uiapi

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: MIT Imports: 55 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package uiapi serves Sidecar's UI API v0 (docs/reference/ui-api.md).

It owns transport, trust and the HTTP/WebSocket mapping only. What a terminal stream means and what a Sessions row says belong to the packages behind Backend, which `sidecar mobile serve --stdio` and `sidecar mobile sessions --json` use unchanged; this package never decides either.

Index

Constants

View Source
const (
	CodeHostRefused         = "host_refused"
	CodeOriginRefused       = "origin_refused"
	CodeMutationRefused     = "mutation_refused"
	CodeUnauthenticated     = "unauthenticated"
	CodeLoginRefused        = "tailnet_login_refused"
	CodeLocalOnly           = "local_only"
	CodeNotServedHere       = "not_served_here"
	CodeNotFound            = "not_found"
	CodeMethod              = "method_not_allowed"
	CodeInvalidRequest      = "invalid_request"
	CodeOriginNotFound      = "origin_not_found"
	CodePairingInvalid      = "pairing_code_invalid"
	CodeSessionProofInvalid = "session_proof_invalid"
	CodeTooMany             = "too_many_outstanding"
	CodeBackend             = "backend"
	CodeUpgradeRequired     = "upgrade_required"
)

Error codes the API adds to the mobile protocol's refusal vocabulary.

View Source
const (
	// APIVersion is the wire contract version in every route path.
	APIVersion = 0
	// DefaultPort is the Browser listener's default loopback port.
	DefaultPort = 7861
)
View Source
const (
	CloseProtocolViolation websocket.StatusCode = 4400
	CloseUnauthenticated   websocket.StatusCode = 4401
	CloseOriginRefused     websocket.StatusCode = 4403
	CloseShuttingDown      websocket.StatusCode = 4409
	// CloseTooManyTerminals is the WebSocket form of too_many_outstanding.
	CloseTooManyTerminals websocket.StatusCode = 4429
)

Close codes for /api/v0/terminal.

View Source
const ScopeContentRead = "content:read"
View Source
const ScopeFull = "full"

ScopeFull grants every API capability, including narrower scoped routes.

View Source
const ScopeUIControl = "ui:control"
View Source
const ScopeWorkspaceWrite = "workspace:write"
View Source
const SessionStorageKey = "sidecar.session"

SessionStorageKey names the legacy bearer key, removed during migration. Browser authentication now persists only a non-extractable CryptoKey.

Variables

View Source
var ErrNotRunning = errors.New("no Sidecar API server is running; start one with `sidecar api serve`")

ErrNotRunning reports that no endpoint file names a live server.

Functions

func BrowserProofMessage

func BrowserProofMessage(origin, id, nonce string, timestamp int64) string

func CheckServiceInstall

func CheckServiceInstall(stateDir string, managedPID int) error

CheckServiceInstall refuses a service alongside an existing foreground server. The lock is authoritative even before discovery is published or if it is lost. A held lock is replaceable only when discovery identifies the manager's PID.

func Dir

func Dir(stateDir string) string

Dir is where the API keeps its sockets, endpoint and paired origins.

func EndpointPath

func EndpointPath(stateDir string) string

EndpointPath is the discovery file for a state tree.

func NormalizeOrigin

func NormalizeOrigin(raw string) (string, error)

NormalizeOrigin returns the serialized origin a browser would send for raw, or an error that says what is wrong with it.

func ParseCatalogQuery

func ParseCatalogQuery(values url.Values) (mobileproto.CatalogQuery, error)

ParseCatalogQuery maps the sessions route's query parameters onto the protocol's catalog_query, refusing anything it does not name.

func Spec

func Spec() ([]byte, error)

Spec generates the public OpenAPI 3.1 contract from the same wire types used by handlers, CLI clients and the terminal service. It performs no I/O.

func WatchExecutable

func WatchExecutable(ctx context.Context, path string, interval time.Duration) (<-chan struct{}, error)

WatchExecutable follows the original launch path, including every symlink. Replacements and in-place changes cause a clean server shutdown. A temporarily missing path during an upgrade is ignored until its replacement arrives.

Types

type APIError

type APIError struct {
	Status int
	ErrorDetail
}

APIError is a decoded API refusal, as the CLI client reports it.

func (*APIError) Error

func (e *APIError) Error() string

type AlreadyRunningError

type AlreadyRunningError struct{ PID int }

AlreadyRunningError is the single-instance refusal.

func (*AlreadyRunningError) Error

