From 4a582f2b8d99fddf99f3c05ec4e9ac5d18028083 Mon Sep 17 00:00:00 2001 From: flemming-it Date: Mon, 25 May 2026 21:49:39 +0200 Subject: [PATCH] chore(proto): regenerate after InvokePluginTheme RPC Tracks fai/platform's new gRPC RPC + matching request / response messages. Adds HubClient.invokePluginTheme as a typed Dart method. Signed-off-by: flemming-it Signed-off-by: flemming-it --- lib/src/generated/fai/v1/hub.pb.dart | 128 +++++++++++++++++++++++ lib/src/generated/fai/v1/hub.pbgrpc.dart | 26 +++++ lib/src/generated/fai/v1/hub.pbjson.dart | 28 +++++ lib/src/hub_client.dart | 29 +++++ 4 files changed, 211 insertions(+) diff --git a/lib/src/generated/fai/v1/hub.pb.dart b/lib/src/generated/fai/v1/hub.pb.dart index 52c8fea..fd84c73 100644 --- a/lib/src/generated/fai/v1/hub.pb.dart +++ b/lib/src/generated/fai/v1/hub.pb.dart @@ -2236,6 +2236,134 @@ class GetInstalledModuleDocsResponse extends $pb.GeneratedMessage { void clearNotInstalled() => $_clearField(3); } +class InvokePluginThemeRequest extends $pb.GeneratedMessage { + factory InvokePluginThemeRequest({ + $core.String? capability, + $core.String? brightness, + }) { + final $result = create(); + if (capability != null) { + $result.capability = capability; + } + if (brightness != null) { + $result.brightness = brightness; + } + return $result; + } + InvokePluginThemeRequest._() : super(); + factory InvokePluginThemeRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory InvokePluginThemeRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'InvokePluginThemeRequest', package: const $pb.PackageName(_omitMessageNames ? '' : 'fai.v1'), createEmptyInstance: create) + ..aOS(1, _omitFieldNames ? '' : 'capability') + ..aOS(2, _omitFieldNames ? '' : 'brightness') + ..hasRequiredFields = false + ; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + InvokePluginThemeRequest clone() => InvokePluginThemeRequest()..mergeFromMessage(this); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + InvokePluginThemeRequest copyWith(void Function(InvokePluginThemeRequest) updates) => super.copyWith((message) => updates(message as InvokePluginThemeRequest)) as InvokePluginThemeRequest; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static InvokePluginThemeRequest create() => InvokePluginThemeRequest._(); + InvokePluginThemeRequest createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static InvokePluginThemeRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static InvokePluginThemeRequest? _defaultInstance; + + /// Capability name the operator asked for, e.g. + /// `studio.theme.solarized`. The hub maps this to the + /// installed plugin directory. + @$pb.TagNumber(1) + $core.String get capability => $_getSZ(0); + @$pb.TagNumber(1) + set capability($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasCapability() => $_has(0); + @$pb.TagNumber(1) + void clearCapability() => $_clearField(1); + + /// "light" or "dark" — the plugin returns a ColorScheme + /// for this brightness. Plugins that don't recognise the + /// value return PluginError::declined and the hub + /// surfaces that as a friendly error. + @$pb.TagNumber(2) + $core.String get brightness => $_getSZ(1); + @$pb.TagNumber(2) + set brightness($core.String v) { $_setString(1, v); } + @$pb.TagNumber(2) + $core.bool hasBrightness() => $_has(1); + @$pb.TagNumber(2) + void clearBrightness() => $_clearField(2); +} + +class InvokePluginThemeResponse extends $pb.GeneratedMessage { + factory InvokePluginThemeResponse({ + $core.String? brightness, + $core.Iterable<$core.int>? tokens, + }) { + final $result = create(); + if (brightness != null) { + $result.brightness = brightness; + } + if (tokens != null) { + $result.tokens.addAll(tokens); + } + return $result; + } + InvokePluginThemeResponse._() : super(); + factory InvokePluginThemeResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory InvokePluginThemeResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'InvokePluginThemeResponse', package: const $pb.PackageName(_omitMessageNames ? '' : 'fai.v1'), createEmptyInstance: create) + ..aOS(1, _omitFieldNames ? '' : 'brightness') + ..p<$core.int>(2, _omitFieldNames ? '' : 'tokens', $pb.PbFieldType.KU3) + ..hasRequiredFields = false + ; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + InvokePluginThemeResponse clone() => InvokePluginThemeResponse()..mergeFromMessage(this); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + InvokePluginThemeResponse copyWith(void Function(InvokePluginThemeResponse) updates) => super.copyWith((message) => updates(message as InvokePluginThemeResponse)) as InvokePluginThemeResponse; + + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static InvokePluginThemeResponse create() => InvokePluginThemeResponse._(); + InvokePluginThemeResponse createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static InvokePluginThemeResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static InvokePluginThemeResponse? _defaultInstance; + + /// Echo of the brightness input. Plugins are expected to + /// round-trip it; if they don't the client treats that as + /// a contract violation. + @$pb.TagNumber(1) + $core.String get brightness => $_getSZ(0); + @$pb.TagNumber(1) + set brightness($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasBrightness() => $_has(0); + @$pb.TagNumber(1) + void clearBrightness() => $_clearField(1); + + /// 14 ARGB tokens in Material 3 order: + /// primary, on_primary, secondary, on_secondary, + /// tertiary, on_tertiary, error, on_error, + /// surface, on_surface, surface_variant, + /// on_surface_variant, outline, outline_variant. + /// Studio merges any missing slot (well-behaved plugins + /// send all 14) with its built-in fallback before + /// applying the scheme. + @$pb.TagNumber(2) + $pb.PbList<$core.int> get tokens => $_getList(1); +} + class ListApprovalsRequest extends $pb.GeneratedMessage { factory ListApprovalsRequest({ $core.Iterable<$core.String>? statuses, diff --git a/lib/src/generated/fai/v1/hub.pbgrpc.dart b/lib/src/generated/fai/v1/hub.pbgrpc.dart index e225ef6..e518459 100644 --- a/lib/src/generated/fai/v1/hub.pbgrpc.dart +++ b/lib/src/generated/fai/v1/hub.pbgrpc.dart @@ -179,6 +179,10 @@ class HubAdminClient extends $grpc.Client { '/fai.v1.HubAdmin/GetInstalledModuleDocs', ($0.GetInstalledModuleDocsRequest value) => value.writeToBuffer(), ($core.List<$core.int> value) => $0.GetInstalledModuleDocsResponse.fromBuffer(value)); + static final _$invokePluginTheme = $grpc.ClientMethod<$0.InvokePluginThemeRequest, $0.InvokePluginThemeResponse>( + '/fai.v1.HubAdmin/InvokePluginTheme', + ($0.InvokePluginThemeRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => $0.InvokePluginThemeResponse.fromBuffer(value)); static final _$listApprovals = $grpc.ClientMethod<$0.ListApprovalsRequest, $0.ApprovalList>( '/fai.v1.HubAdmin/ListApprovals', ($0.ListApprovalsRequest value) => value.writeToBuffer(), @@ -370,6 +374,16 @@ class HubAdminClient extends $grpc.Client { return $createUnaryCall(_$getInstalledModuleDocs, request, options: options); } + /// Invoke an installed Studio plugin's `theme` hook. Returns + /// the plugin's proposed Material 3 ColorScheme for the + /// brightness the caller asked for ("light" or "dark"). The + /// first end-to-end RPC of the Studio-plugin subsystem; the + /// `translate` and `output-view` hooks get their own RPCs as + /// the matching Studio surfaces ship. + $grpc.ResponseFuture<$0.InvokePluginThemeResponse> invokePluginTheme($0.InvokePluginThemeRequest request, {$grpc.CallOptions? options}) { + return $createUnaryCall(_$invokePluginTheme, request, options: options); + } + /// List system.approval@^0 entries, optionally filtered by status. $grpc.ResponseFuture<$0.ApprovalList> listApprovals($0.ListApprovalsRequest request, {$grpc.CallOptions? options}) { return $createUnaryCall(_$listApprovals, request, options: options); @@ -660,6 +674,13 @@ abstract class HubAdminServiceBase extends $grpc.Service { false, ($core.List<$core.int> value) => $0.GetInstalledModuleDocsRequest.fromBuffer(value), ($0.GetInstalledModuleDocsResponse value) => value.writeToBuffer())); + $addMethod($grpc.ServiceMethod<$0.InvokePluginThemeRequest, $0.InvokePluginThemeResponse>( + 'InvokePluginTheme', + invokePluginTheme_Pre, + false, + false, + ($core.List<$core.int> value) => $0.InvokePluginThemeRequest.fromBuffer(value), + ($0.InvokePluginThemeResponse value) => value.writeToBuffer())); $addMethod($grpc.ServiceMethod<$0.ListApprovalsRequest, $0.ApprovalList>( 'ListApprovals', listApprovals_Pre, @@ -900,6 +921,10 @@ abstract class HubAdminServiceBase extends $grpc.Service { return getInstalledModuleDocs($call, await $request); } + $async.Future<$0.InvokePluginThemeResponse> invokePluginTheme_Pre($grpc.ServiceCall $call, $async.Future<$0.InvokePluginThemeRequest> $request) async { + return invokePluginTheme($call, await $request); + } + $async.Future<$0.ApprovalList> listApprovals_Pre($grpc.ServiceCall $call, $async.Future<$0.ListApprovalsRequest> $request) async { return listApprovals($call, await $request); } @@ -1018,6 +1043,7 @@ abstract class HubAdminServiceBase extends $grpc.Service { $async.Future<$0.UninstallModuleResponse> uninstallModule($grpc.ServiceCall call, $0.UninstallModuleRequest request); $async.Future<$0.FetchModuleDocsResponse> fetchModuleDocs($grpc.ServiceCall call, $0.FetchModuleDocsRequest request); $async.Future<$0.GetInstalledModuleDocsResponse> getInstalledModuleDocs($grpc.ServiceCall call, $0.GetInstalledModuleDocsRequest request); + $async.Future<$0.InvokePluginThemeResponse> invokePluginTheme($grpc.ServiceCall call, $0.InvokePluginThemeRequest request); $async.Future<$0.ApprovalList> listApprovals($grpc.ServiceCall call, $0.ListApprovalsRequest request); $async.Future<$0.DecideApprovalResponse> decideApproval($grpc.ServiceCall call, $0.DecideApprovalRequest request); $async.Future<$0.VerifyEventChainResponse> verifyEventChain($grpc.ServiceCall call, $1.Empty request); diff --git a/lib/src/generated/fai/v1/hub.pbjson.dart b/lib/src/generated/fai/v1/hub.pbjson.dart index 9cb289d..571bbfd 100644 --- a/lib/src/generated/fai/v1/hub.pbjson.dart +++ b/lib/src/generated/fai/v1/hub.pbjson.dart @@ -565,6 +565,34 @@ final $typed_data.Uint8List getInstalledModuleDocsResponseDescriptor = $convert. 'tzb3VyY2VfcGF0aBgCIAEoCVIKc291cmNlUGF0aBIjCg1ub3RfaW5zdGFsbGVkGAMgASgIUgxu' 'b3RJbnN0YWxsZWQ='); +@$core.Deprecated('Use invokePluginThemeRequestDescriptor instead') +const InvokePluginThemeRequest$json = { + '1': 'InvokePluginThemeRequest', + '2': [ + {'1': 'capability', '3': 1, '4': 1, '5': 9, '10': 'capability'}, + {'1': 'brightness', '3': 2, '4': 1, '5': 9, '10': 'brightness'}, + ], +}; + +/// Descriptor for `InvokePluginThemeRequest`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List invokePluginThemeRequestDescriptor = $convert.base64Decode( + 'ChhJbnZva2VQbHVnaW5UaGVtZVJlcXVlc3QSHgoKY2FwYWJpbGl0eRgBIAEoCVIKY2FwYWJpbG' + 'l0eRIeCgpicmlnaHRuZXNzGAIgASgJUgpicmlnaHRuZXNz'); + +@$core.Deprecated('Use invokePluginThemeResponseDescriptor instead') +const InvokePluginThemeResponse$json = { + '1': 'InvokePluginThemeResponse', + '2': [ + {'1': 'brightness', '3': 1, '4': 1, '5': 9, '10': 'brightness'}, + {'1': 'tokens', '3': 2, '4': 3, '5': 13, '10': 'tokens'}, + ], +}; + +/// Descriptor for `InvokePluginThemeResponse`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List invokePluginThemeResponseDescriptor = $convert.base64Decode( + 'ChlJbnZva2VQbHVnaW5UaGVtZVJlc3BvbnNlEh4KCmJyaWdodG5lc3MYASABKAlSCmJyaWdodG' + '5lc3MSFgoGdG9rZW5zGAIgAygNUgZ0b2tlbnM='); + @$core.Deprecated('Use listApprovalsRequestDescriptor instead') const ListApprovalsRequest$json = { '1': 'ListApprovalsRequest', diff --git a/lib/src/hub_client.dart b/lib/src/hub_client.dart index 9da5025..36ef62e 100644 --- a/lib/src/hub_client.dart +++ b/lib/src/hub_client.dart @@ -60,6 +60,7 @@ typedef DaemonPathsResponse = pb.DaemonPathsResponse; typedef UninstallModuleResponse = pb.UninstallModuleResponse; typedef FetchModuleDocsResponse = pb.FetchModuleDocsResponse; typedef GetInstalledModuleDocsResponse = pb.GetInstalledModuleDocsResponse; +typedef InvokePluginThemeResponse = pb.InvokePluginThemeResponse; typedef ListMcpClientsResponse = pb.ListMcpClientsResponse; typedef McpClientStatus = pb.McpClientStatus; typedef McpClientConfigEntry = pb.McpClientConfigEntry; @@ -273,6 +274,34 @@ class HubClient { ); } + /// Invoke an installed Studio plugin's `theme` hook and + /// receive a Material 3 ColorScheme for the brightness + /// ("light" or "dark") the caller asked for. + /// + /// [capability] is the full Studio-plugin capability name + /// (e.g. "studio.theme.solarized"). [brightness] must be + /// "light" or "dark"; other values surface as + /// `INVALID_ARGUMENT` from the hub. A plugin that doesn't + /// recognise the brightness returns Declined, which the + /// hub maps to `FAILED_PRECONDITION` — Studio's + /// friendly-error mapper renders it with a recovery hint. + /// + /// The first end-to-end RPC of the Studio-plugin + /// subsystem; `translate` and `output-view` hooks get + /// their own methods once the matching Studio surfaces + /// ship. + Future invokePluginTheme({ + required String capability, + required String brightness, + }) { + return _admin.invokePluginTheme( + pb.InvokePluginThemeRequest( + capability: capability, + brightness: brightness, + ), + ); + } + /// List every configured MCP server with the last-discovery /// snapshot. Drives Studio's MCP-clients editor. Future listMcpClients() {