@kybernesis/dispatch 0.2.0 → 0.2.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.
@@ -37,19 +37,30 @@ export function remotePeer(options) {
37
37
  throw new Error("remotePeer: governed mode requires `callee` (the peer's registered control-plane name).");
38
38
  }
39
39
  const session = governed && callee ? createA2ASessionSource(governed.issuer, callee) : null;
40
+ // eve resolves this at agent-graph build (boot), not per dispatch — so URL
41
+ // resolution must DEGRADE, never throw for a merely-missing credential:
42
+ // a misconfigured edge should fail when dispatched, not prevent the whole
43
+ // agent (and its evals) from booting.
40
44
  const url = async () => {
41
45
  const override = envVar ? process.env[envVar] : undefined;
42
46
  if (override)
43
47
  return override;
44
- if (session) {
45
- const s = await session();
46
- if (s.callee.deploymentUrl)
47
- return s.callee.deploymentUrl;
48
+ if (session && process.env.KYBERNESIS_AGENT_CREDENTIAL) {
49
+ try {
50
+ const s = await session();
51
+ if (s.callee.deploymentUrl)
52
+ return s.callee.deploymentUrl;
53
+ }
54
+ catch {
55
+ // Mint failed (control plane down, edge revoked): fall through to the
56
+ // static fallback so boot survives; the dispatch itself will fail
57
+ // loudly in auth() with the precise mint error.
58
+ }
48
59
  }
49
60
  if (fallbackUrl)
50
61
  return fallbackUrl;
51
62
  throw new Error(`remotePeer: no URL for this edge — ${session
52
- ? "the registry has no deploymentUrl for the callee and no envVar/fallbackUrl override is set."
63
+ ? "registry discovery unavailable (no credential or no registered deploymentUrl) and no envVar/fallbackUrl override is set."
53
64
  : `${envVar ?? "envVar"} is not set and no fallbackUrl was provided.`}`);
54
65
  };
55
66
  const auth = session
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kybernesis/dispatch",
3
- "version": "0.2.0",
3
+ "version": "0.2.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",