@kybernesis/dispatch 0.3.0 → 0.3.1

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.
@@ -35,5 +35,20 @@ export interface GovernedPeersOptions {
35
35
  cacheMs?: number;
36
36
  /** How long to wait for a peer's answer before giving up. */
37
37
  timeoutMs?: number;
38
+ /**
39
+ * Peers that already have a declared `remotePeer()` file, so they are not
40
+ * offered twice.
41
+ *
42
+ * Some peers earn their file: `remotePeer` forwards the human's principal,
43
+ * which is the only correct way to reach an agent holding personal data.
44
+ * Discovery would list those peers too, and an agent shown two routes to the
45
+ * same colleague will sometimes pick the one that answers as itself — the
46
+ * quieter of the two failures, because it succeeds and returns less.
47
+ *
48
+ * Naming a peer here is not the thing this module exists to remove. It does
49
+ * not make the peer reachable; the file already did that. It says "handled
50
+ * elsewhere", and removing the line costs a duplicate, not a capability.
51
+ */
52
+ declared?: string[];
38
53
  }
39
54
  export declare function governedPeers(options?: GovernedPeersOptions): import("eve").DynamicSentinel<Record<string, unknown> | null>;
@@ -117,7 +117,9 @@ export function governedPeers(options = {}) {
117
117
  return defineDynamic({
118
118
  events: {
119
119
  "turn.started": async () => {
120
- const peers = await discover(options);
120
+ const all = await discover(options);
121
+ const skip = new Set((options.declared ?? []).map((n) => n.toLowerCase()));
122
+ const peers = all.filter((p) => !skip.has(p.name.toLowerCase()));
121
123
  if (peers.length === 0)
122
124
  return null;
123
125
  const tools = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kybernesis/dispatch",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Agent-to-agent dispatch for eve agents: declared remote-peer edges with principal forwarding on by default, and a receiver channel that makes trusting the wrong caller hard to express.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",