omni-notify-mcp 1.3.433 → 1.3.434
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/shared/agentSession.js +41 -7
- package/package.json +1 -1
|
@@ -1361,12 +1361,13 @@ const TABLE_END = "\u0004END";
|
|
|
1361
1361
|
* times, working set and start from its own handle, and its command line once per process start. A process this user
|
|
1362
1362
|
* cannot open (System, a protected service) is listed with its parent and zeros.
|
|
1363
1363
|
*/
|
|
1364
|
-
const
|
|
1364
|
+
const windowsTableScript = (ownerPid) => `$ErrorActionPreference = 'Stop'
|
|
1365
1365
|
Add-Type -TypeDefinition @'
|
|
1366
1366
|
using System;
|
|
1367
1367
|
using System.Collections.Generic;
|
|
1368
1368
|
using System.Runtime.InteropServices;
|
|
1369
1369
|
using System.Text;
|
|
1370
|
+
using System.Threading;
|
|
1370
1371
|
public static class AgentSessionProcessTable {
|
|
1371
1372
|
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
|
|
1372
1373
|
struct Entry { public uint size, usage, pid; public IntPtr heap; public uint module, threads, ppid; public int priority; public uint flags; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)] public string exe; }
|
|
@@ -1377,6 +1378,14 @@ public static class AgentSessionProcessTable {
|
|
|
1377
1378
|
[DllImport("kernel32.dll", CharSet = CharSet.Unicode)] static extern bool Process32NextW(IntPtr snap, ref Entry entry);
|
|
1378
1379
|
[DllImport("kernel32.dll")] static extern IntPtr OpenProcess(uint access, bool inherit, uint pid);
|
|
1379
1380
|
[DllImport("kernel32.dll")] static extern bool CloseHandle(IntPtr handle);
|
|
1381
|
+
[DllImport("kernel32.dll")] static extern uint WaitForSingleObject(IntPtr handle, uint ms);
|
|
1382
|
+
public static void EndWithOwner(uint pid) {
|
|
1383
|
+
IntPtr owner = OpenProcess(0x00100000, false, pid);
|
|
1384
|
+
if (owner == IntPtr.Zero) Environment.Exit(0);
|
|
1385
|
+
var watch = new Thread(() => { WaitForSingleObject(owner, 0xFFFFFFFF); Environment.Exit(0); });
|
|
1386
|
+
watch.IsBackground = true;
|
|
1387
|
+
watch.Start();
|
|
1388
|
+
}
|
|
1380
1389
|
[DllImport("kernel32.dll")] static extern bool GetProcessTimes(IntPtr handle, out long created, out long exited, out long kernel, out long user);
|
|
1381
1390
|
[DllImport("kernel32.dll")] static extern bool K32GetProcessMemoryInfo(IntPtr handle, out Memory memory, uint cb);
|
|
1382
1391
|
[DllImport("ntdll.dll")] static extern int NtQueryInformationProcess(IntPtr handle, int infoClass, IntPtr buffer, int length, out int returned);
|
|
@@ -1575,6 +1584,7 @@ public static class AgentSessionProcessTable {
|
|
|
1575
1584
|
}
|
|
1576
1585
|
'@
|
|
1577
1586
|
[Console]::OutputEncoding = New-Object System.Text.UTF8Encoding $false
|
|
1587
|
+
[AgentSessionProcessTable]::EndWithOwner(${ownerPid})
|
|
1578
1588
|
while ($null -ne ($request = [Console]::In.ReadLine())) {
|
|
1579
1589
|
if ($request.StartsWith('ports ')) { [Console]::Out.Write([AgentSessionProcessTable]::Listeners($request.Substring(6))) }
|
|
1580
1590
|
elseif ($request.StartsWith('lanes ')) { [Console]::Out.Write([AgentSessionProcessTable]::Lanes($request.Substring(6))) }
|
|
@@ -1601,6 +1611,10 @@ export class ProcessTableUnreadable extends Error {
|
|
|
1601
1611
|
function throwProcessRead() {
|
|
1602
1612
|
throw new ProcessTableUnreadable("the process table could not be read");
|
|
1603
1613
|
}
|
|
1614
|
+
/** #14288 — the Windows table reader, bound to the process it serves: it ends the moment that process is gone, whoever still holds its input. */
|
|
1615
|
+
export function windowsTableLaunch(ownerPid) {
|
|
1616
|
+
return { file: "powershell", args: ["-NoProfile", "-NonInteractive", "-Command", "Invoke-Expression $env:AGENT_SESSION_WINDOWS_TABLE"], env: { ...process.env, AGENT_SESSION_WINDOWS_TABLE: windowsTableScript(ownerPid) } };
|
|
1617
|
+
}
|
|
1604
1618
|
export class TableReader {
|
|
1605
1619
|
launch;
|
|
1606
1620
|
child;
|
|
@@ -1742,7 +1756,7 @@ export class ProcessTable {
|
|
|
1742
1756
|
windows;
|
|
1743
1757
|
msys;
|
|
1744
1758
|
constructor(gitBash) {
|
|
1745
|
-
this.windows = new TableReader(() => (
|
|
1759
|
+
this.windows = new TableReader(() => windowsTableLaunch(process.pid));
|
|
1746
1760
|
this.msys = new TableReader(() => ({ file: gitBash(), args: ["-c", 'eval "$AGENT_SESSION_MSYS_TABLE"'], env: { ...process.env, AGENT_SESSION_MSYS_TABLE: MSYS_TABLE_SCRIPT } }));
|
|
1747
1761
|
}
|
|
1748
1762
|
dispose() {
|
|
@@ -2487,6 +2501,18 @@ export class OpenCodeTurn extends JsonlCliTurn {
|
|
|
2487
2501
|
export const STORY_QUEUE_WIRE = 1;
|
|
2488
2502
|
const PRI_ORDER = ["P0", "P1", "P2", "P3", "P4", "P5"];
|
|
2489
2503
|
const EFFORT_ORDER = ["XS", "S", "M", "L", "XL"];
|
|
2504
|
+
/** 🔴 #3798 — the request origin a start carries: his press, or the board's own act. */
|
|
2505
|
+
export const originOf = (by) => (by === "press" ? "press" : "auto");
|
|
2506
|
+
/** 🔴 #3798 — who started a request, in FleetView's words on its trace. */
|
|
2507
|
+
const STARTED_LABEL = { press: "his Start press", auto: "AUTO START", rehand: "the board's re-hand of a handed-back row" };
|
|
2508
|
+
/** 🔴 #3798 — the brief's line naming who started the story, never his press for a start he did not make. */
|
|
2509
|
+
export function startedOnLine(storyId, by) {
|
|
2510
|
+
switch (by) {
|
|
2511
|
+
case "press": return `Meni pressed Start on #${storyId} on the BullseyeBacklog board`;
|
|
2512
|
+
case "auto": return `AUTO START on the BullseyeBacklog board started #${storyId} — Meni pressed nothing`;
|
|
2513
|
+
case "rehand": return `The BullseyeBacklog board re-handed #${storyId}, a handed-back row no lane holds — Meni pressed nothing`;
|
|
2514
|
+
}
|
|
2515
|
+
}
|
|
2490
2516
|
/** 🔴 #4116 — the act a blocked worker waits on, in words. */
|
|
2491
2517
|
// NULL-OK: field needs is OPTIONAL and therefore it is ok to check for NULL
|
|
2492
2518
|
export const blockedAct = (worker) => (worker.needs === undefined ? "an act its job record does not name" : worker.needs);
|
|
@@ -2687,15 +2713,20 @@ export function submitStory(board, given, now) {
|
|
|
2687
2713
|
&& !(given.origin === "press" && given.forced === undefined && given.pressedAt !== undefined && given.pressedAt > standing.forced)
|
|
2688
2714
|
? { ...kept, forced: standing.forced } : kept;
|
|
2689
2715
|
// his press stays his only while it is unspent: once FleetView took it, an AUTO START resubmission carries its stamp only until the queue has started or woken the story for it
|
|
2690
|
-
const
|
|
2716
|
+
const carried = placed.origin !== "press" && standing?.origin === "press" && standing.pressedAt !== undefined && standing.eligible && placed.eligible && pressUnspent(board, standing.storyId)
|
|
2691
2717
|
? { ...placed, origin: "press", pressedAt: standing.pressedAt } : placed;
|
|
2718
|
+
const fields = carried.origin === given.origin ? carried
|
|
2719
|
+
: { ...carried, by: "press", brief: carried.brief.replace(startedOnLine(given.storyId, "auto"), startedOnLine(given.storyId, "press")).replace(startedOnLine(given.storyId, "rehand"), startedOnLine(given.storyId, "press")) };
|
|
2692
2720
|
const requestId = requestIdOf(fields);
|
|
2693
|
-
|
|
2721
|
+
const sameWhy = standing?.why === fields.why;
|
|
2722
|
+
if (standing !== undefined && sameWhy && ack?.requestId === requestId)
|
|
2694
2723
|
return { request: standing, written: false, acked: ack };
|
|
2695
|
-
if (standing?.requestId === requestId && now - standing.submittedAt < ACK_LATE_MS)
|
|
2724
|
+
if (standing?.requestId === requestId && sameWhy && now - standing.submittedAt < ACK_LATE_MS)
|
|
2696
2725
|
return { request: standing, written: false, unackedMs: now - standing.submittedAt };
|
|
2697
2726
|
const request = { v: STORY_QUEUE_WIRE, requestId, submittedAt: now, ...fields };
|
|
2698
2727
|
writeWhole(board, requestFile(board, given.storyId), request);
|
|
2728
|
+
if (ack?.requestId === requestId)
|
|
2729
|
+
return { request, written: true, acked: ack };
|
|
2699
2730
|
return { request, written: true, ...(standing?.requestId === requestId ? { unackedMs: now - standing.submittedAt } : {}) };
|
|
2700
2731
|
}
|
|
2701
2732
|
function pressUnspent(board, storyId) {
|
|
@@ -3134,8 +3165,11 @@ function applyRequest(store, r, now) {
|
|
|
3134
3165
|
if (refused !== undefined)
|
|
3135
3166
|
return refused;
|
|
3136
3167
|
let e = store.entries.find((x) => x.storyId === r.storyId);
|
|
3137
|
-
if (e?.requestId === r.requestId)
|
|
3168
|
+
if (e?.requestId === r.requestId) {
|
|
3169
|
+
if (!r.eligible && e.state === "withdrawn")
|
|
3170
|
+
e.why = r.why;
|
|
3138
3171
|
return undefined;
|
|
3172
|
+
}
|
|
3139
3173
|
const intentAt = r.forced ?? r.pressedAt;
|
|
3140
3174
|
const priorAuthority = priorAuthorityOf(e);
|
|
3141
3175
|
const freshForce = r.forced !== undefined && r.forced > priorAuthority;
|
|
@@ -3146,7 +3180,7 @@ function applyRequest(store, r, now) {
|
|
|
3146
3180
|
return undefined;
|
|
3147
3181
|
e = { storyId: r.storyId, requestId: r.requestId, startRequestId: r.requestId, ...(intentAt === undefined ? {} : { startPressedAt: intentAt }), seq: store.nextSeq++, state: "queued", attempts: 0, trace: [], ...fields };
|
|
3148
3182
|
store.entries.push(e);
|
|
3149
|
-
step(e, now, "acknowledged", `${r.origin === "press" ? "
|
|
3183
|
+
step(e, now, "acknowledged", `${STARTED_LABEL[r.by ?? (r.origin === "press" ? "press" : "auto")]} submitted it ${r.pri} ${r.effort} — ${r.why}`);
|
|
3150
3184
|
}
|
|
3151
3185
|
else {
|
|
3152
3186
|
const before = `${e.pri} ${e.effort}`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omni-notify-mcp",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.434",
|
|
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",
|