Create a new SwarmNode.
SwarmNode configuration. Only agentId and capabilities are required.
This agent's ID, as configured.
Capabilities advertised by this node.
The active McpServerBootstrap instance, if an MCP server was started. Returns null when no MCP server is running.
ATF trust level for this node.
Run a capability auction and return the auction result (or null if no
agents bid within the collection window).
Convenience wrapper over AuctionOrchestrator. Generates a
taskId automatically when one is not provided (UUID v4).
Task description. taskId is optional; one will be
generated if omitted.
Optionalgraph: MeshGraphSPARQL graph for persisting bid records. Defaults to a NullMeshGraph (no persistence).
OptionalauctionConfig: AuctionConfigOptional AuctionConfig overrides.
AuctionResult with winner + all bids, or null if no bids.
Check the ATF trust level of a peer agent.
Sends a NATS request to mesh.atf.trust.check. If no ATF service is
reachable within the timeout, returns ATF_LEVELS.INTERN as a
safe default (least privilege).
Agent ID to check (e.g. 'did:mesh:peer-agent').
The peer's ATFLevel.
Connect to NATS and register agent capabilities in the mesh.
After calling connect(), the node is reachable by other mesh participants
and will receive messages on any subjects it subscribes to via
SwarmNode.subscribe.
Capabilities are announced via a fire-and-forget publish to
mesh.agent.register. If a graphUrl was provided in config, the
capabilities are also written to the Oxigraph RDF store via a SPARQL
UPDATE over HTTP.
Gracefully disconnect from the mesh.
Stops all background sweeps, disposes reliability components, and
closes the underlying NATS connection. If an MCP HTTP server was started
via the mcp config option, it is always stopped (and awaited) before
this method returns.
Discover agents that advertise a given capability.
Sends a NATS request to mesh.capabilities.query and returns the list
of agent IDs that responded with the requested capability. Falls back to
an empty array if no responder is available within the timeout.
Capability name to search for (e.g. 'search').
Array of agent ID strings that have the capability.
Publish a confidence score for this agent to the mesh confidence signal bus.
Convenience wrapper over ConfidenceBus.publish. Pass a
ConfidenceBus instance (created with the underlying NATS connection)
and an optional taskId for correlation.
Data collection only — does not alter ATF trust levels (Phase 4).
The ConfidenceBus to publish on.
Confidence score in [0.0, 1.0].
OptionaltaskId: stringOptional task ID for correlation.
Subscribe to a NATS subject.
The handler receives the decoded JSON payload. Returns an unsubscribe function; call it to cancel the subscription.
NATS subject to subscribe to.
Callback invoked with the parsed JSON payload.
A zero-argument function that cancels the subscription.
SwarmNode — minimal mesh participant.
Wraps MeshNode with a small, ergonomic API focused on the three core operations: connect, publish, and discover. Advanced capabilities (circuit breaker, packet history, module registry) remain accessible via the SwarmNode.meshNode escape hatch.