codexClientCustomizations.ts ×13

Frontier kind: Code frontier

unlabeled · c_ce775c0d6d17

19 tests · 14003 LOC · 54 files · introduces 0 tests · 98 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
13 ranges98 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1096 ranges14003 lines · 54 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.

Introduced files, introduced tests, and structurally relevant concept specializationcodexAgent.ts ×13 · 83 introduced LOCcodexAgent.ts ×13codexSessionConfigKeys.test|title=codexSessionConfigKeys resolveSessionConfig preserves legacy read-only permissions on restore|occurrence=1 · 0 introduced LOCcodexSessionConfigKeys.t…codexSessionConfigKeys.test|title=codexSessionConfigKeys resolveSessionConfig exposes a single permissions-preset chip|occurrence=1 · 0 introduced LOCcodexSessionConfigKeys.t…codexAgent.ts ×1 · 27 introduced LOCcodexAgent.ts ×1codexAgent.ts ×24 · 89 introduced LOCcodexAgent.ts ×24codexSessionConfigKeys.ts ×1 · 7 introduced LOCcodexSessionConfigKeys.t…codexSessionConfigKeys.ts ×1 · 2 introduced LOCcodexSessionConfigKeys.t…codexSessionConfigKeys.ts ×7 · 49 introduced LOCcodexSessionConfigKeys.t…codexSessionConfigKeys.ts ×1 · 11 introduced LOCcodexSessionConfigKeys.t…codexSessionConfigKeys.ts ×1 · 2 introduced LOCcodexSessionConfigKeys.t…codexSessionConfigKeys.ts ×2 · 4 introduced LOCcodexSessionConfigKeys.t…codexSessionConfigKeys.ts ×3 · 18 introduced LOCcodexSessionConfigKeys.t…codexSessionConfigKeys.ts ×3 · 19 introduced LOCcodexSessionConfigKeys.t…codexSessionConfigKeys.ts ×2 · 3 introduced LOCcodexSessionConfigKeys.t…codexSessionConfigKeys.ts ×2 · 2 introduced LOCcodexSessionConfigKeys.t…codexSessionConfigKeys.ts ×6 · 23 introduced LOCcodexSessionConfigKeys.t…codexAgent.ts ×1 · 2 introduced LOCcodexAgent.ts ×1codexAgent.ts ×1 · 2 introduced LOCcodexAgent.ts ×1codexAgent.ts ×3 · 7 introduced LOCcodexAgent.ts ×3codexAgent.ts ×1 · 2 introduced LOCcodexAgent.ts ×1codexAgent.ts ×1 · 2 introduced LOCcodexAgent.ts ×1codexAgent.ts ×1 · 2 introduced LOCcodexAgent.ts ×1codexAgent.ts ×1 · 10 introduced LOCcodexAgent.ts ×1codexAgent.ts ×8 · 19 introduced LOCcodexAgent.ts ×8codexAgent.ts ×158 · 1640 introduced LOCcodexAgent.ts ×158codexClientCustomizations.ts ×1 · 10 introduced LOCcodexClientCustomization…codexClientCustomizations.test|title=codexClientCustomizations codexMcpServersFromPlugins maps stdio + http, stringifies env, and maps headers|occurrence=1 · 0 introduced LOCcodexClientCustomization…codexClientCustomizations.ts ×1 · 10 introduced LOCcodexClientCustomization…codexClientCustomizations.ts ×2 · 4 introduced LOCcodexClientCustomization…codexClientCustomizations.ts ×2 · 20 introduced LOCcodexClientCustomization…codexClientCustomizations.ts ×1 · 2 introduced LOCcodexClientCustomization…codexClientCustomizations.ts ×4 · 8 introduced LOCcodexClientCustomization…codexClientCustomizations.ts ×7 · 26 introduced LOCcodexClientCustomization…pluginParsers.ts ×47 · 410 introduced LOCpluginParsers.ts ×47mcpAppDefaults.ts ×1 · 43 introduced LOCmcpAppDefaults.ts ×1agentPluginParser.ts ×5 · 26 introduced LOCagentPluginParser.ts ×5resources.ts ×23 · 253 introduced LOCresources.ts ×23network.ts ×20 · 292 introduced LOCnetwork.ts ×20extpath.ts ×17 · 91 introduced LOCextpath.ts ×17strings.ts ×101 · 542 introduced LOCstrings.ts ×101sessionState.ts ×57 · 914 introduced LOCsessionState.ts ×57cancellation.ts ×18 · 90 introduced LOCcancellation.ts ×18event.ts ×93 · 864 introduced LOCevent.ts ×93buffer.ts ×42 · 483 introduced LOCbuffer.ts ×42yaml.ts ×54 · 301 introduced LOCyaml.ts ×54codexMcpServers.ts ×17 · 194 introduced LOCcodexMcpServers.ts ×17json.ts ×14 · 399 introduced LOCjson.ts ×14state.ts ×1 · 711 introduced LOCstate.ts ×1commands.ts ×1 · 1661 introduced LOCcommands.ts ×1mcpPlatformTypes.ts ×1 · 81 introduced LOCmcpPlatformTypes.ts ×1state.ts ×1 · 1351 introduced LOCstate.ts ×1state.ts ×1 · 73 introduced LOCstate.ts ×1state.ts ×1 · 1557 introduced LOCstate.ts ×1utils.ts ×3 · 9 introduced LOCutils.ts ×3linkedList.ts ×13 · 44 introduced LOClinkedList.ts ×13objects.ts ×13 · 65 introduced LOCobjects.ts ×13lifecycle.ts ×2 · 4 introduced LOClifecycle.ts ×2lifecycle.ts ×4 · 8 introduced LOClifecycle.ts ×4lifecycle.ts ×6 · 16 introduced LOClifecycle.ts ×6lazy.ts ×1 · 2 introduced LOClazy.ts ×1lazy.ts ×3 · 37 introduced LOClazy.ts ×3lifecycle.ts ×1 · 2 introduced LOClifecycle.ts ×1lifecycle.ts ×1 · 2 introduced LOClifecycle.ts ×1uint.ts ×2 · 43 introduced LOCuint.ts ×2lifecycle.ts ×1 · 3 introduced LOClifecycle.ts ×1map.ts ×97 · 3334 introduced LOCmap.ts ×97src/vs/base/common/arrays.ts · 949 LOCcommon/arrays.tssrc/vs/base/common/arraysFind.ts · 226 LOCcommon/arraysFind.tssrc/vs/base/common/assert.ts · 91 LOCcommon/assert.tssrc/vs/base/common/buffer.ts · 499 LOCcommon/buffer.tssrc/vs/base/common/cache.ts · 153 LOCcommon/cache.tssrc/vs/base/common/cancellation.ts · 206 LOCcommon/cancellation.tssrc/vs/base/common/charCode.ts · 450 LOCcommon/charCode.tssrc/vs/base/common/collections.ts · 176 LOCcommon/collections.tssrc/vs/base/common/errors.ts · 357 LOCcommon/errors.tssrc/vs/base/common/event.ts · 1964 LOCcommon/event.tssrc/vs/base/common/extpath.ts · 433 LOCcommon/extpath.tssrc/vs/base/common/functional.ts · 32 LOCcommon/functional.tssrc/vs/base/common/iterator.ts · 194 LOCcommon/iterator.tssrc/vs/base/common/json.ts · 1326 LOCcommon/json.tssrc/vs/base/common/lazy.ts · 57 LOCcommon/lazy.tssrc/vs/base/common/lifecycle.ts · 974 LOCcommon/lifecycle.tssrc/vs/base/common/linkedList.ts · 151 LOCcommon/linkedList.tssrc/vs/base/common/map.ts · 1016 LOCcommon/map.tssrc/vs/base/common/marshallingIds.ts · 33 LOCcommon/marshallingIds.tssrc/vs/base/common/network.ts · 440 LOCcommon/network.tssrc/vs/base/common/objects.ts · 286 LOCcommon/objects.tssrc/vs/base/common/path.ts · 1589 LOCcommon/path.tssrc/vs/base/common/platform.ts · 281 LOCcommon/platform.tssrc/vs/base/common/process.ts · 76 LOCcommon/process.tssrc/vs/base/common/resources.ts · 444 LOCcommon/resources.tssrc/vs/base/common/stopwatch.ts · 41 LOCcommon/stopwatch.tssrc/vs/base/common/stream.ts · 790 LOCcommon/stream.tssrc/vs/base/common/strings.ts · 1413 LOCcommon/strings.tssrc/vs/base/common/types.ts · 410 LOCcommon/types.tssrc/vs/base/common/uint.ts · 59 LOCcommon/uint.tssrc/vs/base/common/uri.ts · 754 LOCcommon/uri.tssrc/vs/base/common/yaml.ts · 1701 LOCcommon/yaml.tssrc/vs/base/test/common/utils.ts · 107 LOCcommon/utils.tssrc/vs/nls.ts · 244 LOCvs/nls.tssrc/vs/platform/agentHost/common/codexSessionConfigKeys.ts · 114 LOCcommon/codexSessionConfi…src/vs/platform/agentHost/common/meta/agentToolCallMeta.ts · 157 LOCmeta/agentToolCallMeta.t…src/vs/platform/agentHost/common/state/protocol/channels-changeset/commands.ts · 105 LOCchannels-changeset/comma…src/vs/platform/agentHost/common/state/protocol/channels-changeset/state.ts · 277 LOCchannels-changeset/state…src/vs/platform/agentHost/common/state/protocol/channels-chat/commands.ts · 147 LOCchannels-chat/commands.t…src/vs/platform/agentHost/common/state/protocol/channels-chat/state.ts · 1557 LOCchannels-chat/state.tssrc/vs/platform/agentHost/common/state/protocol/channels-resource-watch/state.ts · 73 LOCchannels-resource-watch/…src/vs/platform/agentHost/common/state/protocol/channels-root/state.ts · 244 LOCchannels-root/state.tssrc/vs/platform/agentHost/common/state/protocol/channels-session/commands.ts · 323 LOCchannels-session/command…src/vs/platform/agentHost/common/state/protocol/channels-session/state.ts · 1351 LOCchannels-session/state.t…src/vs/platform/agentHost/common/state/protocol/channels-terminal/state.ts · 173 LOCchannels-terminal/state.…src/vs/platform/agentHost/common/state/protocol/commands.ts · 15 LOCprotocol/commands.tssrc/vs/platform/agentHost/common/state/protocol/common/commands.ts · 1071 LOCcommon/commands.tssrc/vs/platform/agentHost/common/state/protocol/mcpAppDefaults.ts · 43 LOCprotocol/mcpAppDefaults.…src/vs/platform/agentHost/common/state/protocol/state.ts · 17 LOCprotocol/state.tssrc/vs/platform/agentHost/common/state/sessionState.ts · 1405 LOCstate/sessionState.tssrc/vs/platform/agentHost/node/codex/codexAgent.ts · 4389 LOCcodex/codexAgent.tssrc/vs/platform/agentHost/node/codex/codexClientCustomizations.ts · 179 LOCcodex/codexClientCustomi…src/vs/platform/agentHost/node/codex/codexMcpServers.ts · 358 LOCcodex/codexMcpServers.tssrc/vs/platform/agentHost/node/codex/codexSessionConfigKeys.ts · 197 LOCcodex/codexSessionConfig…src/vs/platform/agentHost/node/codex/codexSessionMetadataStore.ts · 112 LOCcodex/codexSessionMetada…src/vs/platform/agentPlugins/common/agentPluginParser.ts · 68 LOCcommon/agentPluginParser…src/vs/platform/agentPlugins/common/pluginParsers.ts · 1307 LOCcommon/pluginParsers.tssrc/vs/platform/mcp/common/mcpPlatformTypes.ts · 81 LOCcommon/mcpPlatformTypes.…codexClientCustomizations.test|title=codexClientCustomizations codexMcpServersFromPlugins de-duplicates server names (first wins) and omits empties|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/codex/codexClientCustomizations.test|title=codexClientCustomizations codexMcpServersFromPlugins de-duplicates server names (first wins) and omits empties|occurrence=1codexClientCustomization…codexClientCustomizations.test|title=codexClientCustomizations codexMcpServersFromPlugins maps stdio + http, stringifies env, and maps headers|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/codex/codexClientCustomizations.test|title=codexClientCustomizations codexMcpServersFromPlugins maps stdio + http, stringifies env, and maps headers|occurrence=1codexClientCustomization…codexClientCustomizations.test|title=codexClientCustomizations codexSkillRootsFromPlugins returns the skills root (dirname twice), deduped and sorted|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/codex/codexClientCustomizations.test|title=codexClientCustomizations codexSkillRootsFromPlugins returns the skills root (dirname twice), deduped and sorted|occurrence=1codexClientCustomization…codexClientCustomizations.test|title=codexClientCustomizations enabledPlugins excludes disabled and unparsed plugins; merge dedupes by id (first client wins)|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/codex/codexClientCustomizations.test|title=codexClientCustomizations enabledPlugins excludes disabled and unparsed plugins; merge dedupes by id (first client wins)|occurrence=1codexClientCustomization…codexClientCustomizations.test|title=codexClientCustomizations removeClient drops a client and setEnabled reports whether it changed|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/codex/codexClientCustomizations.test|title=codexClientCustomizations removeClient drops a client and setEnabled reports whether it changed|occurrence=1codexClientCustomization…codexClientCustomizations.test|title=codexClientCustomizations toCustomizations folds parsed children and applies the enablement overlay|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/codex/codexClientCustomizations.test|title=codexClientCustomizations toCustomizations folds parsed children and applies the enablement overlay|occurrence=1codexClientCustomization…codexModelRefresh.test|title=CodexAgent model refresh keeps the last known-good models when a periodic refresh fails|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/codex/codexModelRefresh.test|title=CodexAgent model refresh keeps the last known-good models when a periodic refresh fails|occurrence=1codexModelRefresh.test|t…codexPackagePaths.test|title=codex package paths codexBinaryTriple every suffix produced by codexPackageSuffix maps to a rust target triple|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/codex/codexPackagePaths.test|title=codex package paths codexBinaryTriple every suffix produced by codexPackageSuffix maps to a rust target triple|occurrence=1codexPackagePaths.test|t…codexPackagePaths.test|title=codex package paths codexBinaryTriple returns undefined for unknown suffixes|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/codex/codexPackagePaths.test|title=codex package paths codexBinaryTriple returns undefined for unknown suffixes|occurrence=1codexPackagePaths.test|t…codexPackagePaths.test|title=codex package paths codexPackageSuffix every supported (platform, arch) returns the npm optionalDependencies suffix|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/codex/codexPackagePaths.test|title=codex package paths codexPackageSuffix every supported (platform, arch) returns the npm optionalDependencies suffix|occurrence=1codexPackagePaths.test|t…codexPackagePaths.test|title=codex package paths codexPackageSuffix never returns a -musl suffix on Linux (Codex is statically musl-linked)|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/codex/codexPackagePaths.test|title=codex package paths codexPackageSuffix never returns a -musl suffix on Linux (Codex is statically musl-linked)|occurrence=1codexPackagePaths.test|t…codexPackagePaths.test|title=codex package paths codexPackageSuffix returns undefined for unsupported platforms and architectures|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/codex/codexPackagePaths.test|title=codex package paths codexPackageSuffix returns undefined for unsupported platforms and architectures|occurrence=1codexPackagePaths.test|t…codex resolves|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/codex/codexPackagePaths.test|title=codex package paths resolveCodexDevSdkRoot returns the directory containing node_modules when @openai/codex resolves|occurrence=1codex resolves|occurrenc…codexPackagePaths.test|title=codex package paths resolveCodexDevSdkRoot returns undefined when resolution throws (e.g. built product without the devDependency)|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/codex/codexPackagePaths.test|title=codex package paths resolveCodexDevSdkRoot returns undefined when resolution throws (e.g. built product without the devDependency)|occurrence=1codexPackagePaths.test|t…codexSessionConfigKeys.test|title=codexSessionConfigKeys expands permissions presets and falls back to legacy axes|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/codex/codexSessionConfigKeys.test|title=codexSessionConfigKeys expands permissions presets and falls back to legacy axes|occurrence=1codexSessionConfigKeys.t…codexSessionConfigKeys.test|title=codexSessionConfigKeys inverts presets and migrates legacy axes without escalating|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/codex/codexSessionConfigKeys.test|title=codexSessionConfigKeys inverts presets and migrates legacy axes without escalating|occurrence=1codexSessionConfigKeys.t…codexSessionConfigKeys.test|title=codexSessionConfigKeys narrows valid values and rejects invalid values|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/codex/codexSessionConfigKeys.test|title=codexSessionConfigKeys narrows valid values and rejects invalid values|occurrence=1codexSessionConfigKeys.t…codexSessionConfigKeys.test|title=codexSessionConfigKeys resolveSessionConfig exposes a single permissions-preset chip|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/codex/codexSessionConfigKeys.test|title=codexSessionConfigKeys resolveSessionConfig exposes a single permissions-preset chip|occurrence=1codexSessionConfigKeys.t…codexSessionConfigKeys.test|title=codexSessionConfigKeys resolveSessionConfig preserves legacy read-only permissions on restore|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/codex/codexSessionConfigKeys.test|title=codexSessionConfigKeys resolveSessionConfig preserves legacy read-only permissions on restore|occurrence=1codexSessionConfigKeys.t…Focused concept · codexClientCustomizations.ts ×13 · 98 introduced LOCcodexClientCustomization…

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: 98 introduced LOC across 13 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/codex/codexClientCustomizations.ts 98 introduced LOC · 13 ranges

