omni-notify-mcp 1.3.432 → 1.3.434

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/mcpHosts.cjs CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  const fs = require("fs");
4
4
  const path = require("path");
5
+ const { threadId } = require("worker_threads");
5
6
 
6
7
  class FileMoved extends Error {}
7
8
 
@@ -10,7 +11,7 @@ function contentOf(file) {
10
11
  }
11
12
 
12
13
  function atomicWrite(file, text, read) {
13
- const staged = `${file}.${process.pid}.tmp`;
14
+ const staged = `${file}.${process.pid}-${threadId}.tmp`;
14
15
  fs.writeFileSync(staged, text, "utf8");
15
16
  if (contentOf(file) !== read) {
16
17
  fs.rmSync(staged, { force: true });
@@ -247,6 +248,7 @@ function createHostWriters(env) {
247
248
  }
248
249
  if (!root.projects || typeof root.projects !== "object" || Array.isArray(root.projects)) root.projects = {};
249
250
  const sameKey = (x, y) => shapeOf(x) === shapeOf(y);
251
+ const asCompared = (entry) => entry && JSON.stringify({ ...entry, headers: { ...entry.headers, "x-bullseye-project": shapeOf(String((entry.headers || {})["x-bullseye-project"] || "")) } });
250
252
  let changed = false;
251
253
  for (const folder of folders) {
252
254
  // Claude Code keeps a folder under each spelling of its drive letter as separate projects, so every spelling that exists carries the entry.
@@ -255,7 +257,7 @@ function createHostWriters(env) {
255
257
  const project = root.projects[key] || (root.projects[key] = {});
256
258
  if (!project.mcpServers || typeof project.mcpServers !== "object" || Array.isArray(project.mcpServers)) project.mcpServers = {};
257
259
  const wanted = { type: "http", url, headers: { Authorization: `Bearer ${gateway.token}`, "x-bullseye-project": folder } };
258
- if (JSON.stringify(project.mcpServers.bn) === JSON.stringify(wanted)) continue;
260
+ if (asCompared(project.mcpServers.bn) === asCompared(wanted)) continue;
259
261
  project.mcpServers.bn = wanted;
260
262
  changed = true;
261
263
  }
@@ -1361,12 +1361,13 @@ const TABLE_END = "\u0004END";
1361
1361
  * times, working set and start from its own handle, and its command line once per process start. A process this user
1362
1362
  * cannot open (System, a protected service) is listed with its parent and zeros.
1363
1363
  */
1364
- const WINDOWS_TABLE_SCRIPT = `$ErrorActionPreference = 'Stop'
1364
+ const windowsTableScript = (ownerPid) => `$ErrorActionPreference = 'Stop'
1365
1365
  Add-Type -TypeDefinition @'
1366
1366
  using System;
1367
1367
  using System.Collections.Generic;
1368
1368
  using System.Runtime.InteropServices;
1369
1369
  using System.Text;
1370
+ using System.Threading;
1370
1371
  public static class AgentSessionProcessTable {
1371
1372
  [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
1372
1373
  struct Entry { public uint size, usage, pid; public IntPtr heap; public uint module, threads, ppid; public int priority; public uint flags; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)] public string exe; }
@@ -1377,6 +1378,14 @@ public static class AgentSessionProcessTable {
1377
1378
  [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] static extern bool Process32NextW(IntPtr snap, ref Entry entry);
1378
1379
  [DllImport("kernel32.dll")] static extern IntPtr OpenProcess(uint access, bool inherit, uint pid);
1379
1380
  [DllImport("kernel32.dll")] static extern bool CloseHandle(IntPtr handle);
1381
+ [DllImport("kernel32.dll")] static extern uint WaitForSingleObject(IntPtr handle, uint ms);
1382
+ public static void EndWithOwner(uint pid) {
1383
+ IntPtr owner = OpenProcess(0x00100000, false, pid);
1384
+ if (owner == IntPtr.Zero) Environment.Exit(0);
1385
+ var watch = new Thread(() => { WaitForSingleObject(owner, 0xFFFFFFFF); Environment.Exit(0); });
1386
+ watch.IsBackground = true;
1387
+ watch.Start();
1388
+ }
1380
1389
  [DllImport("kernel32.dll")] static extern bool GetProcessTimes(IntPtr handle, out long created, out long exited, out long kernel, out long user);
1381
1390
  [DllImport("kernel32.dll")] static extern bool K32GetProcessMemoryInfo(IntPtr handle, out Memory memory, uint cb);
1382
1391
  [DllImport("ntdll.dll")] static extern int NtQueryInformationProcess(IntPtr handle, int infoClass, IntPtr buffer, int length, out int returned);
@@ -1575,6 +1584,7 @@ public static class AgentSessionProcessTable {
1575
1584
  }
1576
1585
  '@
1577
1586
  [Console]::OutputEncoding = New-Object System.Text.UTF8Encoding $false
1587
+ [AgentSessionProcessTable]::EndWithOwner(${ownerPid})
1578
1588
  while ($null -ne ($request = [Console]::In.ReadLine())) {
1579
1589
  if ($request.StartsWith('ports ')) { [Console]::Out.Write([AgentSessionProcessTable]::Listeners($request.Substring(6))) }
1580
1590
  elseif ($request.StartsWith('lanes ')) { [Console]::Out.Write([AgentSessionProcessTable]::Lanes($request.Substring(6))) }
@@ -1601,6 +1611,10 @@ export class ProcessTableUnreadable extends Error {
1601
1611
  function throwProcessRead() {
1602
1612
  throw new ProcessTableUnreadable("the process table could not be read");
1603
1613
  }
1614
+ /** #14288 — the Windows table reader, bound to the process it serves: it ends the moment that process is gone, whoever still holds its input. */
1615
+ export function windowsTableLaunch(ownerPid) {
1616
+ return { file: "powershell", args: ["-NoProfile", "-NonInteractive", "-Command", "Invoke-Expression $env:AGENT_SESSION_WINDOWS_TABLE"], env: { ...process.env, AGENT_SESSION_WINDOWS_TABLE: windowsTableScript(ownerPid) } };
1617
+ }
1604
1618
  export class TableReader {
1605
1619
  launch;
1606
1620
  child;
@@ -1742,7 +1756,7 @@ export class ProcessTable {
1742
1756
  windows;
1743
1757
  msys;
1744
1758
  constructor(gitBash) {
1745
- this.windows = new TableReader(() => ({ file: "powershell", args: ["-NoProfile", "-NonInteractive", "-Command", "Invoke-Expression $env:AGENT_SESSION_WINDOWS_TABLE"], env: { ...process.env, AGENT_SESSION_WINDOWS_TABLE: WINDOWS_TABLE_SCRIPT } }));
1759
+ this.windows = new TableReader(() => windowsTableLaunch(process.pid));
1746
1760
  this.msys = new TableReader(() => ({ file: gitBash(), args: ["-c", 'eval "$AGENT_SESSION_MSYS_TABLE"'], env: { ...process.env, AGENT_SESSION_MSYS_TABLE: MSYS_TABLE_SCRIPT } }));
1747
1761
  }
1748
1762
  dispose() {
@@ -2487,6 +2501,18 @@ export class OpenCodeTurn extends JsonlCliTurn {
2487
2501
  export const STORY_QUEUE_WIRE = 1;
2488
2502
  const PRI_ORDER = ["P0", "P1", "P2", "P3", "P4", "P5"];
2489
2503
  const EFFORT_ORDER = ["XS", "S", "M", "L", "XL"];
2504
+ /** 🔴 #3798 — the request origin a start carries: his press, or the board's own act. */
2505
+ export const originOf = (by) => (by === "press" ? "press" : "auto");
2506
+ /** 🔴 #3798 — who started a request, in FleetView's words on its trace. */
2507
+ const STARTED_LABEL = { press: "his Start press", auto: "AUTO START", rehand: "the board's re-hand of a handed-back row" };
2508
+ /** 🔴 #3798 — the brief's line naming who started the story, never his press for a start he did not make. */
2509
+ export function startedOnLine(storyId, by) {
2510
+ switch (by) {
2511
+ case "press": return `Meni pressed Start on #${storyId} on the BullseyeBacklog board`;
2512
+ case "auto": return `AUTO START on the BullseyeBacklog board started #${storyId} — Meni pressed nothing`;
2513
+ case "rehand": return `The BullseyeBacklog board re-handed #${storyId}, a handed-back row no lane holds — Meni pressed nothing`;
2514
+ }
2515
+ }
2490
2516
  /** 🔴 #4116 — the act a blocked worker waits on, in words. */
2491
2517
  // NULL-OK: field needs is OPTIONAL and therefore it is ok to check for NULL
2492
2518
  export const blockedAct = (worker) => (worker.needs === undefined ? "an act its job record does not name" : worker.needs);
@@ -2687,15 +2713,20 @@ export function submitStory(board, given, now) {
2687
2713
  && !(given.origin === "press" && given.forced === undefined && given.pressedAt !== undefined && given.pressedAt > standing.forced)
2688
2714
  ? { ...kept, forced: standing.forced } : kept;
2689
2715
  // his press stays his only while it is unspent: once FleetView took it, an AUTO START resubmission carries its stamp only until the queue has started or woken the story for it
2690
- const fields = placed.origin !== "press" && standing?.origin === "press" && standing.pressedAt !== undefined && standing.eligible && placed.eligible && pressUnspent(board, standing.storyId)
2716
+ const carried = placed.origin !== "press" && standing?.origin === "press" && standing.pressedAt !== undefined && standing.eligible && placed.eligible && pressUnspent(board, standing.storyId)
2691
2717
  ? { ...placed, origin: "press", pressedAt: standing.pressedAt } : placed;
2718
+ const fields = carried.origin === given.origin ? carried
2719
+ : { ...carried, by: "press", brief: carried.brief.replace(startedOnLine(given.storyId, "auto"), startedOnLine(given.storyId, "press")).replace(startedOnLine(given.storyId, "rehand"), startedOnLine(given.storyId, "press")) };
2692
2720
  const requestId = requestIdOf(fields);
2693
- if (standing !== undefined && ack?.requestId === requestId)
2721
+ const sameWhy = standing?.why === fields.why;
2722
+ if (standing !== undefined && sameWhy && ack?.requestId === requestId)
2694
2723
  return { request: standing, written: false, acked: ack };
2695
- if (standing?.requestId === requestId && now - standing.submittedAt < ACK_LATE_MS)
2724
+ if (standing?.requestId === requestId && sameWhy && now - standing.submittedAt < ACK_LATE_MS)
2696
2725
  return { request: standing, written: false, unackedMs: now - standing.submittedAt };
2697
2726
  const request = { v: STORY_QUEUE_WIRE, requestId, submittedAt: now, ...fields };
2698
2727
  writeWhole(board, requestFile(board, given.storyId), request);
2728
+ if (ack?.requestId === requestId)
2729
+ return { request, written: true, acked: ack };
2699
2730
  return { request, written: true, ...(standing?.requestId === requestId ? { unackedMs: now - standing.submittedAt } : {}) };
2700
2731
  }
2701
2732
  function pressUnspent(board, storyId) {
@@ -2784,10 +2815,11 @@ export function newerVersion(a, b) {
2784
2815
  }
2785
2816
  return false;
2786
2817
  }
2787
- /** 🔴 #4156 — a move named an entry that is no longer in line on the board: withdrawn, finished or failed out between the press and the queue's lock. */
2818
+ /** 🔴 #4156 — a press named a story the line does not hold: one that left it (withdrawn or finished) says so with what it reads, and 🔴 #4522 one the queue never took in says that instead. */
2788
2819
  export class NotInQueue extends Error {
2789
- constructor(board, storyId) {
2790
- super(`#${storyId} is no longer in FleetView's queue on ${board}`);
2820
+ constructor(board, storyId, left) {
2821
+ // NULL-OK: field left is OPTIONAL and therefore it is ok to check for NULL
2822
+ super(left === undefined ? (readableRequestView(board, storyId) === undefined ? `#${storyId} has never been in FleetView's queue on ${board} — BullseyeBacklog has not handed it over` : `#${storyId} is not in FleetView's queue on ${board} yet — BullseyeBacklog's request is in, and the queue takes it in on its next pass`) : `#${storyId} is not waiting in FleetView's queue on ${board} — it is ${left.state}: ${left.why}`);
2791
2823
  this.name = "NotInQueue";
2792
2824
  }
2793
2825
  }
@@ -2982,7 +3014,9 @@ export async function clearStoryQueue(board, since) {
2982
3014
  removed += 1;
2983
3015
  }
2984
3016
  }
2985
- writeStore(board, { ...store, entries: kept });
3017
+ // NULL-OK: field forcesAhead is OPTIONAL and therefore it is ok to check for NULL
3018
+ const ahead = store.forcesAhead === undefined ? {} : { forcesAhead: Object.fromEntries(Object.entries(store.forcesAhead).filter(([, f]) => f.at >= since)) };
3019
+ writeStore(board, { ...store, entries: kept, ...ahead });
2986
3020
  return removed;
2987
3021
  });
2988
3022
  }
@@ -3123,12 +3157,19 @@ function refusalOf(r) {
3123
3157
  const priorAuthorityOf = (e) => Math.max(e?.startPressedAt ?? 0, e?.handStop?.at ?? 0, e?.worker?.startedAt ?? 0, e?.forceStartedAt ?? 0, e?.forceEventAt ?? 0);
3124
3158
  /** One request applied to the store: an entry made, updated, withdrawn or put back in line; answers the refusal when it cannot be queued. */
3125
3159
  function applyRequest(store, r, now) {
3160
+ const ahead = store.forcesAhead?.[String(r.storyId)];
3161
+ // NULL-OK: field ahead is OPTIONAL and therefore it is ok to check for NULL
3162
+ if (ahead !== undefined)
3163
+ delete store.forcesAhead[String(r.storyId)];
3126
3164
  const refused = refusalOf(r);
3127
3165
  if (refused !== undefined)
3128
3166
  return refused;
3129
3167
  let e = store.entries.find((x) => x.storyId === r.storyId);
3130
- if (e?.requestId === r.requestId)
3168
+ if (e?.requestId === r.requestId) {
3169
+ if (!r.eligible && e.state === "withdrawn")
3170
+ e.why = r.why;
3131
3171
  return undefined;
3172
+ }
3132
3173
  const intentAt = r.forced ?? r.pressedAt;
3133
3174
  const priorAuthority = priorAuthorityOf(e);
3134
3175
  const freshForce = r.forced !== undefined && r.forced > priorAuthority;
@@ -3139,7 +3180,7 @@ function applyRequest(store, r, now) {
3139
3180
  return undefined;
3140
3181
  e = { storyId: r.storyId, requestId: r.requestId, startRequestId: r.requestId, ...(intentAt === undefined ? {} : { startPressedAt: intentAt }), seq: store.nextSeq++, state: "queued", attempts: 0, trace: [], ...fields };
3141
3182
  store.entries.push(e);
3142
- step(e, now, "acknowledged", `${r.origin === "press" ? "his Start press" : "AUTO START"} submitted it ${r.pri} ${r.effort} — ${r.why}`);
3183
+ step(e, now, "acknowledged", `${STARTED_LABEL[r.by ?? (r.origin === "press" ? "press" : "auto")]} submitted it ${r.pri} ${r.effort} — ${r.why}`);
3143
3184
  }
3144
3185
  else {
3145
3186
  const before = `${e.pri} ${e.effort}`;
@@ -3220,6 +3261,13 @@ function applyRequest(store, r, now) {
3220
3261
  else
3221
3262
  forceEntry(e, now, HIS_PRESS, r.forced);
3222
3263
  }
3264
+ // NULL-OK: field ahead is OPTIONAL and therefore it is ok to check for NULL
3265
+ if (ahead !== undefined && r.eligible && IN_LINE.has(e.state)) {
3266
+ if (ahead.at <= priorAuthority || e.state === "starting" || e.state === "running" || e.handStop !== undefined)
3267
+ step(e, now, "updated", `${ahead.by} ⚡ Force start, pressed before the board handed it over, had nothing to start — ${e.handStop === undefined ? "a worker took it up since" : `${e.handStop.by} 🛑 Stop holds it until his Start`}`);
3268
+ else
3269
+ forceEntry(e, now, ahead.by, ahead.at);
3270
+ }
3223
3271
  return undefined;
3224
3272
  }
3225
3273
  /** 🔴 #4156 — his ⚡ Force start on an entry in line: it starts on the next pass past a ⏸ Stop; the request that carries it (#4177) and the queue's own ⚡ press both force it here. */
@@ -4609,19 +4657,49 @@ export class StoryPressRefused extends Error {
4609
4657
  this.name = "StoryPressRefused";
4610
4658
  }
4611
4659
  }
4660
+ /** 🔴 #4522 — BullseyeBacklog's standing request for a story the line does not hold, taken in now as the next pass would; a request the queue refuses, or one the board says is not to be started, refuses the press with why. */
4661
+ function takeStandingRequest(board, store, storyId, now) {
4662
+ const r = readableRequest(board, storyId);
4663
+ // NULL-OK: field r is OPTIONAL and therefore it is ok to check for NULL
4664
+ if (r === undefined)
4665
+ return undefined;
4666
+ const refused = applyRequest(store, r, now);
4667
+ // NULL-OK: field refused is OPTIONAL and therefore it is ok to check for NULL
4668
+ if (refused !== undefined)
4669
+ throw new StoryPressRefused(`#${storyId}: FleetView refuses BullseyeBacklog's request for it — ${refused}`);
4670
+ if (!r.eligible)
4671
+ throw new StoryPressRefused(`#${storyId}: BullseyeBacklog's request says it is not to be started — ${r.why}`);
4672
+ return r;
4673
+ }
4674
+ /** 🔴 #4522 — his ⚡ Force start on a story BullseyeBacklog has not handed over yet: kept on the store, so the request that brings it into line takes it in forced. */
4675
+ function forceAhead(board, store, storyId, now, by) {
4676
+ const held = autoStartHeld(board);
4677
+ store.forcesAhead = { ...store.forcesAhead, [String(storyId)]: { at: now, by } };
4678
+ writeStore(board, store);
4679
+ // NULL-OK: field held is OPTIONAL and therefore it is ok to check for NULL
4680
+ return `#${storyId} is not in FleetView's queue yet — BullseyeBacklog has not handed it over; the ⚡ Force start is kept, and the pass that takes the board's request in starts it, past a ⏸ Stop and this workspace's lane limit${held === undefined ? "" : ` (AUTO START is off on this board, so the board hands it over on his ▶️ Start)`}`;
4681
+ }
4612
4682
  /**
4613
4683
  * 🔴 #4156 — HIS PRESS ON ONE STORY OF FLEETVIEW'S QUEUE, under the queue's lock: ✕ Remove takes it out of the line (BullseyeBacklog's
4614
4684
  * next new request puts it back), ↻ Retry puts a failed or retrying story back in line with its attempts reset, ⚡ Force start starts
4615
4685
  * it on the next pass past a ⏸ Stop, and 🔔 Nudge ends the wait it stands on (a retry's backoff, a parked worker's wake delay). A press
4616
4686
  * that does not apply throws
4617
- * {@link StoryPressRefused}; one on a story no longer in line throws {@link NotInQueue}. Answers what it did, in words.
4687
+ * {@link StoryPressRefused}; one on a story not in line throws {@link NotInQueue}, except 🔴 #4522 a ⚡ Force start, which takes in the board's standing request or keeps the force for the request to come. Answers what it did, in words.
4618
4688
  */
4619
4689
  export async function pressStory(board, storyId, press, now, by, requestHandledByOwner = false, ownerAction) {
4620
4690
  return withQueueLock(board, now, async () => {
4621
4691
  const store = readQueueStore(board);
4622
- const e = store.entries.find((x) => x.storyId === storyId && IN_LINE.has(x.state));
4623
- if (e === undefined)
4624
- throw new NotInQueue(board, storyId);
4692
+ const inLine = () => store.entries.find((x) => x.storyId === storyId && IN_LINE.has(x.state));
4693
+ const taken = press === "force" && inLine() === undefined ? takeStandingRequest(board, store, storyId, now) : undefined;
4694
+ const e = inLine();
4695
+ // NULL-OK: field e is OPTIONAL and therefore it is ok to check for NULL
4696
+ if (e === undefined) {
4697
+ const left = store.entries.find((x) => x.storyId === storyId);
4698
+ // NULL-OK: field left is OPTIONAL and therefore it is ok to check for NULL
4699
+ if (press === "force" && left === undefined)
4700
+ return forceAhead(board, store, storyId, now, by);
4701
+ throw new NotInQueue(board, storyId, left);
4702
+ }
4625
4703
  const working = e.state === "starting" || e.state === "running";
4626
4704
  // NULL-OK: field stopped is OPTIONAL and therefore it is ok to check for NULL
4627
4705
  const afterStop = store.stopped === undefined ? "" : " after ▶ Run lifts the queue's ⏸ Stop";
@@ -4659,7 +4737,7 @@ export async function pressStory(board, storyId, press, now, by, requestHandledB
4659
4737
  if (working)
4660
4738
  throw new StoryPressRefused(`#${storyId} already has a worker at work, so there is nothing to force`);
4661
4739
  forceEntry(e, now, by);
4662
- did = `#${storyId} starts on the next pass, past a ⏸ Stop and this workspace's lane limit`;
4740
+ did = `#${storyId} ${taken === undefined ? "" : "was taken into the queue from BullseyeBacklog's request and "}starts on the next pass, past a ⏸ Stop and this workspace's lane limit`;
4663
4741
  }
4664
4742
  else if (press === "stop" || press === "kill") {
4665
4743
  if (e.worker === undefined || !(working || parkedInLine(e) || e.worker.carried !== undefined || ownerAction !== undefined))
@@ -4761,7 +4839,7 @@ export async function placeStory(board, storyId, place, now, by) {
4761
4839
  const store = readQueueStore(board);
4762
4840
  const e = store.entries.find((x) => x.storyId === storyId && IN_LINE.has(x.state));
4763
4841
  if (e === undefined)
4764
- throw new NotInQueue(board, storyId);
4842
+ throw new NotInQueue(board, storyId, store.entries.find((x) => x.storyId === storyId));
4765
4843
  if (place === "auto") {
4766
4844
  delete e.manual;
4767
4845
  delete e.ordered;
@@ -4790,7 +4868,7 @@ export async function placeWaiting(board, now, by, decide, visible) {
4790
4868
  const { next, moved } = decide(waiting);
4791
4869
  for (const id of moved)
4792
4870
  if (!waiting.includes(id))
4793
- throw new NotInQueue(board, id);
4871
+ throw new NotInQueue(board, id, store.entries.find((x) => x.storyId === id));
4794
4872
  if (next.join() === waiting.join())
4795
4873
  return waiting;
4796
4874
  const refill = next.slice();
@@ -13,6 +13,28 @@ const path = require("path");
13
13
  const { spawn, spawnSync } = require("child_process");
14
14
  // GATE: the room, in percent, at or under which the live account's own figure is shown as running low — the same band the room column already paints CRITICAL/LOW; DeepAgent's tick moves nothing at this boundary, the pad's Claude tick moves the live work off it only to a subscription above it, and no move onto or off a key answers to it
15
15
  const WARN_BAND_ROOM_PCT = 25;
16
+ // GATE: the US dollars LEFT on a key under which it reads `low` (little left) and `critical` (nearly gone) — warnings only, nothing moves at either; a dashboard spending limit is invisible to this figure, so the key's own 402 refusal is watched beside it
17
+ const KEY_FUNDS_LOW_USD = 50;
18
+ const KEY_FUNDS_CRITICAL_USD = 10;
19
+ /**
20
+ * The band a key's spendable dollars fall in, on what is LEFT. `go` and `dead` are the two states every caller already
21
+ * reads; `low` and `critical` are the two between them, so a key that has not yet refused anything is warned about
22
+ * before it dies rather than reported dead after the fact.
23
+ * @param {number} dollars @returns {"go" | "low" | "critical" | "dead"}
24
+ */
25
+ function keyFundsBand(dollars) {
26
+ if (!(dollars > 0))
27
+ return "dead";
28
+ if (dollars < KEY_FUNDS_CRITICAL_USD)
29
+ return "critical";
30
+ if (dollars < KEY_FUNDS_LOW_USD)
31
+ return "low";
32
+ return "go";
33
+ }
34
+ /** The two warning bands said in words, as the surface that warns shouts them. @param {"low" | "critical"} band */
35
+ function keyFundsWords(band) {
36
+ return band === "low" ? "little left" : "nearly gone";
37
+ }
16
38
  /**
17
39
  * @typedef {object} AccountState
18
40
  * @property {string} identityId
@@ -773,13 +795,14 @@ function recordRoom(home, providerId, room) {
773
795
  writeAtomically(roomPath(home, providerId), JSON.stringify(room));
774
796
  }
775
797
  /**
776
- * Whether the key carrying the live work has funds, as the room record states it: the balance reading's status word
777
- * (`go` funded, `dead` unfunded) as a boolean, and no field at all when the work is on a subscription or the balance could not be read.
798
+ * Whether the key carrying the live work has funds, as the room record states it: the balance reading's status word as
799
+ * a boolean — every band but `dead` is funded, `low` and `critical` included — and no field at all when the work is on
800
+ * a subscription or the balance could not be read.
778
801
  * @param {string} fundsStatus
779
802
  * @returns {{ liveKeyFunded?: boolean }}
780
803
  */
781
804
  function keyFundsRecord(fundsStatus) {
782
- if (fundsStatus === "go")
805
+ if (fundsStatus === "go" || fundsStatus === "low" || fundsStatus === "critical")
783
806
  return { liveKeyFunded: true };
784
807
  if (fundsStatus === "dead")
785
808
  return { liveKeyFunded: false };
@@ -2104,6 +2127,8 @@ module.exports = {
2104
2127
  OPENCODE_RULES,
2105
2128
  OPENCODE_KEY_REFUSAL_WORDS,
2106
2129
  keyFundsRecord,
2130
+ keyFundsBand,
2131
+ keyFundsWords,
2107
2132
  failbackDue,
2108
2133
  appliedHookWired,
2109
2134
  expectApplied,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omni-notify-mcp",
3
- "version": "1.3.432",
3
+ "version": "1.3.434",
4
4
  "homepage": "https://www.npmjs.com/package/omni-notify-mcp",
5
5
  "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.",
6
6
  "main": "dist/daemon.js",