Skip to content

Commit 28d1e7b

Browse files
committed
Add exec_service proto
1 parent a6a9cf6 commit 28d1e7b

File tree

3 files changed

+69
-0
lines changed

3 files changed

+69
-0
lines changed

exec_service/BUILD.bazel

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright 2026 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
proto_library(
16+
name = "exec_service_proto",
17+
srcs = ["exec_service.proto"],
18+
)

exec_service/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
A service to execute commands.
2+
3+
Intended to be run inside a sandbox, with a socket exposed.
4+
Connected from a MCP or built-in integration of a coding agent.

exec_service/exec_service.proto

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// Copyright 2026 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
syntax = "proto3";
16+
17+
package exec_service;
18+
19+
// A simple command execution service.
20+
service ExecService {
21+
// Executes a command and streams the output until completion.
22+
rpc RunCommand(StartCommandRequest) returns (stream ServerEvent);
23+
}
24+
25+
message StartCommandRequest {
26+
// The raw shell command to execute.
27+
string command_line = 1;
28+
29+
// The directory to execute the command in.
30+
string working_dir = 2;
31+
}
32+
33+
message ServerEvent {
34+
oneof event {
35+
// Incremental stdout/stderr from the command.
36+
bytes output = 1;
37+
38+
// Sent exactly once when the command finishes.
39+
ExitInfo exited = 2;
40+
}
41+
}
42+
43+
message ExitInfo {
44+
int32 exit_code = 1;
45+
// Populated only if the system failed to execute the command at all.
46+
string error_message = 2;
47+
}

0 commit comments

Comments
 (0)