protocol

package module
v0.0.1-dev.2 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 22 Imported by: 3 modules, 5 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

Index

Constants

View Source
const (
	ToolCreateSession      = "create_session"
	ToolGetSession         = "get_session"
	ToolUpdateSession      = "update_session"
	ToolDeleteSession      = "delete_session"
	ToolRenewSession       = "renew_session"
	ToolAuthorizeLifecycle = "authorize_lifecycle"
	ToolRetryLifecycle     = "retry_lifecycle"
	ToolUploadGrant        = "issue_upload_grant"
	ToolSetValue           = "set_value"
	ToolDeleteValue        = "delete_value"
	ToolListValues         = "list_values"
)
View Source
const (
	APIPathInfo           = "/.well-known/holon"
	HeaderInstallationUID = "X-Holon-Installation-UID"
)
View Source
const (
	SchemeHTTPS         = "https"
	HTTPSPrefix         = SchemeHTTPS + "://"
	APIPathSessions     = "/sessions"
	MCPPathPrefix       = "/mcp/"
	MCPPath             = "/mcp"
	HeaderAuthorization = "Authorization"
	HeaderContentType   = "Content-Type"
	MIMEApplicationJSON = "application/json"
	MIMETextPlain       = "text/plain; charset=utf-8"
	BearerScheme        = "Bearer"
	BearerPrefix        = BearerScheme + " "
	UploadUsername      = "holon-upload"
)
View Source
const (
	ToolImportRegistryPackage = "import_registry_package"
	ToolGetImport             = "get_import"
)
View Source
const (
	OTELServiceNameEnv          = "OTEL_SERVICE_NAME"
	OTELResourceAttributesEnv   = "OTEL_RESOURCE_ATTRIBUTES"
	OTELExporterOTLPEndpointEnv = "OTEL_EXPORTER_OTLP_ENDPOINT"
	OTELExporterOTLPProtocolEnv = "OTEL_EXPORTER_OTLP_PROTOCOL"
)
View Source
const (
	ModeDevelopment = "development"
	ModeProduction  = "production"
	ProductionName  = "production"
)
View Source
const (
	ScopeDevRead   = "system:dev:read"
	ScopeDevWrite  = "system:dev:write"
	ScopeProdRead  = "system:prod:read"
	ScopeProdWrite = "system:prod:write"
)
View Source
const (
	ConditionReady         = "Ready"
	ConditionAvailable     = "Available"
	ReasonInvalidIdentity  = "InvalidIdentity"
	ReasonInvalidExpiry    = "InvalidExpiry"
	ReasonInvalidSpec      = "InvalidSpec"
	ReasonDeleting         = "Deleting"
	ReasonLeaseExpired     = "LeaseExpired"
	ReasonProgressDeadline = "ProgressDeadlineExceeded"
)
View Source
const MCPCallEvent = "holon.mcp.call"

MCPCallEvent is the event.name of the completion record logged for each MCP call, sampled or not.

View Source
const MCPRegistryOrigin = "https://registry.modelcontextprotocol.io"
View Source
const PlatformPaths = `` /* 130-byte string literal not displayed */
View Source
const RuntimeConfigEnv = "HOLON_MCP_RUNTIME_CONFIG"
View Source
const ToolResolveAppBuild = "resolve_app_build"

Variables

View Source
var ErrInvalidAccess = errors.New("invalid access configuration")

Functions

func AccessPolicy

func AccessPolicy(apps []App, identityConfigured bool) error

func AppBrowserMount

func AppBrowserMount(app App, mode string) string

func AppPath

func AppPath(name string) string

func BrowserPath

func BrowserPath(raw string) (string, bool)

func CanonicalOrigin

func CanonicalOrigin(raw string) (string, error)

func ChangedApps

func ChangedApps(before, after []App) []string

func ControlScopes

func ControlScopes(plane Plane) []string

func DecodeJSONFields

func DecodeJSONFields(data []byte, target any, required ...string) error

func DecodeJSONNonNull

func DecodeJSONNonNull(data []byte, target any) error

func DecodeJSONStrict

func DecodeJSONStrict(data []byte, target any) error

func Dependencies

func Dependencies(apps []App) []string

func DependencyEnvName

func DependencyEnvName(name string) string

func Expand

