Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterTranslatorOwnedTypesForList ¶
func FilterTranslatorOwnedTypesForList(cl client.Client, agent v1alpha2.AgentObject, translatorOwnedTypes []client.Object, backend Backend) ([]client.Object, error)
FilterTranslatorOwnedTypesForList returns the owned-resource types the reconciler should pass to FindOwnedObjects. It drops sandbox-backend-only types when the workload is not sandbox, so reconcile does not List substrate sandbox APIs on clusters where those CRDs are not installed. For sandbox workloads it keeps only the owned types for the Agent Substrate backend.
translatorOwnedTypes is typically AdkApiTranslator.GetOwnedResourceTypes() (full set used for watches).
func NormalizeAllowedDomainHost ¶
NormalizeAllowedDomainHost trims an AgentHarness allowedDomains entry into a hostname or glob suitable for sandbox.v1.NetworkEndpoint.host. URLs and host:port forms are accepted.
Types ¶
type AsyncBackend ¶
type AsyncBackend interface {
// Name identifies the backend for AgentHarness.Status.BackendRef.Backend
// and logging.
Name() v1alpha2.AgentHarnessBackendType
// EnsureAgentHarness creates the sandbox on the backend if it does not
// already exist. Implementations must be idempotent — if a sandbox
// matching sbx.Name is already present, return its current handle.
EnsureAgentHarness(ctx context.Context, ah *v1alpha2.AgentHarness) (EnsureResult, error)
// GetStatus returns a Ready condition (status, reason, message) for
// the sandbox identified by h. Used to refresh AgentHarness.Status after
// each reconcile.
GetStatus(ctx context.Context, h Handle) (metav1.ConditionStatus, string, string)
// DeleteAgentHarness releases the sandbox. It performs at most one
// reconcile-safe delete step and returns done=true once the sandbox is gone.
// NotFound must be treated as success so the finalizer can be removed
// idempotently.
DeleteAgentHarness(ctx context.Context, h Handle) (done bool, err error)
// OnAgentHarnessReady runs one-time work after the AgentHarness reports
// Ready (for example ExecSandbox bootstrap inside the VM). Backends that
// have no post-ready work should return nil.
OnAgentHarnessReady(ctx context.Context, ah *v1alpha2.AgentHarness, h Handle) error
}
AsyncBackend is the minimal surface a gRPC/HTTP-driven sandbox control plane must implement to back the kagent.dev/v1alpha2 AgentHarness CRD. It is deliberately separate from Backend (which serves SandboxAgent's in-cluster agent-runtime flow).
type Backend ¶
type Backend interface {
BuildSandbox(ctx context.Context, in BuildInput) ([]client.Object, error)
GetOwnedResourceTypes() []client.Object
// OwnedResourceTypesFor returns owned types for the agent's sandbox platform (for reconcile lists).
OwnedResourceTypesFor(agent v1alpha2.AgentObject) ([]client.Object, error)
// SessionDBURL returns the backend-specific session-store URL the translator bakes into the
// agent's rendered config (AgentConfig.session_db_url) before building the config Secret,
// or "" when the backend keeps sessions in the controller database.
SessionDBURL(agent v1alpha2.AgentObject) string
// ComputeReady reflects implementation-specific status into condition pieces for Agent.status.
ComputeReady(ctx context.Context, cl client.Client, nn types.NamespacedName) (status metav1.ConditionStatus, reason, message string)
}
Backend builds sandbox CRD objects and evaluates their readiness.
type BuildInput ¶
type BuildInput struct {
Agent v1alpha2.AgentObject
PodTemplate corev1.PodTemplateSpec
WorkloadName string
ExtraLabels map[string]string
}
BuildInput carries the pod template for a Sandbox workload (agents.x-k8s.io Sandbox).
type EnsureResult ¶
EnsureResult is returned by EnsureAgentHarness. Endpoint (if set) is surfaced to users via AgentHarness.Status.Connection (Substrate: kagent gateway proxy path).
type Handle ¶
Handle is the opaque identifier an AsyncBackend uses to address a sandbox it owns on an external control plane. Persisted in AgentHarness.Status.BackendRef.
For Substrate backends, Atespace scopes the ID — an actor's identity on substrate is (Atespace, ID). Non-substrate backends may leave Atespace empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package channel_helpers holds backend-agnostic helpers for translating AgentHarness channel (Slack/Telegram) credentials and allowlists into Substrate ActorTemplate container env vars.
|
Package channel_helpers holds backend-agnostic helpers for translating AgentHarness channel (Slack/Telegram) credentials and allowlists into Substrate ActorTemplate container env vars. |