historyRecordFixtures.ts ×7

Frontier kind: Code frontier

unlabeled · c_910d873c420f

19 tests · 32849 LOC · 173 files · introduces 0 tests · 34 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
7 ranges34 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
2767 ranges32849 lines · 173 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.

1 file ranked by introduced lines: 34 introduced LOC across 7 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/test/node/historyRecordFixtures.ts 34 introduced LOC · 7 ranges

Open complete file

377 * available. Test-fixture-only.
378 */
379 > export async function mapSessionEventsToHistoryRecords( historyRecordFixtures.ts
380 > session: URI,
381 > db: ISessionDatabase | undefined,
382 > events: readonly ISessionEvent[],
383 > workingDirectory?: URI,
384 > ): Promise<IHistoryRecord[]> {
385 > const result: IHistoryRecord[] = [];
386 > const toolInfoByCallId = new Map<string, { toolName: string; parameters: Record<string, unknown> | undefined; rewrittenArgs?: string }>();
387 > const editToolCallIds: string[] = [];
388 >
389 > // The SDK tags sub-agent events with an envelope-level `agentId` (the
390 > // `data.parentToolCallId` field is deprecated). `subagent.started` maps the
391 > // sub-agent's `agentId` to the parent tool call id; resolve later events
392 > // through it so the produced records carry the right `parentToolCallId`.
393 > const parentToolCallIdByAgentId = new Map<string, string>();
394 > const resolveParentToolCallId = (agentId: string | undefined, deprecatedParentToolCallId: string | undefined): string | undefined => {
395 const mapped = agentId ? parentToolCallIdByAgentId.get(agentId) : undefined;
396 return mapped ?? deprecatedParentToolCallId;
397 };
399 > for (const e of events) {
400 > if (e.type === 'subagent.started') {
401 const sub = e as ISessionEventSubagentStarted;
402 if (sub.agentId) {
404 }
405 }
406 > if (e.type === 'tool.execution_start') { historyRecordFixtures.ts
407 const d = (e as ISessionEventToolStart).data;
408 if (isHiddenTool(d.toolName)) {
421 }
422 }
424 >
425 > let storedEdits: Map<string, IFileEditRecord[]> | undefined;
426 > if (db && editToolCallIds.length > 0) {
427 try {
428 const records = await db.getFileEdits(editToolCallIds);
442 }
443 }
445 > const sessionUriStr = session.toString();
446 >
447 > for (const e of events) {
448 > if (e.type === 'assistant.message' || e.type === 'user.message') {
449 if (isSyntheticUserMessage(e)) {
450 continue;
468 parentToolCallId: resolveParentToolCallId((e as ISessionEventMessage).agentId, d?.parentToolCallId),
469 });
470 > } else if (e.type === 'tool.execution_start') { historyRecordFixtures.ts
471 const d = (e as ISessionEventToolStart).data;
472 if (isHiddenTool(d.toolName)) {