client

package
v0.2.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 11, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const JWTTokenKey contextKey = "jwtToken"

JWTTokenKey is used for JWT token context propagation

Variables

View Source
var JWTTokenKeyStruct = jwtContextKey{}

Use exact same variable name and type as starops-agent middleware

Functions

This section is empty.

Types

type RemoteAgentClient

type RemoteAgentClient struct {
	// contains filtered or unexported fields
}

RemoteAgentClient handles communication with remote agents via gRPC

func NewRemoteAgentClient

func NewRemoteAgentClient(config RemoteAgentConfig) *RemoteAgentClient

NewRemoteAgentClient creates a new remote agent client

func (*RemoteAgentClient) ApproveExecutionPlan

func (r *RemoteAgentClient) ApproveExecutionPlan(ctx context.Context, planID string, approved bool, modifications string) (*pb.ApprovalResponse, error)

ApproveExecutionPlan approves an execution plan via the remote agent

func (*RemoteAgentClient) Connect

func (r *RemoteAgentClient) Connect() error

Connect establishes a connection to the remote agent service

func (*RemoteAgentClient) Disconnect

func (r *RemoteAgentClient) Disconnect() error

Disconnect closes the connection to the remote agent service

func (*RemoteAgentClient) GenerateExecutionPlan

func (r *RemoteAgentClient) GenerateExecutionPlan(ctx context.Context, input string) (*pb.PlanResponse, error)

GenerateExecutionPlan generates an execution plan via the remote agent

func (*RemoteAgentClient) GetCapabilities

func (r *RemoteAgentClient) GetCapabilities(ctx context.Context) (*pb.CapabilitiesResponse, error)

GetCapabilities retrieves capabilities from the remote agent

func (*RemoteAgentClient) GetMetadata

func (r *RemoteAgentClient) GetMetadata(ctx context.Context) (*pb.MetadataResponse, error)

GetMetadata retrieves metadata from the remote agent

func (*RemoteAgentClient) GetURL

func (r *RemoteAgentClient) GetURL() string

GetURL returns the URL of the remote agent

func (*RemoteAgentClient) Health

Health checks the health of the remote agent service

func (*RemoteAgentClient) IsConnected

func (r *RemoteAgentClient) IsConnected() bool

IsConnected returns true if the client is connected

func (*RemoteAgentClient) OnComplete added in v0.0.35

func (r *RemoteAgentClient) OnComplete(handler func()) *RemoteAgentClient

OnComplete registers a handler for completion events

func (*RemoteAgentClient) OnContent added in v0.0.35

func (r *RemoteAgentClient) OnContent(handler func(string)) *RemoteAgentClient

OnContent registers a handler for content events

func (*RemoteAgentClient) OnError added in v0.0.35

func (r *RemoteAgentClient) OnError(handler func(error)) *RemoteAgentClient

OnError registers a handler for error events

func (*RemoteAgentClient) OnThinking added in v0.0.35

func (r *RemoteAgentClient) OnThinking(handler func(string)) *RemoteAgentClient

OnThinking registers a handler for thinking events

func (*RemoteAgentClient) OnToolCall added in v0.0.35

func (r *RemoteAgentClient) OnToolCall(handler func(*interfaces.ToolCallEvent)) *RemoteAgentClient

OnToolCall registers a handler for tool call events

func (*RemoteAgentClient) OnToolResult added in v0.0.35

func (r *RemoteAgentClient) OnToolResult(handler func(*interfaces.ToolCallEvent)) *RemoteAgentClient

OnToolResult registers a handler for tool result events

func (*RemoteAgentClient) Ready

Ready checks if the remote agent service is ready

func (*RemoteAgentClient) Run

func (r *RemoteAgentClient) Run(ctx context.Context, input string) (string, error)

Run executes the remote agent with the given input

func (*RemoteAgentClient) RunStream added in v0.0.35

func (r *RemoteAgentClient) RunStream(ctx context.Context, input string) (<-chan interfaces.AgentStreamEvent, error)

RunStream executes the remote agent with streaming response

func (*RemoteAgentClient) RunStreamWithAuth added in v0.0.35

func (r *RemoteAgentClient) RunStreamWithAuth(ctx context.Context, input string, authToken string) (<-chan interfaces.AgentStreamEvent, error)

RunStreamWithAuth executes the remote agent with streaming response and explicit auth token

func (*RemoteAgentClient) RunWithAuth added in v0.0.29

func (r *RemoteAgentClient) RunWithAuth(ctx context.Context, input string, authToken string) (string, error)

RunWithAuth executes the remote agent with explicit auth token

func (*RemoteAgentClient) SetRetryCount

func (r *RemoteAgentClient) SetRetryCount(count int)

SetRetryCount sets the number of retries for failed requests

func (*RemoteAgentClient) SetTimeout

func (r *RemoteAgentClient) SetTimeout(timeout time.Duration)

SetTimeout sets the timeout for requests

func (*RemoteAgentClient) Stream added in v0.0.35

func (r *RemoteAgentClient) Stream(ctx context.Context, input string) error

Stream executes the remote agent with registered event handlers

func (*RemoteAgentClient) StreamWithAuth added in v0.0.35

func (r *RemoteAgentClient) StreamWithAuth(ctx context.Context, input string, authToken string) error

StreamWithAuth executes the remote agent with registered event handlers and explicit auth token

type RemoteAgentConfig

type RemoteAgentConfig struct {
	URL        string
	Timeout    time.Duration
	RetryCount int
}

RemoteAgentConfig configures the remote agent client

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL