322
const COPILOT_SDK_TOOL_OUTPUT_BASENAME_RE = /^(?:\d{10,}-copilot-tool-output-[a-z0-9]{6}|copilot-tool-output-\d{10,}-[a-z0-9]{6})\.txt$/i;
323
324
>
function isCopilotSdkToolOutputTempFile(filePath: string, tmpDir: string): boolean {
copilotAgentSession.ts
325
>
const fileUri = normalizePath(URI.file(filePath));
326
>
const tmpDirUri = normalizePath(URI.file(tmpDir));
327
>
const parentUri = normalizePath(URI.joinPath(fileUri, '..'));
328
>
if (!extUriBiasedIgnorePathCase.isEqual(parentUri, tmpDirUri)) {
329
return false;
330
}
331
const lastSlash = Math.max(filePath.lastIndexOf('/'), filePath.lastIndexOf('\\'));
333
>
return COPILOT_SDK_TOOL_OUTPUT_BASENAME_RE.test(basename);
334
>
}
335
336
/**