feat: 支持运行中 steer command
This commit is contained in:
@@ -2,6 +2,13 @@ import type { BackendEvent, BackendTurnResult, CommandRecord, RunRecord } from "
|
||||
import { CodexStdioBackendSession, runCodexStdioTurn, type CodexStdioTurnOptions } from "./codex-stdio.js";
|
||||
import { backendProfileSpec } from "../common/backend-profiles.js";
|
||||
|
||||
export interface BackendActiveTurnControl {
|
||||
threadId: string;
|
||||
turnId: string;
|
||||
steer(prompt: string): Promise<void>;
|
||||
interrupt(): Promise<void>;
|
||||
}
|
||||
|
||||
export interface BackendAdapterOptions {
|
||||
codexCommand?: string;
|
||||
codexArgs?: string[];
|
||||
@@ -9,6 +16,7 @@ export interface BackendAdapterOptions {
|
||||
workspacePath?: string;
|
||||
abortSignal?: AbortSignal;
|
||||
onEvent?: (event: BackendEvent) => void | Promise<void>;
|
||||
onActiveTurn?: (control: BackendActiveTurnControl) => void | (() => void);
|
||||
env?: NodeJS.ProcessEnv;
|
||||
}
|
||||
|
||||
@@ -54,5 +62,6 @@ export function backendTurnOptions(run: RunRecord, command: CommandRecord, optio
|
||||
if (options.codexHome) turnOptions.codexHome = options.codexHome;
|
||||
if (options.abortSignal) turnOptions.abortSignal = options.abortSignal;
|
||||
if (options.onEvent) turnOptions.onEvent = options.onEvent;
|
||||
if (options.onActiveTurn) turnOptions.onActiveTurn = options.onActiveTurn;
|
||||
return turnOptions;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user