src/vs/platform/agentHost/common/agentCustomizationSettings.ts

96 LOC · 82 covered · 14 uncovered · 19 ranges · 3662 concepts · 7 introducers · 1707 tests

File neighbourhood

The centred file is linked to every concept that introduces one of its ranges, every test that runs code from the file, and the gray connector concepts standing between those tests and the file's own introducer concepts. Undirected links join concepts to every file where they introduce source and concepts to the tests they introduce; arrows show specialization between the displayed concepts and bridge only concepts omitted from this view. Concept colors match the source ranges below; connector concepts have no source color and are shown in gray.

Focused file, its introducer and connector concepts, their introduced files, and tests that run code from the file

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 related-file, concept, and source links on this page.

Focused file, its introducer and connector concepts, their introduced files, and tests that run code from the filesrc/vs/platform/agentHost/node/agentHostStateManager.ts · 1465 LOCnode/agentHostStateManag… §3.8 — permissionMode propagation) Test 16b — live state seeded BEFORE first sendMessage flows into Options.permissionMode at materialize|occurrence=1 · 0 introduced LOC §3.8 — permissionMode p…claudeCanUseTool.ts ×1 · 2 introduced LOCclaudeCanUseTool.ts ×1agentService.ts ×2 · 4 introduced LOCagentService.ts ×2claudeAgent.ts ×5 · 11 introduced LOCclaudeAgent.ts ×5agentService.ts ×10 · 47 introduced LOCagentService.ts ×10agentService.ts ×1 · 2 introduced LOCagentService.ts ×1agentService.ts ×1 · 3 introduced LOCagentService.ts ×1agentService.ts ×1 · 2 introduced LOCagentService.ts ×1claudeAgent.ts ×2 · 9 introduced LOCclaudeAgent.ts ×2agentHostChangesetCoordinator.ts ×1 · 3 introduced LOCagentHostChangesetCoordi…mcpCustomizationController.test|title=McpCustomizationController non-ready bare server has no channel but still advertises mcpApp (static capability)|occurrence=1 · 0 introduced LOCmcpCustomizationControll…agentConfigurationService.ts ×1 · 2 introduced LOCagentConfigurationServic…agentConfigurationService.ts ×7 · 29 introduced LOCagentConfigurationServic…agentHostTerminalManager.test|title=AgentHostTerminalManager – command detection integration multiple sequential commands get sequential IDs|occurrence=1 · 0 introduced LOCagentHostTerminalManager…agentHostTerminalManager.test|title=AgentHostTerminalManager – command detection integration CWD property dispatches TerminalCwdChanged|occurrence=1 · 0 introduced LOCagentHostTerminalManager…agentHostTerminalManager.test|title=AgentHostTerminalManager – command detection integration nonce validation accepts trusted command lines|occurrence=1, agentHostTerminalManager.test|title=AgentHostTerminalManager – command detection integration nonce validation rejects untrusted command lines|occurrence=1 · 0 introduced LOCagentHostTerminalManager…agentHostTerminalManager.test|title=AgentHostTerminalManager – command detection integration TerminalCommandDetectionAvailable is dispatched on first OSC 633|occurrence=1 · 0 introduced LOCagentHostTerminalManager…agentCustomizationSettings.ts ×2 · 17 introduced LOCagentCustomizationSettin…sessionServerTools.ts ×2 · 19 introduced LOCsessionServerTools.ts ×2agentHostTerminalManager.ts ×41 · 285 introduced LOCagentHostTerminalManager…reducer.ts ×1 · 6 introduced LOCreducer.ts ×1sessionServerTools.ts ×10 · 12 introduced LOCsessionServerTools.ts ×1…agentCustomizationSettings.ts ×1 · 2 introduced LOCagentCustomizationSettin…sessionServerTools.ts ×1 · 2 introduced LOCsessionServerTools.ts ×1sessionServerTools.ts ×9 · 60 introduced LOCsessionServerTools.ts ×9agentConfigurationService.ts ×1 · 2 introduced LOCagentConfigurationServic…agentConfigurationService.ts ×2 · 17 introduced LOCagentConfigurationServic…agentHostStateManager.test|title=Subagent URI helpers isSubagentSession identifies subagent URIs|occurrence=1 · 0 introduced LOCagentHostStateManager.te…agentHostStateManager.test|title=Subagent URI helpers buildSubagentSessionUri creates correct URI|occurrence=1, agentHostStateManager.test|title=Subagent URI helpers buildSubagentSessionUri preserves parent URI path shape|occurrence=1 · 0 introduced LOCagentHostStateManager.te…agentHostStateManager.test|title=Subagent URI helpers parseSubagentSessionUri handles nested subagent URIs|occurrence=1, agentHostStateManager.test|title=Subagent URI helpers parseSubagentSessionUri extracts parent and toolCallId|occurrence=1 · 0 introduced LOCagentHostStateManager.te…sessionState.ts ×1 · 3 introduced LOCsessionState.ts ×1agentCustomizationSettings.ts ×1 · 2 introduced LOCagentCustomizationSettin…agentConfigurationService.ts ×5 · 30 introduced LOCagentConfigurationServic…agentHostStateManager.test|title=Subagent URI helpers parseSubagentSessionUri returns undefined for non-subagent URIs|occurrence=1 · 0 introduced LOCagentHostStateManager.te…agentHostStateManager.test|title=Subagent URI helpers mergeSessionWithDefaultChat resolves the per-chat working directory override over the session default|occurrence=1, agentHostStateManager.test|title=Subagent URI helpers mergeSessionWithDefaultChat falls back to the session working directory when no chat state is hydrated|occurrence=1, +1 · 0 introduced LOCagentHostStateManager.te…sessionServerTools.ts ×1 · 2 introduced LOCsessionServerTools.ts ×1agentServerToolHost.ts ×2 · 12 introduced LOCagentServerToolHost.ts ×…agentCustomizationSettings.ts ×1 · 2 introduced LOCagentCustomizationSettin…agentCustomizationSettings.ts ×6 · 15 introduced LOCagentCustomizationSettin…agentCustomizationSettings.ts ×1 · 4 introduced LOCagentCustomizationSettin…agentHostStateManager.ts ×3 · 11 introduced LOCagentHostStateManager.ts…sessionState.ts ×1 · 2 introduced LOCsessionState.ts ×1sessionState.ts ×1 · 2 introduced LOCsessionState.ts ×1agentHostStateManager.ts ×1 · 2 introduced LOCagentHostStateManager.ts…agentHostStateManager.ts ×4 · 40 introduced LOCagentHostStateManager.ts…agentFeedbackServerTools.ts ×1 · 2 introduced LOCagentFeedbackServerTools…agentServerToolHost.ts ×5 · 117 introduced LOCagentServerToolHost.ts ×…sessionState.ts ×1 · 11 introduced LOCsessionState.ts ×1sessionState.ts ×1 · 2 introduced LOCsessionState.ts ×1sessionState.ts ×1 · 2 introduced LOCsessionState.ts ×1agentHostStateManager.ts ×60 · 753 introduced LOCagentHostStateManager.ts…agentConfigurationService.ts ×16 · 335 introduced LOCagentConfigurationServic…agentCustomizationSettings.ts ×7 · 46 introduced LOCagentCustomizationSettin…agentConfigurationService.test|title=AgentConfigurationService does not persist provider-backed root settings in agent-host config|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentConfigurationService.test|title=AgentConfigurationService does not persist provider-backed root settings in agent-host config|occurrence=1agentConfigurationServic…agentConfigurationService.test|title=AgentConfigurationService ignores malformed provider customization metadata|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentConfigurationService.test|title=AgentConfigurationService ignores malformed provider customization metadata|occurrence=1agentConfigurationServic…agentConfigurationService.test|title=AgentConfigurationService seeds provider configuration into the initial root snapshot|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentConfigurationService.test|title=AgentConfigurationService seeds provider configuration into the initial root snapshot|occurrence=1agentConfigurationServic…agentFeedbackServerTools.test|title=AgentFeedbackServerTools AgentServerToolHost advertise publishes the server tools as server tools|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentFeedbackServerTools.test|title=AgentFeedbackServerTools AgentServerToolHost advertise publishes the server tools as server tools|occurrence=1agentFeedbackServerTools…mutate tools do not|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentFeedbackServerTools.test|title=AgentFeedbackServerTools viewUnreviewedComments requires confirmation; the read/mutate tools do not|occurrence=1mutate tools do not|occu…agentHostStateManager.test|title=AgentHostStateManager root config replacement preserves provider-backed values|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostStateManager.test|title=AgentHostStateManager root config replacement preserves provider-backed values|occurrence=1agentHostStateManager.te…agentHostStateManager.test|title=Subagent URI helpers buildSubagentSessionUri creates correct URI|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostStateManager.test|title=Subagent URI helpers buildSubagentSessionUri creates correct URI|occurrence=1agentHostStateManager.te…agentHostStateManager.test|title=Subagent URI helpers buildSubagentSessionUri preserves parent URI path shape|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostStateManager.test|title=Subagent URI helpers buildSubagentSessionUri preserves parent URI path shape|occurrence=1agentHostStateManager.te…agentHostStateManager.test|title=Subagent URI helpers buildSubagentSessionUriPrefix creates state manager prefix|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostStateManager.test|title=Subagent URI helpers buildSubagentSessionUriPrefix creates state manager prefix|occurrence=1agentHostStateManager.te…agentHostStateManager.test|title=Subagent URI helpers buildSubagentSessionUriPrefix preserves parent URI path shape|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostStateManager.test|title=Subagent URI helpers buildSubagentSessionUriPrefix preserves parent URI path shape|occurrence=1agentHostStateManager.te…agentHostStateManager.test|title=Subagent URI helpers isSubagentSession identifies subagent URIs|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostStateManager.test|title=Subagent URI helpers isSubagentSession identifies subagent URIs|occurrence=1agentHostStateManager.te…agentHostStateManager.test|title=Subagent URI helpers mergeSessionWithDefaultChat falls back to the session working directory when no chat state is hydrated|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostStateManager.test|title=Subagent URI helpers mergeSessionWithDefaultChat falls back to the session working directory when no chat state is hydrated|occurrence=1agentHostStateManager.te…agentHostStateManager.test|title=Subagent URI helpers mergeSessionWithDefaultChat falls back to the session working directory when the chat does not override it|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostStateManager.test|title=Subagent URI helpers mergeSessionWithDefaultChat falls back to the session working directory when the chat does not override it|occurrence=1agentHostStateManager.te…agentHostStateManager.test|title=Subagent URI helpers mergeSessionWithDefaultChat resolves the per-chat working directory override over the session default|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostStateManager.test|title=Subagent URI helpers mergeSessionWithDefaultChat resolves the per-chat working directory override over the session default|occurrence=1agentHostStateManager.te…agentHostStateManager.test|title=Subagent URI helpers parseSubagentSessionUri extracts parent and toolCallId|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostStateManager.test|title=Subagent URI helpers parseSubagentSessionUri extracts parent and toolCallId|occurrence=1agentHostStateManager.te…agentHostStateManager.test|title=Subagent URI helpers parseSubagentSessionUri handles nested subagent URIs|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostStateManager.test|title=Subagent URI helpers parseSubagentSessionUri handles nested subagent URIs|occurrence=1agentHostStateManager.te…agentHostStateManager.test|title=Subagent URI helpers parseSubagentSessionUri returns undefined for non-subagent URIs|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostStateManager.test|title=Subagent URI helpers parseSubagentSessionUri returns undefined for non-subagent URIs|occurrence=1agentHostStateManager.te…agentHostTerminalManager.test|title=AgentHostTerminalManager – command detection integration CWD property dispatches TerminalCwdChanged|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostTerminalManager.test|title=AgentHostTerminalManager – command detection integration CWD property dispatches TerminalCwdChanged|occurrence=1agentHostTerminalManager…agentHostTerminalManager.test|title=AgentHostTerminalManager – command detection integration TerminalCommandDetectionAvailable is dispatched on first OSC 633|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostTerminalManager.test|title=AgentHostTerminalManager – command detection integration TerminalCommandDetectionAvailable is dispatched on first OSC 633|occurrence=1agentHostTerminalManager…agentHostTerminalManager.test|title=AgentHostTerminalManager – command detection integration multiple sequential commands get sequential IDs|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostTerminalManager.test|title=AgentHostTerminalManager – command detection integration multiple sequential commands get sequential IDs|occurrence=1agentHostTerminalManager…agentHostTerminalManager.test|title=AgentHostTerminalManager – command detection integration nonce validation accepts trusted command lines|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostTerminalManager.test|title=AgentHostTerminalManager – command detection integration nonce validation accepts trusted command lines|occurrence=1agentHostTerminalManager…agentHostTerminalManager.test|title=AgentHostTerminalManager – command detection integration nonce validation rejects untrusted command lines|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostTerminalManager.test|title=AgentHostTerminalManager – command detection integration nonce validation rejects untrusted command lines|occurrence=1agentHostTerminalManager…agentService.test|title=AgentService (node dispatcher) aggregation listSessions never returns subagent sessions|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentService.test|title=AgentService (node dispatcher) aggregation listSessions never returns subagent sessions|occurrence=1agentService.test|title=…agentService.test|title=AgentService (node dispatcher) dispatchAction applies and persists root config changes from clients|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentService.test|title=AgentService (node dispatcher) dispatchAction applies and persists root config changes from clients|occurrence=1agentService.test|title=…agentService.test|title=AgentService (node dispatcher) subscriber refcount eviction depth-2 subagent unsubscribe evicts the root session state|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentService.test|title=AgentService (node dispatcher) subscriber refcount eviction depth-2 subagent unsubscribe evicts the root session state|occurrence=1agentService.test|title=…claudeAgent.test|title=ClaudeAgent (Phase 7 §3.4 — _handleCanUseTool) SDK abort signal already aborted on entry returns deny without parking|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/claudeAgent.test|title=ClaudeAgent (Phase 7 §3.4 — _handleCanUseTool) SDK abort signal already aborted on entry returns deny without parking|occurrence=1claudeAgent.test|title=C… §3.8 — permissionMode propagation) Test 16b — live state seeded BEFORE first sendMessage flows into Options.permissionMode at materialize|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/claudeAgent.test|title=ClaudeAgent (Phase 7 §3.6 / §3.8 — permissionMode propagation) Test 16b — live state seeded BEFORE first sendMessage flows into Options.permissionMode at materialize|occurrence=1 §3.8 — permissionMode p…claudeAgent.test|title=ClaudeAgent onClientToolCallComplete is a benign no-op for an unknown toolCallId (Phase 10)|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/claudeAgent.test|title=ClaudeAgent onClientToolCallComplete is a benign no-op for an unknown toolCallId (Phase 10)|occurrence=1claudeAgent.test|title=C…claudeAgent.test|title=ClaudeAgent — Phase 11 customizations createChat({ sideChat }) falls back to injected source context when the source transcript is unavailable|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/claudeAgent.test|title=ClaudeAgent — Phase 11 customizations createChat({ sideChat }) falls back to injected source context when the source transcript is unavailable|occurrence=1claudeAgent.test|title=C…sessionServerTools.test|title=SessionServerTools definitions and confirmation|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/sessionServerTools.test|title=SessionServerTools definitions and confirmation|occurrence=1sessionServerTools.test|…sessionServerTools.test|title=SessionServerTools get_session_context execute reads from the accessor; cold session returns identity + empty transcript|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/sessionServerTools.test|title=SessionServerTools get_session_context execute reads from the accessor; cold session returns identity + empty transcript|occurrence=1sessionServerTools.test|…sessionServerTools.test|title=SessionServerTools get_session_context summary returns per-turn gists (message + reply snippet), no tool calls|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/sessionServerTools.test|title=SessionServerTools get_session_context summary returns per-turn gists (message + reply snippet), no tool calls|occurrence=1sessionServerTools.test|…sessionServerTools.test|title=SessionServerTools get_session_context transcriptLimit drops older turns and flags truncated|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/sessionServerTools.test|title=SessionServerTools get_session_context transcriptLimit drops older turns and flags truncated|occurrence=1sessionServerTools.test|…mcpCustomizationController.test|title=McpCustomizationController non-ready bare server has no channel but still advertises mcpApp (static capability)|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/shared/mcpCustomizationController.test|title=McpCustomizationController non-ready bare server has no channel but still advertises mcpApp (static capability)|occurrence=1mcpCustomizationControll…Focused file · src/vs/platform/agentHost/common/agentCustomizationSettings.ts · 96 LOCcommon/agentCustomizatio…

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the related-file, concept, and source links on this page while the interactive map is unavailable.