func (e *AlreadyRunningError) Error() string

type AttentionEvent

type AttentionEvent struct {
	Kind      string    `json:"kind" jsonschema:"enum=needs_input,enum=finished"`
	CatalogID string    `json:"catalog_id"`
	Title     string    `json:"title"`
	Time      time.Time `json:"time"`
}

type Backend

type Backend interface {
	Sessions(ctx context.Context, query mobileproto.CatalogQuery) (mobileproto.CatalogSnapshot, error)
	ServeTerminal(ctx context.Context, input io.Reader, output io.Writer) error
}

Backend is the library seam the API maps onto. One Backend lives for the whole server process; ServeTerminal is called once per terminal connection and owns that stream until input reaches EOF or ctx ends.

type BrowserPublicKey

type BrowserPublicKey struct {
	Kty    string   `json:"kty"`
	Crv    string   `json:"crv"`
	X      string   `json:"x"`
	Y      string   `json:"y"`
	KeyOps []string `json:"key_ops,omitempty"`
	Ext    *bool    `json:"ext,omitempty"`
}

BrowserPublicKey is the public portion of an ECDSA P-256 JWK. The wire decoder rejects a private d field; key_ops/ext from WebCrypto are advisory.

type CatalogChangeSource

type CatalogChangeSource interface {
	WatchCatalog(context.Context) (<-chan struct{}, error)
}

CatalogChangeSource supplies real invalidations, not a catalog polling clock. One subscription lives for the API process. A buffered signal may coalesce any number of changes; Sessions must always return the current snapshot.

type ClientInfo

type ClientInfo struct {
	ID       string    `json:"id"`
	Kind     string    `json:"kind"`
	Listener Listener  `json:"listener"`
	Auth     string    `json:"auth"`
	Origin   string    `json:"origin,omitempty"`
	Login    string    `json:"login,omitempty"`
	Since    time.Time `json:"since"`
}

ClientInfo is one connected client in status.

type ContentBackend

ContentBackend preserves the shared content DTOs at the transport seam.

type ContentEvent

type ContentEvent struct {
	Resources []ContentRef `json:"resources"`
}

type ContentRef

type ContentRef struct {
	Project   string `json:"project"`
	Workspace string `json:"workspace,omitempty"`
	Kind      string `json:"kind"`
	Target    string `json:"target,omitempty"`
	Operation string `json:"operation,omitempty"`
	Path      string `json:"path,omitempty"`
}

ContentRef is one currently open content pane. Reconnect events with a new set when panes change; subscriptions belong to the socket, not durable state.

type ContentWatchSource

type ContentWatchSource interface {
	WatchProject(context.Context, string, string, contentservice.ReadParams) ([]livewatch.Target, error)
}

type Endpoint

type Endpoint struct {
	PID           int       `json:"pid"`
	Version       string    `json:"version"`
	APIVersion    int       `json:"api_version"`
	APIInstance   string    `json:"api_instance"`
	StartedAt     time.Time `json:"started_at"`
	UnixSocket    string    `json:"unix_socket"`
	TCP           string    `json:"tcp"`
	TailnetSocket string    `json:"tailnet_socket,omitempty"`
	TailnetTCP    string    `json:"tailnet_tcp,omitempty"`
}

Endpoint is $STATE/api/endpoint.json: how local CLI verbs and SDK users find the one running server.

func ReadEndpoint

func ReadEndpoint(stateDir string) (Endpoint, error)

ReadEndpoint reads the discovery file and refuses one whose process is gone.

type ErrorBody

type ErrorBody struct {
	Error ErrorDetail `json:"error"`
}

ErrorBody is the shape of every API error.

type ErrorDetail

type ErrorDetail struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

ErrorDetail names a machine code and one human sentence that says what to do.

type EventMessage

type EventMessage struct {
	Viewer        *ViewerIdentity               `json:"viewer,omitempty"`
	UIRequest     *UIRequestEvent               `json:"ui_request,omitempty"`
	Type          string                        `` /* 159-byte string literal not displayed */
	Seq           uint64                        `json:"seq" jsonschema:"minimum=1"`
	APIVersion    int                           `json:"api_version" jsonschema:"enum=0"`
	APIInstance   string                        `json:"api_instance,omitempty"`
	ServerVersion string                        `json:"server_version,omitempty"`
	Capabilities  []string                      `json:"capabilities,omitempty"`
	Catalog       *mobileproto.CatalogSnapshot  `json:"catalog,omitempty"`
	Attention     *AttentionEvent               `json:"attention,omitempty"`
	Terminals     *[]EventTerminal              `json:"terminals,omitempty"`
	Error         *ErrorDetail                  `json:"error,omitempty"`
	Workspace     *workspacewire.WorkspaceEvent `json:"workspace,omitempty"`
	Content       *ContentEvent                 `json:"content,omitempty"`
	Reason        string                        `json:"reason,omitempty"`
}

