omni-notify-mcp 1.3.312 → 1.3.314
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/agentGateway.js +2 -2
- package/dist/gateway/claudeProvider.js +2 -3
- package/dist/gateway/mcpDoor.js +12 -12
- package/dist/gateway/sessionDriver.js +2 -4
- package/dist/notify.js +1 -1
- package/dist/shared/agentSession.js +0 -1
- package/dist/shared/webhost/bullseyeWebHost.js +26 -0
- package/dist/shared/webhost/webviewShim.js +2 -4
- package/package.json +1 -1
package/dist/agentGateway.js
CHANGED
|
@@ -115,8 +115,8 @@ export class AgentGateway {
|
|
|
115
115
|
return this.driver.quiet() && [...this.turns.values()].every((turns) => turns.size === 0);
|
|
116
116
|
}
|
|
117
117
|
/** Gives the store back when this process hands the gateway over. */
|
|
118
|
-
shutdown() {
|
|
119
|
-
this.driver.shutdown();
|
|
118
|
+
async shutdown() {
|
|
119
|
+
await this.driver.shutdown();
|
|
120
120
|
this.recovered = false;
|
|
121
121
|
}
|
|
122
122
|
/** What this message asks of the agent, or undefined when it is not addressed to it and belongs to the inbox. */
|
|
@@ -318,12 +318,11 @@ class ClaudeSession {
|
|
|
318
318
|
sink.layers(clock.finish(monotonicMs(), this.debugFile));
|
|
319
319
|
this.sink = undefined;
|
|
320
320
|
}
|
|
321
|
-
// A session that was ended reads no record: its answer is refused here, before any record is read for it.
|
|
322
|
-
if (this.warm.stopped)
|
|
323
|
-
throw this.spec.failures.fail("the agent's session was ended");
|
|
324
321
|
// NULL-OK: field unsupported is OPTIONAL and therefore it is ok to check for NULL
|
|
325
322
|
if (this.unsupported !== undefined)
|
|
326
323
|
throw this.spec.failures.fail(`the agent asked BN for "${this.unsupported}", which BN does not answer — the session was ended.`);
|
|
324
|
+
if (this.warm.stopped)
|
|
325
|
+
throw this.spec.failures.fail("the agent's session was ended");
|
|
327
326
|
if (result.stdout === "") {
|
|
328
327
|
const exited = `the agent exited (code ${result.code ?? "none"}) without an answer while ${this.resumes ? "resuming" : "creating"} session ${this.spec.sessionId}${result.stderr.trim() ? `: ${result.stderr.trim().slice(-300)}` : ""}`;
|
|
329
328
|
if (this.resumes && !transcriptWritten(this.spec.sessionId))
|
package/dist/gateway/mcpDoor.js
CHANGED
|
@@ -46,8 +46,8 @@ A NEW conversation names the folder it works in and the agent CLI it runs, in th
|
|
|
46
46
|
agent_open opens a conversation with no message and starts nothing: it names its project and provider as above, 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.
|
|
47
47
|
An agent works on the project it runs in: its own folder is the board it writes to, so work belonging to another project is never done from this agent — 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.
|
|
48
48
|
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. Every agent respects the shared claim store, the one claims file this machine's doors write, so no Story is executed twice: a message naming a Story claims that Story in its conversation's own name for the length of its turn — a read-only question or a status check included — and a message whose Story another session already claims fails that turn in the claims file's own words, naming the holder. 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.
|
|
49
|
-
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
|
|
50
|
-
A call that finishes inside the wait returns the end of the turn itself — an answer, a
|
|
49
|
+
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.
|
|
50
|
+
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.
|
|
51
51
|
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.
|
|
52
52
|
Start a fresh conversation with new=true for each independent task as well, so a conversation carries one line of work and stays short of the length where it is compacted — compaction summarises the earlier turns and their detail is lost.
|
|
53
53
|
|
|
@@ -58,9 +58,9 @@ Which tool to call:
|
|
|
58
58
|
- agent_start: a long or autonomous task. It creates a new conversation and submits the text as its first task (turn 1) in one call, and returns the id at once without waiting.
|
|
59
59
|
- agent_open: an empty conversation with no agent work — no text, no project, no process and nothing spent. It returns {id, state}; pick its project with agent_project, then ask with agent_send.
|
|
60
60
|
- agent_project: sets or switches the project folder a conversation's agent works in, before its first message or between any two turns, also after work in another project. A switch while a turn is running is refused and says which turn.
|
|
61
|
-
- agent_send: a follow-up to a conversation that already exists. It appends the message and returns its position n at once without waiting; n is the turn to read the answer of. A message sent while a turn runs is queued behind that turn, not an interrupt
|
|
62
|
-
- agent_wait: the only way to read what happened. It is a read you call, not a notification BN pushes. wait=0 (the default) returns at once with whatever is there; wait up to ${MAX_WAIT_SECONDS} holds the call until a new event arrives. Pass after = the after the previous reply returned, which already counts the line that reply wrote; after=0 reads the log from the start, earlier turns included. The turn you asked for has ended at the first event whose turn is your n
|
|
63
|
-
- agent_stream: the
|
|
61
|
+
- agent_send: a follow-up to a conversation that already exists. It appends the message and returns its position n at once without waiting; n is the turn to read the answer of. A message sent while a turn runs is queued behind that turn, not an interrupt — also while a conversation's agent waits on a question on its own CLI screen, which the user answers on that screen, never by a message to the conversation.
|
|
62
|
+
- agent_wait: the only way to read what happened. It is a read you call, not a notification BN pushes. wait=0 (the default) returns at once with whatever is there; wait up to ${MAX_WAIT_SECONDS} holds the call until a new event arrives. Pass after = the after the previous reply returned, which already counts the line that reply wrote; after=0 reads the log from the start, earlier turns included. The turn you asked for has ended at the first event whose turn is your n and whose kind is answer or failed, or at an event of kind stopped.
|
|
63
|
+
- agent_stream: what the conversation's agent shows AS IT HAPPENS — not only the finished reply. It returns the URL of a live Server-Sent Events stream on this same door; attach with a plain HTTP GET, and reconnect with ?after=<seq> of the last frame you read to miss nothing. It is a read: it changes nothing and starts nothing. While the conversation's CLI is running — every Claude conversation's turns run in its own interactive CLI, and a CLI console session started on its own in the browser (mirrored at /terminal) is one too — the URL is that CLI's own console output, /v1/terminals/<id>/console, frames {seq,ts,kind:"output",text,reset}: its raw screen bytes, never a second CLI. Otherwise it is the turn stream, frames of kind doing (the tool a Codex turn is on) and turn (a start, status, place-in-line, answer or failure line). A CLI console session started on its own in the browser (no turn queue) also takes agent_send, agent_prompt and agent_wait straight into and out of that same CLI; a Claude conversation opened in the browser does not — its messages still go through its turn queue.
|
|
64
64
|
For a long autonomous task, call agent_start, then agent_wait with after=1 and wait=${MAX_WAIT_SECONDS}, again and again with the after each reply returned, until the turn ends; your own reply to the user can be written between reads. A follow-up is agent_send to the same id, then the same agent_wait loop with after = the n it returned.
|
|
65
65
|
To avoid submitting a task twice: agent_start already submitted its text, so do not agent_send the same text after it; a call that timed out or returned working=true has been received and is running, so read on with agent_wait instead of calling agent_prompt, agent_start or agent_send again with the same text.
|
|
66
66
|
To avoid blocking: agent_prompt and agent_wait with wait above 0 each hold the call for up to ${MAX_WAIT_SECONDS} seconds; agent_start, agent_send and agent_wait with wait=0 return at once.
|
|
@@ -131,7 +131,7 @@ function buildServer(caller, base) {
|
|
|
131
131
|
built += 1;
|
|
132
132
|
const server = new McpServer({ name: "notify-agent-gateway", version: PACKAGE_VERSION, icons: iconsFor(base) }, { instructions: INSTRUCTIONS, capabilities: EVENTS_CAPABILITY });
|
|
133
133
|
serveEvents(server.server, caller);
|
|
134
|
-
server.tool("agent_prompt", `Runs a request on this machine's own Claude Code agent — with the user's files, git repositories, shell and MCP servers — and returns the agent's answer. Each call goes on with the same agent as this connection's previous call, so the agent keeps what it already knows (a stopped one resumes); with no conversation named, new=true starts a fresh agent, and so does an ask that does not point at the work already under way while that agent is busy
|
|
134
|
+
server.tool("agent_prompt", `Runs a request on this machine's own Claude Code agent — with the user's files, git repositories, shell and MCP servers — and returns the agent's answer. Each call goes on with the same agent as this connection's previous call, so the agent keeps what it already knows (a stopped one resumes); with no conversation named, new=true starts a fresh agent, and so does an ask that does not point at the work already under way while that agent is busy. A message to a conversation whose agent waits on a question on its CLI screen is queued behind that turn and never answers it. Waits up to ${MAX_WAIT_SECONDS} seconds: the answer comes back in this call, or working=true with the id and position to read on with agent_wait. It is the convenience send-and-wait for a request expected to finish within about a minute; for a long or autonomous task use agent_start and then agent_wait, which do not hold a call open while the agent works. A call that returned working=true or timed out was received and is still running: read on with agent_wait, and do not call agent_prompt again with the same text, which would submit the task a second time. The result carries the ending event's timing, in which a reply's time is three separate figures rather than one number: bnMs, the end-to-end elapsed time from the request arriving at BN's door to the answer being stored; queuedMs (beside queued, whether it stood in line at all — false is the store's own statement that it never stood in line, absent is unmeasured), the part of it the message waited for a free slot or the turn ahead; and agentMs, the part the agent itself worked. totalMs is BN's own total from the message being stored to the answer being stored, never the agent's time, and rows carries the turn layer by layer. It also carries waitedMs, the milliseconds this call itself held on BN's own clock. When the id names a CLI console session (a CLI started on its own in the browser and mirrored at /terminal — not a conversation's own CLI opened there), the text is typed into that SAME live CLI and the call returns at once with {console:true, sent:true, stream, after} — there is no turn to wait on, so read the CLI's answer with agent_wait or agent_stream_read at that after, or attach to stream.`, {
|
|
135
135
|
text: z.string().min(1).describe("The user's request, as the user wrote it"),
|
|
136
136
|
conversation: z.string().min(1).optional().describe("A 'conversation' id an earlier agent_prompt returned, to address that agent; without it the call goes on with this connection's current agent"),
|
|
137
137
|
new: z.boolean().optional().describe("true starts a fresh agent instead of going on with the current one; with a conversation named it is ignored, because that conversation is addressed as usual"),
|
|
@@ -182,10 +182,10 @@ function buildServer(caller, base) {
|
|
|
182
182
|
return { ...head, [REPLY_FIELD[reply.kind]]: reply.text, timing: reply.timing, waitedMs, events: others, after };
|
|
183
183
|
if (ended)
|
|
184
184
|
return { ...head, stopped: true, waitedMs, events: others, after };
|
|
185
|
-
return { ...head, working: true, waitedMs, events: others, after, next: `call agent_wait with id="${sent.id}", after=${after}, wait=${MAX_WAIT_SECONDS} until an event of kind answer,
|
|
185
|
+
return { ...head, working: true, waitedMs, events: others, after, next: `call agent_wait with id="${sent.id}", after=${after}, wait=${MAX_WAIT_SECONDS} until an event of kind answer, failed or stopped arrives` };
|
|
186
186
|
}));
|
|
187
187
|
server.tool("agent_projects", `The project folders on this machine (the folders under ${workspaceRoot()}), each with its absolute path and whether it is a git repository.`, {}, () => act(() => listProjects()));
|
|
188
|
-
server.tool("agent_start", `Creates a new conversation AND submits text as its first task (turn 1) in one call, and returns {id, state} at once without waiting for the agent. The way to run a long or autonomous task: read its progress and answer with agent_wait {id, after:1, wait:${MAX_WAIT_SECONDS}}, again with the after each reply returned, until an event of kind answer
|
|
188
|
+
server.tool("agent_start", `Creates a new conversation AND submits text as its first task (turn 1) in one call, and returns {id, state} at once without waiting for the agent. The way to run a long or autonomous task: read its progress and answer with agent_wait {id, after:1, wait:${MAX_WAIT_SECONDS}}, again with the after each reply returned, until an event of kind answer or failed with turn 1, or of kind stopped, arrives. The task is already submitted, so do not also agent_send the same text, and do not call agent_start again for it — each call starts another agent on the task. agent_prompt sends and waits in one blocking call instead.`, { project: z.enum(allowedProjects()).optional().describe(`The workspace this conversation runs in: exactly one of ${allowedProjects().join(" or ")}, resolved under ${workspaceRoot()}; no path is accepted. Required here, because this call creates the conversation — it is never resolved from the text`), text: z.string().min(1).describe("The first task, submitted by this call itself"), provider: z.string().min(1).optional().describe(`The agent CLI this conversation runs: exactly one of ${PROVIDER_NAMES.join(", ")}. Required here, beside project`), model: z.string().min(1).optional() }, ({ project, text, provider, model }) => act(() => {
|
|
189
189
|
const arrived = performance.now();
|
|
190
190
|
const arrival = arrivalOf(requestIdOf(), randomUUID().slice(0, 8));
|
|
191
191
|
const meta = startConversation({ platform: "mcp", technical: true, chat: caller, project: namedProject(project), provider: namedProvider(provider), model, text, receivedMs: Math.round(performance.now() - arrived), arrival });
|
|
@@ -195,7 +195,7 @@ function buildServer(caller, base) {
|
|
|
195
195
|
const meta = openConversation({ platform: "mcp", technical: true, chat: caller, project: namedProject(project), provider: namedProvider(provider), model });
|
|
196
196
|
return { id: meta.id, state: meta.state };
|
|
197
197
|
}));
|
|
198
|
-
server.tool("agent_send", `Sends a message to a conversation that already exists (agent_start or agent_prompt made it) and returns {n} at once without waiting for the agent. n is the message's position in the log and the number of the turn it starts: read its answer with agent_wait {id, after:n, wait:${MAX_WAIT_SECONDS}}. A message sent while a turn runs is queued behind that turn, not an interrupt
|
|
198
|
+
server.tool("agent_send", `Sends a message to a conversation that already exists (agent_start or agent_prompt made it) and returns {n} at once without waiting for the agent. n is the message's position in the log and the number of the turn it starts: read its answer with agent_wait {id, after:n, wait:${MAX_WAIT_SECONDS}}. A message sent while a turn runs is queued behind that turn, not an interrupt — also while a conversation's agent waits on a question on its own CLI screen, which the user answers there by opening the conversation in BN, never by a message to it. A stopped or archived conversation resumes. Each call submits its text once more, so do not repeat a send that returned.`, { id: z.string().min(1).describe("The conversation id agent_start returned, or the 'conversation' agent_prompt returned"), text: z.string().min(1).describe("The follow-up message; the first task belongs in agent_start") }, ({ id, text }) => act(async () => {
|
|
199
199
|
// A CLI console session gets the message typed into the CLI it already runs (#3434) — the same session the browser mirrors.
|
|
200
200
|
const live = consoleOf(id);
|
|
201
201
|
if (live !== undefined) {
|
|
@@ -208,7 +208,7 @@ function buildServer(caller, base) {
|
|
|
208
208
|
const arrived = performance.now();
|
|
209
209
|
return { n: sendToConversation(id, text, Math.round(performance.now() - arrived), arrivalOf(requestIdOf(), randomUUID().slice(0, 8))).n };
|
|
210
210
|
}));
|
|
211
|
-
server.tool("agent_wait", `Reads a conversation's events past position 'after' — a long-poll read the caller repeats, not a notification BN pushes. With wait=0 (the default) it returns at once with whatever is there; with wait above 0 it holds the call until a new event arrives or the wait (at most ${MAX_WAIT_SECONDS} seconds) runs out, and an empty events list means nothing new yet. Repeat the call with the reply's after value (the position it leaves you at, a line it wrote itself included) until the turn you wait on ends: an event of kind answer
|
|
211
|
+
server.tool("agent_wait", `Reads a conversation's events past position 'after' — a long-poll read the caller repeats, not a notification BN pushes. With wait=0 (the default) it returns at once with whatever is there; with wait above 0 it holds the call until a new event arrives or the wait (at most ${MAX_WAIT_SECONDS} seconds) runs out, and an empty events list means nothing new yet. Repeat the call with the reply's after value (the position it leaves you at, a line it wrote itself included) until the turn you wait on ends: an event of kind answer or failed whose turn is that turn's number (1 after agent_start, the n agent_send returned), or an event of kind stopped. A question the agent asks does not end the turn: a status event says it waits on its own CLI screen, and the turn goes on once the user answers there. after=0 reads the log from the start, earlier turns' answers included. The state is not the end of the turn, because a conversation stays running until its idle process is freed. Reading sends nothing, so it is always safe to call again. Each answer or failed event carries its timing, in which a reply's time is three separate figures rather than one number: bnMs, the end-to-end elapsed time from the request arriving at BN's door to the answer being stored; queuedMs (beside queued, whether it stood in line at all — false is the store's own statement that it never stood in line, absent is unmeasured), the part of it the message waited for a free slot or the turn ahead; and agentMs, the part the agent itself worked. totalMs is BN's own total from the message being stored to the answer being stored, never the agent's time, and rows carries the turn layer by layer.`, { id: z.string().min(1), after: z.number().int().min(0).default(0).describe("The last event position n already read; events past it are returned. 1 right after agent_start, the n agent_send returned after a send"), wait: z.number().min(0).default(0).describe(`Seconds to hold the call for a new event, capped at ${MAX_WAIT_SECONDS}; 0 returns at once`) }, ({ id, after, wait }) => {
|
|
212
212
|
// A CLI console session has no turn log — its answer is the live console output, read the same way agent_stream serves it (#3434).
|
|
213
213
|
const live = consoleOf(id);
|
|
214
214
|
if (live !== undefined)
|
|
@@ -240,7 +240,7 @@ function buildServer(caller, base) {
|
|
|
240
240
|
});
|
|
241
241
|
server.tool("agent_project", `Sets or switches the project folder a conversation's agent works in — before its first message, or between any two turns, also after work in another project. The next turn's agent runs in that folder and writes to its board, while the conversation's id, its whole transcript and the agent itself stay: the same session carries on in the new folder with its earlier turns in hand, so this NEVER starts a new agent and never makes a new conversation. A switch is refused at two safe boundaries — while a turn is running, named with the running turn's number, and while a browser CLI is running the conversation's own session, because a running process is never moved under itself. Either refusal leaves the record on its old project.`, { id: z.string().min(1).describe("The conversation id agent_open or agent_start returned, or the 'conversation' agent_prompt returned"), project: z.enum(allowedProjects()).describe(`Exactly one of ${allowedProjects().join(" or ")}, resolved under ${workspaceRoot()}; no path is accepted`) }, ({ id, project }) => act(() => setConversationProject(id, project)));
|
|
242
242
|
server.tool("agent_status", "One conversation's project (absent until one is chosen), provider, model and state, with its title (the name its session carries in Claude's session list), its lifecycle (active while a turn runs, is queued or waits on the user's answer; idle when open with no turn; completed once stopped or archived) and beside (the conversation of the same connection it was opened next to, if any).", { id: z.string().min(1) }, ({ id }) => act(() => describeConversation(readConversation(id))));
|
|
243
|
-
server.tool("agent_stream", `Where to attach to a conversation's LIVE stream:
|
|
243
|
+
server.tool("agent_stream", `Where to attach to a conversation's LIVE stream: what its agent shows AS IT HAPPENS, not only the finished reply that agent_prompt and agent_wait carry. It returns {conversation, url, after, console?}. Attach to url with a plain HTTP GET; the answer is a Server-Sent Events stream, one 'data: <frame>' line per frame. While the conversation's CLI is running — every Claude conversation's turns run in its own interactive CLI, and a CLI console session started on its own in the browser and mirrored at /terminal is one too — console is true and the url is that CLI's own console output at /v1/terminals/<id>/console: frames {seq, ts, kind:"output", text, reset} carrying its raw screen bytes (its prompt, tool traces and any question it waits on), never a second CLI. Otherwise the url is the conversation's turn stream: frames {seq, ts, kind, text, turn} where kind is doing (the tool a Codex turn is on) or turn (a start, status, place-in-line, answer or failure line). Reconnect with ?after=<seq> of the last frame you read and you are handed every frame past it: nothing you already received is repeated and nothing new is missed. It is a read — it starts no agent, spends nothing and changes nothing — and it is the live feed of the agent that agent_start or agent_send is running. A CLI console session started on its own in the browser takes agent_send and agent_prompt typed straight into it; a Claude conversation's messages go through its turn queue, which types each one into that same CLI.`, { id: z.string().min(1).describe("The conversation id agent_start, agent_prompt or agent_open returned"), after: z.number().int().min(0).optional().describe("The last frame seq you already have; the stream resumes past it") }, ({ id, after }) => act(() => {
|
|
244
244
|
// A CLI console session (one opened in the browser) streams the CLI's OWN output (#3434) — the SAME session, not a
|
|
245
245
|
// second CLI and not the turn stream it does not keep.
|
|
246
246
|
const live = consoleOf(id);
|
|
@@ -253,7 +253,7 @@ function buildServer(caller, base) {
|
|
|
253
253
|
url.searchParams.set("after", String(after));
|
|
254
254
|
return { conversation: id, url: url.toString(), after: after ?? 0, ...(live === undefined ? {} : { console: true }) };
|
|
255
255
|
}));
|
|
256
|
-
server.tool("agent_stream_read", `Reads a conversation's LIVE stream as a tool call
|
|
256
|
+
server.tool("agent_stream_read", `Reads a conversation's LIVE stream as a tool call, as it happens — the same frames agent_stream's url carries, for a caller that invokes tools and cannot hold a Server-Sent Events connection. While the conversation's CLI is running — every Claude conversation's turns run in its own interactive CLI, and a CLI console session started on its own in the browser is one too — console is true and each call returns that CLI's console output past 'after' as one frame {seq, ts, kind:"output", text, reset}: its raw screen bytes. Otherwise each call returns the turn stream's frames past 'after', in arrival order, each one {seq, ts, kind, text, turn} where kind is doing (the tool a Codex turn is on) or turn (a start, status, place-in-line, answer or failure line). The reply's 'after' is the value to pass next, so nothing is ever repeated and nothing between two calls is missed. wait=0 (the default) returns at once with whatever is there, and an empty frames list means nothing new yet; wait above 0 holds the call until a frame arrives, at most ${MAX_WAIT_SECONDS} seconds. It is a read — it starts no agent, spends nothing and changes nothing — and it is the live feed of the agent that agent_start or agent_send is running.`, {
|
|
257
257
|
id: z.string().min(1).describe("The conversation id agent_start, agent_prompt or agent_open returned"),
|
|
258
258
|
after: z.number().int().min(0).default(0).describe("The last frame seq already read; frames past it are returned. 0 reads the stream from its start"),
|
|
259
259
|
wait: z.number().min(0).default(0).describe(`Seconds to hold the call for a new frame, capped at ${MAX_WAIT_SECONDS}; 0 returns at once`),
|
|
@@ -422,7 +422,7 @@ export class SessionDriver {
|
|
|
422
422
|
quiet() {
|
|
423
423
|
return this.driving.size === 0 && this.waiting.length === 0;
|
|
424
424
|
}
|
|
425
|
-
/** Hands the store back: the beat stops
|
|
425
|
+
/** Hands the store back: the beat stops, every held session's process is ended and awaited, and each conversation keeps its record until the next boot resets it to idle. */
|
|
426
426
|
async shutdown() {
|
|
427
427
|
this.stopping = true;
|
|
428
428
|
this.watcher?.close();
|
|
@@ -1164,7 +1164,6 @@ export class SessionDriver {
|
|
|
1164
1164
|
listener({ ...event, id });
|
|
1165
1165
|
return event;
|
|
1166
1166
|
}
|
|
1167
|
-
/** Ends a session's process and gives its slot back; `keep` leaves the record's own state to the caller that is handing the session over. */
|
|
1168
1167
|
/** Ends the process of a live session and forgets the session; the record is left as its caller sets it. */
|
|
1169
1168
|
endLive(id) {
|
|
1170
1169
|
const live = this.lives.get(id);
|
|
@@ -1182,8 +1181,7 @@ export class SessionDriver {
|
|
|
1182
1181
|
}
|
|
1183
1182
|
/** Ends a session's process and gives its slot back; `keep` leaves the record's own state to the caller that is handing the session over. */
|
|
1184
1183
|
free(id, state) {
|
|
1185
|
-
|
|
1186
|
-
if (this.stopping || this.lives.get(id) === undefined)
|
|
1184
|
+
if (this.stopping || !this.lives.has(id))
|
|
1187
1185
|
return;
|
|
1188
1186
|
this.endLive(id);
|
|
1189
1187
|
if (state !== "keep")
|
package/dist/notify.js
CHANGED
|
@@ -255,7 +255,6 @@ export class WarmSession {
|
|
|
255
255
|
return !this.ended && this.child.exitCode === null && this.child.signalCode === null && this.startError === undefined && this.writeError === undefined;
|
|
256
256
|
}
|
|
257
257
|
read(chunk) {
|
|
258
|
-
// A session that was ended reads nothing more: its state is gone, so no line of its output is handed on.
|
|
259
258
|
if (this.ended)
|
|
260
259
|
return;
|
|
261
260
|
this.lineBuffer += chunk;
|
|
@@ -811,6 +811,32 @@ class WebHost {
|
|
|
811
811
|
if (home !== null && ROSTER_EXTENSIONS.has(this.extension)) {
|
|
812
812
|
return send(response, 200, MIME[".html"], peekedRosterPage(this.label, home, workspacesServed(this.extension, base).get(home)?.[page.name]), { "Cache-Control": "no-store" });
|
|
813
813
|
}
|
|
814
|
+
let chosen = "";
|
|
815
|
+
if (this.currentOf(url.searchParams) === "") {
|
|
816
|
+
try {
|
|
817
|
+
chosen = chosenWorkspace();
|
|
818
|
+
}
|
|
819
|
+
catch (err) {
|
|
820
|
+
if (!(err instanceof SyntaxError) && !(err instanceof TypeError))
|
|
821
|
+
throw err;
|
|
822
|
+
// OWNER: the page request is this read's trigger root — a pick file that is not a label serves the page at its own address, and the picker's own read puts chosenUnreadable on screen.
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
let remembered;
|
|
826
|
+
try {
|
|
827
|
+
// NULL-OK: field workspaces(base).get(chosen) is OPTIONAL and therefore it is ok to check for NULL
|
|
828
|
+
remembered = chosen === "" ? undefined : this.workspaces(base).get(chosen)?.[page.name];
|
|
829
|
+
}
|
|
830
|
+
catch (err) {
|
|
831
|
+
if (!(err instanceof SyntaxError))
|
|
832
|
+
throw err;
|
|
833
|
+
// OWNER: the page request is this read's trigger root — a workspace list that cannot be read serves the page at its own address, and the picker's own read puts listUnreadable on screen.
|
|
834
|
+
remembered = undefined;
|
|
835
|
+
}
|
|
836
|
+
// NULL-OK: field remembered is OPTIONAL and therefore it is ok to check for NULL
|
|
837
|
+
if (remembered !== undefined) {
|
|
838
|
+
return send(response, 302, MIME[".txt"], `moved to ${remembered}`, { Location: remembered, "Cache-Control": "no-store" });
|
|
839
|
+
}
|
|
814
840
|
return this.serveDocument(page, response);
|
|
815
841
|
}
|
|
816
842
|
/** The workspaces a page of this host can switch to: label -> { page -> address }, built on `base` when the request came through the gateway. The workspaces are this window's own and the ones on the workspace list; a live window's record is only the address of that window's pages, never a source of the list. */
|
|
@@ -145,10 +145,8 @@ const PICKER_SOURCE = String.raw `
|
|
|
145
145
|
window.sessionStorage.removeItem(moved);
|
|
146
146
|
}
|
|
147
147
|
var remembered = served.chosen;
|
|
148
|
-
if (served.
|
|
149
|
-
|
|
150
|
-
window.location.assign(served.workspaces[remembered][page]);
|
|
151
|
-
return;
|
|
148
|
+
if (served.chosenUnreadable !== undefined) {
|
|
149
|
+
notice("__bullseye-workspace-pick-unread", "⛔ The workspace you last picked could not be read: " + served.chosenUnreadable + " — pick one in the bar above to replace it");
|
|
152
150
|
}
|
|
153
151
|
if (labels.length <= 1) {
|
|
154
152
|
return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omni-notify-mcp",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.314",
|
|
4
4
|
"description": "Reach your AI agents from anywhere — and let them reach you. One stdio process 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/index.js",
|
|
6
6
|
"type": "module",
|