Meshpocalypse Semantic
    Preparing search index...

    Interface SwarmNodeConfig

    Configuration for a SwarmNode.

    Only agentId and capabilities are required. All other fields have sensible defaults.

    interface SwarmNodeConfig {
        agentId: string;
        capabilities: string[];
        graphUrl?: string;
        mcp?: boolean | { host?: string; port?: number };
        meshNode?: MeshNode;
        modelCapabilities?: ModelCapabilityConfig[];
        natsUrl?: string;
        observability?: {
            heartbeatMs?: number;
            langfuseBaseUrl?: string;
            langfusePublicKey?: string;
            langfuseSecretKey?: string;
            sampleRate?: number;
            subject?: string;
            unsafePlaintext?: boolean;
        };
        observe?: boolean;
        trustLevel?: ATFLevel;
    }
    Index

    Properties

    agentId: string

    Unique identifier for this agent. Used as the NATS routing key.

    capabilities: string[]

    Capabilities advertised by this agent. Used for registration and peer discovery.

    `['summarise', 'search', 'embed']`
    
    graphUrl?: string

    Optional Oxigraph HTTP endpoint. When provided, connect() registers capabilities in the RDF graph. Capability discovery falls back to graph queries when NATS is unavailable.

    mcp?: boolean | { host?: string; port?: number }

    When set, auto-starts a Streamable HTTP MCP server alongside the NATS connection, exposing this agent's capabilities over the Model Context Protocol via JSON-RPC 2.0.

    • true — start on the default port (3001), bound to 0.0.0.0.
    • { port, host } — start on a custom port / host.
    • false / absent — no MCP server is started (default).

    If the port is already in use when connect() is called.

    meshNode?: MeshNode

    Inject a custom MeshNode instance. Useful for testing or advanced use-cases where you need fine-grained control over transport or reliability settings.

    When provided, natsUrl is ignored (transport is owned by the injected node).

    modelCapabilities?: ModelCapabilityConfig[]

    Model capability profiles available to this agent.

    When provided along with a graphUrl, these are registered as mesh:ModelCapability RDF triples at bootstrap, enabling SPARQL-driven model selection and budget-aware downgrades.

    modelCapabilities: [
    { modelId: 'gpt-4o', modelProvider: 'openai', costPerToken: 0.000015,
    contextWindow: 128000, qualityScore: 0.95 },
    { modelId: 'gpt-4o-mini', modelProvider: 'openai', costPerToken: 0.0000006,
    contextWindow: 128000, qualityScore: 0.70 },
    ]
    natsUrl?: string

    NATS server URL. Defaults to 'nats://localhost:4222'.

    observability?: {
        heartbeatMs?: number;
        langfuseBaseUrl?: string;
        langfusePublicKey?: string;
        langfuseSecretKey?: string;
        sampleRate?: number;
        subject?: string;
        unsafePlaintext?: boolean;
    }

    Fine-grained observability configuration. All fields are optional and have sensible defaults. Requires observe: true to have any effect.

    Type Declaration

    • OptionalheartbeatMs?: number

      Heartbeat interval in milliseconds. Default 30000.

    • OptionallangfuseBaseUrl?: string

      Langfuse base URL. Default 'https://cloud.langfuse.com'.

    • OptionallangfusePublicKey?: string

      Langfuse public key for LLM call tracing integration.

    • OptionallangfuseSecretKey?: string

      Langfuse secret key.

    • OptionalsampleRate?: number

      Fraction of events to emit, 0.0–1.0. Default 1.0.

    • Optionalsubject?: string

      NATS subject for telemetry events. Default 'mesh.telemetry.events'.

    • OptionalunsafePlaintext?: boolean

      Skip Ed25519 signing (development only). Default false.

    observe?: boolean

    Enable automatic observability emission.

    When true, the node will emit signed telemetry events to NATS on connect, disconnect, publish, subscribe handler invocation, trust changes, and errors. No-op until @one137th/mesh-observability-core is wired up in Phase 1.

    false
    
    trustLevel?: ATFLevel

    ATF trust level for this agent. Defaults to ATF_LEVELS.SENIOR — a reasonable default for operational agents.