Open complete file

1 > /*--------------------------------------------------------------------------------------------- codexClientCustomizations.ts
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 { dirname } from '../../../../base/common/path.js';
7 > import type { IMcpServerDefinition, IParsedPlugin } from '../../../agentPlugins/common/pluginParsers.js';
8 > import type { ISyncedCustomization } from '../../common/agentPluginManager.js';
9 > import { type ChildCustomization, type PluginCustomization } from '../../common/state/sessionState.js';
10 > import { toCodexMcpServerJson, type ICodexMcpServerConfigJson } from './codexMcpServers.js';
11 >
12 > /**
13 > * Codex ingests **client-pushed** plugin customizations (the "Open Plugins"
14 > * the workbench syncs via {@link IActiveClient.customizations}) differently
15 > * from the `.agents`/`.codex` files it discovers itself. This module holds the
16 > * per-session store for those synced+parsed plugins plus the pure mappers that
17 > * project them into (a) the AHP {@link PluginCustomization} surface, (b) codex
18 > * per-thread `thread/start.config.mcp_servers`, and (c) process-global
19 > * `skills/extraRoots/set` roots.
20 > *
21 > * Feeding strategy (see the phase investigation):
22 > * - MCP servers are attached **per session** via `thread/start.config`
23 > * (verified: codex starts the server for that thread only), so a plugin's
24 > * server only runs for sessions that enable it.
25 > * - Skills are process-global in codex (`skills/extraRoots/set` replaces a
26 > * single shared root list), so the store exposes the union of enabled skill
27 > * roots and the agent sets it across all live sessions. This matches the
28 > * semantics of client customizations, which are global user choices.
29 > */
30 >
31 > /** A single client-pushed plugin: its sync result plus the parsed components (when the sync succeeded). */
32 > export interface ICodexClientPlugin {
33 > readonly synced: ISyncedCustomization;
34 > readonly parsed: IParsedPlugin | undefined;
35 > }
36 >
37 > /**
38 > * Per-session store of client-pushed plugin customizations, keyed by the
39 > * contributing client id, with a per-customization enablement overlay
40 > * (absent = enabled, `false` = disabled). Merges every client's contribution
41 > * deduplicated by customization id (first client wins). Pure state holder —
42 > * the agent reads the projections below and drives codex.
43 > */
44 > export class CodexClientCustomizationStore {
45
46 private readonly _byClient = new Map<string, readonly ICodexClientPlugin[]>();
47 private readonly _enablement = new Map<string, boolean>();
49 > /** Replace one client's synced+parsed plugin set. */
50 > setClient(clientId: string, plugins: readonly ICodexClientPlugin[]): void {
51 this._byClient.set(clientId, plugins);
52 }
54 > /** Drop a client's contribution. Returns whether anything was removed. */
55 > removeClient(clientId: string): boolean {
56 return this._byClient.delete(clientId);
57 }
59 > /**
60 > * Toggle a client-pushed customization on/off. Returns whether the
61 > * enablement actually changed (so callers can skip a no-op refresh).
62 > */
63 > setEnabled(id: string, enabled: boolean): boolean {
64 const current = this._enablement.get(id);
65 const effective = current !== false; // absent counts as enabled
74 return true;
75 }
77 > /** Whether a client-pushed customization with this id exists in the store. */
78 > has(id: string): boolean {
79 return this._merged().some(p => p.synced.customization.id === id);
80 }
82 > /** Whether the store holds any client-pushed customizations. */
83 > isEmpty(): boolean {
84 return this._merged().length === 0;
85 }
87 > /** Merge of every client's plugins, deduplicated by customization id (first client wins). */
88 > private _merged(): readonly ICodexClientPlugin[] {
89 const seen = new Set<string>();
90 const out: ICodexClientPlugin[] = [];
101 return out;
102 }
104 > private _isEnabled(id: string): boolean {
105 return this._enablement.get(id) !== false;
106 }
108 > /** The merged plugins that are currently enabled and successfully parsed. */
109 > enabledPlugins(): readonly ICodexClientPlugin[] {
110 return this._merged().filter(p => p.parsed !== undefined && this._isEnabled(p.synced.customization.id));
111 }
113 > /**
114 > * Projects the store onto the AHP {@link PluginCustomization} surface, with
115 > * the enablement overlay applied and each plugin's parsed children folded
116 > * in (skills, MCP servers, agents, instructions, hooks).
117 > */
118 > toCustomizations(): PluginCustomization[] {
119 return this._merged().map(plugin => {
120 const base = plugin.synced.customization;
127 });
128 }
130 >
131 > /** Collects every child customization a parsed plugin exposes, deduped by id. */
132 function parsedPluginChildren(parsed: IParsedPlugin): ChildCustomization[] {
133 const byId = new Map<string, ChildCustomization>();
140 return [...byId.values()];
141 }
143 > /**
144 > * Builds the `mcp_servers` object for `thread/start.config` from a set of
145 > * client plugins. Later servers do not overwrite earlier ones (first
146 > * definition of a given name wins), matching the dedupe used elsewhere.
147 > * Returns an empty object when the plugins declare no MCP servers.
148 > */
149 > export function codexMcpServersFromPlugins(plugins: readonly ICodexClientPlugin[]): Record<string, ICodexMcpServerConfigJson> {
150 const out: Record<string, ICodexMcpServerConfigJson> = {};
151 for (const plugin of plugins) {
158 return out;
159 }
161 > const emptyMcpDefs: readonly IMcpServerDefinition[] = [];
162 >
163 > /**
164 > * Derives the codex skill roots (absolute fsPaths) for a set of client
165 > * plugins: the parent directory of each skill's `<name>/SKILL.md`, i.e. the
166 > * plugin's `skills` root, which codex scans for `<name>/SKILL.md` entries.
167 > * De-duplicated and sorted for a stable `skills/extraRoots/set` payload.
168 > */
169 > export function codexSkillRootsFromPlugins(plugins: readonly ICodexClientPlugin[]): string[] {
170 const roots = new Set<string>();
171 for (const plugin of plugins) {