Documentation
¶
Overview ¶
Package spec provides shared type definitions for the Astro platform spec (astropods.yml). This package is used by both astro-cli and astro-server to ensure consistent parsing.
Index ¶
- Constants
- Variables
- func AgentConnectionKeys(s *AstroSpec, addrs map[string]ConnectionAddress) map[string]string
- func AgentKeysForComponent(s *AstroSpec, section, entryName string) []string
- func AllAgentAutoEnvKeys(s *AstroSpec) map[string]AgentEnvMeta
- func AllCredentialKeys(s *AstroSpec) map[string]CredentialMeta
- func CloudCredentialKeys(s *AstroSpec) map[string]CredentialMeta
- func ComponentImageName(kind ComponentKind, agentName, name string) string
- func CredentialKeys(provider string) []string
- func CredentialStorageKeyMap(provider string) map[string]string
- func CustomProviderCredentialKeys(s *AstroSpec) map[string]CredentialMeta
- func DeprecatedMetaFields(specYAML []byte) []string
- func DeprecationWarnings(s *AstroSpec) []string
- func ExtractLegacyMeta(specMap map[string]any) (description string, tags []string)
- func IsCloudIntegrationProvider(name string) bool
- func IsCloudKnowledgeProvider(name string) bool
- func IsCloudModelProvider(name string) bool
- func IsGatewayModelProvider(name string) bool
- func IsManagedProvider(section, name string) bool
- func IsValidName(name string) bool
- func IsValidVarName(name string) bool
- func NormalizeTag(s string) string
- func RewriteMarkdownImages(md string, replace map[string]string) string
- func SanitizeDBName(name string) string
- func SanitizeEnvName(name string) string
- func Schema() []byte
- func SecretDefaultViolations(s *AstroSpec) []string
- func StripSecretDefaults(specObj map[string]any)
- func TransformSpecForRegistry(specObj map[string]any, agentName string, ...) map[string]any
- func ValidateName(name string) error
- func ValidateVarName(name string) error
- type AgentCard
- type AgentCardAuthor
- type AgentCardRepo
- type AgentEnvMeta
- type AstroSpec
- type BindCredentialDef
- type BuildConfig
- type BuildSecret
- type BuiltinProvider
- type Component
- type ComponentKind
- type ConnectionAddress
- type Container
- type ContainerConfig
- type CredentialMeta
- type CredentialSuffix
- type CustomProvider
- type Dev
- type DevFrontend
- type DevInterfaces
- type DevMessaging
- type DevOverrides
- type EnvResult
- type GPUConfig
- type Healthcheck
- type Ingestion
- type IngestionTrigger
- type Input
- type Integration
- type Interfaces
- type Knowledge
- type KnownIntegration
- type MarkdownImage
- type Meta
- type Model
- type ParsedAgentCard
- type PortDef
- type Provider
- type ResolvedIntegration
- type SlackAdapterConfig
Constants ¶
const AgentReadmeFilename = "AGENT.md"
AgentReadmeFilename is the canonical filename for an agent's README/card. Creation writes this exact name; readers match it case-insensitively so agent.md / Agent.md also resolve on case-sensitive sources.
const DefaultAgentVolumeMount = "/data"
DefaultAgentVolumeMount is the mount path for the disk every agent gets by default. Setting agent.volume routes the agent through the StatefulSet + PVC path, so this makes persistent disk a guaranteed default. The messaging sidecar mounts the same volume under a subPath.
const GatewayProviderName = "gateway"
GatewayProviderName is the reserved model provider that routes calls through the Astro AI Gateway. It is not a builtin container/cloud provider: it deploys no container and needs no user credentials — the platform injects ASTRO_GATEWAY_URL + ASTRO_GATEWAY_API_KEY at deploy time.
const MaxAgentCardTags = 10
MaxAgentCardTags is the maximum number of tags allowed in an agent card.
const MaxCapabilityLength = 100
MaxCapabilityLength is the maximum character length for a single capability entry.
const MaxDescriptionLength = 200
MaxDescriptionLength is the maximum character length for an agent card description.
Variables ¶
Functions ¶
func AgentConnectionKeys ¶
func AgentConnectionKeys(s *AstroSpec, addrs map[string]ConnectionAddress) map[string]string
AgentConnectionKeys returns all env var keys that will be auto-injected into the agent for component connection wiring (§8.2 and §8.3). Keys are populated using the provided addrs map so that the caller controls whether values are concrete or deferred. Credential and input keys are NOT included — use CloudCredentialKeys for those.
func AgentKeysForComponent ¶
AgentKeysForComponent returns the env var key names that one specific component contributes to the agent's environment, correctly handling duplicate-provider naming by evaluating within the full spec context.
section must be "models", "knowledge", or "integrations". entryName is the map key. Only connection keys are returned.
func AllAgentAutoEnvKeys ¶
func AllAgentAutoEnvKeys(s *AstroSpec) map[string]AgentEnvMeta
AllAgentAutoEnvKeys returns all env var keys automatically injected into the agent: connection wiring keys (§8.2/§8.3) and credential keys (§8.1, cloud + custom provider secrets). Inputs are not included as they are user-defined.
func AllCredentialKeys ¶
func AllCredentialKeys(s *AstroSpec) map[string]CredentialMeta
AllCredentialKeys returns all credential key names (cloud + custom provider secrets) that will be injected into the agent, with their metadata.
func CloudCredentialKeys ¶
func CloudCredentialKeys(s *AstroSpec) map[string]CredentialMeta
CloudCredentialKeys returns the env var key names and metadata for all cloud provider credentials derived from the spec (sections 8.1). The returned map is keyed by env var key (e.g. "ANTHROPIC_API_KEY").
This is the authoritative implementation of the duplicate-handling rule:
- One entry for a provider → bare key {UPPER(provider)}_{suffix}.
- Multiple entries for the same provider → qualified keys for all; the primary entry (name matches provider, else first alphabetically) also gets the bare key.
- When entry name == provider name, the redundant qualified form is omitted.
func ComponentImageName ¶
func ComponentImageName(kind ComponentKind, agentName, name string) string
ComponentImageName returns the canonical image-name segment for a buildable component. For ComponentAgent the name is ignored and the agent name is returned directly; all other kinds use the {agent}-{kind}-{name} convention (e.g. "my-agent-knowledge-docs").
func CredentialKeys ¶
CredentialKeys returns the credential attribute names valid for ${knowledge.*.credentials.<attr>} references for the given provider. Derived from the provider registry's BindCredentials field.
func CredentialStorageKeyMap ¶
CredentialStorageKeyMap returns a map of storage key → reference attribute for a provider. Used at deploy time to map decrypted credential keys to reference attributes.
func CustomProviderCredentialKeys ¶
func CustomProviderCredentialKeys(s *AstroSpec) map[string]CredentialMeta
CustomProviderCredentialKeys returns the env var key names for all custom provider variables that are marked secret=true and are referenced by at least one component.
Keys follow §8.1: {UPPER(provider)}_{varName}, where varName is the variable suffix. Duplicate-entry handling mirrors §8.1: multiple entries referencing the same custom provider produce qualified keys; the primary entry also gets the bare key.
func DeprecatedMetaFields ¶
DeprecatedMetaFields checks raw spec YAML bytes for deprecated meta fields (description, tags) that have moved to AGENT.md frontmatter. Returns a list of human-readable deprecation messages for any found fields.
func DeprecationWarnings ¶
DeprecationWarnings returns human-readable notices for deprecated spec usage. Callers (CLI validate/create) surface these without failing the parse.
func ExtractLegacyMeta ¶
ExtractLegacyMeta extracts deprecated description and tags from a raw spec map (as stored in spec_json). Used for backward-compatible display of existing agents that haven't migrated to AGENT.md.
func IsCloudModelProvider ¶
func IsGatewayModelProvider ¶
IsGatewayModelProvider reports whether a model provider name refers to the Astro AI Gateway.
func IsManagedProvider ¶
func IsValidName ¶
IsValidName reports whether name passes ValidateName.
func IsValidVarName ¶
IsValidVarName reports whether name passes ValidateVarName.
func NormalizeTag ¶
NormalizeTag converts a tag string to a valid format: lowercase, spaces to hyphens, strip characters that aren't letters, numbers, or hyphens, collapse consecutive hyphens.
func RewriteMarkdownImages ¶
RewriteMarkdownImages returns md with every local image reference whose cleaned path is a key in replace rewritten to the mapped URL. References not present in replace (including all remote references) are left untouched.
func SanitizeDBName ¶
SanitizeDBName converts an agent name into a valid Postgres database name. Same sanitization as SanitizeEnvName but returns lowercase (Postgres convention).
Examples:
"memory-box" → "memory_box" "my.agent" → "my_agent"
func SanitizeEnvName ¶
SanitizeEnvName sanitizes an entry name and returns the uppercased form ready for use inside an env var key. Implements spec section 8.5.
Steps: lowercase → replace -, _ and . with _ → remove non-alphanumeric → collapse consecutive underscores → trim leading/trailing underscores → uppercase.
Examples:
"my_model" → "MY_MODEL" "my.store" → "MY_STORE" "my-model" → "MY_MODEL" "llm" → "LLM" "local_llm" → "LOCAL_LLM"
func SecretDefaultViolations ¶
SecretDefaultViolations returns the names of all secret inputs that still carry a non-empty default value. These must be stripped before registration to avoid storing credentials in the registry.
func StripSecretDefaults ¶
StripSecretDefaults removes default values from all secret inputs across the raw YAML spec map so that credentials are not stored in the registry.
func TransformSpecForRegistry ¶
func TransformSpecForRegistry(specObj map[string]any, agentName string, imageRefFn func(imageName string) string) map[string]any
TransformSpecForRegistry rewrites a raw YAML spec map: it replaces every build block with the corresponding image reference and normalizes the name field. Only sections that have a build block are transformed; image-only sections are left unchanged.
imageRefFn is called with each component's canonical image name and must return the fully qualified image reference (e.g. "registry.io/acct/name:tag").
func ValidateName ¶
ValidateName checks whether name is a valid Astro agent name. Rules:
- 4–63 characters
- lowercase alphanumeric with hyphens only
- must start with a lowercase letter
- must end with alphanumeric
- cannot be a reserved platform name (astro, agent, model, integration)
func ValidateVarName ¶
ValidateVarName checks whether name is a valid variable (secret) name. Rules: letters, digits, and underscores only; must start with a letter or underscore.
Types ¶
type AgentCard ¶
type AgentCard struct {
Description string `json:"description,omitempty" yaml:"description,omitempty"`
Tags []string `json:"tags,omitempty" yaml:"tags,omitempty"`
Authors []AgentCardAuthor `json:"authors,omitempty" yaml:"authors,omitempty"`
Repository *AgentCardRepo `json:"repository,omitempty" yaml:"repository,omitempty"`
Capabilities []string `json:"capabilities,omitempty" yaml:"capabilities,omitempty"`
Integrations []string `json:"-" yaml:"integrations,omitempty"`
}
AgentCard represents the structured frontmatter metadata from an AGENT.md file.
type AgentCardAuthor ¶
type AgentCardAuthor struct {
Name string `json:"name" yaml:"name"`
Account string `json:"account,omitempty" yaml:"account,omitempty"`
}
AgentCardAuthor represents an author entry in the agent card frontmatter.
func (*AgentCardAuthor) UnmarshalYAML ¶
func (a *AgentCardAuthor) UnmarshalYAML(value *yaml.Node) error
UnmarshalYAML implements custom YAML unmarshaling for AgentCardAuthor, accepting both a plain string (used as Name) and an object form.
type AgentCardRepo ¶
type AgentCardRepo struct {
Type string `json:"type,omitempty" yaml:"type,omitempty"`
URL string `json:"url" yaml:"url"`
Directory string `json:"directory,omitempty" yaml:"directory,omitempty"`
}
AgentCardRepo represents a source-code repository pointer. It can be specified as a shorthand string (e.g. "github:user/repo") or as an object with type, url, and optional directory.
func (*AgentCardRepo) UnmarshalYAML ¶
func (r *AgentCardRepo) UnmarshalYAML(value *yaml.Node) error
UnmarshalYAML implements custom YAML unmarshaling for AgentCardRepo, accepting both a shorthand string and an object form.
type AgentEnvMeta ¶
type AgentEnvMeta struct {
Source string // "connection" or "credential"
Provider string // originating provider name (lowercase), e.g. "qdrant", "anthropic"
Category string // "model", "knowledge", "integration", "provider"
Optional bool // credentials only
}
AgentEnvMeta describes one env var automatically injected into the agent.
type AstroSpec ¶
type AstroSpec struct {
Spec string `json:"spec" yaml:"spec" jsonschema:"description=Spec version. Must be package/v1"`
Name string `json:"name" yaml:"name" jsonschema:"description=Unique agent name"`
Meta Meta `json:"meta,omitempty" yaml:"meta,omitempty"`
Agent Container `json:"agent" yaml:"agent" jsonschema:"description=Main agent container"`
Models map[string]Model `json:"models,omitempty" yaml:"models,omitempty" jsonschema:"description=Model sidecar containers"`
Knowledge map[string]Knowledge `json:"knowledge,omitempty" yaml:"knowledge,omitempty" jsonschema:"description=Knowledge store containers"`
Integrations map[string]Integration `json:"integrations,omitempty" yaml:"integrations,omitempty" jsonschema:"description=Integration sidecar containers"`
Providers map[string]CustomProvider `json:"providers,omitempty" yaml:"providers,omitempty" jsonschema:"description=Custom provider definitions"`
Inputs map[string]Input `json:"inputs,omitempty" yaml:"inputs,omitempty" jsonschema:"description=User-supplied inputs injected into every container"`
Ingestion map[string]Ingestion `json:"ingestion,omitempty" yaml:"ingestion,omitempty" jsonschema:"description=Data ingestion pipelines"`
Dev *Dev `json:"dev,omitempty" yaml:"dev,omitempty" jsonschema:"description=Local development overrides"`
}
AstroSpec represents the complete Astro specification
func ParseString ¶
ParseString parses the spec content from a string
func (*AstroSpec) UsesGateway ¶
UsesGateway reports whether the agent uses the Astro AI Gateway — either via the deprecated agent.astro_ai_gateway boolean or a model with provider: gateway.
type BindCredentialDef ¶
type BindCredentialDef struct {
Attr string // reference attribute (e.g. "user", "password")
StorageKey string // exact key in credentials store (e.g. "POSTGRES_USER")
}
BindCredentialDef maps a reference attribute name (used in ${knowledge.*.credentials.<attr>}) to the exact key stored in knowledge_store_credentials.
type BuildConfig ¶
type BuildConfig struct {
Context string `json:"context" yaml:"context"`
Dockerfile string `json:"dockerfile" yaml:"dockerfile"`
Target string `json:"target,omitempty" yaml:"target,omitempty"`
Args map[string]string `json:"args,omitempty" yaml:"args,omitempty"`
Secrets []BuildSecret `json:"secrets,omitempty" yaml:"secrets,omitempty"`
}
type BuildSecret ¶
type BuiltinProvider ¶
type BuiltinProvider struct {
Name string // lowercase provider name (e.g. "anthropic", "qdrant")
Section string // "models", "knowledge", or "integrations"
Cloud bool // true → credentials only, no container deployed
Managed bool // true → server injects credentials from its own environment (user never provides them)
// Cloud provider fields
Credentials []CredentialSuffix
// Self-hosted provider fields
Image string
DefaultPort int
ExtraPorts []PortDef
MountPath string
EnvPrefix string
URLScheme string
HealthCheck []string // exec health check; nil → use HealthPath
HealthPath string // HTTP health check path
DefaultEnv map[string]string
WritableRootFS bool // true → skip readOnlyRootFilesystem (e.g. qdrant writes outside its data mount)
ExtraEmptyDirs []string // extra paths that need writable emptyDir mounts (e.g. "/qdrant/snapshots")
FsGroup int64 // non-zero → pod runs as this uid/gid (overrides hardened default of 1000)
InitSQL string // optional SQL run via /docker-entrypoint-initdb.d/ on first boot (postgres-compatible images only)
// BindCredentials defines the credential schema for knowledge store bindings.
// Each entry maps a reference attribute (e.g. "user") to its storage key (e.g. "USERNAME").
// Used by ${knowledge.*.credentials.<attr>} reference validation and deploy-time resolution.
BindCredentials []BindCredentialDef
}
BuiltinProvider is the single canonical type for every platform-known provider. All providers — cloud and self-hosted, across all sections — are declared once in the builtinProviders slice below. Everything else is derived from it.
func GetProvider ¶
func GetProvider(name string) BuiltinProvider
GetProvider returns self-hosted configuration for a knowledge provider. Unknown or cloud-only providers return a zero BuiltinProvider.
func LookupBuiltin ¶
func LookupBuiltin(section, name string) (BuiltinProvider, bool)
LookupBuiltin returns the BuiltinProvider for the given section and name. The second return value is false if the provider is not in the registry.
type Component ¶
type Component struct {
Kind ComponentKind // spec section this component belongs to
Name string // map key within the spec section (empty for agent)
ImageName string // full image-name segment, e.g. "my-agent-integration-search"
Build *BuildConfig // always non-nil (only buildable components are returned)
}
Component represents one buildable unit extracted from an AstroSpec. Only components with a build block are included.
func CollectComponents ¶
CollectComponents returns every component in the spec that has a build block. Components without a build block are omitted. The returned list uses canonical naming: {agent}-integration-{name} for integrations (matching the spec key), {agent}-model-{name} for models, etc.
type ComponentKind ¶
type ComponentKind string
ComponentKind identifies the spec section a buildable component belongs to.
const ( ComponentAgent ComponentKind = "agent" ComponentModel ComponentKind = "model" ComponentKnowledge ComponentKind = "knowledge" ComponentIntegration ComponentKind = "integration" ComponentIngestion ComponentKind = "ingestion" )
type ConnectionAddress ¶
ConnectionAddress holds the resolved connection details for a single component. Values may be concrete strings (docker DNS, k8s service DNS) or placeholder references (e.g. "${models.llm.host}") for deferred resolution.
type Container ¶
type Container struct {
Image string `json:"image,omitempty" yaml:"image,omitempty"`
Build *BuildConfig `json:"build,omitempty" yaml:"build,omitempty"`
Distributed bool `` /* 134-byte string literal not displayed */
Interfaces *Interfaces `` /* 126-byte string literal not displayed */
Healthcheck *Healthcheck `json:"healthcheck,omitempty" yaml:"healthcheck,omitempty"`
Inputs []Input `` /* 127-byte string literal not displayed */
// AIGateway opts the agent into the Astro AI Gateway. DEPRECATED at the spec
// level in favor of a model with `provider: gateway` — still honored (injects
// ASTRO_GATEWAY_URL + ASTRO_GATEWAY_API_KEY, agent picks the model at call
// time), but a gateway model entry also lets the deployer pick the model at
// deploy time. The boolean and a gateway model entry are mutually exclusive.
// (Not marked //Deprecated: so internal backward-compat reads don't trip SA1019.)
AIGateway bool `` /* 226-byte string literal not displayed */
}
func (Container) HasFrontend ¶
HasFrontend reports whether the agent serves its own web frontend.
func (Container) HasMessaging ¶
HasMessaging reports whether the agent supports the messaging protocol. Returns true when interfaces is omitted (backward compat).
type ContainerConfig ¶
type ContainerConfig struct {
Image string `json:"image,omitempty" yaml:"image,omitempty"`
Build *BuildConfig `json:"build,omitempty" yaml:"build,omitempty"`
GPU *GPUConfig `json:"gpu,omitempty" yaml:"gpu,omitempty"`
Persistent bool `json:"-" yaml:"-"` // derived; set by ResolvedContainer
Port int `json:"port,omitempty" yaml:"port,omitempty"`
Volume string `` /* 131-byte string literal not displayed */
Environment map[string]string `json:"environment,omitempty" yaml:"environment,omitempty"`
Healthcheck *Healthcheck `json:"healthcheck,omitempty" yaml:"healthcheck,omitempty"`
}
func (ContainerConfig) HasGPU ¶
func (c ContainerConfig) HasGPU() bool
HasGPU returns true when the container requires GPU resources.
type CredentialMeta ¶
type CredentialMeta struct {
Provider string
Category string // "model", "knowledge", "integration", "provider"
Description string
Optional bool
}
CredentialMeta describes one required credential.
type CredentialSuffix ¶
CredentialSuffix describes one credential a cloud provider requires.
func GetCloudIntegrationCredentials ¶
func GetCloudIntegrationCredentials(name string) ([]CredentialSuffix, bool)
func GetCloudKnowledgeCredentials ¶
func GetCloudKnowledgeCredentials(name string) ([]CredentialSuffix, bool)
func GetCloudModelCredentials ¶
func GetCloudModelCredentials(name string) ([]CredentialSuffix, bool)
type CustomProvider ¶
type CustomProvider struct {
Scope []string `json:"scope" yaml:"scope" jsonschema:"description=Sections that may reference this provider"`
Variables []Input `json:"variables" yaml:"variables" jsonschema:"description=Variables this provider requires from the user"`
Config map[string]any `json:"config,omitempty" yaml:"config,omitempty" jsonschema:"description=Provider-specific configuration"`
}
CustomProvider extends the platform's built-in provider registry. It declares the variables it requires so the platform can prompt at deploy time.
type Dev ¶
type Dev struct {
Interfaces *DevInterfaces `` /* 142-byte string literal not displayed */
Schedules map[string]string `json:"schedules,omitempty" yaml:"schedules,omitempty" jsonschema:"description=Cron schedules for ingestion jobs during dev"`
Command string `` /* 135-byte string literal not displayed */
Overrides *DevOverrides `json:"overrides,omitempty" yaml:"overrides,omitempty" jsonschema:"description=Image overrides for local dev services"`
}
Dev provides local development overrides read by `astro dev`.
func (*Dev) HasMessagingAdapters ¶
HasMessagingAdapters reports whether dev messaging adapters are configured.
func (*Dev) MessagingAdapters ¶
MessagingAdapters returns the dev messaging adapter names, or nil.
func (*Dev) MessagingLogLevel ¶
MessagingLogLevel returns the dev messaging sidecar log level, or empty when unset.
func (*Dev) SlackConfig ¶
func (d *Dev) SlackConfig() *SlackAdapterConfig
SlackConfig returns the Slack adapter configuration, or nil when not configured.
type DevFrontend ¶
type DevFrontend struct {
Port int `` /* 148-byte string literal not displayed */
}
DevFrontend configures the agent's frontend for local development.
type DevInterfaces ¶
type DevInterfaces struct {
Frontend *DevFrontend `json:"frontend,omitempty" yaml:"frontend,omitempty" jsonschema:"description=Local dev configuration for the agent frontend"`
Messaging *DevMessaging `json:"messaging,omitempty" yaml:"messaging,omitempty" jsonschema:"description=Local dev configuration for messaging"`
}
DevInterfaces configures interfaces for local development. Supports both the legacy format (string array: [slack, web]) and the structured format ({frontend: {port: 3000}, messaging: {adapters: [slack]}}). The legacy format is treated as messaging.adapters.
func (DevInterfaces) JSONSchema ¶
func (DevInterfaces) JSONSchema() *jsonschema.Schema
JSONSchema returns a schema that accepts both the legacy string-array format (["web", "slack"]) and the structured object format ({frontend: ..., messaging: ...}).
func (*DevInterfaces) UnmarshalJSON ¶
func (d *DevInterfaces) UnmarshalJSON(data []byte) error
UnmarshalJSON supports the legacy string-array format for backward compatibility. This mirrors UnmarshalYAML so that specs stored as JSON (e.g. in the agent index) can be deserialized back into AstroSpec correctly.
func (*DevInterfaces) UnmarshalYAML ¶
func (d *DevInterfaces) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML supports the legacy string-array format for backward compatibility.
type DevMessaging ¶
type DevMessaging struct {
Adapters []string `` /* 126-byte string literal not displayed */
Slack *SlackAdapterConfig `json:"slack,omitempty" yaml:"slack,omitempty" jsonschema:"description=Slack-specific adapter configuration"`
LogLevel string `` /* 159-byte string literal not displayed */
}
DevMessaging configures the messaging sidecar for local development.
type DevOverrides ¶
type DevOverrides struct {
MessagingImage string `` /* 127-byte string literal not displayed */
PlaygroundImage string `json:"playgroundImage,omitempty" yaml:"playgroundImage,omitempty" jsonschema:"description=Custom image for the playground UI"`
}
DevOverrides allows overriding default images for local dev services.
type EnvResult ¶
type EnvResult struct {
Agent map[string]string
Models map[string]map[string]string
Knowledge map[string]map[string]string
Integrations map[string]map[string]string
Ingestion map[string]map[string]string
}
EnvResult holds the computed env var maps for every container.
func ResolveEnvVars ¶
func ResolveEnvVars(s *AstroSpec, addrs map[string]ConnectionAddress, credentials, inputValues map[string]string) EnvResult
ResolveEnvVars computes the complete env var injection for all containers in a spec.
Parameters:
- addrs: maps "models.{name}", "knowledge.{name}", "tools.{name}" to connection details. Values may be concrete strings or deferred placeholders.
- credentials: maps credential key → value (cloud + custom-provider secrets).
- inputValues: maps input name → user-supplied value (falls back to Input.Default).
Returns an EnvResult with one map per container.
type GPUConfig ¶
type GPUConfig struct {
VRAM string `json:"vram,omitempty" yaml:"vram,omitempty" jsonschema:"description=GPU memory required (e.g. 24Gi)"`
Runtime string `json:"runtime,omitempty" yaml:"runtime,omitempty" jsonschema:"description=GPU runtime,enum=cuda,enum=rocm"`
}
GPUConfig is a scheduling hint declaring that a container needs GPU resources. VRAM (e.g. "24Gi") tells the server how much GPU memory the workload needs. Runtime is "cuda" (default) or "rocm".
type Healthcheck ¶
type Healthcheck struct {
Test []string `json:"test,omitempty" yaml:"test,omitempty"` // Custom health check command (e.g., ["CMD", "redis-cli", "ping"])
Path string `json:"path,omitempty" yaml:"path,omitempty"` // HTTP path for health check (auto-generates test command)
Interval string `json:"interval,omitempty" yaml:"interval,omitempty"` // How often to check (default: 10s)
Timeout string `json:"timeout,omitempty" yaml:"timeout,omitempty"` // Time to wait for response (default: 5s)
Retries int `json:"retries,omitempty" yaml:"retries,omitempty"` // Number of retries before unhealthy (default: 3)
}
type Ingestion ¶
type Ingestion struct {
Container ContainerConfig `json:"container" yaml:"container"`
Trigger IngestionTrigger `json:"trigger" yaml:"trigger"`
Inputs []Input `` /* 131-byte string literal not displayed */
}
Ingestion represents a data ingestion job — a container that runs on a trigger.
type IngestionTrigger ¶
type IngestionTrigger struct {
Type string `json:"type" yaml:"type" jsonschema:"description=When the ingestion runs,enum=schedule,enum=manual,enum=startup,enum=webhook"`
}
type Input ¶
type Input struct {
Name string `json:"name" yaml:"name" jsonschema:"description=Env var key injected into the target container"`
Datatype string `` /* 127-byte string literal not displayed */
Secret bool `json:"secret,omitempty" yaml:"secret,omitempty" jsonschema:"description=If true, stored securely and never logged"`
Description string `json:"description,omitempty" yaml:"description,omitempty"`
DisplayAs string `` /* 141-byte string literal not displayed */
Options []string `json:"options,omitempty" yaml:"options,omitempty" jsonschema:"description=Allowed values; required when display-as is select"`
Default string `json:"default,omitempty" yaml:"default,omitempty"`
Optional bool `json:"optional,omitempty" yaml:"optional,omitempty" jsonschema:"description=If true, may be omitted at deploy time"`
}
Input declares a user-supplied value prompted at deploy time and injected as an env var. The name is used directly as the env var key in the target container.
type Integration ¶
type Integration struct {
Provider string `` /* 132-byte string literal not displayed */
Container *ContainerConfig `json:"container,omitempty" yaml:"container,omitempty"`
Inputs []Input `` /* 133-byte string literal not displayed */
}
func (Integration) DeploysContainer ¶
func (t Integration) DeploysContainer(customProviders map[string]CustomProvider) bool
DeploysContainer reports whether this tool entry deploys a sidecar container.
func (Integration) IsProviderMode ¶
func (t Integration) IsProviderMode() bool
IsProviderMode returns true when the integration entry uses a cloud provider.
type Interfaces ¶
type Interfaces struct {
Frontend bool `json:"frontend,omitempty" yaml:"frontend,omitempty" jsonschema:"description=Agent serves its own web interface on port 80"`
Messaging bool `json:"messaging,omitempty" yaml:"messaging,omitempty" jsonschema:"description=Agent supports the messaging protocol"`
}
Interfaces declares agent interface capabilities. When nil (omitted), the platform defaults to messaging enabled. When present, both fields default to false.
type Knowledge ¶
type Knowledge struct {
Provider string `json:"provider,omitempty" yaml:"provider,omitempty"`
Container *ContainerConfig `json:"container,omitempty" yaml:"container,omitempty"`
Inputs []Input `` /* 131-byte string literal not displayed */
}
func (Knowledge) DeploysContainer ¶
func (k Knowledge) DeploysContainer(customProviders map[string]CustomProvider) bool
DeploysContainer reports whether this knowledge entry deploys a sidecar container.
func (Knowledge) IsProviderMode ¶
IsProviderMode returns true when the knowledge entry uses a platform-managed provider.
func (Knowledge) ResolvedContainer ¶
func (k Knowledge) ResolvedContainer() ContainerConfig
ResolvedContainer returns the effective ContainerConfig — either built from the provider registry (provider mode) or passed through from the user's container block (container mode). Persistent is derived from Volume so the invariant Persistent ⇔ Volume != "" holds in both modes.
type KnownIntegration ¶
type KnownIntegration struct {
ID string `json:"id"`
Name string `json:"name"`
Aliases []string `json:"aliases,omitempty"`
}
KnownIntegration represents an entry in the known integrations registry.
func KnownIntegrations ¶
func KnownIntegrations() []KnownIntegration
KnownIntegrations returns the full list of known integrations from the embedded registry.
func ResolveIntegration ¶
func ResolveIntegration(name string) *KnownIntegration
ResolveIntegration matches an integration string against the known integrations registry. Returns nil if no match is found (unknown integration).
Matching rules:
- Normalize input: lowercase, trim whitespace.
- Look up in the precomputed map (covers id, name, and alias matches).
- No match → return nil.
type MarkdownImage ¶
type MarkdownImage struct {
// Path is the cleaned, repo-relative path used both as the file to load and
// as the key for rewriting. Percent-decoding, query/fragment stripping, and
// lexical cleaning are already applied (e.g. "./docs/x.png?v=1" → "docs/x.png").
Path string
}
MarkdownImage is a local (repo-relative) image reference discovered in an AGENT.md document.
func ExtractMarkdownImages ¶
func ExtractMarkdownImages(md string) []MarkdownImage
ExtractMarkdownImages returns the deduplicated, first-seen-ordered set of local image references in md. Both Markdown image syntax and HTML <img> tags are scanned. Remote (scheme:// or //host), data:, anchor-only, root-absolute (/foo), and parent-escaping (../) references are skipped.
type Model ¶
type Model struct {
Provider string `` /* 145-byte string literal not displayed */
Models []string `json:"models,omitempty" yaml:"models,omitempty" jsonschema:"description=Model identifiers to make available"`
Model string `` /* 127-byte string literal not displayed */
Container *ContainerConfig `` /* 128-byte string literal not displayed */
Inputs []Input `` /* 127-byte string literal not displayed */
}
func (Model) DeploysContainer ¶
func (m Model) DeploysContainer(customProviders map[string]CustomProvider) bool
DeploysContainer reports whether this model entry deploys a sidecar container. Only container-mode models deploy a sidecar; provider-mode models are cloud (credentials only) or custom (no container).
func (Model) IsProviderMode ¶
IsProviderMode returns true when the model entry uses a platform-managed provider.
func (Model) ResolvedContainer ¶
func (m Model) ResolvedContainer() ContainerConfig
ResolvedContainer returns the effective ContainerConfig for a container-mode model. Provider-mode models never deploy a container, so this returns a zero value for them.
func (Model) ResolvedModels ¶
ResolvedModels returns the effective list of model identifiers, merging the deprecated Model field into Models.
type ParsedAgentCard ¶
type ParsedAgentCard struct {
AgentCard
Body string `json:"body"`
ResolvedIntegrations []ResolvedIntegration `json:"integrations,omitempty"`
// Warnings describe fields that were invalid and dropped/truncated. Display-only;
// not stored or serialized to clients.
Warnings []string `json:"-"`
}
ParsedAgentCard is the result of parsing an AGENT.md file.
func ParseAgentCard ¶
func ParseAgentCard(content string) *ParsedAgentCard
ParseAgentCard parses raw AGENT.md content into structured metadata and a markdown body. It extracts YAML frontmatter (delimited by --- lines) and returns the remaining content as body.
Parsing is best-effort: any field that fails to validate is dropped and recorded in result.Warnings. The function never returns a nil result.
func ParseAgentCardFile ¶
func ParseAgentCardFile(path string) (*ParsedAgentCard, error)
ParseAgentCardFile reads and parses an AGENT.md file from the given path. If the file does not exist, it returns an empty ParsedAgentCard without error. Parsing the file contents is best-effort; see ParseAgentCard.
type Provider ¶
type Provider = BuiltinProvider
Provider holds self-hosted container configuration. Returned by GetProvider for backward compatibility with existing callers.
type ResolvedIntegration ¶
type ResolvedIntegration struct {
ID string `json:"id"`
Name string `json:"name"`
Known bool `json:"known"`
}
ResolvedIntegration is an integration entry resolved against the known registry.
func MergeResolvedIntegrations ¶
func MergeResolvedIntegrations(existing []ResolvedIntegration, additional []string) []ResolvedIntegration
MergeResolvedIntegrations resolves additional integration strings and merges them into existing resolved integrations, deduplicating by ID.
type SlackAdapterConfig ¶
type SlackAdapterConfig struct {
ActionableReactions []string `` /* 196-byte string literal not displayed */
AllowedChannelIDs []string `` /* 184-byte string literal not displayed */
AllowedUserIDs []string `` /* 172-byte string literal not displayed */
ObserveChannelIDs []string `` /* 190-byte string literal not displayed */
SocketMode *bool `` /* 140-byte string literal not displayed */
AutoThread *bool `` /* 130-byte string literal not displayed */
Extra map[string]any `json:"-" yaml:",inline" jsonschema:"-"`
}
SlackAdapterConfig holds behavioral settings for the Slack messaging adapter. Shared between the dev (compose builder) and deployment (template generator) paths. Serialized as JSON into the SLACK_CONFIG env var for the messaging sidecar.
Extra captures any keys present under dev.interfaces.messaging.slack that aren't named fields above, so new messaging-sidecar options can be passed through without changes here.
func (SlackAdapterConfig) MarshalJSON ¶
func (s SlackAdapterConfig) MarshalJSON() ([]byte, error)
MarshalJSON flattens Extra into the top-level JSON object alongside the named fields. Named fields win on key conflict.
func (*SlackAdapterConfig) UnmarshalJSON ¶
func (s *SlackAdapterConfig) UnmarshalJSON(data []byte) error
UnmarshalJSON pulls out the named fields and routes any remaining keys into Extra so they round-trip back through MarshalJSON unchanged.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
generate-schema
command
Command generate-schema reflects spec.AstroSpec into a JSON Schema and writes it to package.schema.json in the package root.
|
Command generate-schema reflects spec.AstroSpec into a JSON Schema and writes it to package.schema.json in the package root. |