Skip to contents

ConsoleConfig() combines runtime selection, package preparation, worker permissions, resolver settings, and tool presentation for console_tool(). Constructors have the same field names as Console's application configuration.

Usage

ConfigDiscovery(global = TRUE, project = TRUE)

ConsoleConfig(
  discovery = NULL,
  r = NULL,
  python = NULL,
  resolver = NULL,
  sandbox = NULL,
  languages = NULL,
  cache = NULL,
  environment = NULL,
  inherit_environment = NULL,
  tool = NULL,
  startup = NULL
)

Arguments

global, project

Whether to discover each configuration source. Both default to TRUE when ConfigDiscovery() is explicitly constructed.

discovery

NULL (no file discovery), or a ConfigDiscovery().

r

NULL or an RConfig().

python

NULL, an ExistingPython(), a ManagedPython(), or a FirstAvailablePython().

resolver

NULL or a ResolverConfig().

sandbox

NULL, a SandboxPolicy(), or FALSE for host execution.

languages

NULL or a character vector selecting "r", "python", and/or "sql" tool inputs. This does not select the installed runtimes.

cache

NULL, "managed", "host", or list(directory = "path"). "console" is an alias for "managed". A directory uses managed caches under <directory>/dependencies for preparation and workers. Relative paths use the project directory; a leading ~ uses Console's launch-home convention. Managed caches require sandboxing.

environment

NULL or a named character vector of child environment assignments. Empty string values are allowed; character() is an empty mapping. Resolver assignments override worker assignments for preparation.

inherit_environment

NULL, TRUE, or FALSE; controls inheritance of the trusted launch environment. Console retains its owned assignments.

tool

NULL or a ToolConfig() customizing descriptions and parameter visibility.

startup

NULL or a StartupConfig() selecting a SQL connection.

Value

An S7 configuration object. The constructor is also its S7 class.

Details

An empty ConsoleConfig() uses built-in defaults without reading global or project configuration files. Workers can read host files, write private temporary storage, and cannot use the network. Dependency preparation retains its independent built-in permissions and may download packages.

Discovery and layering

Prefer discover_console_config() to read files once into an inspectable object, or materialize_console_config() to fill defaults without file reads. prune_console_config() produces a compact view of nondefault settings. console_tool() discovers files when config is omitted.

ConfigDiscovery() explicitly enables global and project file discovery at launch. Disable either source with global = FALSE or project = FALSE. Project discovery reads .agents/console/config.yaml in console_tool()'s launch directory; no ancestor directories are searched. Files can select runtimes, child environments, and permissions, so discovery trusts the whole file.

NULL fields are omitted: selected files supply their values before native defaults apply. Runtime and environment mappings follow Console's recursive layering rules; supplied package lists replace inherited lists, including character() for no optional startup packages. Python selections replace the whole python node to avoid mixing existing and managed environments. Explicit worker and resolver SandboxPolicy() objects replace their entire permission nodes; they do not inherit grants from discovered files.

sandbox = FALSE disables enforcement for workers and dependency preparation, clearing any discovered permission nodes. An explicit resolver policy cannot be combined with this choice. Host execution has no native runner guarantee of descendant cleanup.

as.list() returns JSON-ready application settings. It excludes the launch controls discovery and sandbox = FALSE; inspect those S7 properties with @. Empty mappings, empty arrays, and omissions stay distinct.

Examples

ConsoleConfig()
ConsoleConfig(sandbox = FALSE)
ConsoleConfig(discovery = ConfigDiscovery(global = FALSE))
config <- ConsoleConfig(
  r = RConfig(packages = c("dplyr", "ggplot2"), resolution = "fixed"),
  python = ManagedPython(version = "3.13", packages = "pandas"),
  sandbox = SandboxPolicy(filesystem = SandboxFilesystem(read_write = "./output"))
)
as.list(config)