copilotToolDisplay.ts ×10

Frontier kind: Code frontier

unlabeled · c_22c3f0e58dc3

31 tests · 18281 LOC · 67 files · introduces 0 tests · 29 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
10 ranges29 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1247 ranges18281 lines · 67 files · Browse complete extent
All tests (intent)
31 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

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 native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

1 file ranked by introduced lines: 29 introduced LOC across 10 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/copilot/copilotToolDisplay.ts 29 introduced LOC · 10 ranges

Open complete file

1083
1084 /** Safely extract a string value from an SDK field that may be `unknown` at runtime. */
1085 > function str(value: unknown): string | undefined { copilotToolDisplay.ts
1086 > return typeof value === 'string' ? value : undefined;
1087 > }
1088
1089 /**
1091 */
1092 export function getPermissionDisplay(request: ITypedPermissionRequest, workingDirectory?: URI, isNewFile?: boolean): {
1093 > confirmationTitle: string; copilotToolDisplay.ts
1094 > invocationMessage: StringOrMarkdown;
1095 > toolInput?: string;
1096 > /** Normalized permission kind for auto-approval routing. */
1097 > permissionKind: IAgentToolPendingConfirmationSignal['permissionKind'];
1098 > /** File path extracted from the request. */
1099 > permissionPath?: string;
1100 > } {
1101 > const path = str(request.path) ?? str(request.fileName);
1102 > const fullCommandText = str(request.fullCommandText);
1103 > const intention = str(request.intention);
1104 > const serverName = str(request.serverName);
1105 > const toolName = str(request.toolName);
1106 >
1107 > const shellConfirmationTitle = request.requestSandboxBypass
1108 ? localize('copilot.permission.shell.bypass.title', "Run in terminal outside the sandbox?")
1109 : localize('copilot.permission.shell.title', "Run in terminal?");
1111 > switch (request.kind) {
1112 > case 'shell': {
1113 // Strip a redundant `cd <workingDirectory> && …` prefix so the
1114 // confirmation dialog shows the simplified command.
1124 };
1125 }
1126 > case 'custom-tool': { copilotToolDisplay.ts
1127 // Custom tool overrides (e.g. our shell tool). Extract the actual
1128 // tool args from the SDK's wrapper envelope.
1148 };
1149 }
1150 > case 'write': { copilotToolDisplay.ts
1151 const toolName = isNewFile ? CopilotToolName.Create : CopilotToolName.Edit;
1152 return {
1160 };
1161 }
1162 > case 'mcp': { copilotToolDisplay.ts
1163 const title = toolName ?? localize('copilot.permission.mcp.defaultTool', "MCP Tool");
1164 return {
1172 };
1173 }
1174 > case 'read': copilotToolDisplay.ts
1175 return {
1176 confirmationTitle: localize('copilot.permission.read.title', "Allow reading file outside of workspace?"),
1179 permissionPath: path,
1180 };
1181 > case 'url': { copilotToolDisplay.ts
1182 const url = str(request.url);
1183 // Parse through URL for punycode escaping, but preserve the raw value if parsing fails.
1190 };
1191 }
1192 > default: copilotToolDisplay.ts
1193 return {
1194 confirmationTitle: localize('copilot.permission.default.title', "Allow tool call?"),