claudeSessionCustomizationDiscovery.ts ×7

Frontier kind: Code frontier

unlabeled · c_59147388949d

14 tests · 19679 LOC · 70 files · introduces 0 tests · 31 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
7 ranges31 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
2072 ranges19679 lines · 70 files · Browse complete extent
All tests (intent)
14 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: 31 introduced LOC across 7 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/claude/customizations/claudeSessionCustomizationDiscovery.ts 31 introduced LOC · 7 ranges

Open complete file

307 const pluginMcpNames = new Set<string>();
308 if (sdk) {
309 > for (const p of nativePlugins) { claudeSessionCustomizationDiscovery.ts
310 const sdkPlugin = sdk.plugins.find(s => s.source === p.id || URI.file(s.path).fsPath === p.root.fsPath);
311 if (!sdkPlugin) {
332 );
333 const builtinSkills = sdk
334 > ? buildSdkBuiltinSkillsContainer(sdk.commands.filter(c => !pluginSkillNames.has(c.name)), diskSkillNames) claudeSessionCustomizationDiscovery.ts
335 : buildClaudeBuiltinSkillsContainer(diskSkillNames);
336 const withBuiltinSkills = (list: readonly Customization[]): readonly Customization[] =>
352 return withBuiltinSkills(mapDiscoveredCustomizations([...discovered, ...builtinAgents], mcpServers, hooks, nativePlugins, workingDirectory, userHome));
353 }
355 > const agentNames = new Set(sdk.agents.map(a => a.name));
356 > const commandNames = new Set(sdk.commands.map(c => c.name));
357 > const mcpByName = new Map(sdk.mcpServers.map(s => [s.name, s] as const));
358 >
359 > // Keep disk entries the live session actually loaded. A loaded skill
360 > // surfaces in the SDK's `supportedCommands()` set, so disk skills are
361 > // matched against `commandNames`.
362 > const seenAgents = new Set<string>();
363 > const entries: (IParsedAgent | IParsedSkill | IParsedRule)[] = [];
364 > for (const d of discovered) {
365 if (d.customization.type === CustomizationType.Agent) {
366 // Hide the SDK's built-in default agent even when a same-named
384 }
385 }
387 > // SDK-known-but-not-on-disk AGENTS → non-editable fallback (Decision D2):
388 > // still selectable as the session agent even without an editable file.
389 > // (Skills get no such fallback — see the doc comment: a non-openable
390 > // skill entry is only ever a dead link.)
391 > for (const agent of sdk.agents) {
392 if (agent.name === CLAUDE_SDK_DEFAULT_AGENT_NAME || seenAgents.has(agent.name) || pluginAgentNames.has(agent.name)) {
393 continue;
395 entries.push(toParsedAgent({ uri: nonEditableUri('agent', agent.name), name: agent.name, ...(agent.description ? { description: agent.description } : {}) }));
396 }
398 > // MCP: keep disk servers the SDK loaded (enriched with live state); add
399 > // SDK-only servers as non-editable entries (status is still informative).
400 > const seenMcp = new Set<string>();
401 > const servers: McpServerCustomization[] = [];
402 > for (const server of mcpServers) {
403 const sdkServer = mcpByName.get(server.name);
404 if (!sdkServer) {
408 servers.push({ ...server, state: deriveMcpState(sdkServer.status) });
409 }
410 > for (const [name, sdkServer] of mcpByName) { claudeSessionCustomizationDiscovery.ts
411 if (seenMcp.has(name) || pluginMcpNames.has(name)) {
412 continue;
414 servers.push({ ...makeMcpServerCustomization(nonEditableUri('mcp', name), name), state: deriveMcpState(sdkServer.status) });
415 }
417 > // Native plugins were matched to the live SDK set at the top of this
418 > // function (`visiblePlugins`); surface them as top-level containers.
419 > return withBuiltinSkills(mapDiscoveredCustomizations(entries, servers, hooks, visiblePlugins, workingDirectory, userHome));
420 > }
421
422 /**