diff --git a/sdk/fidl/fuchsia.app.discover/BUILD.gn b/sdk/fidl/fuchsia.app.discover/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..53080293a965f273ae719ef6a54d693364b2abf9 --- /dev/null +++ b/sdk/fidl/fuchsia.app.discover/BUILD.gn @@ -0,0 +1,18 @@ +# Copyright 2019 The Fuchsia Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/fidl/fidl.gni") + +fidl("fuchsia.app.discover") { + sdk_category = "partner" + + sources = [ + "discover_manager.fidl", + "module_output.fidl", + ] + + deps = [ + "//sdk/fidl/fuchsia.app", + ] +} diff --git a/sdk/fidl/fuchsia.app.discover/OWNERS b/sdk/fidl/fuchsia.app.discover/OWNERS new file mode 100644 index 0000000000000000000000000000000000000000..ea3f4ae6efc70688d45b7f978f4d641e390b1e1c --- /dev/null +++ b/sdk/fidl/fuchsia.app.discover/OWNERS @@ -0,0 +1,2 @@ +miguelfrde@google.com +schilit@google.com diff --git a/sdk/fidl/fuchsia.app.discover/README.md b/sdk/fidl/fuchsia.app.discover/README.md new file mode 100644 index 0000000000000000000000000000000000000000..aceff3e69ab5e930a008546a0ec01a8cd7ff1a15 --- /dev/null +++ b/sdk/fidl/fuchsia.app.discover/README.md @@ -0,0 +1,18 @@ +# Discover FIDL API + +Experimental. + +## DiscoverManager + +Sessionmgr routes modules' requests for ModuleOutputWriter to discovermgr via +the DiscoverRegistry protocol. While doing so, it provides the discovermgr with +a unique identifier for the module. + +This interface is meant to be used only by sessionmgr. + +## ModuleOutputWriter + +Provided to modules to write to output parameters. Entities written to these outputs +will be used in suggested action inputs by the discovermgr. + +This interface is meant to be used by modules. diff --git a/sdk/fidl/fuchsia.app.discover/discover_manager.fidl b/sdk/fidl/fuchsia.app.discover/discover_manager.fidl new file mode 100644 index 0000000000000000000000000000000000000000..f3486b95c14c1667796ab840d630ffb6c3a952be --- /dev/null +++ b/sdk/fidl/fuchsia.app.discover/discover_manager.fidl @@ -0,0 +1,24 @@ +// Copyright 2019 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +library fuchsia.app.discover; + +using fuchsia.app; + +/// Interface between sessionmgr and discovermgr to route service connections +/// requests that require module scoping. +[Discoverable] +protocol DiscoverRegistry { + /// Retrieves a module output writer for the module identified by |module|. + RegisterModuleOutputWriter(ModuleIdentifier module, request<ModuleOutputWriter> request); +}; + +table ModuleIdentifier { + /// The ID of the story to which the module belongs. + 1: fuchsia.app.StoryId story_id; + + /// The named path leading up to this module instance. This path is a unique + /// identifier of the module in the story. + 2: vector<string> module_path; +}; diff --git a/sdk/fidl/fuchsia.app.discover/module_output.fidl b/sdk/fidl/fuchsia.app.discover/module_output.fidl new file mode 100644 index 0000000000000000000000000000000000000000..4db150450e56966ff5c7ebbd20ec02981cfc66c3 --- /dev/null +++ b/sdk/fidl/fuchsia.app.discover/module_output.fidl @@ -0,0 +1,27 @@ +// Copyright 2019 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +library fuchsia.app.discover; + +[Discoverable] +protocol ModuleOutputWriter { + /// Writes the |entity_reference| to the module's |output_parameter_name| + /// output. If no entity is provided, the output will be unset. + /// Return happens upon completion of a successful write. + Write(string output_name, string? entity_reference) -> () error OutputError; +}; + +/// Errors that can occur when writing to an output. +enum OutputError : int32 { + /// If the output doesn't match a parameter defined in the module manifest + /// for the action currently being handled by the module. + UNKNOWN_NAME = 1; + + /// If the entity reference couldn't be resolved. + UNKNOWN_ENTITY_REFERENCE = 2; + + /// If the entity type written doesn't match the type defined in the module + /// manifest for the action currently being handled by the module.. + INVALID_ENTITY_TYPE = 3; +};