EventMessage is one text frame (or one JSONL line on the CLI bridge). Seq starts at 1 with hello, increases on delivery, and resets on reconnect.

type EventTerminal

type EventTerminal struct {
	ClientID    string          `json:"client_id"`
	OwnerHostID string          `json:"owner_host_id,omitempty"`
	Session     string          `json:"session"`
	Pane        string          `json:"pane"`
	DisplayName string          `json:"display_name,omitempty"`
	Holder      *GeometryHolder `json:"holder" jsonschema:"nullable"`
}

type FixtureBackend

type FixtureBackend struct {
	Status Status
	// contains filtered or unexported fields
}

FixtureBackend serves recorded resource data through the real server and runs the real terminal protocol Service with a synthetic capture adapter.

func LoadFixtures

func LoadFixtures(dir string) (*FixtureBackend, error)

LoadFixtures requires a project-ordered sessions.json and status.json. Files are bounded and decoded strictly; malformed fixture authority fails at start.

func (*FixtureBackend) LookupProject

func (b *FixtureBackend) LookupProject(_ context.Context, project, workspace string) (contentservice.Workspace, error)

func (*FixtureBackend) Projects

func (*FixtureBackend) ReadProject

func (b *FixtureBackend) ReadProject(ctx context.Context, project, workspace string, p contentservice.ReadParams) (contentservice.ReadResult, error)

func (*FixtureBackend) ServeTerminal

func (b *FixtureBackend) ServeTerminal(ctx context.Context, input io.Reader, output io.Writer) error

func (*FixtureBackend) Sessions

func (*FixtureBackend) TreeProject

func (b *FixtureBackend) TreeProject(ctx context.Context, project, workspace string, paths []string) (contentservice.TreeResult, error)

func (*FixtureBackend) WatchProject

func (b *FixtureBackend) WatchProject(ctx context.Context, project, workspace string, p contentservice.ReadParams) ([]livewatch.Target, error)

func (*FixtureBackend) Workspace

func (b *FixtureBackend) Workspace(ctx context.Context, project, host string, q mobileproto.CatalogQuery) (workspacewire.Workspace, error)

func (*FixtureBackend) WorkspaceInvalidation

func (b *FixtureBackend) WorkspaceInvalidation(ctx context.Context) (workspacewire.WorkspaceEvent, error)

func (*FixtureBackend) WorkspaceOperation

type GeometryHolder

type GeometryHolder struct {
	Kind  string `json:"kind"`
	Label string `json:"label"`
}

type GeometryHolderSource

type GeometryHolderSource interface {
	GeometryHolder(context.Context, TerminalInfo) *GeometryHolder
}

GeometryHolderSource observes only sessions with open API attachments. The holder is presentation data, never a lease token or instance identity.

type Hello

type Hello struct {
	APIVersion    int              `json:"api_version"`
	APIInstance   string           `json:"api_instance"`
	ServerVersion string           `json:"server_version"`
	Capabilities  []string         `json:"capabilities"`
	Terminal      TerminalProtocol `json:"terminal"`
}

Hello is GET /api/v0/hello.

type LayoutDocument

type LayoutDocument = viewerlayout.Document

LayoutDocument is the shared layout store document, with no cell geometry.

type Listener

type Listener string

Listener names one of the three trust surfaces.

const (
	ListenerLocal   Listener = "local"
	ListenerBrowser Listener = "browser"
	ListenerTailnet Listener = "tailnet"
)

type ListenerInfo

type ListenerInfo struct {
	Name    Listener `json:"name"`
	Network string   `json:"network"`
	Address string   `json:"address"`
	Host    string   `json:"host,omitempty"`
}

ListenerInfo describes one bound listener in status.

type LocalClient

type LocalClient struct {
	Endpoint Endpoint
	// contains filtered or unexported fields
}

LocalClient talks to a running server over its Local Unix socket, where no guard or credential applies. CLI verbs and tests use it.

func NewLocalClient

func NewLocalClient(stateDir string) (*LocalClient, error)

NewLocalClient discovers the server for stateDir through endpoint.json.

