diff --git a/modules/nftables/allowances.ts b/modules/nftables/allowances.ts index a8f40839a..f5d5269ed 100644 --- a/modules/nftables/allowances.ts +++ b/modules/nftables/allowances.ts @@ -8,6 +8,7 @@ // its own state, said and journalled, so no expired entry is kept or answered. import { isIP } from "node:net"; +import type { ConvergedAnswer } from "@novox/mesh-contracts-node-engine"; /** The state the allowances are kept in, as the seat's definition names it (§7). */ export const STATE = "allowances"; @@ -55,13 +56,8 @@ export interface Changed { at: string; } -/** The node's convergence state as the node-engine seat's converged answers it (§10, H-A-316). */ -export interface Convergence { - state: "adopted" | "converged"; - since?: string; - /** The found firewall's kind, for an adopted node. */ - found?: string; -} +/** The node's convergence state as the node-engine seat's converged answers it (§10, H-A-316, H-A-321). */ +export type Convergence = ConvergedAnswer; /** One act by hand, as the seat mesh-hand-acts' hand-act takes it (ADR 0565 §10): the SDK's views.HandAct. */ export interface HandAct { diff --git a/modules/nftables/package.json b/modules/nftables/package.json index 34139c83d..38cc540ba 100644 --- a/modules/nftables/package.json +++ b/modules/nftables/package.json @@ -10,7 +10,8 @@ }, "dependencies": { "@novox/mesh-sdk": "^0.1.1", - "@novox/mesh-connectivity-contracts-node-packet-filter": "^0.1.0" + "@novox/mesh-connectivity-contracts-node-packet-filter": "^0.1.0", + "@novox/mesh-contracts-node-engine": "^0.1.0" }, "devDependencies": { "@types/node": "^22.0.0", diff --git a/modules/nftables/tools/index.ts b/modules/nftables/tools/index.ts index 03b3ccdb0..5646e0017 100644 --- a/modules/nftables/tools/index.ts +++ b/modules/nftables/tools/index.ts @@ -8,6 +8,7 @@ import { broker } from "@novox/mesh-sdk/messaging"; import { config, seatPublish } from "@novox/mesh-sdk/runtime"; import { keeps, state } from "@novox/mesh-sdk/state"; import { allowancesChangedSubject } from "@novox/mesh-connectivity-contracts-node-packet-filter"; +import { seat as nodeEngine, verbs as nodeEngineVerbs } from "@novox/mesh-contracts-node-engine"; import { FirewallClient } from "../client.js"; import { Allowances, MOST, STATE, markLoaded, type Convergence, type Store, type Value } from "../allowances.js"; @@ -127,7 +128,7 @@ const store: Store = { }, }; const allowances = new Allowances(store, node, (body) => seatPublish(allowancesChangedSubject(node), body), { - converged: async () => (await broker().request(`seat:node-engine.converged@${node}`, {})), + converged: async () => (await broker().request(`seat:${nodeEngine}.${nodeEngineVerbs.converged}@${node}`, {})), handAct: async (act) => { await broker().request("seat:mesh-hand-acts.hand-act", act); }, most: async () => { const v = await config("allowances-max");