export type TControllerCodexDiagnosticCode = | 'executable_missing' | 'unsupported_platform' | 'startup_timeout' | 'version_unsupported' | 'authentication_required' | 'external_writer' | 'connection_closed' | 'connection_failed' | 'cleanup_incomplete'; /** Safe for public status: never includes provider messages, paths or credentials. */ export interface IControllerCodexDiagnostic { code: TControllerCodexDiagnosticCode; stage: 'startup' | 'connection' | 'recovery' | 'cleanup'; message: string; occurredAt: number; } export type TControllerCodexCollaborationMode = 'default' | 'plan'; /** Effective native Codex mode settings confirmed by thread/settings/updated. */ export interface IControllerCodexCollaborationMode { mode: TControllerCodexCollaborationMode; model: string; /** Absent means the model's default reasoning effort. */ effort?: string; } /** A requested native mode mutation that has not yet produced exact settings evidence. */ export type TControllerCodexCollaborationModeAuthority = | { status: 'pending'; requested: IControllerCodexCollaborationMode } | { status: 'unconfirmed'; requested: IControllerCodexCollaborationMode }; export interface IControllerCodexActivitySummary { writer: 'released' | 'agl' | 'external' | 'idle'; /** Exact native turn currently observed by this connected app-server. */ turnId?: string; /** True only when this app-server can interrupt `turnId` without guessing. */ canInterrupt: boolean; /** * Present only after AGL requested a mode mutation whose exact native outcome is pending or * unknown. Absence preserves ordinary native behavior when AGL has never observed mode settings. */ collaborationModeAuthority?: TControllerCodexCollaborationModeAuthority; } export interface IControllerCodexActivity extends IControllerCodexActivitySummary { queuePaused?: boolean; /** * Model that answered most recently. The session detail's own `model` is written from it, and * that is what the conversation subheading states. */ model?: string; /** Reasoning effort of that answer; the session detail's own `effort` is written from it. */ effort?: string; /** Exact collaboration mode observed from native thread settings; hidden while authority is uncertain. */ collaborationMode?: IControllerCodexCollaborationMode; reroute?: { fromModel: string; toModel: string; reason: string }; plan?: { explanation?: string; steps: Array<{ content: string; status: 'pending' | 'in_progress' | 'completed' }> }; diff?: string; /** The native UTF-8 diff exceeded the controller transfer bound. */ diffTruncated?: true; totalTokens?: number; contextWindow?: number; } export interface IReq_ControllerCodexAccountGet extends plugins.typedrequestInterfaces.implementsTR { method: 'controller.codex.account.get'; request: { profileId?: string }; response: { account: IControllerCodexAccount }; } export interface IReq_ControllerCodexRestart extends plugins.typedrequestInterfaces.implementsTR { method: 'controller.codex.restart'; request: { profileId?: string }; response: { success: true }; } export interface IReq_ControllerCodexWriterUpdate extends plugins.typedrequestInterfaces.implementsTR { method: 'controller.codex.writer.update'; request: { projectId: string; sessionId: IControllerRuntimeId; action: 'release' | 'resume' | 'resumeQueue' }; response: { success: true }; } export interface IReq_ControllerCodexModeUpdate extends plugins.typedrequestInterfaces.implementsTR { method: 'controller.codex.mode.update'; request: { projectId: string; sessionId: IControllerRuntimeId & { harnessId: 'codex' }; mode: TControllerCodexCollaborationMode; }; response: { collaborationMode: IControllerCodexCollaborationMode }; } export interface IControllerCodexAccount { type: 'signedOut' | 'apiKey' | 'chatgpt' | 'amazonBedrock'; /** Exact account ID reported for the running app-server authentication. */ accountId?: string; email?: string; plan?: string; requiresOpenaiAuth: boolean; rateLimits: Array<{ name: string; windows: Array<{ usedPercent: number; durationMinutes?: number; resetsAt?: number }> }>; rateLimitsAvailable: boolean; usageAvailable: boolean; lifetimeTokens?: number; peakDailyTokens?: number; readAt: number; } export interface IControllerCodexProfile { id: string; name: string; mode: 'local' | 'remote'; serverUrl?: string; hasCredential: boolean; credentialRevision: number; state: 'active' | 'retired'; status?: import('./interfaces.js').IControllerStatus['harnesses'][number]; } export interface IControllerCodexProjectMapping { projectId: string; profileId: string; remoteDirectory: string; } export interface IControllerCodexContext { profileId: string; remoteDirectory: string; status: import('./interfaces.js').IControllerStatus['harnesses'][number]; } export interface IReq_ControllerCodexProfilesList extends plugins.typedrequestInterfaces.implementsTR { method: 'controller.codex.profiles.list'; request: { projectId?: string }; response: { profiles: IControllerCodexProfile[]; mapping?: IControllerCodexProjectMapping }; } export interface IReq_ControllerCodexProfileCreate extends plugins.typedrequestInterfaces.implementsTR { method: 'controller.codex.profile.create'; request: { name: string; serverUrl: string; token?: string }; response: { profile: IControllerCodexProfile }; } export interface IReq_ControllerCodexProfileUpdate extends plugins.typedrequestInterfaces.implementsTR { method: 'controller.codex.profile.update'; request: { profileId: string; expectedCredentialRevision: number; name?: string; token?: string | null; retire?: true }; response: { profile: IControllerCodexProfile }; } export interface IReq_ControllerCodexProfileTest extends plugins.typedrequestInterfaces.implementsTR { method: 'controller.codex.profile.test'; request: { profileId: string }; response: { profile: IControllerCodexProfile }; } export interface IReq_ControllerCodexMappingUpdate extends plugins.typedrequestInterfaces.implementsTR { method: 'controller.codex.mapping.update'; request: IControllerCodexProjectMapping; response: { mapping: IControllerCodexProjectMapping }; } export interface IReq_ControllerCodexThreadsList extends plugins.typedrequestInterfaces.implementsTR { method: 'controller.codex.threads.list'; request: { projectId: string; cursor?: string }; response: { profileId: string; sessions: import('./interfaces.js').IControllerSession[]; nextCursor?: string }; } export interface IReq_ControllerCodexThreadEnroll extends plugins.typedrequestInterfaces.implementsTR { method: 'controller.codex.thread.enroll'; request: { projectId: string; sessionId: IControllerRuntimeId }; response: { session: import('./interfaces.js').IControllerSession }; } import type * as plugins from './plugins.js'; import type { IControllerRuntimeId } from './interfaces.js';