diff --git a/arduino/libraries/libraries.go b/arduino/libraries/libraries.go index 7347a18ace5..6c939eec70f 100644 --- a/arduino/libraries/libraries.go +++ b/arduino/libraries/libraries.go @@ -70,6 +70,7 @@ type Library struct { Version *semver.Version License string Properties *properties.Map + Examples paths.PathList } func (library *Library) String() string { @@ -137,3 +138,18 @@ func (library *Library) SourceDirs() []SourceDir { } return dirs } + +// LocationPriorityFor returns a number representing the location priority for the given library +// using the given platform and referenced-platform. Higher value means higher priority. +func (library *Library) LocationPriorityFor(platformRelease, refPlatformRelease *cores.PlatformRelease) int { + if library.Location == IDEBuiltIn { + return 1 + } else if library.ContainerPlatform == refPlatformRelease { + return 2 + } else if library.ContainerPlatform == platformRelease { + return 3 + } else if library.Location == User { + return 4 + } + return 0 +} diff --git a/arduino/libraries/libraries_location.go b/arduino/libraries/libraries_location.go index 5761652197f..a3e22cfb3f3 100644 --- a/arduino/libraries/libraries_location.go +++ b/arduino/libraries/libraries_location.go @@ -28,7 +28,7 @@ type LibraryLocation int // The enumeration is listed in ascending order of priority const ( // IDEBuiltIn are libraries bundled in the IDE - IDEBuiltIn = iota + IDEBuiltIn LibraryLocation = iota // PlatformBuiltIn are libraries bundled in a PlatformRelease PlatformBuiltIn // ReferencedPlatformBuiltIn are libraries bundled in a PlatformRelease referenced for build diff --git a/arduino/libraries/loader.go b/arduino/libraries/loader.go index f2042399b61..3c30fd1708c 100644 --- a/arduino/libraries/loader.go +++ b/arduino/libraries/loader.go @@ -21,6 +21,7 @@ import ( "github.com/arduino/go-paths-helper" properties "github.com/arduino/go-properties-orderedmap" + "github.com/pkg/errors" semver "go.bug.st/relaxed-semver" ) @@ -94,6 +95,9 @@ func makeNewLibrary(libraryDir *paths.Path, location LibraryLocation) (*Library, library.Version = v } + if err := addExamples(library); err != nil { + return nil, errors.Errorf("scanning examples: %s", err) + } library.Name = libraryDir.Base() library.RealName = strings.TrimSpace(libProperties.Get("name")) library.Author = strings.TrimSpace(libProperties.Get("author")) @@ -122,6 +126,56 @@ func makeLegacyLibrary(path *paths.Path, location LibraryLocation) (*Library, er IsLegacy: true, Version: semver.MustParse(""), } + if err := addExamples(library); err != nil { + return nil, errors.Errorf("scanning examples: %s", err) + } addUtilityDirectory(library) return library, nil } + +func addExamples(lib *Library) error { + files, err := lib.InstallDir.ReadDir() + if err != nil { + return err + } + examples := paths.NewPathList() + for _, file := range files { + name := strings.ToLower(file.Base()) + if name != "example" && name != "examples" { + continue + } + if !file.IsDir() { + continue + } + if err := addExamplesToPathList(file, &examples); err != nil { + return err + } + break + } + + lib.Examples = examples + return nil +} + +func addExamplesToPathList(examplesPath *paths.Path, list *paths.PathList) error { + files, err := examplesPath.ReadDir() + if err != nil { + return err + } + for _, file := range files { + if isExample(file) { + list.Add(file) + } else if file.IsDir() { + if err := addExamplesToPathList(file, list); err != nil { + return err + } + } + } + return nil +} + +// isExample returns true if examplePath contains an example +func isExample(examplePath *paths.Path) bool { + mainIno := examplePath.Join(examplePath.Base() + ".ino") + return mainIno.Exist() && mainIno.IsNotDir() +} diff --git a/cli/lib/examples.go b/cli/lib/examples.go new file mode 100644 index 00000000000..60bd2f2047c --- /dev/null +++ b/cli/lib/examples.go @@ -0,0 +1,132 @@ +// This file is part of arduino-cli. +// +// Copyright 2020 ARDUINO SA (http://www.arduino.cc/) +// +// This software is released under the GNU General Public License version 3, +// which covers the main part of arduino-cli. +// The terms of this license can be found at: +// https://www.gnu.org/licenses/gpl-3.0.en.html +// +// You can be released from the requirements of the above licenses by purchasing +// a commercial license. Buying such a license is mandatory if you want to +// modify or otherwise use the software for commercial activities involving the +// Arduino software without disclosing the source code of your own applications. +// To purchase a commercial license, send an email to license@arduino.cc. + +package lib + +import ( + "fmt" + "os" + "sort" + "strings" + + "github.com/arduino/arduino-cli/cli/errorcodes" + "github.com/arduino/arduino-cli/cli/feedback" + "github.com/arduino/arduino-cli/cli/instance" + "github.com/arduino/arduino-cli/commands/lib" + rpc "github.com/arduino/arduino-cli/rpc/commands" + "github.com/arduino/go-paths-helper" + "github.com/fatih/color" + "github.com/sirupsen/logrus" + "github.com/spf13/cobra" + "golang.org/x/net/context" +) + +func initExamplesCommand() *cobra.Command { + examplesCommand := &cobra.Command{ + Use: "examples [LIBRARY_NAME]", + Short: "Shows the list of the examples for libraries.", + Long: "Shows the list of the examples for libraries. A name may be given as argument to search a specific library.", + Example: " " + os.Args[0] + " lib examples Wire", + Args: cobra.MaximumNArgs(1), + Run: runExamplesCommand, + } + examplesCommand.Flags().StringVarP(&examplesFlags.fqbn, "fqbn", "b", "", "Show libraries for the specified board FQBN.") + return examplesCommand +} + +var examplesFlags struct { + fqbn string +} + +func runExamplesCommand(cmd *cobra.Command, args []string) { + instance := instance.CreateInstanceIgnorePlatformIndexErrors() + logrus.Info("Show examples for library") + + name := "" + if len(args) > 0 { + name = args[0] + } + + res, err := lib.LibraryList(context.Background(), &rpc.LibraryListReq{ + Instance: instance, + All: true, + Name: name, + Fqbn: examplesFlags.fqbn, + }) + if err != nil { + feedback.Errorf("Error getting libraries info: %v", err) + os.Exit(errorcodes.ErrGeneric) + } + + found := []*libraryExamples{} + for _, lib := range res.GetInstalledLibrary() { + found = append(found, &libraryExamples{ + Library: lib.Library, + Examples: lib.Library.Examples, + }) + } + + feedback.PrintResult(libraryExamplesResult{found}) + logrus.Info("Done") +} + +// output from this command requires special formatting, let's create a dedicated +// feedback.Result implementation + +type libraryExamples struct { + Library *rpc.Library `json:"library"` + Examples []string `json:"examples"` +} + +type libraryExamplesResult struct { + Examples []*libraryExamples +} + +func (ir libraryExamplesResult) Data() interface{} { + return ir.Examples +} + +func (ir libraryExamplesResult) String() string { + if ir.Examples == nil || len(ir.Examples) == 0 { + return "No libraries found." + } + + sort.Slice(ir.Examples, func(i, j int) bool { + return strings.ToLower(ir.Examples[i].Library.Name) < strings.ToLower(ir.Examples[j].Library.Name) + }) + + res := []string{} + for _, lib := range ir.Examples { + name := lib.Library.Name + if lib.Library.ContainerPlatform != "" { + name += " (" + lib.Library.GetContainerPlatform() + ")" + } else if lib.Library.Location != rpc.LibraryLocation_user { + name += " (" + lib.Library.GetLocation().String() + ")" + } + r := fmt.Sprintf("Examples for library %s\n", color.GreenString("%s", name)) + sort.Slice(lib.Examples, func(i, j int) bool { + return strings.ToLower(lib.Examples[i]) < strings.ToLower(lib.Examples[j]) + }) + for _, example := range lib.Examples { + examplePath := paths.New(example) + r += fmt.Sprintf(" - %s%s\n", + color.New(color.Faint).Sprintf("%s%c", examplePath.Parent(), os.PathSeparator), + examplePath.Base()) + } + res = append(res, r) + } + + return strings.Join(res, "\n") +} diff --git a/cli/lib/lib.go b/cli/lib/lib.go index 8037ae53cdc..149e2a24837 100644 --- a/cli/lib/lib.go +++ b/cli/lib/lib.go @@ -35,6 +35,7 @@ func NewCommand() *cobra.Command { libCommand.AddCommand(initDownloadCommand()) libCommand.AddCommand(initInstallCommand()) libCommand.AddCommand(initListCommand()) + libCommand.AddCommand(initExamplesCommand()) libCommand.AddCommand(initSearchCommand()) libCommand.AddCommand(initUninstallCommand()) libCommand.AddCommand(initUpgradeCommand()) diff --git a/cli/lib/list.go b/cli/lib/list.go index 01426734827..d0d33246a3c 100644 --- a/cli/lib/list.go +++ b/cli/lib/list.go @@ -17,6 +17,8 @@ package lib import ( "os" + "sort" + "strings" "github.com/arduino/arduino-cli/cli/errorcodes" "github.com/arduino/arduino-cli/cli/feedback" @@ -31,14 +33,18 @@ import ( func initListCommand() *cobra.Command { listCommand := &cobra.Command{ - Use: "list", - Short: "Shows a list of all installed libraries.", - Long: "Shows a list of all installed libraries.", + Use: "list [LIBNAME]", + Short: "Shows a list of installed libraries.", + Long: "Shows a list of installed libraries.\n\n" + + "If the LIBNAME parameter is specified the listing is limited to that specific\n" + + "library. By default the libraries provided as built-in by platforms/core are\n" + + "not listed, they can be listed by adding the --all flag.", Example: " " + os.Args[0] + " lib list", - Args: cobra.NoArgs, + Args: cobra.MaximumNArgs(1), Run: runListCommand, } listCommand.Flags().BoolVar(&listFlags.all, "all", false, "Include built-in libraries (from platforms and IDE) in listing.") + listCommand.Flags().StringVarP(&listFlags.fqbn, "fqbn", "b", "", "Show libraries for the specified board FQBN.") listCommand.Flags().BoolVar(&listFlags.updatable, "updatable", false, "List updatable libraries.") return listCommand } @@ -46,16 +52,24 @@ func initListCommand() *cobra.Command { var listFlags struct { all bool updatable bool + fqbn string } func runListCommand(cmd *cobra.Command, args []string) { instance := instance.CreateInstanceIgnorePlatformIndexErrors() logrus.Info("Listing") + name := "" + if len(args) > 0 { + name = args[0] + } + res, err := lib.LibraryList(context.Background(), &rpc.LibraryListReq{ Instance: instance, All: listFlags.all, Updatable: listFlags.updatable, + Name: name, + Fqbn: listFlags.fqbn, }) if err != nil { feedback.Errorf("Error listing Libraries: %v", err) @@ -88,6 +102,10 @@ func (ir installedResult) String() string { if ir.installedLibs == nil || len(ir.installedLibs) == 0 { return "No libraries installed." } + sort.Slice(ir.installedLibs, func(i, j int) bool { + return strings.ToLower(ir.installedLibs[i].Library.Name) < strings.ToLower(ir.installedLibs[j].Library.Name) || + strings.ToLower(ir.installedLibs[i].Library.ContainerPlatform) < strings.ToLower(ir.installedLibs[j].Library.ContainerPlatform) + }) t := table.New() t.SetHeader("Name", "Installed", "Available", "Location", "Description") diff --git a/commands/lib/list.go b/commands/lib/list.go index 5839e0f5424..48dad1fc609 100644 --- a/commands/lib/list.go +++ b/commands/lib/list.go @@ -17,7 +17,11 @@ package lib import ( "context" + "errors" + "fmt" + "strings" + "github.com/arduino/arduino-cli/arduino/cores" "github.com/arduino/arduino-cli/arduino/libraries" "github.com/arduino/arduino-cli/arduino/libraries/librariesindex" "github.com/arduino/arduino-cli/arduino/libraries/librariesmanager" @@ -32,12 +36,57 @@ type installedLib struct { // LibraryList FIXMEDOC func LibraryList(ctx context.Context, req *rpc.LibraryListReq) (*rpc.LibraryListResp, error) { + pm := commands.GetPackageManager(req.GetInstance().GetId()) + if pm == nil { + return nil, errors.New("invalid instance") + } + lm := commands.GetLibraryManager(req.GetInstance().GetId()) + if lm == nil { + return nil, errors.New("invalid instance") + } + + nameFilter := strings.ToLower(req.GetName()) instaledLib := []*rpc.InstalledLibrary{} res := listLibraries(lm, req.GetUpdatable(), req.GetAll()) if len(res) > 0 { + if f := req.GetFqbn(); f != "" { + fqbn, err := cores.ParseFQBN(req.GetFqbn()) + if err != nil { + return nil, fmt.Errorf("parsing fqbn: %s", err) + } + _, boardPlatform, _, _, refBoardPlatform, err := pm.ResolveFQBN(fqbn) + if err != nil { + return nil, fmt.Errorf("loading board data: %s", err) + } + + filteredRes := map[string]*installedLib{} + for _, lib := range res { + if cp := lib.Library.ContainerPlatform; cp != nil { + if cp != boardPlatform && cp != refBoardPlatform { + // Filter all libraries from extraneous platforms + continue + } + } + if latest, has := filteredRes[lib.Library.Name]; has { + if latest.Library.LocationPriorityFor(boardPlatform, refBoardPlatform) >= lib.Library.LocationPriorityFor(boardPlatform, refBoardPlatform) { + continue + } + } + filteredRes[lib.Library.Name] = lib + } + + res = []*installedLib{} + for _, lib := range filteredRes { + res = append(res, lib) + } + } + for _, lib := range res { + if nameFilter != "" && strings.ToLower(lib.Library.Name) != nameFilter { + continue + } libtmp := GetOutputLibrary(lib.Library) release := GetOutputRelease(lib.Available) instaledLib = append(instaledLib, &rpc.InstalledLibrary{ @@ -117,6 +166,7 @@ func GetOutputLibrary(lib *libraries.Library) *rpc.Library { IsLegacy: lib.IsLegacy, Version: lib.Version.String(), License: lib.License, + Examples: lib.Examples.AsStrings(), } } diff --git a/rpc/commands/lib.pb.go b/rpc/commands/lib.pb.go index dc6b906b294..f147239b5bb 100644 --- a/rpc/commands/lib.pb.go +++ b/rpc/commands/lib.pb.go @@ -1326,6 +1326,11 @@ type LibraryListReq struct { // Whether to list only libraries for which there is a newer version than // the installed version available in the libraries index. Updatable bool `protobuf:"varint,3,opt,name=updatable,proto3" json:"updatable,omitempty"` + // If set filters out the libraries not matching name + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + // By setting this field all duplicate libraries are filtered out leaving + // only the libraries that will be used to compile for the specified board FQBN. + Fqbn string `protobuf:"bytes,5,opt,name=fqbn,proto3" json:"fqbn,omitempty"` } func (x *LibraryListReq) Reset() { @@ -1381,6 +1386,20 @@ func (x *LibraryListReq) GetUpdatable() bool { return false } +func (x *LibraryListReq) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *LibraryListReq) GetFqbn() string { + if x != nil { + return x.Fqbn + } + return "" +} + type LibraryListResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1543,6 +1562,8 @@ type Library struct { Location LibraryLocation `protobuf:"varint,24,opt,name=location,proto3,enum=cc.arduino.cli.commands.LibraryLocation" json:"location,omitempty"` // The library format type. Layout LibraryLayout `protobuf:"varint,25,opt,name=layout,proto3,enum=cc.arduino.cli.commands.LibraryLayout" json:"layout,omitempty"` + // The example sketches provided by the library + Examples []string `protobuf:"bytes,26,rep,name=examples,proto3" json:"examples,omitempty"` } func (x *Library) Reset() { @@ -1738,6 +1759,13 @@ func (x *Library) GetLayout() LibraryLayout { return LibraryLayout_flat_layout } +func (x *Library) GetExamples() []string { + if x != nil { + return x.Examples + } + return nil +} + var File_commands_lib_proto protoreflect.FileDescriptor var file_commands_lib_proto_rawDesc = []byte{ @@ -1915,103 +1943,107 @@ var file_commands_lib_proto_rawDesc = []byte{ 0x73, 0x75, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x61, 0x63, 0x68, 0x65, 0x70, 0x61, 0x74, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x61, 0x63, 0x68, - 0x65, 0x70, 0x61, 0x74, 0x68, 0x22, 0x7f, 0x0a, 0x0e, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, - 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x3d, 0x0a, 0x08, 0x69, 0x6e, 0x73, 0x74, 0x61, - 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x63, 0x2e, 0x61, - 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, - 0x6e, 0x64, 0x73, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x69, 0x6e, - 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x6c, 0x6c, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x03, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x75, 0x70, 0x64, 0x61, - 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x22, 0x69, 0x0a, 0x0f, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, - 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x56, 0x0a, 0x11, 0x69, 0x6e, 0x73, - 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x5f, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, - 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x49, - 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x52, - 0x10, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, - 0x79, 0x22, 0x91, 0x01, 0x0a, 0x10, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x4c, - 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x12, 0x3a, 0x0a, 0x07, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, - 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, - 0x73, 0x2e, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x52, 0x07, 0x6c, 0x69, 0x62, 0x72, 0x61, - 0x72, 0x79, 0x12, 0x41, 0x0a, 0x07, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, - 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x4c, 0x69, - 0x62, 0x72, 0x61, 0x72, 0x79, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x07, 0x72, 0x65, - 0x6c, 0x65, 0x61, 0x73, 0x65, 0x22, 0xf7, 0x06, 0x0a, 0x07, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, - 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x12, 0x1e, 0x0a, - 0x0a, 0x6d, 0x61, 0x69, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0a, 0x6d, 0x61, 0x69, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x1a, 0x0a, - 0x08, 0x73, 0x65, 0x6e, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x73, 0x65, 0x6e, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x61, 0x72, - 0x61, 0x67, 0x72, 0x61, 0x70, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, - 0x72, 0x61, 0x67, 0x72, 0x61, 0x70, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x73, 0x69, - 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, - 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x24, 0x0a, - 0x0d, 0x61, 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x08, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x61, 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, - 0x72, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x09, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x73, - 0x74, 0x61, 0x6c, 0x6c, 0x5f, 0x64, 0x69, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, - 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x44, 0x69, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x5f, 0x64, 0x69, 0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x69, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x75, 0x74, 0x69, - 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x64, 0x69, 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, - 0x75, 0x74, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x44, 0x69, 0x72, 0x12, 0x2d, 0x0a, 0x12, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, - 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x61, - 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, - 0x61, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x22, 0x0a, 0x0d, 0x64, 0x6f, 0x74, 0x5f, 0x61, 0x5f, - 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x64, - 0x6f, 0x74, 0x41, 0x4c, 0x69, 0x6e, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x72, - 0x65, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x18, 0x12, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x0b, 0x70, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x19, 0x0a, 0x08, - 0x6c, 0x64, 0x5f, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x18, 0x13, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x6c, 0x64, 0x46, 0x6c, 0x61, 0x67, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x73, 0x5f, 0x6c, 0x65, - 0x67, 0x61, 0x63, 0x79, 0x18, 0x14, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x4c, 0x65, - 0x67, 0x61, 0x63, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, - 0x15, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x18, - 0x0a, 0x07, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x18, 0x16, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x70, - 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, 0x17, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x63, - 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, - 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x2e, 0x50, - 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, - 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x12, 0x44, 0x0a, 0x08, 0x6c, 0x6f, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x18, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x28, 0x2e, 0x63, - 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, - 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x4c, 0x6f, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x3e, 0x0a, 0x06, 0x6c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x18, 0x19, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x26, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, + 0x65, 0x70, 0x61, 0x74, 0x68, 0x22, 0xa7, 0x01, 0x0a, 0x0e, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, + 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x3d, 0x0a, 0x08, 0x69, 0x6e, 0x73, 0x74, + 0x61, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x63, 0x2e, + 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, + 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x69, + 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x6c, 0x6c, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x75, 0x70, 0x64, + 0x61, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x66, + 0x71, 0x62, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x71, 0x62, 0x6e, 0x22, + 0x69, 0x0a, 0x0f, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x56, 0x0a, 0x11, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x5f, + 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, + 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, + 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, + 0x64, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x52, 0x10, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, + 0x6c, 0x65, 0x64, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x22, 0x91, 0x01, 0x0a, 0x10, 0x49, + 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x12, + 0x3a, 0x0a, 0x07, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x20, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x62, 0x72, 0x61, - 0x72, 0x79, 0x4c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x52, 0x06, 0x6c, 0x61, 0x79, 0x6f, 0x75, 0x74, - 0x1a, 0x3d, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x2a, - 0x2e, 0x0a, 0x13, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0a, 0x0a, 0x06, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, - 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x10, 0x01, 0x2a, - 0x36, 0x0a, 0x0d, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x4c, 0x61, 0x79, 0x6f, 0x75, 0x74, - 0x12, 0x0f, 0x0a, 0x0b, 0x66, 0x6c, 0x61, 0x74, 0x5f, 0x6c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x10, - 0x00, 0x12, 0x14, 0x0a, 0x10, 0x72, 0x65, 0x63, 0x75, 0x72, 0x73, 0x69, 0x76, 0x65, 0x5f, 0x6c, - 0x61, 0x79, 0x6f, 0x75, 0x74, 0x10, 0x01, 0x2a, 0x63, 0x0a, 0x0f, 0x4c, 0x69, 0x62, 0x72, 0x61, - 0x72, 0x79, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0f, 0x0a, 0x0b, 0x69, 0x64, - 0x65, 0x5f, 0x62, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x75, - 0x73, 0x65, 0x72, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, - 0x6d, 0x5f, 0x62, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x10, 0x02, 0x12, 0x1f, 0x0a, 0x1b, 0x72, - 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x64, 0x5f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, - 0x72, 0x6d, 0x5f, 0x62, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x10, 0x03, 0x42, 0x2d, 0x5a, 0x2b, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x72, 0x64, 0x75, 0x69, - 0x6e, 0x6f, 0x2f, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2d, 0x63, 0x6c, 0x69, 0x2f, 0x72, - 0x70, 0x63, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x72, 0x79, 0x52, 0x07, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x12, 0x41, 0x0a, 0x07, 0x72, + 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, + 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, + 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x52, 0x65, + 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x07, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x22, 0x93, + 0x07, 0x0a, 0x07, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, + 0x0a, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x6d, 0x61, 0x69, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x61, 0x69, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x6e, 0x74, 0x65, 0x6e, + 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x6e, 0x74, 0x65, 0x6e, + 0x63, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x61, 0x72, 0x61, 0x67, 0x72, 0x61, 0x70, 0x68, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x72, 0x61, 0x67, 0x72, 0x61, 0x70, 0x68, + 0x12, 0x18, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x61, + 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x61, + 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x24, 0x0a, 0x0d, 0x61, 0x72, 0x63, 0x68, 0x69, 0x74, + 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x61, + 0x72, 0x63, 0x68, 0x69, 0x74, 0x65, 0x63, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x5f, 0x64, 0x69, + 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, + 0x44, 0x69, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x64, 0x69, + 0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, + 0x69, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x75, 0x74, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x64, 0x69, + 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x75, 0x74, 0x69, 0x6c, 0x69, 0x74, 0x79, + 0x44, 0x69, 0x72, 0x12, 0x2d, 0x0a, 0x12, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x5f, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x11, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, + 0x72, 0x6d, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x10, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x61, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x22, 0x0a, 0x0d, 0x64, 0x6f, 0x74, 0x5f, 0x61, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x61, 0x67, 0x65, + 0x18, 0x11, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x64, 0x6f, 0x74, 0x41, 0x4c, 0x69, 0x6e, 0x6b, + 0x61, 0x67, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, + 0x65, 0x64, 0x18, 0x12, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x70, 0x72, 0x65, 0x63, 0x6f, 0x6d, + 0x70, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x6c, 0x64, 0x5f, 0x66, 0x6c, 0x61, 0x67, + 0x73, 0x18, 0x13, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6c, 0x64, 0x46, 0x6c, 0x61, 0x67, 0x73, + 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x73, 0x5f, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x18, 0x14, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x12, 0x18, 0x0a, + 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x15, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x6c, 0x69, 0x63, 0x65, 0x6e, + 0x73, 0x65, 0x18, 0x16, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, + 0x65, 0x12, 0x50, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x18, + 0x17, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, + 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, + 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, + 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, + 0x69, 0x65, 0x73, 0x12, 0x44, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x18, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x28, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, + 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, + 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, 0x06, 0x6c, 0x61, 0x79, + 0x6f, 0x75, 0x74, 0x18, 0x19, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, 0x2e, 0x63, 0x63, 0x2e, 0x61, + 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, + 0x6e, 0x64, 0x73, 0x2e, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x4c, 0x61, 0x79, 0x6f, 0x75, + 0x74, 0x52, 0x06, 0x6c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x78, 0x61, + 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x18, 0x1a, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x65, 0x78, 0x61, + 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x1a, 0x3d, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, + 0x69, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x02, 0x38, 0x01, 0x2a, 0x2e, 0x0a, 0x13, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x53, + 0x65, 0x61, 0x72, 0x63, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0a, 0x0a, 0x06, 0x66, + 0x61, 0x69, 0x6c, 0x65, 0x64, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x10, 0x01, 0x2a, 0x36, 0x0a, 0x0d, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x4c, + 0x61, 0x79, 0x6f, 0x75, 0x74, 0x12, 0x0f, 0x0a, 0x0b, 0x66, 0x6c, 0x61, 0x74, 0x5f, 0x6c, 0x61, + 0x79, 0x6f, 0x75, 0x74, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x72, 0x65, 0x63, 0x75, 0x72, 0x73, + 0x69, 0x76, 0x65, 0x5f, 0x6c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x10, 0x01, 0x2a, 0x63, 0x0a, 0x0f, + 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x0f, 0x0a, 0x0b, 0x69, 0x64, 0x65, 0x5f, 0x62, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x10, 0x00, + 0x12, 0x08, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x70, 0x6c, + 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x5f, 0x62, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x10, 0x02, + 0x12, 0x1f, 0x0a, 0x1b, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x64, 0x5f, 0x70, + 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x5f, 0x62, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x10, + 0x03, 0x42, 0x2d, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2d, + 0x63, 0x6c, 0x69, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/rpc/commands/lib.proto b/rpc/commands/lib.proto index 8601a73184b..6779d36b7fe 100644 --- a/rpc/commands/lib.proto +++ b/rpc/commands/lib.proto @@ -193,7 +193,12 @@ message LibraryListReq { bool all = 2; // Whether to list only libraries for which there is a newer version than // the installed version available in the libraries index. - bool updatable = 3; + bool updatable = 3; + // If set filters out the libraries not matching name + string name = 4; + // By setting this field all duplicate libraries are filtered out leaving + // only the libraries that will be used to compile for the specified board FQBN. + string fqbn = 5; } message LibraryListResp { @@ -261,6 +266,8 @@ message Library { LibraryLocation location = 24; // The library format type. LibraryLayout layout = 25; + // The example sketches provided by the library + repeated string examples = 26; } enum LibraryLayout {