func Expand(template string, lookup func(string) (string, bool)) (string, bool)

Expand replaces each placeholder with lookup's value for its input. A templated value is absent unless every input it names has a value.

func IsValidDigestImage

func IsValidDigestImage(image string) bool

func NormalizeEgressHost

func NormalizeEgressHost(host string) (string, error)

func ParseAppPath

func ParseAppPath(path string) (string, bool)

func ParseAppResource

func ParseAppResource(resource string) (string, string, bool)

func ParseSessionAudience

func ParseSessionAudience(origin, audience string) (string, string, bool)

func ParseWebPath

func ParseWebPath(raw string) (string, bool)

func PlaneOrigin

func PlaneOrigin(origin string, plane Plane, sessionID string) (string, error)

func PlaneScopes

func PlaneScopes(plane Plane) (read, write string)

func RegistryHost

func RegistryHost(origin string) string

func RemoteURL

func RemoteURL(raw string) (*url.URL, error)

func ReservedAppNames

func ReservedAppNames() []string

func SessionAudience

func SessionAudience(origin, mode, sessionID string) (string, error)

func SessionScopes

func SessionScopes(mode string, apps []App) []string

func SystemScopes

func SystemScopes() []string

func TemplateInputs

func TemplateInputs(template string) []string

TemplateInputs returns the names a template's placeholders refer to.

func ValidAppName

func ValidAppName(value string) bool

func ValidAppNames

func ValidAppNames(names []string) bool

func ValidArgs

func ValidArgs[I any](env map[string]I, args []Template) bool

ValidArgs reports whether each argument is single-line text whose placeholders name inputs env declares.

func ValidBuildArchitectures

func ValidBuildArchitectures(architectures []string) bool

func ValidDNSLabel

func ValidDNSLabel(value string) bool

ValidDNSLabel uses Kubernetes' lowercase RFC 1123 §2.1 hostname-label profile.

func ValidDNSName

func ValidDNSName(value string) bool

func ValidDigest

func ValidDigest(value string) bool

func ValidEnvName

func ValidEnvName(value string) bool

func ValidEnvTemplates

func ValidEnvTemplates[I any](env map[string]I, templates map[string]Template) bool

ValidEnvTemplates reports whether each template sets a variable env does not declare, from inputs env declares.

func ValidImageRepositoryPrefix

func ValidImageRepositoryPrefix(prefix string) bool

func ValidInputValue

func ValidInputValue(value string) bool

func ValidMCPName

func ValidMCPName(name string) bool

func ValidPort

func ValidPort(port int) bool

func ValidRegistryHost

func ValidRegistryHost(value string) bool

func ValidRemoteHeader

func ValidRemoteHeader(name string) bool

func ValidRepository

func ValidRepository(value string) bool

func ValidateAccess

func ValidateAccess(access *AppAccess) error

func ValidateAppMounts

func ValidateAppMounts(apps []App) error

func ValidateRegistry

func ValidateRegistry(registry string) error

func WebPath

func WebPath(name string) string

Types

type AccessRule

type AccessRule struct {
	// +nullable
	// +optional
	OAuth *OAuthRequirement `json:"oauth,omitempty"`
}

+mapType=atomic

func (AccessRule) Scopes

func (rule AccessRule) Scopes() []string

type AccountManagement

type AccountManagement struct {
	ProfileURL  string `json:"profileURL,omitempty"`
	SecurityURL string `json:"securityURL,omitempty"`
	SessionsURL string `json:"sessionsURL,omitempty"`
}

AccountManagement contains provider-owned self-service pages. Omitted links mean that the provider does not advertise that capability.

type App

