feat: монорепо миграция, Discover/SearxNG улучшения
- Миграция на монорепозиторий (apps/frontend, apps/chat-service, etc.) - Discover: проверка SearxNG, понятное empty state при ненастроенном поиске - searxng.ts: валидация URL, проверка JSON-ответа, авто-добавление http:// - docker/searxng-config: настройки для JSON API SearxNG Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
127
apps/shared-types/src/types.ts
Normal file
127
apps/shared-types/src/types.ts
Normal file
@@ -0,0 +1,127 @@
|
||||
export type ToolCall = {
|
||||
id: string;
|
||||
name: string;
|
||||
arguments: Record<string, unknown>;
|
||||
};
|
||||
|
||||
export type SystemMessage = {
|
||||
role: 'system';
|
||||
content: string;
|
||||
};
|
||||
|
||||
export type AssistantMessage = {
|
||||
role: 'assistant';
|
||||
content: string;
|
||||
tool_calls?: ToolCall[];
|
||||
};
|
||||
|
||||
export type UserMessage = {
|
||||
role: 'user';
|
||||
content: string;
|
||||
};
|
||||
|
||||
export type ToolMessage = {
|
||||
role: 'tool';
|
||||
id: string;
|
||||
name: string;
|
||||
content: string;
|
||||
};
|
||||
|
||||
export type ChatTurnMessage = UserMessage | AssistantMessage;
|
||||
|
||||
export type Message =
|
||||
| UserMessage
|
||||
| AssistantMessage
|
||||
| SystemMessage
|
||||
| ToolMessage;
|
||||
|
||||
export type Chunk = {
|
||||
content: string;
|
||||
metadata: Record<string, any>;
|
||||
};
|
||||
|
||||
export type TextBlock = {
|
||||
id: string;
|
||||
type: 'text';
|
||||
data: string;
|
||||
};
|
||||
|
||||
export type SourceBlock = {
|
||||
id: string;
|
||||
type: 'source';
|
||||
data: Chunk[];
|
||||
};
|
||||
|
||||
export type SuggestionBlock = {
|
||||
id: string;
|
||||
type: 'suggestion';
|
||||
data: string[];
|
||||
};
|
||||
|
||||
export type WidgetBlock = {
|
||||
id: string;
|
||||
type: 'widget';
|
||||
data: {
|
||||
widgetType: string;
|
||||
params: Record<string, any>;
|
||||
};
|
||||
};
|
||||
|
||||
export type ReasoningResearchBlock = {
|
||||
id: string;
|
||||
type: 'reasoning';
|
||||
reasoning: string;
|
||||
};
|
||||
|
||||
export type SearchingResearchBlock = {
|
||||
id: string;
|
||||
type: 'searching';
|
||||
searching: string[];
|
||||
};
|
||||
|
||||
export type SearchResultsResearchBlock = {
|
||||
id: string;
|
||||
type: 'search_results';
|
||||
reading: Chunk[];
|
||||
};
|
||||
|
||||
export type ReadingResearchBlock = {
|
||||
id: string;
|
||||
type: 'reading';
|
||||
reading: Chunk[];
|
||||
};
|
||||
|
||||
export type UploadSearchingResearchBlock = {
|
||||
id: string;
|
||||
type: 'upload_searching';
|
||||
queries: string[];
|
||||
};
|
||||
|
||||
export type UploadSearchResultsResearchBlock = {
|
||||
id: string;
|
||||
type: 'upload_search_results';
|
||||
results: Chunk[];
|
||||
};
|
||||
|
||||
export type ResearchBlockSubStep =
|
||||
| ReasoningResearchBlock
|
||||
| SearchingResearchBlock
|
||||
| SearchResultsResearchBlock
|
||||
| ReadingResearchBlock
|
||||
| UploadSearchingResearchBlock
|
||||
| UploadSearchResultsResearchBlock;
|
||||
|
||||
export type ResearchBlock = {
|
||||
id: string;
|
||||
type: 'research';
|
||||
data: {
|
||||
subSteps: ResearchBlockSubStep[];
|
||||
};
|
||||
};
|
||||
|
||||
export type Block =
|
||||
| TextBlock
|
||||
| SourceBlock
|
||||
| SuggestionBlock
|
||||
| WidgetBlock
|
||||
| ResearchBlock;
|
||||
Reference in New Issue
Block a user