Documentation
¶
Overview ¶
Package cmd implements talon cache subcommands for the governed semantic cache.
Package cmd implements the talon init interactive wizard and config builders.
WizardState → Output File Mapping ¶
agent.talon.yaml:
AgentName, AgentDescription → agent.name, agent.description
OwnerEmail, Department → metadata.owner, metadata.department
WorkloadType="agent" → agent.model_tier=1, capabilities.allowed_tools=[sql_query,file_read,web_search]
WorkloadType="proxy" → agent.model_tier=0, capabilities.allowed_tools=[]
PackID → applyPackToAgent (openclaw → gateway proxy: model_tier=0, no tools, tags; langchain → tags)
DataSovereignty="eu_strict" → compliance.data_residency=eu, policies.model_routing.*.location=EU region
DataSovereignty="eu_preferred" → compliance.data_residency=eu
DataSovereignty="global" → compliance.data_residency=any
EnabledFeatures contains "pii" → policies.data_classification.{input_scan,output_scan,redact_pii}=true
EnabledFeatures contains "audit" → audit.{log_level=detailed,retention_days=2555,include_prompts=false}
EnabledFeatures contains "cost" → policies.cost_limits.{per_request,daily,monthly} with defaults
EnabledFeatures contains "injection" → attachment_handling.{mode=strict,scanning.detect_instructions=true}
EnabledFeatures contains "eu-ai-act" → compliance.ai_act_risk_level=limited, compliance.frameworks+=[eu-ai-act]
EnabledFeatures contains "dora" → compliance.frameworks+=[dora]
RegionID → policies.model_routing tier locations when provider has region
talon.config.yaml:
PackID=openclaw → gateway block in talon.config.yaml (enabled, callers, providers) so talon serve --gateway works ProviderID, RegionID → llm.providers.<id> block (type, config with region/key_env, enabled) ProviderID → llm primary provider DataSovereignty → llm.routing.data_sovereignty_mode DataSovereignty="eu_strict" → (OPA handles blocking; no blocked_providers in config) AgentName → tenants[0].id (default tenant) (always) → llm.pricing_file: "pricing/models.yaml"
Index ¶
- Variables
- func Execute() error
- func IsTerminal() bool
- func PacksWithGateway() []string
- func PostInitVerify(agentPath, infraPath string, out io.Writer) (warnings int, fail error)
- func PrintNextSteps(agentName, providerID string, out io.Writer)
- func VaultSecretName(providerID string) string
- func WriteConfigs(agentCfg *policy.Policy, infraCfg *InfraYAML, opts WriteOptions) error
- type CacheBlock
- type GatewayBlock
- type GatewayCaller
- type GatewayCallerOverrides
- type GatewayProvider
- type GatewayRateLimits
- type GatewayServerDefaults
- type GatewayTimeouts
- type InfraYAML
- type ProviderBlock
- type TenantBlock
- type WizardIO
- type WizardState
- type WriteOptions
Constants ¶
This section is empty.
Variables ¶
var ( // Version info injected via ldflags at build time Version = "dev" Commit = "none" BuildDate = "unknown" )
Functions ¶
func PacksWithGateway ¶
func PacksWithGateway() []string
PacksWithGateway returns pack IDs that use the LLM gateway (talon.config.yaml gateway block + talon serve --gateway). Used so wizard infra and next-steps stay consistent with pack nature.
func PostInitVerify ¶
PostInitVerify runs a subset of doctor checks (policy, config load, data dir, crypto keys) and prints results.
func PrintNextSteps ¶
PrintNextSteps prints the vault-first next steps block.
func VaultSecretName ¶
VaultSecretName returns the vault key name for talon secrets set <name>.
func WriteConfigs ¶
func WriteConfigs(agentCfg *policy.Policy, infraCfg *InfraYAML, opts WriteOptions) error
WriteConfigs writes both config files atomically (temp file + rename). Refuses overwrite without Force.
Types ¶
type CacheBlock ¶
type CacheBlock struct {
Enabled bool `yaml:"enabled"`
DefaultTTL int `yaml:"default_ttl"`
SimilarityThreshold float64 `yaml:"similarity_threshold"`
MaxEntriesPerTenant int `yaml:"max_entries_per_tenant"`
}
CacheBlock is the cache section in talon.config.yaml (governed semantic cache).
type GatewayBlock ¶
type GatewayBlock struct {
Enabled bool `yaml:"enabled"`
ListenPrefix string `yaml:"listen_prefix"`
Mode string `yaml:"mode"`
Providers map[string]GatewayProvider `yaml:"providers"`
Callers []GatewayCaller `yaml:"callers"`
ServerDefaults *GatewayServerDefaults `yaml:"default_policy,omitempty"`
RateLimits *GatewayRateLimits `yaml:"rate_limits,omitempty"`
Timeouts *GatewayTimeouts `yaml:"timeouts,omitempty"`
}
GatewayBlock is the gateway section written to talon.config.yaml when PackID is openclaw. Structure matches gateway.GatewayConfig so LoadGatewayConfig parses it correctly.
type GatewayCaller ¶
type GatewayCaller struct {
Name string `yaml:"name"`
TenantKey string `yaml:"tenant_key"` //nolint:gosec // G117 — caller identifier, not a credential
TenantID string `yaml:"tenant_id"`
Team string `yaml:"team,omitempty"`
Tags []string `yaml:"tags,omitempty"`
AllowedProviders []string `yaml:"allowed_providers,omitempty"`
PolicyOverrides *GatewayCallerOverrides `yaml:"policy_overrides,omitempty"`
}
type GatewayCallerOverrides ¶
type GatewayProvider ¶
type GatewayRateLimits ¶
type GatewayServerDefaults ¶
type GatewayServerDefaults struct {
DefaultPIIAction string `yaml:"default_pii_action"`
ResponsePIIAction string `yaml:"response_pii_action,omitempty"`
MaxDailyCost float64 `yaml:"max_daily_cost"`
MaxMonthlyCost float64 `yaml:"max_monthly_cost"`
RequireCallerID bool `yaml:"require_caller_id"`
LogPrompts bool `yaml:"log_prompts"`
LogResponses bool `yaml:"log_responses"`
}
type GatewayTimeouts ¶
type InfraYAML ¶
type InfraYAML struct {
LLM *struct {
PricingFile string `yaml:"pricing_file"`
Providers map[string]ProviderBlock `yaml:"providers"`
Routing *struct {
DataSovereigntyMode string `yaml:"data_sovereignty_mode"`
} `yaml:"routing"`
} `yaml:"llm"`
Evidence *struct {
Type string `yaml:"type"`
Path string `yaml:"path"`
} `yaml:"evidence"`
Cache *CacheBlock `yaml:"cache,omitempty"`
SecretsKeyEnv string `yaml:"secrets_key_env"`
Tenants []TenantBlock `yaml:"tenants"`
Gateway *GatewayBlock `yaml:"gateway,omitempty"`
}
InfraYAML is the structure written to talon.config.yaml.
func BuildConfigs ¶
func BuildConfigs(state WizardState) (*policy.Policy, *InfraYAML, error)
BuildConfigs converts WizardState into agent policy and infra config. Pure function, no I/O.
type ProviderBlock ¶
type ProviderBlock struct {
Type string `yaml:"type"`
Config map[string]interface{} `yaml:"config"`
Enabled bool `yaml:"enabled"`
}
ProviderBlock is one entry in llm.providers.
type TenantBlock ¶
type TenantBlock struct {
ID string `yaml:"id"`
DisplayName string `yaml:"display_name"`
Budgets struct {
Daily float64 `yaml:"daily"`
Monthly float64 `yaml:"monthly"`
} `yaml:"budgets"`
RateLimit int `yaml:"rate_limit"`
}
TenantBlock is one entry in tenants.
type WizardState ¶
type WizardState struct {
AgentName string
AgentDescription string
OwnerEmail string
Department string
WorkloadType string // "agent" | "proxy" | "hybrid"
PackID string
ProviderID string
RegionID string
DataSovereignty string // "eu_strict" | "eu_preferred" | "global"
EnabledFeatures []string
CacheEnabled bool // semantic cache for cost savings (off by default)
}
WizardState accumulates wizard answers.