wire

package
v1.58.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package wire is the (work-in-progress) HTTP transport for pkg/runtime. It exposes the runtime.LoadTeamRequest and runtime.CreateSessionRequest payloads as JSON-over-HTTP endpoints so a future docker-agent server process can host the same backend a docker-agent CLI process today drives in-process.

Today the package contains only the server-side decode/encode scaffolding plus an in-process round-trip test. There is no client (a future commit adds wire.Client driving runtime.RemoteRuntime), no streaming endpoint (a future commit adds /v1/session/run), and no authentication (deliberately out of scope for the scaffold).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(b Backend) http.Handler

NewHandler returns an http.Handler that decodes the JSON request payloads, dispatches to b, and JSON-encodes the response.

Routes (subject to versioning under /v1/):

  • POST /v1/team/load -> Backend.LoadTeam
  • POST /v1/session/create -> Backend.CreateSession

Types

type Backend

type Backend interface {
	LoadTeam(ctx context.Context, req runtime.LoadTeamRequest) (LoadTeamResponse, error)
	CreateSession(ctx context.Context, req runtime.CreateSessionRequest) (CreateSessionResponse, error)
}

Backend is the surface a wire.Server expects. It is the wire-side mirror of cmd/root.backend without the cleanup-closure return values — those are owned server-side and don't cross the wire.

type CreateSessionResponse

type CreateSessionResponse struct {
	SessionID string `json:"session_id"`
}

CreateSessionResponse identifies a freshly created session. The session document itself comes back later via the (yet-to-be-added) /v1/session/run streaming endpoint.

type LoadTeamResponse

type LoadTeamResponse struct {
	AgentNames   []string `json:"agent_names,omitempty"`
	DefaultAgent string   `json:"default_agent,omitempty"`
}

LoadTeamResponse summarises the result of a LoadTeam call. It carries the bare minimum a client needs to tell the user 'the team loaded; here are the agents you can talk to'. The server-side LoadResult itself is intentionally NOT returned: it holds live toolset handles the client cannot use.

Jump to

Keyboard shortcuts

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