feat(client): listStores / addStore / removeStore for the store manager
Some checks failed
Security / Security check (push) Failing after 2s
Some checks failed
Security / Security check (push) Failing after 2s
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>
This commit is contained in:
parent
2d87030945
commit
d07a0a9777
8 changed files with 956 additions and 143 deletions
|
|
@ -243,6 +243,33 @@ class HubAdminClient extends $grpc.Client {
|
|||
return $createUnaryCall(_$searchStore, request, options: options);
|
||||
}
|
||||
|
||||
/// List the configured module stores (operator config `stores:`)
|
||||
/// plus the implicit bundled seed, for the Studio store manager.
|
||||
$grpc.ResponseFuture<$0.ListStoresResponse> listStores(
|
||||
$0.ListStoresRequest request, {
|
||||
$grpc.CallOptions? options,
|
||||
}) {
|
||||
return $createUnaryCall(_$listStores, request, options: options);
|
||||
}
|
||||
|
||||
/// Register a new module store and merge its index into the live
|
||||
/// store so its modules become searchable + installable immediately.
|
||||
$grpc.ResponseFuture<$0.AddStoreResponse> addStore(
|
||||
$0.AddStoreRequest request, {
|
||||
$grpc.CallOptions? options,
|
||||
}) {
|
||||
return $createUnaryCall(_$addStore, request, options: options);
|
||||
}
|
||||
|
||||
/// Drop a configured store by name and rebuild the live index
|
||||
/// without it. The bundled seed cannot be removed.
|
||||
$grpc.ResponseFuture<$0.RemoveStoreResponse> removeStore(
|
||||
$0.RemoveStoreRequest request, {
|
||||
$grpc.CallOptions? options,
|
||||
}) {
|
||||
return $createUnaryCall(_$removeStore, request, options: options);
|
||||
}
|
||||
|
||||
/// Install a module from a .fai bundle (local path or http(s) URL).
|
||||
$grpc.ResponseFuture<$0.InstallModuleResponse> installModule(
|
||||
$0.InstallModuleRequest request, {
|
||||
|
|
@ -336,7 +363,7 @@ class HubAdminClient extends $grpc.Client {
|
|||
}
|
||||
|
||||
/// Walk the event-log hash chain and return whether tampering
|
||||
/// was detected. Surfaced by the CLI as `fai admin verify-events`
|
||||
/// was detected. Surfaced by the CLI as `chain admin verify-events`
|
||||
/// and by Studio's health page.
|
||||
$grpc.ResponseFuture<$0.VerifyEventChainResponse> verifyEventChain(
|
||||
$1.Empty request, {
|
||||
|
|
@ -348,7 +375,7 @@ class HubAdminClient extends $grpc.Client {
|
|||
/// Wipe every audit event and seed the log with a single
|
||||
/// `chain.reset` marker. Refused on `beta` / `production` for
|
||||
/// compliance — only callable on `local` / `dev`. Surfaced by
|
||||
/// the CLI as `fai admin events clear`.
|
||||
/// the CLI as `chain admin events clear`.
|
||||
$grpc.ResponseFuture<$0.ClearEventLogResponse> clearEventLog(
|
||||
$0.ClearEventLogRequest request, {
|
||||
$grpc.CallOptions? options,
|
||||
|
|
@ -394,7 +421,7 @@ class HubAdminClient extends $grpc.Client {
|
|||
|
||||
/// List host services declared in the operator config. Each
|
||||
/// entry carries name + endpoint; reachability is operator-side
|
||||
/// (on-demand `fai service status` or Studio probe).
|
||||
/// (on-demand `chain service status` or Studio probe).
|
||||
$grpc.ResponseFuture<$0.ServiceList> listServices(
|
||||
$1.Empty request, {
|
||||
$grpc.CallOptions? options,
|
||||
|
|
@ -403,7 +430,7 @@ class HubAdminClient extends $grpc.Client {
|
|||
}
|
||||
|
||||
/// Compare the running hub's version against the channel release
|
||||
/// manifest. Surfaced by the CLI as `fai update check` and by
|
||||
/// manifest. Surfaced by the CLI as `chain update check` and by
|
||||
/// Studio's Doctor page as a "v0.x.y available" pill. Network
|
||||
/// failures are returned as `manifest_reachable=false` rather
|
||||
/// than gRPC errors so Studio can render gracefully when the
|
||||
|
|
@ -438,7 +465,7 @@ class HubAdminClient extends $grpc.Client {
|
|||
|
||||
/// Configured MCP servers + their last-discovery report.
|
||||
/// Studio's MCP-clients editor renders the result. Mirrors
|
||||
/// `fai mcp list` on the CLI.
|
||||
/// `chain mcp list` on the CLI.
|
||||
$grpc.ResponseFuture<$0.ListMcpClientsResponse> listMcpClients(
|
||||
$1.Empty request, {
|
||||
$grpc.CallOptions? options,
|
||||
|
|
@ -449,7 +476,7 @@ class HubAdminClient extends $grpc.Client {
|
|||
/// Re-run discovery against every configured MCP server and
|
||||
/// update the *live* store-index in place. Synthetic entries
|
||||
/// for tools the server no longer exposes are dropped.
|
||||
/// Mirrors `fai mcp refresh` but operates on the running
|
||||
/// Mirrors `chain mcp refresh` but operates on the running
|
||||
/// daemon — Studio doesn't need to ask the operator to
|
||||
/// restart anything.
|
||||
$grpc.ResponseFuture<$0.ListMcpClientsResponse> refreshMcpClients(
|
||||
|
|
@ -459,7 +486,7 @@ class HubAdminClient extends $grpc.Client {
|
|||
return $createUnaryCall(_$refreshMcpClients, request, options: options);
|
||||
}
|
||||
|
||||
/// Persist a new MCP server in `~/.fai/config.yaml` and
|
||||
/// Persist a new MCP server in `~/.chain/config.yaml` and
|
||||
/// re-run discovery. Returns the resulting list (same shape
|
||||
/// as ListMcpClients) so Studio can repaint in one round-trip.
|
||||
$grpc.ResponseFuture<$0.ListMcpClientsResponse> addMcpClient(
|
||||
|
|
@ -530,7 +557,7 @@ class HubAdminClient extends $grpc.Client {
|
|||
}
|
||||
|
||||
/// Persist a new system-AI configuration. Updates the live
|
||||
/// hub state AND writes back to ~/.fai/config.yaml so the
|
||||
/// hub state AND writes back to ~/.chain/config.yaml so the
|
||||
/// change survives daemon restart. Used by Studio's settings
|
||||
/// editor. Returns the resulting status (same shape as
|
||||
/// SystemAiStatus) so the UI can refresh in one round-trip.
|
||||
|
|
@ -620,9 +647,9 @@ class HubAdminClient extends $grpc.Client {
|
|||
}
|
||||
|
||||
/// Federation (primary side). Issue a single-use bootstrap
|
||||
/// token enrolling a named satellite (`fai admin satellites
|
||||
/// token enrolling a named satellite (`chain admin satellites
|
||||
/// peer-add`), and list the satellites currently connected
|
||||
/// (`fai admin satellites list`).
|
||||
/// (`chain admin satellites list`).
|
||||
$grpc.ResponseFuture<$0.IssueBootstrapTokenResponse> issueBootstrapToken(
|
||||
$0.IssueBootstrapTokenRequest request, {
|
||||
$grpc.CallOptions? options,
|
||||
|
|
@ -637,6 +664,16 @@ class HubAdminClient extends $grpc.Client {
|
|||
return $createUnaryCall(_$listSatellites, request, options: options);
|
||||
}
|
||||
|
||||
/// Revoke a satellite by UUID (`chain admin satellites revoke`):
|
||||
/// drops any live connection and refuses future connects even
|
||||
/// with a still-valid cert. Persisted across restarts.
|
||||
$grpc.ResponseFuture<$1.Empty> revokeSatellite(
|
||||
$0.RevokeSatelliteRequest request, {
|
||||
$grpc.CallOptions? options,
|
||||
}) {
|
||||
return $createUnaryCall(_$revokeSatellite, request, options: options);
|
||||
}
|
||||
|
||||
// method descriptors
|
||||
|
||||
static final _$listCapabilities =
|
||||
|
|
@ -693,6 +730,21 @@ class HubAdminClient extends $grpc.Client {
|
|||
'/chain.v1.HubAdmin/SearchStore',
|
||||
($0.SearchStoreRequest value) => value.writeToBuffer(),
|
||||
$0.StoreSearchResponse.fromBuffer);
|
||||
static final _$listStores =
|
||||
$grpc.ClientMethod<$0.ListStoresRequest, $0.ListStoresResponse>(
|
||||
'/chain.v1.HubAdmin/ListStores',
|
||||
($0.ListStoresRequest value) => value.writeToBuffer(),
|
||||
$0.ListStoresResponse.fromBuffer);
|
||||
static final _$addStore =
|
||||
$grpc.ClientMethod<$0.AddStoreRequest, $0.AddStoreResponse>(
|
||||
'/chain.v1.HubAdmin/AddStore',
|
||||
($0.AddStoreRequest value) => value.writeToBuffer(),
|
||||
$0.AddStoreResponse.fromBuffer);
|
||||
static final _$removeStore =
|
||||
$grpc.ClientMethod<$0.RemoveStoreRequest, $0.RemoveStoreResponse>(
|
||||
'/chain.v1.HubAdmin/RemoveStore',
|
||||
($0.RemoveStoreRequest value) => value.writeToBuffer(),
|
||||
$0.RemoveStoreResponse.fromBuffer);
|
||||
static final _$installModule =
|
||||
$grpc.ClientMethod<$0.InstallModuleRequest, $0.InstallModuleResponse>(
|
||||
'/chain.v1.HubAdmin/InstallModule',
|
||||
|
|
@ -876,6 +928,11 @@ class HubAdminClient extends $grpc.Client {
|
|||
'/chain.v1.HubAdmin/ListSatellites',
|
||||
($1.Empty value) => value.writeToBuffer(),
|
||||
$0.SatelliteList.fromBuffer);
|
||||
static final _$revokeSatellite =
|
||||
$grpc.ClientMethod<$0.RevokeSatelliteRequest, $1.Empty>(
|
||||
'/chain.v1.HubAdmin/RevokeSatellite',
|
||||
($0.RevokeSatelliteRequest value) => value.writeToBuffer(),
|
||||
$1.Empty.fromBuffer);
|
||||
}
|
||||
|
||||
@$pb.GrpcServiceName('chain.v1.HubAdmin')
|
||||
|
|
@ -968,6 +1025,29 @@ abstract class HubAdminServiceBase extends $grpc.Service {
|
|||
($core.List<$core.int> value) =>
|
||||
$0.SearchStoreRequest.fromBuffer(value),
|
||||
($0.StoreSearchResponse value) => value.writeToBuffer()));
|
||||
$addMethod($grpc.ServiceMethod<$0.ListStoresRequest, $0.ListStoresResponse>(
|
||||
'ListStores',
|
||||
listStores_Pre,
|
||||
false,
|
||||
false,
|
||||
($core.List<$core.int> value) => $0.ListStoresRequest.fromBuffer(value),
|
||||
($0.ListStoresResponse value) => value.writeToBuffer()));
|
||||
$addMethod($grpc.ServiceMethod<$0.AddStoreRequest, $0.AddStoreResponse>(
|
||||
'AddStore',
|
||||
addStore_Pre,
|
||||
false,
|
||||
false,
|
||||
($core.List<$core.int> value) => $0.AddStoreRequest.fromBuffer(value),
|
||||
($0.AddStoreResponse value) => value.writeToBuffer()));
|
||||
$addMethod(
|
||||
$grpc.ServiceMethod<$0.RemoveStoreRequest, $0.RemoveStoreResponse>(
|
||||
'RemoveStore',
|
||||
removeStore_Pre,
|
||||
false,
|
||||
false,
|
||||
($core.List<$core.int> value) =>
|
||||
$0.RemoveStoreRequest.fromBuffer(value),
|
||||
($0.RemoveStoreResponse value) => value.writeToBuffer()));
|
||||
$addMethod(
|
||||
$grpc.ServiceMethod<$0.InstallModuleRequest, $0.InstallModuleResponse>(
|
||||
'InstallModule',
|
||||
|
|
@ -1265,6 +1345,14 @@ abstract class HubAdminServiceBase extends $grpc.Service {
|
|||
false,
|
||||
($core.List<$core.int> value) => $1.Empty.fromBuffer(value),
|
||||
($0.SatelliteList value) => value.writeToBuffer()));
|
||||
$addMethod($grpc.ServiceMethod<$0.RevokeSatelliteRequest, $1.Empty>(
|
||||
'RevokeSatellite',
|
||||
revokeSatellite_Pre,
|
||||
false,
|
||||
false,
|
||||
($core.List<$core.int> value) =>
|
||||
$0.RevokeSatelliteRequest.fromBuffer(value),
|
||||
($1.Empty value) => value.writeToBuffer()));
|
||||
}
|
||||
|
||||
$async.Future<$0.CapabilityList> listCapabilities_Pre(
|
||||
|
|
@ -1357,6 +1445,30 @@ abstract class HubAdminServiceBase extends $grpc.Service {
|
|||
$async.Future<$0.StoreSearchResponse> searchStore(
|
||||
$grpc.ServiceCall call, $0.SearchStoreRequest request);
|
||||
|
||||
$async.Future<$0.ListStoresResponse> listStores_Pre($grpc.ServiceCall $call,
|
||||
$async.Future<$0.ListStoresRequest> $request) async {
|
||||
return listStores($call, await $request);
|
||||
}
|
||||
|
||||
$async.Future<$0.ListStoresResponse> listStores(
|
||||
$grpc.ServiceCall call, $0.ListStoresRequest request);
|
||||
|
||||
$async.Future<$0.AddStoreResponse> addStore_Pre($grpc.ServiceCall $call,
|
||||
$async.Future<$0.AddStoreRequest> $request) async {
|
||||
return addStore($call, await $request);
|
||||
}
|
||||
|
||||
$async.Future<$0.AddStoreResponse> addStore(
|
||||
$grpc.ServiceCall call, $0.AddStoreRequest request);
|
||||
|
||||
$async.Future<$0.RemoveStoreResponse> removeStore_Pre($grpc.ServiceCall $call,
|
||||
$async.Future<$0.RemoveStoreRequest> $request) async {
|
||||
return removeStore($call, await $request);
|
||||
}
|
||||
|
||||
$async.Future<$0.RemoveStoreResponse> removeStore(
|
||||
$grpc.ServiceCall call, $0.RemoveStoreRequest request);
|
||||
|
||||
$async.Future<$0.InstallModuleResponse> installModule_Pre(
|
||||
$grpc.ServiceCall $call,
|
||||
$async.Future<$0.InstallModuleRequest> $request) async {
|
||||
|
|
@ -1670,4 +1782,12 @@ abstract class HubAdminServiceBase extends $grpc.Service {
|
|||
|
||||
$async.Future<$0.SatelliteList> listSatellites(
|
||||
$grpc.ServiceCall call, $1.Empty request);
|
||||
|
||||
$async.Future<$1.Empty> revokeSatellite_Pre($grpc.ServiceCall $call,
|
||||
$async.Future<$0.RevokeSatelliteRequest> $request) async {
|
||||
return revokeSatellite($call, await $request);
|
||||
}
|
||||
|
||||
$async.Future<$1.Empty> revokeSatellite(
|
||||
$grpc.ServiceCall call, $0.RevokeSatelliteRequest request);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue