| // 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.modular.session; |
| |
| using fuchsia.io; |
| using fuchsia.sys; |
| |
| /// Descriptions and defaults for these configurations are echoed in |
| /// [modular config guide](https://fuchsia.dev/fuchsia-src/concepts/modular/guide/config). |
| type BasemgrConfig = table { |
| /// When set to false, Cobalt statistics are disabled. |
| /// Default: true |
| 1: enable_cobalt bool; |
| |
| 2: reserved; |
| |
| /// Create story shells through StoryShellFactory exposed by the session |
| /// shell instead of creating separate story shell components. When set, |
| /// `story_shell_url` and any story shell args are ignored. |
| /// Default: false |
| 3: use_session_shell_for_story_shell_factory bool; |
| |
| 4: reserved; |
| |
| /// A map of launch configurations specific to session shells. |
| 5: session_shell_map vector<SessionShellMapEntry>; |
| |
| /// Launch configurations specific to story shell. |
| 6: story_shell StoryShellConfig; |
| |
| 7: reserved; |
| |
| /// Launch configuration for a session launcher component. |
| /// |
| /// If specified, this component is started instead of sessionmgr, |
| /// and all other configuration fields are ignored, except `enable_cobalt`. |
| /// |
| /// The session launcher component can then use the `Launcher` protocol |
| /// to launch sessionmgr with a particular configuration. |
| 8: session_launcher AppConfig; |
| |
| /// When set to true, basemgr will not use graphics. |
| /// Default: false |
| 9: headless bool; |
| }; |
| |
| type SessionShellMapEntry = table { |
| /// The name of the session shell represented by its url. |
| 1: name fuchsia.io.Path; |
| |
| /// The launch configurations for the session shell. |
| 2: config SessionShellConfig; |
| }; |
| |
| type SessionShellConfig = table { |
| /// Contains the fuchsia package url and arguments to pass to the shell. |
| 1: app_config AppConfig; |
| |
| 2: reserved; |
| |
| 3: reserved; |
| |
| 4: reserved; |
| }; |
| |
| type StoryShellConfig = table { |
| /// Contains the fuchsia package url and arguments to pass to the shell. |
| 1: app_config AppConfig; |
| }; |
| |
| type SessionmgrConfig = table { |
| 1: reserved; |
| |
| /// When set to false, Cobalt statistics are disabled. This is used for |
| /// testing. |
| /// Default: true |
| 2: enable_cobalt bool; |
| |
| 3: reserved bool; |
| |
| 4: reserved; |
| |
| /// A list of fuchsia package urls that specify which agents to launch at |
| /// startup. |
| 5: startup_agents vector<fuchsia.io.Path>; |
| |
| /// A list of fuchsia package urls that specify which agents to launch at |
| /// startup with PuppetMaster and FocusProvider services. |
| 6: session_agents vector<fuchsia.io.Path>; |
| |
| /// The fuchsia package url for which story shell to use. |
| 7: story_shell_url fuchsia.io.Path; |
| |
| /// A map of agents to the arguments they should be started with. |
| 8: component_args vector<AppConfig>; |
| |
| 9: reserved; |
| |
| /// A list of services mapped to the component URL that serves it. |
| /// Valid components to specify here are agents or the session shell. |
| /// Services listed here are available in the incoming namespaces for |
| /// modules, shells, and agents. |
| 10: agent_service_index vector<AgentServiceIndexEntry>; |
| |
| /// A list of `fuchsia.modular.Agent` services, as provided to sessionmgr |
| /// in `additional_services_for_agents`, mapped to a v1 agent URL. |
| /// |
| /// Modules, the session shell, and other agents, can connect to services |
| /// exposed by v2 agents via |
| /// `fuchsia.modular/ComponentContext.DeprecatedConnectToAgent` |
| /// and `fuchsia.modular/ComponentContext.DeprecatedConnectToAgentService`, |
| /// or from the namespace if the service is present in `agent_service_index`. |
| /// |
| /// The agent URL and service name must be present in `agent_service_index` |
| /// to connect to services with `DeprecatedConnectToAgentService` or |
| /// from an agent namespace. |
| @available(added=9) |
| 13: v2_modular_agents vector<V2ModularAgentsEntry>; |
| |
| /// A list of agent URLs that will cause the session to be restarted |
| /// when they terminate. If an agent is not in this list, sessionmgr will |
| /// restart it individually, preserving the session. |
| /// |
| /// The session shell is automatically added to this list. |
| 11: restart_session_on_agent_crash vector<fuchsia.io.Path>:MAX; |
| |
| /// If set to true, disables any automatic agent restarts when an agent is |
| /// observed to have crashed. |
| 12: disable_agent_restart_on_crash bool; |
| |
| /// If set to true, module views are presented to the session shell as |
| /// story shell views through GraphicalPresenter protocol, if available. |
| @available(added=9) |
| 14: present_mods_as_stories bool; |
| }; |
| |
| /// Used to pass around configuration references to apps such as base shell, |
| /// session shell, story shell, and agents. |
| type AppConfig = table { |
| /// The fuchsia package url for app. |
| 1: url fuchsia.io.Path; |
| |
| /// The arguments for the app. |
| 2: args vector<string>; |
| }; |
| |
| /// A service and the URL of the agent known to provide that service. |
| type AgentServiceIndexEntry = table { |
| /// The service name. |
| 1: service_name string; |
| |
| /// The fuchsia component url for agent. |
| 2: agent_url fuchsia.sys.component_url; |
| |
| /// [Optional] The name of the service as published by the Agent. |
| /// This allows a service published by an Agent to be made available under |
| /// a different name (e.g. for disambiguation from other implementations |
| /// of the same service) in the agent-services index. |
| @available(added=9) |
| 3: expose_from string; |
| }; |
| |
| /// A service name for the `fuchsia.modular.Agent` protocol served by a v2 component |
| /// and the v1 agent URL that identifies the v2 agent inside Modular. |
| @available(added=9) |
| type V2ModularAgentsEntry = table { |
| /// The service name. |
| 1: service_name string; |
| |
| /// The fuchsia component url for agent. |
| 2: agent_url fuchsia.sys.component_url; |
| }; |
| |
| /// Contains the configurations for the modular framework components. |
| type ModularConfig = table { |
| 1: basemgr_config BasemgrConfig; |
| |
| 2: sessionmgr_config SessionmgrConfig; |
| }; |