1
>
/*---------------------------------------------------------------------------------------------
codexCustomizations.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 { URI } from '../../../../base/common/uri.js';
7
>
import { CustomizationLoadStatus, CustomizationType, customizationId, type DirectoryCustomization, type HookCustomization, type SkillCustomization } from '../../common/state/sessionState.js';
8
>
import type { HookMetadata } from './protocol/generated/v2/HookMetadata.js';
9
>
import type { HooksListResponse } from './protocol/generated/v2/HooksListResponse.js';
10
>
import type { SkillMetadata } from './protocol/generated/v2/SkillMetadata.js';
11
>
import type { SkillScope } from './protocol/generated/v2/SkillScope.js';
12
>
import type { SkillsListResponse } from './protocol/generated/v2/SkillsListResponse.js';
13
>
14
>
/**
15
>
* Codex reports its *effective* skills and hooks through the cwd-scoped
16
>
* `skills/list` and `hooks/list` app-server methods (see
17
>
* `codex-rs/.../catalog_processor.rs`). Codex natively discovers skills from
18
>
* the VS Code `.agents/skills` convention (`<repo>/.agents/skills` at repo
19
>
* scope and `~/.agents/skills` at user scope) as well as `.codex` and bundled
20
>
* roots. These helpers project those catalogs into the AHP
21
>
* {@link DirectoryCustomization} containers that back the workbench
22
>
* Customizations surface, so what codex actually loaded is visible alongside
23
>
* the MCP servers already surfaced by {@link McpCustomizationController}.
24
>
*
25
>
* The mappers are pure (no codex round-trip): the {@link CodexAgent} fetches
26
>
* the `skills/list` / `hooks/list` responses and feeds them here.
27
>
*/
28
>
29
>
/** Synthetic URI scheme for the per-scope codex skills container. */
30
>
const CODEX_SKILLS_SCHEME = 'codex-skills';
31
>
/** Synthetic URI scheme for the codex hooks container. */
32
>
const CODEX_HOOKS_SCHEME = 'codex-hooks';
33
>
34
>
/** Human-facing container name for each {@link SkillScope}. */
35
function skillScopeContainerName(scope: SkillScope): string {
36
switch (scope) {