func NewLocalClientForSocket

func NewLocalClientForSocket(endpoint Endpoint) *LocalClient

NewLocalClientForSocket builds a client for an already-known endpoint.

func (*LocalClient) Do

func (c *LocalClient) Do(ctx context.Context, method, path string, body, out any) error

Do sends one request and decodes a success into out, or returns *APIError.

func (*LocalClient) HTTPClient

func (c *LocalClient) HTTPClient() *http.Client

HTTPClient exposes the socket-bound client, for WebSocket dialing.

func (*LocalClient) ListOrigins

func (c *LocalClient) ListOrigins(ctx context.Context) (OriginList, error)

ListOrigins lists paired origins without tokens.

func (*LocalClient) PairOrigin

func (c *LocalClient) PairOrigin(ctx context.Context, origin string, scopes ...string) (OriginRegistration, error)

PairOrigin registers origin and returns its one-time-visible token.

func (*LocalClient) PairingCode

func (c *LocalClient) PairingCode(ctx context.Context, next string) (PairingCode, error)

PairingCode issues a one-time code for the same-origin UI.

func (*LocalClient) RevokeOrigin

func (c *LocalClient) RevokeOrigin(ctx context.Context, origin string) (OriginRevocation, error)

RevokeOrigin removes one paired origin.

func (*LocalClient) RevokeSessions

func (c *LocalClient) RevokeSessions(ctx context.Context, origin string) (SessionRevocation, error)

RevokeSessions drops every browser session, or only origin's when origin is not empty.

func (*LocalClient) Status

func (c *LocalClient) Status(ctx context.Context) (Status, error)

Status reads GET /api/v0/status.

func (*LocalClient) URL

func (c *LocalClient) URL(path string) string

URL is the request URL for path on the Local listener.

type OperationError

type OperationError struct {
	Code, Message string
	ExitCode      int
}

OperationError retains the CLI refusal and status across HTTP and remote calls.

func (*OperationError) Error

func (e *OperationError) Error() string

type Options

type Options struct {
	StateDir string
	// Inherited supplies already-acquired manager listeners. Start owns them on
	// success; the caller closes them on failure. Nil discovers manager sockets.
	Inherited []apiservice.ActivatedListener
	// Port is the Browser listener's loopback port; 0 picks a free one.
	Port          int
	UIDir         string
	Tailnet       *TailnetOptions
	Backend       Backend
	Content       ContentBackend
	Version       string
	FixtureStatus *Status
	Now           func() time.Time
	Logf          func(format string, args ...any)
	// KeepaliveInterval and KeepaliveTimeout govern terminal WebSocket pings;
	// zero means 30s and 15s.
	KeepaliveInterval time.Duration
	KeepaliveTimeout  time.Duration
	// KeepaliveStallTimeout bounds how long a blocked inbound pump may excuse
	// missing pongs. Zero means one minute.
	KeepaliveStallTimeout time.Duration
}

Options configures Start.

type OriginList

type OriginList struct {
	Origins []PairedOrigin `json:"origins"`
}

OriginList is GET /api/v0/origins.

type OriginRecord

type OriginRecord struct {
	Origin      string    `json:"origin"`
	TokenSHA256 string    `json:"token_sha256"`
	Scopes      []string  `json:"scopes"`
	CreatedAt   time.Time `json:"created_at"`
}

OriginRecord is one paired origin as persisted. The bearer token itself is never stored, only its SHA-256.

type OriginRegistration

type OriginRegistration struct {
	Origin string   `json:"origin"`
	Token  string   `json:"token"`
	Scopes []string `json:"scopes"`
}

OriginRegistration is POST /api/v0/origins. The token appears only here.

type OriginRequest

type OriginRequest struct {
	Origin string   `json:"origin"`
	Scopes []string `json:"scopes,omitempty"`
}

type OriginRevocation

type OriginRevocation struct {
	Origin  string `json:"origin"`
	Revoked bool   `json:"revoked"`
}

OriginRevocation is DELETE /api/v0/origins.

type PairedOrigin

type PairedOrigin struct {
	Origin    string    `json:"origin"`
	Scopes    []string  `json:"scopes"`
	CreatedAt time.Time `json:"created_at"`
}

PairedOrigin is a registration as listed: never the token or its hash.

type PairingCode

type PairingCode struct {
	Code      string    `json:"code"`
	URL       string    `json:"url"`
	ExpiresAt time.Time `json:"expires_at"`
}

