32 lines
920 B
Python
32 lines
920 B
Python
import json
|
|
import os
|
|
import re
|
|
|
|
ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
|
LOG_PATH = os.path.join(ROOT, "docs", "progress-log.md")
|
|
|
|
def latest_entry():
|
|
try:
|
|
with open(LOG_PATH, encoding="utf-8") as f:
|
|
text = f.read()
|
|
except FileNotFoundError:
|
|
return ""
|
|
for part in re.split(r"^---$", text, flags=re.MULTILINE):
|
|
if re.search(r"^## ", part, re.MULTILINE):
|
|
return part.strip()
|
|
return ""
|
|
|
|
entry = latest_entry()
|
|
if entry:
|
|
context = (
|
|
"Project: Duoc Thu RAG medical chatbot (D:\\VSF-DUOCTHU). "
|
|
"Latest entry from docs/progress-log.md (read that file and "
|
|
"CLAUDE.md for full status before assuming anything):\n\n" + entry
|
|
)
|
|
print(json.dumps({
|
|
"hookSpecificOutput": {
|
|
"hookEventName": "SessionStart",
|
|
"additionalContext": context,
|
|
}
|
|
}))
|