agentHostSandboxEngine.ts ×7

Frontier kind: Code frontier

unlabeled · c_fb8680164742

6 tests · 29390 LOC · 131 files · introduces 0 tests · 47 LOC · 4 files

Introduces — evidence that enters the hierarchy at this concept

Code
13 ranges47 lines · 4 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
2697 ranges29390 lines · 131 files · Browse complete extent
All tests (intent)
6 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.

4 files ranked by introduced lines: 47 introduced LOC across 13 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/copilot/agentHostSandboxEngine.ts 32 introduced LOC · 7 ranges

Open complete file

49
50 async getRuntimeInfo(): Promise<ITerminalSandboxRuntimeInfo> {
51 > const appRoot = dirname(FileAccess.asFileUri('').path); agentHostSandboxEngine.ts
52 > const runAsNode = !!process.versions['electron'];
53 > // In the desktop app the native binaries (ripgrep-universal, mxc-sdk) are
54 > // unpacked from the ASAR archive into `node_modules.asar.unpacked`; in dev
55 > // and on the server (which has no ASAR) they remain in a plain
56 > // `node_modules`.
57 > const nativeModulesDir = getAppNodeModulesDirName();
58 > return { appRoot, execPath: process.execPath, runAsNode, nativeModulesDir };
59 > }
60
61 async getUserHome(): Promise<URI | undefined> {
62 > return this._environmentService.userHome; agentHostSandboxEngine.ts
63 > }
64
65 async getSandboxTempDir(): Promise<URI | undefined> {
66 > const userHome = this._environmentService.userHome; agentHostSandboxEngine.ts
67 > if (!userHome) {
68 return undefined;
69 }
70 > const sandboxRoot = URI.joinPath(userHome, this._productService.dataFolderName, SANDBOX_TEMP_DIR_NAME); agentHostSandboxEngine.ts
71 > // Keep the per-session leaf short and bounded: the sandbox runtime
72 > // creates its network-bridge UNIX sockets (e.g. `claude-socks-<id>.sock`,
73 > // ~35 bytes) directly under this directory, and the full socket path must
74 > // stay within the AF_UNIX 108-byte limit. The raw session id is a URI
75 > // segment (often a UUID), so hash it to a short hex string instead. A
76 > // 64-bit SHA-256 prefix (16 hex chars) keeps the leaf short and
77 > // collisions infeasible.
78 > const digest = createHash('sha256').update(this._sessionId).digest('hex');
79 > const sessionLeaf = `agenthost_${digest.substring(0, 16)}`;
80 > return URI.joinPath(sandboxRoot, sessionLeaf);
81 > }
82
83 async getWorkspaceStorageReadRoot(): Promise<URI | undefined> {
84 > // The agent host has no workspace-storage equivalent today. agentHostSandboxEngine.ts
85 > return undefined;
86 > }
87
88 getWriteRoots(): readonly URI[] {
89 > return this._workingDirectory ? [this._workingDirectory] : []; agentHostSandboxEngine.ts
90 > }
91
92 async checkSandboxDependencies(): Promise<ISandboxDependencyStatus | undefined> {
115 const innerKey = sandboxSettingIdToAgentHostKey[settingId];
116 if (innerKey === undefined) {
117 > return undefined; agentHostSandboxEngine.ts
118 > }
119 const sandbox = this._agentConfigurationService.getRootValue(sandboxConfigSchema, AgentHostSandboxConfigKey.Sandbox);
120 return sandbox?.[innerKey] as T | undefined;
src/vs/platform/agentHost/node/copilot/copilotShellTools.ts 8 introduced LOC · 3 ranges

Open complete file

438 );
439 }
441 > const requestUnsandboxedConfirmation = async (blockedDomains?: readonly string[]): Promise<boolean | ToolResultObject> => {
442 if (!confirmUnsandboxedExecution) {
443 const blocked = blockedDomains?.join(', ') ?? '(unknown)';
458 return approved;
459 };
461 > let wrapped = await engine.wrapCommand(
462 > args.command,
463 > args.requestUnsandboxedExecution,
464 > executable,
465 ref.object.shellType === 'bash' ? shellManager.workingDirectory : undefined,
466 );
468 if (args.requestUnsandboxedExecution && !wrapped.isSandboxWrapped) {
469 const decision = await requestUnsandboxedConfirmation(wrapped.blockedDomains);
src/vs/platform/sandbox/common/terminalSandboxEngine.ts 5 introduced LOC · 2 ranges

Open complete file

421 return;
422 }
424 > await this._fileService.del(this._tempDir, { recursive: true, useTrash: false });
425 > } catch (error) {
426 this._logService.warn('TerminalSandboxEngine: Failed to delete sandbox temp dir', error);
427 }
1025 for (const path of [this._execPath, this._pathDirname(this._execPath)]) {
1026 if (!this._isPathUnderAppRoot(path)) {
1027 > paths.push(path); terminalSandboxEngine.ts
1028 > }
1029 }
1030 }
src/vs/platform/agentHost/node/appNodeModules.ts 2 introduced LOC · 1 range

Open complete file

24 */
25 export function getAppNodeModulesDirName(): 'node_modules' | 'node_modules.asar.unpacked' {
26 > return hasUnpackedNodeModulesArchive() ? 'node_modules.asar.unpacked' : 'node_modules'; appNodeModules.ts
27 > }