gRPC client SDK for the F∆I Platform hub (Dart/Flutter)
Find a file
flemming-it 4c7db58bce feat: pullSystemAiModelStreaming for live model-download progress
Wraps HubAdmin/PullSystemAiModelStream: yields the backend's own
status and byte counts per layer, and hands the terminal response to
onFinished, whose errorKind stays the failure signal. Stubs
regenerated from the protos (additive only).

Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
2026-09-08 17:51:28 +02:00
.forgejo/workflows ci(security): add self-test harness (mirror of fai/platform) 2026-05-10 21:41:24 +02:00
.githooks docs: old product name F∆I Platform -> Ch∆In + contact chain@flemming.ai 2026-06-16 10:14:33 +02:00
example refactor: rename package fai_client_sdk -> chain_client_sdk 2026-06-16 17:39:12 +02:00
lib feat: pullSystemAiModelStreaming for live model-download progress 2026-09-08 17:51:28 +02:00
test refactor: rename package fai_client_sdk -> chain_client_sdk 2026-06-16 17:39:12 +02:00
tools refactor: regenerate gRPC stubs for chain.v1 wire package 2026-06-16 16:59:35 +02:00
.gitignore feat: fai_dart_sdk scaffold 2026-05-05 14:19:39 +02:00
analysis_options.yaml feat: live HubClient with generated proto bindings 2026-05-05 16:24:16 +02:00
CHANGELOG.md feat: FlowSummary.sample — regenerated stubs 2026-08-28 00:09:13 +02:00
pubspec.yaml refactor: rename package fai_client_sdk -> chain_client_sdk 2026-06-16 17:39:12 +02:00
README.md docs: describe the shipped SDK surface instead of the 2026-05 scaffold status 2026-07-07 13:44:43 +02:00

chain_client_sdk (Dart)

gRPC client SDK for the Ch∆In hub. Used by Ch∆In Studio (Tier-2 generic GUI) and any Tier-3 Dart/Flutter domain app that wants to talk to a running chain serve.

One of the three SDK families documented in the platform repo (docs/architecture/client-sdks.md):

  • chain-module-sdk (Rust) — flow modules
  • chain-plugin-sdk (Rust) — Studio plugins
  • chain_client_sdk (Dart) — clients ← this package

Dir / repo carries the _dart / -dart language suffix (fai_chain_client_sdk_dart / chain-client-sdk-dart); the Dart package name itself does not (Dart-land doesn't need the suffix).

Status: functional and in production use by Studio. The generated proto bindings (lib/src/generated/chain/v1/) are committed and pinned to the platform's wire protocol (chain.v1). HubClient exposes the full Hub + HubAdmin surface — flow execution (submit incl. detach, submitStreaming, runSavedFlow), detached-invocation status/result/cancel, saved flows, store + module management, audit log (eventLog, streamEvents, verifyEventChain), approvals, federation admin, MCP/n8n endpoint management, System-AI administration, and bearer-token auth (HubClient(authToken:)). Works over native gRPC (desktop / CLI) and gRPC-Web (browser) via conditional channel factories.

Not yet published to pub.dev (publish_to: none) — consume it as a path or git dependency.

Why a separate SDK package

The platform hub speaks gRPC. Each Dart consumer (Studio plus each Tier-3 domain app) would otherwise re-generate proto bindings independently and write near-identical client boilerplate. This package centralises that work:

  • One source of generated proto bindings.
  • One typed HubClient wrapper with helpers.
  • One place to bump when the wire protocol evolves.

Layout

fai_chain_client_sdk_dart/
├── lib/
│   ├── chain_client_sdk.dart        # Public API
│   └── src/
│       ├── hub_client.dart           # Typed client wrapper (~55 methods)
│       ├── channel_factory_io.dart   # Native ClientChannel (HTTP/2)
│       ├── channel_factory_web.dart  # GrpcWebClientChannel.xhr (HTTP/1.1)
│       └── generated/                # protoc output (committed; pinned to platform proto)
├── tools/
│   └── generate.sh                  # Wraps `protoc --dart_out=...` against ../fai_chain/proto
├── example/
└── pubspec.yaml

Repo placement

Published as fai/chain-client-sdk-dart on Forgejo (git.flemming.ai).

Versioning

Tracks the platform's wire-protocol version, not the platform binary version. As long as chain.v1 is current, this SDK stays at 0.x (will move to 1.0 once the API stabilises); when a chain.v2 wire package lands, a 2.x SDK ships in parallel during the transition.