blob: 89d45918d93936a72466593165a6fa35e33ffd25 [file] [log] [blame] [edit]
// Copyright 2022 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.dash;
using zx;
using fuchsia.hardware.pty;
using fuchsia.url;
/// Standard errors for the Launcher protocol
type LauncherError = strict enum {
/// Launcher encountered an unspecified error
INTERNAL = 1;
/// Moniker could not be parsed by launcher
BAD_MONIKER = 2;
/// No instance was found matching the moniker
INSTANCE_NOT_FOUND = 3;
/// Error occurred using fuchsia.sys2.RealmQuery
REALM_QUERY = 4;
/// Error occurred using fuchsia.process.Launcher
PROCESS_LAUNCHER = 5;
/// Error loading dash binary
DASH_BINARY = 6;
/// Error occurred involving the PTY
PTY = 7;
/// Instance is not in a resolved state, so there is nothing to explore
INSTANCE_NOT_RESOLVED = 8;
/// Error occurred using fuchsia.pkg.PackageResolver
PACKAGE_RESOLVER = 9;
/// Error resolving tools package
TOOLS_CANNOT_RESOLVE = 10;
};
@discoverable
protocol Launcher {
/// Launch a dash process scoped to the given moniker, forwarding the given stdio PTY.
LaunchWithPty(resource struct {
/// The moniker of the component that dash should be scoped to
moniker string:MAX;
/// The PTY device that should be forwarded to the dash process
pty client_end:fuchsia.hardware.pty.Device;
/// A package URL whose directory will also be loaded into the dash namespace
tools_url fuchsia.url.Url:optional;
/// A optional inline command to run
command string:<MAX, optional>;
}) -> (struct {}) error LauncherError;
/// Launch a dash process scoped to the given moniker, forwarding the given stdio socket.
///
/// The dash launcher will implicitly create a PTY and transfer bytes between the PTY and
/// the socket.
LaunchWithSocket(resource struct {
/// The moniker of the component that dash should be scoped to
moniker string:MAX;
/// The raw socket to connect to the dash process
socket zx.handle:SOCKET;
/// A package URL whose directory will also be loaded into the dash namespace
tools_url fuchsia.url.Url:optional;
/// A optional inline command to run
command string:<MAX, optional>;
}) -> (struct {}) error LauncherError;
};