Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Tools to let coding agents access the shell with opinionated defaults.
host-side command execution. Complements sandboxing by narrowly delegating
specific CLI capabilities the agent may use with the user's ambient
credentials.
- **[`exec_service`](exec_service/)** — gRPC service for streaming command
- **[`grpc_exec`](grpc_exec/)** — gRPC service for streaming command
execution over Unix sockets.
- **[`mcpmux`](mcpmux/)** — MCP proxy for developing and testing MCP servers.
The agent can edit a server, start it through `mcpmux`, and exercise it
Expand All @@ -29,7 +29,7 @@ executes commands freely; the container wall is the only boundary.
`command_filter` governs any host-side commands the agent is granted.

**Agent outside the sandbox.** The agent runs on the host and sends commands
to `exec_service` inside the sandbox over a Unix socket. `command_filter`
to `grpc_exec` inside the sandbox over a Unix socket. `command_filter`
is not needed for sandboxed execution but may still govern other host-side
commands.

Expand Down
4 changes: 2 additions & 2 deletions dist/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ load("@rules_pkg//pkg:tar.bzl", "pkg_tar")
pkg_files(
name = "binaries",
srcs = [
"//exec_service/cmd/exec_client:exec_client",
"//exec_service/cmd/exec_server:exec_server",
"//grpc_exec/cmd/grpc_exec",
"//grpc_exec/cmd/grpc_execd",
"//mcpmux:mcpmux",
"//sandbox:sandbox",
],
Expand Down
12 changes: 6 additions & 6 deletions dist/dist_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ func extractTar(t *testing.T, dir string) {
}
}

