Home / Docs / SDK and Clients

SDK and Clients

SDK and Clients

FabrCore v1.7.1 separates the HTTP SDK from real-time transport. Use FabrCore.Sdk for Host REST operations and FabrCore.Client.WebSocket for the authenticated WebSocket v2 protocol. Keep user-interface state and identity integration in your application.

Principal-scoped identity

ClientGrain is now PrincipalGrain. Handles use principalHandle:agentHandle, and the principal is the partition for tracking, access control, durable delivery, and agent state.

Install

Command line
dotnet add package FabrCore.Sdk
dotnet add package FabrCore.Client.WebSocket

Typed Host API Client

IFabrCoreHostApiClient wraps the Host REST API for agent lifecycle, messaging, health, storage, discovery, diagnostics, Blueprints, verifiable execution, and administrative operations. Configure the Host base address and authenticated principal in one application service, then expose business-specific methods to your UI.

Administrative model APIs

Remote model-configuration endpoints require the FabrCoreAdmin policy. Set FabrCore:AdminAuthentication:ApiKey for an SDK client that is authorized to manage models. Do not place that key in browser-delivered code.

Typed WebSocket Client

The v2 client obtains a short-lived connection ticket, negotiates fabrcore.v2, waits for the server hello, and exposes typed operations. Configure a stable clientId when the application needs ordered replay across reconnects.

C# — real-time client
await using var client = new FabrCoreWebSocketClient(
    authenticatedHttpClient,
    new FabrCoreWebSocketClientOptions
    {
        HostUri = new Uri("https://agents.example.com"),
        ClientId = "research-console-42"
    });

await client.ConnectAsync(cancellationToken);
await client.SendMessageAsync(
    new AgentMessage
    {
        ToHandle = "research-agent",
        Message = "Summarize the latest evidence."
    },
    cancellationToken);

For tickets, operations, acknowledgements, replay, and gap handling, see WebSocket v2.

Harness Skills Administration

v1.7.1 adds SDK methods for listing, publishing, retrieving, and deleting exact-version Harness Skills for a principal. The administration routes are protected by FabrCoreAdmin; execution receives only the versions explicitly selected in the agent's _HarnessSkills argument.

See Harness Skills for package constraints and versioning rules.

Migration Notes

  • Replace IClientGrain/ClientGrain with IPrincipalGrain/PrincipalGrain.
  • Remove the obsolete FabrCore.Client, ClientContext, DirectMessageSender, and ChatDock dependencies.
  • Replace query-string WebSocket identity and raw AgentMessage payloads with WebSocket v2 tickets and typed operations.
Documentation