Help us shape the future of Go! Take the 2026 Go Developer Survey

config

package
v1.0.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProtocolVersion = "2026-08-11"
	ServerName      = "agentdock"
	PathModel       = "host"
	RecallTimeoutMS = 30000
)
View Source
const (
	SkillDataDirEnvKey  = "SKILL_DATA_DIR"
	PluginDataDirEnvKey = "PLUGIN_DATA_DIR"
)

Variables

This section is empty.

Functions

func IsReservedCommandEnvironmentKey added in v0.9.0

func IsReservedCommandEnvironmentKey(key string) bool

IsReservedCommandEnvironmentKey covers every runtime-owned command variable.

func IsReservedPluginEnvironmentKey added in v0.9.0

func IsReservedPluginEnvironmentKey(key string) bool

IsReservedPluginEnvironmentKey reports whether a variable is owned by the Plugin runtime and cannot be supplied through user environment config.

func IsReservedSkillEnvironmentKey added in v0.9.0

func IsReservedSkillEnvironmentKey(key string) bool

IsReservedSkillEnvironmentKey reports whether a variable is owned by the AgentDock Skill runtime and cannot be supplied through user environment config.

func PluginDataDir added in v0.9.0

func PluginDataDir(cfg Config, pluginName string) (string, error)

PluginDataDir returns the private persistent-data directory assigned to one installed Plugin. The path is version-independent so updates preserve data.

func PluginSkillDataDir added in v0.9.0

func PluginSkillDataDir(cfg Config, pluginName, skill string) (string, error)

PluginSkillDataDir returns the private persistent-data directory assigned to one Skill inside a Plugin. It is independent from the shared Plugin data root.

func PluginSkillDataRoot added in v0.9.0

func PluginSkillDataRoot(cfg Config, pluginName string) (string, error)

PluginSkillDataRoot returns the version-independent data namespace for all Skills owned by one Plugin. The hidden .plugin segment cannot collide with a valid standalone Skill name.

func SkillDataDir added in v0.9.0

func SkillDataDir(cfg Config, skill string) (string, error)

SkillDataDir returns the private persistent-data directory assigned to one managed Skill. It validates the Skill identity itself so callers cannot turn a data-directory lookup into an arbitrary path join.

func SkillDir added in v0.9.0

func SkillDir(cfg Config) string

SkillDir returns the managed Skill root. Each child directory is the current installed content for one standalone managed Skill.

func ValidateOAuthAccessTokenTTL added in v0.7.7

func ValidateOAuthAccessTokenTTL(value string) error

ValidateOAuthAccessTokenTTL validates an explicit access-token lifetime using the same syntax and bounds as AGENTDOCK_OAUTH_ACCESS_TOKEN_TTL.

Types

type ACPProfile added in v0.9.0

type ACPProfile struct {
	ID          string            `json:"id"`
	DisplayName string            `json:"display_name,omitempty"`
	Kind        string            `json:"kind"`
	Command     string            `json:"command"`
	Args        []string          `json:"args,omitempty"`
	EnvFromEnv  map[string]string `json:"env_from_env,omitempty"`
	Enabled     bool              `json:"enabled"`
}

ACPProfile 表示一个可独立运行、独立持久化会话的 ACP 实例。 内置类型使用固定 ID(codex/claude/grok)保持单实例;custom 使用自定义 ID 支持多个实例。

type Config

type Config struct {
	AgentDockHome                string
	AgentDockDefaultDir          string
	CommandEnvFromEnv            map[string]string
	Host                         string
	Port                         int
	AuthToken                    string
	OAuthEnabled                 bool
	OAuthServerURL               string
	OAuthAccessTokenTTLSeconds   int64
	OAuthAccessTokenNeverExpires bool
	LogLevel                     string
	NexusEndpoint                string
	NexusDeviceToken             string
	MCPAppsMode                  MCPAppsMode
	BrowserEnabled               bool
	BrowserExecutablePath        string
	BrowserCDPURL                string
	BrowserReuseExistingCDP      bool
	ACPEnabled                   bool
	ACPProfiles                  []ACPProfile
	ACPDefaultProfile            string
	ACPMaxPrompts                int
	ACPInteractionMS             int
	Stdio                        bool
	TrustedProxyCIDRs            []string
}

func FromEnv

func FromEnv() (Config, error)

func (Config) AuthRequired

func (c Config) AuthRequired() bool

func (Config) EffectiveACPDefaultProfile added in v0.9.0

func (c Config) EffectiveACPDefaultProfile() string

func (Config) EffectiveACPProfiles added in v0.9.0

func (c Config) EffectiveACPProfiles() []ACPProfile

EffectiveACPProfiles 返回 Runtime 实际需要启动的 ACP profile。

func (*Config) Normalize

func (c *Config) Normalize() error

func (Config) ValidateAuth

func (c Config) ValidateAuth() error

type MCPAppsMode added in v0.9.1

type MCPAppsMode string
const (
	MCPAppsModeFull    MCPAppsMode = "full"
	MCPAppsModeCompact MCPAppsMode = "compact"
	MCPAppsModeOff     MCPAppsMode = "off"
)

func ParseMCPAppsMode added in v0.9.1

func ParseMCPAppsMode(value string) (MCPAppsMode, error)

Jump to

Keyboard shortcuts

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