49
50
async getRuntimeInfo(): Promise<ITerminalSandboxRuntimeInfo> {
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> {
63
>
}
64
65
async getSandboxTempDir(): Promise<URI | undefined> {
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> {
85
>
return undefined;
86
>
}
87
88
getWriteRoots(): readonly URI[] {
90
>
}
91
92
async checkSandboxDependencies(): Promise<ISandboxDependencyStatus | undefined> {