fix: 实时上报 Codex 工具事件
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import type { BackendTurnResult, CommandRecord, RunRecord } from "../common/types.js";
|
||||
import type { BackendEvent, BackendTurnResult, CommandRecord, RunRecord } from "../common/types.js";
|
||||
import { CodexStdioBackendSession, runCodexStdioTurn, type CodexStdioTurnOptions } from "./codex-stdio.js";
|
||||
import { backendProfileSpec } from "../common/backend-profiles.js";
|
||||
|
||||
@@ -8,6 +8,7 @@ export interface BackendAdapterOptions {
|
||||
codexHome?: string;
|
||||
workspacePath?: string;
|
||||
abortSignal?: AbortSignal;
|
||||
onEvent?: (event: BackendEvent) => void | Promise<void>;
|
||||
env?: NodeJS.ProcessEnv;
|
||||
}
|
||||
|
||||
@@ -52,5 +53,6 @@ export function backendTurnOptions(run: RunRecord, command: CommandRecord, optio
|
||||
if (options.env) turnOptions.env = options.env;
|
||||
if (options.codexHome) turnOptions.codexHome = options.codexHome;
|
||||
if (options.abortSignal) turnOptions.abortSignal = options.abortSignal;
|
||||
if (options.onEvent) turnOptions.onEvent = options.onEvent;
|
||||
return turnOptions;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user