Documentation
¶
Index ¶
- Constants
- func AppendToAuthorizedCommands(commandRegex string) error
- func GetAgentContextWindowTokens(runner *interp.Runner, logger *zap.Logger) int
- func GetAgentMacros(runner *interp.Runner, logger *zap.Logger) map[string]string
- func GetApprovedBashCommandRegex(runner *interp.Runner, logger *zap.Logger) []string
- func GetAuthorizedCommandsFileForTesting() string
- func GetConfigDirForTesting() string
- func GetContextNumHistoryConcise(runner *interp.Runner, logger *zap.Logger) int
- func GetContextNumHistoryVerbose(runner *interp.Runner, logger *zap.Logger) int
- func GetContextTypesForAgent(runner *interp.Runner, logger *zap.Logger) []string
- func GetContextTypesForExplanation(runner *interp.Runner, logger *zap.Logger) []string
- func GetContextTypesForPredictionWithPrefix(runner *interp.Runner, logger *zap.Logger) []string
- func GetContextTypesForPredictionWithoutPrefix(runner *interp.Runner, logger *zap.Logger) []string
- func GetHistoryContextLimit(runner *interp.Runner, logger *zap.Logger) int
- func GetHomeDir(runner *interp.Runner) string
- func GetLogLevel(runner *interp.Runner) zap.AtomicLevel
- func GetMinimumLines(runner *interp.Runner, logger *zap.Logger) int
- func GetPwd(runner *interp.Runner) string
- func IsCommandAuthorized(command string) (bool, error)
- func IsCommandPatternAuthorized(commandPattern string) (bool, error)
- func LoadAuthorizedCommandsFromFile() ([]string, error)
- func ResetCacheForTesting()
- func SetAuthorizedCommandsFileForTesting(file string)
- func SetConfigDirForTesting(dir string)
- func ShouldCleanLogFile(runner *interp.Runner) bool
- func WriteAuthorizedCommandsToFile(patterns []string) error
Constants ¶
const (
DEFAULT_PROMPT = "gsh> "
)
Variables ¶
This section is empty.
Functions ¶
func AppendToAuthorizedCommands ¶ added in v0.23.0
AppendToAuthorizedCommands appends a command regex to the authorized_commands file
func GetAgentMacros ¶ added in v0.16.0
func GetApprovedBashCommandRegex ¶ added in v0.10.0
func GetAuthorizedCommandsFileForTesting ¶ added in v0.23.0
func GetAuthorizedCommandsFileForTesting() string
func GetConfigDirForTesting ¶ added in v0.23.0
func GetConfigDirForTesting() string
Helper functions for testing
func GetContextNumHistoryConcise ¶ added in v0.9.0
func GetContextNumHistoryVerbose ¶ added in v0.9.0
func GetContextTypesForAgent ¶ added in v0.9.0
func GetContextTypesForExplanation ¶ added in v0.9.0
func GetContextTypesForPredictionWithPrefix ¶ added in v0.9.0
func GetContextTypesForPredictionWithoutPrefix ¶ added in v0.9.0
func GetHistoryContextLimit ¶
func GetHomeDir ¶ added in v0.9.2
func GetLogLevel ¶
func GetLogLevel(runner *interp.Runner) zap.AtomicLevel
func GetMinimumLines ¶ added in v0.4.0
func IsCommandAuthorized ¶ added in v0.23.0
IsCommandAuthorized checks if a command matches any of the authorized patterns
func IsCommandPatternAuthorized ¶ added in v0.23.0
IsCommandPatternAuthorized checks if a specific command pattern already exists in the authorized_commands file This is used for pre-selecting permissions in the menu - only exact pattern matches should be pre-selected
func LoadAuthorizedCommandsFromFile ¶ added in v0.23.0
LoadAuthorizedCommandsFromFile loads authorized command regex patterns from file
func ResetCacheForTesting ¶ added in v0.23.0
func ResetCacheForTesting()
ResetCacheForTesting resets the authorized commands cache for testing
func SetAuthorizedCommandsFileForTesting ¶ added in v0.23.0
func SetAuthorizedCommandsFileForTesting(file string)
func SetConfigDirForTesting ¶ added in v0.23.0
func SetConfigDirForTesting(dir string)
func ShouldCleanLogFile ¶
func WriteAuthorizedCommandsToFile ¶ added in v0.23.0
WriteAuthorizedCommandsToFile writes a list of regex patterns to the authorized_commands file This replaces the entire file content and deduplicates entries
Types ¶
This section is empty.