const profile = createCapabilityProfile({
id: "notes", version: 1,
tools: [{
name: "notes.write",
description: "Replace the bound workspace's note.",
inputSchema: { /* bounded schema */ },
parseInput(input) { /* trusted parser */ },
execute(input, context) {
context.assertActive();
notes.set(context.workspaceId, input);
return { stored: true };
},
}],
});
const broker = createCapabilityBroker({
profile, workspaceId: "workspace-1", runId: "run-1",
isActive: () => hostState.active,
});
await broker.invoke("notes.write", { text: "First note." });