Skip to content

armgit / ax

Public Imported from GitHub
0

Agent Executor (AX) is Google's open agentic orchestration runtime

Go

Allow starting executions bidirectionally (#127)

Jaana Dogan878a3c384f3d
diff --git a/agent/agent.go b/agent/agent.go
index c7ea89d..39eea67 100644
--- a/agent/agent.go
+++ b/agent/agent.go
@@ -20,31 +20,23 @@ import (
"context"
"github.com/google/ax/proto"
- "google.golang.org/protobuf/types/known/anypb"
)
// OutputHandler is a callback function that handles output content from an agent.
// It is called for each piece of content the agent generates.
-type OutputHandler func(outgoing *proto.ProcessResponse) error
+type OutputHandler func(outgoing *proto.AgentOutputs) error
-type Task struct {
- ID string
- AgentID string
- Inputs []*proto.Content
- Config *anypb.Any // agent implementation specific configuration
-}
-
-type TaskExecutor interface {
- Exec(ctx context.Context, t *Task, o OutputHandler) error
+type Executor interface {
+ Exec(ctx context.Context, execID string, start *proto.AgentStart, o OutputHandler) error
}
// Agent defines the common interface for both local and remote agents.
// Agents process content using callback handlers.
type Agent interface {
- // Process handles processing of input content.
+ // Connect handles processing of input content.
// It calls the output handler for each piece of content generated.
// The handler may be called multiple times during processing.
- Process(ctx context.Context, t *Task, e TaskExecutor, o OutputHandler) error
+ Connect(ctx context.Context, execID string, start *proto.AgentStart, e Executor, o OutputHandler) error
// HealthCheck checks if the agent is healthy and responsive.
// Returns an error if the agent is unhealthy or unreachable.
diff --git a/agent/k8s_sandbox.go b/agent/k8s_sandbox.go
index b7594af..45e2a3b 100644
--- a/agent/k8s_sandbox.go
+++ b/agent/k8s_sandbox.go
@@ -25,6 +25,7 @@ import (
"time"
"github.com/google/ax/internal/sandboxclient"
+ "github.com/google/ax/proto"
"google.golang.org/grpc/metadata"
)
@@ -81,13 +82,13 @@ func (a *KubernetesSandboxAgent) HealthCheck(ctx context.Context) error {
return nil
}
-func (a *KubernetesSandboxAgent) Process(ctx context.Context, t *Task, e TaskExecutor, o OutputHandler) error {
+func (a *KubernetesSandboxAgent) Connect(ctx context.Context, execID string, start *proto.AgentStart, e Executor, o OutputHandler) error {
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
// Use the id deterministically so interactive executions reuse the same sandbox pod,
// rather than spawning a new pod for every exchanged message.
- safeID := strings.ReplaceAll(t.ID, "-", "")
+ safeID := strings.ReplaceAll(execID, "-", "")
if len(safeID) > 20 {
safeID = safeID[:20] // Keep it short for k8s names
}
@@ -198,7 +199,7 @@ func (a *KubernetesSandboxAgent) Process(ctx context.Context, t *Task, e TaskExe
defer remoteAgent.Close()
// Forward the request!
- return remoteAgent.Process(ctx, t, e, o)
+ return remoteAgent.Connect(ctx, execID, start, e, o)
}
func findAvailablePort() (int, error) {
diff --git a/agent/local.go b/agent/local.go
index e01dd2b..e7d3c1b 100644
--- a/agent/local.go
+++ b/agent/local.go
@@ -16,19 +16,21 @@ package agent
import (
"context"
+
+ "github.com/google/ax/proto"
"fmt"
)
// LocalAgent wraps a local (in-process) agent implementation.
// It implements the Agent interface for agents running in the same process as the controller.
type LocalAgent struct {
- processFunc func(ctx context.Context, t *Task, e TaskExecutor, o OutputHandler) error
+ processFunc func(ctx context.Context, execID string, start *proto.AgentStart, e Executor, o OutputHandler) error
healthCheckFunc func(ctx context.Context) error
}
// LocalAgentConfig configures a local agent.
type LocalAgentConfig struct {
- ProcessFunc func(ctx context.Context, t *Task, e TaskExecutor, o OutputHandler) error
+ ProcessFunc func(ctx context.Context, execID string, start *proto.AgentStart, e Executor, o OutputHandler) error
HealthCheckFunc func(ctx context.Context) error
}
@@ -49,9 +51,9 @@ func NewLocalAgent(config LocalAgentConfig) (*LocalAgent, error) {
}, nil
}
-// Process handles processing of input content with callback handler.
-func (a *LocalAgent) Process(ctx context.Context, t *Task, e TaskExecutor, o OutputHandler) error {
- return a.processFunc(ctx, t, e, o)
+// Connect handles processing of input content with callback handler.
+func (a *LocalAgent) Connect(ctx context.Context, execID string, start *proto.AgentStart, e Executor, o OutputHandler) error {
+ return a.processFunc(ctx, execID, start, e, o)
}
// HealthCheck checks if the agent is healthy.
diff --git a/agent/remote.go b/agent/remote.go
index be210e7..d76557a 100644
--- a/agent/remote.go
+++ b/agent/remote.go
@@ -64,9 +64,9 @@ func (a *RemoteAgent) connect() (*grpc.ClientConn, error) {
return conn, nil
}
-// Process handles processing of input content with the remote agent.
-func (a *RemoteAgent) Process(ctx context.Context, t *Task, e TaskExecutor, o OutputHandler) error {
- ctx = metadata.AppendToOutgoingContext(ctx, "execution-id", t.ID)
+// Connect handles processing of input content with the remote agent.
+func (a *RemoteAgent) Connect(ctx context.Context, execID string, start *proto.AgentStart, e Executor, o OutputHandler) error {
+ ctx = metadata.AppendToOutgoingContext(ctx, "execution-id", execID)
conn, err := a.connect()
if err != nil {
return fmt.Errorf("failed to connect: %w", err)
@@ -74,13 +74,17 @@ func (a *RemoteAgent) Process(ctx context.Context, t *Task, e TaskExecutor, o Ou
defer conn.Close()
client := proto.NewAgentServiceClient(conn)
- stream, err := client.Process(ctx)
+ stream, err := client.Connect(ctx)
if err != nil {
return fmt.Errorf("failed to create stream: %w", err)
}
- // Send all inputs to the remote agent
- if err := stream.Send(&proto.ProcessRequest{Contents: t.Inputs}); err != nil {
+ if err := stream.Send(&proto.AgentMessage{
+ ExecId: execID,
+ Msg: &proto.AgentMessage_Start{
+ Start: start,
+ },
+ }); err != nil {
return fmt.Errorf("failed to send content: %w", err)
}
@@ -100,16 +104,21 @@ func (a *RemoteAgent) Process(ctx context.Context, t *Task, e TaskExecutor, o Ou
return fmt.Errorf("failed to receive content: %w", err)
}
- // Call the handler with the received content
- if err := o(resp); err != nil {
- return fmt.Errorf("handler error: %w", err)
- }
-
- // Check for context cancellation
- select {
- case <-ctx.Done():
- return ctx.Err()
+ switch msg := resp.Msg.(type) {
+ case *proto.AgentMessage_Start:
+ // Start a new agent call
+ if err := e.Exec(stream.Context(), resp.ExecId, msg.Start, o); err != nil {
+ return fmt.Errorf("failed to execute: %w", err)
+ }
+ case *proto.AgentMessage_Outputs:
+ if resp.ExecId != execID {
+ return fmt.Errorf("received content for different execution id: %s != %s", resp.ExecId, execID)
+ }
+ if err := o(msg.Outputs); err != nil {
+ return fmt.Errorf("handler error: %w", err)
+ }
default:
+ return fmt.Errorf("unknown message type: %T", msg)
}
}
}
diff --git a/cmd/ax/exec.go b/cmd/ax/exec.go
index db96297..d9ce288 100644
--- a/cmd/ax/exec.go
+++ b/cmd/ax/exec.go
@@ -218,7 +218,7 @@ func runExecHeadless(ctx context.Context, d *internal.Display, id string, agentI
var checkpoint string
var outputs []*proto.Content
var confirmation *proto.ConfirmationContent
- outputHandler := agent.OutputHandler(func(resp *proto.ProcessResponse) error {
+ outputHandler := agent.OutputHandler(func(resp *proto.AgentOutputs) error {
if resp.CheckpointId != "" {
checkpoint = resp.CheckpointId
}
@@ -232,8 +232,14 @@ func runExecHeadless(ctx context.Context, d *internal.Display, id string, agentI
displayContents(d, resp.Contents)
return nil
})
- if err := execController.Exec(ctx, id, agentID, nil, &proto.ProcessRequest{
- Contents: inputs,
+ if err := execController.Exec(ctx, &proto.AgentMessage{
+ ExecId: id,
+ Msg: &proto.AgentMessage_Start{
+ Start: &proto.AgentStart{
+ AgentId: agentID,
+ Contents: inputs,
+ },
+ },
}, outputHandler); err != nil {
return nil, nil, fmt.Errorf("error executing with local server: %w", err)
}
diff --git a/cmd/ax/trace.go b/cmd/ax/trace.go
index 9f75b49..c08d336 100644
--- a/cmd/ax/trace.go
+++ b/cmd/ax/trace.go
@@ -49,7 +49,7 @@ type Content struct {
}
type ExecutionEvent struct {
- TaskID string `json:"task_id"`
+ ExecID string `json:"exec_id"`
AgentID string `json:"agent_id"`
Inputs []Content `json:"inputs"`
Outputs []Content `json:"outputs"`
@@ -58,13 +58,13 @@ type ExecutionEvent struct {
}
type TaskTrace struct {
- TaskID string `json:"task_id"`
+ ExecID string `json:"exec_id"`
AgentID string `json:"agent_id"`
Events []ExecutionEvent `json:"events"`
}
type TraceData struct {
- RootTaskID string `json:"root_task_id"`
+ RootExecID string `json:"root_exec_id"`
Tasks []TaskTrace `json:"tasks"`
}
@@ -107,24 +107,24 @@ func runTrace(cmd *cobra.Command, args []string) error {
return serveTraceUI(listener, data, indexHTML)
}
-func loadTraceData(rootTaskID string) (*TraceData, error) {
+func loadTraceData(rootExecID string) (*TraceData, error) {
// The trace command uses the config provided by --config flag
configPath := traceConfigFile
- events, err := fetchEventsFromDB(configPath, rootTaskID)
+ events, err := fetchEventsFromDB(configPath, rootExecID)
if err != nil {
return nil, err
}
data := &TraceData{
- RootTaskID: rootTaskID,
- Tasks: buildTaskTraces(rootTaskID, events),
+ RootExecID: rootExecID,
+ Tasks: buildTaskTraces(rootExecID, events),
}
return data, nil
}
-func fetchEventsFromDB(configPath string, rootTaskID string) ([]*proto.ExecutionEvent, error) {
+func fetchEventsFromDB(configPath string, rootExecID string) ([]*proto.ExecutionEvent, error) {
cfg, err := config.LoadFromFile(configPath)
if err != nil {
return nil, fmt.Errorf("error loading config: %w", err)
@@ -137,7 +137,7 @@ func fetchEventsFromDB(configPath string, rootTaskID string) ([]*proto.Execution
defer evLog.Close()
ctx := context.Background()
- events, err := evLog.EventsByPrefix(ctx, rootTaskID)
+ events, err := evLog.EventsByPrefix(ctx, rootExecID)
if err != nil {
return nil, fmt.Errorf("failed to query trace events: %w", err)
}
@@ -145,17 +145,17 @@ func fetchEventsFromDB(configPath string, rootTaskID string) ([]*proto.Execution
return events, nil
}
-func buildTaskTraces(rootTaskID string, events []*proto.ExecutionEvent) []TaskTrace {
+func buildTaskTraces(rootExecID string, events []*proto.ExecutionEvent) []TaskTrace {
tasksMap := make(map[string][]ExecutionEvent)
for _, protoEv := range events {
- taskID := protoEv.TaskId
- ev := extractExecutionEvent(taskID, protoEv)
- tasksMap[taskID] = append(tasksMap[taskID], ev)
+ exID := protoEv.ExecId
+ ev := extractExecutionEvent(exID, protoEv)
+ tasksMap[exID] = append(tasksMap[exID], ev)
}
var tasks []TaskTrace
- for taskID, evs := range tasksMap {
+ for execID, evs := range tasksMap {
agentID := ""
for _, ev := range evs {
if ev.AgentID != "" {
@@ -164,7 +164,7 @@ func buildTaskTraces(rootTaskID string, events []*proto.ExecutionEvent) []TaskTr
}
}
tasks = append(tasks, TaskTrace{
- TaskID: taskID,
+ ExecID: execID,
AgentID: agentID,
Events: evs,
})
@@ -172,13 +172,13 @@ func buildTaskTraces(rootTaskID string, events []*proto.ExecutionEvent) []TaskTr
// Root task first, then sub-tasks sorted by name.
sort.Slice(tasks, func(i, j int) bool {
- if tasks[i].TaskID == rootTaskID {
+ if tasks[i].ExecID == rootExecID {
return true
}
- if tasks[j].TaskID == rootTaskID {
+ if tasks[j].ExecID == rootExecID {
return false
}
- return tasks[i].TaskID < tasks[j].TaskID
+ return tasks[i].ExecID < tasks[j].ExecID
})
return tasks
@@ -206,9 +206,9 @@ func extractContents(protoContents []*proto.Content) []Content {
return results
}
-func extractExecutionEvent(taskID string, protoEv *proto.ExecutionEvent) ExecutionEvent {
+func extractExecutionEvent(execID string, protoEv *proto.ExecutionEvent) ExecutionEvent {
ev := ExecutionEvent{
- TaskID: taskID,
+ ExecID: execID,
AgentID: protoEv.AgentId,
}
if protoEv.Timestamp != nil {
diff --git a/cmd/ax/trace_ui.go b/cmd/ax/trace_ui.go
index 7412de6..efad959 100644
--- a/cmd/ax/trace_ui.go
+++ b/cmd/ax/trace_ui.go
@@ -46,7 +46,7 @@ func serveTraceUI(listener net.Listener, data *TraceData, rawHTML string) error
}
url := fmt.Sprintf("http://%s", addr)
- fmt.Printf("Starting trace viewer for %s...\n", data.RootTaskID)
+ fmt.Printf("Starting trace viewer for %s...\n", data.RootExecID)
fmt.Printf("Opening browser to %s\n", url)
fmt.Printf("Press Ctrl+C to exit.\n")
@@ -258,7 +258,7 @@ function renderTrace(data){
const ts=t.events.map(e=>new Date(e.timestamp).getTime());
const start=ts.length?Math.min(...ts):null;
const end=ts.length?Math.max(...ts):null;
- return{taskID:t.task_id,start,end};
+ return{execID:t.exec_id,start,end};
});
taskTimes.sort((a,b)=>{
if(a.start==null)return 1;
@@ -274,31 +274,31 @@ function renderTrace(data){
});
const span=maxT-minT||1;
- let html='<div class="trace-hdr"><div class="label">Trace</div><div class="tid">'+esc(data.root_task_id)+'</div></div>';
+ let html='<div class="trace-hdr"><div class="label">Trace</div><div class="tid">'+esc(data.root_exec_id)+'</div></div>';
html+='<div class="timeline-card"><div class="card-title">Timeline</div><div class="tl-rows">';
- taskTimes.forEach(({taskID,start,end},i)=>{
- const shortName=taskID===data.root_task_id?'root':taskID.slice(data.root_task_id.length+1);
+ taskTimes.forEach(({execID,start,end},i)=>{
+ const shortName=execID===data.root_exec_id?'root':execID.slice(data.root_exec_id.length+1);
const left=start!=null?((start-minT)/span*100).toFixed(2):0;
const width=start!=null?Math.max((end-start)/span*100,0.4).toFixed(2):0;
const dur=end-start;
const durStr=dur<1000?dur+'ms':(dur/1000).toFixed(2)+'s';
const colorCls='c'+(i%7);
html+='<div class="tl-row">'
- +'<div class="tl-label" title="'+esc(taskID)+'">'+esc(shortName)+'</div>'
- +'<div class="tl-track"><div class="tl-bar '+colorCls+'" style="left:'+left+'%;width:'+width+'%;cursor:pointer" title="'+esc(durStr)+'" onclick="scrollToCard(\''+esc(taskID)+'\')"><span>'+esc(durStr)+'</span></div></div>'
+ +'<div class="tl-label" title="'+esc(execID)+'">'+esc(shortName)+'</div>'
+ +'<div class="tl-track"><div class="tl-bar '+colorCls+'" style="left:'+left+'%;width:'+width+'%;cursor:pointer" title="'+esc(durStr)+'" onclick="scrollToCard(\''+esc(execID)+'\')"><span>'+esc(durStr)+'</span></div></div>'
+'</div>';
});
html+='</div></div>';
// Task sections
data.tasks.forEach((task,i)=>{
- const shortName=task.task_id===data.root_task_id?'root':task.task_id.slice(data.root_task_id.length+1);
+ const shortName=task.exec_id===data.root_exec_id?'root':task.exec_id.slice(data.root_exec_id.length+1);
const lastState=getLastState(task.events);
const stateClass=lastState?lastState.toLowerCase().replace('state_',''):'';
const stateBadge=lastState?'<span class="state-badge '+esc(stateClass)+'">'+esc(lastState.replace('STATE_',''))+'</span>':'';
- html+='<div class="task-card" id="card-'+esc(task.task_id)+'">'
+ html+='<div class="task-card" id="card-'+esc(task.exec_id)+'">'
+'<div class="task-card-hdr collapsed" onclick="toggleCard(this)">'
+'<span class="expand-ico">▼</span>'
+'<span class="task-name">'+esc(shortName)+'</span>'
@@ -313,8 +313,8 @@ function renderTrace(data){
document.getElementById('main').innerHTML=html;
}
-function scrollToCard(taskID){
- const el=document.getElementById('card-'+taskID);
+function scrollToCard(execID){
+ const el=document.getElementById('card-'+execID);
if(!el)return;
const hdr=el.querySelector('.task-card-hdr');
const body=el.querySelector('.task-card-body');
diff --git a/examples/gke_sandbox_agent/main.go b/examples/gke_sandbox_agent/main.go
index 4d6bd4b..892f774 100644
--- a/examples/gke_sandbox_agent/main.go
+++ b/examples/gke_sandbox_agent/main.go
@@ -38,7 +38,7 @@ func (s *server) HealthCheck(ctx context.Context, req *proto.HealthCheckRequest)
return &proto.HealthCheckResponse{Healthy: true, Message: "upper_case_agent is running"}, nil
}
-func (s *server) Process(stream grpc.BidiStreamingServer[proto.ProcessRequest, proto.ProcessResponse]) error {
+func (s *server) Connect(stream grpc.BidiStreamingServer[proto.AgentMessage, proto.AgentMessage]) error {
for {
// Read input from the orchestrator
req, err := stream.Recv()
@@ -50,12 +50,12 @@ func (s *server) Process(stream grpc.BidiStreamingServer[proto.ProcessRequest, p
}
var outputs []*proto.Content
-
- if len(req.Contents) > 0 {
+ start := req.GetStart()
+ if start != nil && len(start.Contents) > 0 {
// Find the most recent message from the "user" in the history
var targetText string
- for i := len(req.Contents) - 1; i >= 0; i-- {
- if text := req.Contents[i].GetText(); text != nil && req.Contents[i].Role == "user" {
+ for i := len(start.Contents) - 1; i >= 0; i-- {
+ if text := start.Contents[i].GetText(); text != nil && start.Contents[i].Role == "user" {
targetText = text.Text
break
}
@@ -89,8 +89,13 @@ func (s *server) Process(stream grpc.BidiStreamingServer[proto.ProcessRequest, p
if len(outputs) > 0 {
// Send response back via gRPC
- if err := stream.Send(&proto.ProcessResponse{
- Contents: outputs,
+ if err := stream.Send(&proto.AgentMessage{
+ ExecId: req.ExecId,
+ Msg: &proto.AgentMessage_Outputs{
+ Outputs: &proto.AgentOutputs{
+ Contents: outputs,
+ },
+ },
}); err != nil {
return err
}
diff --git a/examples/remote_agent/main.go b/examples/remote_agent/main.go
index 10f8874..d3f2cec 100644
--- a/examples/remote_agent/main.go
+++ b/examples/remote_agent/main.go
@@ -36,9 +36,9 @@ type server struct {
proto.UnimplementedAgentServiceServer
}
-// Process implements bidirectional streaming for content processing.
+// Connect implements bidirectional streaming for agent processing.
// This RPC is called by the gar controller when a session triggers this agent.
-func (s *server) Process(stream proto.AgentService_ProcessServer) error {
+func (s *server) Connect(stream grpc.BidiStreamingServer[proto.AgentMessage, proto.AgentMessage]) error {
for {
// Receive input content from gar controller
incoming, err := stream.Recv()
@@ -49,8 +49,13 @@ func (s *server) Process(stream proto.AgentService_ProcessServer) error {
return err
}
+ startMsg := incoming.GetStart()
+ if startMsg == nil {
+ continue // optionally wait for start
+ }
+
var contents []*proto.Content
- for _, input := range incoming.Contents {
+ for _, input := range startMsg.Contents {
textContent := input.GetText()
if textContent == nil {
continue
@@ -71,9 +76,14 @@ func (s *server) Process(stream proto.AgentService_ProcessServer) error {
},
}
- if err := stream.Send(&proto.ProcessResponse{
- Contents: []*proto.Content{last},
- CheckpointId: uuid.New().String(),
+ if err := stream.Send(&proto.AgentMessage{
+ ExecId: incoming.ExecId,
+ Msg: &proto.AgentMessage_Outputs{
+ Outputs: &proto.AgentOutputs{
+ Contents: []*proto.Content{last},
+ CheckpointId: uuid.New().String(),
+ },
+ },
}); err != nil {
return err
}
diff --git a/internal/controller/controller.go b/internal/controller/controller.go
index 20af92f..91ddefa 100644
--- a/internal/controller/controller.go
+++ b/internal/controller/controller.go
@@ -29,7 +29,6 @@ import (
"github.com/google/ax/proto"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
- "google.golang.org/protobuf/types/known/anypb"
)
const plannerAgentID = "__planner"
@@ -90,16 +89,16 @@ func New(ctx context.Context, config Config) (*Controller, error) {
// Exec executes a new agentic loop execution or resumes an existing one.
// If id is empty, a UUID will be generated.
// If the execution already exists, it will be resumed with optional new inputs.
-func (d *Controller) Exec(ctx context.Context, id string, agentID string, agentConfig *anypb.Any, incoming *proto.ProcessRequest, handler agent.OutputHandler) error {
- if id == "" {
+func (d *Controller) Exec(ctx context.Context, incoming *proto.AgentMessage, handler agent.OutputHandler) error {
+ if incoming.ExecId == "" {
return fmt.Errorf("id is required")
}
- inFlight, cleanup := d.markInFlight(id)
+ inFlight, cleanup := d.markInFlight(incoming.ExecId)
defer cleanup()
if inFlight {
- return fmt.Errorf("task %q is already in flight", id)
+ return fmt.Errorf("task %q is already in flight", incoming.ExecId)
}
planner, err := d.plannerBuilder(ctx, d.registry)
@@ -118,16 +117,15 @@ func (d *Controller) Exec(ctx context.Context, id string, agentID string, agentC
}
}
- if agentID == "" {
- agentID = plannerAgentID
+ start := incoming.GetStart()
+ if start == nil {
+ return fmt.Errorf("no start message")
+ }
+ if start.AgentId == "" {
+ start.AgentId = plannerAgentID
}
e := task.DefaultExecutor(d.eventLog, registry)
- return e.Exec(ctx, &agent.Task{
- ID: id,
- AgentID: agentID,
- Inputs: incoming.Contents,
- Config: agentConfig,
- }, handler)
+ return e.Exec(ctx, incoming.ExecId, start, handler)
}
// Fork forks an execution from a source execution.
diff --git a/internal/controller/gemini.go b/internal/controller/gemini.go
index 5a6602e..03dcab0 100644
--- a/internal/controller/gemini.go
+++ b/internal/controller/gemini.go
@@ -40,8 +40,8 @@ func NewGeminiAgent() *GeminiAgent {
return &GeminiAgent{}
}
-func (a *GeminiAgent) config(t *agent.Task) (*proto.GeminiConfig, error) {
- if t.Config == nil {
+func (a *GeminiAgent) config(start *proto.AgentStart) (*proto.GeminiConfig, error) {
+ if start.Config == nil {
return &proto.GeminiConfig{
Model: "gemini-3-flash-preview",
Timeout: &duration.Duration{Seconds: 30},
@@ -49,14 +49,14 @@ func (a *GeminiAgent) config(t *agent.Task) (*proto.GeminiConfig, error) {
}
var cfg proto.GeminiConfig
- if err := t.Config.UnmarshalTo(&cfg); err != nil {
+ if err := start.Config.UnmarshalTo(&cfg); err != nil {
return nil, fmt.Errorf("failed to unmarshal Gemini config: %w", err)
}
return &cfg, nil
}
-func (a *GeminiAgent) Process(ctx context.Context, t *agent.Task, e agent.TaskExecutor, handler agent.OutputHandler) error {
- cfg, err := a.config(t)
+func (a *GeminiAgent) Connect(ctx context.Context, execID string, start *proto.AgentStart, e agent.Executor, handler agent.OutputHandler) error {
+ cfg, err := a.config(start)
if err != nil {
return err
}
@@ -69,7 +69,7 @@ func (a *GeminiAgent) Process(ctx context.Context, t *agent.Task, e agent.TaskEx
return fmt.Errorf("failed to create Gemini client: %w", err)
}
- inputs := t.Inputs
+ inputs := start.Contents
contents := protoToContents(inputs)
ctx, cancel := context.WithTimeout(ctx, cfg.Timeout.AsDuration())
defer cancel()
@@ -102,7 +102,7 @@ func (a *GeminiAgent) Process(ctx context.Context, t *agent.Task, e agent.TaskEx
}
if part.Text != "" {
respCount++
- if err := handler(&proto.ProcessResponse{
+ if err := handler(&proto.AgentOutputs{
Contents: []*proto.Content{{
Role: "model",
Content: &proto.Content_Text{
@@ -171,7 +171,7 @@ func (t *BashTool) HandleCall(ctx context.Context, fc *genai.FunctionCall, o age
if err != nil {
return err
}
- return o(&proto.ProcessResponse{
+ return o(&proto.AgentOutputs{
Contents: []*proto.Content{
{
Content: &proto.Content_FunctionCall{
@@ -198,7 +198,7 @@ func (t *BashTool) HandleExecute(ctx context.Context, fc *genai.FunctionCall, ap
// Declined, nothing to do in terms of executing any commands.
// But we still have to finish with a function response,
// not to keep the previously log function call hanging forever.
- return o(&proto.ProcessResponse{
+ return o(&proto.AgentOutputs{
Contents: []*proto.Content{
{
Role: "assistant",
@@ -229,7 +229,7 @@ func (t *BashTool) HandleExecute(ctx context.Context, fc *genai.FunctionCall, ap
if err != nil {
return fmt.Errorf("failed to convert function response to structpb: %w", err)
}
- return o(&proto.ProcessResponse{
+ return o(&proto.AgentOutputs{
Contents: []*proto.Content{
{
Role: "assistant",
@@ -293,7 +293,7 @@ func (t *SkillsTool) HandleCall(ctx context.Context, fc *genai.FunctionCall, o a
script, _ := fc.Args["script"].(string)
question := fmt.Sprintf("Can I run script %q from skill %q?", script, skill)
- return o(&proto.ProcessResponse{
+ return o(&proto.AgentOutputs{
Contents: []*proto.Content{
{
Content: &proto.Content_FunctionCall{
@@ -314,7 +314,7 @@ func (t *SkillsTool) HandleCall(ctx context.Context, fc *genai.FunctionCall, o a
}},
})
}
- return o(&proto.ProcessResponse{
+ return o(&proto.AgentOutputs{
Contents: []*proto.Content{
{
Content: &proto.Content_FunctionCall{
@@ -333,7 +333,7 @@ func (t *SkillsTool) HandleExecute(ctx context.Context, fc *genai.FunctionCall,
// Declined, nothing to do in terms of executing any commands.
// But we still have to finish with a function response,
// not to keep the previously log function call hanging forever.
- return o(&proto.ProcessResponse{
+ return o(&proto.AgentOutputs{
Contents: []*proto.Content{
{
Role: "assistant",
@@ -385,7 +385,7 @@ func (t *SkillsTool) HandleExecute(ctx context.Context, fc *genai.FunctionCall,
if err != nil {
return fmt.Errorf("failed to convert function response to structpb: %w", err)
}
- return o(&proto.ProcessResponse{
+ return o(&proto.AgentOutputs{
Contents: []*proto.Content{
{
Role: "assistant",
diff --git a/internal/controller/gemini_planner.go b/internal/controller/gemini_planner.go
index 611d904..e025f32 100644
--- a/internal/controller/gemini_planner.go
+++ b/internal/controller/gemini_planner.go
@@ -73,7 +73,6 @@ Guidelines:
}
// TODO(jbd): Enable skills tool.
-
return &geminiPlannerAgent{
client: client,
bashTool: &BashTool{},
@@ -82,24 +81,22 @@ Guidelines:
}, nil
}
-func (p *geminiPlannerAgent) Process(ctx context.Context, t *agent.Task, e agent.TaskExecutor, handler agent.OutputHandler) error {
+func (p *geminiPlannerAgent) Connect(ctx context.Context, execID string, start *proto.AgentStart, e agent.Executor, handler agent.OutputHandler) error {
var outputs []*proto.Content
- var outputCapturer = func(resp *proto.ProcessResponse) error {
+ var outputCapturer = func(resp *proto.AgentOutputs) error {
outputs = append(outputs, resp.Contents...)
return handler(resp)
}
-
- nextAgentID, err := p.process(ctx, t, outputCapturer)
+ nextAgentID, err := p.process(ctx, start, outputCapturer)
if err != nil {
return err
}
if nextAgentID == "" {
return nil
}
- if err := e.Exec(ctx, &agent.Task{
- ID: nextAgentID,
- AgentID: nextAgentID,
- Inputs: append(t.Inputs, outputs...),
+ if err := e.Exec(ctx, nextAgentID, &proto.AgentStart{
+ AgentId: nextAgentID,
+ Contents: append(start.Contents, outputs...),
}, handler); err != nil {
return err
}
@@ -114,13 +111,13 @@ func (p *geminiPlannerAgent) Close() error {
return nil
}
-func (p *geminiPlannerAgent) process(ctx context.Context, t *agent.Task, handler agent.OutputHandler) (agentID string, err error) {
+func (p *geminiPlannerAgent) process(ctx context.Context, start *proto.AgentStart, handler agent.OutputHandler) (agentID string, err error) {
tools, err := agentsToTools(p.registry, p.bashTool, p.skillsTool)
if err != nil {
return "", fmt.Errorf("failed to convert agents to tools: %w", err)
}
- inputs := t.Inputs
+ inputs := start.Contents
if fc, approved := p.handleConfirmationAnswer(inputs); fc != nil {
if p.bashTool.Name() == fc.Name {
return "", p.bashTool.HandleExecute(ctx, fc, approved, handler)
@@ -164,7 +161,7 @@ func (p *geminiPlannerAgent) process(ctx context.Context, t *agent.Task, handler
}
if part.Text != "" {
- if err := handler(&proto.ProcessResponse{
+ if err := handler(&proto.AgentOutputs{
Contents: []*proto.Content{{
Role: "assistant",
Content: &proto.Content_Text{
diff --git a/internal/controller/registry_test.go b/internal/controller/registry_test.go
index 9a52f5d..e370842 100644
--- a/internal/controller/registry_test.go
+++ b/internal/controller/registry_test.go
@@ -31,14 +31,14 @@ import (
// MockAgent is a mock implementation of the Agent interface for testing.
type MockAgent struct {
- processFunc func(ctx context.Context, t *agent.Task, e agent.TaskExecutor, o agent.OutputHandler) error
+ ProcessFunc func(ctx context.Context, execID string, start *proto.AgentStart, e agent.Executor, o agent.OutputHandler) error
healthCheckFunc func(ctx context.Context) error
closeFunc func() error
}
-func (m *MockAgent) Process(ctx context.Context, t *agent.Task, e agent.TaskExecutor, o agent.OutputHandler) error {
- if m.processFunc != nil {
- return m.processFunc(ctx, t, e, o)
+func (m *MockAgent) Connect(ctx context.Context, execID string, start *proto.AgentStart, e agent.Executor, o agent.OutputHandler) error {
+ if m.ProcessFunc != nil {
+ return m.ProcessFunc(ctx, execID, start, e, o)
}
return nil
}
diff --git a/internal/controller/task/sqlite.go b/internal/controller/task/sqlite.go
index 27a73c7..8aa3008 100644
--- a/internal/controller/task/sqlite.go
+++ b/internal/controller/task/sqlite.go
@@ -44,7 +44,7 @@ func OpenSQLiteEventLog(path string) (*SQLiteEventLog, error) {
if _, err := db.Exec(`
CREATE TABLE IF NOT EXISTS event_log (
id INTEGER PRIMARY KEY AUTOINCREMENT,
- task_id TEXT NOT NULL,
+ exec_id TEXT NOT NULL,
state INTEGER NOT NULL,
payload TEXT NOT NULL,
timestamp DATETIME NOT NULL
@@ -54,7 +54,7 @@ func OpenSQLiteEventLog(path string) (*SQLiteEventLog, error) {
}
// Create index if it doesn't exist
- if _, err := db.Exec(`CREATE INDEX IF NOT EXISTS idx_event_log_task_id ON event_log(task_id)`); err != nil {
+ if _, err := db.Exec(`CREATE INDEX IF NOT EXISTS idx_event_log_exec_id ON event_log(exec_id)`); err != nil {
db.Close()
return nil, fmt.Errorf("sqlite_eventlog: create index: %w", err)
}
@@ -78,8 +78,8 @@ func (l *SQLiteEventLog) Append(ctx context.Context, event *proto.ExecutionEvent
}
_, err = l.db.ExecContext(ctx,
- "INSERT INTO event_log (task_id, state, payload, timestamp) VALUES (?, ?, ?, ?)",
- event.TaskId, event.State, string(payload), timestamp)
+ "INSERT INTO event_log (exec_id, state, payload, timestamp) VALUES (?, ?, ?, ?)",
+ event.ExecId, event.State, string(payload), timestamp)
if err != nil {
return fmt.Errorf("sqlite_eventlog: insert: %w", err)
@@ -90,7 +90,7 @@ func (l *SQLiteEventLog) Append(ctx context.Context, event *proto.ExecutionEvent
// Events retrieves all events from the database ordered by insertion order.
func (l *SQLiteEventLog) Events(ctx context.Context, id string) ([]*proto.ExecutionEvent, error) {
- rows, err := l.db.QueryContext(ctx, "SELECT payload FROM event_log WHERE task_id = ?", id)
+ rows, err := l.db.QueryContext(ctx, "SELECT payload FROM event_log WHERE exec_id = ?", id)
if err != nil {
return nil, fmt.Errorf("sqlite_eventlog: query: %w", err)
}
@@ -118,9 +118,9 @@ func (l *SQLiteEventLog) Events(ctx context.Context, id string) ([]*proto.Execut
return events, nil
}
-// EventsByPrefix retrieves all events from the database matching a task_id prefix, ordered by insertion order.
+// EventsByPrefix retrieves all events from the database matching a exec_id prefix, ordered by insertion order.
func (l *SQLiteEventLog) EventsByPrefix(ctx context.Context, prefix string) ([]*proto.ExecutionEvent, error) {
- rows, err := l.db.QueryContext(ctx, "SELECT payload FROM event_log WHERE task_id LIKE ? ORDER BY id", prefix+"%")
+ rows, err := l.db.QueryContext(ctx, "SELECT payload FROM event_log WHERE exec_id LIKE ? ORDER BY id", prefix+"%")
if err != nil {
return nil, fmt.Errorf("sqlite_eventlog: query: %w", err)
}
diff --git a/internal/controller/task/sqlite_test.go b/internal/controller/task/sqlite_test.go
index b73a899..034b41e 100644
--- a/internal/controller/task/sqlite_test.go
+++ b/internal/controller/task/sqlite_test.go
@@ -35,7 +35,7 @@ func TestSQLiteEventLog_AppendAndEvents(t *testing.T) {
defer log.Close()
ev1 := &proto.ExecutionEvent{
- TaskId: "task-1",
+ ExecId: "task-1",
State: proto.State_STATE_PENDING,
Timestamp: timestamppb.Now(),
Inputs: []*proto.Content{
@@ -44,7 +44,7 @@ func TestSQLiteEventLog_AppendAndEvents(t *testing.T) {
}
ev2 := &proto.ExecutionEvent{
- TaskId: "task-1",
+ ExecId: "task-1",
State: proto.State_STATE_COMPLETED,
Timestamp: timestamppb.Now(),
Outputs: []*proto.Content{
@@ -68,10 +68,10 @@ func TestSQLiteEventLog_AppendAndEvents(t *testing.T) {
t.Fatalf("expected 2 events, got %d", len(events))
}
- if events[0].TaskId != "task-1" || events[0].State != proto.State_STATE_PENDING {
+ if events[0].ExecId != "task-1" || events[0].State != proto.State_STATE_PENDING {
t.Errorf("ev1 metadata mismatch")
}
- if events[1].TaskId != "task-1" || events[1].State != proto.State_STATE_COMPLETED {
+ if events[1].ExecId != "task-1" || events[1].State != proto.State_STATE_COMPLETED {
t.Errorf("ev2 metadata mismatch")
}
}
@@ -96,7 +96,7 @@ func TestSQLiteEventLog_ConcurrentAppend(t *testing.T) {
defer wg.Done()
for j := 0; j < numEvents; j++ {
ev := &proto.ExecutionEvent{
- TaskId: "task-concurrent",
+ ExecId: "task-concurrent",
State: proto.State(agentIdx % 4), // distribute states 0-3
Timestamp: timestamppb.Now(),
}
diff --git a/internal/controller/task/task.go b/internal/controller/task/task.go
index 4dd6783..5e74479 100644
--- a/internal/controller/task/task.go
+++ b/internal/controller/task/task.go
@@ -31,14 +31,14 @@ type taskExecutor struct {
registry map[string]agent.Agent
}
-func newTaskID(parent, child string) string {
+func newExecID(parent, child string) string {
if parent == "" {
return child
}
return parent + "-" + child
}
-func DefaultExecutor(eventLog EventLog, registry map[string]agent.Agent) agent.TaskExecutor {
+func DefaultExecutor(eventLog EventLog, registry map[string]agent.Agent) agent.Executor {
return &taskExecutor{
id: "",
eventLog: eventLog,
@@ -46,14 +46,14 @@ func DefaultExecutor(eventLog EventLog, registry map[string]agent.Agent) agent.T
}
}
-func (tm *taskExecutor) Exec(ctx context.Context, t *agent.Task, o agent.OutputHandler) error {
- t.ID = newTaskID(tm.id, t.ID)
- a, ok := tm.registry[t.AgentID]
+func (tm *taskExecutor) Exec(ctx context.Context, execID string, start *proto.AgentStart, o agent.OutputHandler) error {
+ execID = newExecID(tm.id, execID)
+ a, ok := tm.registry[start.AgentId]
if !ok {
return errors.New("no agent found")
}
- allInputs, state, err := history(ctx, tm.eventLog, t.ID)
+ allInputs, state, err := history(ctx, tm.eventLog, execID)
if err != nil {
return err
}
@@ -61,24 +61,25 @@ func (tm *taskExecutor) Exec(ctx context.Context, t *agent.Task, o agent.OutputH
if state == proto.State_STATE_COMPLETED {
return nil
}
- return tm.exec(ctx, t, tm.eventLog, a, allInputs, o)
+ return tm.exec(ctx, execID, start, tm.eventLog, a, allInputs, o)
}
func (tm *taskExecutor) exec(
ctx context.Context,
- t *agent.Task,
+ execID string,
+ start *proto.AgentStart,
el EventLog,
a agent.Agent,
allInputs []*proto.Content,
o agent.OutputHandler) error {
child := &taskExecutor{
- id: t.ID,
+ id: execID,
eventLog: tm.eventLog,
registry: tm.registry,
}
var allOutputs []*proto.Content
- outputBuffer := func(outgoing *proto.ProcessResponse) error {
+ outputBuffer := func(outgoing *proto.AgentOutputs) error {
allOutputs = append(allOutputs, outgoing.Contents...)
if o != nil {
return o(outgoing)
@@ -86,29 +87,24 @@ func (tm *taskExecutor) exec(
return nil
}
- allInputs = append(allInputs, t.Inputs...)
- if err := logPending(ctx, el, t); err != nil {
- return err
- }
-
+ allInputs = append(allInputs, start.Contents...)
if len(allInputs) == 0 {
return errors.New("no inputs")
}
+ if err := logPending(ctx, el, execID, start); err != nil {
+ return err
+ }
- if err := a.Process(ctx, &agent.Task{
- ID: t.ID,
- AgentID: t.AgentID,
- Inputs: allInputs,
- Config: t.Config,
- }, child, outputBuffer); err != nil {
- _ = logFailed(ctx, el, t) // Attempt to log failure, but prioritize returning the original error.
+ start.Contents = allInputs
+ if err := a.Connect(ctx, execID, start, child, outputBuffer); err != nil {
+ _ = logFailed(ctx, el, execID, start) // Attempt to log failure, but prioritize returning the original error.
return err
}
if len(allOutputs) > 0 {
// Log all the outputs at once.
// TODO: Log only at checkpoints.
- if err := logOutputs(ctx, el, t, allOutputs); err != nil {
+ if err := logOutputs(ctx, el, execID, start, allOutputs); err != nil {
return err
}
@@ -116,14 +112,14 @@ func (tm *taskExecutor) exec(
if last.GetConfirmation() == nil || last.GetConfirmation().GetQuestion() == "" {
// Log completed only if we are not waiting
// for an answer to a confirmation.
- return logCompleted(ctx, el, t)
+ return logCompleted(ctx, el, execID, start)
}
}
return nil
}
-func history(ctx context.Context, el EventLog, taskID string) ([]*proto.Content, proto.State, error) {
- events, err := el.Events(ctx, taskID)
+func history(ctx context.Context, el EventLog, execID string) ([]*proto.Content, proto.State, error) {
+ events, err := el.Events(ctx, execID)
if err != nil {
return nil, proto.State_STATE_UNSPECIFIED, err
}
@@ -132,7 +128,7 @@ func history(ctx context.Context, el EventLog, taskID string) ([]*proto.Content,
var state proto.State
for _, event := range events {
- if event.TaskId != taskID {
+ if event.ExecId != execID {
continue
}
// Reset after the status change ensure
@@ -154,39 +150,39 @@ func history(ctx context.Context, el EventLog, taskID string) ([]*proto.Content,
return history, state, nil
}
-func logPending(ctx context.Context, el EventLog, t *agent.Task) error {
+func logPending(ctx context.Context, el EventLog, execID string, start *proto.AgentStart) error {
return el.Append(ctx, &proto.ExecutionEvent{
Timestamp: timestamppb.Now(),
- TaskId: t.ID,
- AgentId: t.AgentID,
- Inputs: t.Inputs,
+ ExecId: execID,
+ AgentId: start.AgentId,
+ Inputs: start.Contents,
State: proto.State_STATE_PENDING,
})
}
-func logFailed(ctx context.Context, el EventLog, t *agent.Task) error {
+func logFailed(ctx context.Context, el EventLog, execID string, start *proto.AgentStart) error {
return el.Append(ctx, &proto.ExecutionEvent{
Timestamp: timestamppb.Now(),
- TaskId: t.ID,
- AgentId: t.AgentID,
+ ExecId: execID,
+ AgentId: start.AgentId,
State: proto.State_STATE_FAILED,
})
}
-func logCompleted(ctx context.Context, el EventLog, t *agent.Task) error {
+func logCompleted(ctx context.Context, el EventLog, execID string, start *proto.AgentStart) error {
return el.Append(ctx, &proto.ExecutionEvent{
Timestamp: timestamppb.Now(),
- TaskId: t.ID,
- AgentId: t.AgentID,
+ ExecId: execID,
+ AgentId: start.AgentId,
State: proto.State_STATE_COMPLETED,
})
}
-func logOutputs(ctx context.Context, el EventLog, t *agent.Task, outputs []*proto.Content) error {
+func logOutputs(ctx context.Context, el EventLog, execID string, start *proto.AgentStart, outputs []*proto.Content) error {
return el.Append(ctx, &proto.ExecutionEvent{
Timestamp: timestamppb.Now(),
- TaskId: t.ID,
- AgentId: t.AgentID,
+ ExecId: execID,
+ AgentId: start.AgentId,
Outputs: outputs,
})
}
diff --git a/internal/controller/task/task_test.go b/internal/controller/task/task_test.go
index b81635c..79af12c 100644
--- a/internal/controller/task/task_test.go
+++ b/internal/controller/task/task_test.go
@@ -43,13 +43,13 @@ func (m *MemoryEventLog) Append(_ context.Context, event *proto.ExecutionEvent)
return nil
}
-func (m *MemoryEventLog) Events(_ context.Context, taskID string) ([]*proto.ExecutionEvent, error) {
+func (m *MemoryEventLog) Events(_ context.Context, execID string) ([]*proto.ExecutionEvent, error) {
m.mu.Lock()
defer m.mu.Unlock()
out := make([]*proto.ExecutionEvent, 0)
for _, ev := range m.events {
- if ev.TaskId == taskID {
+ if ev.ExecId == execID {
out = append(out, ev)
}
}
@@ -84,19 +84,17 @@ func Example() {
ctx := context.Background()
registry := map[string]agent.Agent{
- "planner": AgentFunc(func(inputs []*proto.Content, tm agent.TaskExecutor, o agent.OutputHandler) {
- if err := tm.Exec(ctx, &agent.Task{
- ID: "deep-research-task",
- AgentID: "deep-research",
- Inputs: inputs,
+ "planner": AgentFunc(func(inputs []*proto.Content, tm agent.Executor, o agent.OutputHandler) {
+ if err := tm.Exec(ctx, "deep-research-task", &proto.AgentStart{
+ AgentId: "deep-research",
+ Contents: inputs,
}, o); err != nil {
return
}
- if err := tm.Exec(ctx, &agent.Task{
- ID: "pub-med-lookup-task",
- AgentID: "pub-med-index",
- Inputs: inputs,
+ if err := tm.Exec(ctx, "pub-med-lookup-task", &proto.AgentStart{
+ AgentId: "pub-med-index",
+ Contents: inputs,
}, o); err != nil {
return
}
@@ -104,10 +102,9 @@ func Example() {
}
tm := DefaultExecutor(memoryEventLog(), registry)
- if err := tm.Exec(ctx, &agent.Task{
- ID: "test",
- AgentID: "planner",
- Inputs: []*proto.Content{text("user", "Hello, I'd like to research cancer treatment options.")},
+ if err := tm.Exec(ctx, "test", &proto.AgentStart{
+ AgentId: "planner",
+ Contents: []*proto.Content{text("user", "Hello, I'd like to research cancer treatment options.")},
}, nil); err != nil {
log.Fatal(err)
}
@@ -117,24 +114,23 @@ func TestTaskManager(t *testing.T) {
ctx := context.Background()
registry := map[string]agent.Agent{
- "root": AgentFunc(func(inputs []*proto.Content, tm agent.TaskExecutor, o agent.OutputHandler) {
- if err := tm.Exec(ctx, &agent.Task{
- ID: "child-task",
- AgentID: "child",
- Inputs: inputs,
+ "root": AgentFunc(func(inputs []*proto.Content, tm agent.Executor, o agent.OutputHandler) {
+ if err := tm.Exec(ctx, "child-task", &proto.AgentStart{
+ AgentId: "child",
+ Contents: inputs,
}, o); err != nil {
t.Fatal(err)
}
if o != nil {
- o(&proto.ProcessResponse{
+ o(&proto.AgentOutputs{
Contents: []*proto.Content{text("assistant", "root done")},
})
}
}),
- "child": AgentFunc(func(inputs []*proto.Content, tm agent.TaskExecutor, o agent.OutputHandler) {
+ "child": AgentFunc(func(inputs []*proto.Content, tm agent.Executor, o agent.OutputHandler) {
time.Sleep(100 * time.Millisecond)
if o != nil {
- o(&proto.ProcessResponse{
+ o(&proto.AgentOutputs{
Contents: []*proto.Content{text("assistant", "child done")},
})
}
@@ -142,10 +138,9 @@ func TestTaskManager(t *testing.T) {
}
tm := DefaultExecutor(memoryEventLog(), registry)
- if err := tm.Exec(ctx, &agent.Task{
- ID: "root-task",
- AgentID: "root",
- Inputs: []*proto.Content{text("user", "hello!")},
+ if err := tm.Exec(ctx, "root-task", &proto.AgentStart{
+ AgentId: "root",
+ Contents: []*proto.Content{text("user", "hello!")},
}, nil); err != nil {
t.Fatal(err)
}
@@ -156,15 +151,14 @@ func TestFanout(t *testing.T) {
var executions atomic.Int32
registry := map[string]agent.Agent{
- "root": AgentFunc(func(inputs []*proto.Content, tm agent.TaskExecutor, o agent.OutputHandler) {
+ "root": AgentFunc(func(inputs []*proto.Content, tm agent.Executor, o agent.OutputHandler) {
var g errgroup.Group
for i := 0; i < 50; i++ {
i := i // Capture loop variable.
g.Go(func() error {
- return tm.Exec(ctx, &agent.Task{
- ID: fmt.Sprintf("child-%d", i),
- AgentID: "child",
- Inputs: inputs,
+ return tm.Exec(ctx, fmt.Sprintf("child-%d", i), &proto.AgentStart{
+ AgentId: "child",
+ Contents: inputs,
}, nil)
})
}
@@ -172,12 +166,12 @@ func TestFanout(t *testing.T) {
t.Fatal(err)
}
if o != nil {
- o(&proto.ProcessResponse{
+ o(&proto.AgentOutputs{
Contents: []*proto.Content{text("assistant", "root done")},
})
}
}),
- "child": AgentFunc(func(inputs []*proto.Content, tm agent.TaskExecutor, o agent.OutputHandler) {
+ "child": AgentFunc(func(inputs []*proto.Content, tm agent.Executor, o agent.OutputHandler) {
executions.Add(1)
time.Sleep(100 * time.Millisecond)
@@ -185,10 +179,9 @@ func TestFanout(t *testing.T) {
for i := 0; i < 2; i++ {
i := i // Capture loop variable.
g.Go(func() error {
- return tm.Exec(ctx, &agent.Task{
- ID: fmt.Sprintf("child2-%d", i),
- AgentID: "child2",
- Inputs: inputs,
+ return tm.Exec(ctx, fmt.Sprintf("child2-%d", i), &proto.AgentStart{
+ AgentId: "child2",
+ Contents: inputs,
}, nil)
})
}
@@ -196,16 +189,16 @@ func TestFanout(t *testing.T) {
t.Fatal(err)
}
if o != nil {
- o(&proto.ProcessResponse{
+ o(&proto.AgentOutputs{
Contents: []*proto.Content{text("assistant", "child done")},
})
}
}),
- "child2": AgentFunc(func(inputs []*proto.Content, tm agent.TaskExecutor, o agent.OutputHandler) {
+ "child2": AgentFunc(func(inputs []*proto.Content, tm agent.Executor, o agent.OutputHandler) {
executions.Add(1)
time.Sleep(100 * time.Millisecond)
if o != nil {
- o(&proto.ProcessResponse{
+ o(&proto.AgentOutputs{
Contents: []*proto.Content{text("assistant", "child2 done")},
})
}
@@ -213,10 +206,9 @@ func TestFanout(t *testing.T) {
}
tm := DefaultExecutor(memoryEventLog(), registry)
- if err := tm.Exec(ctx, &agent.Task{
- ID: "root-task",
- AgentID: "root",
- Inputs: []*proto.Content{text("user", "hello!")},
+ if err := tm.Exec(ctx, "root-task", &proto.AgentStart{
+ AgentId: "root",
+ Contents: []*proto.Content{text("user", "hello!")},
}, nil); err != nil {
t.Fatal(err)
}
@@ -235,21 +227,20 @@ func TestConfirmation(t *testing.T) {
confID := "test-conf-id"
var childDone atomic.Bool
registry := map[string]agent.Agent{
- "root": AgentFunc(func(inputs []*proto.Content, tm agent.TaskExecutor, o agent.OutputHandler) {
- if err := tm.Exec(ctx, &agent.Task{
- ID: "child-task",
- AgentID: "child",
- Inputs: inputs,
+ "root": AgentFunc(func(inputs []*proto.Content, tm agent.Executor, o agent.OutputHandler) {
+ if err := tm.Exec(ctx, "child-task", &proto.AgentStart{
+ AgentId: "child",
+ Contents: inputs,
}, o); err != nil {
t.Fatal(err)
}
}),
- "child": AgentFunc(func(inputs []*proto.Content, tm agent.TaskExecutor, o agent.OutputHandler) {
+ "child": AgentFunc(func(inputs []*proto.Content, tm agent.Executor, o agent.OutputHandler) {
if runCount == 0 {
runCount++
log.Println("Asking for the question...")
if o != nil {
- o(&proto.ProcessResponse{
+ o(&proto.AgentOutputs{
Contents: []*proto.Content{{
Content: &proto.Content_Confirmation{
Confirmation: &proto.ConfirmationContent{Id: confID, Question: "proceed?"},
@@ -267,7 +258,7 @@ func TestConfirmation(t *testing.T) {
childDone.Store(true)
if o != nil {
- o(&proto.ProcessResponse{
+ o(&proto.AgentOutputs{
Contents: []*proto.Content{text("assistant", "child done")},
})
}
@@ -277,10 +268,9 @@ func TestConfirmation(t *testing.T) {
tm := DefaultExecutor(eventLog, registry)
// First run: child returns a confirmation request.
- if err := tm.Exec(ctx, &agent.Task{
- ID: "root-task",
- AgentID: "root",
- Inputs: []*proto.Content{text("user", "hello!")},
+ if err := tm.Exec(ctx, "root-task", &proto.AgentStart{
+ AgentId: "root",
+ Contents: []*proto.Content{text("user", "hello!")},
}, nil); err != nil {
t.Fatal(err)
}
@@ -297,10 +287,9 @@ func TestConfirmation(t *testing.T) {
},
},
}
- if err := tm.Exec(ctx, &agent.Task{
- ID: "root-task",
- AgentID: "root",
- Inputs: []*proto.Content{approval},
+ if err := tm.Exec(ctx, "root-task", &proto.AgentStart{
+ AgentId: "root",
+ Contents: []*proto.Content{approval},
}, nil); err != nil {
t.Fatal(err)
}
@@ -315,24 +304,23 @@ func TestResume(t *testing.T) {
eventLog := memoryEventLog()
registry := map[string]agent.Agent{
- "root": AgentFunc(func(inputs []*proto.Content, tm agent.TaskExecutor, o agent.OutputHandler) {
- if err := tm.Exec(ctx, &agent.Task{
- ID: "child-task",
- AgentID: "child",
- Inputs: inputs,
+ "root": AgentFunc(func(inputs []*proto.Content, tm agent.Executor, o agent.OutputHandler) {
+ if err := tm.Exec(ctx, "child-task", &proto.AgentStart{
+ AgentId: "child",
+ Contents: inputs,
}, nil); err != nil {
t.Fatal(err)
}
if o != nil {
- o(&proto.ProcessResponse{
+ o(&proto.AgentOutputs{
Contents: []*proto.Content{text("assistant", "root done")},
})
}
}),
- "child": AgentFunc(func(inputs []*proto.Content, tm agent.TaskExecutor, o agent.OutputHandler) {
+ "child": AgentFunc(func(inputs []*proto.Content, tm agent.Executor, o agent.OutputHandler) {
time.Sleep(100 * time.Millisecond)
if o != nil {
- o(&proto.ProcessResponse{
+ o(&proto.AgentOutputs{
Contents: []*proto.Content{text("assistant", "child done")},
})
}
@@ -340,10 +328,9 @@ func TestResume(t *testing.T) {
}
tm := DefaultExecutor(eventLog, registry)
- if err := tm.Exec(ctx, &agent.Task{
- ID: "root-task",
- AgentID: "root",
- Inputs: []*proto.Content{text("user", "hello!")},
+ if err := tm.Exec(ctx, "root-task", &proto.AgentStart{
+ AgentId: "root",
+ Contents: []*proto.Content{text("user", "hello!")},
}, nil); err != nil {
t.Fatal(err)
}
diff --git a/internal/controller/task/util.go b/internal/controller/task/util.go
index 51ff662..eefed7d 100644
--- a/internal/controller/task/util.go
+++ b/internal/controller/task/util.go
@@ -22,17 +22,17 @@ import (
)
// agentFunc adapts a simple string→string function into the agent.Agent interface.
-type agentFunc func(input []*proto.Content, tm agent.TaskExecutor, o agent.OutputHandler)
+type agentFunc func(input []*proto.Content, tm agent.Executor, o agent.OutputHandler)
-func (f agentFunc) Process(ctx context.Context, t *agent.Task, tm agent.TaskExecutor, o agent.OutputHandler) error {
- f(t.Inputs, tm, o)
+func (f agentFunc) Connect(ctx context.Context, execID string, start *proto.AgentStart, tm agent.Executor, o agent.OutputHandler) error {
+ f(start.Contents, tm, o)
return nil
}
func (f agentFunc) HealthCheck(_ context.Context) error { return nil }
func (f agentFunc) Close() error { return nil }
-func AgentFunc(fn func(input []*proto.Content, tm agent.TaskExecutor, o agent.OutputHandler)) agent.Agent {
+func AgentFunc(fn func(input []*proto.Content, tm agent.Executor, o agent.OutputHandler)) agent.Agent {
return agentFunc(fn)
}
diff --git a/internal/server/server.go b/internal/server/server.go
index a60eac3..3f983fa 100644
--- a/internal/server/server.go
+++ b/internal/server/server.go
@@ -47,17 +47,22 @@ func New(c *controller.Controller) *Server {
// Exec executes a new agentic task with streaming responses.
func (s *Server) Exec(req *proto.ExecRequest, stream grpc.ServerStreamingServer[proto.ExecResponse]) error {
- incoming := &proto.ProcessRequest{
- Contents: req.Inputs,
- }
// Create output handler to stream outputs back to client
- outputHandler := agent.OutputHandler(func(outgoing *proto.ProcessResponse) error {
+ outputHandler := agent.OutputHandler(func(outgoing *proto.AgentOutputs) error {
return stream.Send(&proto.ExecResponse{
Outputs: outgoing.Contents,
})
})
- return s.controller.Exec(
- stream.Context(), req.Id, req.AgentId, req.AgentConfig, incoming, outputHandler)
+ return s.controller.Exec(stream.Context(), &proto.AgentMessage{
+ ExecId: req.Id,
+ Msg: &proto.AgentMessage_Start{
+ Start: &proto.AgentStart{
+ AgentId: req.AgentId,
+ Config: req.AgentConfig,
+ Contents: req.Inputs,
+ },
+ },
+ }, outputHandler)
}
func (s *Server) Fork(ctx context.Context, req *proto.ForkRequest) (*proto.ForkResponse, error) {
diff --git a/internal/testagent/agent.go b/internal/testagent/agent.go
index 3a2c0a6..9fa277e 100644
--- a/internal/testagent/agent.go
+++ b/internal/testagent/agent.go
@@ -27,8 +27,8 @@ func Agents() map[string]agent.Agent {
type CodingAgent struct{}
-// Process handles processing of input content with callback handler.
-func (a *CodingAgent) Process(ctx context.Context, t *agent.Task, e agent.TaskExecutor, o agent.OutputHandler) error {
+// Connect handles processing of input content with callback handler.
+func (a *CodingAgent) Connect(ctx context.Context, execID string, start *proto.AgentStart, e agent.Executor, o agent.OutputHandler) error {
exec := NewExecutor(e, o)
var history []*proto.Content
@@ -43,11 +43,10 @@ func (a *CodingAgent) Process(ctx context.Context, t *agent.Task, e agent.TaskEx
},
},
}
- inputs = append(inputs, t.Inputs...)
- outputs, err := exec.Exec(ctx, &agent.Task{
- ID: "code",
- AgentID: "gemini",
- Inputs: inputs,
+ inputs = append(inputs, start.Contents...)
+ outputs, err := exec.Exec(ctx, "code", &proto.AgentStart{
+ AgentId: "gemini",
+ Contents: inputs,
})
if err != nil {
return err
@@ -56,10 +55,9 @@ func (a *CodingAgent) Process(ctx context.Context, t *agent.Task, e agent.TaskEx
}
{
- outputs, err := exec.Exec(ctx, &agent.Task{
- ID: "docker",
- AgentID: "docker-build",
- Inputs: history,
+ outputs, err := exec.Exec(ctx, "docker", &proto.AgentStart{
+ AgentId: "docker-build",
+ Contents: history,
})
if err != nil {
return err
@@ -74,10 +72,9 @@ func (a *CodingAgent) Process(ctx context.Context, t *agent.Task, e agent.TaskEx
if err != nil {
return err
}
- outputs, err := exec.Exec(ctx, &agent.Task{
- ID: "deploy",
- AgentID: "kubernetes-deploy",
- Inputs: history,
+ outputs, err := exec.Exec(ctx, "deploy", &proto.AgentStart{
+ AgentId: "kubernetes-deploy",
+ Contents: history,
Config: config,
})
if err != nil {
@@ -98,10 +95,9 @@ func (a *CodingAgent) Process(ctx context.Context, t *agent.Task, e agent.TaskEx
if err != nil {
return err
}
- outputs, err := exec.Exec(ctx, &agent.Task{
- ID: "deploy-more",
- AgentID: "kubernetes-deploy",
- Inputs: history,
+ outputs, err := exec.Exec(ctx, "deploy-more", &proto.AgentStart{
+ AgentId: "kubernetes-deploy",
+ Contents: history,
Config: config,
})
if err != nil {
@@ -114,7 +110,7 @@ func (a *CodingAgent) Process(ctx context.Context, t *agent.Task, e agent.TaskEx
}
}
- if err := o(&proto.ProcessResponse{
+ if err := o(&proto.AgentOutputs{
Contents: []*proto.Content{{
Role: "assistant",
Content: &proto.Content_Text{
@@ -136,10 +132,9 @@ func (a *CodingAgent) Process(ctx context.Context, t *agent.Task, e agent.TaskEx
},
},
})
- _, err := exec.Exec(ctx, &agent.Task{
- ID: "summarize",
- AgentID: "gemini",
- Inputs: history,
+ _, err := exec.Exec(ctx, "summarize", &proto.AgentStart{
+ AgentId: "gemini",
+ Contents: history,
})
if err != nil {
return err
@@ -162,17 +157,17 @@ var pendingRegions = make(map[string][]string) // not for production
type KubernetesDeployAgent struct{}
-func (a *KubernetesDeployAgent) Process(ctx context.Context, t *agent.Task, e agent.TaskExecutor, o agent.OutputHandler) error {
+func (a *KubernetesDeployAgent) Connect(ctx context.Context, execID string, start *proto.AgentStart, e agent.Executor, o agent.OutputHandler) error {
exec := NewExecutor(e, o)
- approved, conf := historyutil.HasConfirmationAnswer(t.Inputs)
+ approved, conf := historyutil.HasConfirmationAnswer(start.Contents)
if conf != nil && pendingRegions[conf.Id] != nil {
if !approved {
return nil
}
regions := pendingRegions[conf.Id]
- if err := o(&proto.ProcessResponse{
+ if err := o(&proto.AgentOutputs{
Contents: []*proto.Content{{
Role: "assistant",
Content: &proto.Content_Text{
@@ -187,10 +182,9 @@ func (a *KubernetesDeployAgent) Process(ctx context.Context, t *agent.Task, e ag
for _, region := range regions {
if region != "us-central1" {
- _, err := exec.Exec(ctx, &agent.Task{
- ID: "mirror-" + region,
- AgentID: "docker-mirror",
- Inputs: []*proto.Content{
+ _, err := exec.Exec(ctx, "mirror-" + region, &proto.AgentStart{
+ AgentId: "docker-mirror",
+ Contents: []*proto.Content{
{
Role: "user",
Content: &proto.Content_Text{
@@ -205,7 +199,7 @@ func (a *KubernetesDeployAgent) Process(ctx context.Context, t *agent.Task, e ag
return err
}
}
- if err := o(&proto.ProcessResponse{
+ if err := o(&proto.AgentOutputs{
Contents: []*proto.Content{{
Role: "assistant",
Content: &proto.Content_Text{
@@ -217,7 +211,7 @@ func (a *KubernetesDeployAgent) Process(ctx context.Context, t *agent.Task, e ag
}); err != nil {
return err
}
- if err := o(&proto.ProcessResponse{
+ if err := o(&proto.AgentOutputs{
Contents: []*proto.Content{{
Role: "assistant",
Content: &proto.Content_Text{
@@ -231,7 +225,7 @@ func (a *KubernetesDeployAgent) Process(ctx context.Context, t *agent.Task, e ag
}
time.Sleep(1500 * time.Millisecond)
- if err := o(&proto.ProcessResponse{
+ if err := o(&proto.AgentOutputs{
Contents: []*proto.Content{{
Role: "assistant",
Content: &proto.Content_Text{
@@ -248,11 +242,11 @@ func (a *KubernetesDeployAgent) Process(ctx context.Context, t *agent.Task, e ag
return nil
}
- if t.Config == nil {
- return fmt.Errorf("no config for id=%v", t.ID)
+ if start.Config == nil {
+ return fmt.Errorf("no config for id=%v", execID)
}
var config testagentpb.KubernetesDeployAgentConfig
- if err := t.Config.UnmarshalTo(&config); err != nil {
+ if err := start.Config.UnmarshalTo(&config); err != nil {
return err
}
if len(config.Regions) == 0 {
@@ -261,7 +255,7 @@ func (a *KubernetesDeployAgent) Process(ctx context.Context, t *agent.Task, e ag
confID := uuid.NewString()
pendingRegions[confID] = config.Regions
- return o(&proto.ProcessResponse{
+ return o(&proto.AgentOutputs{
Contents: []*proto.Content{{
Role: "assistant",
Content: &proto.Content_Confirmation{
@@ -284,27 +278,27 @@ func (a *KubernetesDeployAgent) Close() error {
}
type Executor struct {
- exec agent.TaskExecutor
+ exec agent.Executor
handler agent.OutputHandler
}
-func NewExecutor(e agent.TaskExecutor, o agent.OutputHandler) *Executor {
+func NewExecutor(e agent.Executor, o agent.OutputHandler) *Executor {
return &Executor{
exec: e,
handler: o,
}
}
-func (e *Executor) Exec(ctx context.Context, t *agent.Task) ([]*proto.Content, error) {
+func (e *Executor) Exec(ctx context.Context, execID string, start *proto.AgentStart) ([]*proto.Content, error) {
var outputs []*proto.Content
- if t.ID == "" {
+ if execID == "" {
var err error
- t.ID, err = randomHex(8)
+ execID, err = randomHex(8)
if err != nil {
return nil, err
}
}
- if err := e.exec.Exec(ctx, t, func(resp *proto.ProcessResponse) error {
+ if err := e.exec.Exec(ctx, execID, start, func(resp *proto.AgentOutputs) error {
outputs = append(outputs, resp.Contents...)
return e.handler(resp)
}); err != nil {
diff --git a/internal/testagent/docker.go b/internal/testagent/docker.go
index 713a719..5496231 100644
--- a/internal/testagent/docker.go
+++ b/internal/testagent/docker.go
@@ -10,8 +10,8 @@ import (
type DockerBuilderAgent struct{}
-func (a *DockerBuilderAgent) Process(ctx context.Context, t *agent.Task, e agent.TaskExecutor, o agent.OutputHandler) error {
- o(&proto.ProcessResponse{
+func (a *DockerBuilderAgent) Connect(ctx context.Context, execID string, start *proto.AgentStart, e agent.Executor, o agent.OutputHandler) error {
+ o(&proto.AgentOutputs{
Contents: []*proto.Content{{
Role: "assistant",
Content: &proto.Content_Text{
@@ -23,7 +23,7 @@ func (a *DockerBuilderAgent) Process(ctx context.Context, t *agent.Task, e agent
})
time.Sleep(500 * time.Millisecond)
- o(&proto.ProcessResponse{
+ o(&proto.AgentOutputs{
Contents: []*proto.Content{{
Role: "assistant",
Content: &proto.Content_Text{
@@ -35,7 +35,7 @@ func (a *DockerBuilderAgent) Process(ctx context.Context, t *agent.Task, e agent
})
time.Sleep(1000 * time.Millisecond)
- o(&proto.ProcessResponse{
+ o(&proto.AgentOutputs{
Contents: []*proto.Content{{
Role: "assistant",
Content: &proto.Content_Text{
@@ -59,8 +59,8 @@ func (a *DockerBuilderAgent) Close() error {
type DockerMirrorAgent struct{}
-func (a *DockerMirrorAgent) Process(ctx context.Context, t *agent.Task, e agent.TaskExecutor, o agent.OutputHandler) error {
- o(&proto.ProcessResponse{
+func (a *DockerMirrorAgent) Connect(ctx context.Context, execID string, start *proto.AgentStart, e agent.Executor, o agent.OutputHandler) error {
+ o(&proto.AgentOutputs{
Contents: []*proto.Content{{
Role: "assistant",
Content: &proto.Content_Text{
@@ -72,7 +72,7 @@ func (a *DockerMirrorAgent) Process(ctx context.Context, t *agent.Task, e agent.
})
time.Sleep(2000 * time.Millisecond)
- o(&proto.ProcessResponse{
+ o(&proto.AgentOutputs{
Contents: []*proto.Content{{
Role: "assistant",
Content: &proto.Content_Text{
diff --git a/internal/testagent/proto/testagent.pb.go b/internal/testagent/proto/testagent.pb.go
index e3711ff..e3b569d 100644
--- a/internal/testagent/proto/testagent.pb.go
+++ b/internal/testagent/proto/testagent.pb.go
@@ -14,8 +14,8 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
-// protoc-gen-go v1.35.1
-// protoc v5.28.2
+// protoc-gen-go v1.36.11
+// protoc v3.21.9
// source: internal/testagent/proto/testagent.proto
package proto
@@ -25,6 +25,7 @@ import (
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
+ unsafe "unsafe"
)
const (
@@ -35,11 +36,10 @@ const (
)
type KubernetesDeployAgentConfig struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Regions []string `protobuf:"bytes,1,rep,name=regions,proto3" json:"regions,omitempty"`
unknownFields protoimpl.UnknownFields
-
- Regions []string `protobuf:"bytes,1,rep,name=regions,proto3" json:"regions,omitempty"`
+ sizeCache protoimpl.SizeCache
}
func (x *KubernetesDeployAgentConfig) Reset() {
@@ -81,28 +81,20 @@ func (x *KubernetesDeployAgentConfig) GetRegions() []string {
var File_internal_testagent_proto_testagent_proto protoreflect.FileDescriptor
-var file_internal_testagent_proto_testagent_proto_rawDesc = []byte{
- 0x0a, 0x28, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x61,
- 0x67, 0x65, 0x6e, 0x74, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x61,
- 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x70, 0x72, 0x6f, 0x74,
- 0x6f, 0x22, 0x37, 0x0a, 0x1b, 0x4b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x44,
- 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
- 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28,
- 0x09, 0x52, 0x07, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x2f, 0x5a, 0x2d, 0x67, 0x69,
- 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f,
- 0x61, 0x78, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74,
- 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f,
- 0x74, 0x6f, 0x33,
-}
+const file_internal_testagent_proto_testagent_proto_rawDesc = "" +
+ "\n" +
+ "(internal/testagent/proto/testagent.proto\x12\x05proto\"7\n" +
+ "\x1bKubernetesDeployAgentConfig\x12\x18\n" +
+ "\aregions\x18\x01 \x03(\tR\aregionsB/Z-github.com/google/ax/internal/testagent/protob\x06proto3"
var (
file_internal_testagent_proto_testagent_proto_rawDescOnce sync.Once
- file_internal_testagent_proto_testagent_proto_rawDescData = file_internal_testagent_proto_testagent_proto_rawDesc
+ file_internal_testagent_proto_testagent_proto_rawDescData []byte
)
func file_internal_testagent_proto_testagent_proto_rawDescGZIP() []byte {
file_internal_testagent_proto_testagent_proto_rawDescOnce.Do(func() {
- file_internal_testagent_proto_testagent_proto_rawDescData = protoimpl.X.CompressGZIP(file_internal_testagent_proto_testagent_proto_rawDescData)
+ file_internal_testagent_proto_testagent_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_internal_testagent_proto_testagent_proto_rawDesc), len(file_internal_testagent_proto_testagent_proto_rawDesc)))
})
return file_internal_testagent_proto_testagent_proto_rawDescData
}
@@ -128,7 +120,7 @@ func file_internal_testagent_proto_testagent_proto_init() {
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
- RawDescriptor: file_internal_testagent_proto_testagent_proto_rawDesc,
+ RawDescriptor: unsafe.Slice(unsafe.StringData(file_internal_testagent_proto_testagent_proto_rawDesc), len(file_internal_testagent_proto_testagent_proto_rawDesc)),
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
@@ -139,7 +131,6 @@ func file_internal_testagent_proto_testagent_proto_init() {
MessageInfos: file_internal_testagent_proto_testagent_proto_msgTypes,
}.Build()
File_internal_testagent_proto_testagent_proto = out.File
- file_internal_testagent_proto_testagent_proto_rawDesc = nil
file_internal_testagent_proto_testagent_proto_goTypes = nil
file_internal_testagent_proto_testagent_proto_depIdxs = nil
}
diff --git a/proto/ax.pb.go b/proto/ax.pb.go
index 7f32e25..d5c8487 100644
--- a/proto/ax.pb.go
+++ b/proto/ax.pb.go
@@ -14,8 +14,8 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
-// protoc-gen-go v1.35.1
-// protoc v5.28.2
+// protoc-gen-go v1.36.11
+// protoc v3.21.9
// source: proto/ax.proto
package proto
@@ -29,6 +29,7 @@ import (
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
reflect "reflect"
sync "sync"
+ unsafe "unsafe"
)
const (
@@ -91,29 +92,29 @@ func (State) EnumDescriptor() ([]byte, []int) {
return file_proto_ax_proto_rawDescGZIP(), []int{0}
}
-// ProcessRequest is an input to an agent.
-type ProcessRequest struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
+type AgentStart struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"`
+ Config *anypb.Any `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"`
+ Contents []*Content `protobuf:"bytes,3,rep,name=contents,proto3" json:"contents,omitempty"`
unknownFields protoimpl.UnknownFields
-
- Contents []*Content `protobuf:"bytes,1,rep,name=contents,proto3" json:"contents,omitempty"`
+ sizeCache protoimpl.SizeCache
}
-func (x *ProcessRequest) Reset() {
- *x = ProcessRequest{}
+func (x *AgentStart) Reset() {
+ *x = AgentStart{}
mi := &file_proto_ax_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
-func (x *ProcessRequest) String() string {
+func (x *AgentStart) String() string {
return protoimpl.X.MessageStringOf(x)
}
-func (*ProcessRequest) ProtoMessage() {}
+func (*AgentStart) ProtoMessage() {}
-func (x *ProcessRequest) ProtoReflect() protoreflect.Message {
+func (x *AgentStart) ProtoReflect() protoreflect.Message {
mi := &file_proto_ax_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -125,43 +126,54 @@ func (x *ProcessRequest) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
-// Deprecated: Use ProcessRequest.ProtoReflect.Descriptor instead.
-func (*ProcessRequest) Descriptor() ([]byte, []int) {
+// Deprecated: Use AgentStart.ProtoReflect.Descriptor instead.
+func (*AgentStart) Descriptor() ([]byte, []int) {
return file_proto_ax_proto_rawDescGZIP(), []int{0}
}
-func (x *ProcessRequest) GetContents() []*Content {
+func (x *AgentStart) GetAgentId() string {
+ if x != nil {
+ return x.AgentId
+ }
+ return ""
+}
+
+func (x *AgentStart) GetConfig() *anypb.Any {
+ if x != nil {
+ return x.Config
+ }
+ return nil
+}
+
+func (x *AgentStart) GetContents() []*Content {
if x != nil {
return x.Contents
}
return nil
}
-// ProcessResponse is an output from an agent.
-// It can be returned in a streaming fashion.
-type ProcessResponse struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
+type AgentOutputs struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Contents []*Content `protobuf:"bytes,1,rep,name=contents,proto3" json:"contents,omitempty"`
+ CheckpointId string `protobuf:"bytes,2,opt,name=checkpoint_id,json=checkpointId,proto3" json:"checkpoint_id,omitempty"` // TODO: Add awaiting_more field.
unknownFields protoimpl.UnknownFields
-
- CheckpointId string `protobuf:"bytes,1,opt,name=checkpoint_id,json=checkpointId,proto3" json:"checkpoint_id,omitempty"`
- Contents []*Content `protobuf:"bytes,2,rep,name=contents,proto3" json:"contents,omitempty"`
+ sizeCache protoimpl.SizeCache
}
-func (x *ProcessResponse) Reset() {
- *x = ProcessResponse{}
+func (x *AgentOutputs) Reset() {
+ *x = AgentOutputs{}
mi := &file_proto_ax_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
-func (x *ProcessResponse) String() string {
+func (x *AgentOutputs) String() string {
return protoimpl.X.MessageStringOf(x)
}
-func (*ProcessResponse) ProtoMessage() {}
+func (*AgentOutputs) ProtoMessage() {}
-func (x *ProcessResponse) ProtoReflect() protoreflect.Message {
+func (x *AgentOutputs) ProtoReflect() protoreflect.Message {
mi := &file_proto_ax_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -173,37 +185,126 @@ func (x *ProcessResponse) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
-// Deprecated: Use ProcessResponse.ProtoReflect.Descriptor instead.
-func (*ProcessResponse) Descriptor() ([]byte, []int) {
+// Deprecated: Use AgentOutputs.ProtoReflect.Descriptor instead.
+func (*AgentOutputs) Descriptor() ([]byte, []int) {
return file_proto_ax_proto_rawDescGZIP(), []int{1}
}
-func (x *ProcessResponse) GetCheckpointId() string {
+func (x *AgentOutputs) GetContents() []*Content {
+ if x != nil {
+ return x.Contents
+ }
+ return nil
+}
+
+func (x *AgentOutputs) GetCheckpointId() string {
if x != nil {
return x.CheckpointId
}
return ""
}
-func (x *ProcessResponse) GetContents() []*Content {
+type AgentMessage struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ ExecId string `protobuf:"bytes,1,opt,name=exec_id,json=execId,proto3" json:"exec_id,omitempty"`
+ // Types that are valid to be assigned to Msg:
+ //
+ // *AgentMessage_Start
+ // *AgentMessage_Outputs
+ Msg isAgentMessage_Msg `protobuf_oneof:"msg"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *AgentMessage) Reset() {
+ *x = AgentMessage{}
+ mi := &file_proto_ax_proto_msgTypes[2]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *AgentMessage) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*AgentMessage) ProtoMessage() {}
+
+func (x *AgentMessage) ProtoReflect() protoreflect.Message {
+ mi := &file_proto_ax_proto_msgTypes[2]
if x != nil {
- return x.Contents
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use AgentMessage.ProtoReflect.Descriptor instead.
+func (*AgentMessage) Descriptor() ([]byte, []int) {
+ return file_proto_ax_proto_rawDescGZIP(), []int{2}
+}
+
+func (x *AgentMessage) GetExecId() string {
+ if x != nil {
+ return x.ExecId
+ }
+ return ""
+}
+
+func (x *AgentMessage) GetMsg() isAgentMessage_Msg {
+ if x != nil {
+ return x.Msg
+ }
+ return nil
+}
+
+func (x *AgentMessage) GetStart() *AgentStart {
+ if x != nil {
+ if x, ok := x.Msg.(*AgentMessage_Start); ok {
+ return x.Start
+ }
+ }
+ return nil
+}
+
+func (x *AgentMessage) GetOutputs() *AgentOutputs {
+ if x != nil {
+ if x, ok := x.Msg.(*AgentMessage_Outputs); ok {
+ return x.Outputs
+ }
}
return nil
}
+type isAgentMessage_Msg interface {
+ isAgentMessage_Msg()
+}
+
+type AgentMessage_Start struct {
+ Start *AgentStart `protobuf:"bytes,2,opt,name=start,proto3,oneof"`
+}
+
+type AgentMessage_Outputs struct {
+ Outputs *AgentOutputs `protobuf:"bytes,3,opt,name=outputs,proto3,oneof"`
+}
+
+func (*AgentMessage_Start) isAgentMessage_Msg() {}
+
+func (*AgentMessage_Outputs) isAgentMessage_Msg() {}
+
// TextContent represents a text content.
type TextContent struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Text string `protobuf:"bytes,3,opt,name=text,proto3" json:"text,omitempty"`
unknownFields protoimpl.UnknownFields
-
- Text string `protobuf:"bytes,3,opt,name=text,proto3" json:"text,omitempty"`
+ sizeCache protoimpl.SizeCache
}
func (x *TextContent) Reset() {
*x = TextContent{}
- mi := &file_proto_ax_proto_msgTypes[2]
+ mi := &file_proto_ax_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -215,7 +316,7 @@ func (x *TextContent) String() string {
func (*TextContent) ProtoMessage() {}
func (x *TextContent) ProtoReflect() protoreflect.Message {
- mi := &file_proto_ax_proto_msgTypes[2]
+ mi := &file_proto_ax_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -228,7 +329,7 @@ func (x *TextContent) ProtoReflect() protoreflect.Message {
// Deprecated: Use TextContent.ProtoReflect.Descriptor instead.
func (*TextContent) Descriptor() ([]byte, []int) {
- return file_proto_ax_proto_rawDescGZIP(), []int{2}
+ return file_proto_ax_proto_rawDescGZIP(), []int{3}
}
func (x *TextContent) GetText() string {
@@ -239,16 +340,15 @@ func (x *TextContent) GetText() string {
}
type ApprovalDecision struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Approved bool `protobuf:"varint,1,opt,name=approved,proto3" json:"approved,omitempty"`
unknownFields protoimpl.UnknownFields
-
- Approved bool `protobuf:"varint,1,opt,name=approved,proto3" json:"approved,omitempty"`
+ sizeCache protoimpl.SizeCache
}
func (x *ApprovalDecision) Reset() {
*x = ApprovalDecision{}
- mi := &file_proto_ax_proto_msgTypes[3]
+ mi := &file_proto_ax_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -260,7 +360,7 @@ func (x *ApprovalDecision) String() string {
func (*ApprovalDecision) ProtoMessage() {}
func (x *ApprovalDecision) ProtoReflect() protoreflect.Message {
- mi := &file_proto_ax_proto_msgTypes[3]
+ mi := &file_proto_ax_proto_msgTypes[4]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -273,7 +373,7 @@ func (x *ApprovalDecision) ProtoReflect() protoreflect.Message {
// Deprecated: Use ApprovalDecision.ProtoReflect.Descriptor instead.
func (*ApprovalDecision) Descriptor() ([]byte, []int) {
- return file_proto_ax_proto_rawDescGZIP(), []int{3}
+ return file_proto_ax_proto_rawDescGZIP(), []int{4}
}
func (x *ApprovalDecision) GetApproved() bool {
@@ -284,16 +384,15 @@ func (x *ApprovalDecision) GetApproved() bool {
}
type DeclineDecision struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Declined bool `protobuf:"varint,1,opt,name=declined,proto3" json:"declined,omitempty"`
unknownFields protoimpl.UnknownFields
-
- Declined bool `protobuf:"varint,1,opt,name=declined,proto3" json:"declined,omitempty"`
+ sizeCache protoimpl.SizeCache
}
func (x *DeclineDecision) Reset() {
*x = DeclineDecision{}
- mi := &file_proto_ax_proto_msgTypes[4]
+ mi := &file_proto_ax_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -305,7 +404,7 @@ func (x *DeclineDecision) String() string {
func (*DeclineDecision) ProtoMessage() {}
func (x *DeclineDecision) ProtoReflect() protoreflect.Message {
- mi := &file_proto_ax_proto_msgTypes[4]
+ mi := &file_proto_ax_proto_msgTypes[5]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -318,7 +417,7 @@ func (x *DeclineDecision) ProtoReflect() protoreflect.Message {
// Deprecated: Use DeclineDecision.ProtoReflect.Descriptor instead.
func (*DeclineDecision) Descriptor() ([]byte, []int) {
- return file_proto_ax_proto_rawDescGZIP(), []int{4}
+ return file_proto_ax_proto_rawDescGZIP(), []int{5}
}
func (x *DeclineDecision) GetDeclined() bool {
@@ -329,22 +428,21 @@ func (x *DeclineDecision) GetDeclined() bool {
}
type ConfirmationContent struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- Id string `protobuf:"bytes,3,opt,name=id,proto3" json:"id,omitempty"`
- Question string `protobuf:"bytes,4,opt,name=question,proto3" json:"question,omitempty"`
- // Types that are assignable to Decision:
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Id string `protobuf:"bytes,3,opt,name=id,proto3" json:"id,omitempty"`
+ Question string `protobuf:"bytes,4,opt,name=question,proto3" json:"question,omitempty"`
+ // Types that are valid to be assigned to Decision:
//
// *ConfirmationContent_Approval
// *ConfirmationContent_Decline
- Decision isConfirmationContent_Decision `protobuf_oneof:"decision"`
+ Decision isConfirmationContent_Decision `protobuf_oneof:"decision"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *ConfirmationContent) Reset() {
*x = ConfirmationContent{}
- mi := &file_proto_ax_proto_msgTypes[5]
+ mi := &file_proto_ax_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -356,7 +454,7 @@ func (x *ConfirmationContent) String() string {
func (*ConfirmationContent) ProtoMessage() {}
func (x *ConfirmationContent) ProtoReflect() protoreflect.Message {
- mi := &file_proto_ax_proto_msgTypes[5]
+ mi := &file_proto_ax_proto_msgTypes[6]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -369,7 +467,7 @@ func (x *ConfirmationContent) ProtoReflect() protoreflect.Message {
// Deprecated: Use ConfirmationContent.ProtoReflect.Descriptor instead.
func (*ConfirmationContent) Descriptor() ([]byte, []int) {
- return file_proto_ax_proto_rawDescGZIP(), []int{5}
+ return file_proto_ax_proto_rawDescGZIP(), []int{6}
}
func (x *ConfirmationContent) GetId() string {
@@ -386,23 +484,27 @@ func (x *ConfirmationContent) GetQuestion() string {
return ""
}
-func (m *ConfirmationContent) GetDecision() isConfirmationContent_Decision {
- if m != nil {
- return m.Decision
+func (x *ConfirmationContent) GetDecision() isConfirmationContent_Decision {
+ if x != nil {
+ return x.Decision
}
return nil
}
func (x *ConfirmationContent) GetApproval() *ApprovalDecision {
- if x, ok := x.GetDecision().(*ConfirmationContent_Approval); ok {
- return x.Approval
+ if x != nil {
+ if x, ok := x.Decision.(*ConfirmationContent_Approval); ok {
+ return x.Approval
+ }
}
return nil
}
func (x *ConfirmationContent) GetDecline() *DeclineDecision {
- if x, ok := x.GetDecision().(*ConfirmationContent_Decline); ok {
- return x.Decline
+ if x != nil {
+ if x, ok := x.Decision.(*ConfirmationContent_Decline); ok {
+ return x.Decline
+ }
}
return nil
}
@@ -424,19 +526,18 @@ func (*ConfirmationContent_Approval) isConfirmationContent_Decision() {}
func (*ConfirmationContent_Decline) isConfirmationContent_Decision() {}
type FunctionCallContent struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- Args *structpb.Struct `protobuf:"bytes,2,opt,name=args,proto3" json:"args,omitempty"`
- Id string `protobuf:"bytes,3,opt,name=id,proto3" json:"id,omitempty"`
- ThoughtSignature []byte `protobuf:"bytes,4,opt,name=thought_signature,json=thoughtSignature,proto3" json:"thought_signature,omitempty"`
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+ Args *structpb.Struct `protobuf:"bytes,2,opt,name=args,proto3" json:"args,omitempty"`
+ Id string `protobuf:"bytes,3,opt,name=id,proto3" json:"id,omitempty"`
+ ThoughtSignature []byte `protobuf:"bytes,4,opt,name=thought_signature,json=thoughtSignature,proto3" json:"thought_signature,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *FunctionCallContent) Reset() {
*x = FunctionCallContent{}
- mi := &file_proto_ax_proto_msgTypes[6]
+ mi := &file_proto_ax_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -448,7 +549,7 @@ func (x *FunctionCallContent) String() string {
func (*FunctionCallContent) ProtoMessage() {}
func (x *FunctionCallContent) ProtoReflect() protoreflect.Message {
- mi := &file_proto_ax_proto_msgTypes[6]
+ mi := &file_proto_ax_proto_msgTypes[7]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -461,7 +562,7 @@ func (x *FunctionCallContent) ProtoReflect() protoreflect.Message {
// Deprecated: Use FunctionCallContent.ProtoReflect.Descriptor instead.
func (*FunctionCallContent) Descriptor() ([]byte, []int) {
- return file_proto_ax_proto_rawDescGZIP(), []int{6}
+ return file_proto_ax_proto_rawDescGZIP(), []int{7}
}
func (x *FunctionCallContent) GetName() string {
@@ -493,18 +594,17 @@ func (x *FunctionCallContent) GetThoughtSignature() []byte {
}
type FunctionResponseContent struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+ Response *structpb.Struct `protobuf:"bytes,2,opt,name=response,proto3" json:"response,omitempty"`
+ Id string `protobuf:"bytes,3,opt,name=id,proto3" json:"id,omitempty"`
unknownFields protoimpl.UnknownFields
-
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- Response *structpb.Struct `protobuf:"bytes,2,opt,name=response,proto3" json:"response,omitempty"`
- Id string `protobuf:"bytes,3,opt,name=id,proto3" json:"id,omitempty"`
+ sizeCache protoimpl.SizeCache
}
func (x *FunctionResponseContent) Reset() {
*x = FunctionResponseContent{}
- mi := &file_proto_ax_proto_msgTypes[7]
+ mi := &file_proto_ax_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -516,7 +616,7 @@ func (x *FunctionResponseContent) String() string {
func (*FunctionResponseContent) ProtoMessage() {}
func (x *FunctionResponseContent) ProtoReflect() protoreflect.Message {
- mi := &file_proto_ax_proto_msgTypes[7]
+ mi := &file_proto_ax_proto_msgTypes[8]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -529,7 +629,7 @@ func (x *FunctionResponseContent) ProtoReflect() protoreflect.Message {
// Deprecated: Use FunctionResponseContent.ProtoReflect.Descriptor instead.
func (*FunctionResponseContent) Descriptor() ([]byte, []int) {
- return file_proto_ax_proto_rawDescGZIP(), []int{7}
+ return file_proto_ax_proto_rawDescGZIP(), []int{8}
}
func (x *FunctionResponseContent) GetName() string {
@@ -555,23 +655,22 @@ func (x *FunctionResponseContent) GetId() string {
// Content represents a message with role, type, mimetype, and data fields
type Content struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- // Types that are assignable to Content:
+ state protoimpl.MessageState `protogen:"open.v1"`
+ // Types that are valid to be assigned to Content:
//
// *Content_Text
// *Content_Confirmation
// *Content_FunctionCall
// *Content_FunctionResponse
- Content isContent_Content `protobuf_oneof:"content"`
- Role string `protobuf:"bytes,1000,opt,name=role,proto3" json:"role,omitempty"` // The role of the content (e.g., "user", "assistant", "system")
+ Content isContent_Content `protobuf_oneof:"content"`
+ Role string `protobuf:"bytes,1000,opt,name=role,proto3" json:"role,omitempty"` // The role of the content (e.g., "user", "assistant", "system")
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *Content) Reset() {
*x = Content{}
- mi := &file_proto_ax_proto_msgTypes[8]
+ mi := &file_proto_ax_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -583,7 +682,7 @@ func (x *Content) String() string {
func (*Content) ProtoMessage() {}
func (x *Content) ProtoReflect() protoreflect.Message {
- mi := &file_proto_ax_proto_msgTypes[8]
+ mi := &file_proto_ax_proto_msgTypes[9]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -596,40 +695,48 @@ func (x *Content) ProtoReflect() protoreflect.Message {
// Deprecated: Use Content.ProtoReflect.Descriptor instead.
func (*Content) Descriptor() ([]byte, []int) {
- return file_proto_ax_proto_rawDescGZIP(), []int{8}
+ return file_proto_ax_proto_rawDescGZIP(), []int{9}
}
-func (m *Content) GetContent() isContent_Content {
- if m != nil {
- return m.Content
+func (x *Content) GetContent() isContent_Content {
+ if x != nil {
+ return x.Content
}
return nil
}
func (x *Content) GetText() *TextContent {
- if x, ok := x.GetContent().(*Content_Text); ok {
- return x.Text
+ if x != nil {
+ if x, ok := x.Content.(*Content_Text); ok {
+ return x.Text
+ }
}
return nil
}
func (x *Content) GetConfirmation() *ConfirmationContent {
- if x, ok := x.GetContent().(*Content_Confirmation); ok {
- return x.Confirmation
+ if x != nil {
+ if x, ok := x.Content.(*Content_Confirmation); ok {
+ return x.Confirmation
+ }
}
return nil
}
func (x *Content) GetFunctionCall() *FunctionCallContent {
- if x, ok := x.GetContent().(*Content_FunctionCall); ok {
- return x.FunctionCall
+ if x != nil {
+ if x, ok := x.Content.(*Content_FunctionCall); ok {
+ return x.FunctionCall
+ }
}
return nil
}
func (x *Content) GetFunctionResponse() *FunctionResponseContent {
- if x, ok := x.GetContent().(*Content_FunctionResponse); ok {
- return x.FunctionResponse
+ if x != nil {
+ if x, ok := x.Content.(*Content_FunctionResponse); ok {
+ return x.FunctionResponse
+ }
}
return nil
}
@@ -673,21 +780,20 @@ func (*Content_FunctionResponse) isContent_Content() {}
// to record the actions taken place in the executor.
// The executor can replay the events for resumability.
type ExecutionEvent struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
+ state protoimpl.MessageState `protogen:"open.v1"`
+ ExecId string `protobuf:"bytes,1,opt,name=exec_id,json=execId,proto3" json:"exec_id,omitempty"`
+ AgentId string `protobuf:"bytes,2,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"`
+ Inputs []*Content `protobuf:"bytes,3,rep,name=inputs,proto3" json:"inputs,omitempty"`
+ Outputs []*Content `protobuf:"bytes,4,rep,name=outputs,proto3" json:"outputs,omitempty"`
+ State State `protobuf:"varint,5,opt,name=state,proto3,enum=proto.State" json:"state,omitempty"`
+ Timestamp *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // string checkpoint_id = 10;
unknownFields protoimpl.UnknownFields
-
- TaskId string `protobuf:"bytes,2,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
- AgentId string `protobuf:"bytes,3,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"`
- Inputs []*Content `protobuf:"bytes,4,rep,name=inputs,proto3" json:"inputs,omitempty"`
- Outputs []*Content `protobuf:"bytes,5,rep,name=outputs,proto3" json:"outputs,omitempty"`
- State State `protobuf:"varint,6,opt,name=state,proto3,enum=proto.State" json:"state,omitempty"`
- Timestamp *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // string checkpoint_id = 10;
+ sizeCache protoimpl.SizeCache
}
func (x *ExecutionEvent) Reset() {
*x = ExecutionEvent{}
- mi := &file_proto_ax_proto_msgTypes[9]
+ mi := &file_proto_ax_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -699,7 +805,7 @@ func (x *ExecutionEvent) String() string {
func (*ExecutionEvent) ProtoMessage() {}
func (x *ExecutionEvent) ProtoReflect() protoreflect.Message {
- mi := &file_proto_ax_proto_msgTypes[9]
+ mi := &file_proto_ax_proto_msgTypes[10]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -712,12 +818,12 @@ func (x *ExecutionEvent) ProtoReflect() protoreflect.Message {
// Deprecated: Use ExecutionEvent.ProtoReflect.Descriptor instead.
func (*ExecutionEvent) Descriptor() ([]byte, []int) {
- return file_proto_ax_proto_rawDescGZIP(), []int{9}
+ return file_proto_ax_proto_rawDescGZIP(), []int{10}
}
-func (x *ExecutionEvent) GetTaskId() string {
+func (x *ExecutionEvent) GetExecId() string {
if x != nil {
- return x.TaskId
+ return x.ExecId
}
return ""
}
@@ -759,14 +865,14 @@ func (x *ExecutionEvent) GetTimestamp() *timestamppb.Timestamp {
// HealthCheckRequest for agent health checks
type HealthCheckRequest struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
+ state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *HealthCheckRequest) Reset() {
*x = HealthCheckRequest{}
- mi := &file_proto_ax_proto_msgTypes[10]
+ mi := &file_proto_ax_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -778,7 +884,7 @@ func (x *HealthCheckRequest) String() string {
func (*HealthCheckRequest) ProtoMessage() {}
func (x *HealthCheckRequest) ProtoReflect() protoreflect.Message {
- mi := &file_proto_ax_proto_msgTypes[10]
+ mi := &file_proto_ax_proto_msgTypes[11]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -791,22 +897,21 @@ func (x *HealthCheckRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use HealthCheckRequest.ProtoReflect.Descriptor instead.
func (*HealthCheckRequest) Descriptor() ([]byte, []int) {
- return file_proto_ax_proto_rawDescGZIP(), []int{10}
+ return file_proto_ax_proto_rawDescGZIP(), []int{11}
}
// HealthCheckResponse contains agent health status
type HealthCheckResponse struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Healthy bool `protobuf:"varint,1,opt,name=healthy,proto3" json:"healthy,omitempty"`
+ Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
unknownFields protoimpl.UnknownFields
-
- Healthy bool `protobuf:"varint,1,opt,name=healthy,proto3" json:"healthy,omitempty"`
- Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
+ sizeCache protoimpl.SizeCache
}
func (x *HealthCheckResponse) Reset() {
*x = HealthCheckResponse{}
- mi := &file_proto_ax_proto_msgTypes[11]
+ mi := &file_proto_ax_proto_msgTypes[12]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -818,7 +923,7 @@ func (x *HealthCheckResponse) String() string {
func (*HealthCheckResponse) ProtoMessage() {}
func (x *HealthCheckResponse) ProtoReflect() protoreflect.Message {
- mi := &file_proto_ax_proto_msgTypes[11]
+ mi := &file_proto_ax_proto_msgTypes[12]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -831,7 +936,7 @@ func (x *HealthCheckResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use HealthCheckResponse.ProtoReflect.Descriptor instead.
func (*HealthCheckResponse) Descriptor() ([]byte, []int) {
- return file_proto_ax_proto_rawDescGZIP(), []int{11}
+ return file_proto_ax_proto_rawDescGZIP(), []int{12}
}
func (x *HealthCheckResponse) GetHealthy() bool {
@@ -850,19 +955,18 @@ func (x *HealthCheckResponse) GetMessage() string {
// ExecRequest for executing.
type ExecRequest struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Unique execution identifier
+ AgentId string `protobuf:"bytes,2,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` // Agent ID, if empty planner is used
+ AgentConfig *anypb.Any `protobuf:"bytes,3,opt,name=agent_config,json=agentConfig,proto3" json:"agent_config,omitempty"` // Agent configuration if any
+ Inputs []*Content `protobuf:"bytes,4,rep,name=inputs,proto3" json:"inputs,omitempty"` // Input content to process
unknownFields protoimpl.UnknownFields
-
- Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Unique execution identifier
- AgentId string `protobuf:"bytes,2,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` // Agent ID, if empty planner is used
- AgentConfig *anypb.Any `protobuf:"bytes,3,opt,name=agent_config,json=agentConfig,proto3" json:"agent_config,omitempty"` // Agent configuration if any
- Inputs []*Content `protobuf:"bytes,4,rep,name=inputs,proto3" json:"inputs,omitempty"` // Input content to process
+ sizeCache protoimpl.SizeCache
}
func (x *ExecRequest) Reset() {
*x = ExecRequest{}
- mi := &file_proto_ax_proto_msgTypes[12]
+ mi := &file_proto_ax_proto_msgTypes[13]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -874,7 +978,7 @@ func (x *ExecRequest) String() string {
func (*ExecRequest) ProtoMessage() {}
func (x *ExecRequest) ProtoReflect() protoreflect.Message {
- mi := &file_proto_ax_proto_msgTypes[12]
+ mi := &file_proto_ax_proto_msgTypes[13]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -887,7 +991,7 @@ func (x *ExecRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use ExecRequest.ProtoReflect.Descriptor instead.
func (*ExecRequest) Descriptor() ([]byte, []int) {
- return file_proto_ax_proto_rawDescGZIP(), []int{12}
+ return file_proto_ax_proto_rawDescGZIP(), []int{13}
}
func (x *ExecRequest) GetId() string {
@@ -920,17 +1024,16 @@ func (x *ExecRequest) GetInputs() []*Content {
// ExecResponse contains the result of an execution.
type ExecResponse struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Outputs []*Content `protobuf:"bytes,1,rep,name=outputs,proto3" json:"outputs,omitempty"` // Output content
+ State State `protobuf:"varint,2,opt,name=state,proto3,enum=proto.State" json:"state,omitempty"` // Execution state
unknownFields protoimpl.UnknownFields
-
- Outputs []*Content `protobuf:"bytes,1,rep,name=outputs,proto3" json:"outputs,omitempty"` // Output content
- State State `protobuf:"varint,2,opt,name=state,proto3,enum=proto.State" json:"state,omitempty"` // Execution state
+ sizeCache protoimpl.SizeCache
}
func (x *ExecResponse) Reset() {
*x = ExecResponse{}
- mi := &file_proto_ax_proto_msgTypes[13]
+ mi := &file_proto_ax_proto_msgTypes[14]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -942,7 +1045,7 @@ func (x *ExecResponse) String() string {
func (*ExecResponse) ProtoMessage() {}
func (x *ExecResponse) ProtoReflect() protoreflect.Message {
- mi := &file_proto_ax_proto_msgTypes[13]
+ mi := &file_proto_ax_proto_msgTypes[14]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -955,7 +1058,7 @@ func (x *ExecResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use ExecResponse.ProtoReflect.Descriptor instead.
func (*ExecResponse) Descriptor() ([]byte, []int) {
- return file_proto_ax_proto_rawDescGZIP(), []int{13}
+ return file_proto_ax_proto_rawDescGZIP(), []int{14}
}
func (x *ExecResponse) GetOutputs() []*Content {
@@ -973,18 +1076,17 @@ func (x *ExecResponse) GetState() State {
}
type ForkRequest struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- SrcId string `protobuf:"bytes,1,opt,name=src_id,json=srcId,proto3" json:"src_id,omitempty"`
- SrcCheckpointId string `protobuf:"bytes,2,opt,name=src_checkpoint_id,json=srcCheckpointId,proto3" json:"src_checkpoint_id,omitempty"` // Checkpoint ID within the source execution to fork from.
- DestId string `protobuf:"bytes,3,opt,name=dest_id,json=destId,proto3" json:"dest_id,omitempty"` // New ID. If provided, must not exist.
+ state protoimpl.MessageState `protogen:"open.v1"`
+ SrcId string `protobuf:"bytes,1,opt,name=src_id,json=srcId,proto3" json:"src_id,omitempty"`
+ SrcCheckpointId string `protobuf:"bytes,2,opt,name=src_checkpoint_id,json=srcCheckpointId,proto3" json:"src_checkpoint_id,omitempty"` // Checkpoint ID within the source execution to fork from.
+ DestId string `protobuf:"bytes,3,opt,name=dest_id,json=destId,proto3" json:"dest_id,omitempty"` // New ID. If provided, must not exist.
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *ForkRequest) Reset() {
*x = ForkRequest{}
- mi := &file_proto_ax_proto_msgTypes[14]
+ mi := &file_proto_ax_proto_msgTypes[15]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -996,7 +1098,7 @@ func (x *ForkRequest) String() string {
func (*ForkRequest) ProtoMessage() {}
func (x *ForkRequest) ProtoReflect() protoreflect.Message {
- mi := &file_proto_ax_proto_msgTypes[14]
+ mi := &file_proto_ax_proto_msgTypes[15]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1009,7 +1111,7 @@ func (x *ForkRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use ForkRequest.ProtoReflect.Descriptor instead.
func (*ForkRequest) Descriptor() ([]byte, []int) {
- return file_proto_ax_proto_rawDescGZIP(), []int{14}
+ return file_proto_ax_proto_rawDescGZIP(), []int{15}
}
func (x *ForkRequest) GetSrcId() string {
@@ -1034,16 +1136,15 @@ func (x *ForkRequest) GetDestId() string {
}
type ForkResponse struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
+ state protoimpl.MessageState `protogen:"open.v1"`
+ NewId string `protobuf:"bytes,1,opt,name=new_id,json=newId,proto3" json:"new_id,omitempty"` // New task ID (in case it was generated or modified by server)
unknownFields protoimpl.UnknownFields
-
- NewId string `protobuf:"bytes,1,opt,name=new_id,json=newId,proto3" json:"new_id,omitempty"` // New task ID (in case it was generated or modified by server)
+ sizeCache protoimpl.SizeCache
}
func (x *ForkResponse) Reset() {
*x = ForkResponse{}
- mi := &file_proto_ax_proto_msgTypes[15]
+ mi := &file_proto_ax_proto_msgTypes[16]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1055,7 +1156,7 @@ func (x *ForkResponse) String() string {
func (*ForkResponse) ProtoMessage() {}
func (x *ForkResponse) ProtoReflect() protoreflect.Message {
- mi := &file_proto_ax_proto_msgTypes[15]
+ mi := &file_proto_ax_proto_msgTypes[16]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1068,7 +1169,7 @@ func (x *ForkResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use ForkResponse.ProtoReflect.Descriptor instead.
func (*ForkResponse) Descriptor() ([]byte, []int) {
- return file_proto_ax_proto_rawDescGZIP(), []int{15}
+ return file_proto_ax_proto_rawDescGZIP(), []int{16}
}
func (x *ForkResponse) GetNewId() string {
@@ -1079,16 +1180,15 @@ func (x *ForkResponse) GetNewId() string {
}
type RemoteAgentConfig struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // gRPC address for remote agents
unknownFields protoimpl.UnknownFields
-
- Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // gRPC address for remote agents
+ sizeCache protoimpl.SizeCache
}
func (x *RemoteAgentConfig) Reset() {
*x = RemoteAgentConfig{}
- mi := &file_proto_ax_proto_msgTypes[16]
+ mi := &file_proto_ax_proto_msgTypes[17]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1100,7 +1200,7 @@ func (x *RemoteAgentConfig) String() string {
func (*RemoteAgentConfig) ProtoMessage() {}
func (x *RemoteAgentConfig) ProtoReflect() protoreflect.Message {
- mi := &file_proto_ax_proto_msgTypes[16]
+ mi := &file_proto_ax_proto_msgTypes[17]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1113,7 +1213,7 @@ func (x *RemoteAgentConfig) ProtoReflect() protoreflect.Message {
// Deprecated: Use RemoteAgentConfig.ProtoReflect.Descriptor instead.
func (*RemoteAgentConfig) Descriptor() ([]byte, []int) {
- return file_proto_ax_proto_rawDescGZIP(), []int{16}
+ return file_proto_ax_proto_rawDescGZIP(), []int{17}
}
func (x *RemoteAgentConfig) GetAddress() string {
@@ -1125,23 +1225,22 @@ func (x *RemoteAgentConfig) GetAddress() string {
// RegisterAgentRequest for registering an agent
type RegisterAgentRequest struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"`
- Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // Human-readable name for the agent
- Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` // Description of agent capabilities
- Metadata map[string]string `protobuf:"bytes,4,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
- // Types that are assignable to Config:
+ state protoimpl.MessageState `protogen:"open.v1"`
+ AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"`
+ Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // Human-readable name for the agent
+ Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` // Description of agent capabilities
+ Metadata map[string]string `protobuf:"bytes,4,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
+ // Types that are valid to be assigned to Config:
//
// *RegisterAgentRequest_Remote
- Config isRegisterAgentRequest_Config `protobuf_oneof:"config"`
+ Config isRegisterAgentRequest_Config `protobuf_oneof:"config"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *RegisterAgentRequest) Reset() {
*x = RegisterAgentRequest{}
- mi := &file_proto_ax_proto_msgTypes[17]
+ mi := &file_proto_ax_proto_msgTypes[18]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1153,7 +1252,7 @@ func (x *RegisterAgentRequest) String() string {
func (*RegisterAgentRequest) ProtoMessage() {}
func (x *RegisterAgentRequest) ProtoReflect() protoreflect.Message {
- mi := &file_proto_ax_proto_msgTypes[17]
+ mi := &file_proto_ax_proto_msgTypes[18]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1166,7 +1265,7 @@ func (x *RegisterAgentRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use RegisterAgentRequest.ProtoReflect.Descriptor instead.
func (*RegisterAgentRequest) Descriptor() ([]byte, []int) {
- return file_proto_ax_proto_rawDescGZIP(), []int{17}
+ return file_proto_ax_proto_rawDescGZIP(), []int{18}
}
func (x *RegisterAgentRequest) GetAgentId() string {
@@ -1197,16 +1296,18 @@ func (x *RegisterAgentRequest) GetMetadata() map[string]string {
return nil
}
-func (m *RegisterAgentRequest) GetConfig() isRegisterAgentRequest_Config {
- if m != nil {
- return m.Config
+func (x *RegisterAgentRequest) GetConfig() isRegisterAgentRequest_Config {
+ if x != nil {
+ return x.Config
}
return nil
}
func (x *RegisterAgentRequest) GetRemote() *RemoteAgentConfig {
- if x, ok := x.GetConfig().(*RegisterAgentRequest_Remote); ok {
- return x.Remote
+ if x != nil {
+ if x, ok := x.Config.(*RegisterAgentRequest_Remote); ok {
+ return x.Remote
+ }
}
return nil
}
@@ -1223,14 +1324,14 @@ func (*RegisterAgentRequest_Remote) isRegisterAgentRequest_Config() {}
// RegisterAgentResponse contains registration result
type RegisterAgentResponse struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
+ state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *RegisterAgentResponse) Reset() {
*x = RegisterAgentResponse{}
- mi := &file_proto_ax_proto_msgTypes[18]
+ mi := &file_proto_ax_proto_msgTypes[19]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1242,7 +1343,7 @@ func (x *RegisterAgentResponse) String() string {
func (*RegisterAgentResponse) ProtoMessage() {}
func (x *RegisterAgentResponse) ProtoReflect() protoreflect.Message {
- mi := &file_proto_ax_proto_msgTypes[18]
+ mi := &file_proto_ax_proto_msgTypes[19]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1255,24 +1356,23 @@ func (x *RegisterAgentResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use RegisterAgentResponse.ProtoReflect.Descriptor instead.
func (*RegisterAgentResponse) Descriptor() ([]byte, []int) {
- return file_proto_ax_proto_rawDescGZIP(), []int{18}
+ return file_proto_ax_proto_rawDescGZIP(), []int{19}
}
// GeminiConfig is the configuration for a Gemini agent.
type GeminiConfig struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Model string `protobuf:"bytes,1,opt,name=model,proto3" json:"model,omitempty"` // e.g. "gemini-3-flash-preview"
+ SystemPrompt string `protobuf:"bytes,2,opt,name=system_prompt,json=systemPrompt,proto3" json:"system_prompt,omitempty"` // System prompt for the agent
+ MaxTokens int32 `protobuf:"varint,3,opt,name=max_tokens,json=maxTokens,proto3" json:"max_tokens,omitempty"` // Maximum number of tokens to generate
+ Timeout *durationpb.Duration `protobuf:"bytes,4,opt,name=timeout,proto3" json:"timeout,omitempty"` // e.g. "10s"
unknownFields protoimpl.UnknownFields
-
- Model string `protobuf:"bytes,1,opt,name=model,proto3" json:"model,omitempty"` // e.g. "gemini-3-flash-preview"
- SystemPrompt string `protobuf:"bytes,2,opt,name=system_prompt,json=systemPrompt,proto3" json:"system_prompt,omitempty"` // System prompt for the agent
- MaxTokens int32 `protobuf:"varint,3,opt,name=max_tokens,json=maxTokens,proto3" json:"max_tokens,omitempty"` // Maximum number of tokens to generate
- Timeout *durationpb.Duration `protobuf:"bytes,4,opt,name=timeout,proto3" json:"timeout,omitempty"` // e.g. "10s"
+ sizeCache protoimpl.SizeCache
}
func (x *GeminiConfig) Reset() {
*x = GeminiConfig{}
- mi := &file_proto_ax_proto_msgTypes[19]
+ mi := &file_proto_ax_proto_msgTypes[20]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1284,7 +1384,7 @@ func (x *GeminiConfig) String() string {
func (*GeminiConfig) ProtoMessage() {}
func (x *GeminiConfig) ProtoReflect() protoreflect.Message {
- mi := &file_proto_ax_proto_msgTypes[19]
+ mi := &file_proto_ax_proto_msgTypes[20]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1297,7 +1397,7 @@ func (x *GeminiConfig) ProtoReflect() protoreflect.Message {
// Deprecated: Use GeminiConfig.ProtoReflect.Descriptor instead.
func (*GeminiConfig) Descriptor() ([]byte, []int) {
- return file_proto_ax_proto_rawDescGZIP(), []int{19}
+ return file_proto_ax_proto_rawDescGZIP(), []int{20}
}
func (x *GeminiConfig) GetModel() string {
@@ -1330,276 +1430,193 @@ func (x *GeminiConfig) GetTimeout() *durationpb.Duration {
var File_proto_ax_proto protoreflect.FileDescriptor
-var file_proto_ax_proto_rawDesc = []byte{
- 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x61, 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
- 0x12, 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f,
- 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61,
- 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
- 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74,
- 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70,
- 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74,
- 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
- 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74,
- 0x6f, 0x22, 0x3c, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75,
- 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x18,
- 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f,
- 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x22,
- 0x62, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
- 0x73, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74,
- 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x68, 0x65, 0x63, 0x6b,
- 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65,
- 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x72, 0x6f, 0x74,
- 0x6f, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65,
- 0x6e, 0x74, 0x73, 0x22, 0x33, 0x0a, 0x0b, 0x54, 0x65, 0x78, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65,
- 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
- 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, 0x4a, 0x04, 0x08, 0x02,
- 0x10, 0x03, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x2e, 0x0a, 0x10, 0x41, 0x70, 0x70, 0x72,
- 0x6f, 0x76, 0x61, 0x6c, 0x44, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08,
- 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08,
- 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x64, 0x22, 0x3b, 0x0a, 0x0f, 0x44, 0x65, 0x63, 0x6c,
- 0x69, 0x6e, 0x65, 0x44, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x64,
- 0x65, 0x63, 0x6c, 0x69, 0x6e, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x64,
- 0x65, 0x63, 0x6c, 0x69, 0x6e, 0x65, 0x64, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x52, 0x06, 0x72,
- 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x22, 0xca, 0x01, 0x0a, 0x13, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72,
- 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a,
- 0x02, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a,
- 0x08, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,
- 0x08, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x35, 0x0a, 0x08, 0x61, 0x70, 0x70,
- 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x44, 0x65, 0x63, 0x69,
- 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x08, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61, 0x6c,
- 0x12, 0x32, 0x0a, 0x07, 0x64, 0x65, 0x63, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28,
- 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x65, 0x63, 0x6c, 0x69, 0x6e,
- 0x65, 0x44, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x07, 0x64, 0x65, 0x63,
- 0x6c, 0x69, 0x6e, 0x65, 0x42, 0x0a, 0x0a, 0x08, 0x64, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e,
- 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x52, 0x04, 0x74, 0x79,
- 0x70, 0x65, 0x22, 0x93, 0x01, 0x0a, 0x13, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43,
- 0x61, 0x6c, 0x6c, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61,
- 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2b,
- 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67,
- 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53,
- 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69,
- 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2b, 0x0a, 0x11, 0x74,
- 0x68, 0x6f, 0x75, 0x67, 0x68, 0x74, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65,
- 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x10, 0x74, 0x68, 0x6f, 0x75, 0x67, 0x68, 0x74, 0x53,
- 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x72, 0x0a, 0x17, 0x46, 0x75, 0x6e, 0x63,
- 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x74,
- 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
- 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x33, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f,
- 0x6e, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
- 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75,
- 0x63, 0x74, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02,
- 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0xb9, 0x02, 0x0a,
- 0x07, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x28, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74,
- 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x54,
- 0x65, 0x78, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x04, 0x74, 0x65,
- 0x78, 0x74, 0x12, 0x40, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74, 0x69,
- 0x6f, 0x6e, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
- 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e,
- 0x74, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61,
- 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x41, 0x0a, 0x0d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
- 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x2e, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x61, 0x6c, 0x6c,
- 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x0c, 0x66, 0x75, 0x6e, 0x63, 0x74,
- 0x69, 0x6f, 0x6e, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x4d, 0x0a, 0x11, 0x66, 0x75, 0x6e, 0x63, 0x74,
- 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x1c, 0x20, 0x01,
- 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x46, 0x75, 0x6e, 0x63, 0x74,
- 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65,
- 0x6e, 0x74, 0x48, 0x00, 0x52, 0x10, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65,
- 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x13, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0xe8,
- 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x42, 0x09, 0x0a, 0x07, 0x63,
- 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x05, 0x4a, 0x04, 0x08, 0x06,
- 0x10, 0x0a, 0x4a, 0x04, 0x08, 0x0b, 0x10, 0x1a, 0x22, 0xf4, 0x01, 0x0a, 0x0e, 0x45, 0x78, 0x65,
- 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x74,
- 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61,
- 0x73, 0x6b, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64,
- 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12,
- 0x26, 0x0a, 0x06, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32,
- 0x0e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52,
- 0x06, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x12, 0x28, 0x0a, 0x07, 0x6f, 0x75, 0x74, 0x70, 0x75,
- 0x74, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
- 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x07, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74,
- 0x73, 0x12, 0x22, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e,
- 0x32, 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05,
- 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61,
- 0x6d, 0x70, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
- 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73,
- 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22,
- 0x14, 0x0a, 0x12, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65,
- 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x49, 0x0a, 0x13, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43,
- 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07,
- 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x68,
- 0x65, 0x61, 0x6c, 0x74, 0x68, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,
- 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
- 0x22, 0x99, 0x01, 0x0a, 0x0b, 0x45, 0x78, 0x65, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
- 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64,
- 0x12, 0x19, 0x0a, 0x08, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01,
- 0x28, 0x09, 0x52, 0x07, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x37, 0x0a, 0x0c, 0x61,
- 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28,
- 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
- 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x0b, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x43, 0x6f,
- 0x6e, 0x66, 0x69, 0x67, 0x12, 0x26, 0x0a, 0x06, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x18, 0x04,
- 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x6e,
- 0x74, 0x65, 0x6e, 0x74, 0x52, 0x06, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x22, 0x5c, 0x0a, 0x0c,
- 0x45, 0x78, 0x65, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x07,
- 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e,
- 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x07, 0x6f,
- 0x75, 0x74, 0x70, 0x75, 0x74, 0x73, 0x12, 0x22, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18,
- 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x74,
- 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x69, 0x0a, 0x0b, 0x46, 0x6f,
- 0x72, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x73, 0x72, 0x63,
- 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x72, 0x63, 0x49, 0x64,
- 0x12, 0x2a, 0x0a, 0x11, 0x73, 0x72, 0x63, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69,
- 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x73, 0x72, 0x63,
- 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07,
- 0x64, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64,
- 0x65, 0x73, 0x74, 0x49, 0x64, 0x22, 0x25, 0x0a, 0x0c, 0x46, 0x6f, 0x72, 0x6b, 0x52, 0x65, 0x73,
- 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x15, 0x0a, 0x06, 0x6e, 0x65, 0x77, 0x5f, 0x69, 0x64, 0x18,
- 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6e, 0x65, 0x77, 0x49, 0x64, 0x22, 0x2d, 0x0a, 0x11,
- 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69,
- 0x67, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01,
- 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0xa9, 0x02, 0x0a, 0x14,
- 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71,
- 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64,
- 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12,
- 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e,
- 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69,
- 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69,
- 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x45, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74,
- 0x61, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e,
- 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71,
- 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74,
- 0x72, 0x79, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x32, 0x0a, 0x06,
- 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70,
- 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74,
- 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x00, 0x52, 0x06, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65,
- 0x1a, 0x3b, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72,
- 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
- 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01,
- 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x08, 0x0a,
- 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x17, 0x0a, 0x15, 0x52, 0x65, 0x67, 0x69, 0x73,
- 0x74, 0x65, 0x72, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
- 0x22, 0x9d, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x6d, 0x69, 0x6e, 0x69, 0x43, 0x6f, 0x6e, 0x66, 0x69,
- 0x67, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
- 0x52, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x79, 0x73, 0x74, 0x65,
- 0x6d, 0x5f, 0x70, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c,
- 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x50, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x12, 0x1d, 0x0a, 0x0a,
- 0x6d, 0x61, 0x78, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05,
- 0x52, 0x09, 0x6d, 0x61, 0x78, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0x33, 0x0a, 0x07, 0x74,
- 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67,
- 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44,
- 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74,
- 0x2a, 0x58, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x15, 0x0a, 0x11, 0x53, 0x54, 0x41,
- 0x54, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00,
- 0x12, 0x11, 0x0a, 0x0d, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e,
- 0x47, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x46, 0x41, 0x49,
- 0x4c, 0x45, 0x44, 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x43,
- 0x4f, 0x4d, 0x50, 0x4c, 0x45, 0x54, 0x45, 0x44, 0x10, 0x03, 0x32, 0x92, 0x01, 0x0a, 0x0c, 0x41,
- 0x67, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3c, 0x0a, 0x07, 0x50,
- 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x12, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50,
- 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e,
- 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73,
- 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x12, 0x44, 0x0a, 0x0b, 0x48, 0x65, 0x61,
- 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
- 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75,
- 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x48, 0x65, 0x61, 0x6c,
- 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32,
- 0xbb, 0x01, 0x0a, 0x09, 0x41, 0x58, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x31, 0x0a,
- 0x04, 0x45, 0x78, 0x65, 0x63, 0x12, 0x12, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x78,
- 0x65, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74,
- 0x6f, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01,
- 0x12, 0x2f, 0x0a, 0x04, 0x46, 0x6f, 0x72, 0x6b, 0x12, 0x12, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
- 0x2e, 0x46, 0x6f, 0x72, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x70,
- 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x46, 0x6f, 0x72, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
- 0x65, 0x12, 0x4a, 0x0a, 0x0d, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x41, 0x67, 0x65,
- 0x6e, 0x74, 0x12, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73,
- 0x74, 0x65, 0x72, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
- 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72,
- 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x1c, 0x5a,
- 0x1a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6f, 0x67,
- 0x6c, 0x65, 0x2f, 0x61, 0x78, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f,
- 0x74, 0x6f, 0x33,
-}
+const file_proto_ax_proto_rawDesc = "" +
+ "\n" +
+ "\x0eproto/ax.proto\x12\x05proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x19google/protobuf/any.proto\x1a\x1egoogle/protobuf/duration.proto\"\x81\x01\n" +
+ "\n" +
+ "AgentStart\x12\x19\n" +
+ "\bagent_id\x18\x01 \x01(\tR\aagentId\x12,\n" +
+ "\x06config\x18\x02 \x01(\v2\x14.google.protobuf.AnyR\x06config\x12*\n" +
+ "\bcontents\x18\x03 \x03(\v2\x0e.proto.ContentR\bcontents\"_\n" +
+ "\fAgentOutputs\x12*\n" +
+ "\bcontents\x18\x01 \x03(\v2\x0e.proto.ContentR\bcontents\x12#\n" +
+ "\rcheckpoint_id\x18\x02 \x01(\tR\fcheckpointId\"\x8a\x01\n" +
+ "\fAgentMessage\x12\x17\n" +
+ "\aexec_id\x18\x01 \x01(\tR\x06execId\x12)\n" +
+ "\x05start\x18\x02 \x01(\v2\x11.proto.AgentStartH\x00R\x05start\x12/\n" +
+ "\aoutputs\x18\x03 \x01(\v2\x13.proto.AgentOutputsH\x00R\aoutputsB\x05\n" +
+ "\x03msg\"3\n" +
+ "\vTextContent\x12\x12\n" +
+ "\x04text\x18\x03 \x01(\tR\x04textJ\x04\b\x01\x10\x02J\x04\b\x02\x10\x03R\x04type\".\n" +
+ "\x10ApprovalDecision\x12\x1a\n" +
+ "\bapproved\x18\x01 \x01(\bR\bapproved\";\n" +
+ "\x0fDeclineDecision\x12\x1a\n" +
+ "\bdeclined\x18\x01 \x01(\bR\bdeclinedJ\x04\b\x02\x10\x03R\x06reason\"\xca\x01\n" +
+ "\x13ConfirmationContent\x12\x0e\n" +
+ "\x02id\x18\x03 \x01(\tR\x02id\x12\x1a\n" +
+ "\bquestion\x18\x04 \x01(\tR\bquestion\x125\n" +
+ "\bapproval\x18\x05 \x01(\v2\x17.proto.ApprovalDecisionH\x00R\bapproval\x122\n" +
+ "\adecline\x18\x06 \x01(\v2\x16.proto.DeclineDecisionH\x00R\adeclineB\n" +
+ "\n" +
+ "\bdecisionJ\x04\b\x01\x10\x02J\x04\b\x02\x10\x03R\x04type\"\x93\x01\n" +
+ "\x13FunctionCallContent\x12\x12\n" +
+ "\x04name\x18\x01 \x01(\tR\x04name\x12+\n" +
+ "\x04args\x18\x02 \x01(\v2\x17.google.protobuf.StructR\x04args\x12\x0e\n" +
+ "\x02id\x18\x03 \x01(\tR\x02id\x12+\n" +
+ "\x11thought_signature\x18\x04 \x01(\fR\x10thoughtSignature\"r\n" +
+ "\x17FunctionResponseContent\x12\x12\n" +
+ "\x04name\x18\x01 \x01(\tR\x04name\x123\n" +
+ "\bresponse\x18\x02 \x01(\v2\x17.google.protobuf.StructR\bresponse\x12\x0e\n" +
+ "\x02id\x18\x03 \x01(\tR\x02id\"\xb9\x02\n" +
+ "\aContent\x12(\n" +
+ "\x04text\x18\n" +
+ " \x01(\v2\x12.proto.TextContentH\x00R\x04text\x12@\n" +
+ "\fconfirmation\x18\x1a \x01(\v2\x1a.proto.ConfirmationContentH\x00R\fconfirmation\x12A\n" +
+ "\rfunction_call\x18\x1b \x01(\v2\x1a.proto.FunctionCallContentH\x00R\ffunctionCall\x12M\n" +
+ "\x11function_response\x18\x1c \x01(\v2\x1e.proto.FunctionResponseContentH\x00R\x10functionResponse\x12\x13\n" +
+ "\x04role\x18\xe8\a \x01(\tR\x04roleB\t\n" +
+ "\acontentJ\x04\b\x01\x10\x05J\x04\b\x06\x10\n" +
+ "J\x04\b\v\x10\x1a\"\xf4\x01\n" +
+ "\x0eExecutionEvent\x12\x17\n" +
+ "\aexec_id\x18\x01 \x01(\tR\x06execId\x12\x19\n" +
+ "\bagent_id\x18\x02 \x01(\tR\aagentId\x12&\n" +
+ "\x06inputs\x18\x03 \x03(\v2\x0e.proto.ContentR\x06inputs\x12(\n" +
+ "\aoutputs\x18\x04 \x03(\v2\x0e.proto.ContentR\aoutputs\x12\"\n" +
+ "\x05state\x18\x05 \x01(\x0e2\f.proto.StateR\x05state\x128\n" +
+ "\ttimestamp\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampR\ttimestamp\"\x14\n" +
+ "\x12HealthCheckRequest\"I\n" +
+ "\x13HealthCheckResponse\x12\x18\n" +
+ "\ahealthy\x18\x01 \x01(\bR\ahealthy\x12\x18\n" +
+ "\amessage\x18\x02 \x01(\tR\amessage\"\x99\x01\n" +
+ "\vExecRequest\x12\x0e\n" +
+ "\x02id\x18\x01 \x01(\tR\x02id\x12\x19\n" +
+ "\bagent_id\x18\x02 \x01(\tR\aagentId\x127\n" +
+ "\fagent_config\x18\x03 \x01(\v2\x14.google.protobuf.AnyR\vagentConfig\x12&\n" +
+ "\x06inputs\x18\x04 \x03(\v2\x0e.proto.ContentR\x06inputs\"\\\n" +
+ "\fExecResponse\x12(\n" +
+ "\aoutputs\x18\x01 \x03(\v2\x0e.proto.ContentR\aoutputs\x12\"\n" +
+ "\x05state\x18\x02 \x01(\x0e2\f.proto.StateR\x05state\"i\n" +
+ "\vForkRequest\x12\x15\n" +
+ "\x06src_id\x18\x01 \x01(\tR\x05srcId\x12*\n" +
+ "\x11src_checkpoint_id\x18\x02 \x01(\tR\x0fsrcCheckpointId\x12\x17\n" +
+ "\adest_id\x18\x03 \x01(\tR\x06destId\"%\n" +
+ "\fForkResponse\x12\x15\n" +
+ "\x06new_id\x18\x01 \x01(\tR\x05newId\"-\n" +
+ "\x11RemoteAgentConfig\x12\x18\n" +
+ "\aaddress\x18\x01 \x01(\tR\aaddress\"\xa9\x02\n" +
+ "\x14RegisterAgentRequest\x12\x19\n" +
+ "\bagent_id\x18\x01 \x01(\tR\aagentId\x12\x12\n" +
+ "\x04name\x18\x02 \x01(\tR\x04name\x12 \n" +
+ "\vdescription\x18\x03 \x01(\tR\vdescription\x12E\n" +
+ "\bmetadata\x18\x04 \x03(\v2).proto.RegisterAgentRequest.MetadataEntryR\bmetadata\x122\n" +
+ "\x06remote\x18\x05 \x01(\v2\x18.proto.RemoteAgentConfigH\x00R\x06remote\x1a;\n" +
+ "\rMetadataEntry\x12\x10\n" +
+ "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +
+ "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01B\b\n" +
+ "\x06config\"\x17\n" +
+ "\x15RegisterAgentResponse\"\x9d\x01\n" +
+ "\fGeminiConfig\x12\x14\n" +
+ "\x05model\x18\x01 \x01(\tR\x05model\x12#\n" +
+ "\rsystem_prompt\x18\x02 \x01(\tR\fsystemPrompt\x12\x1d\n" +
+ "\n" +
+ "max_tokens\x18\x03 \x01(\x05R\tmaxTokens\x123\n" +
+ "\atimeout\x18\x04 \x01(\v2\x19.google.protobuf.DurationR\atimeout*X\n" +
+ "\x05State\x12\x15\n" +
+ "\x11STATE_UNSPECIFIED\x10\x00\x12\x11\n" +
+ "\rSTATE_PENDING\x10\x01\x12\x10\n" +
+ "\fSTATE_FAILED\x10\x02\x12\x13\n" +
+ "\x0fSTATE_COMPLETED\x10\x032\x8d\x01\n" +
+ "\fAgentService\x127\n" +
+ "\aConnect\x12\x13.proto.AgentMessage\x1a\x13.proto.AgentMessage(\x010\x01\x12D\n" +
+ "\vHealthCheck\x12\x19.proto.HealthCheckRequest\x1a\x1a.proto.HealthCheckResponse2\xbb\x01\n" +
+ "\tAXService\x121\n" +
+ "\x04Exec\x12\x12.proto.ExecRequest\x1a\x13.proto.ExecResponse0\x01\x12/\n" +
+ "\x04Fork\x12\x12.proto.ForkRequest\x1a\x13.proto.ForkResponse\x12J\n" +
+ "\rRegisterAgent\x12\x1b.proto.RegisterAgentRequest\x1a\x1c.proto.RegisterAgentResponseB\x1cZ\x1agithub.com/google/ax/protob\x06proto3"
var (
file_proto_ax_proto_rawDescOnce sync.Once
- file_proto_ax_proto_rawDescData = file_proto_ax_proto_rawDesc
+ file_proto_ax_proto_rawDescData []byte
)
func file_proto_ax_proto_rawDescGZIP() []byte {
file_proto_ax_proto_rawDescOnce.Do(func() {
- file_proto_ax_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_ax_proto_rawDescData)
+ file_proto_ax_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_proto_ax_proto_rawDesc), len(file_proto_ax_proto_rawDesc)))
})
return file_proto_ax_proto_rawDescData
}
var file_proto_ax_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
-var file_proto_ax_proto_msgTypes = make([]protoimpl.MessageInfo, 21)
+var file_proto_ax_proto_msgTypes = make([]protoimpl.MessageInfo, 22)
var file_proto_ax_proto_goTypes = []any{
(State)(0), // 0: proto.State
- (*ProcessRequest)(nil), // 1: proto.ProcessRequest
- (*ProcessResponse)(nil), // 2: proto.ProcessResponse
- (*TextContent)(nil), // 3: proto.TextContent
- (*ApprovalDecision)(nil), // 4: proto.ApprovalDecision
- (*DeclineDecision)(nil), // 5: proto.DeclineDecision
- (*ConfirmationContent)(nil), // 6: proto.ConfirmationContent
- (*FunctionCallContent)(nil), // 7: proto.FunctionCallContent
- (*FunctionResponseContent)(nil), // 8: proto.FunctionResponseContent
- (*Content)(nil), // 9: proto.Content
- (*ExecutionEvent)(nil), // 10: proto.ExecutionEvent
- (*HealthCheckRequest)(nil), // 11: proto.HealthCheckRequest
- (*HealthCheckResponse)(nil), // 12: proto.HealthCheckResponse
- (*ExecRequest)(nil), // 13: proto.ExecRequest
- (*ExecResponse)(nil), // 14: proto.ExecResponse
- (*ForkRequest)(nil), // 15: proto.ForkRequest
- (*ForkResponse)(nil), // 16: proto.ForkResponse
- (*RemoteAgentConfig)(nil), // 17: proto.RemoteAgentConfig
- (*RegisterAgentRequest)(nil), // 18: proto.RegisterAgentRequest
- (*RegisterAgentResponse)(nil), // 19: proto.RegisterAgentResponse
- (*GeminiConfig)(nil), // 20: proto.GeminiConfig
- nil, // 21: proto.RegisterAgentRequest.MetadataEntry
- (*structpb.Struct)(nil), // 22: google.protobuf.Struct
- (*timestamppb.Timestamp)(nil), // 23: google.protobuf.Timestamp
- (*anypb.Any)(nil), // 24: google.protobuf.Any
- (*durationpb.Duration)(nil), // 25: google.protobuf.Duration
+ (*AgentStart)(nil), // 1: proto.AgentStart
+ (*AgentOutputs)(nil), // 2: proto.AgentOutputs
+ (*AgentMessage)(nil), // 3: proto.AgentMessage
+ (*TextContent)(nil), // 4: proto.TextContent
+ (*ApprovalDecision)(nil), // 5: proto.ApprovalDecision
+ (*DeclineDecision)(nil), // 6: proto.DeclineDecision
+ (*ConfirmationContent)(nil), // 7: proto.ConfirmationContent
+ (*FunctionCallContent)(nil), // 8: proto.FunctionCallContent
+ (*FunctionResponseContent)(nil), // 9: proto.FunctionResponseContent
+ (*Content)(nil), // 10: proto.Content
+ (*ExecutionEvent)(nil), // 11: proto.ExecutionEvent
+ (*HealthCheckRequest)(nil), // 12: proto.HealthCheckRequest
+ (*HealthCheckResponse)(nil), // 13: proto.HealthCheckResponse
+ (*ExecRequest)(nil), // 14: proto.ExecRequest
+ (*ExecResponse)(nil), // 15: proto.ExecResponse
+ (*ForkRequest)(nil), // 16: proto.ForkRequest
+ (*ForkResponse)(nil), // 17: proto.ForkResponse
+ (*RemoteAgentConfig)(nil), // 18: proto.RemoteAgentConfig
+ (*RegisterAgentRequest)(nil), // 19: proto.RegisterAgentRequest
+ (*RegisterAgentResponse)(nil), // 20: proto.RegisterAgentResponse
+ (*GeminiConfig)(nil), // 21: proto.GeminiConfig
+ nil, // 22: proto.RegisterAgentRequest.MetadataEntry
+ (*anypb.Any)(nil), // 23: google.protobuf.Any
+ (*structpb.Struct)(nil), // 24: google.protobuf.Struct
+ (*timestamppb.Timestamp)(nil), // 25: google.protobuf.Timestamp
+ (*durationpb.Duration)(nil), // 26: google.protobuf.Duration
}
var file_proto_ax_proto_depIdxs = []int32{
- 9, // 0: proto.ProcessRequest.contents:type_name -> proto.Content
- 9, // 1: proto.ProcessResponse.contents:type_name -> proto.Content
- 4, // 2: proto.ConfirmationContent.approval:type_name -> proto.ApprovalDecision
- 5, // 3: proto.ConfirmationContent.decline:type_name -> proto.DeclineDecision
- 22, // 4: proto.FunctionCallContent.args:type_name -> google.protobuf.Struct
- 22, // 5: proto.FunctionResponseContent.response:type_name -> google.protobuf.Struct
- 3, // 6: proto.Content.text:type_name -> proto.TextContent
- 6, // 7: proto.Content.confirmation:type_name -> proto.ConfirmationContent
- 7, // 8: proto.Content.function_call:type_name -> proto.FunctionCallContent
- 8, // 9: proto.Content.function_response:type_name -> proto.FunctionResponseContent
- 9, // 10: proto.ExecutionEvent.inputs:type_name -> proto.Content
- 9, // 11: proto.ExecutionEvent.outputs:type_name -> proto.Content
- 0, // 12: proto.ExecutionEvent.state:type_name -> proto.State
- 23, // 13: proto.ExecutionEvent.timestamp:type_name -> google.protobuf.Timestamp
- 24, // 14: proto.ExecRequest.agent_config:type_name -> google.protobuf.Any
- 9, // 15: proto.ExecRequest.inputs:type_name -> proto.Content
- 9, // 16: proto.ExecResponse.outputs:type_name -> proto.Content
- 0, // 17: proto.ExecResponse.state:type_name -> proto.State
- 21, // 18: proto.RegisterAgentRequest.metadata:type_name -> proto.RegisterAgentRequest.MetadataEntry
- 17, // 19: proto.RegisterAgentRequest.remote:type_name -> proto.RemoteAgentConfig
- 25, // 20: proto.GeminiConfig.timeout:type_name -> google.protobuf.Duration
- 1, // 21: proto.AgentService.Process:input_type -> proto.ProcessRequest
- 11, // 22: proto.AgentService.HealthCheck:input_type -> proto.HealthCheckRequest
- 13, // 23: proto.AXService.Exec:input_type -> proto.ExecRequest
- 15, // 24: proto.AXService.Fork:input_type -> proto.ForkRequest
- 18, // 25: proto.AXService.RegisterAgent:input_type -> proto.RegisterAgentRequest
- 2, // 26: proto.AgentService.Process:output_type -> proto.ProcessResponse
- 12, // 27: proto.AgentService.HealthCheck:output_type -> proto.HealthCheckResponse
- 14, // 28: proto.AXService.Exec:output_type -> proto.ExecResponse
- 16, // 29: proto.AXService.Fork:output_type -> proto.ForkResponse
- 19, // 30: proto.AXService.RegisterAgent:output_type -> proto.RegisterAgentResponse
- 26, // [26:31] is the sub-list for method output_type
- 21, // [21:26] is the sub-list for method input_type
- 21, // [21:21] is the sub-list for extension type_name
- 21, // [21:21] is the sub-list for extension extendee
- 0, // [0:21] is the sub-list for field type_name
+ 23, // 0: proto.AgentStart.config:type_name -> google.protobuf.Any
+ 10, // 1: proto.AgentStart.contents:type_name -> proto.Content
+ 10, // 2: proto.AgentOutputs.contents:type_name -> proto.Content
+ 1, // 3: proto.AgentMessage.start:type_name -> proto.AgentStart
+ 2, // 4: proto.AgentMessage.outputs:type_name -> proto.AgentOutputs
+ 5, // 5: proto.ConfirmationContent.approval:type_name -> proto.ApprovalDecision
+ 6, // 6: proto.ConfirmationContent.decline:type_name -> proto.DeclineDecision
+ 24, // 7: proto.FunctionCallContent.args:type_name -> google.protobuf.Struct
+ 24, // 8: proto.FunctionResponseContent.response:type_name -> google.protobuf.Struct
+ 4, // 9: proto.Content.text:type_name -> proto.TextContent
+ 7, // 10: proto.Content.confirmation:type_name -> proto.ConfirmationContent
+ 8, // 11: proto.Content.function_call:type_name -> proto.FunctionCallContent
+ 9, // 12: proto.Content.function_response:type_name -> proto.FunctionResponseContent
+ 10, // 13: proto.ExecutionEvent.inputs:type_name -> proto.Content
+ 10, // 14: proto.ExecutionEvent.outputs:type_name -> proto.Content
+ 0, // 15: proto.ExecutionEvent.state:type_name -> proto.State
+ 25, // 16: proto.ExecutionEvent.timestamp:type_name -> google.protobuf.Timestamp
+ 23, // 17: proto.ExecRequest.agent_config:type_name -> google.protobuf.Any
+ 10, // 18: proto.ExecRequest.inputs:type_name -> proto.Content
+ 10, // 19: proto.ExecResponse.outputs:type_name -> proto.Content
+ 0, // 20: proto.ExecResponse.state:type_name -> proto.State
+ 22, // 21: proto.RegisterAgentRequest.metadata:type_name -> proto.RegisterAgentRequest.MetadataEntry
+ 18, // 22: proto.RegisterAgentRequest.remote:type_name -> proto.RemoteAgentConfig
+ 26, // 23: proto.GeminiConfig.timeout:type_name -> google.protobuf.Duration
+ 3, // 24: proto.AgentService.Connect:input_type -> proto.AgentMessage
+ 12, // 25: proto.AgentService.HealthCheck:input_type -> proto.HealthCheckRequest
+ 14, // 26: proto.AXService.Exec:input_type -> proto.ExecRequest
+ 16, // 27: proto.AXService.Fork:input_type -> proto.ForkRequest
+ 19, // 28: proto.AXService.RegisterAgent:input_type -> proto.RegisterAgentRequest
+ 3, // 29: proto.AgentService.Connect:output_type -> proto.AgentMessage
+ 13, // 30: proto.AgentService.HealthCheck:output_type -> proto.HealthCheckResponse
+ 15, // 31: proto.AXService.Exec:output_type -> proto.ExecResponse
+ 17, // 32: proto.AXService.Fork:output_type -> proto.ForkResponse
+ 20, // 33: proto.AXService.RegisterAgent:output_type -> proto.RegisterAgentResponse
+ 29, // [29:34] is the sub-list for method output_type
+ 24, // [24:29] is the sub-list for method input_type
+ 24, // [24:24] is the sub-list for extension type_name
+ 24, // [24:24] is the sub-list for extension extendee
+ 0, // [0:24] is the sub-list for field type_name
}
func init() { file_proto_ax_proto_init() }
@@ -1607,26 +1624,30 @@ func file_proto_ax_proto_init() {
if File_proto_ax_proto != nil {
return
}
- file_proto_ax_proto_msgTypes[5].OneofWrappers = []any{
+ file_proto_ax_proto_msgTypes[2].OneofWrappers = []any{
+ (*AgentMessage_Start)(nil),
+ (*AgentMessage_Outputs)(nil),
+ }
+ file_proto_ax_proto_msgTypes[6].OneofWrappers = []any{
(*ConfirmationContent_Approval)(nil),
(*ConfirmationContent_Decline)(nil),
}
- file_proto_ax_proto_msgTypes[8].OneofWrappers = []any{
+ file_proto_ax_proto_msgTypes[9].OneofWrappers = []any{
(*Content_Text)(nil),
(*Content_Confirmation)(nil),
(*Content_FunctionCall)(nil),
(*Content_FunctionResponse)(nil),
}
- file_proto_ax_proto_msgTypes[17].OneofWrappers = []any{
+ file_proto_ax_proto_msgTypes[18].OneofWrappers = []any{
(*RegisterAgentRequest_Remote)(nil),
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
- RawDescriptor: file_proto_ax_proto_rawDesc,
+ RawDescriptor: unsafe.Slice(unsafe.StringData(file_proto_ax_proto_rawDesc), len(file_proto_ax_proto_rawDesc)),
NumEnums: 1,
- NumMessages: 21,
+ NumMessages: 22,
NumExtensions: 0,
NumServices: 2,
},
@@ -1636,7 +1657,6 @@ func file_proto_ax_proto_init() {
MessageInfos: file_proto_ax_proto_msgTypes,
}.Build()
File_proto_ax_proto = out.File
- file_proto_ax_proto_rawDesc = nil
file_proto_ax_proto_goTypes = nil
file_proto_ax_proto_depIdxs = nil
}
diff --git a/proto/ax.proto b/proto/ax.proto
index 9632f07..24db4c2 100644
--- a/proto/ax.proto
+++ b/proto/ax.proto
@@ -23,16 +23,24 @@ import "google/protobuf/duration.proto";
option go_package = "github.com/google/ax/proto";
-// ProcessRequest is an input to an agent.
-message ProcessRequest {
+message AgentStart {
+ string agent_id = 1;
+ google.protobuf.Any config = 2;
+ repeated Content contents = 3;
+}
+
+message AgentOutputs {
repeated Content contents = 1;
+ string checkpoint_id = 2;
+ // TODO: Add awaiting_more field.
}
-// ProcessResponse is an output from an agent.
-// It can be returned in a streaming fashion.
-message ProcessResponse {
- string checkpoint_id = 1;
- repeated Content contents = 2;
+message AgentMessage {
+ string exec_id = 1;
+ oneof msg {
+ AgentStart start = 2;
+ AgentOutputs outputs = 3;
+ }
}
// TextContent represents a text content.
@@ -98,12 +106,12 @@ message Content {
// to record the actions taken place in the executor.
// The executor can replay the events for resumability.
message ExecutionEvent {
- string task_id = 2;
- string agent_id = 3;
- repeated Content inputs = 4;
- repeated Content outputs = 5;
- State state = 6;
- google.protobuf.Timestamp timestamp = 7;
+ string exec_id = 1;
+ string agent_id = 2;
+ repeated Content inputs = 3;
+ repeated Content outputs = 4;
+ State state = 5;
+ google.protobuf.Timestamp timestamp = 6;
// string checkpoint_id = 10;
}
@@ -118,8 +126,8 @@ message HealthCheckResponse {
// AgentService defines the gRPC service for agent communication
service AgentService {
- // Process handles bidirectional streaming of content between controller and agent
- rpc Process(stream ProcessRequest) returns (stream ProcessResponse);
+ // Connect is used by agents to connect to the controller.
+ rpc Connect(stream AgentMessage) returns (stream AgentMessage);
// HealthCheck checks if the agent is healthy and responsive
rpc HealthCheck(HealthCheckRequest) returns (HealthCheckResponse);
diff --git a/proto/ax_grpc.pb.go b/proto/ax_grpc.pb.go
index 096160d..4361d3d 100644
--- a/proto/ax_grpc.pb.go
+++ b/proto/ax_grpc.pb.go
@@ -14,8 +14,8 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
-// - protoc-gen-go-grpc v1.5.1
-// - protoc v5.28.2
+// - protoc-gen-go-grpc v1.6.0
+// - protoc v3.21.9
// source: proto/ax.proto
package proto
@@ -33,7 +33,7 @@ import (
const _ = grpc.SupportPackageIsVersion9
const (
- AgentService_Process_FullMethodName = "/proto.AgentService/Process"
+ AgentService_Connect_FullMethodName = "/proto.AgentService/Connect"
AgentService_HealthCheck_FullMethodName = "/proto.AgentService/HealthCheck"
)
@@ -43,8 +43,8 @@ const (
//
// AgentService defines the gRPC service for agent communication
type AgentServiceClient interface {
- // Process handles bidirectional streaming of content between controller and agent
- Process(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[ProcessRequest, ProcessResponse], error)
+ // Connect is used by agents to connect to the controller.
+ Connect(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[AgentMessage, AgentMessage], error)
// HealthCheck checks if the agent is healthy and responsive
HealthCheck(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error)
}
@@ -57,18 +57,18 @@ func NewAgentServiceClient(cc grpc.ClientConnInterface) AgentServiceClient {
return &agentServiceClient{cc}
}
-func (c *agentServiceClient) Process(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[ProcessRequest, ProcessResponse], error) {
+func (c *agentServiceClient) Connect(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[AgentMessage, AgentMessage], error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
- stream, err := c.cc.NewStream(ctx, &AgentService_ServiceDesc.Streams[0], AgentService_Process_FullMethodName, cOpts...)
+ stream, err := c.cc.NewStream(ctx, &AgentService_ServiceDesc.Streams[0], AgentService_Connect_FullMethodName, cOpts...)
if err != nil {
return nil, err
}
- x := &grpc.GenericClientStream[ProcessRequest, ProcessResponse]{ClientStream: stream}
+ x := &grpc.GenericClientStream[AgentMessage, AgentMessage]{ClientStream: stream}
return x, nil
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
-type AgentService_ProcessClient = grpc.BidiStreamingClient[ProcessRequest, ProcessResponse]
+type AgentService_ConnectClient = grpc.BidiStreamingClient[AgentMessage, AgentMessage]
func (c *agentServiceClient) HealthCheck(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
@@ -86,8 +86,8 @@ func (c *agentServiceClient) HealthCheck(ctx context.Context, in *HealthCheckReq
//
// AgentService defines the gRPC service for agent communication
type AgentServiceServer interface {
- // Process handles bidirectional streaming of content between controller and agent
- Process(grpc.BidiStreamingServer[ProcessRequest, ProcessResponse]) error
+ // Connect is used by agents to connect to the controller.
+ Connect(grpc.BidiStreamingServer[AgentMessage, AgentMessage]) error
// HealthCheck checks if the agent is healthy and responsive
HealthCheck(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error)
mustEmbedUnimplementedAgentServiceServer()
@@ -100,11 +100,11 @@ type AgentServiceServer interface {
// pointer dereference when methods are called.
type UnimplementedAgentServiceServer struct{}
-func (UnimplementedAgentServiceServer) Process(grpc.BidiStreamingServer[ProcessRequest, ProcessResponse]) error {
- return status.Errorf(codes.Unimplemented, "method Process not implemented")
+func (UnimplementedAgentServiceServer) Connect(grpc.BidiStreamingServer[AgentMessage, AgentMessage]) error {
+ return status.Error(codes.Unimplemented, "method Connect not implemented")
}
func (UnimplementedAgentServiceServer) HealthCheck(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method HealthCheck not implemented")
+ return nil, status.Error(codes.Unimplemented, "method HealthCheck not implemented")
}
func (UnimplementedAgentServiceServer) mustEmbedUnimplementedAgentServiceServer() {}
func (UnimplementedAgentServiceServer) testEmbeddedByValue() {}
@@ -117,7 +117,7 @@ type UnsafeAgentServiceServer interface {
}
func RegisterAgentServiceServer(s grpc.ServiceRegistrar, srv AgentServiceServer) {
- // If the following call pancis, it indicates UnimplementedAgentServiceServer was
+ // If the following call panics, it indicates UnimplementedAgentServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
@@ -127,12 +127,12 @@ func RegisterAgentServiceServer(s grpc.ServiceRegistrar, srv AgentServiceServer)
s.RegisterService(&AgentService_ServiceDesc, srv)
}
-func _AgentService_Process_Handler(srv interface{}, stream grpc.ServerStream) error {
- return srv.(AgentServiceServer).Process(&grpc.GenericServerStream[ProcessRequest, ProcessResponse]{ServerStream: stream})
+func _AgentService_Connect_Handler(srv interface{}, stream grpc.ServerStream) error {
+ return srv.(AgentServiceServer).Connect(&grpc.GenericServerStream[AgentMessage, AgentMessage]{ServerStream: stream})
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
-type AgentService_ProcessServer = grpc.BidiStreamingServer[ProcessRequest, ProcessResponse]
+type AgentService_ConnectServer = grpc.BidiStreamingServer[AgentMessage, AgentMessage]
func _AgentService_HealthCheck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(HealthCheckRequest)
@@ -166,8 +166,8 @@ var AgentService_ServiceDesc = grpc.ServiceDesc{
},
Streams: []grpc.StreamDesc{
{
- StreamName: "Process",
- Handler: _AgentService_Process_Handler,
+ StreamName: "Connect",
+ Handler: _AgentService_Connect_Handler,
ServerStreams: true,
ClientStreams: true,
},
@@ -267,13 +267,13 @@ type AXServiceServer interface {
type UnimplementedAXServiceServer struct{}
func (UnimplementedAXServiceServer) Exec(*ExecRequest, grpc.ServerStreamingServer[ExecResponse]) error {
- return status.Errorf(codes.Unimplemented, "method Exec not implemented")
+ return status.Error(codes.Unimplemented, "method Exec not implemented")
}
func (UnimplementedAXServiceServer) Fork(context.Context, *ForkRequest) (*ForkResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method Fork not implemented")
+ return nil, status.Error(codes.Unimplemented, "method Fork not implemented")
}
func (UnimplementedAXServiceServer) RegisterAgent(context.Context, *RegisterAgentRequest) (*RegisterAgentResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method RegisterAgent not implemented")
+ return nil, status.Error(codes.Unimplemented, "method RegisterAgent not implemented")
}
func (UnimplementedAXServiceServer) mustEmbedUnimplementedAXServiceServer() {}
func (UnimplementedAXServiceServer) testEmbeddedByValue() {}
@@ -286,7 +286,7 @@ type UnsafeAXServiceServer interface {
}
func RegisterAXServiceServer(s grpc.ServiceRegistrar, srv AXServiceServer) {
- // If the following call pancis, it indicates UnimplementedAXServiceServer was
+ // If the following call panics, it indicates UnimplementedAXServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
diff --git a/test_multi.go b/test_multi.go
index f027cc0..7d50ec0 100644
--- a/test_multi.go
+++ b/test_multi.go
@@ -95,7 +95,7 @@ func main() {
log.Printf("ID: %s\n", execID)
- handler := agent.OutputHandler(func(outgoing *proto.ProcessResponse) error {
+ handler := agent.OutputHandler(func(outgoing *proto.AgentOutputs) error {
for _, c := range outgoing.Contents {
if textContent := c.GetText(); textContent != nil {
fmt.Printf("Output received: %s\n", textContent.Text)
@@ -104,28 +104,42 @@ func main() {
return nil
})
- req := &proto.ProcessRequest{
- Contents: inputs,
+ req := &proto.AgentMessage{
+ ExecId: execID,
+ Msg: &proto.AgentMessage_Start{
+ Start: &proto.AgentStart{
+ AgentId: "planner",
+ Contents: inputs,
+ },
+ },
}
for i := 0; i < 4; i++ {
log.Printf("\n--- Executing step %d ---\n", i+1)
- if err := c.Exec(ctx, execID, "", nil, req, handler); err != nil {
+ if err := c.Exec(ctx, req, handler); err != nil {
log.Fatalf("Error executing step %d: %v\n", i+1, err)
}
// Subsequent execs just ask the planner to continue processing the existing history
- req = &proto.ProcessRequest{}
+ req = &proto.AgentMessage{
+ ExecId: execID,
+ Msg: &proto.AgentMessage_Start{
+ Start: &proto.AgentStart{
+ AgentId: "planner",
+ Contents: inputs,
+ },
+ },
+ }
}
}
func createLocalAgent() (*agent.LocalAgent, error) {
- processFunc := func(ctx context.Context, t *agent.Task, e agent.TaskExecutor, handler agent.OutputHandler) error {
- for _, content := range t.Inputs {
+ processFunc := func(ctx context.Context, execID string, start *proto.AgentStart, e agent.Executor, handler agent.OutputHandler) error {
+ for _, content := range start.Contents {
textContent := content.GetText()
if textContent == nil {
continue
}
- if err := handler(&proto.ProcessResponse{
+ if err := handler(&proto.AgentOutputs{
Contents: []*proto.Content{
{
Role: "assistant",
@@ -155,9 +169,9 @@ func (m *mockPlanner) ID() string { return "__planner
func (m *mockPlanner) Name() string { return "Mock Planner" }
func (m *mockPlanner) HealthCheck(ctx context.Context) error { return nil }
func (m *mockPlanner) Close() error { return nil }
-func (m *mockPlanner) Process(ctx context.Context, t *agent.Task, e agent.TaskExecutor, handler agent.OutputHandler) error {
+func (m *mockPlanner) Connect(ctx context.Context, execID string, start *proto.AgentStart, e agent.Executor, handler agent.OutputHandler) error {
var lastText string
- for _, c := range t.Inputs {
+ for _, c := range start.Contents {
if textMsg := c.GetText(); textMsg != nil {
lastText = textMsg.Text
}
@@ -165,52 +179,49 @@ func (m *mockPlanner) Process(ctx context.Context, t *agent.Task, e agent.TaskEx
// Step 1: User -> Local
if strings.HasPrefix(lastText, "Send the word") {
- inputs := append(t.Inputs, &proto.Content{
+ inputs := append(start.Contents, &proto.Content{
Role: "assistant",
Content: &proto.Content_Text{
Text: &proto.TextContent{Text: "oRanGe"},
},
})
- return e.Exec(ctx, &agent.Task{
- ID: "local-echo",
- AgentID: "local-echo-agent",
- Inputs: inputs,
+ return e.Exec(ctx, "local-echo", &proto.AgentStart{
+ AgentId: "local-echo-agent",
+ Contents: inputs,
}, handler)
}
// Step 2: Local -> Remote
if lastText == "orange" {
- inputs := append(t.Inputs, &proto.Content{
+ inputs := append(start.Contents, &proto.Content{
Role: "assistant",
Content: &proto.Content_Text{
Text: &proto.TextContent{Text: lastText},
},
})
- return e.Exec(ctx, &agent.Task{
- ID: "remote-text",
- AgentID: "remote-text-processor",
- Inputs: inputs,
+ return e.Exec(ctx, "remote-text", &proto.AgentStart{
+ AgentId: "remote-text-processor",
+ Contents: inputs,
}, handler)
}
// Step 3: Remote -> Sandbox
if strings.HasPrefix(lastText, "Remote Prefix:") {
- inputs := append(t.Inputs, &proto.Content{
+ inputs := append(start.Contents, &proto.Content{
Role: "assistant",
Content: &proto.Content_Text{
Text: &proto.TextContent{Text: lastText},
},
})
- return e.Exec(ctx, &agent.Task{
- ID: "uppercase-task",
- AgentID: "uppercase",
- Inputs: inputs,
+ return e.Exec(ctx, "uppercase-task", &proto.AgentStart{
+ AgentId: "uppercase",
+ Contents: inputs,
}, handler)
}
// Final step: Sandbox -> Done
if strings.Contains(lastText, "UPPERCASE") {
- return handler(&proto.ProcessResponse{
+ return handler(&proto.AgentOutputs{
Contents: []*proto.Content{{
Role: "assistant",
Content: &proto.Content_Text{