From 35a8ee28442124966332c3f15aeb3bd4e908e97f Mon Sep 17 00:00:00 2001 From: flemming-it Date: Mon, 1 Jun 2026 22:13:07 +0200 Subject: [PATCH] feat: ModuleInfoResponse.inputs/outputs + ModuleField 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 --- lib/src/generated/fai/v1/hub.pb.dart | 201 +++++++++++++++++++++++ lib/src/generated/fai/v1/hub.pbjson.dart | 79 ++++++++- pubspec.yaml | 2 +- 3 files changed, 280 insertions(+), 2 deletions(-) diff --git a/lib/src/generated/fai/v1/hub.pb.dart b/lib/src/generated/fai/v1/hub.pb.dart index 05af8d0..2a80a62 100644 --- a/lib/src/generated/fai/v1/hub.pb.dart +++ b/lib/src/generated/fai/v1/hub.pb.dart @@ -633,6 +633,9 @@ class ModuleInfoResponse extends $pb.GeneratedMessage { $core.Iterable<$core.String>? permissions, $core.String? directory, $core.Iterable<$core.String>? acceptsMime, + $core.Iterable? consumes, + $core.Iterable? inputs, + $core.Iterable? outputs, }) { final result = create(); if (name != null) result.name = name; @@ -641,6 +644,9 @@ class ModuleInfoResponse extends $pb.GeneratedMessage { if (permissions != null) result.permissions.addAll(permissions); if (directory != null) result.directory = directory; if (acceptsMime != null) result.acceptsMime.addAll(acceptsMime); + if (consumes != null) result.consumes.addAll(consumes); + if (inputs != null) result.inputs.addAll(inputs); + if (outputs != null) result.outputs.addAll(outputs); return result; } @@ -664,6 +670,12 @@ class ModuleInfoResponse extends $pb.GeneratedMessage { ..pPS(4, _omitFieldNames ? '' : 'permissions') ..aOS(5, _omitFieldNames ? '' : 'directory') ..pPS(6, _omitFieldNames ? '' : 'acceptsMime') + ..pPM(7, _omitFieldNames ? '' : 'consumes', + subBuilder: ConsumedCapability.create) + ..pPM(8, _omitFieldNames ? '' : 'inputs', + subBuilder: ModuleField.create) + ..pPM(9, _omitFieldNames ? '' : 'outputs', + subBuilder: ModuleField.create) ..hasRequiredFields = false; @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') @@ -727,6 +739,195 @@ class ModuleInfoResponse extends $pb.GeneratedMessage { /// module would reject. @$pb.TagNumber(6) $pb.PbList<$core.String> get acceptsMime => $_getList(5); + + /// Capabilities this module advisorily expects to be available, + /// copied from module.yaml's optional `consumes:` list. Empty + /// means "this is a leaf module with no declared dependencies". + /// Studio surfaces "you'll also want these installed" hints + /// based on this list; the hub does NOT enforce. + @$pb.TagNumber(7) + $pb.PbList get consumes => $_getList(6); + + /// Declared inputs the module's invoke function accepts. The + /// editor uses this to render per-field input ports with their + /// canonical names + types and i18n tooltips. Empty when the + /// manifest declares no inputs (rare; usually means the module + /// is a pure data source). + @$pb.TagNumber(8) + $pb.PbList get inputs => $_getList(7); + + /// Declared outputs the module produces. The editor uses this + /// to render one output port per declared field instead of + /// collapsing every downstream reference into a single anchor. + @$pb.TagNumber(9) + $pb.PbList get outputs => $_getList(8); +} + +class ConsumedCapability extends $pb.GeneratedMessage { + factory ConsumedCapability({ + $core.String? capability, + $core.String? version, + $core.String? why, + }) { + final result = create(); + if (capability != null) result.capability = capability; + if (version != null) result.version = version; + if (why != null) result.why = why; + return result; + } + + ConsumedCapability._(); + + factory ConsumedCapability.fromBuffer($core.List<$core.int> data, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(data, registry); + factory ConsumedCapability.fromJson($core.String json, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(json, registry); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'ConsumedCapability', + package: const $pb.PackageName(_omitMessageNames ? '' : 'fai.v1'), + createEmptyInstance: create) + ..aOS(1, _omitFieldNames ? '' : 'capability') + ..aOS(2, _omitFieldNames ? '' : 'version') + ..aOS(3, _omitFieldNames ? '' : 'why') + ..hasRequiredFields = false; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + ConsumedCapability clone() => deepCopy(); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + ConsumedCapability copyWith(void Function(ConsumedCapability) updates) => + super.copyWith((message) => updates(message as ConsumedCapability)) + as ConsumedCapability; + + @$core.override + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static ConsumedCapability create() => ConsumedCapability._(); + @$core.override + ConsumedCapability createEmptyInstance() => create(); + @$core.pragma('dart2js:noInline') + static ConsumedCapability getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); + static ConsumedCapability? _defaultInstance; + + /// Capability name, e.g. "llm.chat". + @$pb.TagNumber(1) + $core.String get capability => $_getSZ(0); + @$pb.TagNumber(1) + set capability($core.String value) => $_setString(0, value); + @$pb.TagNumber(1) + $core.bool hasCapability() => $_has(0); + @$pb.TagNumber(1) + void clearCapability() => $_clearField(1); + + /// Semver range constraint, e.g. "^0". Empty = any version. + @$pb.TagNumber(2) + $core.String get version => $_getSZ(1); + @$pb.TagNumber(2) + set version($core.String value) => $_setString(1, value); + @$pb.TagNumber(2) + $core.bool hasVersion() => $_has(1); + @$pb.TagNumber(2) + void clearVersion() => $_clearField(2); + + /// Free-form rationale from the manifest's `why:` field. + @$pb.TagNumber(3) + $core.String get why => $_getSZ(2); + @$pb.TagNumber(3) + set why($core.String value) => $_setString(2, value); + @$pb.TagNumber(3) + $core.bool hasWhy() => $_has(2); + @$pb.TagNumber(3) + void clearWhy() => $_clearField(3); +} + +/// One declared input or output field on a module. Carries the +/// type descriptor (text / json / bytes / file) and a locale → +/// description map for tooltips. The map is keyed by IETF locale +/// tag ("en", "de", "ja", …) so callers pick their active +/// locale with a single lookup + "en" fallback. +class ModuleField extends $pb.GeneratedMessage { + factory ModuleField({ + $core.String? name, + $core.String? type, + $core.Iterable<$core.MapEntry<$core.String, $core.String>>? description, + }) { + final result = create(); + if (name != null) result.name = name; + if (type != null) result.type = type; + if (description != null) result.description.addEntries(description); + return result; + } + + ModuleField._(); + + factory ModuleField.fromBuffer($core.List<$core.int> data, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(data, registry); + factory ModuleField.fromJson($core.String json, + [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(json, registry); + + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'ModuleField', + package: const $pb.PackageName(_omitMessageNames ? '' : 'fai.v1'), + createEmptyInstance: create) + ..aOS(1, _omitFieldNames ? '' : 'name') + ..aOS(2, _omitFieldNames ? '' : 'type') + ..m<$core.String, $core.String>(3, _omitFieldNames ? '' : 'description', + entryClassName: 'ModuleField.DescriptionEntry', + keyFieldType: $pb.PbFieldType.OS, + valueFieldType: $pb.PbFieldType.OS, + packageName: const $pb.PackageName('fai.v1')) + ..hasRequiredFields = false; + + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + ModuleField clone() => deepCopy(); + @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.') + ModuleField copyWith(void Function(ModuleField) updates) => + super.copyWith((message) => updates(message as ModuleField)) + as ModuleField; + + @$core.override + $pb.BuilderInfo get info_ => _i; + + @$core.pragma('dart2js:noInline') + static ModuleField create() => ModuleField._(); + @$core.override + ModuleField createEmptyInstance() => create(); + @$core.pragma('dart2js:noInline') + static ModuleField getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); + static ModuleField? _defaultInstance; + + /// Field name, e.g. "prompt" or "model_endpoint". + @$pb.TagNumber(1) + $core.String get name => $_getSZ(0); + @$pb.TagNumber(1) + set name($core.String value) => $_setString(0, value); + @$pb.TagNumber(1) + $core.bool hasName() => $_has(0); + @$pb.TagNumber(1) + void clearName() => $_clearField(1); + + /// Type descriptor: one of text / json / bytes / file. + @$pb.TagNumber(2) + $core.String get type => $_getSZ(1); + @$pb.TagNumber(2) + set type($core.String value) => $_setString(1, value); + @$pb.TagNumber(2) + $core.bool hasType() => $_has(1); + @$pb.TagNumber(2) + void clearType() => $_clearField(2); + + /// Locale → description. Empty map = no description declared + /// (schema_version 1/2 manifests, or v3 manifests that left + /// the field in shorthand form). + @$pb.TagNumber(3) + $pb.PbMap<$core.String, $core.String> get description => $_getMap(2); } class CheckPermissionRequest extends $pb.GeneratedMessage { diff --git a/lib/src/generated/fai/v1/hub.pbjson.dart b/lib/src/generated/fai/v1/hub.pbjson.dart index f04ab35..472e80e 100644 --- a/lib/src/generated/fai/v1/hub.pbjson.dart +++ b/lib/src/generated/fai/v1/hub.pbjson.dart @@ -252,6 +252,30 @@ const ModuleInfoResponse$json = { {'1': 'permissions', '3': 4, '4': 3, '5': 9, '10': 'permissions'}, {'1': 'directory', '3': 5, '4': 1, '5': 9, '10': 'directory'}, {'1': 'accepts_mime', '3': 6, '4': 3, '5': 9, '10': 'acceptsMime'}, + { + '1': 'consumes', + '3': 7, + '4': 3, + '5': 11, + '6': '.fai.v1.ConsumedCapability', + '10': 'consumes' + }, + { + '1': 'inputs', + '3': 8, + '4': 3, + '5': 11, + '6': '.fai.v1.ModuleField', + '10': 'inputs' + }, + { + '1': 'outputs', + '3': 9, + '4': 3, + '5': 11, + '6': '.fai.v1.ModuleField', + '10': 'outputs' + }, ], }; @@ -260,7 +284,60 @@ final $typed_data.Uint8List moduleInfoResponseDescriptor = $convert.base64Decode 'ChJNb2R1bGVJbmZvUmVzcG9uc2USEgoEbmFtZRgBIAEoCVIEbmFtZRIYCgd2ZXJzaW9uGAIgAS' 'gJUgd2ZXJzaW9uEjEKCHByb3ZpZGVzGAMgAygLMhUuZmFpLnYxLkNhcGFiaWxpdHlSZWZSCHBy' 'b3ZpZGVzEiAKC3Blcm1pc3Npb25zGAQgAygJUgtwZXJtaXNzaW9ucxIcCglkaXJlY3RvcnkYBS' - 'ABKAlSCWRpcmVjdG9yeRIhCgxhY2NlcHRzX21pbWUYBiADKAlSC2FjY2VwdHNNaW1l'); + 'ABKAlSCWRpcmVjdG9yeRIhCgxhY2NlcHRzX21pbWUYBiADKAlSC2FjY2VwdHNNaW1lEjYKCGNv' + 'bnN1bWVzGAcgAygLMhouZmFpLnYxLkNvbnN1bWVkQ2FwYWJpbGl0eVIIY29uc3VtZXMSKwoGaW' + '5wdXRzGAggAygLMhMuZmFpLnYxLk1vZHVsZUZpZWxkUgZpbnB1dHMSLQoHb3V0cHV0cxgJIAMo' + 'CzITLmZhaS52MS5Nb2R1bGVGaWVsZFIHb3V0cHV0cw=='); + +@$core.Deprecated('Use consumedCapabilityDescriptor instead') +const ConsumedCapability$json = { + '1': 'ConsumedCapability', + '2': [ + {'1': 'capability', '3': 1, '4': 1, '5': 9, '10': 'capability'}, + {'1': 'version', '3': 2, '4': 1, '5': 9, '10': 'version'}, + {'1': 'why', '3': 3, '4': 1, '5': 9, '10': 'why'}, + ], +}; + +/// Descriptor for `ConsumedCapability`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List consumedCapabilityDescriptor = $convert.base64Decode( + 'ChJDb25zdW1lZENhcGFiaWxpdHkSHgoKY2FwYWJpbGl0eRgBIAEoCVIKY2FwYWJpbGl0eRIYCg' + 'd2ZXJzaW9uGAIgASgJUgd2ZXJzaW9uEhAKA3doeRgDIAEoCVIDd2h5'); + +@$core.Deprecated('Use moduleFieldDescriptor instead') +const ModuleField$json = { + '1': 'ModuleField', + '2': [ + {'1': 'name', '3': 1, '4': 1, '5': 9, '10': 'name'}, + {'1': 'type', '3': 2, '4': 1, '5': 9, '10': 'type'}, + { + '1': 'description', + '3': 3, + '4': 3, + '5': 11, + '6': '.fai.v1.ModuleField.DescriptionEntry', + '10': 'description' + }, + ], + '3': [ModuleField_DescriptionEntry$json], +}; + +@$core.Deprecated('Use moduleFieldDescriptor instead') +const ModuleField_DescriptionEntry$json = { + '1': 'DescriptionEntry', + '2': [ + {'1': 'key', '3': 1, '4': 1, '5': 9, '10': 'key'}, + {'1': 'value', '3': 2, '4': 1, '5': 9, '10': 'value'}, + ], + '7': {'7': true}, +}; + +/// Descriptor for `ModuleField`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List moduleFieldDescriptor = $convert.base64Decode( + 'CgtNb2R1bGVGaWVsZBISCgRuYW1lGAEgASgJUgRuYW1lEhIKBHR5cGUYAiABKAlSBHR5cGUSRg' + 'oLZGVzY3JpcHRpb24YAyADKAsyJC5mYWkudjEuTW9kdWxlRmllbGQuRGVzY3JpcHRpb25FbnRy' + 'eVILZGVzY3JpcHRpb24aPgoQRGVzY3JpcHRpb25FbnRyeRIQCgNrZXkYASABKAlSA2tleRIUCg' + 'V2YWx1ZRgCIAEoCVIFdmFsdWU6AjgB'); @$core.Deprecated('Use checkPermissionRequestDescriptor instead') const CheckPermissionRequest$json = { diff --git a/pubspec.yaml b/pubspec.yaml index 24be5e2..65a926d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: fai_client_sdk description: gRPC client SDK for the F∆I Platform hub. Used by F∆I Studio and Tier-3 domain apps. -version: 0.17.1 +version: 0.18.0 publish_to: 'none' repository: https://git.flemming.ai/fai/client-sdk-dart