Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a069d61fbd |
@@ -33,7 +33,7 @@ this node a subscription token. Nothing else under the home is read or written.
|
|||||||
Everything between this module and the rest of the mesh is NATS, in three kinds: an **event** says that
|
Everything between this module and the rest of the mesh is NATS, in three kinds: an **event** says that
|
||||||
something happened and carries no secret, because a stream keeps it; a **request** carries a token,
|
something happened and carries no secret, because a stream keeps it; a **request** carries a token,
|
||||||
because nothing keeps it (hq design 32 §10); and **state** is the current value of something every node
|
because nothing keeps it (hq design 32 §10); and **state** is the current value of something every node
|
||||||
must see, a node that joins later included — kept, so it carries no secret either (hq ADR 0202).
|
must see, a node that joins later included — kept, so it carries no secret either (hq ADR 0201).
|
||||||
|
|
||||||
| what | how |
|
| what | how |
|
||||||
|---|---|
|
|---|---|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
// - a login a person made here — a refresh token this module never writes — is offered to the seat at
|
// - a login a person made here — a refresh token this module never writes — is offered to the seat at
|
||||||
// once, sealed to the seat's key: the one moment a refresh token travels, because the login made the
|
// once, sealed to the seat's key: the one moment a refresh token travels, because the login made the
|
||||||
// manager's stale;
|
// manager's stale;
|
||||||
// - an MCP server registered through this module is **state, not an event** (novox/hq ADR 0202): one
|
// - an MCP server registered through this module is **state, not an event** (novox/hq ADR 0201): one
|
||||||
// key per server in the module's `servers` bucket — `all.<server>` for every node, `<node>.<server>`
|
// key per server in the module's `servers` bucket — `all.<server>` for every node, `<node>.<server>`
|
||||||
// for one — which every node watches. A node that joins later, or was off, reads the whole current set
|
// for one — which every node watches. A node that joins later, or was off, reads the whole current set
|
||||||
// at start; unregistering is a delete. A secret never goes in an entry: the runtime refuses one.
|
// at start; unregistering is a delete. A secret never goes in an entry: the runtime refuses one.
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
//
|
//
|
||||||
// At start it renders the agent's managed directory, asks the licence manager for this node's token,
|
// At start it renders the agent's managed directory, asks the licence manager for this node's token,
|
||||||
// begins watching the credentials file for a login, takes the manager's licence events, and watches the
|
// begins watching the credentials file for a login, takes the manager's licence events, and watches the
|
||||||
// module's `servers` state — every node's MCP server registrations (novox/hq ADR 0202). node.ts holds the
|
// module's `servers` state — every node's MCP server registrations (novox/hq ADR 0201). node.ts holds the
|
||||||
// logic.
|
// logic.
|
||||||
|
|
||||||
import { readFileSync, watchFile } from "node:fs";
|
import { readFileSync, watchFile } from "node:fs";
|
||||||
@@ -92,7 +92,7 @@ function status(p: Paths): Record<string, unknown> {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The module's MCP servers on the bus (ADR 0202): its own state, which every node of it watches. */
|
/** The module's MCP servers on the bus (ADR 0201): its own state, which every node of it watches. */
|
||||||
const servers = () => state<Record<string, unknown>>("servers") as unknown as ServerState;
|
const servers = () => state<Record<string, unknown>>("servers") as unknown as ServerState;
|
||||||
|
|
||||||
/** What this node takes from that state, kept from the watch. One per process. */
|
/** What this node takes from that state, kept from the watch. One per process. */
|
||||||
@@ -180,7 +180,7 @@ if (p) {
|
|||||||
say(JSON.stringify(await pull(p, ask, writeManaged).catch((e) => ({ failed: String(e) }))));
|
say(JSON.stringify(await pull(p, ask, writeManaged).catch((e) => ({ failed: String(e) }))));
|
||||||
}).catch(loud("the licence events"));
|
}).catch(loud("the licence events"));
|
||||||
|
|
||||||
// Every node's MCP servers: the whole current set first, then each change (ADR 0202). Awaited, so the
|
// Every node's MCP servers: the whole current set first, then each change (ADR 0201). Awaited, so the
|
||||||
// managed directory holds every server that applies here before the bundle says what it serves.
|
// managed directory holds every server that applies here before the bundle says what it serves.
|
||||||
try {
|
try {
|
||||||
await state<Record<string, unknown>>("servers").watch((c) => {
|
await state<Record<string, unknown>>("servers").watch((c) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user