protocol

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

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

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 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"
	ToolListSessions       = "list_sessions"
	ToolUpdateSession      = "update_session"
	ToolDeleteSession      = "delete_session"
	ToolRenewSession       = "renew_session"
	ToolGetLogs            = "get_logs"
	ToolGetAppContract     = "get_app_contract"
	ToolAuthorizeLifecycle = "authorize_lifecycle"
	ToolRetryLifecycle     = "retry_lifecycle"
	ToolUploadGrant        = "issue_upload_grant"
	ToolSetValue           = "set_value"
	ToolDeleteValue        = "delete_value"
	ToolListValues         = "list_values"
	ToolGetEgress          = "get_egress"
	ToolSetEgress          = "set_egress"
	ToolGetIdentity        = "get_identity"
)
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"
	ConditionEgressRestricted = "EgressRestricted"
	ReasonInvalidIdentity     = "InvalidIdentity"
	ReasonInvalidExpiry       = "InvalidExpiry"
	ReasonInvalidSpec         = "InvalidSpec"
	ReasonDeleting            = "Deleting"
	ReasonLeaseExpired        = "LeaseExpired"
	ReasonProgressDeadline    = "ProgressDeadlineExceeded"
)
View Source
const (
	ConditionTrue  = "True"
	ConditionFalse = "False"
)
View Source
const (
	PhasePending   = "Pending"
	PhaseRunning   = "Running"
	PhaseSucceeded = "Succeeded"
	PhaseFailed    = "Failed"
)
View Source
const BaseRepository = "development"
View Source
const DependencyEnvSuffix = "_MCP_URL"

DependencyEnvSuffix ends the name of the variable that holds a dependency's endpoint.

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 PlatformEnv = "HOLON_PLATFORM"

PlatformEnv is set to "1" by the controller in every app container. Requests reach such a container only through Holon's waypoint, which verifies X-Holon-Context and replaces any X-Holon-* header a client sent, so an app may trust those headers exactly when it is set.

View Source
const PlatformPaths = `` /* 130-byte string literal not displayed */
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

Types

type AccessRule

type AccessRule struct {
	// +nullable
	// +optional
	OAuth *OAuthRequirement `json:"oauth,omitempty"`
	// +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 `description:"App callers: omit for all; [] denies all." json:"callers,omitzero" maxItems:"256" uniqueItems:"true"`
}

+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"`
	// +kubebuilder:validation:MaxLength=49
	// +kubebuilder:validation:Pattern="^[a-z0-9]([-a-z0-9]*[a-z0-9])?$"
	Name string `json:"name"`
	// +kubebuilder:validation:MaxLength=2048
	// +kubebuilder:validation:Pattern="@sha256:[0-9a-f]{64}$"
	// +optional
	Image string `json:"image,omitempty"`
	// +kubebuilder:validation:Minimum=1
	// +kubebuilder:validation:Maximum=65535
	// +optional
	Port int32 `json:"port,omitempty"`
	// 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"`
	// +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_PLATFORM' in self) && !('HOLON_HOOK_CONFIG' in self)",message="Holon platform 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"`
	// Supplied are the values set for the app that it does not declare. The platform adds them at deploy, so the app's
	// container receives every value set for it.
	// +kubebuilder:validation:MaxProperties=64
	// +optional
	Supplied map[string]Input `json:"supplied,omitempty"`
	// Imported marks an app installed from an MCP Registry package. Holon hands such third-party code no caller context,
	// which it could replay against the session's other apps.
	// +optional
	Imported bool `json:"imported,omitempty"`
	// +optional
	Inherited bool `json:"inherited,omitempty"`
	// +optional
	Source bool `json:"source,omitempty"`
}

+kubebuilder:validation:XValidation:rule="[has(self.image), has(self.remote), has(self.source)].exists_one(x, x) && has(self.port) == has(self.image)",message="an app has exactly one of image, remote and source, and a port only with an image" +kubebuilder:validation:XValidation:rule="!has(self.oauth) || !has(self.remote) || !has(self.remote.registration)",message="an app signs in with its own OAuth client or a registration, not both"

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 {
	Server *AccessRule `` /* 146-byte string literal not displayed */
	// +nullable
	// +kubebuilder:validation:MaxProperties=256
	// +optional
	Tools map[string]AccessRule `description:"Tool rules replace the server rule." 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"`
	ArtifactDigest string `json:"artifactDigest"`
}

