The wcgw agent operates in different modes that restrict its capabilities (bash execution, file editing, and file writing). You can configure these via ModesConfig.
Available Modes
wcgw: The standard mode. Allows normal bash execution, file editing, and writing to all files.architect: A read-only mode. Restricts bash to restricted_mode, and prohibits all file editing and writing. Designed for repository exploration.code_writer: A customizable mode. By default, it behaves like wcgw, but allows for granular restrictions on which files can be edited or written to using glob patterns.
Mode Configuration via modes_to_state
You can convert a mode configuration into the internal state used by the agent. If you provide a string (e.g., "architect"), it uses the default settings for that mode. If you provide a ModesConfig object, it treats it as a customized code_writer mode.
# Example of how modes are structured conceptually
# Using 'architect' mode
# bash_mode: "restricted_mode", allowed_commands: "all"
# file_edit_mode: allowed_globs: []
# write_if_empty_mode: allowed_globs: []
# Using a custom 'code_writer' mode via ModesConfig
# (Assuming ModesConfig is imported and available)
# mode_config = ModesConfig(allowed_globs=["src/**/*.py"], allowed_commands=["pytest"])
# bash_cmd, edit_mode, write_mode, mode_name = modes_to_state(mode_config)