omni-notify-mcp 1.3.393 → 1.3.394
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/gateway/terminalPage.js +24 -10
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ import { PASSKEY_SCRIPT } from "./passkeyDoor.js";
|
|
|
6
6
|
import { PROVIDER_CHOICES } from "./conversationOwner.js";
|
|
7
7
|
import { notificationStatusScript } from "./panelPage.js";
|
|
8
8
|
import { ICON_HEAD } from "./iconDoor.js";
|
|
9
|
-
import { CLI_SCROLLBACK_LINES } from "../shared/conversation/nativeTerminal.js";
|
|
9
|
+
import { CLI_SCROLLBACK_LINES, CLI_WINDOWS_PTY } from "../shared/conversation/nativeTerminal.js";
|
|
10
10
|
const require = createRequire(import.meta.url);
|
|
11
11
|
function asset(name, installed) {
|
|
12
12
|
const packaged = new URL("../vendor/terminal/" + name, import.meta.url);
|
|
@@ -227,7 +227,7 @@ async function newAgentView(){
|
|
|
227
227
|
|
|
228
228
|
async function cliAttach(id,origin){
|
|
229
229
|
var mine=show("terminal","Native CLI · "+(phone?id.slice(0,8):id)),toolbar=el("div","setup toolbar"),back=tool("↩","Back",""),reattach=tool("🔌","Reattach",""),copy=tool("⧉","Copy selection",""),latest=tool("↓","Newest","latest"),close=tool("⏹","Close CLI",""),host=el("div");host.id="terminal";main.style.display="flex";main.style.flexDirection="column";host.style.flex="1";host.style.minHeight="0";toolbar.append(back,reattach,copy,latest,close,el("span","origin",origin));main.append(toolbar,host);
|
|
230
|
-
terminal=new Terminal({cursorBlink:true,fontSize:Math.round(15*phoneScale),fontFamily:"ui-monospace,SFMono-Regular,Menlo,Consolas,Roboto Mono,DejaVu Sans Mono,monospace",scrollback:${CLI_SCROLLBACK_LINES},theme:{background:"#101217"},allowProposedApi:true});fitAddon=new FitAddon.FitAddon();terminal.loadAddon(fitAddon);
|
|
230
|
+
terminal=new Terminal({cursorBlink:true,fontSize:Math.round(15*phoneScale),fontFamily:"ui-monospace,SFMono-Regular,Menlo,Consolas,Roboto Mono,DejaVu Sans Mono,monospace",scrollback:${CLI_SCROLLBACK_LINES},windowsPty:${JSON.stringify(CLI_WINDOWS_PTY)},theme:{background:"#101217"},allowProposedApi:true});fitAddon=new FitAddon.FitAddon();terminal.loadAddon(fitAddon);
|
|
231
231
|
terminal.loadAddon(new Unicode11Addon.Unicode11Addon());terminal.unicode.activeVersion="11";
|
|
232
232
|
terminal.open(host);terminal.textarea.enterKeyHint="send";terminal.focus();var term=terminal;
|
|
233
233
|
// Reading back through the scrollback is the reader's own act, so it is never taken away from them: output arriving
|
|
@@ -237,18 +237,32 @@ async function cliAttach(id,origin){
|
|
|
237
237
|
var atNewest=function(){var b=term.buffer.active;return b.viewportY>=b.baseY;};
|
|
238
238
|
var syncLatest=function(){latest.hidden=atNewest();};
|
|
239
239
|
latest.onclick=function(){term.scrollToBottom();term.focus();syncLatest();};
|
|
240
|
-
var swipeY=0,swipeX=0,swipeTravel=0;
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
var touch=event.touches[0],dy=swipeY-touch.clientY,dx=swipeX-touch.clientX;swipeY=touch.clientY;swipeX=touch.clientX;
|
|
244
|
-
if(Math.abs(dx)>Math.abs(dy))return;
|
|
245
|
-
event.preventDefault();event.stopPropagation();swipeTravel+=dy;
|
|
240
|
+
var swipeY=0,swipeX=0,swipeTravel=0,swipeAt=0,swipeSpeed=0,glide=0;
|
|
241
|
+
function pan(dy){
|
|
242
|
+
swipeTravel+=dy;
|
|
246
243
|
while(Math.abs(swipeTravel)>=20){
|
|
247
244
|
var down=swipeTravel>0;swipeTravel-=down?20:-20;
|
|
248
245
|
if(term.modes.mouseTrackingMode==="none"){if(term.buffer.active.type==="alternate")ordered(id,"input",{data:(term.modes.applicationCursorKeysMode?"\\x1bO":"\\x1b[")+(down?"B":"A")});else term.scrollLines(down?1:-1);}
|
|
249
246
|
else ordered(id,"input",{data:"\\x1b[<"+(down?65:64)+";"+Math.ceil(term.cols/2)+";"+Math.ceil(term.rows/2)+"M"});
|
|
250
247
|
}
|
|
248
|
+
}
|
|
249
|
+
// A phone's own scroller keeps gliding after the finger lifts, at the speed the finger left with, and slows to a stop:
|
|
250
|
+
// the release velocity (px/ms, smoothed over the last moves) decays by a constant factor per millisecond.
|
|
251
|
+
function stopGlide(){if(glide){cancelAnimationFrame(glide);glide=0;}}
|
|
252
|
+
function startGlide(){
|
|
253
|
+
var last=performance.now(),speed=swipeSpeed;
|
|
254
|
+
if(performance.now()-swipeAt>80||Math.abs(speed)<0.05)return;
|
|
255
|
+
var tick=function(now){if(mine!==view){glide=0;return;}var dt=Math.max(now-last,0);last=Math.max(now,last);pan(speed*dt);speed*=Math.pow(0.995,dt);if(Math.abs(speed)<0.02){glide=0;return;}glide=requestAnimationFrame(tick);};
|
|
256
|
+
glide=requestAnimationFrame(tick);
|
|
257
|
+
}
|
|
258
|
+
host.addEventListener("touchstart",function(event){stopGlide();swipeY=event.touches[0].clientY;swipeX=event.touches[0].clientX;swipeTravel=0;swipeSpeed=0;swipeAt=performance.now();},{passive:true,capture:true});
|
|
259
|
+
host.addEventListener("touchmove",function(event){
|
|
260
|
+
var touch=event.touches[0],dy=swipeY-touch.clientY,dx=swipeX-touch.clientX,now=performance.now(),dt=Math.max(now-swipeAt,1);swipeY=touch.clientY;swipeX=touch.clientX;
|
|
261
|
+
if(Math.abs(dx)>Math.abs(dy))return;
|
|
262
|
+
event.preventDefault();event.stopPropagation();swipeSpeed=0.7*swipeSpeed+0.3*(dy/dt);swipeAt=now;pan(dy);
|
|
251
263
|
},{passive:false,capture:true});
|
|
264
|
+
host.addEventListener("touchend",startGlide,{passive:true,capture:true});
|
|
265
|
+
host.addEventListener("touchcancel",stopGlide,{passive:true,capture:true});
|
|
252
266
|
term.onScroll(syncLatest);
|
|
253
267
|
term.onWriteParsed(syncLatest);
|
|
254
268
|
// xterm turns every keystroke into the CLI's input, so Ctrl+C and Ctrl+V never reach the browser's own clipboard.
|
|
@@ -296,7 +310,7 @@ async function cliAttach(id,origin){
|
|
|
296
310
|
},true);
|
|
297
311
|
term.onData(function(data){ordered(id,"input",{data:data});});term.onBinary(function(data){ordered(id,"input",{data:btoa(data),binary:true});});
|
|
298
312
|
refit=function(){if(mine!==view||!socket||socket.readyState!==WebSocket.OPEN)return;fitAddon.fit();ordered(id,"resize",{cols:term.cols,rows:term.rows});};
|
|
299
|
-
observer=new ResizeObserver(refit);
|
|
313
|
+
observer=new ResizeObserver(refit);host.addEventListener("pointerdown",refit);host.addEventListener("touchstart",refit,{passive:true});window.addEventListener("focus",refit);document.addEventListener("visibilitychange",function(){if(!document.hidden)refit();});
|
|
300
314
|
reattach.onclick=function(){cliAttach(id,origin);};
|
|
301
315
|
back.onclick=goBack;
|
|
302
316
|
close.onclick=async function(){close.disabled=true;try{await api("DELETE","/v1/terminals/"+id);swap("list");}catch(error){close.disabled=false;fail(error);}};
|
|
@@ -307,7 +321,7 @@ async function cliAttach(id,origin){
|
|
|
307
321
|
var ws=new WebSocket((location.protocol==="https:"?"wss://":"ws://")+location.host+"/v1/terminals/"+id+"/ws",["bn-terminal","bn-bearer."+token]);socket=ws;
|
|
308
322
|
var frames=Promise.resolve();
|
|
309
323
|
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();};
|
|
310
|
-
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;}if(frame.reset)term.reset();await new Promise(function(done){term.write(frame.data,done);});if(mine!==view)return;note.textContent=frame.provider+" · "+(phone?base(frame.project):frame.project)+(frame.ended?" · CLI ended":" · connected")+(frame.failure?" · "+frame.failure:"")+(fileNotice?" · "+fileNotice:"");}).catch(fail);};
|
|
324
|
+
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);};
|
|
311
325
|
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);};
|
|
312
326
|
ws.onerror=function(){note.textContent="Terminal connection failed. Reconnecting…";};
|
|
313
327
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omni-notify-mcp",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.394",
|
|
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",
|