type App struct {
	// +optional
	Icons []Icon `json:"icons,omitempty"`

	// +kubebuilder:validation:MaxLength=2048
	// +optional
	Mount string `json:"mount,omitempty"`

	// +optional
	Release *Release `json:"release,omitempty"`
	// +optional
	OAuth *OAuthClient `json:"oauth,omitempty"`
	// +optional
	Remote *Remote    `json:"remote,omitempty"`
	Access *AppAccess `json:"access"           nullable:"false" required:"true"`
	// +kubebuilder:validation:MaxLength=49
	// +kubebuilder:validation:Pattern="^[a-z0-9]([-a-z0-9]*[a-z0-9])?$"
	Name string `json:"name" maxLength:"49" pattern:"^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" required:"true"`
	// +kubebuilder:validation:MaxLength=2048
	// +kubebuilder:validation:Pattern="@sha256:[0-9a-f]{64}$"
	// +optional
	Image string `json:"image,omitempty" pattern:"@sha256:[0-9a-f]{64}$"`
	// +kubebuilder:validation:Minimum=1
	// +kubebuilder:validation:Maximum=65535
	// +optional
	Port int32 `json:"port,omitempty" maximum:"65535" minimum:"1"`
	// Args replace the image's command arguments. Each entry is one argument, a template over the app's inputs: the
	// container receives an entry only when every input it names has a value.
	// +kubebuilder:validation:MaxItems=64
	// +optional
	Args []Template `json:"args,omitempty" maxItems:"64"`
	// +listType=set
	// +kubebuilder:validation:items:MaxLength=49
	// +kubebuilder:validation:items:Pattern="^[a-z0-9]([-a-z0-9]*[a-z0-9])?$"
	// +optional
	Requires []string `json:"requires,omitempty"`
	// +optional
	Egress Egress `json:"egress,omitzero"`
	// +kubebuilder:validation:MaxProperties=64
	// +kubebuilder:validation:XValidation:rule="!('HOLON_MCP_RUNTIME_CONFIG' in self) && !('HOLON_HOOK_CONFIG' in self)",message="Holon runtime configuration is reserved for the controller"
	// +optional
	Env map[string]Input `json:"env,omitempty"`
	// EnvTemplates sets environment variables from templates over the app's inputs. A variable is set only when every
	// input its template names has a value.
	// +kubebuilder:validation:MaxProperties=64
	// +optional
	EnvTemplates map[string]Template `json:"envTemplates,omitempty"`
	// +kubebuilder:validation:MaxProperties=64
	// +optional
	Applied map[string]ConfigRevision `json:"applied,omitempty"`
}

+kubebuilder:validation:XValidation:rule="has(self.remote) ? (!has(self.image) && !has(self.port)) : (has(self.image) && has(self.port))",message="apps require either a remote endpoint or an image and port"

func WritableApps

func WritableApps(apps []App) []App

func (App) Inputs

func (a App) Inputs() map[string]Input

func (*App) UnmarshalJSON

func (app *App) UnmarshalJSON(data []byte) error

type AppAccess

type AppAccess struct {
	// +listType=set
	// +kubebuilder:validation:MaxItems=256
	// +kubebuilder:validation:items:MaxLength=49
	// +kubebuilder:validation:items:Pattern="^[a-z0-9]([-a-z0-9]*[a-z0-9])?$"
	// +optional
	Callers []string `` /* 130-byte string literal not displayed */

	Server *AccessRule `description:"{} is public; oauth: {} requires authentication." json:"server" nullable:"false" required:"true"`
	// +nullable
	// +kubebuilder:validation:MaxProperties=256
	// +optional
	Tools map[string]AccessRule `description:"Tool rules combined with server requirements." json:"tools,omitempty" maxProperties:"256"`
}

func (*AppAccess) Rules

func (access *AppAccess) Rules() iter.Seq2[string, AccessRule]

func (*AppAccess) UnmarshalJSON

func (access *AppAccess) UnmarshalJSON(data []byte) error

type AppBuildRef

type AppBuildRef struct {
	Repository     string `json:"repository"     maxLength:"256"                 required:"true"`
	ArtifactDigest string `json:"artifactDigest" pattern:"^sha256:[0-9a-f]{64}$" required:"true"`
}

type AppRequest

type AppRequest struct {
	SessionRequest

	Environment string `json:"environment,omitempty"`
	App         string `json:"app,omitempty"`
}

AppRequest selects a deployment and optionally one of its apps.

type AppsRequestFor

type AppsRequestFor[A any] struct {
	RequestID  string `json:"requestId,omitempty"`
	TTLSeconds *int64 `json:"ttlSeconds,omitempty" maximum:"86400" minimum:"1"`
	Apps       []A    `json:"apps"                 minItems:"1"    nullable:"false" required:"true"`
}

func (*AppsRequestFor[A]) UnmarshalJSON

func (input *AppsRequestFor[A]) UnmarshalJSON(data []byte) error

type Artifact

