cape.agent.skills.cntlrunner: Run whitelisted Cntl methods¶
This module defines the built-in agent skill "cntl-runner", which
teaches the CAPE agent how to call methods of a CAPE run matrix control
instance (cape.cfdx.cntl.Cntl and subclasses) that are not
covered by the fixed CLI tools.
The skill provides the run_cntl_methods() tool, which reads a CAPE
JSON file into a Cntl instance using
cape.cfdx.cli.read_cntl_cache() and then runs one or more methods
of that instance from a whitelist of read-only methods.
- cape.agent.skills.cntlrunner.run_cntl_methods(f: str | None = None, solver: str | None = None, calls: list | None = None) dict¶
Read a CAPE JSON file and run whitelisted
Cntlmethods on itThe JSON file is read into a Cntl instance using
cape.cfdx.cli.read_cntl_cache(). Each entry of calls is a dict with a required"method"key and optional"args"and"kwargs", which must name a method in METHOD_WHITELIST.A failing call flags its own entry but does not prevent remaining calls from running; mutating methods are not in the whitelist.
- Call:
>>> result = run_cntl_methods(f=None, solver=None, calls=calls)
- Inputs:
- Outputs:
- result:
dict Keys include success, results (one entry per call), and stdout
- result:
- Versions:
2026-09-01
@ddalle: v1.0