Commit graph

24 commits

Author SHA1 Message Date
flemming-it
35a8ee2844 feat: ModuleInfoResponse.inputs/outputs + ModuleField
Some checks failed
Security / Security check (push) Failing after 2s
Generated bindings for the schema_version 3 / ModuleField
proto addition in fai_platform commit f8b364e. Studio's
flow editor can now ask the hub for declared inputs and
outputs per module, with i18n descriptions, instead of
parsing references out of the flow YAML.

Bumps fai_client_sdk to 0.18.0.

Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
2026-06-01 22:13:07 +02:00
flemming-it
db13bdb4a7 feat(client): reloadAuth() wrapper
Some checks failed
Security / Security check (push) Failing after 1s
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>
2026-05-29 18:40:20 +02:00
flemming-it
023adcec31 chore(deps): grpc 4→5, protobuf 4→6
Some checks failed
Security / Security check (push) Failing after 2s
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>
2026-05-29 14:35:05 +02:00
flemming-it
f882b7f955 chore: rename package + dir + repo to fai_client_sdk
Some checks failed
Security / Security check (push) Failing after 1s
Adopts the three SDK families convention from
fai/platform/docs/architecture/sdks.md — base name carries
the family, language suffix on dir + repo only:

  fai_dart_sdk          (pkg) → fai_client_sdk
  fai_dart_sdk          (dir) → fai_client_sdk_dart
  fai/dart-sdk          (repo) → fai/client-sdk-dart

Internal lib/test/example file renames track the package
name. Old git.flemming.ws URL also retired here.

Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
2026-05-26 13:46:16 +02:00
flemming-it
5c96d74744 chore: regen for FlowSummary.required_capabilities (v0.16.0)
`pb.FlowSummary.requiredCapabilities` flows through the
existing typedef untouched, so callers see the new field
without a wrapper change.

Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
2026-05-09 11:14:34 +02:00
flemming-it
1e98ab9ccf feat: getFlowDefinition wrapper + FlowInputDef DTO (v0.15.0)
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>
2026-05-09 10:12:59 +02:00
flemming-it
193f59302a feat: runSavedFlow accepts file (bytes) inputs (v0.14.0)
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>
2026-05-09 02:07:07 +02:00
flemming-it
45f60ef77b feat: n8n endpoints federation surface (v0.13.0)
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>
2026-05-08 01:00:03 +02:00
flemming-it
f91f477230 feat: kind+provider fields on StoreEntry (v0.12.1)
Studio uses these to mark synthetic capabilities and suppress
their Install button.

Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
2026-05-07 22:44:12 +02:00
flemming-it
776e3c0221 feat: MCP-client federation surface (v0.12.0)
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>
2026-05-07 22:39:19 +02:00
flemming-it
a893361ff9 feat: icon/screenshots/docs_url fields on StoreEntry (v0.11.0)
Picks up the three new optional fields on the StoreEntry
proto. No new client method — fields are plumbed through
SearchStore. Studio reads them off the entry directly.

Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
2026-05-07 21:51:29 +02:00
flemming-it
df6ab995d3 feat: featured flag on StoreEntry (v0.10.1)
Picks up the new `featured: bool` field in the StoreEntry
proto. No new client method — the flag is plumbed through
SearchStore. Studio reads it directly off the entry.

Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
2026-05-07 21:05:03 +02:00
flemming-it
6efbdb2ff9 feat: fetchModuleDocs wrapper (v0.10.0)
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>
2026-05-07 20:45:59 +02:00
flemming-it
90405e6fc3 feat: uninstallModule + daemonPaths wrappers (v0.9.0)
HubClient gains:
- daemonPaths() — typed access to the new DaemonPaths RPC.
- uninstallModule(name) — typed wrapper for UninstallModule.

Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
2026-05-07 17:46:32 +02:00
flemming-it
6dc058344b feat: System-AI cache surface (v0.8.0)
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>
2026-05-07 17:29:26 +02:00
flemming-it
26d9d1f502 feat: clearEventLog wrapper (v0.7.1)
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>
2026-05-07 17:09:52 +02:00
flemming-it
4dad51da6d feat: hardwareInfo + listSystemAiCuratedModels RPCs (v0.7.0)
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>
2026-05-07 15:39:12 +02:00
flemming-it
f04da40751 feat: testSystemAi accepts draft config; list+pull models (v0.6.0)
`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>
2026-05-07 14:02:43 +02:00
flemming-it
8798119903 feat: updateSystemAi + testSystemAi RPCs (v0.5.0)
`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>
2026-05-07 13:41:10 +02:00
flemming-it
f0db42264f feat: SystemAiStatus + AskAi RPCs (v0.4.0)
`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>
2026-05-07 13:18:22 +02:00
flemming-it
73dbdc16ef feat: store + install + channel status (v0.3.0)
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>
2026-05-07 11:54:30 +02:00
flemming-it
c5e11395fb feat: regenerate for HubAdmin.CheckUpdate (v0.2.0)
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>
2026-05-06 15:53:13 +02:00
flemming-it
da10820959 feat: live HubClient with generated proto bindings
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>
2026-05-05 16:24:16 +02:00
flemming-it
d405a6a9bd feat: fai_dart_sdk scaffold
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>
2026-05-05 14:19:39 +02:00