// TestSandboxedHostname extracts the dist tarball, runs exec_server inside the
// sandbox, and uses exec_client to verify that the UTS namespace hostname is
// TestSandboxedHostname extracts the dist tarball, runs grpc_execd inside the
// sandbox, and uses grpc_exec to verify that the UTS namespace hostname is
// "coding-agent".
func TestSandboxedHostname(t *testing.T) {
dir := t.TempDir()
Expand All @@ -81,9 +81,9 @@ func TestSandboxedHostname(t *testing.T) {
bin := func(name string) string { return filepath.Join(dir, name) }
sock := filepath.Join(dir, "exec.sock")

// Start exec_server inside the sandbox.
// Start grpc_execd inside the sandbox.
server := exec.Command(bin("sandbox"), "--log-file", "/dev/null", "--rw", dir, "--",
bin("exec_server"), "-addr", sock)
bin("grpc_execd"), "-addr", sock)
server.Stderr = os.Stderr
if err := server.Start(); err != nil {
t.Fatalf("start sandboxed server: %v", err)
Expand All @@ -102,8 +102,8 @@ func TestSandboxedHostname(t *testing.T) {
time.Sleep(20 * time.Millisecond)
}

// Use exec_client to read the hostname inside the sandbox.
out, err := exec.Command(bin("exec_client"), "-addr", sock, "cat /proc/sys/kernel/hostname").Output()
// Use grpc_exec to read the hostname inside the sandbox.
out, err := exec.Command(bin("grpc_exec"), "-addr", sock, "cat /proc/sys/kernel/hostname").Output()
if err != nil {
t.Fatalf("exec_client: %v", err)
}
Expand Down
10 changes: 5 additions & 5 deletions exec_service/BUILD.bazel → grpc_exec/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
load("@rules_go//proto:def.bzl", "go_proto_library")

proto_library(
name = "exec_service_proto",
srcs = ["exec_service.proto"],
name = "grpc_exec_proto",
srcs = ["grpc_exec.proto"],
deps = ["@protobuf//:duration_proto"],
)

go_proto_library(
name = "exec_service_go_proto",
name = "grpc_exec_go_proto",
compilers = ["@rules_go//proto:go_grpc"],
importpath = "github.com/google/agent-shell-tools/exec_service/execservicepb",
proto = ":exec_service_proto",
importpath = "github.com/google/agent-shell-tools/grpc_exec/grpcexecpb",
proto = ":grpc_exec_proto",
visibility = ["//visibility:public"],
)
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,30 @@
load("@rules_go//go:def.bzl", "go_binary", "go_library", "go_test")

go_library(
name = "exec_client_lib",
name = "grpc_exec_lib",
srcs = ["main.go"],
importpath = "github.com/google/agent-shell-tools/exec_service/cmd/exec_client",
importpath = "github.com/google/agent-shell-tools/grpc_exec/cmd/grpc_exec",
deps = [
"//exec_service:exec_service_go_proto",
"//grpc_exec:grpc_exec_go_proto",
"@org_golang_google_grpc//:grpc",
"@org_golang_google_grpc//credentials/insecure",
],
)

go_binary(
name = "exec_client",
embed = [":exec_client_lib"],
name = "grpc_exec",
embed = [":grpc_exec_lib"],
visibility = ["//visibility:public"],
)

go_test(
name = "exec_client_test",
srcs = ["exec_client_test.go"],
embed = [":exec_client_lib"],
name = "grpc_exec_test",
srcs = ["grpc_exec_test.go"],
embed = [":grpc_exec_lib"],
tags = ["local"],
deps = [
"//exec_service:exec_service_go_proto",
"//exec_service/server",
"//grpc_exec:grpc_exec_go_proto",
"//grpc_exec/server",
"@org_golang_google_grpc//:grpc",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"strings"
"testing"

pb "github.com/google/agent-shell-tools/exec_service/execservicepb"
"github.com/google/agent-shell-tools/exec_service/server"
pb "github.com/google/agent-shell-tools/grpc_exec/grpcexecpb"
"github.com/google/agent-shell-tools/grpc_exec/server"
"google.golang.org/grpc"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// Binary exec_client is a command line client for the ExecService gRPC server.
// Binary grpc_exec is a command line client for the ExecService gRPC server.
// It connects to the server over a Unix socket, sends a command, streams
// output to stdout, and exits with the command's exit code.
package main
Expand All @@ -26,13 +26,13 @@ import (
"path/filepath"
"strings"

pb "github.com/google/agent-shell-tools/exec_service/execservicepb"
pb "github.com/google/agent-shell-tools/grpc_exec/grpcexecpb"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
)

func run(args []string, stdout, stderr io.Writer) int {
fs := flag.NewFlagSet("exec_client", flag.ContinueOnError)
fs := flag.NewFlagSet("grpc_exec", flag.ContinueOnError)
fs.SetOutput(stderr)
addr := fs.String("addr", "", "Unix socket path to connect to (required)")
dir := fs.String("dir", "", "Working directory for the command")
Expand All @@ -53,9 +53,9 @@ func run(args []string, stdout, stderr io.Writer) int {
}

// When the caller passes a single argument it is treated as a raw shell
// command (e.g. exec_client -addr s "echo hello && ls"). Multiple
// command (e.g. grpc_exec -addr s "echo hello && ls"). Multiple
// arguments are shell-quoted so that spaces and metacharacters in
// individual args are preserved (e.g. exec_client -addr s touch "a b").
// individual args are preserved (e.g. grpc_exec -addr s touch "a b").
var cmdLine string
if len(cmdArgs) == 1 {
cmdLine = cmdArgs[0]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,30 @@
load("@rules_go//go:def.bzl", "go_binary", "go_library", "go_test")

go_library(
name = "exec_server_lib",
name = "grpc_execd_lib",
srcs = ["main.go"],
importpath = "github.com/google/agent-shell-tools/exec_service/cmd/exec_server",
importpath = "github.com/google/agent-shell-tools/grpc_exec/cmd/grpc_execd",
deps = [
"//exec_service:exec_service_go_proto",
"//exec_service/server",
"//grpc_exec:grpc_exec_go_proto",
"//grpc_exec/server",
"@org_golang_google_grpc//:grpc",
],
)

go_binary(
name = "exec_server",
embed = [":exec_server_lib"],
name = "grpc_execd",
embed = [":grpc_execd_lib"],
visibility = ["//visibility:public"],
)

go_test(
name = "exec_server_test",
srcs = ["exec_server_test.go"],
data = [":exec_server"],
env = {"EXEC_SERVER_BIN": "$(rlocationpath :exec_server)"},
name = "grpc_execd_test",
srcs = ["grpc_execd_test.go"],
data = [":grpc_execd"],
env = {"GRPC_EXECD_BIN": "$(rlocationpath :grpc_execd)"},
tags = ["local"],
deps = [
"//exec_service:exec_service_go_proto",
"//grpc_exec:grpc_exec_go_proto",
"@org_golang_google_grpc//:grpc",
"@org_golang_google_grpc//credentials/insecure",
"@rules_go//go/runfiles",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ import (
"time"

"github.com/bazelbuild/rules_go/go/runfiles"
pb "github.com/google/agent-shell-tools/exec_service/execservicepb"
pb "github.com/google/agent-shell-tools/grpc_exec/grpcexecpb"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
)

func binPath(t *testing.T) string {
t.Helper()
rloc := os.Getenv("EXEC_SERVER_BIN")
rloc := os.Getenv("GRPC_EXECD_BIN")
if rloc == "" {
t.Fatal("EXEC_SERVER_BIN not set")
t.Fatal("GRPC_EXECD_BIN not set")
}
r, err := runfiles.New()
if err != nil {
Expand All @@ -49,7 +49,7 @@ func binPath(t *testing.T) string {
return p
}

// startServer launches the exec_server binary on a temporary Unix socket and
// startServer launches the grpc_execd binary on a temporary Unix socket and
// returns a connected gRPC client. The server process is killed on cleanup.
func startServer(t *testing.T) pb.ExecServiceClient {
t.Helper()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// Binary exec_server runs the ExecService gRPC server.
// Binary grpc_execd runs the ExecService gRPC server.
package main

import (
Expand All @@ -23,8 +23,8 @@ import (
"os/signal"
"syscall"

pb "github.com/google/agent-shell-tools/exec_service/execservicepb"
"github.com/google/agent-shell-tools/exec_service/server"
pb "github.com/google/agent-shell-tools/grpc_exec/grpcexecpb"
"github.com/google/agent-shell-tools/grpc_exec/server"
"google.golang.org/grpc"
)

Expand Down
4 changes: 2 additions & 2 deletions exec_service/exec_service.proto → grpc_exec/grpc_exec.proto
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@

syntax = "proto3";

package exec_service;
package grpc_exec;

import "google/protobuf/duration.proto";

option go_package = "github.com/google/agent-shell-tools/exec_service/execservicepb";
option go_package = "github.com/google/agent-shell-tools/grpc_exec/grpcexecpb";

// A simple command execution service.
service ExecService {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ load("@rules_go//go:def.bzl", "go_library", "go_test")
go_library(
name = "server",
srcs = ["server.go"],
importpath = "github.com/google/agent-shell-tools/exec_service/server",
importpath = "github.com/google/agent-shell-tools/grpc_exec/server",
visibility = ["//visibility:public"],
deps = [
"//exec_service:exec_service_go_proto",
"//grpc_exec:grpc_exec_go_proto",
"@org_golang_google_grpc//:grpc",
"@org_golang_google_grpc//codes",
"@org_golang_google_grpc//status",
Expand All @@ -32,7 +32,7 @@ go_test(
srcs = ["server_test.go"],
deps = [
":server",
"//exec_service:exec_service_go_proto",
"//grpc_exec:grpc_exec_go_proto",
"@org_golang_google_grpc//:grpc",
"@org_golang_google_grpc//codes",
"@org_golang_google_grpc//credentials/insecure",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"syscall"
"time"

pb "github.com/google/agent-shell-tools/exec_service/execservicepb"
pb "github.com/google/agent-shell-tools/grpc_exec/grpcexecpb"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
"testing"
"time"

pb "github.com/google/agent-shell-tools/exec_service/execservicepb"
"github.com/google/agent-shell-tools/exec_service/server"
pb "github.com/google/agent-shell-tools/grpc_exec/grpcexecpb"
"github.com/google/agent-shell-tools/grpc_exec/server"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/credentials/insecure"
Expand Down
Loading