constant

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package constant centralizes string keys and default values used across the Agent Runtime so they are declared once instead of scattered as literals.

Index

Constants

View Source
const (
	MetaKeyTraceID       = "x-trace-id"
	MetaKeyTraceparent   = "traceparent"
	MetaKeyAPIKey        = "x-api-key"
	MetaKeyAuthorization = "authorization"
)

gRPC metadata (header) keys used to resolve trace/auth context.

View Source
const (
	RoleSystem    = "system"
	RoleUser      = "user"
	RoleAssistant = "assistant"
	RoleTool      = "tool"
)

Chat message roles.

View Source
const (
	StreamProtocolGRPC = "grpc"
	StreamProtocolSSE  = "sse"
)

Stream protocol identifiers reported in MetaEvent.stream_protocol.

View Source
const (
	EventMeta        = "meta"
	EventDelta       = "delta"
	EventToolCall    = "tool_call"
	EventTool        = "tool"
	EventInterrupted = "interrupted"
	EventError       = "error"
	EventDone        = "done"
	EventMessage     = "message"
)

SSE event names emitted by the HTTP gateway (mirror StreamEvent oneof).

View Source
const (
	EnvGRPCAddr                    = "GRPC_ADDR"
	EnvHTTPAddr                    = "HTTP_ADDR"
	EnvDefaultModel                = "DEFAULT_MODEL"
	EnvDefaultAPIKey               = "DEFAULT_API_KEY"
	EnvDefaultAPIBase              = "DEFAULT_API_BASE"
	EnvRuntimePublicURL            = "AGENT_RUNTIME_PUBLIC_URL"
	EnvRuntimeClientInternalURL    = "ATHENA_RUNTIME_CLIENT_INTERNAL_URL"
	EnvRuntimeClientGoalURL        = "ATHENA_RUNTIME_CLIENT_GOAL_URL"
	EnvInternalServiceToken        = "ATHENA_INTERNAL_SERVICE_TOKEN"
	EnvResearchCacheDir            = "ATHENA_RESEARCH_CACHE_DIR"
	EnvResearchProviders           = "ATHENA_RESEARCH_PROVIDERS"
	EnvResearchMaxQueries          = "ATHENA_RESEARCH_MAX_QUERIES"
	EnvResearchMaxPages            = "ATHENA_RESEARCH_MAX_PAGES"
	EnvResearchMaxRounds           = "ATHENA_RESEARCH_MAX_ROUNDS"
	EnvResearchTimeoutSec          = "ATHENA_RESEARCH_TIMEOUT_SEC"
	EnvResearchGitHubToken         = "ATHENA_GITHUB_TOKEN"
	EnvGitHubToken                 = "GITHUB_TOKEN"
	EnvPluginsEnabled              = "ATHENA_PLUGINS_ENABLED"
	EnvPluginsDir                  = "ATHENA_PLUGINS_DIR"
	EnvPluginRegistryPath          = "ATHENA_PLUGIN_REGISTRY_PATH"
	EnvPluginTrustStorePath        = "ATHENA_PLUGIN_TRUST_STORE_PATH"
	EnvPluginAuditPath             = "ATHENA_PLUGIN_AUDIT_PATH"
	EnvPluginRequireSignature      = "ATHENA_PLUGIN_REQUIRE_SIGNATURE"
	EnvOperationsMaxInflight       = "ATHENA_OPERATIONS_MAX_INFLIGHT"
	EnvOperationsMaxQueue          = "ATHENA_OPERATIONS_MAX_QUEUE"
	EnvOperationsAdmissionWaitMS   = "ATHENA_OPERATIONS_ADMISSION_WAIT_MS"
	EnvOperationsRequestTimeoutSec = "ATHENA_OPERATIONS_REQUEST_TIMEOUT_SEC"
	EnvDBEnabled                   = "ATHENA_DB_ENABLED"
	EnvDBType                      = "ATHENA_DB_TYPE"
	EnvDBHost                      = "ATHENA_DB_HOST"
	EnvDBPort                      = "ATHENA_DB_PORT"
	EnvDBUser                      = "ATHENA_DB_USER"
	EnvDBPassword                  = "ATHENA_DB_PASSWORD"
	EnvDBName                      = "ATHENA_DB_NAME"
	EnvDBSSLMode                   = "ATHENA_DB_SSL_MODE"
	// EnvConfigPath points to the YAML config file (db + memory sections).
	EnvConfigPath = "AGENT_RUNTIME_CONFIG"
)

Environment variable names for server configuration.

View Source
const (
	DefaultGRPCAddr   = ":18080"
	DefaultHTTPAddr   = ":18081"
	DefaultConfigPath = "config.yaml"
)

Default listen addresses and config path.

View Source
const (
	ContextKeySessionID  = "session_id"
	ContextKeyUserID     = "user_id"
	ContextKeyAgentID    = "agent_id"
	ContextKeyProjectDir = "project_dir"
)

Context keys carried in RunRequest/AgentRequest.context (google.protobuf.Struct) used to scope memory to a session/user/agent.

View Source
const (
	RouteHealth               = "/healthz"
	RouteRun                  = "/run"
	RouteAgent                = "/agent"
	RouteGenerated            = "/generated"
	RouteCapabilities         = "/capabilities"
	RouteReady                = "/readyz"
	RouteGAReadiness          = "/readiness"
	RouteMetrics              = "/metrics"
	HeaderTraceID             = "X-Trace-Id"
	HeaderRequestID           = "X-Request-Id"
	HeaderCorrelationID       = "X-Correlation-Id"
	HeaderTraceparent         = "Traceparent"
	HeaderAthenaInternalToken = "X-Athena-Internal-Token"
)

