1
>
/*---------------------------------------------------------------------------------------------
codexLaunchConfig.ts
2
>
* Copyright (c) Microsoft Corporation. All rights reserved.
3
>
* Licensed under the MIT License. See License.txt in the project root for license information.
4
>
*--------------------------------------------------------------------------------------------*/
5
>
6
>
import { AiAgentEnvValue, AiAgentEnvVar } from '../../../chat/common/aiAgentEnv.js';
7
>
import type { CodexUsageSource } from '../../common/agentHostCustomizationConfig.js';
8
>
import type { ThreadResumeParams } from './protocol/generated/v2/ThreadResumeParams.js';
9
>
import type { JsonValue } from './protocol/generated/serde_json/JsonValue.js';
10
>
11
>
export interface ICodexLaunchProxy {
12
>
readonly baseUrl: string;
13
>
readonly nonce: string;
14
>
}
15
>
16
>
export interface ICodexLaunchConfig {
17
>
readonly env: NodeJS.ProcessEnv;
18
>
readonly args: readonly string[];
19
>
}
20
>
21
>
export function isCodexThreadProviderCompatible(usageSource: CodexUsageSource, modelProvider: string): boolean {
22
return usageSource === 'copilot' ? modelProvider === 'vscode-proxy' : modelProvider !== 'vscode-proxy';
23
}
25
>
/** Explicitly bind a compatible resumed thread to the current global usage source. */
26
>
export function buildCodexResumeParams(usageSource: CodexUsageSource, threadId: string, mcpServers: Readonly<Record<string, unknown>>): ThreadResumeParams {
27
return {
28
threadId,