1 > /*--------------------------------------------------------------------------------------------- agentCustomizationSettings.ts ×7
2 > * Copyright (c) Microsoft Corporation. All rights reserved.
3 > * Licensed under the MIT License. See License.txt in the project root for license information.
4 > *--------------------------------------------------------------------------------------------*/
5 >
6 > import type { ConfigPropertySchema, RootState } from './state/protocol/state.js';
7 >
8 > export const AGENT_CUSTOMIZATION_SETTINGS_META_KEY = 'vscode.agentCustomizationSettings';
9 >
10 > export interface IAgentCustomizationSettingDescriptor {
11 > readonly key: string;
12 > readonly group: string;
13 > readonly kind?: 'multiline';
14 > readonly saveLabel?: string;
15 > }
16 >
17 > export interface IAgentCustomizationSettingsDescriptor {
18 > readonly provider: string;
19 > readonly title: string;
20 > readonly description: string;
21 > readonly settings: readonly IAgentCustomizationSettingDescriptor[];
22 > readonly configurationFile?: {
23 > readonly resource: string;
24 > readonly title: string;
25 > readonly description: string;
26 > readonly openLabel: string;
27 > readonly documentationUrl?: string;
28 > readonly documentationLabel?: string;
29 > };
30 > }
31 >
32 > export interface IAgentCustomizationSettingsRegistration extends IAgentCustomizationSettingsDescriptor {
33 > readonly properties: Readonly<Record<string, ConfigPropertySchema>>;
34 > }
35 >
36 > function isAgentCustomizationSettingDescriptor(value: unknown): value is IAgentCustomizationSettingDescriptor { agentCustomizationSettings.ts ×6
37 > if (!value || typeof value !== 'object') {
38 return false;
39 }
40 > const setting = value as Partial<IAgentCustomizationSettingDescriptor>; agentCustomizationSettings.ts ×6
41 > return typeof setting.key === 'string'
42 > && typeof setting.group === 'string'
43 > && (setting.kind === undefined || setting.kind === 'multiline')
44 > && (setting.saveLabel === undefined || typeof setting.saveLabel === 'string');
45 > }
47 > function isAgentCustomizationSettingsDescriptor(value: unknown): value is IAgentCustomizationSettingsDescriptor { agentCustomizationSettings.ts ×6
48 > if (!value || typeof value !== 'object') {
49 return false;
50 }
51 > const entry = value as Partial<IAgentCustomizationSettingsDescriptor>; agentCustomizationSettings.ts ×6
52 > if (typeof entry.provider !== 'string' || typeof entry.title !== 'string' || typeof entry.description !== 'string' || !Array.isArray(entry.settings) || !entry.settings.every(isAgentCustomizationSettingDescriptor)) {
54 > }
55 > const file = entry.configurationFile; agentCustomizationSettings.ts ×6
56 > return file === undefined || (!!file
57 && typeof file.resource === 'string'
58 && typeof file.title === 'string'
59 && typeof file.description === 'string'
60 && typeof file.openLabel === 'string'
61 && (file.documentationUrl === undefined || typeof file.documentationUrl === 'string')
62 && (file.documentationLabel === undefined || typeof file.documentationLabel === 'string'));
65 > export function getAgentCustomizationSettingsEntries(state: RootState | undefined): readonly IAgentCustomizationSettingsDescriptor[] {
66 > const meta = state?._meta; agentCustomizationSettings.ts ×1
67 > const value = meta?.[AGENT_CUSTOMIZATION_SETTINGS_META_KEY];
68 > return Array.isArray(value) ? value.filter(isAgentCustomizationSettingsDescriptor) : [];
69 > }
71 > export function withAgentCustomizationSettings(state: RootState | undefined, entries: readonly IAgentCustomizationSettingsDescriptor[]): Record<string, unknown> {
72 > return { ...state?._meta, [AGENT_CUSTOMIZATION_SETTINGS_META_KEY]: entries }; agentCustomizationSettings.ts ×1
73 > }
75 > export function readAgentCustomizationSettings(state: RootState | undefined, provider: string): IAgentCustomizationSettingsDescriptor | undefined {
76 return getAgentCustomizationSettingsEntries(state).find(entry => entry.provider === provider);
77 }
79 > export function getProviderBackedRootConfigKeys(state: RootState | undefined): ReadonlySet<string> {
80 > return new Set(getAgentCustomizationSettingsEntries(state).flatMap(entry => entry.settings.map(setting => setting.key))); agentCustomizationSettings.ts ×1
81 > }
83 > export function preserveProviderBackedRootConfigValues(state: RootState | undefined, replacement: Readonly<Record<string, unknown>>): Record<string, unknown> {
84 > const values = { ...replacement }; agentCustomizationSettings.ts ×2
85 > const current = state?.config?.values;
86 > if (!current) {
87 return values;
88 }
90 > for (const key of getProviderBackedRootConfigKeys(state)) {
91 > if (!Object.hasOwn(values, key) && Object.hasOwn(current, key)) {
92 > values[key] = current[key];
93 > }
94 > }
95 > return values;
96 > }