feat: installModuleStreaming for live install progress

Wraps the new HubAdmin/InstallModuleStream: yields one update per
phase and, during the download, as bytes arrive; completes on success
and surfaces the hub's failure text as a stream error, so callers
handle failures exactly as with the unary installModule. Generated
stubs regenerated from the protos (additive only).

Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
This commit is contained in:
flemming-it 2026-09-08 13:38:35 +02:00
parent 5759ce4c7a
commit 1d3d33d55a
4 changed files with 381 additions and 0 deletions

View file

@ -442,6 +442,21 @@ class HubAdminClient extends $grpc.Client {
return $createUnaryCall(_$installModule, request, options: options);
}
/// Same install, with live progress. Emits an update per phase and,
/// during the download, as bytes arrive; the last message carries
/// either the finished response or the error. Clients that only need
/// the outcome keep using the unary InstallModule above this exists
/// so a waiting operator can see that a slow download is progressing
/// rather than hung.
$grpc.ResponseStream<$0.InstallProgressEvent> installModuleStream(
$0.InstallModuleRequest request, {
$grpc.CallOptions? options,
}) {
return $createStreamingCall(
_$installModuleStream, $async.Stream.fromIterable([request]),
options: options);
}
/// Remove an installed module by name. Wipes the module
/// directory and re-scans the registry; writes a
/// `module.uninstalled` audit event. Surfaced by the Studio
@ -956,6 +971,11 @@ class HubAdminClient extends $grpc.Client {
'/chain.v1.HubAdmin/InstallModule',
($0.InstallModuleRequest value) => value.writeToBuffer(),
$0.InstallModuleResponse.fromBuffer);
static final _$installModuleStream =
$grpc.ClientMethod<$0.InstallModuleRequest, $0.InstallProgressEvent>(
'/chain.v1.HubAdmin/InstallModuleStream',
($0.InstallModuleRequest value) => value.writeToBuffer(),
$0.InstallProgressEvent.fromBuffer);
static final _$uninstallModule =
$grpc.ClientMethod<$0.UninstallModuleRequest, $0.UninstallModuleResponse>(
'/chain.v1.HubAdmin/UninstallModule',
@ -1285,6 +1305,15 @@ abstract class HubAdminServiceBase extends $grpc.Service {
($core.List<$core.int> value) =>
$0.InstallModuleRequest.fromBuffer(value),
($0.InstallModuleResponse value) => value.writeToBuffer()));
$addMethod(
$grpc.ServiceMethod<$0.InstallModuleRequest, $0.InstallProgressEvent>(
'InstallModuleStream',
installModuleStream_Pre,
false,
true,
($core.List<$core.int> value) =>
$0.InstallModuleRequest.fromBuffer(value),
($0.InstallProgressEvent value) => value.writeToBuffer()));
$addMethod($grpc.ServiceMethod<$0.UninstallModuleRequest,
$0.UninstallModuleResponse>(
'UninstallModule',
@ -1737,6 +1766,15 @@ abstract class HubAdminServiceBase extends $grpc.Service {
$async.Future<$0.InstallModuleResponse> installModule(
$grpc.ServiceCall call, $0.InstallModuleRequest request);
$async.Stream<$0.InstallProgressEvent> installModuleStream_Pre(
$grpc.ServiceCall $call,
$async.Future<$0.InstallModuleRequest> $request) async* {
yield* installModuleStream($call, await $request);
}
$async.Stream<$0.InstallProgressEvent> installModuleStream(
$grpc.ServiceCall call, $0.InstallModuleRequest request);
$async.Future<$0.UninstallModuleResponse> uninstallModule_Pre(
$grpc.ServiceCall $call,
$async.Future<$0.UninstallModuleRequest> $request) async {