Add progress tracking fields to shared types and session parser

Introduce ProgressSubtype union ("hook" | "bash" | "mcp" | "agent") and
three new fields on ParsedMessage: toolUseId, parentToolUseId, and
progressSubtype. These enable linking hook_progress events to the
tool_call that spawned them and classifying progress by source.

Session parser changes:
- Extract `id` from tool_use content blocks into toolUseId
- Extract `tool_use_id` from tool_result blocks into toolUseId (was
  previously misassigned to toolName)
- Read `parentToolUseID` from raw progress lines
- Derive progressSubtype from the `data.type` field using a new
  deriveProgressSubtype() helper
- Add `toolProgress` map to SessionDetailResponse for grouped progress

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-30 23:03:00 -05:00
parent 150cd0c686
commit b168e6ffd7
2 changed files with 22 additions and 2 deletions

View File

@@ -9,6 +9,8 @@ export type MessageCategory =
| "file_snapshot"
| "summary";
export type ProgressSubtype = "hook" | "bash" | "mcp" | "agent";
export interface ParsedMessage {
uuid: string;
category: MessageCategory;
@@ -17,6 +19,9 @@ export interface ParsedMessage {
toolInput?: string;
timestamp?: string;
rawIndex: number;
toolUseId?: string;
parentToolUseId?: string;
progressSubtype?: ProgressSubtype;
}
export interface SessionEntry {
@@ -39,6 +44,7 @@ export interface SessionDetailResponse {
id: string;
project: string;
messages: ParsedMessage[];
toolProgress?: Record<string, ParsedMessage[]>;
}
export interface ExportRequest {