From 3c77c20de8ee355dfc3c0e97d5ff720e1baae0ee Mon Sep 17 00:00:00 2001 From: mrhid6 Date: Mon, 20 Jul 2026 11:24:08 +0100 Subject: [PATCH] feat(proto): add RunStepCmd and StepResult messages --- agent/internal/grpc/pb/vantage.pb.go | 17 +++++++++++++++++ proto/vantage/v1/vantage.proto | 17 +++++++++++++++++ server/internal/grpc/pb/vantage.pb.go | 17 +++++++++++++++++ 3 files changed, 51 insertions(+) diff --git a/agent/internal/grpc/pb/vantage.pb.go b/agent/internal/grpc/pb/vantage.pb.go index 37a9b65..42441f9 100644 --- a/agent/internal/grpc/pb/vantage.pb.go +++ b/agent/internal/grpc/pb/vantage.pb.go @@ -68,6 +68,7 @@ type ServerCommand struct { DeleteKey *DeleteKeyCmd `json:"delete_key,omitempty"` UpdateAgent *UpdateAgentCmd `json:"update_agent,omitempty"` ApplyUpdates *ApplyUpdatesCmd `json:"apply_updates,omitempty"` + RunStep *RunStepCmd `json:"run_step,omitempty"` } type DeleteKeyCmd struct { @@ -92,6 +93,7 @@ type AgentMessage struct { AgentToken string `json:"agent_token"` Ready *AgentReady `json:"ready,omitempty"` Result *CommandResult `json:"result,omitempty"` + StepResult *StepResult `json:"step_result,omitempty"` } type AgentReady struct{} @@ -102,6 +104,21 @@ type CommandResult struct { Message string `json:"message"` } +type RunStepCmd struct { + Interpreter string `json:"interpreter"` + Script string `json:"script"` + Env map[string]string `json:"env,omitempty"` + TimeoutSeconds int `json:"timeout_seconds,omitempty"` +} + +type StepResult struct { + CommandId string `json:"command_id"` + ExitCode int `json:"exit_code"` + Stdout string `json:"stdout,omitempty"` + Stderr string `json:"stderr,omitempty"` + OutputEnv map[string]string `json:"output_env,omitempty"` +} + // CommandStream client-side interface type Vantage_CommandStreamClient interface { diff --git a/proto/vantage/v1/vantage.proto b/proto/vantage/v1/vantage.proto index 942d730..f65b425 100644 --- a/proto/vantage/v1/vantage.proto +++ b/proto/vantage/v1/vantage.proto @@ -55,6 +55,7 @@ message AgentMessage { oneof payload { AgentReady ready = 3; CommandResult result = 4; + StepResult step_result = 5; } } @@ -89,6 +90,7 @@ message ServerCommand { DeleteKeyCmd delete_key = 3; UpdateAgentCmd update_agent = 4; ApplyUpdatesCmd apply_updates = 5; + RunStepCmd run_step = 6; } } @@ -108,3 +110,18 @@ message GenerateKeyCmd { string passphrase = 4; // empty = no passphrase string comment = 5; // embedded in public key } + +message RunStepCmd { + string interpreter = 1; // "bash" | "powershell" + string script = 2; + map env = 3; + int32 timeout_seconds = 4; +} + +message StepResult { + string command_id = 1; + int32 exit_code = 2; + string stdout = 3; + string stderr = 4; + map output_env = 5; +} diff --git a/server/internal/grpc/pb/vantage.pb.go b/server/internal/grpc/pb/vantage.pb.go index 223317b..758ed73 100644 --- a/server/internal/grpc/pb/vantage.pb.go +++ b/server/internal/grpc/pb/vantage.pb.go @@ -71,6 +71,7 @@ type ServerCommand struct { DeleteKey *DeleteKeyCmd `json:"delete_key,omitempty"` UpdateAgent *UpdateAgentCmd `json:"update_agent,omitempty"` ApplyUpdates *ApplyUpdatesCmd `json:"apply_updates,omitempty"` + RunStep *RunStepCmd `json:"run_step,omitempty"` } type DeleteKeyCmd struct { @@ -95,6 +96,7 @@ type AgentMessage struct { AgentToken string `json:"agent_token"` Ready *AgentReady `json:"ready,omitempty"` Result *CommandResult `json:"result,omitempty"` + StepResult *StepResult `json:"step_result,omitempty"` } type AgentReady struct{} @@ -105,6 +107,21 @@ type CommandResult struct { Message string `json:"message"` } +type RunStepCmd struct { + Interpreter string `json:"interpreter"` + Script string `json:"script"` + Env map[string]string `json:"env,omitempty"` + TimeoutSeconds int `json:"timeout_seconds,omitempty"` +} + +type StepResult struct { + CommandId string `json:"command_id"` + ExitCode int `json:"exit_code"` + Stdout string `json:"stdout,omitempty"` + Stderr string `json:"stderr,omitempty"` + OutputEnv map[string]string `json:"output_env,omitempty"` +} + // CommandStream server-side interface type Vantage_CommandStreamServer interface {