PairingCode is POST /api/v0/pairing/codes.

type PairingCodeRequest

type PairingCodeRequest struct {
	Next string `json:"next,omitempty"`
}

type PairingExchange

type PairingExchange struct {
	RegistrationID string    `json:"registration_id"`
	ExpiresAt      time.Time `json:"expires_at"`
	Token          string    `json:"token"`
	Next           string    `json:"next"`
}

PairingExchange is POST /api/v0/pairing/exchange: a browser session token for the same-origin UI, and the validated path to land on.

type PairingExchangeRequest

type PairingExchangeRequest struct {
	PublicKey BrowserPublicKey `json:"public_key"`
	Code      string           `json:"code"`
	Next      string           `json:"next,omitempty"`
}

type Server

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

Server is one running API process.

func Start

func Start(opts Options) (*Server, error)

Start binds every listener, writes endpoint.json and begins serving. It refuses while another server holds the same state tree.

func (*Server) BrowserURL

func (s *Server) BrowserURL() string

BrowserURL is the Browser listener's base URL.

func (*Server) Endpoint

func (s *Server) Endpoint() Endpoint

Endpoint is what this server recorded in endpoint.json.

func (*Server) Failed

func (s *Server) Failed() <-chan error

Failed delivers a listener that stopped serving unexpectedly.

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

Shutdown closes every terminal stream with 4409, stops the listeners and removes endpoint.json. Leases are released by the streams themselves, exactly as on stdin EOF.

type SessionProofChallenge

type SessionProofChallenge struct {
	Nonce     string    `json:"nonce"`
	Timestamp int64     `json:"timestamp"`
	ExpiresAt time.Time `json:"expires_at"`
}

type SessionProofChallengeRequest

type SessionProofChallengeRequest struct {
	RegistrationID string `json:"registration_id"`
}

SessionProofChallengeRequest names an origin-bound public-key registration.

type SessionProofRequest

type SessionProofRequest struct {
	RegistrationID string `json:"registration_id"`
	Nonce          string `json:"nonce"`
	Timestamp      int64  `json:"timestamp"`
	Signature      string `json:"signature"`
}

type SessionRevocation

type SessionRevocation struct {
	Origin          string `json:"origin,omitempty"`
	Revoked         int    `json:"revoked"`
	TerminalsClosed int    `json:"terminals_closed"`
}

SessionRevocation is DELETE /api/v0/pairing/sessions.

type SessionToken

type SessionToken struct {
	Token     string    `json:"token"`
	ExpiresAt time.Time `json:"expires_at"`
}

type Status

type Status struct {
	APIVersion    int            `json:"api_version"`
	APIInstance   string         `json:"api_instance"`
	ServerVersion string         `json:"server_version"`
	UIDir         *string        `json:"ui_dir,omitempty"`
	UIConfigured  bool           `json:"ui_configured"`
	PID           int            `json:"pid"`
	StartedAt     time.Time      `json:"started_at"`
	Listeners     []ListenerInfo `json:"listeners"`
	Clients       []ClientInfo   `json:"clients"`
	Terminals     []TerminalInfo `json:"terminals"`
}

Status is GET /api/v0/status and `sidecar api status --json`.

type TailnetIdentity

type TailnetIdentity struct {
	Host       string
	OwnerLogin string
}

TailnetIdentity is what the Tailnet listener needs from Tailscale: the node's MagicDNS name and the login that owns the node.

func ParseTailscaleStatus

func ParseTailscaleStatus(data []byte) (TailnetIdentity, error)

ParseTailscaleStatus extracts the node identity from `tailscale status --json` output.

func TailscaleStatusIdentity

func TailscaleStatusIdentity(ctx context.Context) (TailnetIdentity, error)

TailscaleStatusIdentity reads the local node's identity from the tailscale CLI.

type TailnetIdentityFunc

type TailnetIdentityFunc func(ctx context.Context) (TailnetIdentity, error)

TailnetIdentityFunc is the adapter seam over Tailscale. The default reads `tailscale status --json` and never changes Tailscale configuration.

type TailnetOptions

type TailnetOptions struct {
	// Host is the node's MagicDNS name without the trailing dot.
	Host string
	// Logins are the Tailscale logins trusted on this listener.
	Logins []string
	// Port, when non-zero, serves the Tailnet listener on a dedicated loopback
	// TCP port instead of the Unix socket, for a tailscaled that cannot open a
	// 0600 user socket.
	Port int
}

TailnetOptions configures the Tailnet listener.

