Regenerated stubs for the additive proto: per-entry
StoreEntry.installVerification, StoreSource.keyPinned, the
ListStoresResponse policy snapshot (requireSignatures /
trustedPublisherCount) and DeclaredService.exposure. New
listStoresFull() exposes the response-level snapshot; listStores()
stays as the plain source list.
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
Wraps the new HubAdmin.PlanSetup RPC (pure plan assembly, no state
change). Regenerated stubs from the updated proto.
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
Stubs regenerated from the current proto: AuthStatusResponse gains
reload_required (true when the hub's on-disk auth config or its env
vars diverge from the live validator — ReloadAuth pending), and the
generated comments pick up the .chain bundle wording. Hand-written
dartdoc in hub_client.dart updated from the pre-rename ~/.fai paths
and .fai bundle extension.
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
healthy() collapses every failure to false, so a hub that is up
but rejects the bearer token was indistinguishable from a dead
endpoint. probe() returns serving / notServing / authRejected
(UNAUTHENTICATED or PERMISSION_DENIED) / unreachable so client
UIs can point the operator at the token instead of the wire.
healthy() is unchanged.
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
Regenerated stubs for the additive AuthStatus HubAdmin RPC and a
typed wrapper: active validator, anonymous flag, token entries with
scope grants, rate limits and env-var set-state. Secret values never
cross the wire.
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
Returns every tracked detached invocation (newest-first) with id,
phase, current step, timestamps, error, flow name and project.
Regenerated stubs from the platform hub.proto.
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
Empty keeps the saved flow's own project:, then general (resolved
hub-side) — the wire field existed, the wrapper now exposes it.
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
- listProjects() returns the shared hub's registry (general first;
sealed areas never appear — they are their own hub instance).
- eventLog, streamEvents and listApprovals take an optional project:
filter; LoggedEvent, PendingApprovalEntry and FlowSummary carry
project. Stubs regenerated from the platform's hub.proto.
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
Regenerates the gRPC stubs from the updated proto and adds:
- HubClient.submitStreaming(...) -> Stream<SubmitStreamEvent>: follow a
flow execution live (step markers, module emit-events, terminal
result/error). Works over native gRPC and, on web, gRPC-Web (the
same conditional channel factory the rest of the SDK uses).
- submit(..., detach: true) and getInvocationStatus /
getInvocationResult / cancelInvocation wrappers (T3).
- SubmitStreamEvent + InvocationStatus re-exported as typedefs.
Shared _buildSubmitRequest between submit + submitStreaming. analyze
clean, tests pass.
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
Regenerate Dart bindings for AddStoreRequest.pinned_pubkey_pem and
thread it through HubClient.addStore so clients can pin a per-store
publisher key.
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
Wrap the Submit RPC so callers can run a flow inline with typed
inputs and read its outputs. jsonInputs (each value a Dart Map) are
converted to a google.protobuf.Struct via a recursive builder and
sent as Payload.json — the only path that can feed a json-typed
module input (e.g. econ.skm_score, law.benefit_score). The returned
SubmitResponse.outputs carry the flow outputs, which the audit log
does not persist.
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
Regenerate the gRPC stubs for the new HubAdmin store-management RPCs and
wrap them in HubClient (returns StoreSource list / Add+RemoveStoreResponse)
so Studio can list and edit the module-store list from the GUI.
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
The hub renamed its gRPC package fai.v1 -> chain.v1 (proto dir
proto/fai/v1 -> proto/chain/v1). Move the generated stubs to
generated/chain/v1 and rewrite the wire package + service paths
(/fai.v1.Hub/* -> /chain.v1.Hub/*) so the client talks to the
renamed hub. Pure package rename — no message/field changes.
HubClient public API is unchanged, so dependents need no edits.
dart analyze: clean.
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
Regenerate the Dart bindings from the platform protos (now including
fai/v1/federation.proto and the IssueBootstrapToken / ListSatellites
HubAdmin RPCs + the new primary_ca_pem field). Add HubClient
wrappers: listSatellites() and issueBootstrapToken(name, region,
ttl), the latter returning the primary CA so callers can bootstrap a
satellite in one step.
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
Studio + pilot apps can now trigger a hub-side TokenStore
swap without restarting the daemon:
await client.reloadAuth(); // returns new token count
Throws when the new config is invalid; the existing store
stays in place server-side so a botched rotation can't lock
the operator out.
Bindings regenerated for the new
HubAdmin.ReloadAuth + ReloadAuthResponse + LoggedEvent
.caller_name proto additions.
dart analyze clean; dart test green (4 tests).
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
Two coupled majors that have been blocking the rest of the
Dart-side dependency lift in Studio (the constraint solver
pins meta/characters/etc. through these). Picked up:
- grpc 5.1.0 (was 4.2.0)
- protobuf 6.0.0 (was 4.2.0)
- analyzer 13.0.0, _fe_analyzer_shared 100.0.0
- google_cloud 0.5.0, googleapis_auth 2.3.1 (transitive)
The bindings now live in `lib/src/generated/fai/v1/` only —
the well-known-types `lib/src/generated/google/protobuf/`
copy has been deleted. protobuf 6 ships its own bundled
`well_known_types/google/protobuf/empty.pb.dart` and the
`HubAdminClient` API expects the *packaged* Empty type;
emitting a local copy created two distinct Empty types and
broke every `_admin.<rpc>(Empty())` call site.
`tools/generate.sh` now skips the WKT generation pass and
wipes `lib/src/generated/google/` on every run so the
duplicate-types breakage can't regress silently. The
import in `hub_client.dart` switches from the local copy to
`package:protobuf/well_known_types/google/protobuf/empty.pb
.dart`.
Smoke-verified: dart analyze clean, dart test green
(4 tests). Bumped to 0.17.0 — Studio absorbs in the next
commit.
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
Studio's upcoming default_scope editor in Settings calls
through these wrappers. Both return a record with the live
`scope` and the catalog-known publisher shortlist so the UI
can render a typeahead while letting operators paste private
publisher segments freely.
Bindings regenerated from fai_platform/proto.
dart analyze + dart test green (4 tests).
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
Adds `HubClient.streamEvents(backfill:, types:)` returning a
`Stream<LoggedEvent>` that fronts the new
`HubAdmin/StreamEvents` RPC. Each event arrives the instant
the hub appends it; cancel the subscription to close the RPC.
`backfill` defaults to 50 historical events (oldest-last for
chronological reception). `RESOURCE_EXHAUSTED` from the
server means the receiver fell behind — reconnect with a
fresh backfill to resync.
Bindings regenerated from fai_platform/proto.
dart analyze + dart test green (4 tests).
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
`HubClient` accepts an optional `authToken: String?` that
attaches `authorization: Bearer <token>` to every gRPC + gRPC-
Web call as default CallOptions metadata.
Operators with `auth.tokens:` configured on the hub now have
a one-line client-side wire-up:
final client = HubClient(
endpoint: HubEndpoint(host: '...', port: 50051),
authToken: 'secret-from-1password-or-vault',
);
Without `authToken`, calls go unauthenticated — the hub
either accepts (anonymous mode) or rejects with
`UNAUTHENTICATED` (16) when auth is required.
dart analyze + dart test green (4 tests).
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
Splits channel construction into two files selected at
compile-time via `if (dart.library.html)`:
channel_factory_io.dart — native ClientChannel (HTTP/2)
channel_factory_web.dart — GrpcWebClientChannel.xhr (HTTP/1.1)
HubClient._channel is now `ClientChannelBase` so both
implementations satisfy the same field type. dart:html-only
imports (`package:grpc/grpc_web.dart`) stay isolated from the
native compile path.
Pairs with the hub-side `fai_grpc_web` adapter crate
(fai/platform 0d07892) — `tonic-web` on the same port as
native gRPC, so one `fai serve` listener handles both
surfaces.
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
Adds HubClient.invokePluginTranslate as a typed method.
Same shape as invokePluginTheme: capability + args in,
typed response out.
Signed-off-by: flemming-it <sf@flemming.it>
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
- New getInstalledModuleDocs(name, locale) wraps the new gRPC
RPC; callers get text + source path + a not-installed flag so
Studio can decide whether to show a Documentation section at
all.
- runSavedFlow gains an optional fileMimeTypes map keyed
parallel to fileInputs. Hard-coded application/octet-stream
remains as the fallback, but text.extract and other
MIME-gating modules now get an accurate type when the caller
knows one.
- fetchModuleDocs is marked @Deprecated; it still works for
older consumers but Studio no longer calls it.
- Proto bindings regenerated against fai/platform proto.
Signed-off-by: flemming-it <sf@flemming.it>
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
Hub now accepts a locale field on FetchModuleDocsRequest so
README.<locale>.md (e.g. README.de.md) gets tried before the
generic README.md. SDK passes it via an optional named param;
empty string keeps the previous behaviour.
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
Surface the new platform RPC `GetFlowDefinition` as a typed
Dart method so Studio (and other GUI clients) can render an
input form before calling `runSavedFlow`. Each declared input
arrives as a `FlowInputDef` with the verbatim type tag from
the flow YAML — usually `text`, `bytes`, `json`, or `file`.
Regenerated proto bindings to pick up the new
`GetFlowDefinitionRequest`, `FlowDefinition`, and
`FlowInputSpec` message types.
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
Studio's Flows tab couldn't run any sample flow with a
binary input (extract / extract-summarize / …) because
runSavedFlow only knew how to wrap textInputs as text
Payloads. Operators saw the hub return
"step references missing value '\$inputs.document'" because
the document key never made it into the request.
`runSavedFlow` is now mixed-mode:
Future<SubmitResponse> runSavedFlow({
required String name,
Map<String, String> textInputs = const {},
Map<String, Uint8List> fileInputs = const {},
})
Both maps default to empty so existing text-only callers
keep working without code changes — the previous required
`textInputs:` parameter is now optional with a default. File
entries get wrapped as `Bytes` Payloads with
`application/octet-stream` MIME — good enough for the
text.extract / text.summarize chain that the bundled flows
exercise. Per-file MIME-type override is a follow-up if any
operator workflow ever needs it.
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
Sister of the MCP-client surface — four new HubAdmin RPCs
(`ListN8nEndpoints`, `RefreshN8nEndpoints`, `AddN8nEndpoint`,
`RemoveN8nEndpoint`) plus the matching typedefs so callers
read configuration off `N8nEndpointStatus` without importing
generated/.
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
Picks up the four new HubAdmin RPCs that drive Studio's
MCP-clients editor:
- `listMcpClients()` — config + last-discovery snapshot.
- `refreshMcpClients()` — re-run discovery against the live
daemon.
- `addMcpClient(name, endpoint, apiKeyEnv?, description?)` —
persist + refresh in one round-trip.
- `removeMcpClient(name)` — drop persisted entry and live
synthetic capabilities.
Typedefs for `ListMcpClientsResponse`, `McpClientStatus`,
`McpClientConfigEntry` so callers don't import generated/.
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
Picks up HubAdmin.FetchModuleDocs. HubClient exposes it as
fetchModuleDocs(name) returning the FetchModuleDocsResponse
verbatim — Studio maps the error_kind to friendly copy.
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
Picks up cache-related additions in HubAdmin:
- AskAi gains `forceFresh` request flag and `cached` /
`cachedAt` / `cacheHits` response fields.
- New ClearSystemLlmCache + ForgetCachedExplanation RPCs.
- SystemAiStatus carries `cacheCount` so the UI can render
"Cache: N cached explanations".
HubClient exposes `clearSystemLlmCache()` returning the
purged count and `forgetCachedExplanation(prompt)` for the
Regenerate flow.
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
Picks up the new HubAdmin.ClearEventLog RPC. Exposed as
HubClient.clearEventLog(reviewer:, reason:) returning the
purged count + active channel for the caller to confirm.
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
Regenerated protos pick up the two new HubAdmin RPCs. HubClient
exposes them as hardwareInfo() and listSystemAiCuratedModels(),
with HardwareInfoResponse, ListSystemAiCuratedModelsResponse,
CuratedModel re-exported as typedefs so callers don't import
the generated/ directory directly.
Studio uses the pair to colour-code models in the System-AI
editor against the operator's actual hardware.
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
`testSystemAi` now takes optional provider/endpoint/model/
apiKeyEnv/privacyMode params; the editor passes form values so
Test Connection works before Save. New `listSystemAiModels`
fetches the provider's `/v1/models` listing, `pullSystemAiModel`
calls Ollama's `/api/pull` synchronously.
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
`HubClient.updateSystemAi(...)` persists a new System-AI config
to ~/.fai/config.yaml AND hot-reloads the live hub state in one
round-trip; returns the resulting SystemAiStatus so the UI
refreshes without a second call.
`HubClient.testSystemAi()` probes the configured provider with
a tiny ping and returns the same error-kind taxonomy as askAi.
Studio's "Test connection" button uses this.
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
`HubClient.systemAiStatus()` reports whether the hub-internal LLM
hook is configured and which provider / privacy mode is active.
`HubClient.askAi(prompt)` issues a one-shot prompt and returns
the answer or a structured error kind so the UI can map each
failure to its inline-fix copy.
LoggedEvent gains `detail` upstream (no SDK change required).
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
Catches the Dart bindings up to the platform's gRPC additions:
* `searchStore({query, category, tag, status, limit})` — wraps
HubAdmin.SearchStore so Studio can build a Store browser
page.
* `installModule({source, expectedSha256})` — wraps
HubAdmin.InstallModule so the operator can one-click install
a `.fai` bundle from the UI.
* `channelStatus()` — new HubAdmin.ChannelStatus RPC. Returns
active channel name + per-channel running flag + endpoint.
Re-exports the new proto types (StoreEntry,
StoreSearchResponse, InstallModuleResponse, ChannelStatusResponse,
ChannelEntry) so callers don't import protobuf directly.
LoggedEvent gains a `detail` field (free-form JSON string)
upstream; the regenerated bindings expose it without further
work — Studio's audit drill-down renders it pretty-printed.
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
Adds `checkUpdate()` to HubClient and re-exports
`CheckUpdateResponse` so callers (Studio Doctor page) can render
update + offline states without importing protobuf directly.
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
Two more wrappers for Studio's new Flows page. Saved flows can
be listed (FlowSummary: name + path + size) and executed by
name with a map of named text inputs. Returns a SubmitResponse
whose `outputs` map carries the flow's declared outputs as
Payloads.
Common payload type re-exposed via the `Payload` typedef from
common.pb.dart so the Studio side can pattern-match on
text/json/bytes/file without dragging in proto imports.
Bumps fai_dart_sdk 0.4.0 -> 0.5.0.
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
Initial scaffold accidentally created three separate gRPC
channels (one for each of `_channel`, `_hub`, `_admin`).
Refactor to a single shared channel — cleaner, fewer file
descriptors, and `close()` actually closes everything now.
Idle timeout raised to 5 minutes so polling-style page loops
don't keep reconnecting.
No public-API change.
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
Wraps the existing HubAdmin.ModuleInfo RPC so Studio can
render a detail panel for one module without re-implementing
the proto types.
Bumps fai_dart_sdk 0.3.0 -> 0.4.0.
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
Mirrors the two new HubAdmin RPCs in fai_platform 0.10.44.
Studio's Doctor page consumes these directly. Generated proto
bindings refreshed to include VerifyEventChainResponse,
ServiceList, DeclaredService.
Bumps fai_dart_sdk 0.2.0 -> 0.3.0.
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
Proto codegen wired in. tools/generate.sh wraps protoc against
../fai_platform/proto/, including the well-known types (Empty,
Struct, Timestamp) so they are generated alongside fai's own
messages — protobuf 4.x doesn't ship them as importable Dart
types, so we have to generate them ourselves.
HubClient now exposes typed methods backed by real RPCs:
- healthy() — Hub.Health probe (returns false on connect refused).
- listCapabilities() — HubAdmin.ListCapabilities.
- eventLog() — HubAdmin.EventLog with type filter.
- listApprovals() — HubAdmin.ListApprovals (status filter).
- approve() / reject() — HubAdmin.DecideApproval.
Generated bindings under lib/src/generated/ are excluded from
analyze (out of our style control). protoc_plugin pinned to
22.2.0 in tools/generate.sh comment because newer plugins
generate code against protobuf 6.x, while grpc 4.x still
constrains us to protobuf 4.x.
Bumps fai_dart_sdk 0.1.0 -> 0.2.0.
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
Dart package skeleton for the F∆I gRPC client. Used by F∆I
Studio (Tier-2) and Tier-3 domain apps (DigiScout / J∆I /
Scout). Public surface — HubClient, HubEndpoint — is committed
as a typed stub so downstream apps can compile against it
immediately. Generated proto bindings land in a follow-up
commit once the codegen step (planned: tools/generate.sh
wrapping protoc-gen-dart against ../fai_platform/proto) is
wired in.
Future Forgejo path: fai/dart-sdk.
dart analyze: clean. dart test: 4/4.
Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>