Share REST and RPC response types

This commit is contained in:
weishu
2026-05-21 10:31:50 +08:00
parent 9698aa9f4c
commit d6f97065c1
13 changed files with 166 additions and 250 deletions
+2 -13
View File
@@ -1,23 +1,12 @@
import type { CodexModelsResponse, CodexModelSummary } from '@hapi/protocol/apiTypes';
import { CodexAppServerClient } from '@/codex/codexAppServerClient';
import { getErrorMessage } from './rpcResponses';
export interface CodexModelSummary {
id: string;
displayName: string;
isDefault: boolean;
defaultReasoningEffort?: string | null;
supportedReasoningEfforts?: string[];
}
export interface ListCodexModelsRequest {
includeHidden?: boolean;
}
export interface ListCodexModelsResponse {
success: boolean;
models?: CodexModelSummary[];
error?: string;
}
export type ListCodexModelsResponse = CodexModelsResponse;
function asNonEmptyString(value: unknown): string | null {
return typeof value === 'string' && value.trim().length > 0 ? value.trim() : null;