Documentation
¶
Overview ¶
Package backend provides the ConnectRPC client for the Kontext AgentService. Authenticates with the user's OIDC bearer token from `kontext login`. No client secrets, no client_credentials grant.
Index ¶
- func BaseURL() string
- type Client
- func (c *Client) BootstrapCli(ctx context.Context, req *agentv1.BootstrapCliRequest) (*agentv1.BootstrapCliResponse, error)
- func (c *Client) CreateSession(ctx context.Context, req *agentv1.CreateSessionRequest) (*agentv1.CreateSessionResponse, error)
- func (c *Client) EndSession(ctx context.Context, sessionID string) error
- func (c *Client) Heartbeat(ctx context.Context, sessionID string) error
- func (c *Client) IngestEvent(ctx context.Context, req *agentv1.ProcessHookEventRequest) error
- type TokenSource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps the ConnectRPC AgentService client.
func NewClient ¶
func NewClient(baseURL string, ts TokenSource) *Client
NewClient creates a ConnectRPC client that fetches a fresh token per request.
func (*Client) BootstrapCli ¶ added in v0.3.0
func (c *Client) BootstrapCli(ctx context.Context, req *agentv1.BootstrapCliRequest) (*agentv1.BootstrapCliResponse, error)
BootstrapCli prepares the shared CLI application for env template sync.
func (*Client) CreateSession ¶
func (c *Client) CreateSession(ctx context.Context, req *agentv1.CreateSessionRequest) (*agentv1.CreateSessionResponse, error)
CreateSession creates a governed agent session.
func (*Client) EndSession ¶
EndSession terminates a session.
func (*Client) IngestEvent ¶
IngestEvent sends a single hook event via the ProcessHookEvent unary RPC.
type TokenSource ¶
TokenSource returns a valid access token, refreshing if necessary.
func StaticToken ¶
func StaticToken(token string) TokenSource
StaticToken returns a TokenSource that always returns the same token. Useful for tests or short-lived commands.