Name each entry shape written_by_human checks, and annotate every parameter in loop_claude
This commit is contained in:
@@ -6,6 +6,8 @@ import shutil
|
||||
import sys
|
||||
import uuid
|
||||
|
||||
from loop_claude.paths import Paths
|
||||
|
||||
NAMESPACE = uuid.UUID("64fb586b-d926-4bb3-a44c-c903e86d3eec")
|
||||
|
||||
|
||||
@@ -17,19 +19,19 @@ class Session:
|
||||
name: str
|
||||
|
||||
|
||||
def session_for(project, paths) -> Session:
|
||||
def session_for(project: str, paths: Paths) -> Session:
|
||||
# "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(id=uuid.uuid5(NAMESPACE, name), claude_code_transcripts=paths.claude_code_transcripts, name=name)
|
||||
|
||||
|
||||
# <claude_code_transcripts>/-home-me-code-log/<session id>.jsonl
|
||||
def transcript_file(session) -> str:
|
||||
def transcript_file(session: Session) -> str:
|
||||
hit = glob.glob(os.path.join(glob.escape(str(session.claude_code_transcripts)), "*", f"{session.id}.jsonl"))
|
||||
return hit[0] if hit else ""
|
||||
|
||||
|
||||
def delete_session(session) -> None:
|
||||
def delete_session(session: Session) -> None:
|
||||
path = transcript_file(session)
|
||||
if not path:
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user