Documentation
¶
Index ¶
- Variables
- func ApiGet(sling *sling.Sling, inputStruct interface{}, path string) (interface{}, error)
- func GetAIAgent(e Environment) string
- func GetAutomationEnvironment(e Environment) string
- func GetUserAgentString(requestingTool string) string
- type Environment
- type MockEnvironment
- type OsEnvironment
Constants ¶
This section is empty.
Variables ¶
var (
UserAgentString = GetUserAgentString("")
)
Functions ¶
func GetAIAgent ¶ added in v2.124.0
func GetAIAgent(e Environment) string
GetAIAgent returns a User-Agent comment naming the AI agent driving this process, or an empty string when none is detected. Only a normalised name is reported: the raw AI_AGENT value is free-form and user-settable, so it is used for matching and never included in the output. Detection is based on self-reported environment variables, so it is suitable for analytics but must not be relied on for security decisions.
Examples:
(ai-agent=ClaudeCode) AI_AGENT=claude-code_2-1-322_agent, or CLAUDECODE=1 (ai-agent=Cursor) CURSOR_AGENT=1 (ai-agent=Other) AI_AGENT set to a value that isn't recognised
func GetAutomationEnvironment ¶ added in v2.17.0
func GetAutomationEnvironment(e Environment) string
func GetUserAgentString ¶
Types ¶
type Environment ¶ added in v2.17.0
type MockEnvironment ¶ added in v2.17.0
type MockEnvironment struct {
// contains filtered or unexported fields
}
func NewMockEnvironment ¶ added in v2.17.0
func NewMockEnvironment() *MockEnvironment
func (MockEnvironment) Getenv ¶ added in v2.17.0
func (e MockEnvironment) Getenv(key string) string
func (MockEnvironment) Setenv ¶ added in v2.17.0
func (e MockEnvironment) Setenv(key string, value string)
type OsEnvironment ¶ added in v2.17.0
type OsEnvironment struct{}
func (OsEnvironment) Getenv ¶ added in v2.17.0
func (e OsEnvironment) Getenv(key string) string