G C-1 (TS): a bundle reads its tool runner's capability words once and names a word not stated
mesh/capabilities answered {words}, an unknown call read as none, the node from MESH_NODE; the finding writer's bundle
transport requires finding-calls; a runtime refusal keeps its code.
Builds: design 47 G §576, §622, §488
Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ
This commit is contained in:
+7
-3
@@ -5,6 +5,7 @@
|
||||
// `<seat>.<event>`), not subjects.
|
||||
|
||||
import { broker } from "../messaging/index.js";
|
||||
import { CAP_FINDING_CALLS, requireCapability } from "../runtime/index.js";
|
||||
import type { EventHeaders } from "../contracts/index.js";
|
||||
import { randomUUID } from "node:crypto";
|
||||
|
||||
@@ -15,6 +16,7 @@ export function bundleTransport(module = process.env.MESH_MODULE ?? "unknown", n
|
||||
} {
|
||||
return {
|
||||
publish: async (event, body, id) => {
|
||||
await requireCapability(CAP_FINDING_CALLS);
|
||||
const headers: EventHeaders = {
|
||||
"x-event-id": id || randomUUID(),
|
||||
"x-source": module,
|
||||
@@ -24,13 +26,15 @@ export function bundleTransport(module = process.env.MESH_MODULE ?? "unknown", n
|
||||
};
|
||||
await broker().publish({ key: event, node, body, headers }, { ack: true });
|
||||
},
|
||||
listen: (event, handle) =>
|
||||
broker().subscribe(
|
||||
listen: async (event, handle) => {
|
||||
await requireCapability(CAP_FINDING_CALLS);
|
||||
return broker().subscribe(
|
||||
event,
|
||||
async (env) => {
|
||||
handle(env.body);
|
||||
},
|
||||
{ deliver: "new" },
|
||||
),
|
||||
);
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user