claudeMapSessionEvents.ts ×4

Frontier kind: Code frontier

unlabeled · c_e3a9e0259483

19 tests · 24219 LOC · 107 files · introduces 0 tests · 62 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
5 ranges62 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1946 ranges24219 lines · 107 files · Browse complete extent
All tests (intent)
19 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

2 files ranked by introduced lines: 62 introduced LOC across 5 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/claude/claudeMapSessionEvents.ts 52 introduced LOC · 4 ranges

Open complete file

90 */
91 startToolBlock(index: number, toolUseId: string, toolName: string, turnId: string): void {
92 > this._activeToolBlocks.set(index, { toolUseId, toolName }); claudeMapSessionEvents.ts
93 > this.toolCalls.begin(toolUseId, toolName, turnId);
94 > }
95
96 getActiveToolBlock(index: number): { toolUseId: string; toolName: string } | undefined {
557 }];
558 }
559 > if (block.type === 'tool_use') { claudeMapSessionEvents.ts
560 > // Phase 10 — strip the SDK's `mcp__<server>__` prefix for
561 > // our in-process client-tool MCP server. The SDK surfaces
562 > // in-process MCP tools to the model with that prefix, but
563 > // the workbench's registered client-tool list (and the
564 > // MCP handler's closure) use the unprefixed name. Without
565 > // normalizing at the seam, `ChatToolCallReady` /
566 > // `ChatToolCallComplete` would carry the prefixed name
567 > // and the workbench would never recognize them as client
568 > // tools. SDK-owned tools (Read, Write, Bash, etc.) and
569 > // subagent spawn tools pass through unchanged because
570 > // they don't carry the prefix.
571 > const toolName = stripClientToolNamePrefix(block.name);
572 > const isClientTool = hasClientToolNamePrefix(block.name);
573 > state.startToolBlock(event.index, block.id, toolName, turnId);
574 > // Phase 12 — subagent correlation bookkeeping. Either this
575 > // tool_use is at the top level and (if Task/Agent) spawns a
576 > // new subagent, or it is inner and we record its edge to the
577 > // parent. They are mutually exclusive (a Task call inside a
578 > // subagent is itself an inner tool_use; the resolver chain
579 > // handles nested spawns by following the parent chain).
580 > // Gated on `!isClientTool` so a workbench tool named `Task` /
581 > // `Agent` cannot impersonate the SDK's subagent-spawn tools.
582 > const isSubagentSpawn = !isClientTool && SUBAGENT_SPAWNING_TOOL_NAMES.has(toolName);
583 > if (parentToolUseId === null) {
584 > if (isSubagentSpawn) {
585 registry.recordSpawn(block.id);
586 }
587 > } else { claudeMapSessionEvents.ts
588 registry.noteInnerTool(block.id, parentToolUseId);
589 }
590 > // Phase 8.5 — `_meta.toolKind` drives the workbench's terminal / claudeMapSessionEvents.ts
591 > // search / subagent renderers. Single write at the tool-open
592 > // seam; the reducer carries `_meta` forward to all subsequent
593 > // state transitions (D6). Subagent meta from Phase 12 is now
594 > // produced by `buildClaudeToolMeta` because
595 > // `getClaudeToolKind('Task') === 'subagent'`.
596 > const meta = buildClaudeToolMeta(toolName);
597 > const toolClientId = isClientTool ? clientToolOwner?.(toolName) : undefined;
598 > return [{
599 > kind: 'action',
600 > resource: chat,
601 > action: {
602 > type: ActionType.ChatToolCallStart,
603 > turnId,
604 > toolCallId: block.id,
605 > toolName,
606 > displayName: getClaudeToolDisplayName(toolName),
607 > ...(toolClientId ? { contributor: { kind: ToolCallContributorKind.Client, clientId: toolClientId } } : {}),
608 > ...(meta ? { _meta: meta } : {}),
609 > },
610 > }];
611 > }
612 return [];
613 }
src/vs/platform/agentHost/test/node/claudeMapSessionEventsTestUtils.ts 10 introduced LOC · 1 range

Open complete file

175
176 export function makeContentBlockStartToolUse(
177 > index: number, claudeMapSessionEventsTestUtils.ts
178 > id: string,
179 > name: string,
180 > ): BetaRawContentBlockStartEvent {
181 > return {
182 > type: 'content_block_start',
183 > index,
184 > content_block: { type: 'tool_use', id, name, input: {} },
185 > };
186 > }
187
188 export function makeTextDelta(index: number, text: string): BetaRawContentBlockDeltaEvent {