diff --git a/bin/loop_claude/claude_code/catalog.py b/bin/loop_claude/claude_code/catalog.py index f50873b3..b3ebe58a 100644 --- a/bin/loop_claude/claude_code/catalog.py +++ b/bin/loop_claude/claude_code/catalog.py @@ -1,16 +1,14 @@ import json -from loop_claude.claude_code.formats import catalog +from loop_claude.claude_code.formats import models_in def offered_models(folder): - return catalog(read_catalog(folder)) - - -def read_catalog(folder): + files = [] for path in folder.glob("*.json"): try: with open(path, encoding="utf-8") as handle: - yield json.load(handle) + files.append(json.load(handle)) except (OSError, ValueError): continue + return models_in(files) diff --git a/bin/loop_claude/claude_code/formats.py b/bin/loop_claude/claude_code/formats.py index a1417da7..d4a8377d 100644 --- a/bin/loop_claude/claude_code/formats.py +++ b/bin/loop_claude/claude_code/formats.py @@ -97,7 +97,7 @@ def mark_trusted(config, roots): # /*.json: {"fetchedAt": 1790618085238, "catalog": {"config": {"models": [{"id": "claude-opus-5-5", "name": "Opus 5.5", ...}]}}} -def catalog(files): +def models_in(files): """The (id, name) of each model in the newest of the parsed catalog files.""" newest = {} for data in files: