Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/platform/agentHost/common/sessionConfigKeys.ts
13394 views
1
/*---------------------------------------------------------------------------------------------
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
/**
7
* Well-known keys used in the agent-host configuration value bag.
8
*
9
* The Agent Host Protocol's config schema is intentionally generic — agents
10
* are free to advertise any property names. These constants capture the
11
* names that the platform itself consumes (e.g. {@link SessionConfigKey.AutoApprove}
12
* drives tool auto-approval) or that clients interpret via convention
13
* (e.g. {@link SessionConfigKey.Branch}, {@link SessionConfigKey.Isolation}).
14
*
15
* Agents that opt into the corresponding behavior should use these exact
16
* property names in their `resolveSessionConfig` response.
17
*/
18
export const enum SessionConfigKey {
19
/** `'autoApprove'` — tool auto-approval level. */
20
AutoApprove = 'autoApprove',
21
/** `'permissions'` — per-tool session allow/deny lists. */
22
Permissions = 'permissions',
23
/** `'isolation'` — `'folder'` or `'worktree'`. */
24
Isolation = 'isolation',
25
/** `'branch'` — base branch to work from. */
26
Branch = 'branch',
27
/** `'branchNameHint'` — client-supplied hint used during worktree creation. */
28
BranchNameHint = 'branchNameHint',
29
/** `'mode'` — agent execution mode (interactive / plan). */
30
Mode = 'mode',
31
}
32
33
/**
34
* The set of enum values the unified permission picker understands for the
35
* {@link SessionConfigKey.AutoApprove} property.
36
*
37
* `default` is the required baseline level; `autoApprove` and `autopilot`
38
* are optional (an agent may choose to advertise a subset).
39
*/
40
export const KNOWN_AUTO_APPROVE_VALUES: ReadonlySet<string> = new Set(['default', 'autoApprove', 'autopilot']);
41
42