1
>
/*---------------------------------------------------------------------------------------------
sessionConfigKeys.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
>
/**
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
>
* Provider-owned platform properties use these names in an agent's
16
>
* `resolveSessionConfig` response. Worktree properties are owned and
17
>
* contributed by the host and are not passed to agents.
18
>
*/
19
>
export const enum SessionConfigKey {
20
>
/** `'autoApprove'` — tool auto-approval level. */
21
>
AutoApprove = 'autoApprove',
22
>
/** `'permissions'` — per-tool session allow/deny lists. */
23
>
Permissions = 'permissions',
24
>
/** `'isolation'` — host-owned `'folder'` or `'worktree'` selection. */
25
>
Isolation = 'isolation',
26
>
/** `'branch'` — host-owned base branch to work from. */
27
>
Branch = 'branch',
28
>
/** `'mode'` — agent execution mode (interactive / plan / autopilot). */
29
>
Mode = 'mode',
30
>
/** `'worktreeBranchPrefix'` — host-owned prefix for the worktree branch name. */
31
>
WorktreeBranchPrefix = 'worktreeBranchPrefix',
32
>
/** `'worktreeIncludeFiles'` — host-owned glob patterns for files copied into a new worktree. */
33
>
WorktreeIncludeFiles = 'worktreeIncludeFiles',
34
>
}
35
>
36
>
/**
37
>
* The set of enum values the unified permission picker *tolerates* for the
38
>
* {@link SessionConfigKey.AutoApprove} property when deciding whether a
39
>
* session's schema is "well-known" (and therefore handled by the dedicated
40
>
* permission picker rather than the generic per-property fallback).
41
>
*
42
>
* `default` is the required baseline level; `assisted` and `autoApprove` are
43
>
* offered elevated levels. `autopilot` is retained for backward compatibility
44
>
* with sessions created before it moved onto the mode axis.
45
>
*/
46
>
export const KNOWN_AUTO_APPROVE_VALUES: ReadonlySet<string> = new Set(['default', 'assisted', 'autoApprove', 'autopilot']);
47
>
48
>
/**
49
>
* The set of enum values understood for the {@link SessionConfigKey.Mode}
50
>
* property: the agent execution mode axis.
51
>
*/
52
>
export const KNOWN_MODE_VALUES: ReadonlySet<string> = new Set(['interactive', 'plan', 'autopilot']);