110
}
111
: {}),
113
>
USE_BUILTIN_RIPGREP: '0',
114
>
// Attribute the CLI's tool subprocesses (`gh`, …) to VS Code.
115
>
// `settings.env` is what the CLI layers onto the commands it runs, so it
116
>
// needs the marker in addition to the spawn env below. Note the CLI
117
>
// re-stamps `AI_AGENT` as `claude-code_<version>_agent` for its own Bash
118
>
// tool, so commands from that tool are not attributed to VS Code.
119
>
[AiAgentEnvVar]: AiAgentEnvValue,
120
>
PATH: `${dirname(resolvedRgDiskPath)}${delimiter}${process.env.PATH ?? ''}`,
121
>
};
122
>
123
>
return {
124
>
cwd: input.workingDirectory.fsPath,
125
>
executable: process.execPath as 'node',
126
>
env: subprocessEnv,
127
>
abortController: input.abortController,
128
>
allowDangerouslySkipPermissions: true,
129
>
canUseTool: input.canUseTool,
130
>
onElicitation: input.onElicitation,
131
>
disallowedTools: ['WebSearch'],
132
>
includePartialMessages: true,
133
>
forwardSubagentText: true,
134
>
enableFileCheckpointing: true,
135
>
model: toSdkModelId(input.model?.id),
136
>
effort: resolveClaudeEffort(input.model),
137
>
permissionMode: input.permissionMode,
138
>
...(input.isResume
139
? { resume: input.sessionId, ...(input.resumeSessionAt ? { resumeSessionAt: input.resumeSessionAt } : {}) }
140
: { sessionId: input.sessionId }),
142
>
...(input.allowedTools && input.allowedTools.length > 0 ? { allowedTools: [...input.allowedTools] } : {}),
143
>
...(input.plugins && input.plugins.length > 0
144
? { plugins: input.plugins.map(p => ({ type: 'local' as const, path: p.fsPath })) }
145
: {}),
147
>
settingSources: ['user', 'project', 'local'],
148
>
settings: { env: settingsEnv },
149
>
systemPrompt: { type: 'preset', preset: 'claude_code' },
150
>
stderr: logStderr,
151
>
};
152
>
}
153
154
/**