omni-notify-mcp 1.3.401 → 1.3.403
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/README.md +2 -2
- package/dist/agentGateway.js +3 -9
- package/dist/gateway/conversationOwner.js +2 -3
- package/dist/gateway/panel.js +1 -1
- package/dist/gateway/panelPage.js +6 -3
- package/dist/gateway/terminalPage.js +7 -6
- package/dist/notify.js +0 -2
- package/dist/shared/agentSession.js +26 -8
- package/dist/shared/conversation/conversationOwner.js +0 -1
- package/dist/shared/conversation/conversations.js +2 -3
- package/dist/shared/conversation/sessionDriver.js +1 -1
- package/dist/shared/webhost/autoSwitch.cjs +18 -5
- package/dist/shared/webhost/bullseyeWebHost.js +5 -4
- package/dist/shared/webhost/webviewShim.js +121 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -165,8 +165,8 @@ printed as though it had.
|
|
|
165
165
|
|
|
166
166
|
## Delivery routing
|
|
167
167
|
|
|
168
|
-
Suppression runs first, in order: **master mute** (`muteAll`) drops
|
|
169
|
-
including `high
|
|
168
|
+
Suppression runs first, in order: **master mute** (`muteAll`) drops every outbound notification
|
|
169
|
+
including `high` (agent conversations are never muted); a client listed in `disabledClients` is dropped by client id; then
|
|
170
170
|
**Do Not Disturb** holds everything, `high` included — nothing reaches you until it
|
|
171
171
|
lifts. A deliberate hold is a choice and never wears the same face as a defect.
|
|
172
172
|
|
package/dist/agentGateway.js
CHANGED
|
@@ -11,8 +11,7 @@
|
|
|
11
11
|
* Every conversation starts in Meni's workspace root, as the web page's and the MCP door's do.
|
|
12
12
|
*/
|
|
13
13
|
import { splitForNotify } from "./chunk.js";
|
|
14
|
-
import {
|
|
15
|
-
import { appendEvent, CONVERSATION_MUTED_MESSAGE, conversationRefusal, createdIn, creationPending, creationsPending, editOwed, GatewayError, listConversations, monotonicMs, openConversationOf, openConversationsOf, queueNoticeOf, readEvents, resolveProject, routeAsk, stopTargetOf, sendToConversation, startConversation, updateConversation, } from "./gateway/conversationOwner.js";
|
|
14
|
+
import { appendEvent, conversationRefusal, createdIn, creationPending, creationsPending, editOwed, GatewayError, listConversations, monotonicMs, openConversationOf, openConversationsOf, queueNoticeOf, readEvents, resolveProject, routeAsk, stopTargetOf, sendToConversation, startConversation, updateConversation, } from "./gateway/conversationOwner.js";
|
|
16
15
|
import { conversationOwner } from "./gateway/conversationOwner.js";
|
|
17
16
|
import { clearOpenCodeLogs } from "./gateway/conversationOwner.js";
|
|
18
17
|
import { resendUndelivered, turnEnded } from "./gateway/mcpEvents.js";
|
|
@@ -146,9 +145,6 @@ export class AgentGateway {
|
|
|
146
145
|
const arrived = monotonicMs();
|
|
147
146
|
const carriage = CARRIAGE[platform];
|
|
148
147
|
const refusal = conversationRefusal();
|
|
149
|
-
// A muted BN answers nobody: the refusal is spoken to the chat only when the switch, not Mute everything, is what is off.
|
|
150
|
-
if (refusal === CONVERSATION_MUTED_MESSAGE)
|
|
151
|
-
return;
|
|
152
148
|
if (refusal !== undefined)
|
|
153
149
|
return reply(refusal);
|
|
154
150
|
// NULL-OK: field pending is OPTIONAL and therefore it is ok to check for NULL
|
|
@@ -251,13 +247,11 @@ export class AgentGateway {
|
|
|
251
247
|
continue;
|
|
252
248
|
}
|
|
253
249
|
const event = pending.shift();
|
|
254
|
-
|
|
255
|
-
const muted = masterMuted();
|
|
256
|
-
if (!muted && carriage.carries(event.kind))
|
|
250
|
+
if (carriage.carries(event.kind))
|
|
257
251
|
for (const part of carriage.parts(event))
|
|
258
252
|
await reply(part);
|
|
259
253
|
const final = FINAL_KINDS.has(event.kind ?? "");
|
|
260
|
-
if (!closed
|
|
254
|
+
if (!closed)
|
|
261
255
|
editOwed(id, (o) => { if (final)
|
|
262
256
|
delete o[n];
|
|
263
257
|
else
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { existsSync } from "fs";
|
|
2
2
|
import { fileURLToPath } from "url";
|
|
3
|
-
import { CONFIG_DIR
|
|
3
|
+
import { CONFIG_DIR } from "../notify.js";
|
|
4
4
|
let personId;
|
|
5
5
|
void import("./passkeyDoor.js").then((door) => { personId = door.personId; });
|
|
6
6
|
import { createConversationOwner } from "../shared/conversation/conversationOwner.js";
|
|
@@ -35,7 +35,6 @@ export const conversationOwner = createConversationOwner({
|
|
|
35
35
|
get configDir() { return CONFIG_DIR; },
|
|
36
36
|
startOwner: FLEET_OWNER,
|
|
37
37
|
personId: () => personId(),
|
|
38
|
-
masterMuted: () => masterMuted(),
|
|
39
38
|
driver: driverOptions(),
|
|
40
39
|
});
|
|
41
40
|
export const { agentDir, storeChanged, SCOPE_HEADER } = conversationOwner.store;
|
|
@@ -109,7 +108,7 @@ export function shelfInLog(...args) { return conversationOwner.store.shelfInLog(
|
|
|
109
108
|
export function purgeConversation(...args) { return conversationOwner.store.purgeConversation(...args); }
|
|
110
109
|
export function stoppedInLog(...args) { return conversationOwner.store.stoppedInLog(...args); }
|
|
111
110
|
export function resumedInLog(...args) { return conversationOwner.store.resumedInLog(...args); }
|
|
112
|
-
export { GatewayError, MAX_WAIT_SECONDS, CONVERSATION_SWITCH_FILE, CONVERSATION_OFF_MESSAGE
|
|
111
|
+
export { GatewayError, MAX_WAIT_SECONDS, CONVERSATION_SWITCH_FILE, CONVERSATION_OFF_MESSAGE } from "../shared/conversation/conversations.js";
|
|
113
112
|
export const SessionDriver = conversationOwner.Driver;
|
|
114
113
|
export { IDLE_MS, SILENT_MS, STALL_MS, ARCHIVE_IDLE_MS, SPARE_IDLE_MS } from "../shared/conversation/sessionDriver.js";
|
|
115
114
|
export const { terminalHolder, NativeTerminal, terminalArriving, nativeTerminals, openDrivenTerminal, closeNativeTerminal, nativeTerminal, consoleSession, removeEndedDaemonsSpools } = conversationOwner.terminals;
|
package/dist/gateway/panel.js
CHANGED
|
@@ -13,7 +13,7 @@ const CONFIG_PATH = join(CONFIG_DIR, "config.json");
|
|
|
13
13
|
// Every config field the notify server reads, one editable row each. A field the server no longer reads is not listed: a control for it would change nothing.
|
|
14
14
|
export const SETTINGS = [
|
|
15
15
|
{ title: "🔕 Master", rows: [
|
|
16
|
-
{ path: ["muteAll"], label: "Mute everything", kind: "toggle", hint: "Master kill switch: On stops every channel at once, Off lets each enabled channel deliver." },
|
|
16
|
+
{ path: ["muteAll"], label: "Mute everything", kind: "toggle", hint: "Master kill switch for outbound notifications only: On stops every notification channel at once, Off lets each enabled channel deliver. Agent conversations are never muted." },
|
|
17
17
|
{ path: ["disabledClients"], label: "Muted clients (comma-separated ids)", kind: "list", hint: "Agent session ids whose notifications are dropped, e.g. @my-laptop-myproject-ea6d78. Leave empty to hear every agent." },
|
|
18
18
|
] },
|
|
19
19
|
{ guide: { summary: "Desktop banner", steps: ["Nothing to fill in: switch Enabled to On and notifications appear as desktop banners.", "Optional: turn Read aloud On to hear them."], need: [] }, title: "🖥️ Desktop", rows: [
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { PAGE_STYLE } from "./chatPage.js";
|
|
8
8
|
import { ICON_HEAD } from "./iconDoor.js";
|
|
9
|
-
import { PICKER_PAGE_SOURCE } from "../shared/webhost/webviewShim.js";
|
|
9
|
+
import { CONNECTION_SOURCE, PICKER_PAGE_SOURCE } from "../shared/webhost/webviewShim.js";
|
|
10
10
|
export const PANEL_PAGES = ["settings", "public-access"];
|
|
11
11
|
const LINKS = {
|
|
12
12
|
tunnels: "https://dash.cloudflare.com/?to=/:account/tunnels",
|
|
@@ -96,7 +96,10 @@ function needSignIn(why) {
|
|
|
96
96
|
}
|
|
97
97
|
async function call(method, path, body) {
|
|
98
98
|
function scoped(h) { var p = new URLSearchParams(location.search).get("project"); if (p !== null) h["x-bullseye-project"] = p; return h; }
|
|
99
|
-
var r
|
|
99
|
+
var r;
|
|
100
|
+
try { r = await fetch(path, { method: method, headers: scoped({ authorization: "Bearer " + token, "content-type": "application/json" }), body: body === undefined ? undefined : JSON.stringify(body) }); }
|
|
101
|
+
catch (e) { window.bullseyeConnection.reconnecting("this page's connection to the Notify service", location.pathname.indexOf("public-access") >= 0 ? 2000 : 5000); throw e; }
|
|
102
|
+
if (r.status >= 502) window.bullseyeConnection.reconnecting("this page's connection to the Notify service (HTTP " + r.status + ")", location.pathname.indexOf("public-access") >= 0 ? 2000 : 5000); else window.bullseyeConnection.live();
|
|
100
103
|
var j = await r.json().catch(function () { return {}; });
|
|
101
104
|
if (r.status === 401) { needSignIn("This sign-in was not accepted. Sign in again."); throw new Error("not signed in"); }
|
|
102
105
|
if (!r.ok) throw new Error(j.error || ("HTTP " + r.status));
|
|
@@ -133,7 +136,7 @@ document.querySelectorAll("nav a").forEach(function (a) { a.search = location.se
|
|
|
133
136
|
function shell(title, here, body, script) {
|
|
134
137
|
const nav = [["/", "💬 Conversations"], ["/settings", "⚙️ Settings"], ["/public-access", "🌐 Public access"]]
|
|
135
138
|
.map(([href, text]) => `<a href="${href}"${href === here ? ' class="here"' : ""}>${text}</a>`).join("");
|
|
136
|
-
return `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>${title}</title>${ICON_HEAD}<style>${PAGE_STYLE}${PANEL_STYLE}</style></head><body><nav>${nav}</nav><div class="wrap"><div id="signin"></div>${body}</div><script>${SIGN_IN}${NAV_KEEPS_WORKSPACE}${script}${notificationStatusScript("call")}</script><script data-page="${here.slice(1)}">${PICKER_PAGE_SOURCE}</script></body></html>`;
|
|
139
|
+
return `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>${title}</title>${ICON_HEAD}<style>${PAGE_STYLE}${PANEL_STYLE}</style></head><body><nav>${nav}</nav><div class="wrap"><div id="signin"></div>${body}</div><script>${CONNECTION_SOURCE}</script><script>${SIGN_IN}${NAV_KEEPS_WORKSPACE}${script}${notificationStatusScript("call")}</script><script data-page="${here.slice(1)}">${PICKER_PAGE_SOURCE}</script></body></html>`;
|
|
137
140
|
}
|
|
138
141
|
const SETTINGS_SCRIPT = `
|
|
139
142
|
var root = document.getElementById("root"), said = document.getElementById("said");
|
|
@@ -5,6 +5,7 @@ import { CONVERSATIONS_VIEWS, PAGE_STYLE, SIGN_IN_SCRIPT, servingLine, storedSta
|
|
|
5
5
|
import { PASSKEY_SCRIPT } from "./passkeyDoor.js";
|
|
6
6
|
import { PROVIDER_CHOICES } from "./conversationOwner.js";
|
|
7
7
|
import { notificationStatusScript } from "./panelPage.js";
|
|
8
|
+
import { CONNECTION_SOURCE } from "../shared/webhost/webviewShim.js";
|
|
8
9
|
import { ICON_HEAD } from "./iconDoor.js";
|
|
9
10
|
import { CLI_SCROLLBACK_LINES, CLI_WINDOWS_PTY } from "../shared/conversation/nativeTerminal.js";
|
|
10
11
|
const require = createRequire(import.meta.url);
|
|
@@ -102,7 +103,7 @@ body.phone.term #keybar{display:flex}
|
|
|
102
103
|
#keybar button.armed{background:#2f6b45;border-color:#7ee2a8;color:#fff}
|
|
103
104
|
</style></head><body><header><button id="back" hidden>Back</button><h1 id="title">Conversations</h1><a href="/settings" style="color:inherit">⚙️ Settings</a><a href="/public-access" style="color:inherit">🌐 Public access</a><button id="newagent" hidden>+ New Agent</button><button id="convs" hidden title="Back to the live Conversations list">📋 Conversations</button><button id="logout" hidden>🚪 Logout</button></header>
|
|
104
105
|
${servingLine()}<div id="status" role="status" hidden></div><main id="main"></main><div id="keybar" hidden></div>
|
|
105
|
-
<script>${js}
|
|
106
|
+
<script>${CONNECTION_SOURCE}</script><script>${js}
|
|
106
107
|
${fit}
|
|
107
108
|
${uni}</script><script>${PASSKEY_SCRIPT}
|
|
108
109
|
${SIGN_IN_SCRIPT}
|
|
@@ -141,7 +142,7 @@ function tool(icon,label,cls){var b=el("button",cls,icon);b.append(" ",el("span"
|
|
|
141
142
|
|
|
142
143
|
function show(name,heading){
|
|
143
144
|
view++;
|
|
144
|
-
if(name!=="terminal"){clearTimeout(reconnect);if(socket){socket.onclose=null;socket.close();socket=null;}if(observer){observer.disconnect();observer=null;}document.getElementById("keybar").hidden=true;if(terminal){terminal.dispose();terminal=null;}main.style.display="";main.style.flexDirection="";}
|
|
145
|
+
if(name!=="terminal"){window.bullseyeConnection.live();clearTimeout(reconnect);if(socket){socket.onclose=null;socket.close();socket=null;}if(observer){observer.disconnect();observer=null;}document.getElementById("keybar").hidden=true;if(terminal){terminal.dispose();terminal=null;}main.style.display="";main.style.flexDirection="";}
|
|
145
146
|
title.textContent=heading;
|
|
146
147
|
var inList=name==="list";
|
|
147
148
|
btnBack.hidden=inList||name==="signin";
|
|
@@ -159,7 +160,7 @@ function show(name,heading){
|
|
|
159
160
|
return view;
|
|
160
161
|
}
|
|
161
162
|
|
|
162
|
-
function scoped(h){if(scope!==null)h["x-bullseye-project"]=scope;return h}async function api(method,path,body,signal){var response=await fetch(path,{method:method,headers:scoped({authorization:"Bearer "+token,"content-type":"application/json"}),body:body===undefined?undefined:JSON.stringify(body),signal:signal});var data=await response.json();if(!response.ok){if(response.status===401)signIn("Sign in again to reach your CLI.");var error=Error(data.error||"Request failed");error.status=response.status;throw error;}return data;}
|
|
163
|
+
function down(what,method,path){if(method==="GET"&&path==="/v1/conversations")window.bullseyeConnection.reconnecting(what,8000);else if(method==="GET"&&path==="/v1/panel")window.bullseyeConnection.reconnecting(what,5000);else window.bullseyeConnection.disconnected(what,"this request did not go through — repeat it");}function scoped(h){if(scope!==null)h["x-bullseye-project"]=scope;return h}async function api(method,path,body,signal){var response;try{response=await fetch(path,{method:method,headers:scoped({authorization:"Bearer "+token,"content-type":"application/json"}),body:body===undefined?undefined:JSON.stringify(body),signal:signal});}catch(e){if(e.name!=="AbortError")down("the connection to the Notify service",method,path);throw e;}if(response.status>=502)down("the connection to the Notify service (HTTP "+response.status+")",method,path);else window.bullseyeConnection.live();var data=await response.json();if(!response.ok){if(response.status===401)signIn("Sign in again to reach your CLI.");var error=Error(data.error||"Request failed");error.status=response.status;throw error;}return data;}
|
|
163
164
|
function fail(error){note.textContent=error.message;}
|
|
164
165
|
function ordered(id,act,body){if(!socket||socket.readyState!==WebSocket.OPEN)return;socket.send(JSON.stringify(Object.assign({kind:act},body)));}
|
|
165
166
|
/** The last folder of a path, so a row names its project without printing the whole path. */
|
|
@@ -382,10 +383,10 @@ async function cliAttach(id,origin){
|
|
|
382
383
|
term.options.disableStdin=true;
|
|
383
384
|
var ws=new WebSocket((location.protocol==="https:"?"wss://":"ws://")+location.host+"/v1/terminals/"+id+"/ws",["bn-terminal","bn-bearer."+token]);socket=ws;
|
|
384
385
|
var frames=Promise.resolve();
|
|
385
|
-
ws.onopen=function(){if(mine!==view){ws.close();return;}term.options.disableStdin=false;fitAddon.fit();ordered(id,"resize",{cols:term.cols,rows:term.rows});term.focus();};
|
|
386
|
+
ws.onopen=function(){if(mine!==view){ws.close();return;}window.bullseyeConnection.live();term.options.disableStdin=false;fitAddon.fit();ordered(id,"resize",{cols:term.cols,rows:term.rows});term.focus();};
|
|
386
387
|
ws.onmessage=function(event){frames=frames.then(async function(){if(mine!==view)return;var frame=JSON.parse(event.data);if(frame.files){fileNotice=frame.error||"Sent to CLI: "+frame.paths.join(" · ");note.textContent=fileNotice;return;}if(frame.error){note.textContent=frame.error;return;}var behind=frame.reset?term.buffer.active.baseY-term.buffer.active.viewportY:0;if(frame.reset)term.reset();await new Promise(function(done){term.write(frame.data,done);});if(mine!==view)return;if(behind>0)term.scrollLines(-behind);note.textContent=frame.provider+" · "+(phone?base(frame.project):frame.project)+(frame.ended?" · CLI ended":" · connected")+(frame.failure?" · "+frame.failure:"")+(fileNotice?" · "+fileNotice:"");}).catch(fail);};
|
|
387
|
-
ws.onclose=function(event){if(mine!==view)return;term.options.disableStdin=true;if(event.code===1000){note.textContent="CLI ended.";return;}if(event.code===1008){note.textContent="Disconnected: "+event.reason+". Press Reattach or sign in again.";return;}note.textContent="Disconnected. Reattaching to the same CLI…";reconnect=setTimeout(connect,1000);};
|
|
388
|
-
ws.onerror=function(){note.textContent="Terminal connection failed. Reconnecting…";};
|
|
388
|
+
ws.onclose=function(event){if(mine!==view)return;term.options.disableStdin=true;if(event.code===1000){window.bullseyeConnection.live();note.textContent="CLI ended.";return;}if(event.code===1008){window.bullseyeConnection.disconnected("the terminal connection to the CLI",event.reason+" — press Reattach or sign in again");note.textContent="Disconnected: "+event.reason+". Press Reattach or sign in again.";return;}window.bullseyeConnection.reconnecting("the terminal connection to the CLI",1000);note.textContent="Disconnected. Reattaching to the same CLI…";reconnect=setTimeout(connect,1000);};
|
|
389
|
+
ws.onerror=function(){window.bullseyeConnection.reconnecting("the terminal connection to the CLI",1000);note.textContent="Terminal connection failed. Reconnecting…";};
|
|
389
390
|
}
|
|
390
391
|
connect();
|
|
391
392
|
}
|
package/dist/notify.js
CHANGED
|
@@ -1723,8 +1723,6 @@ async function slackPost(text) {
|
|
|
1723
1723
|
}
|
|
1724
1724
|
}
|
|
1725
1725
|
async function slackPostInThread(token, channel, threadTs, text) {
|
|
1726
|
-
if (masterMuted())
|
|
1727
|
-
return;
|
|
1728
1726
|
const r = await fetch(`${SLACK_API_BASE}/chat.postMessage`, {
|
|
1729
1727
|
method: "POST",
|
|
1730
1728
|
headers: { "Content-Type": "application/json; charset=utf-8", Authorization: `Bearer ${token}` },
|
|
@@ -2493,6 +2493,7 @@ export const blockedAct = (worker) => (worker.needs === undefined ? "an act its
|
|
|
2493
2493
|
export function workerRunner(worker) {
|
|
2494
2494
|
return worker.blocked === true ? `${worker.provider} worker, stopped until it gets ${blockedAct(worker)}` : `${worker.provider} worker`;
|
|
2495
2495
|
}
|
|
2496
|
+
const STOP_AUTHOR_WORDS = { press: "his ⏸ Stop press", emergency: "emergency stop of every board, not his press", caller: "a caller of the stop verb, not his press" };
|
|
2496
2497
|
export const storyQueueDir = (board) => path.join(board, ".fleetview", "queue");
|
|
2497
2498
|
const requestFile = (board, id) => path.join(storyQueueDir(board), "requests", `${id}.json`);
|
|
2498
2499
|
const ackFile = (board, id) => path.join(storyQueueDir(board), "acks", `${id}.json`);
|
|
@@ -3027,8 +3028,10 @@ function applyRequest(store, r, now) {
|
|
|
3027
3028
|
const authority = queueStartRequestId(e);
|
|
3028
3029
|
const newPress = r.eligible && r.origin === "press" && intentAt !== undefined && intentAt > priorAuthority;
|
|
3029
3030
|
e.startRequestId = newPress ? r.requestId : authority;
|
|
3030
|
-
if (newPress)
|
|
3031
|
+
if (newPress) {
|
|
3031
3032
|
e.startPressedAt = intentAt;
|
|
3033
|
+
delete e.accountRefusals;
|
|
3034
|
+
}
|
|
3032
3035
|
const said = e.why;
|
|
3033
3036
|
Object.assign(e, fields, { requestId: r.requestId });
|
|
3034
3037
|
if (newPress && r.forced === undefined) {
|
|
@@ -3036,7 +3039,12 @@ function applyRequest(store, r, now) {
|
|
|
3036
3039
|
delete e.forcedBy;
|
|
3037
3040
|
delete e.forceStartedAt;
|
|
3038
3041
|
}
|
|
3039
|
-
|
|
3042
|
+
const heldPlace = moved && e.manual !== undefined;
|
|
3043
|
+
if (moved) {
|
|
3044
|
+
delete e.manual;
|
|
3045
|
+
delete e.ordered;
|
|
3046
|
+
}
|
|
3047
|
+
step(e, now, "updated", moved ? `priority and size ${before} → ${r.pri} ${r.effort}${heldPlace ? ", his placement is dropped and" : ","} its automatic place follows` : `request updated — ${r.why}`);
|
|
3040
3048
|
if (!r.eligible && (e.state === "queued" || e.state === "retrying" || e.state === "failed")) {
|
|
3041
3049
|
e.state = "withdrawn";
|
|
3042
3050
|
step(e, now, "withdrawn", r.why);
|
|
@@ -3061,6 +3069,7 @@ function applyRequest(store, r, now) {
|
|
|
3061
3069
|
if (r.origin === "press" || e.state === "done")
|
|
3062
3070
|
e.attempts = 0;
|
|
3063
3071
|
delete e.accountRefused;
|
|
3072
|
+
delete e.accountRefusals;
|
|
3064
3073
|
if (e.handStop !== undefined && e.worker !== undefined)
|
|
3065
3074
|
e.worker.parkedAt = now - wakeDelayMs(e.worker.wakes ?? 0);
|
|
3066
3075
|
// NULL-OK: field session is OPTIONAL and therefore it is ok to check for NULL
|
|
@@ -3282,6 +3291,8 @@ function noteCarried(e, reading, now) {
|
|
|
3282
3291
|
}
|
|
3283
3292
|
/** A worker that ended with its story still open: started again after its backoff, stopped in `failed` past {@link WORKER_ATTEMPTS}, or at once when its provider refused it as the box stands (`retried` false), read again after the first backoff. */
|
|
3284
3293
|
function afterWorker(e, now, why, retried = true, refund = false) {
|
|
3294
|
+
if (!ACCOUNT_REFUSAL.test(why))
|
|
3295
|
+
delete e.accountRefusals;
|
|
3285
3296
|
if (!e.eligible) {
|
|
3286
3297
|
e.state = "withdrawn";
|
|
3287
3298
|
step(e, now, "withdrawn", e.why);
|
|
@@ -3292,6 +3303,7 @@ function afterWorker(e, now, why, retried = true, refund = false) {
|
|
|
3292
3303
|
e.state = "failed";
|
|
3293
3304
|
delete e.nextTryAt;
|
|
3294
3305
|
e.accountRefused = { at: now, why };
|
|
3306
|
+
e.accountRefusals = (e.accountRefusals ?? 0) + 1;
|
|
3295
3307
|
e.why = `${why} — a refusal about the money on the account it billed, not about the story: nothing starts it again until its start would land on a subscription with room, or his Start press`;
|
|
3296
3308
|
step(e, now, "failed", e.why);
|
|
3297
3309
|
}
|
|
@@ -3526,6 +3538,7 @@ export async function driveStoryQueue(board, world, now) {
|
|
|
3526
3538
|
e.state = "queued";
|
|
3527
3539
|
e.attempts = 0;
|
|
3528
3540
|
delete e.accountRefused;
|
|
3541
|
+
delete e.accountRefusals;
|
|
3529
3542
|
delete e.nextTryAt;
|
|
3530
3543
|
e.why = "its story is an open row on the board again";
|
|
3531
3544
|
delete e.worker?.archiveRefused;
|
|
@@ -3607,14 +3620,16 @@ export async function driveStoryQueue(board, world, now) {
|
|
|
3607
3620
|
continue;
|
|
3608
3621
|
// NULL-OK: field accountRefused is OPTIONAL and therefore it is ok to check for NULL
|
|
3609
3622
|
if (e.accountRefused !== undefined) {
|
|
3610
|
-
|
|
3623
|
+
// NULL-OK: field accountRefusals is OPTIONAL and therefore it is ok to check for NULL
|
|
3624
|
+
const refusals = e.accountRefusals ?? 1;
|
|
3625
|
+
if (now - e.accountRefused.at < (refusals <= 1 ? RETRY_BASE_MS : rearmDelayMs(WORKER_ATTEMPTS + refusals - 2)))
|
|
3611
3626
|
continue;
|
|
3612
3627
|
// NULL-OK: field noRoomForStart is OPTIONAL and therefore it is ok to check for NULL
|
|
3613
3628
|
const noRoom = world.noRoomForStart === undefined ? "this FleetView cannot tell where its next start would land" : await world.noRoomForStart(e);
|
|
3614
3629
|
// NULL-OK: field noRoom is OPTIONAL and therefore it is ok to check for NULL
|
|
3615
3630
|
if (noRoom !== undefined) {
|
|
3616
3631
|
e.accountRefused.at = now;
|
|
3617
|
-
const waits = `${e.accountRefused.why} — it waits failed, read again
|
|
3632
|
+
const waits = `${e.accountRefused.why} — it waits failed, read again when its wait ends: ${noRoom}`;
|
|
3618
3633
|
if (e.why !== waits) {
|
|
3619
3634
|
e.why = waits;
|
|
3620
3635
|
step(e, now, "held-back", waits);
|
|
@@ -3939,7 +3954,7 @@ export async function driveStoryQueue(board, world, now) {
|
|
|
3939
3954
|
}
|
|
3940
3955
|
save();
|
|
3941
3956
|
// NULL-OK: field stopped is OPTIONAL and therefore it is ok to check for NULL
|
|
3942
|
-
const halted = store.stopped === undefined ? undefined : `the queue is stopped (${store.stopped.by}), so nothing more starts or wakes until ▶ Run`;
|
|
3957
|
+
const halted = store.stopped === undefined ? undefined : `the queue is stopped (${store.stopped.by}; ${store.stopped.author === undefined ? "author not recorded" : STOP_AUTHOR_WORDS[store.stopped.author]}), so nothing more starts or wakes until ▶ Run`;
|
|
3943
3958
|
const unscheduled = autoStartHeld(board);
|
|
3944
3959
|
const heldWhy = (e) => {
|
|
3945
3960
|
const manual = unscheduled !== undefined && !hisOwn(e) ? unscheduled : undefined;
|
|
@@ -4123,6 +4138,8 @@ export async function driveStoryQueue(board, world, now) {
|
|
|
4123
4138
|
const forced = e.forced === true && (halted !== undefined || unscheduled !== undefined);
|
|
4124
4139
|
// NULL-OK: field halted is OPTIONAL and therefore it is ok to check for NULL
|
|
4125
4140
|
const forcedPast = halted !== undefined ? "the queue's ⏸ Stop" : "AUTO START being off";
|
|
4141
|
+
if (e.forced === true)
|
|
4142
|
+
delete e.accountRefusals;
|
|
4126
4143
|
delete e.forced;
|
|
4127
4144
|
delete e.forcedBy;
|
|
4128
4145
|
e.state = "starting";
|
|
@@ -4241,6 +4258,7 @@ export async function pressStory(board, storyId, press, now, by, requestHandledB
|
|
|
4241
4258
|
e.state = "queued";
|
|
4242
4259
|
e.attempts = 0;
|
|
4243
4260
|
delete e.accountRefused;
|
|
4261
|
+
delete e.accountRefusals;
|
|
4244
4262
|
delete e.nextTryAt;
|
|
4245
4263
|
e.why = `${by} ↻ Retry put it back in line with its attempts reset`;
|
|
4246
4264
|
step(e, now, "retry", e.why);
|
|
@@ -4327,16 +4345,16 @@ function pressedFor(e) {
|
|
|
4327
4345
|
return e.startPressedAt > (e.landedAt ?? e.worker?.startedAt ?? -Infinity);
|
|
4328
4346
|
}
|
|
4329
4347
|
/** 🔴 #4156 — his ▶ Run or ⏸ Stop on the board's queue: stopped, nothing more starts or wakes until he runs it again; workers already running carry on. Answers whether it changed. */
|
|
4330
|
-
export async function setStoryQueueStopped(board, stopped, by, now) {
|
|
4348
|
+
export async function setStoryQueueStopped(board, stopped, by, now, author = "caller") {
|
|
4331
4349
|
return withQueueLock(board, now, async () => {
|
|
4332
4350
|
const store = readQueueStore(board);
|
|
4333
4351
|
// NULL-OK: field stopped is OPTIONAL and therefore it is ok to check for NULL
|
|
4334
4352
|
if ((store.stopped !== undefined) === stopped)
|
|
4335
4353
|
return false;
|
|
4336
4354
|
if (stopped)
|
|
4337
|
-
store.stopped = { at: now, by };
|
|
4355
|
+
store.stopped = { at: now, by, author };
|
|
4338
4356
|
else {
|
|
4339
|
-
store.lifted = { at: now, by, stoppedBy: store.stopped.by };
|
|
4357
|
+
store.lifted = { at: now, by, stoppedBy: store.stopped.by, stoppedAuthor: store.stopped.author };
|
|
4340
4358
|
delete store.stopped;
|
|
4341
4359
|
}
|
|
4342
4360
|
writeStore(board, store);
|
|
@@ -30,7 +30,6 @@ export class GatewayError extends Error {
|
|
|
30
30
|
/** The service's own store for the agent-conversation On/Off switch, beside config.json in the config dir: BN's page flips it, this process reads it, and BullseyeSync carries it to every machine. */
|
|
31
31
|
export const CONVERSATION_SWITCH_FILE = "conversation-switch.json";
|
|
32
32
|
export const CONVERSATION_OFF_MESSAGE = "The BN agent conversation is switched off. Turn the On switch beside Agent conversations on BN's Settings page to use it; nothing was started.";
|
|
33
|
-
export const CONVERSATION_MUTED_MESSAGE = "BN is muted: Mute everything is On in the BN Notify tab, so nothing was started and nothing is sent.";
|
|
34
33
|
// GATE: the longest a read may wait for a new event, one second under the 55 s BLOCKING_TOOL_MAX_SECONDS in notify.ts so no call is held past it.
|
|
35
34
|
export const MAX_WAIT_SECONDS = 54;
|
|
36
35
|
/** #4230/#4231 — whether `name`'s agents are started by the OTHER owner now (the agent cluster for BN's owner, the fleet for the cluster's), so this owner starts none of them; an unread authority refuses the start. */
|
|
@@ -90,9 +89,9 @@ export function createConversationStore(host, registry) {
|
|
|
90
89
|
if (conversationEnabled() !== enabled)
|
|
91
90
|
throw new Error(`${switchPath()} did not hold — wrote ${enabled}, read back ${!enabled}`);
|
|
92
91
|
}
|
|
93
|
-
/** Why no conversation may run right now, or undefined when one may: Mute everything
|
|
92
|
+
/** Why no conversation may run right now, or undefined when one may: Mute everything never gates a conversation. */
|
|
94
93
|
function conversationRefusal() {
|
|
95
|
-
return
|
|
94
|
+
return conversationEnabled() ? undefined : CONVERSATION_OFF_MESSAGE;
|
|
96
95
|
}
|
|
97
96
|
function requireConversationEnabled() {
|
|
98
97
|
const why = conversationRefusal();
|
|
@@ -49,7 +49,7 @@ export function sessionDriverClass(runtime) {
|
|
|
49
49
|
const GAVE_UP = "❌ BN restarted under this message again and again — that answer was lost. Send the message again.";
|
|
50
50
|
/** What the resumed turn is told before the message it was cut off on. */
|
|
51
51
|
const RESUME_PREAMBLE = "(BN restarted while you were working on the message below, and your work on it was cut off. If this session's history shows what you had already done for it, carry on from where you stopped rather than starting over, then answer it.)";
|
|
52
|
-
// GATE: the longest the driver waits before trying again to warm a spare agent once no spare is standing — after its process died, or an open was refused because BN is switched off,
|
|
52
|
+
// GATE: the longest the driver waits before trying again to warm a spare agent once no spare is standing — after its process died, or an open was refused because BN is switched off, or the project it is needed in holds no board; at the boundary the next beat tries again.
|
|
53
53
|
const SPARE_RETRY_MS = 10_000;
|
|
54
54
|
/** #4230/#4231 — refuses the start of `name`'s agent when this owner does not make it: the other owner starts that provider now, or the ownership authority is unread. */
|
|
55
55
|
function refuseClusterStart(name) {
|
|
@@ -919,11 +919,13 @@ function readOpencodeModel(home) {
|
|
|
919
919
|
function writeOpencodeModel(home, model) {
|
|
920
920
|
writeProviderField(home, OPENCODE_PROVIDER, "model", model);
|
|
921
921
|
}
|
|
922
|
-
// GATE: the key kinds OpenCode is handed, each with the OpenCode provider it names, the ONE environment variable that carries the key and the
|
|
923
|
-
// OpenCode speaks
|
|
922
|
+
// GATE: the key kinds OpenCode is handed, each with the OpenCode provider it names, the ONE environment variable that carries the key and the address variables it is sent with; a key of any other kind is never offered to OpenCode
|
|
923
|
+
// OpenCode speaks Anthropic Messages for the anthropic provider and OpenAI Chat Completions for every other one, and its own catalogue names deepinfra and deepseek as providers that know their own address, so those two carry none. The provider named here must be the one whose wire format the key's vendor answers: an OpenAI address handed to the anthropic provider (or the reverse) is a key OpenCode cannot reach.
|
|
924
924
|
const OPENCODE_KEY_KINDS = Object.freeze({
|
|
925
|
-
"claude-api": Object.freeze({ provider: "anthropic", env: "ANTHROPIC_API_KEY",
|
|
926
|
-
"codex-api": Object.freeze({ provider: "openai", env: "OPENAI_API_KEY",
|
|
925
|
+
"claude-api": Object.freeze({ provider: "anthropic", env: "ANTHROPIC_API_KEY", address: Object.freeze({ ANTHROPIC_BASE_URL: "https://api.anthropic.com/v1" }) }),
|
|
926
|
+
"codex-api": Object.freeze({ provider: "openai", env: "OPENAI_API_KEY", address: Object.freeze({ OPENAI_BASE_URL: "https://api.openai.com/v1" }) }),
|
|
927
|
+
deepinfra: Object.freeze({ provider: "deepinfra", env: "DEEPINFRA_API_KEY", address: Object.freeze({}) }),
|
|
928
|
+
deepseek: Object.freeze({ provider: "deepseek", env: "DEEPSEEK_API_KEY", address: Object.freeze({}) }),
|
|
927
929
|
});
|
|
928
930
|
const OPENCODE_FREE_ID = "opencode-free";
|
|
929
931
|
/** OpenCode's own model catalogue, the file the CLI keeps from models.dev — where its free tier's models are named. */
|
|
@@ -1181,7 +1183,7 @@ function opencodeKeyRoute(home, wanted, now = Date.now(), identities = identitie
|
|
|
1181
1183
|
passed.push(`${named}: ${bare === undefined ? "DeepAgent allows it no model" : `DeepAgent does not allow it ${wanted}`}`);
|
|
1182
1184
|
continue;
|
|
1183
1185
|
}
|
|
1184
|
-
return { identityId: id, named, model: `${kind.provider}/${model}`, env: { [kind.env]: key,
|
|
1186
|
+
return { identityId: id, named, model: `${kind.provider}/${model}`, env: { [kind.env]: key, ...kind.address, ...storeEnv } };
|
|
1185
1187
|
}
|
|
1186
1188
|
throw new NoOpenCodeKey(`no key DeepAgent holds can run OpenCode now — ${passed.join("; ") || "its OpenCode key plan names no key"}`);
|
|
1187
1189
|
}
|
|
@@ -2009,7 +2011,18 @@ function claudeSubscriptions(identities, Failure = Error) {
|
|
|
2009
2011
|
function boxClaudeSubscriptions() {
|
|
2010
2012
|
return claudeSubscriptions(deepagentSettings().values[IDENTITY_RECORDS]);
|
|
2011
2013
|
}
|
|
2014
|
+
/**
|
|
2015
|
+
* The credits a DeepInfra account still holds, from its /payment/checklist reply's two dollar figures, as its own billing page computes them.
|
|
2016
|
+
* @param {number} stripeBalance
|
|
2017
|
+
* @param {number} recent
|
|
2018
|
+
* @returns {{ dollars: number, text: string }}
|
|
2019
|
+
*/
|
|
2020
|
+
function deepinfraCredits(stripeBalance, recent) {
|
|
2021
|
+
const dollars = -(stripeBalance + recent);
|
|
2022
|
+
return { dollars, text: (dollars < 0 ? "-$" : "$") + Math.abs(dollars).toFixed(2) };
|
|
2023
|
+
}
|
|
2012
2024
|
module.exports = {
|
|
2025
|
+
deepinfraCredits,
|
|
2013
2026
|
UnreadableSettings,
|
|
2014
2027
|
VSCODE_VARIANTS,
|
|
2015
2028
|
vscodeDataRoot,
|
|
@@ -5,7 +5,7 @@ const http = require("http");
|
|
|
5
5
|
const os = require("os");
|
|
6
6
|
const path = require("path");
|
|
7
7
|
const zlib = require("zlib");
|
|
8
|
-
const { SHIM_SOURCE, NATIVE_PICKER_SOURCE } = require("./webviewShim");
|
|
8
|
+
const { CONNECTION_SOURCE, SHIM_SOURCE, NATIVE_PICKER_SOURCE } = require("./webviewShim");
|
|
9
9
|
const { workspacesHere } = require("./workspaceList");
|
|
10
10
|
const WS_GUID = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
|
|
11
11
|
const TOKEN_PARAMETER = "bullseye-token";
|
|
@@ -1316,19 +1316,20 @@ function peekedRosterPage(label, home, back) {
|
|
|
1316
1316
|
function closedPage(extension, page) {
|
|
1317
1317
|
return `<!DOCTYPE html><html><head><meta charset="utf-8">${PHONE_VIEWPORT}<title>${escapeAttribute(extension)} · ${escapeAttribute(page.title)}</title></head>
|
|
1318
1318
|
<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>
|
|
1319
|
-
<script>(function () {
|
|
1319
|
+
<script>${CONNECTION_SOURCE}</script><script>(function () {
|
|
1320
1320
|
var opened = false;
|
|
1321
1321
|
var socket = new WebSocket((location.protocol === "https:" ? "wss:" : "ws:") + "//" + location.host + "/__bullseye/ws?page=${encodeURIComponent(page.name)}&peek=1");
|
|
1322
1322
|
function awaitHost() {
|
|
1323
|
+
window.bullseyeConnection.reconnecting("this page's live connection to its host", 250);
|
|
1323
1324
|
document.getElementById("said").textContent = "⏳ This page's host is not answering — this page reloads the moment it does";
|
|
1324
|
-
fetch("/__bullseye/health", { cache: "no-store" }).then(function (r) { if (r.ok) location.reload(); else if (r.status === 401) location.assign("/"); else setTimeout(awaitHost,
|
|
1325
|
+
fetch("/__bullseye/health", { cache: "no-store" }).then(function (r) { if (r.ok) { window.bullseyeConnection.live(); location.reload(); } else if (r.status === 401) location.assign("/"); else setTimeout(awaitHost, 250); }, function () { setTimeout(awaitHost, 250); });
|
|
1325
1326
|
}
|
|
1326
1327
|
socket.addEventListener("open", function () {
|
|
1327
1328
|
opened = true;
|
|
1328
1329
|
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(); });
|
|
1329
1330
|
});
|
|
1330
1331
|
socket.addEventListener("message", function (event) { if (JSON.parse(String(event.data)).type === "reload") location.reload(); });
|
|
1331
|
-
socket.addEventListener("close", function () { if (opened) awaitHost(); else document.getElementById("said").textContent = "⚠️ This page could not reach its host, so it cannot load the page when it opens — reload it to try again"; });
|
|
1332
|
+
socket.addEventListener("close", function () { if (opened) { window.bullseyeConnection.reconnecting("this page's live connection to its host", 0); awaitHost(); } else { window.bullseyeConnection.disconnected("this page's live connection to its host", "the host did not accept the connection — reload this page to try again"); document.getElementById("said").textContent = "⚠️ This page could not reach its host, so it cannot load the page when it opens — reload it to try again"; } });
|
|
1332
1333
|
})();</script></body></html>`;
|
|
1333
1334
|
}
|
|
1334
1335
|
function codeDefect(err) {
|
|
@@ -272,7 +272,117 @@ const PICKER_SOURCE = String.raw `
|
|
|
272
272
|
place(box);
|
|
273
273
|
}
|
|
274
274
|
`;
|
|
275
|
-
const
|
|
275
|
+
const CONNECTION_SOURCE = String.raw `(function () {
|
|
276
|
+
"use strict";
|
|
277
|
+
if (window.bullseyeConnection !== undefined) {
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
var COVER = "__bullseye-connection";
|
|
281
|
+
var MARKS = { reconnecting: "🔄 RECONNECTING", disconnected: "🔴 DISCONNECTED", live: "✅ LIVE" };
|
|
282
|
+
var COLOURS = { reconnecting: "#7a5200", disconnected: "#8a1f1f", live: "#1d5a2c" };
|
|
283
|
+
var current = null;
|
|
284
|
+
var ticker = 0;
|
|
285
|
+
var clearer = 0;
|
|
286
|
+
var stilled = [];
|
|
287
|
+
|
|
288
|
+
function clock(at) {
|
|
289
|
+
return new Date(at).toLocaleTimeString([], { hour12: false });
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
function reading() {
|
|
293
|
+
var now = Date.now();
|
|
294
|
+
var lines = ["What dropped: " + current.what, "Since: " + clock(current.since) + " (" + Math.round((now - current.since) / 1000) + " s ago)"];
|
|
295
|
+
if (current.state === "reconnecting" && current.retryAt !== undefined) {
|
|
296
|
+
lines.push("Next retry: " + (current.retryAt > now ? "in " + Math.ceil((current.retryAt - now) / 1000) + " s" : "now"));
|
|
297
|
+
} else if (current.state === "disconnected") {
|
|
298
|
+
lines.push("Next retry: none — " + (current.why || "reload this page to try again"));
|
|
299
|
+
} else if (current.state === "live") {
|
|
300
|
+
lines.push("Live again after " + Math.round((now - current.since) / 1000) + " s");
|
|
301
|
+
}
|
|
302
|
+
return lines.join("\n");
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
function cover() {
|
|
306
|
+
var found = document.getElementById(COVER);
|
|
307
|
+
if (found !== null) {
|
|
308
|
+
return found;
|
|
309
|
+
}
|
|
310
|
+
found = document.createElement("div");
|
|
311
|
+
found.id = COVER;
|
|
312
|
+
found.setAttribute("role", "alert");
|
|
313
|
+
found.style.cssText = "position:fixed;inset:0;z-index:2147483647;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.6);cursor:not-allowed;padding:16px;box-sizing:border-box";
|
|
314
|
+
var word = document.createElement("div");
|
|
315
|
+
word.className = "__bullseye-notice-text";
|
|
316
|
+
word.style.cssText = "max-width:100%;padding:18px 28px;border:2px solid #fff;border-radius:12px;box-shadow:0 8px 32px rgba(0,0,0,.6);font:700 clamp(20px,6vw,32px) system-ui,sans-serif;color:#fff;text-align:center;cursor:help";
|
|
317
|
+
found.appendChild(word);
|
|
318
|
+
document.body.appendChild(found);
|
|
319
|
+
return found;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
function stillThePage(shown) {
|
|
323
|
+
if (document.activeElement !== null && document.activeElement !== document.body) {
|
|
324
|
+
document.activeElement.blur();
|
|
325
|
+
}
|
|
326
|
+
Array.prototype.forEach.call(document.body.children, function (el) {
|
|
327
|
+
if (el !== shown && !el.inert) {
|
|
328
|
+
el.inert = true;
|
|
329
|
+
stilled.push(el);
|
|
330
|
+
}
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
function paint() {
|
|
335
|
+
var shown = cover();
|
|
336
|
+
var word = shown.firstChild;
|
|
337
|
+
word.style.background = COLOURS[current.state];
|
|
338
|
+
var mark = MARKS[current.state];
|
|
339
|
+
if (word.textContent !== mark) {
|
|
340
|
+
word.textContent = mark;
|
|
341
|
+
}
|
|
342
|
+
var tip = reading();
|
|
343
|
+
if (word.getAttribute("data-be-tip") !== tip) {
|
|
344
|
+
word.setAttribute("data-be-tip", tip);
|
|
345
|
+
}
|
|
346
|
+
stillThePage(shown);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
function release() {
|
|
350
|
+
var shown = document.getElementById(COVER);
|
|
351
|
+
if (shown !== null) {
|
|
352
|
+
shown.remove();
|
|
353
|
+
}
|
|
354
|
+
stilled.forEach(function (el) { el.inert = false; });
|
|
355
|
+
stilled = [];
|
|
356
|
+
current = null;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
function show(state, what, extra) {
|
|
360
|
+
window.clearTimeout(clearer);
|
|
361
|
+
var dropped = current !== null && current.state !== "live";
|
|
362
|
+
current = { state: state, what: what || (current && current.what) || "the live connection to this page's service", since: dropped ? current.since : Date.now(), retryAt: extra.retryAt, why: extra.why };
|
|
363
|
+
paint();
|
|
364
|
+
window.clearInterval(ticker);
|
|
365
|
+
ticker = window.setInterval(paint, 1000);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
window.bullseyeConnection = {
|
|
369
|
+
reconnecting: function (what, retryInMs) {
|
|
370
|
+
show("reconnecting", what, { retryAt: Date.now() + retryInMs });
|
|
371
|
+
},
|
|
372
|
+
disconnected: function (what, why) {
|
|
373
|
+
show("disconnected", what, { why: why });
|
|
374
|
+
},
|
|
375
|
+
live: function () {
|
|
376
|
+
if (current === null || current.state === "live") {
|
|
377
|
+
return;
|
|
378
|
+
}
|
|
379
|
+
show("live", current.what, {});
|
|
380
|
+
window.clearInterval(ticker);
|
|
381
|
+
clearer = window.setTimeout(release, 300);
|
|
382
|
+
}
|
|
383
|
+
};
|
|
384
|
+
})();`;
|
|
385
|
+
const SHIM_SOURCE = CONNECTION_SOURCE + ";" + String.raw `(function () {
|
|
276
386
|
"use strict";
|
|
277
387
|
var script = document.currentScript;
|
|
278
388
|
var page = script.getAttribute("data-page");
|
|
@@ -310,18 +420,21 @@ const SHIM_SOURCE = String.raw `(function () {
|
|
|
310
420
|
}
|
|
311
421
|
|
|
312
422
|
` + PICKER_SOURCE + String.raw `
|
|
423
|
+
var WHAT = "this page's live connection to its service";
|
|
424
|
+
|
|
313
425
|
function awaitHost() {
|
|
314
|
-
|
|
426
|
+
window.bullseyeConnection.reconnecting(WHAT, 250);
|
|
315
427
|
window.fetch("/__bullseye/health", { cache: "no-store" }).then(function (response) {
|
|
316
428
|
if (response.ok) {
|
|
429
|
+
window.bullseyeConnection.live();
|
|
317
430
|
window.location.reload();
|
|
318
431
|
} else if (response.status === 401) {
|
|
319
432
|
window.location.assign("/");
|
|
320
433
|
} else {
|
|
321
|
-
window.setTimeout(awaitHost,
|
|
434
|
+
window.setTimeout(awaitHost, 250);
|
|
322
435
|
}
|
|
323
436
|
}, function () {
|
|
324
|
-
window.setTimeout(awaitHost,
|
|
437
|
+
window.setTimeout(awaitHost, 250);
|
|
325
438
|
});
|
|
326
439
|
}
|
|
327
440
|
|
|
@@ -383,12 +496,13 @@ const SHIM_SOURCE = String.raw `(function () {
|
|
|
383
496
|
socket.addEventListener("close", function () {
|
|
384
497
|
socket = null;
|
|
385
498
|
if (opened) {
|
|
386
|
-
window.
|
|
499
|
+
window.bullseyeConnection.reconnecting(WHAT, 250);
|
|
500
|
+
window.setTimeout(awaitHost, 250);
|
|
387
501
|
return;
|
|
388
502
|
}
|
|
389
503
|
window.fetch("/__bullseye/health", { cache: "no-store" }).then(function (response) {
|
|
390
504
|
if (response.ok) {
|
|
391
|
-
|
|
505
|
+
window.bullseyeConnection.disconnected(WHAT, "the host did not accept the connection — reload this page to try again");
|
|
392
506
|
} else {
|
|
393
507
|
awaitHost();
|
|
394
508
|
}
|
|
@@ -521,4 +635,4 @@ const NATIVE_PICKER_SOURCE = String.raw `(function () {
|
|
|
521
635
|
return api;
|
|
522
636
|
};
|
|
523
637
|
})();`;
|
|
524
|
-
module.exports = { SHIM_SOURCE, PICKER_PAGE_SOURCE, NATIVE_PICKER_SOURCE };
|
|
638
|
+
module.exports = { CONNECTION_SOURCE, SHIM_SOURCE, PICKER_PAGE_SOURCE, NATIVE_PICKER_SOURCE };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omni-notify-mcp",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.403",
|
|
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",
|