type AppEgressPolicy

type AppEgressPolicy struct {
	Allow Egress `json:"allow,omitzero"`
}

AppEgressPolicy is the installation's egress ceiling for one app.

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 AppsRequest

type AppsRequest struct {
	RequestID  string    `json:"requestId,omitempty"`
	TTLSeconds *int64    `json:"ttlSeconds,omitempty"`
	Apps       []App     `json:"apps"`
	Revision   *Revision `json:"revision,omitempty"`
}

func (*AppsRequest) UnmarshalJSON

func (input *AppsRequest) 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"`
	// Remote is set by an OpenAPI import; such a build has no image.
	Remote *Remote `json:"remote,omitempty"`
}

type Caller

type Caller struct {
	Identity     *CallerIdentity    `json:"identity"`
	Capabilities CallerCapabilities `json:"capabilities"`
}

Caller is the get_identity reply. Identity is present and null when identity is disabled.

type CallerCapabilities

type CallerCapabilities struct {
	Telemetry bool `json:"telemetry"`
}

type CallerIdentity

type CallerIdentity struct {
	Act     json.RawMessage `json:"act,omitempty"`
	Issuer  string          `json:"issuer"`
	Subject string          `json:"subject"`
	Scopes  []string        `json:"scopes"`
	Profile *CallerProfile  `json:"profile,omitempty"`
}

CallerIdentity describes a verified caller and its granted scopes.

type CallerProfile

type CallerProfile struct {
	Name             string `json:"name,omitempty"`
	Email            string `json:"email,omitempty"`
	EmailVerified    bool   `json:"emailVerified,omitempty"`
	IdentityProvider string `json:"identityProvider,omitempty"`
}

CallerProfile is the small set of verified token claims displayed by the console.

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"`
	Apps      []string `json:"apps"`
	Kind      string   `json:"kind"`
	Variable  string   `json:"variable"`
	Revision  string   `json:"revision"`
	Value     *string  `json:"value,omitempty"`
	Note      string   `json:"note,omitempty"`
	UpdatedAt string   `json:"updatedAt"`
	UpdatedBy string   `json:"updatedBy,omitempty"`
}

ConfigValue is a value and the apps linked to it. Its revision names it in a SetValueRequest that replaces it.

type ConfigValues

type ConfigValues struct {
	Values []ConfigValue `json:"values"`
}

type DeleteSessionRequest

type DeleteSessionRequest struct {
	SessionRequest

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

type DeleteSessionResult

type DeleteSessionResult struct {
	Deleted bool             `json:"deleted"`
	Session *SessionResponse `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 EgressRequest

type EgressRequest struct {
	App string `json:"app"`
}

type EgressResponse

type EgressResponse struct {
	AppEgressPolicy

	Revision string       `json:"revision"`
	App      string       `json:"app"`
	Status   EgressStatus `json:"status"`
}

EgressResponse combines the declared policy with its observed status.

type EgressStatus

type EgressStatus struct {
	Reconciled      bool   `json:"reconciled"`
	RolloutComplete bool   `json:"rolloutComplete"`
	Targets         int    `json:"targets"`
	Pending         int    `json:"pending"`
	Degraded        bool   `json:"degraded"`
	Message         string `json:"message,omitempty"`
}

EgressStatus reports asynchronous policy reconciliation and rollout.

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"`
}

type GetSessionRequest

type GetSessionRequest struct {
	SessionRequest

	Revision string `json:"revision,omitempty"`
}

GetSessionRequest reads a session; with a Revision the server first waits for the session to move past it.

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"`
	Registry RegistrySource `json:"registry"`
}

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"`
	UID    string `json:"uid"    maxLength:"128" minLength:"1"`
}

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 LogRecord

type LogRecord struct {
	Time       string            `description:"RFC 3339 time with nanoseconds."                                                    json:"time"`
	Severity   string            `description:"OTLP severity text."                                                                json:"severity,omitempty"`
	App        string            `description:"The record's service.name: an app or a platform service."                           json:"app,omitempty"`
	Body       string            `json:"body"`
	TraceID    string            `json:"traceId,omitempty"`
	Attributes map[string]string `description:"The record's other attributes, named as Loki labels, such as holon_lifecycle_hook." json:"attributes,omitempty"`
}

LogRecord is one collected log record.

func (LogRecord) Line

