/** * 共享类型定义 */ /** * MCP 工具响应类型 */ export interface ToolResponse { content: Array<{ type: 'text'; text: string; }>; isError?: boolean; } /** * API 请求参数 */ export interface ApiRequestSpec { headers?: Record; cookies?: Record; query?: Record; body?: { type?: string; jsonSchema?: JsonSchema; json?: unknown; example?: unknown; }; path?: Record; } /** * API 响应规格 */ export interface ApiResponseSpec { statusCode?: number; headers?: Record; body?: { type?: string; jsonSchema?: JsonSchema; json?: unknown; example?: unknown; }; example?: unknown; } /** * JSON Schema 定义 */ export interface JsonSchema { type?: string; properties?: Record; items?: JsonSchema; required?: string[]; description?: string; enum?: unknown[]; format?: string; $ref?: string; } /** * 接口详情 */ export interface InterfaceDetail { id: string; name: string; method: string; path: string; description?: string; request?: ApiRequestSpec; response?: ApiResponseSpec; } /** * MCP Server 配置项 */ export interface McpServerItem { command: string; args?: string[]; env?: Record; } /** * MCP 配置文件格式 */ export interface McpConfigFile { mcpServers: Record; } /** * 项目信息 */ export interface ProjectInfo { name: string; id: string; description?: string; mcpConfig?: McpConfigFile; executionSteps?: string[]; } /** * Handler 上下文(已废弃,各 Handler 使用自己的 Context 接口) * @deprecated 使用各 Handler 特定的 Context 接口 */ export interface HandlerContext { projectRoot: string; configManager: { getAccessToken: () => string | null; getApiBaseUrl: () => string | null; }; } /** * 创建文本响应的辅助函数 */ export declare function createTextResponse(text: string, isError?: boolean): { content: { type: "text"; text: string; }[]; isError: boolean; }; /** * 创建错误响应的辅助函数 */ export declare function createErrorResponse(message: string): { content: { type: "text"; text: string; }[]; isError: boolean; }; //# sourceMappingURL=index.d.ts.map