src/vs/platform/agentHost/common/claudeSessionConfigKeys.ts

48 LOC · 48 covered · 0 uncovered · 6 ranges · 381 concepts · 4 introducers · 208 tests

File neighbourhood

The centred file is linked to every concept that introduces one of its ranges, every test that runs code from the file, and the gray connector concepts standing between those tests and the file's own introducer concepts. Undirected links join concepts to every file where they introduce source and concepts to the tests they introduce; arrows show specialization between the displayed concepts and bridge only concepts omitted from this view. Concept colors match the source ranges below; connector concepts have no source color and are shown in gray.

Focused file, its introducer and connector concepts, their introduced files, and tests that run code from the file

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the related-file, concept, and source links on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the related-file, concept, and source links on this page while the interactive map is unavailable.

1 > /*--------------------------------------------------------------------------------------------- claudeSessionMetadataStore.ts ×7
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 session-config keys advertised by the agent-host Claude
8 > * provider in its `resolveSessionConfig` schema.
9 > *
10 > * Claude collapses the platform's two-axis approval model
11 > * (`autoApprove` × `mode`) onto a single `permissionMode` axis matching
12 > * the Claude SDK's native `PermissionMode` (see
13 > * `@anthropic-ai/claude-agent-sdk` typings, `sdk.d.ts:1560`). The five
14 > * values mirror the SDK enum values that VS Code exposes, excluding
15 > * `dontAsk`, so that the value flowing back into `query({ permissionMode })`
16 > * requires no translation layer.
17 > *
18 > * The platform `Permissions` key (allow/deny tool lists) is reused
19 > * unchanged from `platformSessionSchema` because the Claude SDK accepts
20 > * `allowedTools` / `disallowedTools` natively.
21 > */
22 > export const enum ClaudeSessionConfigKey {
23 > /** `'permissionMode'` — Claude SDK approval mode. */
24 > PermissionMode = 'permissionMode',
25 > }
26 >
27 > /**
28 > * Permission-mode values advertised in the Claude session-config schema.
29 > */
30 > export type ClaudePermissionMode = 'default' | 'acceptEdits' | 'bypassPermissions' | 'plan' | 'auto';
31 >
32 > /**
33 > * Single source of truth for narrowing an arbitrary runtime value to the
34 > * closed {@link ClaudePermissionMode} union. Returns `undefined` for
35 > * non-strings or unmatched strings; callers apply their own fallback.
36 > */
37 > export function narrowClaudePermissionMode(raw: unknown): ClaudePermissionMode | undefined {
38 > switch (raw) { claudeSessionConfigKeys.ts ×3
39 > case 'default':
40 > case 'acceptEdits':
41 > case 'bypassPermissions':
42 > case 'plan':
43 > case 'auto':
46 > return undefined; claudeSessionConfigKeys.ts ×1
48 > }