nxp_monkey.cache

design / api / cache

cache_path

Kind: function.

Return the cache root pathlib.Path. Cross-platform via platformdirs. See ADR-0006 for the full layout contract.

Rationale

Downstream tools and agents need a stable, programmatic way to find the cache without re-implementing platformdirs logic. Returning a Path (not a string) keeps callers honest about path handling on Windows.

cache_size

Kind: function.

Return the total byte size of files under the cache root. Returns 0 when the cache is empty. Iterates with rglob; not intended for sub-second polling.

cache_clear

Kind: function.

Remove cached content. The scope argument selects what to remove ("all", "versions", "index", or a specific tool version label).

Safety

Per ADR-0006, only re-fetchable upstream content lives under the cache root, so clearing is always safe. Future scopes that touch user-owned state would require an ADR.