HTTP gateway routes and headers.

View Source
const (
	AgentName        = "main_agent"
	AgentDescription = "Main agent backed by an eino chat model"
)

Agent identity used when constructing the ADK ChatModelAgent.

View Source
const (
	Version                    = "1.0.0"
	DefaultMaxIterations       = 20
	DefaultParallelToolWorkers = 8
)

Runtime defaults.

View Source
const (
	EnvAgentRuntimeHome = "AGENT_RUNTIME_HOME"
	EnvBaseDir          = "XQL_BASE_DIR"
	EnvSkillsDir        = "SKILLS_DIR"
	EnvGlobalSkillsDir  = "GLOBAL_SKILLS_DIR"
	EnvSkillsConfigPath = "SKILLS_CONFIG_PATH"
	EnvSandboxImage     = "SANDBOX_IMAGE"
)

Environment variable names for skill/sandbox directory resolution.

View Source
const (
	DefaultBaseDirName        = ".agent-runtime"
	DefaultAthenaHomeDirName  = ".athena"
	DefaultAthenaTempDirName  = "athena"
	DirSkills                 = "skills"
	DirDataReports            = "data/reports"
	DirModels                 = "models"
	DirDiffusers              = "diffusers"
	DirImageRuntime           = "image-runtime"
	DirVenv                   = "venv"
	DirGeneratedImages        = "generated-images"
	SkillsConfigRelPath       = "config/skills-config.yaml"
	FallbackReportsDir        = "/tmp/reports"
	FallbackReportsURL        = "/reports"
	SkillMDFileName           = "SKILL.md"
	SkillScriptsDir           = "scripts"
	AutoDataFileName          = ".auto_data.json"
	DiffusersCompleteFileName = ".athena_complete"
	OllamaStartupLogFileName  = "athena-ollama.log"
	SkillScopeBoth            = "both"
)

Base directory layout used for skills, reports and other runtime data.

View Source
const (
	DefaultSandboxImage         = "alpine:latest"
	DefaultPptxImage            = "node:18-alpine"
	SandboxWorkdir              = "/workspace"
	DefaultSandboxTimeoutMs     = 120000
	DefaultSandboxExecTimeoutMs = 60000
)

Sandbox execution defaults.

View Source
const (
	DefaultBashTimeoutSec         = 30
	DefaultSkillExecTimeoutSec    = 120
	DefaultWebRequestTimeoutSec   = 30
	DefaultWebFetchCacheTTLMin    = 15
	DefaultSubAgentWaitTimeoutSec = 30
	MaxSubAgentWaitTimeoutSec     = 300
	DefaultParallelTaskTimeoutSec = 60
	DefaultPoolTimeoutSec         = 300
	DefaultResearchTimeoutSec     = 30
	DefaultProviderTimeoutSec     = 10
	DefaultCircuitOpenSec         = 120
)

Timeout defaults (seconds unless noted).

View Source
const (
	DefaultSkillMaxIterations  = 30
	DefaultMaxReviewMemory     = 10
	DefaultResearchMaxQueries  = 6
	DefaultResearchMaxPages    = 8
	DefaultResearchMaxRounds   = 3
	DefaultResearchResults     = 5
	DefaultProviderFailures    = 3
	DefaultResearchCacheTTLMin = 60
	DefaultNewsCacheTTLMin     = 5
)

Miscellaneous runtime magic numbers.

View Source
const (
	DefaultOpenAIAPIBase                         = "https://api.openai.com/v1"
	DefaultOllamaAPIBase                         = "http://127.0.0.1:11434"
	DefaultRuntimePublicURL                      = "http://127.0.0.1:18081"
	DefaultRuntimeClientInternalScheduledTaskURL = "http://127.0.0.1:8090/api/agent-runtime-client/v1/internal/scheduled-task"
	DefaultRuntimeClientInternalGoalURL          = "http://127.0.0.1:8090/api/agent-runtime-client/v1/internal/goals"
	DuckDuckGoHTMLSearchURL                      = "https://html.duckduckgo.com/html/?q=%s"
	GitHubAPIBase                                = "https://api.github.com"
	WikipediaEnglishBase                         = "https://en.wikipedia.org"
	WikipediaChineseBase                         = "https://zh.wikipedia.org"
	ArxivAPIURL                                  = "https://export.arxiv.org/api/query"
	GDELTDocAPIURL                               = "https://api.gdeltproject.org/api/v2/doc/doc"
)

External service endpoints.

View Source
const (
	ProviderOllama    = "ollama"
	ProviderDiffusers = "diffusers"

	RuntimeModeAlwaysOn = "always_on"
	RuntimeModeOnDemand = "on_demand"
	RuntimeModeOff      = "off"
)

Local model providers and lifecycle modes.

View Source
const (
	RiskLevelLow    = "low"
	RiskLevelMedium = "medium"
	RiskLevelHigh   = "high"
)

Risk levels used by the approval engine.

View Source
const (
	ToolTypeBuiltin = "builtin"
	ToolTypeSkill   = "skill"
	ToolTypeMCP     = "mcp"
	ToolTypeA2A     = "a2a"
	ToolTypeHTTP    = "http"
)

Tool type identifiers used for approval wrapping and diagnostics.

View Source
const (
	ModelRoleDefault = "default"
)

Model routing role keys (map keys in RunRequest.models).

Variables

This section is empty.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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