Construct configuration from named fields or one named list using the same
field names and nesting as config.yaml. Construction validates the supplied
values without reading files, finding executables, or starting a process.
Nested lists are converted to typed configuration objects; edit properties
with @, including replacing a nested object with another named list.
Usage
ConsoleConfig(
...,
r = NULL,
python = NULL,
resolver = NULL,
sandbox = NULL,
languages = NULL,
cache = NULL,
environment = NULL,
inherit_environment = NULL,
tool = NULL,
startup = NULL,
sessions = NULL
)Arguments
- ...
A single unnamed list of configuration fields, instead of named arguments. All other arguments must be supplied by their full names.
- r
An R executable path, or a list with
executable,packages,resolution, andvanilla. Resolution is"implicit"(prepare packages as needed),"explicit"(only on request),"fixed"(startup packages only), or"disabled"(use installed packages).vanilla = TRUEskips native R startup files.- python
An existing environment path,
list(existing = path), orlist(managed = list(version = "3.13", packages = "pandas", resolution = "fixed")). Managed Python supports"implicit","explicit", and"fixed".list(first_available = list(...))tries existing paths,"active_venv", and an optional managed choice, last, in order.- resolver
A list with
environment,inherit_environment, andsandbox, controlling package preparation separately from executed code.- sandbox
A permission list with
profile,filesystem,network, andtempdir, orFALSEfor host execution. Profiles are"read_only"(the default),"workspace"(project writes with metadata protection), and"inherit_codex"(client permissions). Filesystem entries areread_only,read_write, anddenypath vectors. Temporary storage is"managed"(the default),"read_write", or"read_only".- languages
A character vector selecting
"r","python", and/or"sql". By default all three are visible to the model.- cache
"managed","host", orlist(directory = "/path/to/cache")for package caches. Defaults to managed caches with sandboxing and host caches withsandbox = FALSE.- environment
Named character vector or list of string environment values shared by workers and package preparation.
- inherit_environment
Whether child processes inherit the launch environment,
TRUEby default.- tool
A list with
description,instructions, andparameters. Each named parameter acceptsenabled,description, and nestedparameters; for example,list(parameters = list(timeout_ms = list(enabled = FALSE)))hides the timeout argument.- startup
A list with
language("r"or"python") andcodethat creates and selects a SQL connection before the first cell in each session.- sessions
A list with
max, a positive whole number limiting concurrent sessions. By default there is no limit.
Details
Use load_console_config() to read configuration files once. Both constructors
return the same class, and passing either result to console_tools() disables
further file discovery. Unspecified R selection uses the calling R installation
at load or launch, below explicit configuration.
NULL fields are omitted. Empty mappings and character vectors are retained.
as.list() returns JSON-ready application settings; the launch-only choice
sandbox = FALSE is not included in that document.
A loaded R executable reset is retained as an explicit JSON null, so saving
and reloading the settings preserves native R discovery.
For worker or resolver network settings, TRUE enables direct networking
and FALSE restricts it. The scalar strings "enabled" and "restricted"
select the same modes; other strings are allowed proxy patterns. Character
vectors and unnamed lists supply allowed patterns, including an empty vector
or list for an explicit empty allow list. Named mappings use
proxy = list(domains = list(allow = ..., deny = ...)) for explicit rules.
YAML accepts the same boolean, string, and sequence forms. A YAML
network: null is omitted when files merge, preserving an earlier network
field. R network = NULL is omitted from the constructed settings.
See also
console_tools() to launch with this configuration;
load_console_config() to read configuration files;
vignette("configuration", package = "mcp.console") for settings and examples.