@claude-flow/plugin-agent-federation 1.0.2 → 1.0.4
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.
- package/README.md +1 -1
- package/dist/application/federation-coordinator.js +1 -1
- package/dist/application/federation-coordinator.js.map +1 -1
- package/dist/application/policy-engine.d.ts.map +1 -1
- package/dist/application/policy-engine.js +31 -0
- package/dist/application/policy-engine.js.map +1 -1
- package/dist/domain/services/discovery-service.d.ts.map +1 -1
- package/dist/domain/services/discovery-service.js +11 -1
- package/dist/domain/services/discovery-service.js.map +1 -1
- package/dist/domain/services/handshake-service.d.ts.map +1 -1
- package/dist/domain/services/handshake-service.js +16 -3
- package/dist/domain/services/handshake-service.js.map +1 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +17 -4
- package/dist/plugin.js.map +1 -1
- package/dist/transport/midstream-aware-loader.d.ts.map +1 -1
- package/dist/transport/midstream-aware-loader.js +3 -1
- package/dist/transport/midstream-aware-loader.js.map +1 -1
- package/package.json +1 -1
- package/dist/a2a/agent-card.d.ts +0 -130
- package/dist/a2a/consume.d.ts +0 -34
- package/dist/a2a/planner-descriptor.d.ts +0 -40
- package/dist/a2a/well-known.d.ts +0 -46
- package/dist/application/claim-checker.d.ts +0 -27
- package/dist/application/federation-breaker-service.d.ts +0 -192
- package/dist/application/federation-coordinator.d.ts +0 -211
- package/dist/application/inbound-dispatcher.d.ts +0 -113
- package/dist/application/policy-engine.d.ts +0 -41
- package/dist/application/spend-reporter.d.ts +0 -150
- package/dist/application/trust-evaluator.d.ts +0 -74
- package/dist/bin.d.ts +0 -13
- package/dist/cli-commands.d.ts +0 -7
- package/dist/domain/entities/federation-envelope.d.ts +0 -45
- package/dist/domain/entities/federation-node.d.ts +0 -104
- package/dist/domain/entities/federation-session.d.ts +0 -55
- package/dist/domain/entities/trust-level.d.ts +0 -17
- package/dist/domain/services/audit-service.d.ts +0 -69
- package/dist/domain/services/discovery-service.d.ts +0 -68
- package/dist/domain/services/handshake-service.d.ts +0 -58
- package/dist/domain/services/pii-pipeline-service.d.ts +0 -65
- package/dist/domain/services/routing-service.d.ts +0 -54
- package/dist/domain/services/wg-firewall-service.d.ts +0 -71
- package/dist/domain/services/wg-mesh-service.d.ts +0 -156
- package/dist/domain/services/wg-witness-service.d.ts +0 -98
- package/dist/domain/value-objects/federation-budget.d.ts +0 -89
- package/dist/domain/value-objects/federation-node-state.d.ts +0 -92
- package/dist/domain/value-objects/wg-config.d.ts +0 -70
- package/dist/index.d.ts +0 -24
- package/dist/mcp-tools.d.ts +0 -10
- package/dist/plugin.d.ts +0 -19
- package/dist/transport/midstream-aware-loader.d.ts +0 -72
- package/dist/version.d.ts +0 -3
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ADR-111 Phase 2 — WgMeshService.
|
|
3
|
-
*
|
|
4
|
-
* Pure-projection service: takes the federation peer registry + local
|
|
5
|
-
* WG identity and produces (a) a `wg-quick`-compatible config string,
|
|
6
|
-
* (b) per-peer `wg set` commands the operator runs to converge an
|
|
7
|
-
* already-running interface, and (c) the AllowedIPs slice that maps to
|
|
8
|
-
* each peer's trust level.
|
|
9
|
-
*
|
|
10
|
-
* Deliberately does NOT shell out. Bringing up a network interface
|
|
11
|
-
* requires root and modifies system state — per CLAUDE.md's
|
|
12
|
-
* destructive-actions guidance the service emits the commands; the
|
|
13
|
-
* operator (or a thin shell wrapper they audit) runs them.
|
|
14
|
-
*
|
|
15
|
-
* Phase 3 (breaker integration) consumes this service: peer state
|
|
16
|
-
* transitions invoke removeAllowedIPs/removePeer/restoreAllowedIPs,
|
|
17
|
-
* which produce commands without side effects.
|
|
18
|
-
*/
|
|
19
|
-
import { TrustLevel } from '../entities/trust-level.js';
|
|
20
|
-
import { FederationNode } from '../entities/federation-node.js';
|
|
21
|
-
import type { WgLocalKey } from '../value-objects/wg-config.js';
|
|
22
|
-
export interface WgPortRule {
|
|
23
|
-
readonly proto: 'tcp' | 'udp' | 'all';
|
|
24
|
-
readonly port?: number;
|
|
25
|
-
readonly portRange?: readonly [number, number];
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Trust-level → reachability. ADR-111's `WG_NETWORK_GATES`.
|
|
29
|
-
*
|
|
30
|
-
* Note: WireGuard's `AllowedIPs` is L3 routing, not L4 ACL — these port
|
|
31
|
-
* rules describe what the L4 firewall (Phase 4: nftables/pf) should
|
|
32
|
-
* enforce. v1 (this phase) only produces the rules; Phase 4 projects
|
|
33
|
-
* them into kernel firewall syntax. Until then, callers using v1
|
|
34
|
-
* fall back to the simpler "AllowedIPs = peer's mesh IP" model (option
|
|
35
|
-
* (b) in the ADR — app-layer auth carries the access decision).
|
|
36
|
-
*/
|
|
37
|
-
export declare const WG_NETWORK_GATES: Record<TrustLevel, readonly WgPortRule[]>;
|
|
38
|
-
/**
|
|
39
|
-
* Minimum trust level whose peers get a `[Peer]` block in the WG config.
|
|
40
|
-
* UNTRUSTED stays out of the mesh entirely — it's the explicit drop bucket.
|
|
41
|
-
*/
|
|
42
|
-
export declare const WG_MIN_MESH_TRUST: TrustLevel;
|
|
43
|
-
export interface WgPeerFields {
|
|
44
|
-
readonly wgPublicKey: string;
|
|
45
|
-
readonly wgMeshIP: string;
|
|
46
|
-
readonly wgEndpoint: string;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Return the validated peer wg fields, or null if any is malformed or
|
|
50
|
-
* out-of-range. Callers treat null as "peer not eligible for mesh" — the
|
|
51
|
-
* peer stays in the federation discovery registry but is excluded from
|
|
52
|
-
* the wg config and any wg commands.
|
|
53
|
-
*/
|
|
54
|
-
export declare function readSafePeerWgFields(peer: FederationNode): WgPeerFields | null;
|
|
55
|
-
export interface WgMeshServiceConfig {
|
|
56
|
-
/** Local interface name. Defaults to `ruflo-fed`. */
|
|
57
|
-
readonly interfaceName?: string;
|
|
58
|
-
/** Local UDP listen port. WireGuard's standard is 51820. */
|
|
59
|
-
readonly listenPort?: number;
|
|
60
|
-
/** Mesh subnet for AllowedIPs filtering. Defaults to DEFAULT_MESH_SUBNET. */
|
|
61
|
-
readonly meshSubnet?: string;
|
|
62
|
-
}
|
|
63
|
-
export interface WgPeerSummary {
|
|
64
|
-
readonly nodeId: string;
|
|
65
|
-
readonly trustLevel: TrustLevel;
|
|
66
|
-
readonly trustLabel: string;
|
|
67
|
-
readonly meshIP: string;
|
|
68
|
-
readonly endpoint: string;
|
|
69
|
-
readonly publicKey: string;
|
|
70
|
-
readonly state: 'active' | 'suspended' | 'evicted';
|
|
71
|
-
readonly allowedIPs: readonly string[];
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* A planned `wg(8)` mutation. Service consumers either execute these or
|
|
75
|
-
* surface them to the operator. Strings are validated for shell metachars
|
|
76
|
-
* before being formatted into a command — callers should still review.
|
|
77
|
-
*/
|
|
78
|
-
export interface WgCommand {
|
|
79
|
-
readonly verb: 'set-allowed-ips' | 'remove-allowed-ips' | 'remove-peer' | 'add-peer';
|
|
80
|
-
/** Public key of the peer this command targets. */
|
|
81
|
-
readonly peerPublicKey: string;
|
|
82
|
-
/** Render to a `wg set <iface> peer <pk> ...` shell-ready string. */
|
|
83
|
-
readonly cmd: string;
|
|
84
|
-
/** Human-readable rationale for audit logs. */
|
|
85
|
-
readonly rationale: string;
|
|
86
|
-
}
|
|
87
|
-
export declare class WgMeshService {
|
|
88
|
-
private readonly interfaceName;
|
|
89
|
-
private readonly listenPort;
|
|
90
|
-
private readonly meshSubnet;
|
|
91
|
-
private localKey;
|
|
92
|
-
private localMeshIP;
|
|
93
|
-
/** Per-peer AllowedIPs after the last applyTrustLevelToAllowedIPs() call. Drives restore from breaker. */
|
|
94
|
-
private readonly lastAppliedAllowedIPs;
|
|
95
|
-
/** Peer-pubkey → suspended flag for breaker integration. */
|
|
96
|
-
private readonly suspended;
|
|
97
|
-
/** Peer-pubkey → evicted flag. */
|
|
98
|
-
private readonly evicted;
|
|
99
|
-
constructor(config?: WgMeshServiceConfig);
|
|
100
|
-
/** Bind the local WG identity. Required before buildInterfaceConfig(). */
|
|
101
|
-
setLocalIdentity(key: WgLocalKey, meshIP: string): void;
|
|
102
|
-
getInterfaceName(): string;
|
|
103
|
-
getMeshSubnet(): string;
|
|
104
|
-
/**
|
|
105
|
-
* Build a `wg-quick`-compatible config string from current peers.
|
|
106
|
-
*
|
|
107
|
-
* Peers below WG_MIN_MESH_TRUST (UNTRUSTED) are excluded entirely.
|
|
108
|
-
* Suspended peers stay in the config but with `AllowedIPs =` empty
|
|
109
|
-
* (soft-block). Evicted peers are dropped completely.
|
|
110
|
-
*
|
|
111
|
-
* Operator writes this to `/etc/wireguard/<interface>.conf` and runs
|
|
112
|
-
* `wg-quick up <interface>`.
|
|
113
|
-
*/
|
|
114
|
-
buildInterfaceConfig(peers: readonly FederationNode[]): string;
|
|
115
|
-
/**
|
|
116
|
-
* Compute the AllowedIPs slice for a peer at its current trust level.
|
|
117
|
-
* v1: each peer gets its own /32 mesh IP. Phase 4 will narrow this
|
|
118
|
-
* further via firewall rules; v1 keeps L3 broad and relies on the app
|
|
119
|
-
* layer + trust gates for access decisions.
|
|
120
|
-
*/
|
|
121
|
-
computeAllowedIPs(peer: FederationNode, meshIP: string): readonly string[];
|
|
122
|
-
/**
|
|
123
|
-
* Apply trust level → AllowedIPs as a `wg set` command for an
|
|
124
|
-
* already-running interface. Used when a peer joins or its trust level
|
|
125
|
-
* changes without needing a full config rewrite.
|
|
126
|
-
*/
|
|
127
|
-
applyTrustLevelToAllowedIPs(peer: FederationNode, meshIP: string, pubkey: string): WgCommand;
|
|
128
|
-
/**
|
|
129
|
-
* Phase 3 hook — peer SUSPENDED. Clear AllowedIPs (soft-block: keeps
|
|
130
|
-
* the peer's public key registered with the interface but blocks all
|
|
131
|
-
* routing to/from it).
|
|
132
|
-
*/
|
|
133
|
-
removeAllowedIPs(peer: FederationNode, pubkey: string, reason?: string): WgCommand;
|
|
134
|
-
/**
|
|
135
|
-
* Phase 3 hook — peer reactivated. Restore the AllowedIPs slice that
|
|
136
|
-
* was active before suspension. Returns null if the peer was never
|
|
137
|
-
* suspended (idempotent).
|
|
138
|
-
*/
|
|
139
|
-
restoreAllowedIPs(peer: FederationNode, meshIP: string, pubkey: string): WgCommand | null;
|
|
140
|
-
/**
|
|
141
|
-
* Phase 3 hook — peer EVICTED. Terminal removal from the mesh; the
|
|
142
|
-
* peer's `[Peer]` block is dropped on next config rebuild and an
|
|
143
|
-
* immediate `wg set <iface> peer <pk> remove` is emitted to flush
|
|
144
|
-
* runtime state without a config reload.
|
|
145
|
-
*/
|
|
146
|
-
removePeer(peer: FederationNode, pubkey: string, reason?: string): WgCommand;
|
|
147
|
-
/** Summarize the mesh state for `federation_wg_status` (Phase 6) and audit. */
|
|
148
|
-
summarize(peers: readonly FederationNode[]): readonly WgPeerSummary[];
|
|
149
|
-
/**
|
|
150
|
-
* Defense-in-depth: validate that all bits we splice into a shell
|
|
151
|
-
* command are alphanumeric / base64 / WG-allowed chars. Refuses the
|
|
152
|
-
* command rather than ship a substring that might escape its slot.
|
|
153
|
-
*/
|
|
154
|
-
private formatCmd;
|
|
155
|
-
}
|
|
156
|
-
//# sourceMappingURL=wg-mesh-service.d.ts.map
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ADR-111 Phase 5 — Witness attestation chain for WG mesh mutations.
|
|
3
|
-
*
|
|
4
|
-
* Every coordination change (peer added/suspended/evicted/reactivated,
|
|
5
|
-
* keypair rotated) appends a signed entry to an append-only log
|
|
6
|
-
* `.claude-flow/federation/wg-changes.log`. The signature is over a
|
|
7
|
-
* canonical JSON encoding of the entry's content fields, using the
|
|
8
|
-
* operator's federation Ed25519 key — the same identity that signs
|
|
9
|
-
* federation manifests, so anyone who already trusts the manifest chain
|
|
10
|
-
* automatically trusts the WG change chain.
|
|
11
|
-
*
|
|
12
|
-
* Append-only via O_APPEND open + entries chained by prevHash (sha256 of
|
|
13
|
-
* the previous entry's canonical bytes). Tampering with history requires
|
|
14
|
-
* forging a chain of signatures with the operator's key.
|
|
15
|
-
*
|
|
16
|
-
* The periodic ruflo witness regen (plugins/ruflo-core/scripts/witness/)
|
|
17
|
-
* includes wg-changes.log as one of its watched artifacts (operator wires
|
|
18
|
-
* this via witness-fixes.json).
|
|
19
|
-
*
|
|
20
|
-
* Pure service: emits the canonical bytes and the signature to write.
|
|
21
|
-
* Caller does the I/O so this stays unit-testable without fs mocks.
|
|
22
|
-
*/
|
|
23
|
-
import type { WgCommand } from './wg-mesh-service.js';
|
|
24
|
-
export type WgWitnessEventType = 'peer-added' | 'peer-removed-suspended' | 'peer-restored' | 'peer-evicted' | 'key-rotated' | 'interface-config-applied';
|
|
25
|
-
/**
|
|
26
|
-
* Canonical fields of a witness entry. The hash + signature are computed
|
|
27
|
-
* over these in a stable JSON encoding (sorted keys, no whitespace).
|
|
28
|
-
*/
|
|
29
|
-
export interface WgWitnessContent {
|
|
30
|
-
readonly version: '1';
|
|
31
|
-
readonly type: WgWitnessEventType;
|
|
32
|
-
readonly timestamp: string;
|
|
33
|
-
readonly nodeId: string;
|
|
34
|
-
/** Public key of the affected peer, if any. */
|
|
35
|
-
readonly peerPublicKey?: string;
|
|
36
|
-
/** Mesh IP affected, if any. */
|
|
37
|
-
readonly meshIP?: string;
|
|
38
|
-
/** wg command that was emitted, if any. */
|
|
39
|
-
readonly wgCommand?: string;
|
|
40
|
-
/** Human-readable rationale for the audit log. */
|
|
41
|
-
readonly rationale: string;
|
|
42
|
-
/** Hash of the previous entry in the chain (sha256 hex), or empty for the genesis entry. */
|
|
43
|
-
readonly prevHash: string;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Full witness entry as it appears on disk — content + the operator's
|
|
47
|
-
* Ed25519 signature over the canonical encoding of content.
|
|
48
|
-
*/
|
|
49
|
-
export interface WgWitnessEntry {
|
|
50
|
-
readonly content: WgWitnessContent;
|
|
51
|
-
readonly hash: string;
|
|
52
|
-
readonly signature: string;
|
|
53
|
-
}
|
|
54
|
-
export interface WgWitnessSigner {
|
|
55
|
-
/** Returns an Ed25519 signature (base64) over the given canonical bytes. */
|
|
56
|
-
sign(bytes: Buffer): Promise<string>;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Stable JSON serialization for hashing/signing. Keys are sorted; no
|
|
60
|
-
* whitespace; undefined fields omitted. Same shape on every host so
|
|
61
|
-
* cross-host verifiers produce identical hashes.
|
|
62
|
-
*/
|
|
63
|
-
export declare function canonicalizeContent(content: WgWitnessContent): Buffer;
|
|
64
|
-
export declare function hashContent(content: WgWitnessContent): string;
|
|
65
|
-
export declare class WgWitnessService {
|
|
66
|
-
private readonly nodeId;
|
|
67
|
-
private readonly signer;
|
|
68
|
-
private lastHash;
|
|
69
|
-
constructor(nodeId: string, signer: WgWitnessSigner);
|
|
70
|
-
/**
|
|
71
|
-
* Override the previous-hash pointer (used when resuming from an existing
|
|
72
|
-
* log on disk). Caller reads the last entry from `wg-changes.log` and
|
|
73
|
-
* passes its `hash` here before appending more.
|
|
74
|
-
*/
|
|
75
|
-
setLastHash(hash: string): void;
|
|
76
|
-
/** Build + sign an entry. Caller is responsible for the actual append-write. */
|
|
77
|
-
build(type: WgWitnessEventType, fields: Omit<WgWitnessContent, 'version' | 'type' | 'timestamp' | 'nodeId' | 'prevHash'>): Promise<WgWitnessEntry>;
|
|
78
|
-
/**
|
|
79
|
-
* Convenience: take a WgCommand emitted by WgMeshService Phase 2/3 and
|
|
80
|
-
* produce a witness entry of the right type. Maps verb → eventType.
|
|
81
|
-
*/
|
|
82
|
-
attestWgCommand(cmd: WgCommand, meshIP?: string): Promise<WgWitnessEntry>;
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Verify a single entry's signature + hash. Caller verifies the chain by
|
|
86
|
-
* iterating entries and confirming each entry's `prevHash` equals the
|
|
87
|
-
* preceding entry's `hash`.
|
|
88
|
-
*/
|
|
89
|
-
export declare function verifyWitnessEntry(entry: WgWitnessEntry, verify: (bytes: Buffer, signature: string) => Promise<boolean>): Promise<boolean>;
|
|
90
|
-
/**
|
|
91
|
-
* Verify a full chain — every entry valid + chain link unbroken.
|
|
92
|
-
*/
|
|
93
|
-
export declare function verifyWitnessChain(entries: readonly WgWitnessEntry[], verify: (bytes: Buffer, signature: string) => Promise<boolean>): Promise<{
|
|
94
|
-
ok: boolean;
|
|
95
|
-
failedAt?: number;
|
|
96
|
-
reason?: string;
|
|
97
|
-
}>;
|
|
98
|
-
//# sourceMappingURL=wg-witness-service.d.ts.map
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Federation budget + hop counter (ADR-097 Phase 1).
|
|
3
|
-
*
|
|
4
|
-
* Carried in {@link FederationEnvelope} alongside the existing
|
|
5
|
-
* sourceNodeId/targetNodeId/payload. Sender supplies the original limits;
|
|
6
|
-
* each outbound hop increments hopCount and decrements remaining budget.
|
|
7
|
-
*
|
|
8
|
-
* Phase 1 enforces at the *send* side because there is no inbound
|
|
9
|
-
* dispatcher today (sendToNode is a stub — see researcher report).
|
|
10
|
-
* Phase 2 will move the decrement to receive once the inbound path lands.
|
|
11
|
-
*
|
|
12
|
-
* Security invariants pinned by the reviewer (audit_1776853149979 follow-up):
|
|
13
|
-
*
|
|
14
|
-
* 1. validateBudget rejects NaN, ±Infinity, negative numbers, and
|
|
15
|
-
* non-integer hop counts. Returns a discriminated result so callers
|
|
16
|
-
* cannot accidentally use a bad budget unchecked.
|
|
17
|
-
* 2. enforceBudget runs check-then-decrement in a single synchronous
|
|
18
|
-
* function with no awaits inside — two concurrent send calls cannot
|
|
19
|
-
* both pass the pre-check.
|
|
20
|
-
* 3. Errors return constant strings ("HOP_LIMIT_EXCEEDED" /
|
|
21
|
-
* "BUDGET_EXCEEDED") with no remaining-budget echo so a caller can't
|
|
22
|
-
* use the error response as an oracle for the threshold.
|
|
23
|
-
*/
|
|
24
|
-
/** Maximum hops a federation message may travel before the breaker opens. */
|
|
25
|
-
export declare const DEFAULT_MAX_HOPS = 8;
|
|
26
|
-
/**
|
|
27
|
-
* Caller-supplied budget. All fields are optional; omitted fields are
|
|
28
|
-
* treated as Infinity for the corresponding axis. Created via validateBudget;
|
|
29
|
-
* never construct directly.
|
|
30
|
-
*/
|
|
31
|
-
export interface Budget {
|
|
32
|
-
readonly maxHops: number;
|
|
33
|
-
readonly maxTokens: number;
|
|
34
|
-
readonly maxUsd: number;
|
|
35
|
-
}
|
|
36
|
-
/** Discriminated result of validating raw user input into a Budget. */
|
|
37
|
-
export type BudgetValidationResult = {
|
|
38
|
-
ok: true;
|
|
39
|
-
budget: Budget;
|
|
40
|
-
} | {
|
|
41
|
-
ok: false;
|
|
42
|
-
error: string;
|
|
43
|
-
};
|
|
44
|
-
/**
|
|
45
|
-
* Validate a raw budget object. Pure, no side effects. Caller obtains either
|
|
46
|
-
* a guaranteed-safe Budget or a structured error suitable for logging.
|
|
47
|
-
*
|
|
48
|
-
* Accepts undefined/null and returns a default unbounded budget (maxHops =
|
|
49
|
-
* DEFAULT_MAX_HOPS, tokens/usd = Infinity). This preserves backward
|
|
50
|
-
* compatibility for callers that don't pass a budget at all.
|
|
51
|
-
*/
|
|
52
|
-
export declare function validateBudget(raw: unknown, overrideMaxHops?: unknown): BudgetValidationResult;
|
|
53
|
-
/**
|
|
54
|
-
* Enforcement decision returned by enforceBudget. Discriminated so the
|
|
55
|
-
* caller can map directly to a constant-string error — no remaining-budget
|
|
56
|
-
* echo on the failure side (anti-oracle).
|
|
57
|
-
*/
|
|
58
|
-
export type BudgetEnforcement = {
|
|
59
|
-
ok: true;
|
|
60
|
-
nextHopCount: number;
|
|
61
|
-
remaining: Budget;
|
|
62
|
-
} | {
|
|
63
|
-
ok: false;
|
|
64
|
-
reason: 'HOP_LIMIT_EXCEEDED' | 'BUDGET_EXCEEDED';
|
|
65
|
-
};
|
|
66
|
-
/**
|
|
67
|
-
* Atomic (single synchronous function, no internal awaits) hop check.
|
|
68
|
-
*
|
|
69
|
-
* Returns the hopCount value the OUTBOUND envelope should carry plus the
|
|
70
|
-
* remaining budget that downstream peers will see. Callers must use the
|
|
71
|
-
* returned values; mutating the input Budget is forbidden (it's readonly).
|
|
72
|
-
*
|
|
73
|
-
* Contract:
|
|
74
|
-
* - hopCount represents how many hops the message has already taken.
|
|
75
|
-
* - The next outbound hop increments it: nextHopCount = hopCount + 1.
|
|
76
|
-
* - The check fires AFTER increment: nextHopCount must be <= maxHops.
|
|
77
|
-
* - This means maxHops=0 refuses to forward at all, which matches the
|
|
78
|
-
* ADR's "no remote delegation allowed" semantic.
|
|
79
|
-
*
|
|
80
|
-
* tokensSpent / usdSpent are caller-reported actuals from the immediately
|
|
81
|
-
* preceding leg (or 0 on the originator). The check fires on the
|
|
82
|
-
* *post-spend* totals so a leg that overshoots is caught before the next
|
|
83
|
-
* outbound dispatch.
|
|
84
|
-
*/
|
|
85
|
-
export declare function enforceBudget(budget: Budget, hopCount: number, spent?: {
|
|
86
|
-
tokens: number;
|
|
87
|
-
usd: number;
|
|
88
|
-
}): BudgetEnforcement;
|
|
89
|
-
//# sourceMappingURL=federation-budget.d.ts.map
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Federation peer state machine (ADR-097 Phase 2).
|
|
3
|
-
*
|
|
4
|
-
* Phase 1 shipped the budget envelope + enforcer that travels with every
|
|
5
|
-
* outbound message. Phase 2 adds the per-peer breaker: when a peer crosses a
|
|
6
|
-
* cost or failure threshold, transition it to SUSPENDED so subsequent
|
|
7
|
-
* `federation_send` calls short-circuit. After a cooldown the peer can
|
|
8
|
-
* recover; if it stays bad the breaker escalates to EVICTED.
|
|
9
|
-
*
|
|
10
|
-
* This module is the *value object* layer — pure, no I/O. The breaker
|
|
11
|
-
* service (Phase 2.b, separate file) reads cost-tracker telemetry, evaluates
|
|
12
|
-
* thresholds, and calls `transition` on the FederationNode entity. Decoupling
|
|
13
|
-
* the state machine from the policy lets tests pin transitions without
|
|
14
|
-
* standing up the cost bus.
|
|
15
|
-
*
|
|
16
|
-
* Security invariants pinned by the spec:
|
|
17
|
-
*
|
|
18
|
-
* 1. EVICTED is terminal under normal flow. The only way out is an
|
|
19
|
-
* explicit `reactivate` call (operator-initiated). This prevents a
|
|
20
|
-
* misbehaving peer from auto-recovering through the cooldown.
|
|
21
|
-
* 2. canTransition is the single source of truth for legality. Any path
|
|
22
|
-
* that mutates state MUST consult it; direct field writes are not
|
|
23
|
-
* permitted (entity getter/setter shape enforces this).
|
|
24
|
-
* 3. Reasons are constant strings, no remaining-budget echo on failure
|
|
25
|
-
* (matches Phase 1's anti-oracle posture).
|
|
26
|
-
* 4. Default cooldown is conservative (30 min) so a transient spike
|
|
27
|
-
* cannot ping-pong a peer ACTIVE↔SUSPENDED at high frequency.
|
|
28
|
-
*/
|
|
29
|
-
/** Lifecycle state of a federation peer. */
|
|
30
|
-
export declare enum FederationNodeState {
|
|
31
|
-
/** Default; healthy. `federation_send` accepts deliveries. */
|
|
32
|
-
ACTIVE = "ACTIVE",
|
|
33
|
-
/** Breaker tripped. Sends short-circuit with PEER_SUSPENDED. */
|
|
34
|
-
SUSPENDED = "SUSPENDED",
|
|
35
|
-
/** Removed from active rotation. Sends short-circuit with PEER_EVICTED. */
|
|
36
|
-
EVICTED = "EVICTED"
|
|
37
|
-
}
|
|
38
|
-
/** Reason a peer was suspended/evicted. Constant strings — no echo of caps. */
|
|
39
|
-
export type SuspensionReason = 'COST_THRESHOLD_EXCEEDED' | 'FAILURE_RATIO_EXCEEDED' | 'MANUAL_SUSPEND' | 'GRACE_PERIOD_EXPIRED' | 'MANUAL_EVICT';
|
|
40
|
-
/**
|
|
41
|
-
* Default cooldown a SUSPENDED peer must wait before being eligible for
|
|
42
|
-
* SUSPENDED → ACTIVE. 30 minutes matches the ADR-097 Part 2 spec and is
|
|
43
|
-
* intentionally well past the prompt-cache window so a recovery probe is
|
|
44
|
-
* cheap to amortize.
|
|
45
|
-
*/
|
|
46
|
-
export declare const DEFAULT_SUSPENSION_COOLDOWN_MS: number;
|
|
47
|
-
/**
|
|
48
|
-
* Default age at which a continuously-SUSPENDED peer is auto-escalated to
|
|
49
|
-
* EVICTED. 24 hours per spec — long enough to ride out a cost-tracker
|
|
50
|
-
* outage without false eviction, short enough that a genuinely-broken peer
|
|
51
|
-
* doesn't linger forever.
|
|
52
|
-
*/
|
|
53
|
-
export declare const DEFAULT_AUTO_EVICTION_AGE_MS: number;
|
|
54
|
-
/** A successful transition's reason payload (for the audit trail). */
|
|
55
|
-
export interface TransitionReason {
|
|
56
|
-
readonly reason: SuspensionReason;
|
|
57
|
-
/** Optional opaque correlation key — task ID, breaker run ID, etc. */
|
|
58
|
-
readonly correlationId?: string;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Static legality table for state transitions. Returns true iff the
|
|
62
|
-
* `from -> to` edge is in the allowed set. Used by the entity to reject
|
|
63
|
-
* illegal mutations before applying them.
|
|
64
|
-
*
|
|
65
|
-
* Allowed edges:
|
|
66
|
-
* ACTIVE → SUSPENDED (breaker trips)
|
|
67
|
-
* SUSPENDED → ACTIVE (cooldown + probe success)
|
|
68
|
-
* SUSPENDED → EVICTED (grace expired, or manual evict)
|
|
69
|
-
* ACTIVE → EVICTED (manual evict only — skips suspend)
|
|
70
|
-
* EVICTED → ACTIVE (manual reactivate only)
|
|
71
|
-
*
|
|
72
|
-
* Disallowed (anything else, including self-loops, is a no-op error).
|
|
73
|
-
*/
|
|
74
|
-
export declare function canTransition(from: FederationNodeState, to: FederationNodeState): boolean;
|
|
75
|
-
/**
|
|
76
|
-
* Should a SUSPENDED peer be eligible for SUSPENDED → ACTIVE based purely
|
|
77
|
-
* on elapsed time? The breaker still has to confirm health via probe before
|
|
78
|
-
* it actually calls reactivate; this just answers "is the cooldown done?"
|
|
79
|
-
*
|
|
80
|
-
* Pure function of (suspendedAt, now, cooldownMs) so it's trivially
|
|
81
|
-
* deterministic in tests.
|
|
82
|
-
*/
|
|
83
|
-
export declare function isCooldownElapsed(suspendedAt: Date, now: Date, cooldownMs?: number): boolean;
|
|
84
|
-
/**
|
|
85
|
-
* Should a SUSPENDED peer be auto-escalated to EVICTED based on the age of
|
|
86
|
-
* its suspension? Returns true once the peer has been continuously
|
|
87
|
-
* SUSPENDED past the configured limit (default 24h). The breaker calls
|
|
88
|
-
* this on each tick and, if true, issues the SUSPENDED → EVICTED
|
|
89
|
-
* transition with reason GRACE_PERIOD_EXPIRED.
|
|
90
|
-
*/
|
|
91
|
-
export declare function shouldAutoEvict(suspendedAt: Date, now: Date, ageLimitMs?: number): boolean;
|
|
92
|
-
//# sourceMappingURL=federation-node-state.d.ts.map
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ADR-111 Phase 1 — WireGuard configuration value objects.
|
|
3
|
-
*
|
|
4
|
-
* Pure types + deterministic helpers. No I/O, no shell calls. Used by
|
|
5
|
-
* WgMeshService (Phase 2) and surfaced in FederationManifest (Phase 1) so
|
|
6
|
-
* peers can publish their WG identity inside the same Ed25519-signed
|
|
7
|
-
* manifest that already carries their federation identity.
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* The WG section of a FederationManifest. Optional — present only when
|
|
11
|
-
* the local node has opted in via `config.wgMesh: true`.
|
|
12
|
-
*
|
|
13
|
-
* - publicKey is the X25519 public key in base64 (32-byte raw → 44 chars
|
|
14
|
-
* including '=' padding), exactly the format `wg-quick`/`wg setconf`
|
|
15
|
-
* accept. Never include the private key in the manifest.
|
|
16
|
-
* - endpoint is `host:port` reachable on UDP. May be a hostname (resolved
|
|
17
|
-
* by the consumer) or an IPv4/v6 literal. The port is WireGuard's, not
|
|
18
|
-
* federation's WS port — usually 51820.
|
|
19
|
-
* - meshIP is the assigned /32 inside the federation mesh subnet
|
|
20
|
-
* (10.50.0.0/16 by default). Stored as `a.b.c.d/32`.
|
|
21
|
-
*/
|
|
22
|
-
export interface WgManifestSection {
|
|
23
|
-
readonly publicKey: string;
|
|
24
|
-
readonly endpoint: string;
|
|
25
|
-
readonly meshIP: string;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* A locally-generated WG keypair. Kept entirely off the wire — `publicKey`
|
|
29
|
-
* is what gets published in the manifest; `privateKey` stays on disk
|
|
30
|
-
* (mode 0600) and in this in-memory object.
|
|
31
|
-
*/
|
|
32
|
-
export interface WgLocalKey {
|
|
33
|
-
readonly publicKey: string;
|
|
34
|
-
readonly privateKey: string;
|
|
35
|
-
readonly createdAt: string;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Default federation mesh subnet. RFC1918 private space outside the
|
|
39
|
-
* common LAN/k8s ranges and Tailscale's 100.64.0.0/10. Documented in
|
|
40
|
-
* the ADR. Birthday-collision probability stays under 1% up to ~36
|
|
41
|
-
* peers and under 50% at ~302 peers — within the v1 ≤50-peer target.
|
|
42
|
-
*/
|
|
43
|
-
export declare const DEFAULT_MESH_SUBNET = "10.50.0.0/16";
|
|
44
|
-
/**
|
|
45
|
-
* Generate an X25519 keypair in the format WireGuard accepts.
|
|
46
|
-
*
|
|
47
|
-
* WireGuard keys are 32 raw bytes encoded base64 (44 chars with '='
|
|
48
|
-
* padding). Node's `generateKeyPairSync('x25519')` returns PKCS8/SPKI
|
|
49
|
-
* DER envelopes — we extract the trailing 32 bytes which are the raw
|
|
50
|
-
* key material (the DER prefix is constant for X25519).
|
|
51
|
-
*
|
|
52
|
-
* No new dependencies: Node 18+ has X25519 support in core crypto.
|
|
53
|
-
*/
|
|
54
|
-
export declare function generateWgKeyPair(): WgLocalKey;
|
|
55
|
-
/**
|
|
56
|
-
* Derive a deterministic mesh IP for `nodeId` inside `subnet`.
|
|
57
|
-
*
|
|
58
|
-
* Strategy: sha256(nodeId) → top bytes interpreted as host portion of the
|
|
59
|
-
* subnet, clamped to avoid the network address (.0) and broadcast (.255)
|
|
60
|
-
* of any /24 inside the subnet. This is collision-resistant in the
|
|
61
|
-
* birthday-paradox sense — see ADR for thresholds.
|
|
62
|
-
*
|
|
63
|
-
* `usedIPs` (when provided) gives previously-assigned IPs in the mesh.
|
|
64
|
-
* If the derived IP is already taken, the function probes `nodeId + '\x00'`,
|
|
65
|
-
* `nodeId + '\x01'`, … until a free slot is found. Bounded to 1024 probes;
|
|
66
|
-
* exceeding that means the subnet is functionally exhausted and the caller
|
|
67
|
-
* should jump to a larger range (see ADR `10.50.0.0/12` recommendation).
|
|
68
|
-
*/
|
|
69
|
-
export declare function deriveMeshIP(nodeId: string, subnet?: string, usedIPs?: ReadonlySet<string>): string;
|
|
70
|
-
//# sourceMappingURL=wg-config.d.ts.map
|
package/dist/index.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export { AgentFederationPlugin } from './plugin.js';
|
|
2
|
-
export { FederationNode, type FederationNodeProps, type FederationNodeCapabilities, type FederationNodeMetadata, type FederationNodeStateRecord } from './domain/entities/federation-node.js';
|
|
3
|
-
export { FederationNodeState, type SuspensionReason, type TransitionReason, canTransition, isCooldownElapsed, shouldAutoEvict, DEFAULT_SUSPENSION_COOLDOWN_MS, DEFAULT_AUTO_EVICTION_AGE_MS, } from './domain/value-objects/federation-node-state.js';
|
|
4
|
-
export { FederationBreakerService, evaluatePolicy, DEFAULT_BREAKER_POLICY, DEFAULT_MAX_SAMPLES_PER_PEER, type BreakerPolicy, type BreakerDecision, type SendOutcome, } from './application/federation-breaker-service.js';
|
|
5
|
-
export { InMemorySpendReporter, MemorySpendReporter, DEFAULT_FEDERATION_SPEND_NAMESPACE, DEFAULT_FEDERATION_SPEND_TTL_SECONDS, type SpendReporter, type MemoryStore, type MemorySpendReporterConfig, type FederationSpendEvent, } from './application/spend-reporter.js';
|
|
6
|
-
export { FederationSession, type FederationSessionProps, type SessionMetrics } from './domain/entities/federation-session.js';
|
|
7
|
-
export { FederationEnvelope, type FederationEnvelopeProps, type FederationMessageType, type PIIScanResult, type PIIScanDetection, type PIIScanAction, CONSENSUS_REQUIRED_TYPES, } from './domain/entities/federation-envelope.js';
|
|
8
|
-
export { TrustLevel, TRUST_TRANSITION_THRESHOLDS, CAPABILITY_GATES, isOperationAllowed, getTrustLevelLabel, type TrustTransitionThreshold, } from './domain/entities/trust-level.js';
|
|
9
|
-
export { PIIPipelineService, type PIIType, type PIIAction, type PIIDetection, type PIIPolicyConfig, type PIICalibration, type PIITransformResult, type PIIConfidenceThresholds, type PIIPipelineServiceDeps, } from './domain/services/pii-pipeline-service.js';
|
|
10
|
-
export { DiscoveryService, type DiscoveryMechanism, type FederationManifest, type DiscoveryServiceDeps, type DiscoveryConfig, } from './domain/services/discovery-service.js';
|
|
11
|
-
export { HandshakeService, type HandshakeChallenge, type HandshakeChallengeResponse, type HandshakeResult, type HandshakeServiceDeps, type HandshakeConfig, } from './domain/services/handshake-service.js';
|
|
12
|
-
export { RoutingService, type RoutingMode, type RoutingResult, type ConsensusProposal, type RoutingServiceDeps, } from './domain/services/routing-service.js';
|
|
13
|
-
export { AuditService, type FederationAuditEvent, type FederationAuditEventType, type AuditSeverity, type AuditCategory, type ComplianceMode, type AuditQuery, type AuditExportFormat, type AuditServiceDeps, type AuditServiceConfig, } from './domain/services/audit-service.js';
|
|
14
|
-
export { TrustEvaluator, type TrustScoreComponents, type TrustTransitionResult, type ImmediateDowngradeReason, type TrustEvaluatorDeps, } from './application/trust-evaluator.js';
|
|
15
|
-
export { FederationCoordinator, type FederationCoordinatorConfig, type FederationStatus, } from './application/federation-coordinator.js';
|
|
16
|
-
export { PolicyEngine, type FederationClaimType, type SecurityPolicy, type PolicyEvaluationResult, type PolicyEngineDeps, } from './application/policy-engine.js';
|
|
17
|
-
export { createFederationClaimChecker, type FederationAuthorizationMode, type FederationClaimChecker, type FederationClaimCheckerConfig, } from './application/claim-checker.js';
|
|
18
|
-
export { DEFAULT_ENVELOPE_SIGNATURE_MODE, JCS_SIGNATURE_PROTOCOL, canonicalizeEnvelopeForVerify, isLegacyEnvelopeTypeAllowed, selectEnvelopeSignatureVersion, type EnvelopeSignatureMode, type EnvelopeSignatureVersion, } from './application/inbound-dispatcher.js';
|
|
19
|
-
export { FEDERATION_PLUGIN_VERSION } from './version.js';
|
|
20
|
-
export { A2A_PROTOCOL_VERSION, A2A_WELL_KNOWN_PATH, RUFLO_FEDERATION_BINDING, RUFLO_FEDERATION_EXTENSION_URI, toAgentCard, fromAgentCard, validateAgentCard, type A2AAgentCard, type A2AAgentInterface, type A2AAgentSkill, type A2AAgentCapabilities, type A2AAgentExtension, type A2AAgentProvider, type ToAgentCardOptions, type AgentCardValidation, } from './a2a/agent-card.js';
|
|
21
|
-
export { projectPlannerSafeAgentCard, type PlannerCapabilityDefinition, type PlannerDescriptorPolicy, type PlannerSafeAgentDescriptor, type PlannerDescriptorProjection, } from './a2a/planner-descriptor.js';
|
|
22
|
-
export { startAgentCardServer, isLoopbackHost, type AgentCardServerOptions, type AgentCardServerHandle, } from './a2a/well-known.js';
|
|
23
|
-
export { fetchAgentCard, consumeAgentCard, resolveAgentCardUrl, type FetchAgentCardOptions, type FetchAgentCardResult, } from './a2a/consume.js';
|
|
24
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/mcp-tools.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { MCPToolDefinition } from '@claude-flow/shared/src/plugin-interface.js';
|
|
2
|
-
import type { PluginContext } from '@claude-flow/shared/src/plugin-interface.js';
|
|
3
|
-
import type { FederationCoordinator } from './application/federation-coordinator.js';
|
|
4
|
-
import type { WgMeshService } from './domain/services/wg-mesh-service.js';
|
|
5
|
-
type CoordinatorGetter = () => FederationCoordinator | null;
|
|
6
|
-
type ContextGetter = () => PluginContext | null;
|
|
7
|
-
type WgMeshGetter = () => WgMeshService | null;
|
|
8
|
-
export declare function createMcpTools(getCoordinator: CoordinatorGetter, getContext: ContextGetter, getWgMesh?: WgMeshGetter): MCPToolDefinition[];
|
|
9
|
-
export {};
|
|
10
|
-
//# sourceMappingURL=mcp-tools.d.ts.map
|
package/dist/plugin.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { ClaudeFlowPlugin, PluginContext, MCPToolDefinition, CLICommandDefinition, AgentTypeDefinition } from '@claude-flow/shared/src/plugin-interface.js';
|
|
2
|
-
export declare class AgentFederationPlugin implements ClaudeFlowPlugin {
|
|
3
|
-
readonly name = "@claude-flow/plugin-agent-federation";
|
|
4
|
-
readonly version: "1.0.0-alpha.18";
|
|
5
|
-
readonly description = "Cross-installation agent federation with PII protection and AI defence";
|
|
6
|
-
readonly author = "Claude Flow Team";
|
|
7
|
-
readonly dependencies: string[];
|
|
8
|
-
private coordinator;
|
|
9
|
-
private context;
|
|
10
|
-
private transport;
|
|
11
|
-
private agentCardServer;
|
|
12
|
-
initialize(context: PluginContext): Promise<void>;
|
|
13
|
-
shutdown(): Promise<void>;
|
|
14
|
-
registerMCPTools(): MCPToolDefinition[];
|
|
15
|
-
registerCLICommands(): CLICommandDefinition[];
|
|
16
|
-
registerAgentTypes(): AgentTypeDefinition[];
|
|
17
|
-
healthCheck(): Promise<boolean>;
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Midstream-aware federation transport loader (ADR-120, Step 2).
|
|
3
|
-
*
|
|
4
|
-
* Extends the agentic-flow `loadQuicTransport` loader pattern with a
|
|
5
|
-
* preferred branch that probes `midstreamer` first. When `midstreamer`
|
|
6
|
-
* ships real QUIC (currently the WASM build is a counter-tracking
|
|
7
|
-
* stub per ADR-119), this loader picks it up automatically without
|
|
8
|
-
* any change to consumer plugins.
|
|
9
|
-
*
|
|
10
|
-
* Resolution order:
|
|
11
|
-
*
|
|
12
|
-
* 1. If `MIDSTREAMER_QUIC_NATIVE=1` AND the `midstreamer` module
|
|
13
|
-
* exposes a real `QuicMultistream`-derived `AgentTransport`,
|
|
14
|
-
* use it. (Today: probes fail closed and we fall through.)
|
|
15
|
-
*
|
|
16
|
-
* 2. Otherwise: defer to agentic-flow's existing loader, which
|
|
17
|
-
* itself respects `AGENTIC_FLOW_QUIC_NATIVE=1` (ADR-108) and
|
|
18
|
-
* falls back to WebSocket (ADR-104) otherwise.
|
|
19
|
-
*
|
|
20
|
-
* The loader is opt-in: callers must explicitly invoke
|
|
21
|
-
* `loadFederationTransport()` instead of `loadQuicTransport()`.
|
|
22
|
-
* Behavior is identical to `loadQuicTransport()` until upstream
|
|
23
|
-
* `midstreamer` ships its real QUIC build AND the operator sets the
|
|
24
|
-
* env flag — so this change is safe to land before any of that
|
|
25
|
-
* happens.
|
|
26
|
-
*
|
|
27
|
-
* Re-exports the `AgentTransport` / `AgentMessage` / `QuicTransportConfig`
|
|
28
|
-
* surface from agentic-flow so consumers only import from one place.
|
|
29
|
-
*/
|
|
30
|
-
export interface AgentMessage {
|
|
31
|
-
id: string;
|
|
32
|
-
type: 'task' | 'result' | 'status' | 'coordination' | 'heartbeat' | string;
|
|
33
|
-
payload: unknown;
|
|
34
|
-
metadata?: Record<string, unknown>;
|
|
35
|
-
[key: string]: unknown;
|
|
36
|
-
}
|
|
37
|
-
export interface AgentTransport {
|
|
38
|
-
send: (address: string, message: AgentMessage) => Promise<void>;
|
|
39
|
-
onMessage: (handler: (address: string, message: AgentMessage) => void) => void;
|
|
40
|
-
listen?: (port: number, host?: string) => Promise<void>;
|
|
41
|
-
close?: () => Promise<void> | void;
|
|
42
|
-
[key: string]: unknown;
|
|
43
|
-
}
|
|
44
|
-
export interface QuicTransportConfig {
|
|
45
|
-
port?: number;
|
|
46
|
-
host?: string;
|
|
47
|
-
serverName?: string;
|
|
48
|
-
[key: string]: unknown;
|
|
49
|
-
}
|
|
50
|
-
/** Result envelope describing which backend the loader picked. */
|
|
51
|
-
export interface LoadedFederationTransport {
|
|
52
|
-
/** The live transport. Send/receive against this. */
|
|
53
|
-
transport: AgentTransport;
|
|
54
|
-
/** Which loader branch resolved. Useful for logs/metrics. */
|
|
55
|
-
source: 'midstreamer-native' | 'agentic-flow-loader' | 'websocket-fallback';
|
|
56
|
-
/** Free-form note when a probe failed (helps explain a fallback). */
|
|
57
|
-
fallbackReason?: string;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Top-level loader for federation transport. Identical signature to
|
|
61
|
-
* agentic-flow's `loadQuicTransport`, but with the midstreamer-first
|
|
62
|
-
* preference. Use this from `plugins/ruflo-federation` in place of
|
|
63
|
-
* the bare `loadQuicTransport`.
|
|
64
|
-
*
|
|
65
|
-
* Failure mode: if midstreamer is requested but rejects (stub, init
|
|
66
|
-
* error, missing package), this function falls through to the
|
|
67
|
-
* agentic-flow loader. If current agentic-flow does not export its
|
|
68
|
-
* historical loader subpath, the plugin-owned WebSocket fallback is
|
|
69
|
-
* used directly (ADR-104, #2618).
|
|
70
|
-
*/
|
|
71
|
-
export declare function loadFederationTransport(config?: QuicTransportConfig): Promise<LoadedFederationTransport>;
|
|
72
|
-
//# sourceMappingURL=midstream-aware-loader.d.ts.map
|
package/dist/version.d.ts
DELETED