Repository navigation
Expand file tree
/
Copy pathsessionConfigKeys.ts
More file actions
62 lines (59 loc) · 3.3 KB
/
Copy pathsessionConfigKeys.ts
File metadata and controls
62 lines (59 loc) · 3.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/**
* Well-known keys used in the agent-host configuration value bag.
*
* The Agent Host Protocol's config schema is intentionally generic — agents
* are free to advertise any property names. These constants capture the
* names that the platform itself consumes (e.g. {@link SessionConfigKey.AutoApprove}
* drives tool auto-approval) or that clients interpret via convention
* (e.g. {@link SessionConfigKey.Branch}, {@link SessionConfigKey.Isolation}).
*
* Provider-owned platform properties use these names in an agent's
* `resolveSessionConfig` response. Worktree properties are owned and
* contributed by the host and are not passed to agents.
*/
export const enum SessionConfigKey {
/** `'autoApprove'` — tool auto-approval level. */
AutoApprove = 'autoApprove',
/** `'permissions'` — per-tool session allow/deny lists. */
Permissions = 'permissions',
/** `'isolation'` — host-owned `'folder'` or `'worktree'` selection. */
Isolation = 'isolation',
/** `'branch'` — host-owned base branch to work from. */
Branch = 'branch',
/** `'mode'` — agent execution mode (interactive / plan / autopilot). */
Mode = 'mode',
/** `'worktreeBranchPrefix'` — host-owned prefix for the worktree branch name. */
WorktreeBranchPrefix = 'worktreeBranchPrefix',
/** `'worktreeIncludeFiles'` — host-owned glob patterns for files copied into a new worktree. */
WorktreeIncludeFiles = 'worktreeIncludeFiles',
/** `'worktreeBranchTrack'` — host-owned branch tracking preference for programmatic session creation. */
WorktreeBranchTrack = 'worktreeBranchTrack',
/** `'worktreeCreateNewBranch'` — host-owned choice to create a branch instead of checking out the selected branch. */
WorktreeCreateNewBranch = 'worktreeCreateNewBranch',
/** `'agentMerge'` — client-owned Agent Merge enablement and session overrides. */
AgentMerge = 'agentMerge',
/** `'agentMerge.controller'` — host-owned Agent Merge lifecycle state. */
AgentMergeController = 'agentMerge.controller',
/** `'shellInitSnippets'` — host-generated scripts sourced before built-in shell tool commands. */
ShellInitSnippets = 'shellInitSnippets',
}
/**
* The set of enum values the unified permission picker *tolerates* for the
* {@link SessionConfigKey.AutoApprove} property when deciding whether a
* session's schema is "well-known" (and therefore handled by the dedicated
* permission picker rather than the generic per-property fallback).
*
* `default` is the required baseline level; `assisted` and `autoApprove` are
* offered elevated levels. `autopilot` is retained for backward compatibility
* with sessions created before it moved onto the mode axis.
*/
export const KNOWN_AUTO_APPROVE_VALUES: ReadonlySet<string> = new Set(['default', 'assisted', 'autoApprove', 'autopilot']);
/**
* The set of enum values understood for the {@link SessionConfigKey.Mode}
* property: the agent execution mode axis.
*/
export const KNOWN_MODE_VALUES: ReadonlySet<string> = new Set(['interactive', 'plan', 'autopilot']);