func (r LogRecord) Line() string

Line renders the record as GET /sessions/{id}/logs streams it: "time severity app body trace_id=…".

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"`
	// +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"`
	PeopleManagement  bool               `json:"peopleManagement,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 {
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=2048
	Issuer string `json:"issuer"`
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=512
	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"`
	Description string `json:"description,omitempty"`
	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"`
}

type Release

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

type ReloadAppResult

type ReloadAppResult struct {
	ElapsedSeconds float64 `json:"elapsedSeconds"`
	Output         string  `description:"The end of what installing and building the app printed." json:"output,omitempty"`
}

ReloadAppResult is how long the API waited for the app to restart from new source, and the end of what it printed.

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"`
	// 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"`
	// OpenAPI names the compiled model of the HTTP API at URL as <repository>@sha256:<digest>. Holon serves its
	// operations as MCP tools. Without it, URL is an MCP endpoint.
	// +kubebuilder:validation:MaxLength=2048
	// +kubebuilder:validation:Pattern="@sha256:[0-9a-f]{64}$"
	// +optional
	OpenAPI string `json:"openapi,omitempty"`
	// Registration names the broker's [RFC 7591] client registration that signs people in at URL's authorization
	// server. Without it, Holon registers a client there or uses the broker's default one.
	//
	// [RFC 7591]: https://www.rfc-editor.org/rfc/rfc7591.html
	// +kubebuilder:validation:MaxLength=63
	// +kubebuilder:validation:Pattern="^[a-z0-9]([-a-z0-9]*[a-z0-9])?$"
	// +optional
	Registration string `json:"registration,omitempty"`
}

+mapType=atomic +kubebuilder:validation:XValidation:rule="!has(self.openapi) || !has(self.headers)",message="an OpenAPI remote sends the credentials its document declares, not headers"

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 Revision

type Revision struct {
	Commit string `json:"commit"`
	// Dirty reports that the deployed files differed from Commit.
	Dirty bool `json:"dirty,omitempty"`
}

Revision is the Git commit a deploy's apps were built from.

type SessionEndpoint

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

type SessionLogs

type SessionLogs struct {
	Environment string      `json:"environment,omitempty"`
	Session     string      `json:"session"`
	App         string      `json:"app"`
	Records     []LogRecord `json:"records"`
}

SessionLogs is a bounded log snapshot: at most the request's limit of records, whose bodies total at most 64 KiB.

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 Sessions

type Sessions struct {
	Items []SessionResponse `json:"items"`
}

type SetEgressRequest

type SetEgressRequest struct {
	EgressRequest
	WritePrecondition

	Policy AppEgressPolicy `json:"policy"`
}

type SetValueRequest

type SetValueRequest struct {
	VariableRequest

	Revision string  `json:"revision,omitempty"`
	Value    *string `json:"value,omitempty"`
	Note     string  `json:"note,omitempty"`
}

SetValueRequest sets one value for exactly the apps it names, linking them. Naming the revision of a listed value replaces it: apps linked to it but not named are unlinked, and without a value the apps get its value. The request fails if no app is linked to that revision any more.

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 UpdateSessionRequest

type UpdateSessionRequest struct {
	SessionRequest
	WritePrecondition

	Desired AppsRequest `json:"desired"`
	Remove  []string    `json:"remove,omitempty"`
}

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"`
}

UploadRequest asks for repository upload authority for named apps.

type VariableRequest

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

VariableRequest names a config value or secret by the apps it is set for, in development (for every session, or one) or in production. Apps that share a value are linked: each receives it, and setting it for all of them changes it once.

type WritePrecondition

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

Directories

Path Synopsis
conformance
Package conformance tests a live issuer and adapter against the rules of package profile.
Package conformance tests a live issuer and adapter against the rules of package profile.
invitation
Package invitation defines Holon's invitation operation.
Package invitation defines Holon's invitation operation.
profile
Package profile states what Holon requires of an identity backend, so a backend is built against the standards and not against one provider.
Package profile states what Holon requires of an identity backend, so a backend is built against the standards and not against one provider.
scim
Package scim is the part of SCIM 2.0 Holon needs from an identity backend: users, the groups that stand for permission sets, and what the backend can do.
Package scim is the part of SCIM 2.0 Holon needs from an identity backend: users, the groups that stand for permission sets, and what the backend can do.

Jump to

Keyboard shortcuts

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