omni-notify-mcp 1.3.490 → 1.3.492

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.
@@ -385,6 +385,8 @@ class TranscriptTail {
385
385
  file;
386
386
  offset = 0;
387
387
  rest = "";
388
+ /** When the turn began: a transcript found only after it began — a resumed or forked session's file is written whole, history first — is read from its start, so only an entry stamped from this time on is this turn's (#4927). */
389
+ since = Date.now();
388
390
  timer;
389
391
  /** Why the transcript could not be read on the last tick, named once until a read succeeds again. */
390
392
  unread;
@@ -470,7 +472,7 @@ class TranscriptTail {
470
472
  this.log(`transcript ${this.sessionId}: a line is not JSON (${err.message}) — it is left out of the chat's preview`);
471
473
  return;
472
474
  }
473
- if (!Array.isArray(entry.message?.content))
475
+ if (!Array.isArray(entry.message?.content) || typeof entry.timestamp !== "string" || Date.parse(entry.timestamp) < this.since)
474
476
  return;
475
477
  for (const block of entry.message.content) {
476
478
  if (entry.type === "assistant" && block.type === "text" && typeof block.text === "string")
@@ -498,8 +500,7 @@ export function streamedChat(messenger, log) {
498
500
  return {
499
501
  say: async (text) => { await messenger.send(text); },
500
502
  turn(turn) {
501
- const chat = turn.parallel === true ? messenger.alongside() : messenger;
502
- const reply = new StreamedReply(chat, log);
503
+ const reply = new StreamedReply(messenger, log);
503
504
  let tail;
504
505
  const ended = () => {
505
506
  // NULL-OK: field tail is OPTIONAL and therefore it is ok to check for NULL
@@ -555,7 +556,7 @@ export function streamedChat(messenger, log) {
555
556
  case "restored":
556
557
  return;
557
558
  default:
558
- await chat.send(event.text);
559
+ await messenger.send(event.text);
559
560
  return;
560
561
  }
561
562
  },
package/dist/daemon.js CHANGED
@@ -9,7 +9,7 @@
9
9
  * inbox files under the config dir: nothing is held only in its memory, so a restart of this process loses no message.
10
10
  */
11
11
  import { spawn } from "child_process";
12
- import { existsSync, readFileSync, mkdirSync } from "fs";
12
+ import { createWriteStream, existsSync, readFileSync, mkdirSync, renameSync } from "fs";
13
13
  import { join } from "path";
14
14
  import { fileURLToPath } from "url";
15
15
  import { DAEMON_BEAT_PATH, CONFIG_DIR, DAEMON_TAG, PACKAGE_VERSION, startNotifyServer, takePendingInbox, writeRecordFile, yieldGateway } from "./notify.js";
@@ -84,10 +84,46 @@ if (stoppedByHand()) {
84
84
  console.log("[BOOT] BullseyeNotify daemon — a Stop was pressed on this machine; nothing started, and nothing beats until Start is pressed in the panel or the machine reboots.");
85
85
  process.exit(0);
86
86
  }
87
+ /** Where this daemon's console goes as well as to its own (#4927): every owner starts it with no console kept, so its output is otherwise lost. Each run begins the file and moves the run before it to the previous file, which that run, a build handing over, goes on writing — so the hand-over and the crash before a start both read whole. */
88
+ const LOG_FILE = join(CONFIG_DIR, "bn-daemon.log");
89
+ const PREVIOUS_LOG_FILE = join(CONFIG_DIR, "bn-daemon.previous.log");
90
+ function keepConsole() {
91
+ mkdirSync(CONFIG_DIR, { recursive: true });
92
+ try {
93
+ if (existsSync(LOG_FILE))
94
+ renameSync(LOG_FILE, PREVIOUS_LOG_FILE);
95
+ }
96
+ catch (err) {
97
+ if (!(err instanceof Error) || !("code" in err))
98
+ throw err;
99
+ // OWNER: the console copy is for reading afterwards — a previous file the disk will not move (locked, denied) leaves the daemon without a copy this run, named once, and it serves on.
100
+ process.stderr.write(`[BOOT] no console copy this run: ${LOG_FILE} could not be moved aside — ${err.message}
101
+ `);
102
+ return;
103
+ }
104
+ const file = createWriteStream(LOG_FILE, { flags: "w" });
105
+ let kept = true;
106
+ // OWNER: the daemon's console is a copy for reading afterwards — a file the disk refuses (full, locked, denied) ends the copy, named once on the console itself, and the daemon serves on.
107
+ file.on("error", (err) => {
108
+ kept = false;
109
+ process.stderr.write(`[BOOT] the console copy in ${LOG_FILE} stopped — ${err.message}
110
+ `);
111
+ });
112
+ for (const stream of [process.stdout, process.stderr]) {
113
+ const write = stream.write.bind(stream);
114
+ stream.write = ((chunk, ...rest) => {
115
+ if (kept)
116
+ file.write(chunk);
117
+ return write(chunk, ...rest);
118
+ });
119
+ }
120
+ console.log(`[BOOT] BullseyeNotify daemon pid ${process.pid} v${PACKAGE_VERSION} at ${new Date().toISOString()} — console kept in ${LOG_FILE}`);
121
+ }
87
122
  // The shared hand-over (src/shared/webhost/originHandover.js ensureResidentDoor) puts a later release on the chat door: the new build is started with --takeover over an IPC channel, says it waits, and binds once this build lets the door go.
88
123
  const takeover = process.argv.includes("--takeover");
89
124
  /** Whether this process writes the heartbeat: the next release only from the moment it holds the chat door, so a takeover that never lands leaves the serving build's beat alone; and a build that let the door go no longer, so the release that took it is the one beat. */
90
125
  let beating = !takeover;
126
+ keepConsole();
91
127
  // The server's own timers are unref'd, so this beat and the door hold the process until it is stopped.
92
128
  if (beating)
93
129
  beat();
@@ -104,6 +140,8 @@ let handedOver;
104
140
  const tunnel = new TunnelRunner();
105
141
  const daemonHost = {
106
142
  clientId: DAEMON_TAG, tag: DAEMON_TAG,
143
+ bindDoor: async (settings) => (await import("./gateway/restDoor.js")).startRestDoor(settings),
144
+ findOtherOwner: async (port) => (await import("./gateway/lanProbe.js")).findOtherBn(port),
107
145
  onDoorOwned: (port) => {
108
146
  // #4231 — BN holds no agent CLI: the cluster keeps every chat CLI and its background subagents (#4814), so a BN release never waits on one.
109
147
  tunnel.beat(port, undefined);
@@ -13,7 +13,7 @@
13
13
  */
14
14
  import { spawn } from "child_process";
15
15
  import { createHash } from "crypto";
16
- import { existsSync } from "fs";
16
+ import { existsSync, readFileSync, renameSync, writeFileSync } from "fs";
17
17
  import { createRequire } from "module";
18
18
  import { isAbsolute, join, relative } from "path";
19
19
  import { createServer, request as httpRequest } from "http";
@@ -39,7 +39,7 @@ const CLUSTER_ROUTE = /^\/v1\/(?:(?:conversations|terminals)(?:\/.*)?|projects|p
39
39
  /** The header a caller names its workspace in (#4120). */
40
40
  const SCOPE_HEADER = "x-bullseye-project";
41
41
  /** The caller's headers AB is handed as they came (#4231 wire); the credential is replaced by the gateway bearer. */
42
- const PASSED_HEADERS = [SCOPE_HEADER, "x-request-id", "content-type", "content-length", "accept", "mcp-protocol-version"];
42
+ const PASSED_HEADERS = [SCOPE_HEADER, "x-bn-opened-by", "x-request-id", "content-type", "content-length", "accept", "mcp-protocol-version"];
43
43
  /** The headers of one hop, which this door's own connection sets for itself. */
44
44
  const HOP_HEADERS = new Set(["connection", "keep-alive", "transfer-encoding"]);
45
45
  const PLATFORMS = new Set(["telegram", "slack", "discord", "teams", "ntfy", "sms", "email"]);
@@ -178,24 +178,47 @@ function stagedLifecycle() {
178
178
  throw new GatewayError(503, `BN's lifecycle is not staged at ${file} — the extension stages it at activation, so a build that never activated has none`);
179
179
  return file;
180
180
  }
181
- /** The press itself, run in a process of its own: the row's own act, whose outcome is read afterwards with act=state. */
182
- const LIFECYCLE_ACTOR = "require(process.argv[1]).row().act(process.argv[2]).then(() => process.exit(0), () => process.exit(1))";
181
+ /** Where the last Start, Stop or Restart press writes what became of it (#4927): pressed, then its outcome in the row's own words, so act=state answers a press that did nothing with its reason. */
182
+ const LIFECYCLE_PRESS_FILE = join(CONFIG_DIR, "lifecycle-press.json");
183
+ /** The press itself, run in a process of its own: the row's own act, its outcome — done, refused or failed, with the row's words — written to the press file for act=state to read. */
184
+ const LIFECYCLE_ACTOR = `const fs = require("fs"); const [file, press, record, pressedAt] = process.argv.slice(1);
185
+ const write = (outcome) => { fs.writeFileSync(record + ".tmp", JSON.stringify({ press, pressedAt: Number(pressedAt), endedAt: Date.now(), ...outcome })); fs.renameSync(record + ".tmp", record); };
186
+ require(file).row().act(press).then((o) => write({ ok: o.ok, said: o.text }), (e) => write({ ok: false, said: String((e && e.message) || e) })).then(() => process.exit(0), () => process.exit(1));`;
183
187
  /** A launcher that starts the actor detached and exits at once, so no live parent links the actor to this daemon: the Stop inside a Restart ends this daemon's whole process tree, and an actor still in it would die before it started BN again. */
184
188
  const LIFECYCLE_LAUNCHER = `require("child_process").spawn(process.execPath, ["-e", ${JSON.stringify(LIFECYCLE_ACTOR)}, ...process.argv.slice(1)], { detached: true, stdio: "ignore", windowsHide: true }).unref()`;
185
189
  /** Start, Stop and Restart end or replace the process answering this very call, so they run in a process that outlives it; the outcome is read afterwards with act=state. */
186
190
  function pressLifecycle(file, press) {
187
191
  return new Promise((resolve, reject) => {
188
- const launcher = spawn(process.execPath, ["-e", LIFECYCLE_LAUNCHER, file, press], { stdio: "ignore", windowsHide: true });
189
- launcher.once("error", (err) => reject(new GatewayError(500, `the ${press} could not be launched — ${err.message}`)));
190
- launcher.once("exit", (code) => (code === 0 ? resolve({ pressed: press, running: true, next: "read the outcome with bn_lifecycle act=state" }) : reject(new GatewayError(500, `the ${press} could not be launched — its launcher exited ${code}`))));
192
+ const pressedAt = Date.now();
193
+ writePress({ press, pressedAt });
194
+ const unlaunched = (said) => {
195
+ writePress({ press, pressedAt, endedAt: Date.now(), ok: false, said });
196
+ reject(new GatewayError(500, said));
197
+ };
198
+ const launcher = spawn(process.execPath, ["-e", LIFECYCLE_LAUNCHER, file, press, LIFECYCLE_PRESS_FILE, String(pressedAt)], { stdio: "ignore", windowsHide: true });
199
+ launcher.once("error", (err) => unlaunched(`the ${press} could not be launched — ${err.message}`));
200
+ launcher.once("exit", (code) => (code === 0 ? resolve({ pressed: press, running: true, next: "read the outcome with bn_lifecycle act=state: its lastPress says done, or not done with the reason" }) : unlaunched(`the ${press} could not be launched — its launcher exited ${code}`)));
191
201
  });
192
202
  }
193
- /** `POST /v1/lifecycle {act}`, what AB's bn_lifecycle tool runs: act=state reads the measured state; start, stop and restart are pressed in a process that outlives this call. */
203
+ /** The press file written whole: staged beside it and renamed over it, so act=state never reads half of it. */
204
+ function writePress(press) {
205
+ writeFileSync(`${LIFECYCLE_PRESS_FILE}.tmp`, JSON.stringify(press));
206
+ renameSync(`${LIFECYCLE_PRESS_FILE}.tmp`, LIFECYCLE_PRESS_FILE);
207
+ }
208
+ /** The last press and what became of it, from the press file: still running while it holds no outcome; none before the first press on this machine. */
209
+ function lastPress() {
210
+ // NULL-OK: field lifecycle-press.json is OPTIONAL and therefore it is ok to check for NULL
211
+ if (!existsSync(LIFECYCLE_PRESS_FILE))
212
+ return undefined;
213
+ const press = JSON.parse(readFileSync(LIFECYCLE_PRESS_FILE, "utf8"));
214
+ return { ...press, outcome: press.ok === undefined ? "running" : press.ok ? "done" : "not done" };
215
+ }
216
+ /** `POST /v1/lifecycle {act}`, what AB's bn_lifecycle tool runs: act=state reads the measured state with the last press and its outcome; start, stop and restart are pressed in a process that outlives this call. */
194
217
  async function lifecycle(act) {
195
218
  if (typeof act !== "string" || !LIFECYCLE_PRESSES.has(act))
196
219
  throw new GatewayError(400, "act must be state, start, stop or restart");
197
220
  const file = stagedLifecycle();
198
- return act === "state" ? createRequire(file)(file).row().state() : pressLifecycle(file, act);
221
+ return act === "state" ? { ...(await createRequire(file)(file).row().state()), lastPress: lastPress() } : pressLifecycle(file, act);
199
222
  }
200
223
  /** `POST /v1/chat/reply`: one part of a chat turn AB carries back, sent on to its thread — `{replyId, platform, conversation, part, final}` — or AB's release of a settled turn's held reply, `{replyId, release: true}`. */
201
224
  async function chatReply(body) {
@@ -219,13 +242,13 @@ async function chatReply(body) {
219
242
  await AgentGateway.instance().carry(replyId, platform, conversation, part, final);
220
243
  return {};
221
244
  }
222
- /** The relayed turn as the wire names it, `{id, n, queued, parallel?, provider, sessionId}`; anything else is AB's request gone wrong, refused 400. */
245
+ /** The relayed turn as the wire names it, `{id, n, queued, provider, sessionId}`; anything else is AB's request gone wrong, refused 400. */
223
246
  function streamedTurnOf(turn) {
224
247
  const t = turn;
225
- if (t === null || typeof t !== "object" || typeof t.id !== "string" || !Number.isInteger(t.n) || typeof t.queued !== "boolean" || (t.parallel !== undefined && typeof t.parallel !== "boolean") || typeof t.provider !== "string" || typeof t.sessionId !== "string") {
226
- throw new GatewayError(400, "turn must be {id, n, queued, parallel?, provider, sessionId}: the conversation, its user event, whether it waits behind another, whether it runs beside the busy main conversation, and its CLI and session");
248
+ if (t === null || typeof t !== "object" || typeof t.id !== "string" || !Number.isInteger(t.n) || typeof t.queued !== "boolean" || typeof t.provider !== "string" || typeof t.sessionId !== "string") {
249
+ throw new GatewayError(400, "turn must be {id, n, queued, provider, sessionId}: the conversation, its user event, whether it waits behind another, and its CLI and session");
227
250
  }
228
- return { id: t.id, n: t.n, queued: t.queued, parallel: t.parallel === true, provider: t.provider, sessionId: t.sessionId };
251
+ return { id: t.id, n: t.n, queued: t.queued, provider: t.provider, sessionId: t.sessionId };
229
252
  }
230
253
  /** `POST /v1/chat/relay {replyId, turn, event?, close?}` (#4453): one event of a streamed turn AB relays whole to the chat its message is held with, or that turn's close. */
231
254
  async function chatRelay(body) {
@@ -218,6 +218,12 @@ function headersOf(headers) {
218
218
  headers.forEach((value, name) => { all.push(`${name}: ${value}`); });
219
219
  return all.join("; ");
220
220
  }
221
+ /** A send that went unanswered within its time-out: Telegram may have shown it, so it is never sent a second time (#4927). */
222
+ export class TelegramSendUnconfirmed extends Error {
223
+ constructor(method, timeoutMs) {
224
+ super(`Telegram did not answer ${method} within ${timeoutMs} ms — it may have been shown, so it is not sent again`);
225
+ }
226
+ }
221
227
  /** An answer the Bot API documents no meaning for: carried whole so it can be read, never retried. */
222
228
  export class TelegramUnknown extends Error {
223
229
  constructor(method, status, body, headers) {
@@ -228,7 +234,7 @@ const DOCUMENTED_REFUSALS = new Set([400, 401, 403, 404, 409]);
228
234
  // GATE: tries of one Bot API call before a network failure, a 5xx or a 429 is given up as unreachable — each wait doubles from 1 s, a 429 waits the retry_after Telegram names.
229
235
  const TELEGRAM_TRIES = 4;
230
236
  const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
231
- /** One Bot API call — a JSON POST, or a GET of `url` as it is when there is no body: retried on a network failure, a 5xx or a 429 (after its retry_after), refused on a documented 4xx, thrown whole on anything else. */
237
+ /** One Bot API call — a JSON POST, or a GET of `url` as it is when there is no body: retried on a network failure, a 5xx or a 429 (after its retry_after), refused on a documented 4xx, thrown whole on anything else. A send that timed out is never sent again: Telegram may already have shown it, and a second copy is the repeated reply (#4927), so it throws TelegramSendUnconfirmed for the sender to name once and take as sent. */
232
238
  export async function telegramCall(url, method, body, tries = TELEGRAM_TRIES, timeoutMs = 15_000) {
233
239
  for (let attempt = 1;; attempt++) {
234
240
  const last = attempt >= tries;
@@ -240,6 +246,8 @@ export async function telegramCall(url, method, body, tries = TELEGRAM_TRIES, ti
240
246
  catch (err) {
241
247
  if (!(err instanceof TypeError) && !(err instanceof DOMException))
242
248
  throw err;
249
+ if (body !== undefined && method.startsWith("send") && err.name === "TimeoutError")
250
+ throw new TelegramSendUnconfirmed(method, timeoutMs);
243
251
  if (last)
244
252
  throw new TelegramUnreachable(`Telegram could not be reached for ${method} after ${attempt} tries: ${err.message}`);
245
253
  await sleep(1000 * 2 ** (attempt - 1));
@@ -341,6 +349,18 @@ export class TelegramMessenger {
341
349
  }
342
350
  /** Sends `text` in the chosen formatting; a formatting Telegram cannot parse is sent again once as plain text, and said. */
343
351
  async formatted(method, payload, text) {
352
+ try {
353
+ return await this.formattedOnce(method, payload, text);
354
+ }
355
+ catch (err) {
356
+ if (!(err instanceof TelegramSendUnconfirmed))
357
+ throw err;
358
+ // OWNER: a send Telegram may already have shown is never sent twice — the repeated reply (#4927) — so it is named once on the daemon's console with its chat and taken as sent.
359
+ this.log(`${method} to ${this.chatId} UNCONFIRMED — ${err.message}`);
360
+ return undefined;
361
+ }
362
+ }
363
+ async formattedOnce(method, payload, text) {
344
364
  if (!this.switchedOn())
345
365
  throw new ChannelOff("Telegram");
346
366
  const mode = this.mode();
package/dist/notify.js CHANGED
@@ -3891,10 +3891,10 @@ function listenBare(port) {
3891
3891
  bare.listen(port, "127.0.0.1", () => resolve(bare));
3892
3892
  });
3893
3893
  }
3894
- async function bindGatewayPort() {
3894
+ async function bindGatewayPort(host) {
3895
3895
  const settings = readGatewaySettings();
3896
3896
  if (settings)
3897
- return (await import("./gateway/restDoor.js")).startRestDoor(settings);
3897
+ return host.bindDoor(settings);
3898
3898
  for (let attempt = 0;; attempt++) {
3899
3899
  try {
3900
3900
  return await listenBare(ownershipPortWithoutDoor(attempt));
@@ -3983,10 +3983,9 @@ function tryOwnGateway(polling, host) {
3983
3983
  ownershipAttempting = true;
3984
3984
  (async () => {
3985
3985
  const port = settings?.port ?? DEFAULT_GATEWAY_PORT;
3986
- const { findOtherBn } = await import("./gateway/lanProbe.js");
3987
3986
  let other;
3988
3987
  try {
3989
- other = await findOtherBn(port);
3988
+ other = await host.findOtherOwner(port);
3990
3989
  }
3991
3990
  catch (err) {
3992
3991
  // OWNER: the probe failed for a reason that is neither "refused" nor "silent" (an unreadable ssh config, say); it is logged as that and the process stays dormant until the next tick reads again.
@@ -4003,7 +4002,7 @@ function tryOwnGateway(polling, host) {
4003
4002
  return;
4004
4003
  }
4005
4004
  lastOtherBn = "";
4006
- door = await bindGatewayPort();
4005
+ door = await bindGatewayPort(host);
4007
4006
  door.on("connection", (socket) => { doorConnections.add(socket); socket.once("close", () => doorConnections.delete(socket)); });
4008
4007
  const owned = readGatewaySettings();
4009
4008
  if (owned)
@@ -6,7 +6,7 @@ const os = require("os");
6
6
  const path = require("path");
7
7
  const zlib = require("zlib");
8
8
  const { CONNECTION_SOURCE, SHIM_SOURCE, NATIVE_PICKER_SOURCE } = require("./webviewShim");
9
- const { workspacesHere } = require("./workspaceList");
9
+ const { workspacesHere, byWorkspaceOrder } = require("./workspaceList");
10
10
  const WS_GUID = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
11
11
  const TOKEN_PARAMETER = "bullseye-token";
12
12
  const PHONE_VIEWPORT = `<meta name="viewport" content="width=device-width, initial-scale=1">`;
@@ -353,7 +353,7 @@ class MirroredWebview {
353
353
  workspaceReading() {
354
354
  // NULL-OK: field workspace.workspaces is OPTIONAL and therefore it is ok to check for NULL
355
355
  const listed = this.workspace.workspaces === undefined ? this.page.host.workspaces() : this.workspace.workspaces();
356
- const workspaces = Object.fromEntries([...listed].sort(([a], [b]) => a.localeCompare(b)));
356
+ const workspaces = Object.fromEntries([...listed].sort(([a], [b]) => byWorkspaceOrder(a, b)));
357
357
  const wanted = new URLSearchParams(this.workspace.read());
358
358
  wanted.sort();
359
359
  const selected = Object.entries(workspaces).find(([, pages]) => {
@@ -918,7 +918,7 @@ class WebHost {
918
918
  let workspaces;
919
919
  let current;
920
920
  try {
921
- workspaces = Object.fromEntries([...this.workspaces(base)].sort(([a], [b]) => a.localeCompare(b)));
921
+ workspaces = Object.fromEntries([...this.workspaces(base)].sort(([a], [b]) => byWorkspaceOrder(a, b)));
922
922
  // NULL-OK: field at is OPTIONAL and therefore it is ok to check for NULL
923
923
  current = this.currentOf(new URLSearchParams(url.searchParams.get("at") ?? ""));
924
924
  }
@@ -1260,32 +1260,32 @@ function indexPage(host, base) {
1260
1260
  const rows = [...host.pages.values()]
1261
1261
  .map((page) => `<li><a href="${escapeAttribute(base === undefined ? page.url : `${base}/${encodeURIComponent(page.name)}/${page.search}`)}">${page.live ? "🟢" : "⚪"} ${escapeAttribute(page.title)}</a></li>`)
1262
1262
  .join("");
1263
- return `<!DOCTYPE html><html><head><meta charset="utf-8">${PHONE_VIEWPORT}<title>${escapeAttribute(host.extension)}</title></head>
1263
+ return `<!DOCTYPE html><html><head><meta charset="utf-8">${PHONE_VIEWPORT}<title>${escapeAttribute(host.extension)}</title></head>
1264
1264
  <body style="font:14px system-ui,sans-serif;padding:24px;background:#1e1e1e;color:#ccc"><div>${escapeAttribute(host.extension)} · ${escapeAttribute(host.label)}</div><ul>${rows}</ul></body></html>`;
1265
1265
  }
1266
1266
  function closedPage(extension, page) {
1267
- return `<!DOCTYPE html><html><head><meta charset="utf-8">${PHONE_VIEWPORT}<title>${escapeAttribute(extension)} · ${escapeAttribute(page.title)}</title></head>
1268
- <body style="font:14px system-ui,sans-serif;padding:24px;background:#1e1e1e;color:#ccc">⚪ ${escapeAttribute(page.title)} is not open in VS Code right now, so there is nothing to show here — this page loads it the moment it opens.<div id="said" style="margin-top:8px"></div>
1269
- <script>${CONNECTION_SOURCE}</script><script>(function () {
1270
- var WHAT = "this page's live connection to its host";
1271
- var kept = window.bullseyeConnection.keep({
1272
- what: WHAT, path: "/__bullseye/health",
1273
- open: function () { return new WebSocket((location.protocol === "https:" ? "wss:" : "ws:") + "//" + location.host + "/__bullseye/ws?page=${encodeURIComponent(page.name)}"); },
1274
- attach: function (connect, later) {
1275
- fetch("/__bullseye/health", { cache: "no-store", signal: AbortSignal.timeout(8000) }).then(function (r) {
1276
- if (r.ok) connect(); else if (r.status === 401) window.bullseyeConnection.signInAgain(); else later();
1277
- }, later);
1278
- },
1279
- opened: function () {
1280
- document.getElementById("said").textContent = "";
1281
- fetch("/__bullseye/health", { cache: "no-store" }).then(function (r) { return r.json(); }).then(function (health) { if (health.pages[${JSON.stringify(page.name)}].live) location.reload(); }, function (error) { console.warn("[Bullseye connection] Page availability unread: " + error.message); });
1282
- },
1283
- message: function (socket, event) { if (JSON.parse(String(event.data)).type === "reload") location.reload(); },
1284
- down: function () { document.getElementById("said").textContent = "⏳ Reconnecting"; },
1285
- closed: function () { return false; },
1286
- ping: function (socket) { socket.send('{"type":"ping"}'); }
1287
- });
1288
- kept.connect();
1267
+ return `<!DOCTYPE html><html><head><meta charset="utf-8">${PHONE_VIEWPORT}<title>${escapeAttribute(extension)} · ${escapeAttribute(page.title)}</title></head>
1268
+ <body style="font:14px system-ui,sans-serif;padding:24px;background:#1e1e1e;color:#ccc">⚪ ${escapeAttribute(page.title)} is not open in VS Code right now, so there is nothing to show here — this page loads it the moment it opens.<div id="said" style="margin-top:8px"></div>
1269
+ <script>${CONNECTION_SOURCE}</script><script>(function () {
1270
+ var WHAT = "this page's live connection to its host";
1271
+ var kept = window.bullseyeConnection.keep({
1272
+ what: WHAT, path: "/__bullseye/health",
1273
+ open: function () { return new WebSocket((location.protocol === "https:" ? "wss:" : "ws:") + "//" + location.host + "/__bullseye/ws?page=${encodeURIComponent(page.name)}"); },
1274
+ attach: function (connect, later) {
1275
+ fetch("/__bullseye/health", { cache: "no-store", signal: AbortSignal.timeout(8000) }).then(function (r) {
1276
+ if (r.ok) connect(); else if (r.status === 401) window.bullseyeConnection.signInAgain(); else later();
1277
+ }, later);
1278
+ },
1279
+ opened: function () {
1280
+ document.getElementById("said").textContent = "";
1281
+ fetch("/__bullseye/health", { cache: "no-store" }).then(function (r) { return r.json(); }).then(function (health) { if (health.pages[${JSON.stringify(page.name)}].live) location.reload(); }, function (error) { console.warn("[Bullseye connection] Page availability unread: " + error.message); });
1282
+ },
1283
+ message: function (socket, event) { if (JSON.parse(String(event.data)).type === "reload") location.reload(); },
1284
+ down: function () { document.getElementById("said").textContent = "⏳ Reconnecting"; },
1285
+ closed: function () { return false; },
1286
+ ping: function (socket) { socket.send('{"type":"ping"}'); }
1287
+ });
1288
+ kept.connect();
1289
1289
  })();</script></body></html>`;
1290
1290
  }
1291
1291
  function codeDefect(err) {
@@ -135,9 +135,22 @@ function readListed(file) {
135
135
  return { label: present ? labelOf(root) : path.basename(root), root, path: entry.path, present };
136
136
  });
137
137
  }
138
- /** @returns {{ label: string, root: string }[]} The named workspaces available on this machine. */
138
+ /** #4934 — the order every workspace picker lists: All first, then AlphaWave, then BullseyeVSC, any other workspace by name, and BullseyeShared last. */
139
+ function workspaceRank(label) {
140
+ if (label.startsWith("🌐"))
141
+ return 0;
142
+ if (label.startsWith("AlphaWave"))
143
+ return 1;
144
+ if (label.startsWith("BullseyeVSC"))
145
+ return 2;
146
+ return label.startsWith("BullseyeShared") ? 4 : 3;
147
+ }
148
+ function byWorkspaceOrder(a, b) {
149
+ return workspaceRank(a) - workspaceRank(b) || a.localeCompare(b);
150
+ }
151
+ /** @returns {{ label: string, root: string }[]} The named workspaces available on this machine, in the order every picker and the All view list them. */
139
152
  function workspacesHere() {
140
- return listedWorkspaces().filter((w) => w.present).map(({ label, root }) => ({ label, root }));
153
+ return listedWorkspaces().filter((w) => w.present).map(({ label, root }) => ({ label, root })).sort((a, b) => byWorkspaceOrder(a.label, b.label));
141
154
  }
142
155
  /** The list a Save is made from, as its bytes on disk: their sha256, or "undefined" when no list is defined. A file that is there but cannot be read THROWS, so no Save can be made from it unseen. */
143
156
  function listBase() {
@@ -835,4 +848,4 @@ function setRemoteHost(typed, enabled) {
835
848
  delete workspaceTurn().remoteHostChoices;
836
849
  return name;
837
850
  }
838
- module.exports = { vscRoot, workspacesFile, publishWorkspaces, WorkspacesUndefined, listedWorkspaces, workspacesHere, listBase, saveWorkspaces, sameRoot, SettingsUndefined, SettingsMoved, SettingsLocked, WorkspaceNotListed, settingsFile, readSettings, savedSettings, AutoStartUnread, savedAutoStart, writeAutoStart, autoStartOnAt, autoStartOff, toolHome, settingsBase, writeSettings, setSettings, publishSettings, alive, sshHostAliases, remoteHostsFile, remoteHostChoices, remoteHosts, setRemoteHost };
851
+ module.exports = { byWorkspaceOrder, vscRoot, workspacesFile, publishWorkspaces, WorkspacesUndefined, listedWorkspaces, workspacesHere, listBase, saveWorkspaces, sameRoot, SettingsUndefined, SettingsMoved, SettingsLocked, WorkspaceNotListed, settingsFile, readSettings, savedSettings, AutoStartUnread, savedAutoStart, writeAutoStart, autoStartOnAt, autoStartOff, toolHome, settingsBase, writeSettings, setSettings, publishSettings, alive, sshHostAliases, remoteHostsFile, remoteHostChoices, remoteHosts, setRemoteHost };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omni-notify-mcp",
3
- "version": "1.3.490",
3
+ "version": "1.3.492",
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",