import type { ClientInfo, InitializeCapabilities, InitializeParams, InitializeResponse, ServerNotification } from "../../.generated/app-server-types/index.js"; import type { ReviewStartParams, ReviewStartResponse, ReviewTarget, Thread, ThreadItem, ThreadListParams, ThreadListResponse, ThreadResumeParams as RawThreadResumeParams, ThreadResumeResponse, ThreadSetNameParams, ThreadSetNameResponse, ThreadStartParams as RawThreadStartParams, ThreadStartResponse, Turn, TurnInterruptParams, TurnInterruptResponse, TurnStartParams, TurnStartResponse, UserInput } from "../../.generated/app-server-types/v2/index.js"; export type { ClientInfo, InitializeCapabilities, InitializeParams, InitializeResponse, ReviewTarget, Thread, ThreadItem, ThreadListParams, Turn, TurnInterruptParams, TurnStartParams, UserInput }; export type ThreadStartParams = Omit; export type ThreadResumeParams = Omit; export interface CodexAppServerClientOptions { env?: NodeJS.ProcessEnv; clientInfo?: ClientInfo; capabilities?: InitializeCapabilities; brokerEndpoint?: string; disableBroker?: boolean; } export interface AppServerMethodMap { initialize: { params: InitializeParams; result: InitializeResponse }; "thread/start": { params: ThreadStartParams; result: ThreadStartResponse }; "thread/resume": { params: ThreadResumeParams; result: ThreadResumeResponse }; "thread/name/set": { params: ThreadSetNameParams; result: ThreadSetNameResponse }; "thread/list": { params: ThreadListParams; result: ThreadListResponse }; "review/start": { params: ReviewStartParams; result: ReviewStartResponse }; "turn/start": { params: TurnStartParams; result: TurnStartResponse }; "turn/interrupt": { params: TurnInterruptParams; result: TurnInterruptResponse }; } export type AppServerMethod = keyof AppServerMethodMap; export type AppServerRequestParams = AppServerMethodMap[M]["params"]; export type AppServerResponse = AppServerMethodMap[M]["result"]; export type AppServerNotification = ServerNotification; export type AppServerNotificationHandler = (message: AppServerNotification) => void;