omni-notify-mcp 1.3.414 → 1.3.415
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.
|
@@ -4,6 +4,8 @@ import { CONFIG_DIR } from "../notify.js";
|
|
|
4
4
|
let personId;
|
|
5
5
|
void import("./passkeyDoor.js").then((door) => { personId = door.personId; });
|
|
6
6
|
import { createConversationOwner } from "../shared/conversation/conversationOwner.js";
|
|
7
|
+
import { GatewayError } from "../shared/conversation/conversations.js";
|
|
8
|
+
import { sameRoot } from "../shared/webhost/workspaceList.js";
|
|
7
9
|
import { FLEET_OWNER } from "../shared/providerOwnership.js";
|
|
8
10
|
function driverOptions() {
|
|
9
11
|
const bundledGuard = new URL("../scripts/shared/", import.meta.url);
|
|
@@ -124,3 +126,16 @@ export { AgentTurnFailed, agentEnv, nativeAgentEnv, nativeCliRefusal } from "../
|
|
|
124
126
|
export { CliSession, CliEnded, LoggedCliSession, folderKey, plain, sameText, endsWithTyped, tailOf, logRow } from "../shared/conversation/cliSession.js";
|
|
125
127
|
export { nativeCliInvocation } from "../shared/conversation/nativeCliInvocation.js";
|
|
126
128
|
export { archiveCodexThread } from "../shared/conversation/codexArchive.js";
|
|
129
|
+
/** #4471 — one conversation as the CLI page reads it (`GET /v1/conversations/{id}`) and `agent_status` answers: its record with title and lifecycle, the native CLI state (pid, input version, model, startup diagnostic, pending input) and whether a turn is running — the page and the tool read the one producer. */
|
|
130
|
+
export function conversationReading(meta) {
|
|
131
|
+
const native = conversationOwner.driver.nativeState(meta.id);
|
|
132
|
+
return { ...conversationOwner.store.describeConversation(meta), ...native, working: native.working || conversationOwner.store.turnInFlight(conversationOwner.store.readEvents(meta.id), meta) !== undefined };
|
|
133
|
+
}
|
|
134
|
+
/** #4471 — which agent CLIs can start in a project and why one cannot (`GET /v1/providers`, `agent_providers`): the project named exactly as a creation names it, refused for a scoped caller outside its own workspace. */
|
|
135
|
+
export function providerStartupReading(project, viewer) {
|
|
136
|
+
conversationOwner.store.requireConversationEnabled();
|
|
137
|
+
const folder = conversationOwner.store.namedProject(project);
|
|
138
|
+
if (viewer !== undefined && !sameRoot(conversationOwner.store.workspaceOf(folder), viewer.folder))
|
|
139
|
+
throw new GatewayError(403, "This provider startup reading belongs to another workspace");
|
|
140
|
+
return { providers: conversationOwner.driver.availability(folder) };
|
|
141
|
+
}
|
package/dist/gateway/mcpDoor.js
CHANGED
|
@@ -21,7 +21,7 @@ import { performance } from "perf_hooks";
|
|
|
21
21
|
import { z } from "zod";
|
|
22
22
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
23
23
|
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
|
|
24
|
-
import { GatewayError, MAX_WAIT_SECONDS, archiveConversation, deleteConversation, describeConversation, lastEventNumber, listProjects, createdOn, creationPending, openConversation, readConversation, routeAsk, requireConversationEnabled, sendToConversation, setConversationProject, shelvedConversations, stampWaitReturn, startConversation, stopConversation, unarchiveConversation, waitForEvents, waitForTurn, workspaceRoot, allowedProjects, requireOwnCli, scopedConversation, namedWorkspace, } from "./conversationOwner.js";
|
|
24
|
+
import { GatewayError, MAX_WAIT_SECONDS, conversationOwner, conversationReading, providerStartupReading, archiveConversation, deleteConversation, describeConversation, lastEventNumber, listProjects, createdOn, creationPending, openConversation, readConversation, routeAsk, requireConversationEnabled, sendToConversation, setConversationProject, shelvedConversations, stampWaitReturn, startConversation, stopConversation, unarchiveConversation, waitForEvents, waitForTurn, workspaceRoot, allowedProjects, requireOwnCli, scopedConversation, namedWorkspace, } from "./conversationOwner.js";
|
|
25
25
|
import { workspacesFile } from "../shared/webhost/workspaceList.js";
|
|
26
26
|
import { PROVIDER_NAMES } from "./conversationOwner.js";
|
|
27
27
|
import { iconsFor } from "./iconDoor.js";
|
|
@@ -300,7 +300,8 @@ function buildServer(caller, base, offer) {
|
|
|
300
300
|
}).then((result) => { row(outcome ?? `refused why=${result.content[0]?.text ?? "the call was refused"}`); return result; }, (err) => { row(outcome ?? `refused why=${err instanceof Error ? err.message : String(err)}`); throw err; });
|
|
301
301
|
});
|
|
302
302
|
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: projectField(offer).describe(`Exactly one of ${offer.either}, resolved under ${offer.under}; no path is accepted`) }, ({ id, project }) => act(() => setConversationProject(seen(id), project)));
|
|
303
|
-
server.tool("agent_status", "One conversation
|
|
303
|
+
server.tool("agent_status", "Read-only. One conversation exactly as the CLI page reads it: its project (absent until one is chosen), provider, model and state, 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), beside (the conversation of the same connection it was opened next to, if any), and the native CLI state: working (a turn runs, also one typed straight into the CLI), pendingInput, nativePid, inputVersion (what agent_stop expectedInputVersion takes), nativeModel and startupDiagnostic. A conversation outside the caller's workspace is refused as not found.", { id: z.string().min(1) }, ({ id }) => act(() => conversationReading(scopedConversation(id, viewerNow()))));
|
|
304
|
+
server.tool("agent_providers", "Read-only. Which agent CLIs can start in a project and why one cannot, as the CLI page's New Agent reads it before offering a CLI: {providers:[{name, label, reason?}]}, reason present only when that CLI cannot start there. The project is named as a new conversation names it (exactly one of the listed projects); a caller scoped to one workspace is refused another workspace's project. Starts nothing and spends nothing.", { project: z.string().min(1).describe("Exactly one of the project names agent_projects lists") }, ({ project }) => act(() => providerStartupReading(project, viewerNow())));
|
|
304
305
|
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. Every conversation on claude, codex, copilot or opencode runs in ONE interactive CLI of its own — the same process the browser shows and agent_send types into — and this returns {conversation, url, after, console:true}, url being that CLI's own console output at /v1/terminals/<id>/console. Attach with a plain HTTP GET; the answer is a Server-Sent Events stream of frames {seq, ts, kind:"output", text, reset} carrying its raw screen bytes (its prompt, tool traces and any question it waits on). Reconnect with ?after=<seq> of the last frame you read and you are handed every byte past it. It is a read — it starts no agent, spends nothing and changes nothing.`, { 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(() => {
|
|
305
306
|
seen(id);
|
|
306
307
|
requireOwnCli(id);
|
|
@@ -325,7 +326,7 @@ function buildServer(caller, base, offer) {
|
|
|
325
326
|
return { conversation: id, console: true, frames, seq: read.after, after: read.after };
|
|
326
327
|
}));
|
|
327
328
|
server.tool("agent_list", "Every agent conversation BN holds on this machine, newest first (conversations, not projects — agent_projects lists projects), each with its title, lifecycle (active, idle or completed) and beside as agent_status gives them. archived=true lists the archived ones instead; BN archives a conversation by itself once it has sat 8 hours with no turn in flight, and a message to it brings it back.", { archived: z.boolean().default(false).describe("true lists the Archived conversations instead of the default list") }, ({ archived }) => act(() => ({ conversations: shelvedConversations(archived ? "archived" : "active", viewerNow()).map(describeConversation) })));
|
|
328
|
-
server.tool("agent_stop", "Stop a conversation and free its agent; a later message resumes it.", { id: z.string().min(1) }, ({ id }) => act(() => stopConversation(seen(id))));
|
|
329
|
+
server.tool("agent_stop", "Stop a conversation and free its agent; a later message resumes it. Pass expectedConsumed (the conversation's consumed turn count) with expectedInputVersion (the inputVersion agent_status read) to stop it only if nothing newer arrived since that read — the same guarded Stop the REST door runs; a conversation with newer or unfinished work is refused and nothing is stopped.", { id: z.string().min(1), expectedConsumed: z.number().int().min(0).optional(), expectedInputVersion: z.string().optional() }, ({ id, expectedConsumed, expectedInputVersion }) => act(() => (expectedConsumed === undefined ? stopConversation(seen(id)) : conversationOwner.stopIfCurrent(seen(id), { expectedConsumed, expectedInputVersion: expectedInputVersion ?? null }))));
|
|
329
330
|
server.tool("agent_archive", "Archive a conversation: it is stopped and moved off the default list to the Archived list with its transcript kept. agent_list archived=true shows it; a message to it (agent_send or agent_prompt) brings it back and resumes it.", { id: z.string().min(1), restore: z.boolean().default(false).describe("true moves an archived conversation back to the default list instead") }, ({ id, restore }) => act(() => (seen(id), restore ? unarchiveConversation(id) : archiveConversation(id))));
|
|
330
331
|
server.tool("agent_delete", "Delete a conversation for good: a running agent is stopped first, then the conversation and its transcript are removed from BN. It cannot be undone — agent_archive keeps the transcript instead.", { id: z.string().min(1) }, ({ id }) => act(() => deleteConversation(seen(id))));
|
|
331
332
|
server.tool("agent_terminals", "The agent CLIs this person has open on this machine (what the CLI page lists) with the CLIs New Agent can open and whether each takes a model; id names one terminal and answers only its facts. A read — it starts nothing.", { id: z.string().min(1).optional().describe("One terminal's conversation id; without it every open terminal is listed beside the CLIs New Agent offers") }, ({ id }) => act(async () => (id === undefined ? scopedListing(await terminalListing(personId())) : (seen(id), nativeTerminal(personId(), id).info()))));
|
package/dist/gateway/restDoor.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* once a passkey is enrolled the gateway token is honoured only on a request from this machine.
|
|
10
10
|
*/
|
|
11
11
|
import { createServer } from "http";
|
|
12
|
-
import { GatewayError, archiveConversation, conversationOwner, deleteConversation, listProjects, monotonicMs, scopedConversation, viewerOfHeaders, createdOn, creatorOf, openConversation, readConversation, requireConversationEnabled, sendToConversation, setConversationProject, shelvedConversations, startConversation, stopConversation, unarchiveConversation, waitForEvents,
|
|
12
|
+
import { GatewayError, conversationReading, providerStartupReading, archiveConversation, conversationOwner, deleteConversation, listProjects, monotonicMs, scopedConversation, viewerOfHeaders, createdOn, creatorOf, openConversation, readConversation, requireConversationEnabled, sendToConversation, setConversationProject, shelvedConversations, startConversation, stopConversation, unarchiveConversation, waitForEvents, } from "./conversationOwner.js";
|
|
13
13
|
import { CHAT_HEADERS } from "./chatPage.js";
|
|
14
14
|
import { isIconPath, serveIcon } from "./iconDoor.js";
|
|
15
15
|
import { handleMcp } from "./mcpDoor.js";
|
|
@@ -20,7 +20,6 @@ import { conversationSwitchRead, panelState, saveConversationSwitch, saveSetting
|
|
|
20
20
|
import { PANEL_PAGES, panelHtml } from "./panelPage.js";
|
|
21
21
|
import { wizard } from "./publicAccess.js";
|
|
22
22
|
import { terminalHtml } from "./terminalPage.js";
|
|
23
|
-
import { AgentGateway } from "../agentGateway.js";
|
|
24
23
|
import { ServiceHost } from "../shared/webhost/bullseyeWebHost.js";
|
|
25
24
|
import { sameRoot, workspacesHere } from "../shared/webhost/workspaceList.js";
|
|
26
25
|
export const BAD_TOKEN_ERROR = "missing or wrong token";
|
|
@@ -128,12 +127,7 @@ async function route(req, url, arrivedAt) {
|
|
|
128
127
|
if (resource === "projects" && parts.length === 2 && method === "GET")
|
|
129
128
|
return { status: 200, body: listProjects(viewerOfHeaders(req.headers, fromThisMachine(req))) };
|
|
130
129
|
if (resource === "providers" && parts.length === 2 && method === "GET") {
|
|
131
|
-
|
|
132
|
-
const project = namedProject(url.searchParams.get("project"));
|
|
133
|
-
const viewer = viewerOfHeaders(req.headers, fromThisMachine(req));
|
|
134
|
-
if (viewer !== undefined && !sameRoot(workspaceOf(project), viewer.folder))
|
|
135
|
-
throw new GatewayError(403, "This provider startup reading belongs to another workspace");
|
|
136
|
-
return { status: 200, body: { providers: AgentGateway.instance().driver.availability(project) } };
|
|
130
|
+
return { status: 200, body: providerStartupReading(url.searchParams.get("project"), viewerOfHeaders(req.headers, fromThisMachine(req))) };
|
|
137
131
|
}
|
|
138
132
|
if (resource !== "conversations")
|
|
139
133
|
throw new GatewayError(404, "unknown route");
|
|
@@ -162,9 +156,7 @@ async function route(req, url, arrivedAt) {
|
|
|
162
156
|
}
|
|
163
157
|
else if (sub === undefined) {
|
|
164
158
|
if (method === "GET") {
|
|
165
|
-
|
|
166
|
-
const native = AgentGateway.instance().driver.nativeState(id);
|
|
167
|
-
return { status: 200, body: { ...current, ...native, working: native.working || turnInFlight(readEvents(id), current) !== undefined } };
|
|
159
|
+
return { status: 200, body: conversationReading(readConversation(id)) };
|
|
168
160
|
}
|
|
169
161
|
if (method === "DELETE") {
|
|
170
162
|
const expected = url.searchParams.get("expectedConsumed");
|
|
@@ -1005,7 +1005,11 @@ function identitiesHere() {
|
|
|
1005
1005
|
read = deepagentSettings();
|
|
1006
1006
|
}
|
|
1007
1007
|
catch (absent) {
|
|
1008
|
-
|
|
1008
|
+
const store = workspaceStore();
|
|
1009
|
+
// A checkout off the workspace list keeps machine-wide settings unread by design (savedSettings answers undefined for it): OpenCode is told that, never "no key".
|
|
1010
|
+
if (absent instanceof store.WorkspaceNotListed)
|
|
1011
|
+
throw new NoOpenCodeKey("the BullseyeVSC checkout is not on this machine's workspace list, so DeepAgent's keys are not read here and OpenCode is handed none — add it on Bullseye Control");
|
|
1012
|
+
if (!(absent instanceof store.SettingsUndefined))
|
|
1009
1013
|
throw absent;
|
|
1010
1014
|
throw new NoOpenCodeKey(`${absent.message}, so this machine holds no DeepAgent key OpenCode could be handed`);
|
|
1011
1015
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omni-notify-mcp",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.415",
|
|
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",
|