type Artifact struct {
	Architecture string `json:"architecture"`
	WorkingDir   string `json:"workingDir"`
	Hooks        []Hook `json:"hooks,omitempty"`
}

type AuthorizeLifecycleRequest

type AuthorizeLifecycleRequest struct {
	SessionRequest

	Operation   string `json:"operation"`
	AccessToken string `json:"accessToken,omitempty"`
}

type BuildRecord

type BuildRecord struct {
	SchemaVersion      int          `json:"schemaVersion"`
	AppName            string       `json:"appName"`
	ServerName         string       `json:"serverName,omitempty"`
	ServerVersion      string       `json:"serverVersion,omitempty"`
	Title              string       `json:"title,omitempty"`
	Description        string       `json:"description,omitempty"`
	Runtime            BuildRuntime `json:"runtime"`
	UnsupportedReasons []string     `json:"unsupportedReasons"`
}

func (BuildRecord) Validate

func (r BuildRecord) Validate() error

type BuildRuntime

type BuildRuntime struct {
	Icons        []Icon              `json:"icons,omitempty"`
	Port         int32               `json:"port"`
	Args         []Template          `json:"args,omitempty"`
	Env          map[string]Input    `json:"env,omitempty"`
	EnvTemplates map[string]Template `json:"envTemplates,omitempty"`
	Requires     []string            `json:"requires,omitempty"`
	Egress       Egress              `json:"egress,omitzero"`
}

type Condition

type Condition struct {
	Type               string `json:"type"`
	Status             string `json:"status"`
	ObservedGeneration int64  `json:"observedGeneration,omitempty"`
	LastTransitionTime Time   `json:"lastTransitionTime"`
	Reason             string `json:"reason"`
	Message            string `json:"message"`
}

type ConfigRevision

type ConfigRevision = string

+kubebuilder:validation:Pattern="^v-[0-9a-f]{24}$"

type ConfigValue

type ConfigValue struct {
	Session   string  `json:"session,omitempty"`
	Kind      string  `json:"kind"`
	Variable  string  `json:"variable"`
	Value     *string `json:"value,omitempty"`
	Note      string  `json:"note,omitempty"`
	UpdatedAt string  `json:"updatedAt"`
	UpdatedBy string  `json:"updatedBy,omitempty"`
}

type ConfigValues

type ConfigValues struct {
	Values []ConfigValue `json:"values" nullable:"false" required:"true"`
}

type DeleteSessionRequest

type DeleteSessionRequest struct {
	SessionRequest

	ExpectedRevision string `json:"expectedRevision"`
	SkipHooks        bool   `json:"skipHooks,omitempty"`
}

type DeleteSessionResultFor

type DeleteSessionResultFor[Session any] struct {
	Deleted bool     `json:"deleted"`
	Session *Session `json:"session,omitempty"`
}

type Egress

type Egress []EgressDestination

+listType=atomic

func (Egress) Normalize

func (policy Egress) Normalize() (Egress, error)

func (*Egress) UnmarshalJSON

func (policy *Egress) UnmarshalJSON(data []byte) error

func (Egress) Validate

func (policy Egress) Validate(env map[string]Input) error

Validate checks the hosts against the app's inputs. Hosts land in network policy, so a placeholder may name only a declared, non-secret input, and each host must be valid with every placeholder replaced by a DNS name.

type EgressDestination

type EgressDestination struct {
	Host Template `description:"Exact DNS hostname or unicast IP address; {NAME} stands for a non-secret input." json:"host" required:"true"`
	// +kubebuilder:validation:MinItems=1
	// +listType=set
	// +kubebuilder:validation:items:Minimum=1
	// +kubebuilder:validation:items:Maximum=65535
	Ports []int32 `` /* 139-byte string literal not displayed */
}

type Error

type Error struct {
	LoginURL string `json:"loginUrl,omitempty"`
	Code     string `json:"code"`
	Message  string `json:"message"`
}

Error contains a stable machine-readable code and a human-readable message.

func (*Error) Error

func (e *Error) Error() string

type ErrorResponse

type ErrorResponse struct {
	Error Error `json:"error"`
}

ErrorResponse is the control-plane error envelope.

type GetImportRequest

type GetImportRequest struct {
	ID string `json:"id" required:"true"`
}

type Hook

