omni-notify-mcp 1.3.405 → 1.3.406
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/mcpDoor.js
CHANGED
|
@@ -93,7 +93,7 @@ agent_prompt sends the user's request to that agent and returns its answer. It c
|
|
|
93
93
|
A NEW conversation needs no project: leave project out whatever the request is about, and the agent runs at the workspace root (${offer.under}), the folder holding every project, exactly as a VS Code window with no workspace would, loading each project's rules so it routes the request to the right project by itself — never choose a project for the user. Name a project only when the user names one: project is exactly one of ${offer.list}, never a path, and agent_projects lists them with their paths. provider is exactly one of ${PROVIDER_NAMES.join(", ")}; left out, it is the agent CLI whose subscription has room, by DeepAgent's provider_room, subscription before any key. A call that goes on with a conversation that already exists needs neither, because both were bound when it was created.
|
|
94
94
|
agent_open opens a conversation with no message and starts nothing: it takes project and provider as above, both optional, spends nothing and returns the id of a session to ask with agent_send and read with agent_wait. The folder of an existing conversation is switched with agent_project, which never starts a new agent and never makes a new conversation.
|
|
95
95
|
An agent that runs in a project works on that project: its own folder is the board it writes to, so work belonging to another project is never done from it — tell the user in one line which project the work belongs to, then start that project's own agent: agent_start with project naming the project and text carrying the request (agent_prompt with project for a quick answer), read its answer with agent_wait and relay it.
|
|
96
|
-
A request that changes a project is a Story, and the Story belongs on that project's own board: the agent of that project — this conversation's own agent when the work is this project's, the agent this conversation starts with agent_start as above when it belongs to another project — files it or joins it with the bullseye-backlog MCP server that project's folder declares, before any work is done on it. Once a Story is on the board the normal BB → FleetView workflow owns its execution and dispatches the subagents that run it, so BN stays free for the user's questions and follows the Story's progress on the board. A short read-only question or a status check is answered directly.
|
|
96
|
+
A request that changes a project is a Story, and the Story belongs on that project's own board: the agent of that project — this conversation's own agent when the work is this project's, the agent this conversation starts with agent_start as above when it belongs to another project — files it or joins it with the bullseye-backlog MCP server that project's folder declares, before any work is done on it. Once a Story is on the board the normal BB → FleetView workflow owns its execution and dispatches the subagents that run it, so BN stays free for the user's questions and follows the Story's progress on the board. A short read-only question or a status check is answered directly. No Story is executed twice: FleetView's queue starts a Story's agent only when the live process list shows none working it, and a message that only names a Story — a question about it, a status check — starts nothing. The long task in the example below goes the same way: agent_start and agent_wait are how such a request is sent and read, and the Story it becomes is filed and run as above.
|
|
97
97
|
Each agent_prompt goes on with the same agent as the previous one from this connection, also when a different project is named; new=true starts a fresh agent. With no conversation named, BN also starts a fresh agent by itself when the newest agent is busy and the ask does not point at the work already under way — so the ask never waits behind that turn. An ask that does point at the work under way (a follow-up, "are you done?", "stop") goes to the agent that is doing that work, even when a later independent ask opened another agent. A stopped conversation resumes on its next message.
|
|
98
98
|
A call that finishes inside the wait returns the end of the turn itself — an answer, a failure, or stopped when the conversation was stopped — and that is shown to the user as it is. When it returns working=true the turn is still running: call agent_wait at once with the id and the after it gave, and call it again the moment each read returns, until an answer or failed event arrives, or the conversation is stopped. The events that end the turn carry kind answer, failed or stopped, so read them by kind. A question the agent asks does not end its turn: it waits on the agent's own CLI screen, a status event says so, and the user answers it there by opening the conversation in BN — a message sent meanwhile is queued behind that turn and is not the answer. The working state is not an answer and neither is a read that brought only progress events — never pass either of them to the user as one.
|
|
99
99
|
Pass new=true whenever the question does not depend on the work already running: a fresh agent takes the question in a conversation of its own instead of waiting behind this connection's current turn, which can be minutes on a long one. Naming a conversation sends the call to that agent whatever new says, so to start a fresh one, pass new=true and leave conversation out.
|
|
@@ -120,7 +120,7 @@ function sizePhone(){
|
|
|
120
120
|
document.body.classList.toggle("phone",phone);document.documentElement.style.setProperty("--k",String(phoneScale));
|
|
121
121
|
if(terminal&&terminal.options.fontSize!==Math.round(15*phoneScale)){terminal.options.fontSize=Math.round(15*phoneScale);refit();}
|
|
122
122
|
}
|
|
123
|
-
var view=0,sent={},listResize=null,terminal,fitAddon,socket,reconnect,observer,arrival=null;
|
|
123
|
+
var view=0,sent={},listResize=null,terminal,fitAddon,socket,reconnect,observer,arrival=null,socketDown=false;
|
|
124
124
|
sizePhone();window.addEventListener("resize",sizePhone);
|
|
125
125
|
if(window.visualViewport){var fitKeyboard=function(){document.body.style.height=phone?visualViewport.height+"px":"";};visualViewport.addEventListener("resize",fitKeyboard);fitKeyboard();}
|
|
126
126
|
var AGENTS = ${JSON.stringify(PROVIDER_CHOICES)};
|
|
@@ -142,7 +142,7 @@ function tool(icon,label,cls){var b=el("button",cls,icon);b.append(" ",el("span"
|
|
|
142
142
|
|
|
143
143
|
function show(name,heading){
|
|
144
144
|
view++;
|
|
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
|
+
if(name!=="terminal"){socketDown=false;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="";}
|
|
146
146
|
title.textContent=heading;
|
|
147
147
|
var inList=name==="list";
|
|
148
148
|
btnBack.hidden=inList||name==="signin";
|
|
@@ -160,7 +160,7 @@ function show(name,heading){
|
|
|
160
160
|
return view;
|
|
161
161
|
}
|
|
162
162
|
|
|
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
|
+
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 if(!socketDown)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;}
|
|
164
164
|
function fail(error){note.textContent=error.message;}
|
|
165
165
|
function ordered(id,act,body){if(!socket||socket.readyState!==WebSocket.OPEN)return;socket.send(JSON.stringify(Object.assign({kind:act},body)));}
|
|
166
166
|
/** The last folder of a path, so a row names its project without printing the whole path. */
|
|
@@ -383,10 +383,10 @@ async function cliAttach(id,origin){
|
|
|
383
383
|
term.options.disableStdin=true;
|
|
384
384
|
var ws=new WebSocket((location.protocol==="https:"?"wss://":"ws://")+location.host+"/v1/terminals/"+id+"/ws",["bn-terminal","bn-bearer."+token]);socket=ws;
|
|
385
385
|
var frames=Promise.resolve();
|
|
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
|
+
ws.onopen=function(){if(mine!==view){ws.close();return;}socketDown=false;window.bullseyeConnection.live();term.options.disableStdin=false;fitAddon.fit();ordered(id,"resize",{cols:term.cols,rows:term.rows});term.focus();};
|
|
387
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);};
|
|
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…";};
|
|
388
|
+
ws.onclose=function(event){if(mine!==view)return;term.options.disableStdin=true;if(event.code===1000){socketDown=false;window.bullseyeConnection.live();note.textContent="CLI ended.";return;}if(event.code===1008){socketDown=true;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;}socketDown=true;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(){socketDown=true;window.bullseyeConnection.reconnecting("the terminal connection to the CLI",1000);note.textContent="Terminal connection failed. Reconnecting…";};
|
|
390
390
|
}
|
|
391
391
|
connect();
|
|
392
392
|
}
|
|
@@ -2701,6 +2701,11 @@ function clearRefusal(e, reading) {
|
|
|
2701
2701
|
delete e.transcriptRefused;
|
|
2702
2702
|
return reading;
|
|
2703
2703
|
}
|
|
2704
|
+
/** 🔴 #4318 — whether the lane `held` names is this entry's own worker whose job record reads dead: a dead worker holds nothing, so the story is not kept from a fresh worker by it. */
|
|
2705
|
+
function holdIsItsDeadWorker(e, held, reading) {
|
|
2706
|
+
// NULL-OK: field worker is OPTIONAL and therefore it is ok to check for NULL
|
|
2707
|
+
return e.worker !== undefined && held.includes(e.worker.jobId) && !reading().alive;
|
|
2708
|
+
}
|
|
2704
2709
|
/** A board pass failed before it could select: each queued entry it held back gets one `held-back` trace step naming why, written again only when the reason changes, so a stalled entry's own trace says why it waits. */
|
|
2705
2710
|
export async function traceHeldBack(board, why, now) {
|
|
2706
2711
|
await withQueueLock(board, now, async () => {
|
|
@@ -3100,7 +3105,7 @@ function applyRequest(store, r, now) {
|
|
|
3100
3105
|
}
|
|
3101
3106
|
return undefined;
|
|
3102
3107
|
}
|
|
3103
|
-
/** 🔴 #4156 — his ⚡ Force start on an entry in line: it starts on the next pass past a ⏸ Stop
|
|
3108
|
+
/** 🔴 #4156 — his ⚡ Force start on an entry in line: it starts on the next pass past a ⏸ Stop; the request that carries it (#4177) and the queue's own ⚡ press both force it here. */
|
|
3104
3109
|
function forceEntry(e, now, by, eventAt = now) {
|
|
3105
3110
|
e.forceStartedAt = eventAt;
|
|
3106
3111
|
e.forceEventAt = eventAt;
|
|
@@ -3110,7 +3115,7 @@ function forceEntry(e, now, by, eventAt = now) {
|
|
|
3110
3115
|
e.forcedBy = by;
|
|
3111
3116
|
if (by === HIS_PRESS)
|
|
3112
3117
|
e.startPressedAt = Math.max(e.startPressedAt ?? 0, eventAt);
|
|
3113
|
-
e.why = `${by} ⚡ Force start starts it on the next pass, past a ⏸ Stop
|
|
3118
|
+
e.why = `${by} ⚡ Force start starts it on the next pass, past a ⏸ Stop`;
|
|
3114
3119
|
step(e, now, "placed", e.why);
|
|
3115
3120
|
}
|
|
3116
3121
|
/** The provider refused to start a story's worker: its own words, which the entry carries and the queue starts again on its backoff. */
|
|
@@ -3440,8 +3445,7 @@ const stopDue = (worker, now) => worker.stoppedAt === undefined || now >= worker
|
|
|
3440
3445
|
/**
|
|
3441
3446
|
* 🔴 ONE PASS OF FLEETVIEW'S STORY QUEUE ON ONE BOARD, under its lock: every request BB wrote is applied and acknowledged,
|
|
3442
3447
|
* every worker is checked (a story shipped closes its entry; a worker that ended with the story still open is started
|
|
3443
|
-
* again after its backoff), and every entry in line is started
|
|
3444
|
-
* never a lane count, a session count or another holder (Meni 2026-11-20). An entry is written `starting` BEFORE its worker is launched, so a crash mid-start is found by its story on the
|
|
3448
|
+
* again after its backoff), and every entry in line with no agent working its story is started. An entry is written `starting` BEFORE its worker is launched, so a crash mid-start is found by its story on the
|
|
3445
3449
|
* next pass and never gets a second worker.
|
|
3446
3450
|
*/
|
|
3447
3451
|
export async function driveStoryQueue(board, world, now) {
|
|
@@ -3510,6 +3514,7 @@ export async function driveStoryQueue(board, world, now) {
|
|
|
3510
3514
|
// NULL-OK: field worker is OPTIONAL and therefore it is ok to check for NULL
|
|
3511
3515
|
const freed = await world.purge([...own, ...(e.archivedSessions ?? [])], worker?.codexDirect === true ? worker.jobId : undefined);
|
|
3512
3516
|
delete e.worker;
|
|
3517
|
+
delete e.lastSession;
|
|
3513
3518
|
delete e.archivedSessions;
|
|
3514
3519
|
delete e.archiveRefused;
|
|
3515
3520
|
step(e, now, "purged", `${cold}, so ${whose} can never be woken again, and ${purgedWords(worker, earlier, freed)}`);
|
|
@@ -3612,7 +3617,7 @@ export async function driveStoryQueue(board, world, now) {
|
|
|
3612
3617
|
e.why = replacement.why;
|
|
3613
3618
|
if (replacement.ended) {
|
|
3614
3619
|
const held = hisOwn(e) ? undefined : autoStartHeld(board);
|
|
3615
|
-
|
|
3620
|
+
dropWorker(e);
|
|
3616
3621
|
delete e.nextTryAt;
|
|
3617
3622
|
e.state = "queued";
|
|
3618
3623
|
step(e, now, "worker-ended", replacement.why);
|
|
@@ -3880,7 +3885,7 @@ export async function driveStoryQueue(board, world, now) {
|
|
|
3880
3885
|
if (worker.parkedAt === undefined && w.parked.failed === true && !killedAfterWork(worker, w.parked)) {
|
|
3881
3886
|
if (e.attempts >= WORKER_ATTEMPTS || ACCOUNT_REFUSAL.test(w.why)) {
|
|
3882
3887
|
idle = idleWorker(worker, () => w, now);
|
|
3883
|
-
|
|
3888
|
+
dropWorker(e);
|
|
3884
3889
|
step(e, now, "worker-ended", w.why);
|
|
3885
3890
|
afterWorker(e, now, w.why);
|
|
3886
3891
|
break judge;
|
|
@@ -3984,11 +3989,17 @@ export async function driveStoryQueue(board, world, now) {
|
|
|
3984
3989
|
continue;
|
|
3985
3990
|
}
|
|
3986
3991
|
const parked = e.worker;
|
|
3992
|
+
const held = world.heldBy(e.storyId);
|
|
3987
3993
|
const unwoken = (why) => {
|
|
3988
3994
|
const moved = e.state !== "queued";
|
|
3989
3995
|
e.state = "queued";
|
|
3990
3996
|
holdBack(e, now, "parked", why, moved, `${why} — no process runs its session, so the story waits in line and is no running worker`);
|
|
3991
3997
|
};
|
|
3998
|
+
// NULL-OK: field held is OPTIONAL and therefore it is ok to check for NULL
|
|
3999
|
+
if (held !== undefined) {
|
|
4000
|
+
unwoken(`worked by ${held}`);
|
|
4001
|
+
continue;
|
|
4002
|
+
}
|
|
3992
4003
|
const wakeHeld = heldWhy(e);
|
|
3993
4004
|
if (wakeHeld !== undefined) {
|
|
3994
4005
|
unwoken(`its worker ${parked.jobId} is parked, and ${wakeHeld}`);
|
|
@@ -3997,7 +4008,7 @@ export async function driveStoryQueue(board, world, now) {
|
|
|
3997
4008
|
const roomless = world.noRoomFor === undefined ? undefined : await world.noRoomFor(e);
|
|
3998
4009
|
if (roomless !== undefined) {
|
|
3999
4010
|
const moved = `its ${parked.provider} worker ${parked.jobId} is not woken: ${roomless}`;
|
|
4000
|
-
|
|
4011
|
+
dropWorker(e);
|
|
4001
4012
|
delete e.forced;
|
|
4002
4013
|
delete e.forcedBy;
|
|
4003
4014
|
step(e, now, "worker-ended", moved);
|
|
@@ -4009,7 +4020,8 @@ export async function driveStoryQueue(board, world, now) {
|
|
|
4009
4020
|
try {
|
|
4010
4021
|
const woken = await world.wake(e, board, sessionId, wakeMessage(e.storyId), worker => { e.worker = worker; save(); });
|
|
4011
4022
|
e.landedAt = now;
|
|
4012
|
-
|
|
4023
|
+
// NULL-OK: field cwd is OPTIONAL and therefore it is ok to check for NULL
|
|
4024
|
+
e.worker = { ...woken, wakes, ...(woken.provider === parked.provider && woken.jobId === parked.jobId ? keptSession(parked) : {}), ...(parked.cwd === undefined ? {} : { cwd: parked.cwd }) };
|
|
4013
4025
|
delete e.forced;
|
|
4014
4026
|
delete e.forcedBy;
|
|
4015
4027
|
if (noteCarried(e, { alive: true, why: "", carried: e.worker.carried }, now)) {
|
|
@@ -4084,7 +4096,7 @@ export async function driveStoryQueue(board, world, now) {
|
|
|
4084
4096
|
else {
|
|
4085
4097
|
// OWNER: ITER/LOOP — Claude Code refused to wake this story's session and no process runs it, so the worker has ended: its entry carries the provider's words and a fresh worker is started on its backoff; the next entry is read.
|
|
4086
4098
|
const why = `its ${parked.provider} worker ${parked.jobId} could not be woken: ${err.message}`;
|
|
4087
|
-
|
|
4099
|
+
dropWorker(e);
|
|
4088
4100
|
delete e.forced;
|
|
4089
4101
|
delete e.forcedBy;
|
|
4090
4102
|
step(e, now, "worker-ended", why);
|
|
@@ -4110,6 +4122,12 @@ export async function driveStoryQueue(board, world, now) {
|
|
|
4110
4122
|
e.why = `its worker ${e.worker.jobId}'s conversation is brought back from the archive on the next pass, and only then woken — never a fresh worker beside it`;
|
|
4111
4123
|
continue;
|
|
4112
4124
|
}
|
|
4125
|
+
const held = world.heldBy(e.storyId);
|
|
4126
|
+
// NULL-OK: field held is OPTIONAL and therefore it is ok to check for NULL
|
|
4127
|
+
if (held !== undefined && !holdIsItsDeadWorker(e, held, () => clearRefusal(e, world.worker(e, board)))) {
|
|
4128
|
+
holdBack(e, now, "held-back", `worked by ${held}`);
|
|
4129
|
+
continue;
|
|
4130
|
+
}
|
|
4113
4131
|
const startHeld = heldWhy(e);
|
|
4114
4132
|
if (startHeld !== undefined) {
|
|
4115
4133
|
holdBack(e, now, "held-back", startHeld);
|
|
@@ -4143,7 +4161,6 @@ export async function driveStoryQueue(board, world, now) {
|
|
|
4143
4161
|
continue;
|
|
4144
4162
|
}
|
|
4145
4163
|
}
|
|
4146
|
-
world.seat(e);
|
|
4147
4164
|
// NULL-OK: field forcedBy is OPTIONAL and therefore it is ok to check for NULL
|
|
4148
4165
|
const forcer = e.forcedBy ?? "an unrecorded presser's";
|
|
4149
4166
|
// NULL-OK: field halted is OPTIONAL and therefore it is ok to check for NULL
|
|
@@ -4157,7 +4174,7 @@ export async function driveStoryQueue(board, world, now) {
|
|
|
4157
4174
|
e.state = "starting";
|
|
4158
4175
|
e.attempts += 1;
|
|
4159
4176
|
delete e.accountRefused;
|
|
4160
|
-
|
|
4177
|
+
dropWorker(e);
|
|
4161
4178
|
step(e, now, "selected", `start ${e.attempts}${e.attempts > WORKER_ATTEMPTS ? ", past the attempts a story is given" : ` of ${WORKER_ATTEMPTS}`}${forced ? ` — ${forcer} ⚡ Force start, past ${forcedPast}` : ""}`);
|
|
4162
4179
|
save();
|
|
4163
4180
|
try {
|
|
@@ -4184,7 +4201,7 @@ export async function driveStoryQueue(board, world, now) {
|
|
|
4184
4201
|
if (err.retained !== undefined)
|
|
4185
4202
|
e.worker = err.retained;
|
|
4186
4203
|
else if (err.unsent)
|
|
4187
|
-
|
|
4204
|
+
dropWorker(e);
|
|
4188
4205
|
const made = clearRefusal(e, world.worker(e, board));
|
|
4189
4206
|
if (noteCarried(e, made, now)) {
|
|
4190
4207
|
save();
|
|
@@ -4233,8 +4250,8 @@ export class StoryPressRefused extends Error {
|
|
|
4233
4250
|
/**
|
|
4234
4251
|
* 🔴 #4156 — HIS PRESS ON ONE STORY OF FLEETVIEW'S QUEUE, under the queue's lock: ✕ Remove takes it out of the line (BullseyeBacklog's
|
|
4235
4252
|
* next new request puts it back), ↻ Retry puts a failed or retrying story back in line with its attempts reset, ⚡ Force start starts
|
|
4236
|
-
* it on the next pass past a ⏸ Stop and
|
|
4237
|
-
*
|
|
4253
|
+
* it on the next pass past a ⏸ Stop, and 🔔 Nudge ends the wait it stands on (a retry's backoff, a parked worker's wake delay). A press
|
|
4254
|
+
* that does not apply throws
|
|
4238
4255
|
* {@link StoryPressRefused}; one on a story no longer in line throws {@link NotInQueue}. Answers what it did, in words.
|
|
4239
4256
|
*/
|
|
4240
4257
|
export async function pressStory(board, storyId, press, now, by, requestHandledByOwner = false, ownerAction) {
|
|
@@ -4280,7 +4297,7 @@ export async function pressStory(board, storyId, press, now, by, requestHandledB
|
|
|
4280
4297
|
if (working)
|
|
4281
4298
|
throw new StoryPressRefused(`#${storyId} already has a worker at work, so there is nothing to force`);
|
|
4282
4299
|
forceEntry(e, now, by);
|
|
4283
|
-
did = `#${storyId} starts on the next pass, past a ⏸ Stop
|
|
4300
|
+
did = `#${storyId} starts on the next pass, past a ⏸ Stop`;
|
|
4284
4301
|
}
|
|
4285
4302
|
else if (press === "stop" || press === "kill") {
|
|
4286
4303
|
if (e.worker === undefined || !(working || parkedInLine(e) || e.worker.carried !== undefined || ownerAction !== undefined))
|
|
@@ -4314,12 +4331,12 @@ export async function pressStory(board, storyId, press, now, by, requestHandledB
|
|
|
4314
4331
|
did = `#${storyId} is tried on the next pass${afterStop}`;
|
|
4315
4332
|
}
|
|
4316
4333
|
else {
|
|
4317
|
-
throw new StoryPressRefused(`#${storyId} waits on nothing a nudge ends — it reads: ${e.why}${e.state === "queued" ? "; ⚡ Force start runs it past a ⏸ Stop
|
|
4334
|
+
throw new StoryPressRefused(`#${storyId} waits on nothing a nudge ends — it reads: ${e.why}${e.state === "queued" ? "; ⚡ Force start runs it past a ⏸ Stop" : ""}`);
|
|
4318
4335
|
}
|
|
4319
4336
|
step(e, now, "retry", e.why);
|
|
4320
4337
|
}
|
|
4321
4338
|
else {
|
|
4322
|
-
throw new StoryPressRefused(
|
|
4339
|
+
throw new StoryPressRefused(`${String(press)} is not a press FleetView's queue knows; #${storyId} reads: ${e.why}`);
|
|
4323
4340
|
}
|
|
4324
4341
|
writeStore(board, store);
|
|
4325
4342
|
writeAcks(board, store, new Map(), new Map([[e.storyId, e.requestId]]), now);
|
|
@@ -4444,7 +4461,8 @@ export async function rewakeStoryWorker(board, storyId, jobId, sessionId, messag
|
|
|
4444
4461
|
await stopStoryWorker(jobId, cli);
|
|
4445
4462
|
let woken;
|
|
4446
4463
|
try {
|
|
4447
|
-
|
|
4464
|
+
// NULL-OK: field cwd is OPTIONAL and therefore it is ok to check for NULL
|
|
4465
|
+
woken = await wakeStoryWorker(sessionId, message, parked.cwd ?? board, cli, now);
|
|
4448
4466
|
}
|
|
4449
4467
|
catch (err) {
|
|
4450
4468
|
if (!(err instanceof WorkerRefused))
|
|
@@ -4516,15 +4534,18 @@ export function claudeJobSession(jobId, home = claudeHome()) {
|
|
|
4516
4534
|
}
|
|
4517
4535
|
/** The `claude --bg` jobs on this machine started on `storyId` in `board` at or after `since`, oldest first — what a crash mid-start left behind, found by the brief's first line. */
|
|
4518
4536
|
export function claudeJobsOfStory(storyId, board, since, home = claudeHome()) {
|
|
4537
|
+
return claudeJobsWhere((job) => startedOnStory(job, storyId, board), since, home);
|
|
4538
|
+
}
|
|
4539
|
+
const startedOnStory = (job, storyId, board) => job.intent.startsWith(`Stories: #${storyId} `) && path.resolve(job.cwd).toLowerCase() === path.resolve(board).toLowerCase();
|
|
4540
|
+
/** Every `claude --bg` job on this machine whose record `matches`, created at or after `since`, oldest first; a record gone or caught mid-rewrite is not listed. */
|
|
4541
|
+
function claudeJobsWhere(matches, since, home) {
|
|
4519
4542
|
const dir = path.join(home, "jobs");
|
|
4520
4543
|
if (!fs.existsSync(dir))
|
|
4521
4544
|
return [];
|
|
4522
|
-
|
|
4523
|
-
const jobs = fs.readdirSync(dir).flatMap((id) => {
|
|
4545
|
+
return fs.readdirSync(dir).flatMap((id) => {
|
|
4524
4546
|
const job = jobRecordOf(id, home);
|
|
4525
|
-
return typeof job !== "string" && job
|
|
4526
|
-
});
|
|
4527
|
-
return jobs.filter((j) => j.at >= since).sort((a, b) => a.at - b.at).map((j) => j.id);
|
|
4547
|
+
return typeof job !== "string" && matches(job) && Date.parse(job.createdAt) >= since ? [{ id, at: Date.parse(job.createdAt) }] : [];
|
|
4548
|
+
}).sort((a, b) => a.at - b.at).map((j) => j.id);
|
|
4528
4549
|
}
|
|
4529
4550
|
/**
|
|
4530
4551
|
* #4230 — the `claude --bg` jobs on this machine launched with `--name <name>`, by the launch flags each job's own record keeps (the list `claude agents`
|
|
@@ -4552,18 +4573,14 @@ export function claudeJobsNamed(name, home = claudeHome()) {
|
|
|
4552
4573
|
}
|
|
4553
4574
|
});
|
|
4554
4575
|
}
|
|
4555
|
-
/**
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
const first = brief.split("\n")[0];
|
|
4561
|
-
|
|
4562
|
-
|
|
4563
|
-
return fs.readdirSync(dir).filter((id) => {
|
|
4564
|
-
const job = jobRecordOf(id, home);
|
|
4565
|
-
return typeof job !== "string" && job.intent.split("\n")[0] === first;
|
|
4566
|
-
});
|
|
4576
|
+
/**
|
|
4577
|
+
* 🔴 #4143/#4337 — the story's jobs created at or after `since`, oldest first: those started on it in `board` ({@link claudeJobsOfStory}), and those in any
|
|
4578
|
+
* folder whose brief opens with the same `Stories: #N — <title>` line as `brief` — a story's job started in a worktree or a nested repo is still that story's.
|
|
4579
|
+
*/
|
|
4580
|
+
export function claudeJobsOfStoryAnywhere(entry, board, since, home = claudeHome()) {
|
|
4581
|
+
const first = entry.brief.split("\n")[0];
|
|
4582
|
+
const briefed = /^Stories: #\d+ — \S/.test(first);
|
|
4583
|
+
return claudeJobsWhere((job) => startedOnStory(job, entry.storyId, board) || (briefed && job.intent.split("\n")[0] === first), since, home);
|
|
4567
4584
|
}
|
|
4568
4585
|
// GATE: how long a just-started worker is read as alive before its process has written its own live record (1.4 s measured on HP)
|
|
4569
4586
|
export const WORKER_START_GRACE_MS = 2 * 60_000;
|
|
@@ -4578,8 +4595,15 @@ const mtimeOf = (file) => {
|
|
|
4578
4595
|
return undefined;
|
|
4579
4596
|
}
|
|
4580
4597
|
};
|
|
4598
|
+
/** 🔴 #4337 — drops the entry's worker, keeping the conversation it recorded as the story's last one, so the story's next worker reads that agent's own transcript first. */
|
|
4599
|
+
function dropWorker(e) {
|
|
4600
|
+
// NULL-OK: field session is OPTIONAL and therefore it is ok to check for NULL
|
|
4601
|
+
if (e.worker?.session !== undefined)
|
|
4602
|
+
e.lastSession = e.worker.session;
|
|
4603
|
+
delete e.worker;
|
|
4604
|
+
}
|
|
4581
4605
|
// NULL-OK: field session is OPTIONAL and therefore it is ok to check for NULL
|
|
4582
|
-
const keptSession = (worker) => (worker.session === undefined ? {} : { session: worker.session });
|
|
4606
|
+
const keptSession = (worker) => ({ ...(worker.session === undefined ? {} : { session: worker.session }), ...(worker.cwd === undefined ? {} : { cwd: worker.cwd }) });
|
|
4583
4607
|
/** 🔴 #4123 — a worker whose job record Claude Code no longer keeps: still the story's worker while a process runs its session or that process is inside its start grace, woken in its own session once none does and its transcript is on disk, ended when there is no session to wake. */
|
|
4584
4608
|
function goneWorker(worker, now, home) {
|
|
4585
4609
|
const gone = `its job ${worker.jobId} is no longer on Claude Code's record`;
|
|
@@ -4766,11 +4790,11 @@ export function storyWorkerLiveness(worker, now, home = claudeHome()) {
|
|
|
4766
4790
|
const BACKGROUNDED = /^backgrounded · (\S+)/m;
|
|
4767
4791
|
/** What `claude --bg --resume` adds when the session it was handed still runs, having started a second process on that session: `note: session <id> is already running in the background, so this started a copy as <copy>.` */
|
|
4768
4792
|
const STARTED_A_COPY = /session (\S+) is already running in the background, so this started a copy as ([^\s.]+)/;
|
|
4769
|
-
/** 🔴 #4123 — wakes a parked `claude --bg` session in place with `message
|
|
4770
|
-
export function wakeStoryWorker(sessionId, message,
|
|
4793
|
+
/** 🔴 #4123 — wakes a parked `claude --bg` session in place with `message`, run from `cwd`, the folder it was started in: passed no flags, Claude Code continues the same job with its own saved options. */
|
|
4794
|
+
export function wakeStoryWorker(sessionId, message, cwd, cli, now) {
|
|
4771
4795
|
return new Promise((resolve, reject) => {
|
|
4772
4796
|
fenceStart("claude", `claude --bg --resume ${sessionId}`);
|
|
4773
|
-
execFile(cli.cmd, [...cli.args, "--bg", "--resume", sessionId, message], { cwd
|
|
4797
|
+
execFile(cli.cmd, [...cli.args, "--bg", "--resume", sessionId, message], { cwd, windowsHide: true, timeout: LAUNCH_TIMEOUT_MS }, (err, stdout, stderr) => {
|
|
4774
4798
|
const said = `${stdout}${stderr}`;
|
|
4775
4799
|
const copy = STARTED_A_COPY.exec(said);
|
|
4776
4800
|
if (copy !== null) {
|
|
@@ -4972,7 +4996,7 @@ export async function retireStory(entry, board, worker, cli, record, home = clau
|
|
|
4972
4996
|
export async function retireEarlierClaudeJobs(entry, board, workerJob, cli, record, home = claudeHome()) {
|
|
4973
4997
|
const storyId = entry.storyId;
|
|
4974
4998
|
const held = [];
|
|
4975
|
-
const earlier = new Set(
|
|
4999
|
+
const earlier = new Set(claudeJobsOfStoryAnywhere(entry, board, 0, home));
|
|
4976
5000
|
earlier.delete(workerJob);
|
|
4977
5001
|
for (const jobId of earlier) {
|
|
4978
5002
|
const job = jobRecordOf(jobId, home);
|
|
@@ -5078,9 +5102,9 @@ export function purgeStoryWorker(sessions, home = claudeHome(), temp = tmpdir())
|
|
|
5078
5102
|
}
|
|
5079
5103
|
// GATE: how long a provider CLI is given to answer a worker start before the start is read as refused
|
|
5080
5104
|
const LAUNCH_TIMEOUT_MS = 60_000;
|
|
5081
|
-
/** A story's worker, started windowless in the
|
|
5082
|
-
export function launchStoryWorker(entry,
|
|
5083
|
-
return launchClaudeJob(entry.name, entry.model, workerBrief(entry),
|
|
5105
|
+
/** A story's worker, started windowless in `dir` (the story's own worktree when it has one, else the board) as a `claude --bg` session whose lifetime is the story's; `cli` is Claude Code's program as this machine runs it. */
|
|
5106
|
+
export function launchStoryWorker(entry, dir, cli, now, env) {
|
|
5107
|
+
return launchClaudeJob(entry.name, entry.model, workerBrief(entry), dir, cli, now, env);
|
|
5084
5108
|
}
|
|
5085
5109
|
const CLAUDE_MODEL = /^(default|best|inherit|opus|sonnet|haiku|fable|opusplan)(\[1m\])?$|^claude-/i;
|
|
5086
5110
|
const PINNED_MODELS = ["ANTHROPIC_SMALL_FAST_MODEL", "ANTHROPIC_DEFAULT_OPUS_MODEL", "ANTHROPIC_DEFAULT_SONNET_MODEL", "ANTHROPIC_DEFAULT_HAIKU_MODEL", "ANTHROPIC_DEFAULT_FABLE_MODEL"];
|
|
@@ -5132,12 +5156,12 @@ export async function launchClaudeJob(name, model, brief, cwd, cli, now, env = l
|
|
|
5132
5156
|
}
|
|
5133
5157
|
/**
|
|
5134
5158
|
* 🔴 #4306 — A CODEX-OWNED STORY'S START: the box's Codex login is read, ONE native session of the story's own is opened in the
|
|
5135
|
-
*
|
|
5159
|
+
* folder `cwd` (the story's own worktree when it has one, else the board) under `name` with the daemon's own configuration and the explicitly selected `model`, and `message` is posted
|
|
5136
5160
|
* into it — never a Claude chat, a `codex exec`, a second app server or a shared carrier; `record` is handed the worker as soon
|
|
5137
5161
|
* as its identity is known and again right before the post is sent. No login is {@link WorkerRefused}; an unsent first input keeps
|
|
5138
5162
|
* that same session with its input pending; a lost answer to the sent input is {@link WorkerStartUnconfirmed}.
|
|
5139
5163
|
*/
|
|
5140
|
-
export async function postCodexStory(control,
|
|
5164
|
+
export async function postCodexStory(control, cwd, name, message, now, record, held, model) {
|
|
5141
5165
|
let submitted = false;
|
|
5142
5166
|
let worker;
|
|
5143
5167
|
try {
|
|
@@ -5145,7 +5169,7 @@ export async function postCodexStory(control, board, name, message, now, record,
|
|
|
5145
5169
|
if (!login.signedIn)
|
|
5146
5170
|
throw new WorkerRefused(login.why);
|
|
5147
5171
|
await control.daemonUp();
|
|
5148
|
-
const main = await control.startMain(
|
|
5172
|
+
const main = await control.startMain(cwd, name, held, model, made => {
|
|
5149
5173
|
worker = { provider: "codex", codexDirect: true, nativeInputPending: true, startedAt: now, jobId: made.threadId, ...(model === undefined ? {} : { nativeModel: model }) };
|
|
5150
5174
|
record(worker);
|
|
5151
5175
|
});
|
|
@@ -727,7 +727,7 @@ function readMove(home, providerId) {
|
|
|
727
727
|
return undefined;
|
|
728
728
|
const move = JSON.parse(text);
|
|
729
729
|
if (!move || typeof move.at !== "number" || typeof move.kind !== "string" || typeof move.to !== "string") {
|
|
730
|
-
throw new
|
|
730
|
+
throw new UnreadableSettings(`${file} does not record a move (${text.slice(0, 200)}) — delete it and the next move writes it again`);
|
|
731
731
|
}
|
|
732
732
|
return move;
|
|
733
733
|
}
|
|
@@ -990,7 +990,7 @@ function keyRefusalId(identityId) {
|
|
|
990
990
|
function markKeyRefused(home, identityId, reason, at = Date.now()) {
|
|
991
991
|
markRefused(home, keyRefusalId(identityId), reason, at);
|
|
992
992
|
}
|
|
993
|
-
/** A settings value the shared reader refuses because what it holds cannot be read: a login map that is no map, a comment never closed, an identity list that is no list, a record with no id, two records sharing an id. */
|
|
993
|
+
/** A settings value the shared reader refuses because what it holds cannot be read: a login map that is no map, a comment never closed, an identity list that is no list, a record with no id, two records sharing an id, a move record that is not a move. */
|
|
994
994
|
class UnreadableSettings extends Error {
|
|
995
995
|
}
|
|
996
996
|
class NoOpenCodeKey extends Error {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omni-notify-mcp",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.406",
|
|
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",
|