48
*/
49
export class ClaudeMapperState {
50
>
private readonly _activeToolBlocks = new Map<number, { toolUseId: string; toolName: string }>();
claudeMapSessionEvents.ts
51
>
/**
52
>
* Phase 8.5 — cross-message tool-call attribution + input
53
>
* accumulation + computed start-info, encapsulated as its own
54
>
* collaborator class so it can be unit-tested independently.
55
>
* Public so mapper functions can call its lifecycle methods
56
>
* directly without forwarding through this class.
57
>
*/
58
>
readonly toolCalls = new ClaudeToolCallRegistry();
59
>
private _currentMessageId: string | undefined;
60
>
61
>
/**
62
>
* Phase 8 — file-edit content pre-staged by
63
>
* `ClaudeAgentSession._observeUserMessage` and consumed by
64
>
* {@link mapUserMessage} when the matching `tool_result` arrives.
65
>
* Keyed by SDK `tool_use_id`. The session's `_processMessages` loop
66
>
* awaits the after-snapshot before invoking the synchronous mapper,
67
>
* so by the time `takeFileEdit` is called the entry is always
68
>
* populated for tracked file-edit tools.
69
>
*/
70
>
private readonly _completedFileEdits = new Map<string, ToolResultFileEditContent>();
71
72
/**