type Hook struct {
	Event    string `json:"event"`
	Version  string `json:"version,omitempty"`
	Path     string `json:"path"`
	Runtime  string `json:"runtime"`
	Checksum string `json:"checksum"`
}

func (Hook) Key

func (h Hook) Key() string

type HookInvocation

type HookInvocation struct {
	Operation string `json:"operation"`
	Job       string `json:"job"`
	JobUID    string `json:"jobUID"`
	App       string `json:"app"`
	Step      int64  `json:"step"`
	Attempt   int64  `json:"attempt"`
	Deadline  string `json:"deadline"`
	Initiator *Owner `json:"initiator,omitempty"`
}

type Icon

type Icon struct {
	Source   string   `json:"src"`
	MIMEType string   `json:"mimeType,omitempty"`
	Sizes    []string `json:"sizes,omitempty"`
	Theme    string   `json:"theme,omitempty"`
}

Icon is the MCP icon object shared by server descriptors and app declarations.

type Import

type Import struct {
	ID      string       `json:"id"`
	Phase   string       `json:"phase"`
	Message string       `json:"message,omitempty"`
	Build   *AppBuildRef `json:"build,omitempty"`
}

type ImportRegistryPackageRequest

type ImportRegistryPackageRequest struct {
	App      string         `json:"app"      required:"true"`
	Registry RegistrySource `json:"registry" required:"true"`
}

type Info

type Info struct {
	Installation          InstallationReference `json:"installation"`
	OAuth                 *OAuthInfo            `json:"oauth"`
	Version               string                `json:"version"`
	ImageRepositoryPrefix string                `json:"imageRepositoryPrefix,omitempty"`
	BuildArchitectures    []string              `json:"buildArchitectures,omitempty"`
}

Info describes installation capabilities. OAuth is present and null when identity is disabled.

func (*Info) UnmarshalJSON

func (info *Info) UnmarshalJSON(data []byte) error

type Input

type Input struct {
	// +nullable
	// +optional
	IsRequired bool `json:"isRequired,omitempty"`
	// +nullable
	// +optional
	IsSecret bool `json:"isSecret,omitempty"`
	// +nullable
	// +kubebuilder:validation:Pattern="^[^\\x00\\r\\n]*$"
	// +optional
	Value *string `json:"value,omitempty"`
	// +nullable
	// +kubebuilder:validation:Pattern="^[^\\x00\\r\\n]*$"
	// +optional
	Default *string `json:"default,omitempty"`
}

+kubebuilder:validation:XValidation:rule="!(has(self.value) && has(self.default))",message="input cannot declare both value and default" +kubebuilder:validation:XValidation:rule="!has(self.isSecret) || !self.isSecret || (!has(self.value) && !has(self.default))",message="secret inputs must use the secret store" +mapType=atomic

func (Input) Kind

func (i Input) Kind() string

func (Input) Source

func (i Input) Source(revision string) (*string, string)

func (*Input) UnmarshalJSON

func (i *Input) UnmarshalJSON(data []byte) error

func (Input) Validate

func (i Input) Validate() error

type InputName

type InputName = string

+kubebuilder:validation:MaxLength=128

type InstallationReference

type InstallationReference struct {
	Origin string `json:"origin" minLength:"1"   required:"true"`
	UID    string `json:"uid"    maxLength:"128" minLength:"1"   required:"true"`
}

func (InstallationReference) Validate

func (p InstallationReference) Validate() error

type InstalledRelease

type InstalledRelease struct {
	Name           string `json:"name"`
	Installed      *App   `json:"installed,omitempty"`
	ServingVersion string `json:"servingVersion,omitempty"`
}

type LifecycleOperation

type LifecycleOperation struct {
	Initiator *Owner `json:"initiator,omitempty"`
	ID        string `json:"id"`
	Retry     int64  `json:"retry,omitempty"`
}

type LifecycleStatus

type LifecycleStatus struct {
	App       string   `json:"app,omitempty"`
	Hook      string   `json:"hook,omitempty"`
	ReadyApps []string `json:"readyApps,omitempty"`
	ID        string   `json:"id"`
	Phase     string   `json:"phase"`
	Step      int64    `json:"step"`
	Attempt   int64    `json:"attempt"`
	Retry     int64    `json:"retry,omitempty"`
	Job       string   `json:"job,omitempty"`
	JobUID    string   `json:"jobUID,omitempty"`
	Deadline  string   `json:"deadline,omitempty"`
	Message   string   `json:"message,omitempty"`
}