type TerminalInfo

type TerminalInfo struct {
	ClientID    string              `json:"client_id"`
	OwnerHostID string              `json:"owner_host_id,omitempty"`
	WorkspaceID string              `json:"workspace_id,omitempty"`
	Session     string              `json:"session,omitempty"`
	Pane        string              `json:"pane,omitempty"`
	DisplayName string              `json:"display_name,omitempty"`
	Control     bool                `json:"control"`
	Holder      *mobileproto.Holder `json:"holder,omitempty"`
}

TerminalInfo is one open terminal attachment and whether its client holds control. It is observed from the stream, never decided here.

type TerminalProtocol

type TerminalProtocol struct {
	Protocol string `json:"protocol"`
	Version  int    `json:"version"`
}

type TicketRequest

type TicketRequest struct{}

type TicketResponse

type TicketResponse struct {
	Ticket    string    `json:"ticket"`
	ExpiresAt time.Time `json:"expires_at"`
}

TicketResponse is POST /api/v0/ws-tickets.

type UIRequestEvent

type UIRequestEvent struct {
	ID        string            `json:"id"`
	Action    uirequest.Action  `json:"action"`
	Project   string            `json:"project"`
	Workspace string            `json:"workspace,omitempty"`
	Request   uirequest.Request `json:"request"`
	// OriginPane identifies the matched leaf in the pre-proposal tree preorder.
	OriginPane int            `json:"origin_pane,omitempty"`
	Document   LayoutDocument `json:"document"`
	ETag       string         `json:"etag"`
	ExpiresAt  time.Time      `json:"expires_at"`
}

type ViewerAckRequest

type ViewerAckRequest struct {
	ViewerID string           `json:"viewer_id"`
	ID       string           `json:"id"`
	Status   uirequest.Status `json:"status"`
	Reason   string           `json:"reason,omitempty"`
}

type ViewerAckResponse

type ViewerAckResponse struct {
	Document LayoutDocument `json:"document"`
	ETag     string         `json:"etag"`
}

type ViewerIdentity

type ViewerIdentity struct {
	ID         string `json:"id"`
	Capability string `json:"capability"`
}

type ViewerPresenceRequest

type ViewerPresenceRequest struct {
	ViewerID    string   `json:"viewer_id"`
	Focused     bool     `json:"focused"`
	Visible     bool     `json:"visible"`
	Project     string   `json:"project"`
	Workspace   string   `json:"workspace,omitempty"`
	Session     string   `json:"session,omitempty"`
	FocusedPane int      `json:"focused_pane,omitempty"`
	Viewport    Viewport `json:"viewport"`
}

type ViewerPresenceResponse

type ViewerPresenceResponse struct {
	Holder bool `json:"holder"`
}

type Viewport

type Viewport = layoutreport.CSSViewport

Viewport is CSS pixels, never terminal cells.

type WorkspaceBackend

WorkspaceBackend is the application seam for the workspace HTTP adapter. Operations use the CLI's JSON result and exit status, including partial results.

type WorkspaceCommand

type WorkspaceCommand struct {
	Operation          string   `json:"-"`
	Host               string   `json:"host,omitempty"`
	Target             string   `json:"target,omitempty"`
	Name               string   `json:"name,omitempty"`
	Base               string   `json:"base,omitempty"`
	Confirm            bool     `json:"confirm,omitempty"`
	ExpectSourceOID    string   `json:"expect_source_oid,omitempty"`
	ExpectHeadOID      string   `json:"expect_head_oid,omitempty"`
	ExpectDeleteState  string   `json:"expect_delete_state,omitempty"`
	ExpectBranch       string   `json:"expect_branch,omitempty"`
	DeleteLocalBranch  bool     `json:"delete_local_branch,omitempty"`
	DeleteRemoteBranch bool     `json:"delete_remote_branch,omitempty"`
	Kind               string   `json:"kind,omitempty"`
	Args               []string `json:"args,omitempty"`
	Text               string   `json:"text,omitempty"`
	Wait               bool     `json:"wait,omitempty"`
	Timeout            string   `json:"timeout,omitempty"`
}

WorkspaceCommand is input to the shared command adapter, never raw CLI argv.

type WorkspaceEventSource

type WorkspaceEventSource interface {
	WorkspaceInvalidation(context.Context) (workspacewire.WorkspaceEvent, error)
}

WorkspaceEventSource adds owning-host project references to resource invalidations.

Jump to

Keyboard shortcuts

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