Name formats.py's samples by what they are, put Session's lifetime on Session, and file the prose pass's places

This commit was merged in pull request #135.
This commit is contained in:
2026-09-29 11:53:46 +02:00
parent c2be13efd5
commit aba2a98d7e
3 changed files with 9 additions and 4 deletions
+3 -3
View File
@@ -1,4 +1,4 @@
"""Every Claude Code shape loop-claude reads, each under a sample of it, as Claude Code 2.1.284 writes it."""
"""Claude Code's JSON shapes loop-claude handles, each under a sample of it, as Claude Code 2.1.284 writes it."""
import json
from loop_claude.outcome import Failure
@@ -84,7 +84,7 @@ def structured_output(stdout):
return (parse(stdout) or {}).get("structured_output")
# ~/.claude.json: {"projects": {"/home/me/code/log": {"hasTrustDialogAccepted": true, ...}}, ...}
# Claude Code's config: {"projects": {"/home/me/code/log": {"hasTrustDialogAccepted": true, ...}}, ...}
def mark_trusted(config, roots):
projects = config.get("projects", {}) if isinstance(config, dict) else None
if not isinstance(projects, dict):
@@ -96,7 +96,7 @@ def mark_trusted(config, roots):
return {**config, "projects": {**projects, **marked}}, untrusted
# <model catalog>/*.json: {"fetchedAt": 1790618085238, "catalog": {"config": {"models": [{"id": "claude-opus-5-5", "name": "Opus 5.5", ...}]}}}
# A model catalog file: {"fetchedAt": 1790618085238, "catalog": {"config": {"models": [{"id": "claude-opus-5-5", "name": "Opus 5.5", ...}]}}}
def models_in(files):
"""The (id, name) of each model in the newest of the parsed catalog files."""
newest = {}