type OAuthClient

type OAuthClient struct {
	// ClientID is a template whose placeholders each name a required config input. Env may declare that input only as
	// a non-secret one without a value or default, and a placeholder never names the ClientSecret key.
	// +kubebuilder:validation:MaxLength=1024
	// +kubebuilder:validation:Pattern="^[^\\x00\\r\\n]+$"
	ClientID string `json:"clientID" required:"true"`
	// +kubebuilder:validation:Pattern="^[A-Za-z_][A-Za-z0-9_]*$"
	// +optional
	ClientSecret InputName `json:"clientSecret,omitempty"`
}

+mapType=atomic

func (*OAuthClient) Inputs

func (c *OAuthClient) Inputs() map[string]Input

func (*OAuthClient) Validate

func (c *OAuthClient) Validate(env map[string]Input) error

type OAuthInfo

type OAuthInfo struct {
	Issuer            string             `json:"issuer"`
	AdminAudience     string             `json:"adminAudience"`
	CLIClientID       string             `json:"cliClientID"`
	AccountManagement *AccountManagement `json:"accountManagement,omitempty"`
}

OAuthInfo supplies the issuer, audience and client settings for control-plane authentication.

type OAuthRequirement

type OAuthRequirement struct {
	// +listType=set
	// +kubebuilder:validation:items:MinLength=1
	// +kubebuilder:validation:items:MaxLength=256
	// +kubebuilder:validation:items:Pattern="^[\\x21\\x23-\\x5B\\x5D-\\x7E]+$"
	// +optional
	Scopes []string `` /* 137-byte string literal not displayed */
}

type Owner

type Owner struct {
	Issuer  string `json:"issuer"`
	Subject string `json:"sub"`
}

type PackageSelection

type PackageSelection struct {
	RegistryType string `description:"MCP package registry type." enum:"oci,npm,pypi" json:"registryType" required:"true"`
	Identifier   string `json:"identifier,omitempty"`
}

type Plane

type Plane string
const (
	BasePlane    Plane = "base"
	DevPlane     Plane = "dev"
	AdminPlane   Plane = "admin"
	SessionPlane Plane = "session"
)

func ParseControlAudience

func ParseControlAudience(origin, resource string) (Plane, bool)

func ParseHost

func ParseHost(origin, host string) (Plane, string, bool)

type RegistryHeader

type RegistryHeader struct {
	Name  string `json:"name"`
	Input Input  `json:"input"`
}

type RegistryRef

type RegistryRef struct {
	Name     string `description:"MCP Registry server identity in namespace/name form."                json:"name"               required:"true"`
	Version  string `description:"Exact server version; ranges and latest are unsupported."            json:"version"            required:"true"`
	Registry string `description:"Registry URL; defaults to https://registry.modelcontextprotocol.io." json:"registry,omitempty"`
}

func (RegistryRef) RegistryURL

func (r RegistryRef) RegistryURL() string

func (RegistryRef) Validate

func (r RegistryRef) Validate() error

The Registry resolves latest to whichever version is current, so a pin must name the version.

type RegistrySource

type RegistrySource struct {
	RegistryRef

	Package *PackageSelection `json:"package,omitempty"`
	Remote  *struct{}         `json:"remote,omitempty"`
}

type Release

type Release struct {
	Name      string     `json:"name,omitempty"`
	Version   string     `json:"version,omitempty"`
	Artifacts []Artifact `json:"artifacts,omitempty"`
}

type Remote

type Remote struct {
	// URL is a template over the app's inputs.
	// +kubebuilder:validation:MaxLength=2048
	// +kubebuilder:validation:XValidation:rule="self.startsWith('https://')",message="remote endpoints must use HTTPS"
	URL string `json:"url" required:"true"`
	// Headers maps each header name to a template over the app's inputs. A header is sent only when every input its
	// template names has a value.
	// +kubebuilder:validation:MaxProperties=64
	// +optional
	Headers map[string]Template `json:"headers,omitempty"`
}

+mapType=atomic

func (Remote) Endpoint

func (r Remote) Endpoint(lookup func(string) (string, bool)) (*url.URL, error)

