1
>
/*---------------------------------------------------------------------------------------------
agentCustomizationMeta.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 type { Mutable } from '../../../../base/common/types.js';
7
>
import type { AgentCustomization } from '../state/protocol/state.js';
8
>
9
>
/**
10
>
* Well-known typed view over a custom agent's `_meta` bag (see
11
>
* `AgentCustomization._meta`), populated by the host's customization discovery
12
>
* and read by the agents-window customization providers. Read it through
13
>
* {@link readAgentCustomizationMeta} rather than indexing `_meta` directly.
14
>
*/
15
>
export interface IAgentCustomizationMeta {
16
>
/**
17
>
* Whether the user may invoke this custom agent directly (e.g. from the
18
>
* agent picker). Absent is treated as `true` by convention — only an
19
>
* explicit `false` hides the agent from direct user invocation.
20
>
*/
21
>
readonly userInvocable?: boolean;
22
>
}
23
>
24
>
/**
25
>
* Reads the well-known {@link IAgentCustomizationMeta} keys from a custom
26
>
* agent's `_meta` bag, dropping unknown keys and wrong-typed values.
27
>
*/
28
>
export function readAgentCustomizationMeta(agent: AgentCustomization): IAgentCustomizationMeta {
29
const meta = agent._meta;
30
if (!meta) {