Documentation
¶
Overview ¶
Package hostedagent reconciles hosted agent instances through the implementation-neutral agent backend contract.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuildInput ¶
type BuildInput struct {
Client kclient.Client
Namespace string
Instance *v1.HostedAgentInstance
Agent *v1.HostedAgent
Harness *v1.Harness
Credential string
}
BuildInput is everything needed to render a sandbox's runtime contract.
Client is here because the sandbox config resolves models and skills into complete endpoints and files, which means reading them; Credential is here because those endpoints carry it.
type CredentialIssuer ¶
type CredentialIssuer interface {
// EnsureInstanceCredential returns the sandbox credential and an opaque
// version that changes whenever the value does. It must be idempotent:
// reconciles are frequent, and reissuing on every pass would restart the
// sandbox on every pass.
EnsureInstanceCredential(ctx context.Context, instanceID, ownerUserID string) (value string, version string, err error)
// RevokeInstanceCredential is called during deletion and must tolerate a
// credential that is already gone.
RevokeInstanceCredential(ctx context.Context, instanceID string) error
}
CredentialIssuer mints and revokes the credential a sandbox authenticates with. It is an interface so the controller can be tested without a database, and so the credential store stays replaceable.
type DesiredBuilder ¶
type DesiredBuilder interface {
Build(context.Context, BuildInput) (agentbackend.DesiredInstance, error)
}
DesiredBuilder converts Obot resources into the runtime-ready backend contract. Keeping this boundary injectable lets resource and credential resolution evolve without coupling a backend adapter to Obot storage types.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func New ¶
func New(backend agentbackend.InstanceBackend, credentials CredentialIssuer, serverURL, internalURL string, maxRepoSizeMB int) *Handler
func NewWithBuilder ¶
func NewWithBuilder(backend agentbackend.InstanceBackend, credentials CredentialIssuer, builder DesiredBuilder) *Handler
func (*Handler) EnsurePool ¶
EnsurePool resolves the instance's pool before backend reconciliation. The deterministic names make concurrent first-instance reconciles for one user converge on the same pool and assignment.
func (*Handler) OrchestrateInstance ¶
OrchestrateInstance converges one HostedAgentInstance and periodically observes it so out-of-band backend changes are reflected in Obot.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package credentials issues the credential a hosted agent sandbox uses to authenticate to Obot.
|
Package credentials issues the credential a hosted agent sandbox uses to authenticate to Obot. |