Endpoint expands the URL with lookup's input values and checks the result.

func (Remote) Validate

func (r Remote) Validate(env map[string]Input) error

Validate checks the remote against the app's inputs. A placeholder in the URL may stand for a DNS label or a path segment, so the URL must be valid with every declared input replaced by one.

type ResolvedAppBuild

type ResolvedAppBuild struct {
	AppBuildRef
	BuildRecord

	Image string `json:"image,omitempty"`
}

type RetryLifecycleRequest

type RetryLifecycleRequest struct {
	SessionRequest

	Operation        string `json:"operation"`
	ExpectedRevision string `json:"expectedRevision"`
}

type SessionEndpoint

type SessionEndpoint struct {
	Name string `json:"name"`
	URL  string `json:"url"`
}

type SessionLogsRequest

type SessionLogsRequest struct {
	AppRequest

	Operation string `json:"operation,omitempty"` // lifecycle operation ID
	Hook      string `json:"hook,omitempty"`      // lifecycle hook key
	Attempt   *int64 `json:"attempt,omitempty"`   // lifecycle attempt, from 1
	Event     string `json:"event,omitempty"`     // record event name, such as MCPCallEvent
	Tool      string `json:"tool,omitempty"`      // a completion record's MCP tool
	Status    string `json:"status,omitempty"`    // a completion record's outcome: ok or error
	Since     string `json:"since,omitempty"`     // duration or RFC 3339; default 15m
	TraceID   string `json:"traceId,omitempty"`   // records for one trace
	Text      string `json:"text,omitempty"`      // substring filter
}

SessionLogsRequest selects collected records: app stdout and stderr, lifecycle hook output and MCP completion records. An empty App means every app.

type SessionRequest

type SessionRequest struct {
	Session string `json:"session"`
}

type SessionResponse

type SessionResponse struct {
	Operation          *LifecycleOperation `json:"operation,omitempty"`
	Lifecycle          *LifecycleStatus    `json:"lifecycle,omitempty"`
	Releases           []InstalledRelease  `json:"releases,omitempty"`
	Detached           bool                `json:"detached,omitempty"`
	BuildArchitectures []string            `json:"buildArchitectures,omitempty"`
	UID                string              `json:"uid"`
	Apps               []App               `json:"apps"`
	Generation         int64               `json:"generation,omitempty"`
	Name               string              `json:"name"`
	Endpoints          []SessionEndpoint   `json:"endpoints"`
	Conditions         []Condition         `json:"conditions"`
	ExpiresAt          string              `json:"expiresAt,omitempty"`
	Revision           string              `json:"revision"`
}

func (SessionResponse) Condition

func (session SessionResponse) Condition(kind string) Condition

type SetValueRequest

type SetValueRequest struct {
	VariableRequest

	Value string `json:"value"`
	Note  string `json:"note,omitempty" maxLength:"256"`
}

type Template

type Template = string

+kubebuilder:validation:MaxLength=4096 +kubebuilder:validation:Pattern="^[^\\x00\\r\\n]*$"

type Time

type Time time.Time

func (Time) MarshalJSON

func (value Time) MarshalJSON() ([]byte, error)

func (*Time) UnmarshalJSON

func (value *Time) UnmarshalJSON(data []byte) error

type UpdateSessionRequestFor

type UpdateSessionRequestFor[Desired any] struct {
	SessionRequest
	WritePrecondition

	Desired Desired `json:"desired"`
}

type UploadGrant

type UploadGrant struct {
	Grant        string            `json:"grant"`
	Registry     string            `json:"registry"`
	Repositories map[string]string `json:"repositories"`
	ExpiresAt    string            `json:"expiresAt"`
}

UploadGrant authorizes image uploads. Treat the grant as a credential until expiry.

type UploadRequest

type UploadRequest struct {
	Apps []string `json:"apps" minItems:"1" nullable:"false" required:"true"`
}

UploadRequest asks for repository upload authority for named apps.

type VariableRequest

type VariableRequest struct {
	Session  string `json:"session,omitempty"`
	Kind     string `json:"kind"`
	Variable string `json:"variable"`
}

type WritePrecondition

type WritePrecondition struct {
	ExpectedRevision string `json:"expectedRevision,omitempty"`
	CreateOnly       bool   `json:"createOnly,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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