mirror of
https://github.com/tinyhumansai/openhuman.git
synced 2026-07-30 15:03:57 +00:00
* feat: add .mcp.json for MCP server configuration - Introduced `.mcp.json` with server details for managing MCP integrations - Defines `readme` server with HTTP type and URL endpoint configuration * fix: Update skills submodule with Telegram error handling improvements - Fixed setup flow showing false success when TDLib errors occurred - Improved async error handling in setup steps - Added client reset mechanisms for error recovery - Enhanced error messaging for better user experience - Cleaned up excessive debug logging while maintaining error logs Resolves issue where Telegram setup showed success modal despite underlying TDLib errors. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: align frontend API endpoints with backend specification - Fix thread API endpoints by removing incorrect /telegram prefix - Fix user settings endpoint path - Add missing API services: settings, actionable items, credits, feedback, API keys - Ensure all endpoints match backend OpenAPI specification 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * Refactor MCP server configuration structure Updated the MCP configuration to use "alphaHuman" as the key instead of "readme" for clarity and consistency. This change ensures better alignment with naming conventions and improves readability. --------- Co-authored-by: Claude <noreply@anthropic.com>
74 lines
2.5 KiB
TypeScript
74 lines
2.5 KiB
TypeScript
import type { ApiResponse } from '../../types/api';
|
|
import type {
|
|
PurgeRequestBody,
|
|
PurgeResultData,
|
|
SendMessageResponseData,
|
|
SuggestQuestionsData,
|
|
ThreadCreateData,
|
|
ThreadDeleteData,
|
|
ThreadMessagesData,
|
|
ThreadsListData,
|
|
} from '../../types/thread';
|
|
import { apiClient } from '../apiClient';
|
|
|
|
export const threadApi = {
|
|
/** GET /threads — list all threads for the authenticated user */
|
|
getThreads: async (): Promise<ThreadsListData> => {
|
|
const response = await apiClient.get<ApiResponse<ThreadsListData>>('/threads');
|
|
return response.data;
|
|
},
|
|
|
|
/** POST /threads — create a new thread */
|
|
createThread: async (chatId?: number): Promise<ThreadCreateData> => {
|
|
const response = await apiClient.post<ApiResponse<ThreadCreateData>>(
|
|
'/threads',
|
|
chatId != null ? { chatId } : undefined
|
|
);
|
|
return response.data;
|
|
},
|
|
|
|
/** GET /threads/:threadId/messages — get messages for a thread */
|
|
getThreadMessages: async (threadId: string): Promise<ThreadMessagesData> => {
|
|
const response = await apiClient.get<ApiResponse<ThreadMessagesData>>(
|
|
`/threads/${encodeURIComponent(threadId)}/messages`
|
|
);
|
|
return response.data;
|
|
},
|
|
|
|
/** DELETE /threads/:threadId — delete a single thread */
|
|
deleteThread: async (threadId: string): Promise<ThreadDeleteData> => {
|
|
const response = await apiClient.delete<ApiResponse<ThreadDeleteData>>(
|
|
`/threads/${encodeURIComponent(threadId)}`
|
|
);
|
|
return response.data;
|
|
},
|
|
|
|
/** POST /chat/sendMessage — send a user message to a thread and get the agent response */
|
|
sendMessage: async (
|
|
message: string,
|
|
conversationId: string
|
|
): Promise<SendMessageResponseData> => {
|
|
const response = await apiClient.post<ApiResponse<SendMessageResponseData>>(
|
|
'/chat/sendMessage',
|
|
{ message, conversationId }
|
|
);
|
|
return response.data;
|
|
},
|
|
|
|
/** GET /chat/autocomplete — suggested starter questions (e.g. for a new/empty thread) */
|
|
getSuggestQuestions: async (conversationId?: string): Promise<SuggestQuestionsData> => {
|
|
const url =
|
|
conversationId != null
|
|
? `/chat/autocomplete?conversationId=${encodeURIComponent(conversationId)}`
|
|
: '/chat/autocomplete';
|
|
const response = await apiClient.get<ApiResponse<SuggestQuestionsData>>(url);
|
|
return response.data;
|
|
},
|
|
|
|
/** POST /purge — purge messages and/or threads */
|
|
purge: async (body: PurgeRequestBody): Promise<PurgeResultData> => {
|
|
const response = await apiClient.post<ApiResponse<PurgeResultData>>('/purge', body);
|
|
return response.data;
|
|
},
|
|
};
|