omni-notify-mcp 1.3.400 → 1.3.401

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.
@@ -12,6 +12,42 @@ function asset(name, installed) {
12
12
  const packaged = new URL("../vendor/terminal/" + name, import.meta.url);
13
13
  return readFileSync(existsSync(packaged) ? fileURLToPath(packaged) : require.resolve(installed), "utf8");
14
14
  }
15
+ export const KEY_BAR = [
16
+ { id: "up", label: "↑", title: "Up", seq: ["\x1b[A", "\x1bOA"] },
17
+ { id: "down", label: "↓", title: "Down", seq: ["\x1b[B", "\x1bOB"] },
18
+ { id: "left", label: "←", title: "Left", seq: ["\x1b[D", "\x1bOD"] },
19
+ { id: "right", label: "→", title: "Right", seq: ["\x1b[C", "\x1bOC"] },
20
+ { id: "esc", label: "Esc", title: "Escape", seq: ["\x1b", "\x1b"] },
21
+ { id: "tab", label: "Tab", title: "Tab", seq: ["\t", "\t"] },
22
+ { id: "shifttab", label: "⇧Tab", title: "Shift+Tab", seq: ["\x1b[Z", "\x1b[Z"] },
23
+ { id: "pgup", label: "PgUp", title: "Page Up", seq: ["\x1b[5~", "\x1b[5~"] },
24
+ { id: "pgdn", label: "PgDn", title: "Page Down", seq: ["\x1b[6~", "\x1b[6~"] },
25
+ { id: "home", label: "Home", title: "Home", seq: ["\x1b[H", "\x1bOH"] },
26
+ { id: "end", label: "End", title: "End", seq: ["\x1b[F", "\x1bOF"] },
27
+ ];
28
+ export function ctrlByte(data) {
29
+ if (data.length !== 1)
30
+ return data;
31
+ const code = data.charCodeAt(0);
32
+ if (code >= 97 && code <= 122)
33
+ return String.fromCharCode(code - 96);
34
+ if (code >= 65 && code <= 90)
35
+ return String.fromCharCode(code - 64);
36
+ if (code >= 91 && code <= 95)
37
+ return String.fromCharCode(code - 64);
38
+ if (data === "@" || data === " ")
39
+ return "\x00";
40
+ if (data === "?")
41
+ return "\x7f";
42
+ return data;
43
+ }
44
+ export function ctrlBarSeq(seq) {
45
+ const cursor = /^\x1b[\[O]([A-DHF])$/.exec(seq);
46
+ if (cursor)
47
+ return "\x1b[1;5" + cursor[1];
48
+ const paged = /^\x1b\[(\d)~$/.exec(seq);
49
+ return paged ? "\x1b[" + paged[1] + ";5~" : seq;
50
+ }
15
51
  /**
16
52
  * BN's ONE page: the Conversations list and the terminal each conversation opens in. Every conversation opens on the
17
53
  * provider's own full interactive CLI — its slash commands, prompts and menus answered by the real CLI — whether MCP or
@@ -25,7 +61,7 @@ export function terminalHtml() {
25
61
  const fit = asset("fit.js", "@xterm/addon-fit/lib/addon-fit.js").replace(/<\/script/gi, "<\\/script");
26
62
  const uni = asset("unicode11.js", "@xterm/addon-unicode11/lib/addon-unicode11.js").replace(/<\/script/gi, "<\\/script");
27
63
  const css = asset("xterm.css", "@xterm/xterm/css/xterm.css");
28
- return `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>BN native CLI</title>${ICON_HEAD}<style>${PAGE_STYLE}
64
+ return `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,interactive-widget=resizes-content"><title>BN native CLI</title>${ICON_HEAD}<style>${PAGE_STYLE}
29
65
  ${css}
30
66
  html,body{overscroll-behavior-y:none;-webkit-text-size-adjust:100%;text-size-adjust:100%}
31
67
  body{height:100dvh;margin:0;display:flex;flex-direction:column}header{flex-wrap:wrap}main{flex:1;min-height:0;padding:12px;overflow:hidden}main.scroll{overflow-y:auto}#terminal{height:100%;width:100%}.setup{display:flex;gap:8px;flex-wrap:wrap}.setup select,.setup input{font:inherit;padding:8px}
@@ -59,9 +95,13 @@ body.phone.term header>a,body.phone.term #convs,body.phone.term #logout,body.pho
59
95
  body.phone.term header{overflow:visible;flex-wrap:nowrap}body.phone.term header h1{flex:1 1 0;min-width:0;max-width:none}
60
96
  body.phone.term .setup.toolbar{flex-wrap:wrap;overflow:visible;gap:6px}body.phone .toolbar .lbl{display:none}body.phone .toolbar button{min-width:44px;justify-content:center}
61
97
  body.phone.term #status{display:block;-webkit-line-clamp:unset;overflow:visible}
62
- body.phone.term header,body.phone.term #status,body.phone.term .toolbar{zoom:var(--k,1)}
98
+ body.phone.term header,body.phone.term #status,body.phone.term .toolbar,body.phone.term #keybar{zoom:var(--k,1)}
99
+ #keybar{display:none;flex-wrap:wrap;gap:4px;padding:4px 6px;background:#101217;border-top:1px solid #2a303c}
100
+ body.phone.term #keybar{display:flex}
101
+ #keybar button{flex:1 1 0;min-width:40px;height:32px;min-height:32px;padding:0 4px;font-size:13px;line-height:1;justify-content:center;touch-action:manipulation;-webkit-user-select:none;user-select:none}
102
+ #keybar button.armed{background:#2f6b45;border-color:#7ee2a8;color:#fff}
63
103
  </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>
64
- ${servingLine()}<div id="status" role="status" hidden></div><main id="main"></main>
104
+ ${servingLine()}<div id="status" role="status" hidden></div><main id="main"></main><div id="keybar" hidden></div>
65
105
  <script>${js}
66
106
  ${fit}
67
107
  ${uni}</script><script>${PASSKEY_SCRIPT}
@@ -70,6 +110,9 @@ var main=document.getElementById("main"),note=document.getElementById("status"),
70
110
  var btnBack=document.getElementById("back");
71
111
  var btnNew=document.getElementById("newagent"),btnConvs=document.getElementById("convs");
72
112
  // A phone is a touch screen no wider than 600px on its short side. Its normal mode lays the page out at the screen's own width; its desktop-site mode lays it out wider and shrinks it to the glass, so everything the page draws outside the terminal is scaled up by that ratio and the terminal's font with it.
113
+ var ctrlByte=${ctrlByte.toString()};
114
+ var ctrlBarSeq=${ctrlBarSeq.toString()};
115
+ var KEY_BAR=${JSON.stringify(KEY_BAR)};
73
116
  var phone,phoneScale,refit=function(){};
74
117
  function sizePhone(){
75
118
  phone=matchMedia("(pointer:coarse)").matches&&Math.min(screen.width,screen.height)<=600;phoneScale=phone?Math.min(3,Math.max(1,innerWidth/screen.width)):1;
@@ -78,6 +121,7 @@ function sizePhone(){
78
121
  }
79
122
  var view=0,sent={},listResize=null,terminal,fitAddon,socket,reconnect,observer,arrival=null;
80
123
  sizePhone();window.addEventListener("resize",sizePhone);
124
+ if(window.visualViewport){var fitKeyboard=function(){document.body.style.height=phone?visualViewport.height+"px":"";};visualViewport.addEventListener("resize",fitKeyboard);fitKeyboard();}
81
125
  var AGENTS = ${JSON.stringify(PROVIDER_CHOICES)};
82
126
  var storedStamp = ${storedStamp.toString()};
83
127
  // The panel that hosts this page (#2726) hands its token over once in the URL fragment, which no request and no
@@ -97,7 +141,7 @@ function tool(icon,label,cls){var b=el("button",cls,icon);b.append(" ",el("span"
97
141
 
98
142
  function show(name,heading){
99
143
  view++;
100
- if(name!=="terminal"){clearTimeout(reconnect);if(socket){socket.onclose=null;socket.close();socket=null;}if(observer){observer.disconnect();observer=null;}if(terminal){terminal.dispose();terminal=null;}main.style.display="";main.style.flexDirection="";}
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="";}
101
145
  title.textContent=heading;
102
146
  var inList=name==="list";
103
147
  btnBack.hidden=inList||name==="signin";
@@ -315,8 +359,18 @@ async function cliAttach(id,origin){
315
359
  if(!files.length)return;
316
360
  event.preventDefault();event.stopImmediatePropagation();upload(files);term.focus();
317
361
  },true);
318
- var pending=[];function typed(body){if(socket&&socket.readyState===WebSocket.OPEN)ordered(id,"input",body);else pending.push(body);}
319
- term.onData(function(data){typed({data:data});});term.onBinary(function(data){typed({data:btoa(data),binary:true});});
362
+ var keybar=document.getElementById("keybar"),ctrlHeld=false,ctrlKey=null;
363
+ function disarm(){ctrlHeld=false;ctrlKey.classList.remove("armed");}
364
+ function sendKey(data){if(ctrlHeld){disarm();data=ctrlBarSeq(data);}ordered(id,"input",{data:data});}
365
+ keybar.replaceChildren();keybar.hidden=false;
366
+ KEY_BAR.slice(0,7).concat([{id:"ctrl",label:"Ctrl",title:"Ctrl (sticky)"}],KEY_BAR.slice(7)).forEach(function(key){
367
+ var b=el("button","",key.label);b.setAttribute("aria-label",key.title);b.type="button";
368
+ var keep=function(event){event.preventDefault();};b.addEventListener("pointerdown",keep);b.addEventListener("mousedown",keep);
369
+ if(key.id==="ctrl"){ctrlKey=b;b.onclick=function(){ctrlHeld=!ctrlHeld;b.classList.toggle("armed",ctrlHeld);term.focus();};}
370
+ else b.onclick=function(){sendKey(key.seq[term.modes.applicationCursorKeysMode?1:0]);term.focus();};
371
+ keybar.append(b);
372
+ });
373
+ term.onData(function(data){if(ctrlHeld&&data.length===1){disarm();data=ctrlByte(data);}ordered(id,"input",{data:data});});term.onBinary(function(data){ordered(id,"input",{data:btoa(data),binary:true});});
320
374
  refit=function(){if(mine!==view||!socket||socket.readyState!==WebSocket.OPEN)return;fitAddon.fit();ordered(id,"resize",{cols:term.cols,rows:term.rows});};
321
375
  if(observer)observer.disconnect();observer=new ResizeObserver(refit);host.addEventListener("pointerdown",refit);host.addEventListener("touchstart",refit,{passive:true});var wake=function(){if(!document.hidden)refit();},off=observer.disconnect.bind(observer);window.addEventListener("focus",wake);document.addEventListener("visibilitychange",wake);observer.disconnect=function(){window.removeEventListener("focus",wake);document.removeEventListener("visibilitychange",wake);off();};
322
376
  reattach.onclick=function(){cliAttach(id,origin);};
@@ -325,11 +379,12 @@ async function cliAttach(id,origin){
325
379
  observer.observe(host);
326
380
  function connect(){
327
381
  if(mine!==view)return;
382
+ term.options.disableStdin=true;
328
383
  var ws=new WebSocket((location.protocol==="https:"?"wss://":"ws://")+location.host+"/v1/terminals/"+id+"/ws",["bn-terminal","bn-bearer."+token]);socket=ws;
329
384
  var frames=Promise.resolve();
330
- ws.onopen=function(){if(mine!==view){ws.close();return;}fitAddon.fit();ordered(id,"resize",{cols:term.cols,rows:term.rows});while(pending.length)ordered(id,"input",pending.shift());term.focus();};
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();};
331
386
  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);};
332
- ws.onclose=function(event){if(mine!==view)return;if(event.code===1000||event.code===1008){term.options.disableStdin=true;pending.length=0;}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);};
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);};
333
388
  ws.onerror=function(){note.textContent="Terminal connection failed. Reconnecting…";};
334
389
  }
335
390
  connect();
@@ -3212,7 +3212,7 @@ export const REARM_DOUBLINGS = 2;
3212
3212
  // GATE: how long a done story's archived Claude Code conversation is kept after its archive — past it the queue deletes every file of it, and a story that comes back later starts afresh
3213
3213
  export const ARCHIVE_KEPT_DAYS = 7;
3214
3214
  /** 🔴 #4418 — a provider's HTTP 402 refusal, in the words its CLI reports it: the account the worker billed has no money or quota left, which no re-send to that account changes. */
3215
- const ACCOUNT_REFUSAL = /API Error: 402\b|\b402 (?:Payment Required|Insufficient Balance|You need positive balance|You have exceeded your monthly quota)|hit your (?:weekly|5-hour|five-hour|session|usage|monthly)? ?limit|Credit balance is too low|issue with the selected model|account (?:has been |is )?(?:suspended|disabled)/i;
3215
+ const ACCOUNT_REFUSAL = /API Error: 402\b|\b402 (?:Payment Required|Insufficient Balance|You need positive balance|You have exceeded your monthly quota)|hit your (?:weekly|5-hour|five-hour|session|usage|monthly)? ?limit|Credit balance is too low|issue with the selected model \(claude-|account (?:has been |is )?(?:suspended|disabled)/i;
3216
3216
  /** 🔴 #4123 — how long after the queue gave up on a story it is offered to the line again. */
3217
3217
  export const rearmDelayMs = (attempts) => REARM_BASE_MS * 2 ** Math.min(Math.max(attempts - WORKER_ATTEMPTS, 0), REARM_DOUBLINGS);
3218
3218
  /** The acks the passes' requests call for: one per request read, carrying its entry's state and place, rewritten only when one of them changed. */
@@ -3607,12 +3607,14 @@ export async function driveStoryQueue(board, world, now) {
3607
3607
  continue;
3608
3608
  // NULL-OK: field accountRefused is OPTIONAL and therefore it is ok to check for NULL
3609
3609
  if (e.accountRefused !== undefined) {
3610
+ if (now - e.accountRefused.at < RETRY_BASE_MS)
3611
+ continue;
3610
3612
  // NULL-OK: field noRoomForStart is OPTIONAL and therefore it is ok to check for NULL
3611
3613
  const noRoom = world.noRoomForStart === undefined ? "this FleetView cannot tell where its next start would land" : await world.noRoomForStart(e);
3612
3614
  // NULL-OK: field noRoom is OPTIONAL and therefore it is ok to check for NULL
3613
3615
  if (noRoom !== undefined) {
3614
3616
  e.accountRefused.at = now;
3615
- const waits = `${e.accountRefused.why} — it waits failed, read again every pass: ${noRoom}`;
3617
+ const waits = `${e.accountRefused.why} — it waits failed, read again every minute: ${noRoom}`;
3616
3618
  if (e.why !== waits) {
3617
3619
  e.why = waits;
3618
3620
  step(e, now, "held-back", waits);
@@ -3944,7 +3946,6 @@ export async function driveStoryQueue(board, world, now) {
3944
3946
  // NULL-OK: field halted is OPTIONAL and therefore it is ok to check for NULL
3945
3947
  return e.forced === true ? manual : halted ?? manual;
3946
3948
  };
3947
- let lanes = world.lanesRunning();
3948
3949
  for (const e of queueOrder(store)) {
3949
3950
  try {
3950
3951
  const sessionId = wakeable.get(e);
@@ -3977,7 +3978,6 @@ export async function driveStoryQueue(board, world, now) {
3977
3978
  save();
3978
3979
  continue;
3979
3980
  }
3980
- lanes += 1;
3981
3981
  const wakes = (parked.wakes ?? 0) + 1;
3982
3982
  try {
3983
3983
  const woken = await world.wake(e, board, sessionId, wakeMessage(e.storyId), worker => { e.worker = worker; save(); });
@@ -4116,7 +4116,6 @@ export async function driveStoryQueue(board, world, now) {
4116
4116
  continue;
4117
4117
  }
4118
4118
  }
4119
- lanes += 1;
4120
4119
  world.seat(e);
4121
4120
  // NULL-OK: field forcedBy is OPTIONAL and therefore it is ok to check for NULL
4122
4121
  const forcer = e.forcedBy ?? "an unrecorded presser's";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omni-notify-mcp",
3
- "version": "1.3.400",
3
+ "version": "1.3.401",
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",