remote

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package remote is an explicit user-authenticated client for real Airlock deployment targets. It does not start an application, database or local host.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentRun

type AgentRun = wire.AgentRunInfo

type Binding

type Binding = airlockv1.TargetBindingInfo

type BindingSelection

type BindingSelection = airlockv1.SetTargetBindingRequest

type Client

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

func New

func New(config Config) (*Client, error)

func (*Client) CancelAgent

func (c *Client) CancelAgent(ctx context.Context, definition, id string) (*AgentRun, error)

func (*Client) CancelTest

func (c *Client) CancelTest(ctx context.Context, id string) (*TestRun, error)

func (*Client) ContinueAgent

func (c *Client) ContinueAgent(ctx context.Context, definition, session, requestID, contractHash, prompt string) (*AgentRun, error)

func (*Client) CreatePreview

func (c *Client) CreatePreview(ctx context.Context) (*Deployment, error)

CreatePreview creates an independent creator-associated deployment. Select its returned concrete name or ID in a new client for subsequent operations.

func (*Client) Get

func (c *Client) Get(ctx context.Context) (*Deployment, error)

func (*Client) GetAgent

func (c *Client) GetAgent(ctx context.Context, definition, id string) (*AgentRun, error)

func (*Client) GetTest

func (c *Client) GetTest(ctx context.Context, id string) (*TestRun, error)

func (*Client) InvokeTool

func (c *Client) InvokeTool(ctx context.Context, name string, input *structpb.Value) (*ToolResult, error)

func (*Client) Lifecycle

func (c *Client) Lifecycle(ctx context.Context, action string) error

Lifecycle changes only the selected deployment. Data/bindings are retained by the host. Refresh Get separately to inspect actual running state.

func (*Client) ListAgents

func (c *Client) ListAgents(ctx context.Context, definition string) ([]AgentRun, error)

func (*Client) ListBindings

func (c *Client) ListBindings(ctx context.Context) (*Bindings, error)

func (*Client) OpenAcceptedArtifact

func (c *Client) OpenAcceptedArtifact(ctx context.Context, definition, id string, index int) (io.ReadCloser, error)

OpenAcceptedArtifact streams an exact ordinal in the completed run's pinned manifest.

func (*Client) Request

func (c *Client) Request(ctx context.Context, method, path string, body io.Reader, headers http.Header) (*http.Response, error)

Request drives a declared route through Airlock's real HTTP admission. The caller owns the response body. Redirects are returned without following them.

func (*Client) RunTests

func (c *Client) RunTests(ctx context.Context, request *TestRequest) (*TestRun, error)

func (*Client) SetBinding

func (c *Client) SetBinding(ctx context.Context, typ, slot string, selection *BindingSelection) (*Bindings, error)

func (*Client) SetPolicy

func (c *Client) SetPolicy(ctx context.Context, policy *Policy) (*Deployment, error)

func (*Client) StartAgent

func (c *Client) StartAgent(ctx context.Context, definition, requestID, contractHash string, input *structpb.Value) (*AgentRun, error)

func (*Client) WaitAgent

func (c *Client) WaitAgent(ctx context.Context, definition, id string, poll time.Duration) (*AgentRun, error)

WaitAgent cancels observation when ctx ends; cancelling work is explicit.

func (*Client) WaitTest

func (c *Client) WaitTest(ctx context.Context, id string, poll time.Duration) (*TestRun, error)

type Config

type Config struct {
	URL, AppID, Target, Revision string
	HTTPClient                   *http.Client
	Token                        func(context.Context) (string, error)
}

Config identifies one logical application on one Airlock instance. Target is production by default; previews use a concrete deployment name or ID. Revision, when set, pins observation to that immutable source revision. Tokens are user/operator credentials, never SDK app credentials or caller assertions.

type Deployment

type Deployment = airlockv1.DeploymentInfo

Deployment is the generated operator contract, shared with the Airlock API.

type HTTPError

type HTTPError struct {
	StatusCode int
	Body       string
}

HTTPError preserves API status without falling back to another target.

func (*HTTPError) Error

func (e *HTTPError) Error() string

type TestClient

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

func NewTestClient

func NewTestClient(config TestConfig) (*TestClient, error)

func TestClientFromEnvironment

func TestClientFromEnvironment() (*TestClient, error)

TestClientFromEnvironment reads only explicit opaque runner coordinates. No CLI login store, provider account, database DSN or host emulator is consulted.

func (*TestClient) CancelAgent

func (c *TestClient) CancelAgent(ctx context.Context, definition, id string) (*AgentRun, error)

func (*TestClient) GetAgent

func (c *TestClient) GetAgent(ctx context.Context, definition, id string) (*AgentRun, error)

func (*TestClient) InvokeTool

func (c *TestClient) InvokeTool(ctx context.Context, name string, input *structpb.Value) (*ToolResult, error)

func (*TestClient) Request

func (c *TestClient) Request(ctx context.Context, method, path string, body io.Reader, headers http.Header) (*http.Response, error)

The scoped client exposes execution only, never binding/deployment/inventory.

func (*TestClient) StartAgent

func (c *TestClient) StartAgent(ctx context.Context, definition, requestID, contractHash string, input *structpb.Value) (*AgentRun, error)

func (*TestClient) WaitAgent

func (c *TestClient) WaitAgent(ctx context.Context, definition, id string, poll time.Duration) (*AgentRun, error)

type TestConfig

type TestConfig struct {
	APIRoot, Token, AppID, DeploymentID, Revision string
	RuntimeGeneration                             int64
	HTTPClient                                    *http.Client
}

TestConfig is supplied by the host runner, not a laptop login or app token. The API root is an exact /api/test-runs/UUID capability namespace.

Jump to

Keyboard shortcuts

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