(conn, turns)
| 557 | |
| 558 | |
| 559 | def insert_turns(conn, turns): |
| 560 | conn.executemany(""" |
| 561 | INSERT OR IGNORE INTO turns |
| 562 | (session_id, timestamp, model, input_tokens, output_tokens, |
| 563 | cache_read_tokens, cache_creation_tokens, tool_name, cwd, message_id, |
| 564 | is_subagent, agent_id) |
| 565 | VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) |
| 566 | """, [ |
| 567 | (t["session_id"], t["timestamp"], t["model"], |
| 568 | t["input_tokens"], t["output_tokens"], |
| 569 | t["cache_read_tokens"], t["cache_creation_tokens"], |
| 570 | t["tool_name"], t["cwd"], t.get("message_id", ""), |
| 571 | t.get("is_subagent", 0), t.get("agent_id")) |
| 572 | for t in turns |
| 573 | ]) |
| 574 | |
| 575 | |
| 576 | def scan(projects_dir=None, projects_dirs=None, db_path=DB_PATH, verbose=True): |
no outgoing calls