omni-notify-mcp 1.3.491 → 1.3.493
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/agentGateway.js +1 -1
- package/dist/daemon.js +2 -0
- package/dist/gateway/chatPage.js +1 -1
- package/dist/gateway/gatewayInstall.js +1 -1
- package/dist/gateway/oauthDoor.js +1 -1
- package/dist/gateway/panel.js +2 -1
- package/dist/gateway/panelPage.js +1 -1
- package/dist/gateway/passkeyDoor.js +2 -1
- package/dist/gateway/publicAccess.js +1 -1
- package/dist/gateway/restDoor.js +1 -1
- package/dist/gateway/tunnel.js +1 -1
- package/dist/gatewaySettings.js +68 -0
- package/dist/notify.js +7 -62
- package/dist/shared/webhost/bullseyeWebHost.js +26 -26
- package/dist/shared/webhost/workspaceList.js +16 -3
- package/package.json +1 -1
package/dist/agentGateway.js
CHANGED
|
@@ -14,7 +14,7 @@ import { homedir } from "os";
|
|
|
14
14
|
import { join } from "path";
|
|
15
15
|
import { setTimeout as delay } from "node:timers/promises";
|
|
16
16
|
import { choicesOf, StreamedReply } from "./messaging/messenger.js";
|
|
17
|
-
import { GatewayError, readGatewaySettings } from "./
|
|
17
|
+
import { GatewayError, readGatewaySettings } from "./gatewaySettings.js";
|
|
18
18
|
import { toolLine } from "./shared/toolLine.js";
|
|
19
19
|
export const AGENT_PREFIX = "!";
|
|
20
20
|
/** The key of Meni's direct-message chat with the bot on Slack (#4453): one conversation, as his Telegram chat is; a Slack channel thread keeps its own. */
|
package/dist/daemon.js
CHANGED
|
@@ -140,6 +140,8 @@ let handedOver;
|
|
|
140
140
|
const tunnel = new TunnelRunner();
|
|
141
141
|
const daemonHost = {
|
|
142
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),
|
|
143
145
|
onDoorOwned: (port) => {
|
|
144
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.
|
|
145
147
|
tunnel.beat(port, undefined);
|
package/dist/gateway/chatPage.js
CHANGED
|
@@ -6,7 +6,7 @@ import { homedir } from "os";
|
|
|
6
6
|
import { dirname, join } from "path";
|
|
7
7
|
import { fileURLToPath } from "url";
|
|
8
8
|
import { extensionModule, extensionModulePath } from "./extensionModule.js";
|
|
9
|
-
import { CONFIG_DIR, GatewayError } from "../
|
|
9
|
+
import { CONFIG_DIR, GatewayError } from "../gatewaySettings.js";
|
|
10
10
|
const HERE = dirname(fileURLToPath(import.meta.url));
|
|
11
11
|
const RUNS = join(CONFIG_DIR, "gateway", "installs");
|
|
12
12
|
const RUN_ID = /^[0-9a-f-]{36}$/;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createHash, createHmac, timingSafeEqual } from "crypto";
|
|
2
2
|
import { existsSync, readFileSync, renameSync, writeFileSync } from "fs";
|
|
3
3
|
import { join } from "path";
|
|
4
|
-
import { CONFIG_DIR, GatewayError } from "../
|
|
4
|
+
import { CONFIG_DIR, GatewayError } from "../gatewaySettings.js";
|
|
5
5
|
import { ICON_HEAD, logoUri } from "./iconDoor.js";
|
|
6
6
|
import { HOST_RE, LOOPBACK_HOSTS, PASSKEY_SCRIPT, approvalStands, digest, doorState, escapeHtml, mint, fromThisMachine, sessionApproval, tokenProves, tokenStands } from "./passkeyDoor.js";
|
|
7
7
|
export const MCP_PATH = "/mcp";
|
package/dist/gateway/panel.js
CHANGED
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
import { createHash } from "crypto";
|
|
8
8
|
import { existsSync, mkdirSync, readFileSync } from "fs";
|
|
9
9
|
import { dirname, join } from "path";
|
|
10
|
-
import { CHAT_PROVIDERS,
|
|
10
|
+
import { CHAT_PROVIDERS, deliveryReport, isDndActive } from "../notify.js";
|
|
11
|
+
import { CONFIG_DIR, GatewayError, writeRecordFile } from "../gatewaySettings.js";
|
|
11
12
|
import { clusterCall } from "../agentGateway.js";
|
|
12
13
|
import { MESSENGER_SETUPS } from "../messaging/setup.js";
|
|
13
14
|
import { extensionModule } from "./extensionModule.js";
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* to one (`POST /v1/settings`, `POST /v1/conversation-switch`, `POST /v1/public-access/<step>`). The VS Code panel frames
|
|
5
5
|
* these very pages, so the panel and a browser with every editor closed show the same thing from the same service.
|
|
6
6
|
*/
|
|
7
|
-
import { PACKAGE_HOMEPAGE } from "../
|
|
7
|
+
import { PACKAGE_HOMEPAGE } from "../gatewaySettings.js";
|
|
8
8
|
import { NOTICE_SCRIPT, PAGE_STYLE } from "./chatPage.js";
|
|
9
9
|
import { ICON_HEAD } from "./iconDoor.js";
|
|
10
10
|
import { CONNECTION_SOURCE, PICKER_PAGE_SOURCE } from "../shared/webhost/webviewShim.js";
|
|
@@ -6,7 +6,8 @@ import { hostname, uptime } from "os";
|
|
|
6
6
|
import { join } from "path";
|
|
7
7
|
import { generateAuthenticationOptions, generateRegistrationOptions, verifyAuthenticationResponse, verifyRegistrationResponse } from "@simplewebauthn/server";
|
|
8
8
|
import QRCode from "qrcode";
|
|
9
|
-
import {
|
|
9
|
+
import { smsReachesOwner, textOwner } from "../notify.js";
|
|
10
|
+
import { CONFIG_DIR, GatewayError, readGatewaySettings } from "../gatewaySettings.js";
|
|
10
11
|
import { ICON_HEAD } from "./iconDoor.js";
|
|
11
12
|
const PASSKEY_PREFIX = "/passkey/";
|
|
12
13
|
const ENROL_PATH = "/passkey/enrol";
|
|
@@ -12,7 +12,7 @@ import { homedir } from "os";
|
|
|
12
12
|
import { basename, dirname, join } from "path";
|
|
13
13
|
import { execFile } from "child_process";
|
|
14
14
|
import { promisify } from "util";
|
|
15
|
-
import { CONFIG_DIR, GatewayError } from "../
|
|
15
|
+
import { CONFIG_DIR, GatewayError } from "../gatewaySettings.js";
|
|
16
16
|
import { GATEWAY_STATE_FILE, TUNNEL_BINARY } from "./tunnel.js";
|
|
17
17
|
import { readConfig, writeConfigValue } from "./panel.js";
|
|
18
18
|
const run = promisify(execFile);
|
package/dist/gateway/restDoor.js
CHANGED
|
@@ -18,7 +18,7 @@ import { createRequire } from "module";
|
|
|
18
18
|
import { isAbsolute, join, relative } from "path";
|
|
19
19
|
import { createServer, request as httpRequest } from "http";
|
|
20
20
|
import { WebSocket, WebSocketServer } from "ws";
|
|
21
|
-
import { CONFIG_DIR, GatewayError } from "../
|
|
21
|
+
import { CONFIG_DIR, GatewayError } from "../gatewaySettings.js";
|
|
22
22
|
import { CHAT_HEADERS } from "./chatPage.js";
|
|
23
23
|
import { isIconPath, serveIcon } from "./iconDoor.js";
|
|
24
24
|
import { MCP_PATH, accessGranted, challenge, grantClient, handleOAuth, isOAuthPath, publicBase } from "./oauthDoor.js";
|
package/dist/gateway/tunnel.js
CHANGED
|
@@ -13,7 +13,7 @@ import { execFileSync, spawn } from "child_process";
|
|
|
13
13
|
import { existsSync, mkdirSync, readFileSync, readlinkSync, renameSync, writeFileSync } from "fs";
|
|
14
14
|
import { homedir } from "os";
|
|
15
15
|
import { join } from "path";
|
|
16
|
-
import { CONFIG_DIR } from "../
|
|
16
|
+
import { CONFIG_DIR } from "../gatewaySettings.js";
|
|
17
17
|
// Read by src/gateway/publicAccess.ts, which names both paths by the same rule.
|
|
18
18
|
export const GATEWAY_STATE_FILE = "gateway-state.json";
|
|
19
19
|
export const TUNNEL_BINARY = join(CONFIG_DIR, "cloudflared", process.platform === "win32" ? "cloudflared.exe" : "cloudflared");
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* #4247 — the leaf every BullseyeNotif door shares with notify: where BN's config lives, the gateway's token settings,
|
|
3
|
+
* the refusal type every door answers with, the atomic record write and the installed build's version.
|
|
4
|
+
* It imports nothing of BN's own, so the doors (oauthDoor, restDoor, tunnel, publicAccess, gatewayInstall, panelPage,
|
|
5
|
+
* agentGateway) no longer reach into notify.ts for it; passkeyDoor's one remaining tie to notify.ts is the SMS sign-in
|
|
6
|
+
* code (smsReachesOwner, textOwner) and notifyDoor's is the MCP server it serves.
|
|
7
|
+
* notify.ts re-exports every name here, so a caller that still imports them from notify.js reads the same values.
|
|
8
|
+
*/
|
|
9
|
+
import { existsSync, readFileSync, renameSync, rmSync, writeFileSync } from "fs";
|
|
10
|
+
import { homedir } from "os";
|
|
11
|
+
import { join } from "path";
|
|
12
|
+
import { fileURLToPath } from "url";
|
|
13
|
+
export const MANIFEST_PATH = fileURLToPath(new URL("../package.json", import.meta.url));
|
|
14
|
+
/** The build the extension has installed beside this bundle now; it moves when a window activates a newer extension and mirrors it. */
|
|
15
|
+
export function installedVersion() {
|
|
16
|
+
return JSON.parse(readFileSync(MANIFEST_PATH, "utf8")).version;
|
|
17
|
+
}
|
|
18
|
+
/** The build this process is running, read once at load. */
|
|
19
|
+
export const PACKAGE_VERSION = installedVersion();
|
|
20
|
+
export const PACKAGE_HOMEPAGE = JSON.parse(readFileSync(MANIFEST_PATH, "utf8")).homepage;
|
|
21
|
+
export const CONFIG_DIR = process.env.NOTIFY_MCP_CONFIG_DIR || join(homedir(), ".notify-mcp");
|
|
22
|
+
export const CONFIG_PATH = join(CONFIG_DIR, "config.json");
|
|
23
|
+
export const DEFAULT_GATEWAY_PORT = 7470;
|
|
24
|
+
/** A refused request, answered to its caller with this status and these words by whichever door it reached. */
|
|
25
|
+
export class GatewayError extends Error {
|
|
26
|
+
status;
|
|
27
|
+
facts;
|
|
28
|
+
/** `facts` ride beside the words in the refusal's body, so a caller acts on what was refused without parsing the message. */
|
|
29
|
+
constructor(status, message, facts = {}) {
|
|
30
|
+
super(message);
|
|
31
|
+
this.status = status;
|
|
32
|
+
this.facts = facts;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/** A rename Windows refuses while a reader holds the destination open for a moment. */
|
|
36
|
+
const RENAME_REFUSED = new Set(["EPERM", "EACCES", "EBUSY"]);
|
|
37
|
+
// GATE: five tries, waiting 10, 20, 40 and 80 ms — 150 ms at the outside — so a write a reader's lock refuses for a moment still lands, and one it refuses for good fails exactly as a single attempt did.
|
|
38
|
+
const RENAME_TRIES = 5;
|
|
39
|
+
const RENAME_FIRST_WAIT_MS = 10;
|
|
40
|
+
/** Writes one of BN's own files — config.json, the daemon's beat — staged beside itself and renamed over the old one, so no reader sees half of it; a refused rename is tried again. */
|
|
41
|
+
export function writeRecordFile(final, text) {
|
|
42
|
+
const staged = `${final}.${process.pid}.tmp`;
|
|
43
|
+
for (let attempt = 0;; attempt++) {
|
|
44
|
+
try {
|
|
45
|
+
writeFileSync(staged, text);
|
|
46
|
+
renameSync(staged, final);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
catch (err) {
|
|
50
|
+
if (!RENAME_REFUSED.has(err.code ?? "") || attempt === RENAME_TRIES - 1) {
|
|
51
|
+
rmSync(staged, { force: true });
|
|
52
|
+
throw err;
|
|
53
|
+
}
|
|
54
|
+
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, RENAME_FIRST_WAIT_MS << attempt);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/** The token is mandatory: a door that is open to the home network never starts without one. */
|
|
59
|
+
export function readGatewaySettings() {
|
|
60
|
+
if (!existsSync(CONFIG_PATH))
|
|
61
|
+
return undefined;
|
|
62
|
+
const section = JSON.parse(readFileSync(CONFIG_PATH, "utf8")).agentGateway;
|
|
63
|
+
if (!section || typeof section.token !== "string" || section.token.length === 0)
|
|
64
|
+
return undefined;
|
|
65
|
+
const host = typeof section.host === "string" && section.host.length > 0 ? section.host : undefined;
|
|
66
|
+
const hosts = Array.isArray(section.hosts) && section.hosts.length > 0 ? section.hosts.map(String) : undefined;
|
|
67
|
+
return { token: section.token, port: typeof section.port === "number" ? section.port : DEFAULT_GATEWAY_PORT, ...(host === undefined ? {} : { host }), ...(hosts === undefined ? {} : { hosts }) };
|
|
68
|
+
}
|
package/dist/notify.js
CHANGED
|
@@ -14,7 +14,6 @@ import { createServer as createNetServer } from "net";
|
|
|
14
14
|
import { readFileSync, writeFileSync, existsSync, mkdirSync, mkdtempSync, readdirSync, statSync, unlinkSync, linkSync, renameSync, rmSync, watch } from "fs";
|
|
15
15
|
import { homedir, networkInterfaces, hostname, tmpdir } from "os";
|
|
16
16
|
import { join, basename, dirname } from "path";
|
|
17
|
-
import { fileURLToPath } from "url";
|
|
18
17
|
import { spawnSync, spawn } from "child_process";
|
|
19
18
|
import { PinpointSMSVoiceV2Client, SendTextMessageCommand } from "@aws-sdk/client-pinpoint-sms-voice-v2";
|
|
20
19
|
import { SQSClient } from "@aws-sdk/client-sqs";
|
|
@@ -36,14 +35,9 @@ import { StoryTopics, shippedStory, storyOfMessage } from "./messaging/storyTopi
|
|
|
36
35
|
import { BoardDoorRefused, buttonPick, decisionButtons, decisionLink, decisionReply, PICK_DATA, pickByDigit, replySaid } from "./messaging/decisionDigit.js";
|
|
37
36
|
import { z } from "zod";
|
|
38
37
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
return JSON.parse(readFileSync(MANIFEST_PATH, "utf8")).version;
|
|
43
|
-
}
|
|
44
|
-
/** The build this process is running, read once at load. */
|
|
45
|
-
export const PACKAGE_VERSION = installedVersion();
|
|
46
|
-
export const PACKAGE_HOMEPAGE = JSON.parse(readFileSync(MANIFEST_PATH, "utf8")).homepage;
|
|
38
|
+
import { CONFIG_DIR, CONFIG_PATH, DEFAULT_GATEWAY_PORT, GatewayError, MANIFEST_PATH, PACKAGE_VERSION, installedVersion, readGatewaySettings } from "./gatewaySettings.js";
|
|
39
|
+
// #4247 — these live in the gatewaySettings leaf so the doors can leave this repo without notify.ts; re-exported for every caller that still names notify.js.
|
|
40
|
+
export { CONFIG_DIR, DEFAULT_GATEWAY_PORT, GatewayError, PACKAGE_HOMEPAGE, PACKAGE_VERSION, readGatewaySettings, writeRecordFile } from "./gatewaySettings.js";
|
|
47
41
|
/**
|
|
48
42
|
* The identity one chat reports and the tag its messages are routed by: `<machine>-<workspace>[-<session>]`.
|
|
49
43
|
* The HTTP door derives it from the headers its client sends: the workspace is walked up from the project folder,
|
|
@@ -80,54 +74,6 @@ export function sessionIdentity(from) {
|
|
|
80
74
|
const session = (from.sessionId ?? "").replace(/[^a-zA-Z0-9]/g, "").toLowerCase().slice(0, 6);
|
|
81
75
|
return `${cleanId(hostname())}-${workspace || "agent"}${session ? `-${session}` : ""}`;
|
|
82
76
|
}
|
|
83
|
-
export const CONFIG_DIR = process.env.NOTIFY_MCP_CONFIG_DIR || join(homedir(), ".notify-mcp");
|
|
84
|
-
const CONFIG_PATH = join(CONFIG_DIR, "config.json");
|
|
85
|
-
export const DEFAULT_GATEWAY_PORT = 7470;
|
|
86
|
-
/** A refused request, answered to its caller with this status and these words by whichever door it reached. */
|
|
87
|
-
export class GatewayError extends Error {
|
|
88
|
-
status;
|
|
89
|
-
facts;
|
|
90
|
-
/** `facts` ride beside the words in the refusal's body, so a caller acts on what was refused without parsing the message. */
|
|
91
|
-
constructor(status, message, facts = {}) {
|
|
92
|
-
super(message);
|
|
93
|
-
this.status = status;
|
|
94
|
-
this.facts = facts;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
/** A rename Windows refuses while a reader holds the destination open for a moment. */
|
|
98
|
-
const RENAME_REFUSED = new Set(["EPERM", "EACCES", "EBUSY"]);
|
|
99
|
-
// GATE: five tries, waiting 10, 20, 40 and 80 ms — 150 ms at the outside — so a write a reader's lock refuses for a moment still lands, and one it refuses for good fails exactly as a single attempt did.
|
|
100
|
-
const RENAME_TRIES = 5;
|
|
101
|
-
const RENAME_FIRST_WAIT_MS = 10;
|
|
102
|
-
/** Writes one of BN's own files — config.json, the daemon's beat — staged beside itself and renamed over the old one, so no reader sees half of it; a refused rename is tried again. */
|
|
103
|
-
export function writeRecordFile(final, text) {
|
|
104
|
-
const staged = `${final}.${process.pid}.tmp`;
|
|
105
|
-
for (let attempt = 0;; attempt++) {
|
|
106
|
-
try {
|
|
107
|
-
writeFileSync(staged, text);
|
|
108
|
-
renameSync(staged, final);
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
catch (err) {
|
|
112
|
-
if (!RENAME_REFUSED.has(err.code ?? "") || attempt === RENAME_TRIES - 1) {
|
|
113
|
-
rmSync(staged, { force: true });
|
|
114
|
-
throw err;
|
|
115
|
-
}
|
|
116
|
-
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, RENAME_FIRST_WAIT_MS << attempt);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
/** The token is mandatory: a door that is open to the home network never starts without one. */
|
|
121
|
-
export function readGatewaySettings() {
|
|
122
|
-
if (!existsSync(CONFIG_PATH))
|
|
123
|
-
return undefined;
|
|
124
|
-
const section = JSON.parse(readFileSync(CONFIG_PATH, "utf8")).agentGateway;
|
|
125
|
-
if (!section || typeof section.token !== "string" || section.token.length === 0)
|
|
126
|
-
return undefined;
|
|
127
|
-
const host = typeof section.host === "string" && section.host.length > 0 ? section.host : undefined;
|
|
128
|
-
const hosts = Array.isArray(section.hosts) && section.hosts.length > 0 ? section.hosts.map(String) : undefined;
|
|
129
|
-
return { token: section.token, port: typeof section.port === "number" ? section.port : DEFAULT_GATEWAY_PORT, ...(host === undefined ? {} : { host }), ...(hosts === undefined ? {} : { hosts }) };
|
|
130
|
-
}
|
|
131
77
|
// GATE: the Slack API base may be moved ONLY under the test gate, so a suite can drive a real Slack call against a socket it owns; without the gate the value is api.slack.com and no environment can redirect it.
|
|
132
78
|
const SLACK_API_BASE = process.env.NOTIFY_MCP_TEST_ENDPOINTS === "1" && process.env.NOTIFY_SLACK_API
|
|
133
79
|
? process.env.NOTIFY_SLACK_API.replace(/\/+$/, "")
|
|
@@ -3891,10 +3837,10 @@ function listenBare(port) {
|
|
|
3891
3837
|
bare.listen(port, "127.0.0.1", () => resolve(bare));
|
|
3892
3838
|
});
|
|
3893
3839
|
}
|
|
3894
|
-
async function bindGatewayPort() {
|
|
3840
|
+
async function bindGatewayPort(host) {
|
|
3895
3841
|
const settings = readGatewaySettings();
|
|
3896
3842
|
if (settings)
|
|
3897
|
-
return
|
|
3843
|
+
return host.bindDoor(settings);
|
|
3898
3844
|
for (let attempt = 0;; attempt++) {
|
|
3899
3845
|
try {
|
|
3900
3846
|
return await listenBare(ownershipPortWithoutDoor(attempt));
|
|
@@ -3983,10 +3929,9 @@ function tryOwnGateway(polling, host) {
|
|
|
3983
3929
|
ownershipAttempting = true;
|
|
3984
3930
|
(async () => {
|
|
3985
3931
|
const port = settings?.port ?? DEFAULT_GATEWAY_PORT;
|
|
3986
|
-
const { findOtherBn } = await import("./gateway/lanProbe.js");
|
|
3987
3932
|
let other;
|
|
3988
3933
|
try {
|
|
3989
|
-
other = await
|
|
3934
|
+
other = await host.findOtherOwner(port);
|
|
3990
3935
|
}
|
|
3991
3936
|
catch (err) {
|
|
3992
3937
|
// 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 +3948,7 @@ function tryOwnGateway(polling, host) {
|
|
|
4003
3948
|
return;
|
|
4004
3949
|
}
|
|
4005
3950
|
lastOtherBn = "";
|
|
4006
|
-
door = await bindGatewayPort();
|
|
3951
|
+
door = await bindGatewayPort(host);
|
|
4007
3952
|
door.on("connection", (socket) => { doorConnections.add(socket); socket.once("close", () => doorConnections.delete(socket)); });
|
|
4008
3953
|
const owned = readGatewaySettings();
|
|
4009
3954
|
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
|
|
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
|
|
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
|
-
/**
|
|
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.
|
|
3
|
+
"version": "1.3.493",
|
|
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",
|