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 Cntl methods on it

The 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:
f: str | None

Name of CAPE JSON file (or use most recent)

solver: str | None

Solver module (or determine based on f)

calls: list[dict]

Ordered list of method calls; each has "method" and optional "args" (list) and "kwargs" (dict)

Outputs:
result: dict

Keys include success, results (one entry per call), and stdout

Versions:
  • 2026-09-01 @ddalle: v1.0