Name the field claude_code_transcripts and build Session by keyword
This commit was merged in pull request #125.
This commit is contained in:
@@ -23,9 +23,9 @@ def locations(home):
|
||||
return home / ".claude.json", home / ".claude" / "cache" / "model-catalog", home / ".claude" / "projects"
|
||||
|
||||
|
||||
# <claude_transcripts>/-home-me-code-log/<session id>.jsonl
|
||||
def transcript_path(claude_transcripts, session_id):
|
||||
hit = glob.glob(os.path.join(glob.escape(str(claude_transcripts)), "*", f"{session_id}.jsonl"))
|
||||
# <claude_code_transcripts>/-home-me-code-log/<session id>.jsonl
|
||||
def transcript_path(claude_code_transcripts, session_id):
|
||||
hit = glob.glob(os.path.join(glob.escape(str(claude_code_transcripts)), "*", f"{session_id}.jsonl"))
|
||||
return hit[0] if hit else ""
|
||||
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ NAMESPACE = uuid.UUID("64fb586b-d926-4bb3-a44c-c903e86d3eec")
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class Session:
|
||||
id: uuid.UUID
|
||||
claude_transcripts: pathlib.Path
|
||||
claude_code_transcripts: pathlib.Path
|
||||
name: str
|
||||
|
||||
|
||||
@@ -21,11 +21,11 @@ def session_for(project, paths):
|
||||
"""Exists while its transcript does."""
|
||||
# "A " is the human's cue in the session picker that the session is the loop's.
|
||||
name = f"A {project} loop-claude"
|
||||
return Session(uuid.uuid5(NAMESPACE, name), paths.claude_transcripts, name)
|
||||
return Session(id=uuid.uuid5(NAMESPACE, name), claude_code_transcripts=paths.claude_code_transcripts, name=name)
|
||||
|
||||
|
||||
def transcript_file(session):
|
||||
return transcript_path(session.claude_transcripts, session.id)
|
||||
return transcript_path(session.claude_code_transcripts, session.id)
|
||||
|
||||
|
||||
def delete_session(session):
|
||||
|
||||
Reference in New Issue
Block a user