feat: V1 - DAG编排/告警系统/Agent循环/知识库RAG/Webhook + 审核管理富上下文修复
This commit is contained in:
@@ -226,8 +226,33 @@ export interface Review {
|
|||||||
reviewed_at?: string;
|
reviewed_at?: string;
|
||||||
tenant_id: number;
|
tenant_id: number;
|
||||||
created_at: string;
|
created_at: string;
|
||||||
|
// ---- Enriched context (joined from task / project / worker / execution) ----
|
||||||
|
task_title: string;
|
||||||
|
task_description: string;
|
||||||
|
task_input_data: string;
|
||||||
|
task_output_data: string;
|
||||||
|
task_priority: string;
|
||||||
|
task_type: string;
|
||||||
|
task_status: string;
|
||||||
|
project_name: string;
|
||||||
|
project_description: string;
|
||||||
|
worker_id?: number;
|
||||||
|
worker_name?: string;
|
||||||
|
worker_model_name?: string;
|
||||||
|
worker_provider?: string;
|
||||||
|
worker_system_prompt?: string;
|
||||||
|
cost_cents: number;
|
||||||
|
token_usage: number;
|
||||||
|
duration_ms: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Review with full context: task/project/worker/cost joined.
|
||||||
|
* Now an alias of `Review`, which itself carries all enriched fields.
|
||||||
|
* Kept for API typing clarity (reviewApi returns ReviewDetail[]).
|
||||||
|
*/
|
||||||
|
export interface ReviewDetail extends Review {}
|
||||||
|
|
||||||
export interface ReviewDecisionPayload {
|
export interface ReviewDecisionPayload {
|
||||||
comment: string;
|
comment: string;
|
||||||
status: 'approved' | 'rejected';
|
status: 'approved' | 'rejected';
|
||||||
@@ -276,6 +301,99 @@ export interface DashboardStats {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ============ Knowledge Base ============
|
||||||
|
|
||||||
|
export interface KnowledgeDoc {
|
||||||
|
id: number;
|
||||||
|
title: string;
|
||||||
|
content: string;
|
||||||
|
doc_type: string;
|
||||||
|
source?: string;
|
||||||
|
tags: string;
|
||||||
|
project_id: number;
|
||||||
|
tenant_id: number;
|
||||||
|
created_at: string;
|
||||||
|
updated_at?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface KnowledgeDocCreate {
|
||||||
|
title: string;
|
||||||
|
content: string;
|
||||||
|
doc_type?: string;
|
||||||
|
source?: string;
|
||||||
|
tags?: string;
|
||||||
|
project_id?: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface KnowledgeSearchResult {
|
||||||
|
id: number;
|
||||||
|
title: string;
|
||||||
|
content: string;
|
||||||
|
doc_type: string;
|
||||||
|
tags: string;
|
||||||
|
score: number;
|
||||||
|
project_id: number;
|
||||||
|
created_at?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ============ Alerts ============
|
||||||
|
|
||||||
|
export type AlertSeverity = 'critical' | 'warning' | 'info';
|
||||||
|
|
||||||
|
export interface Alert {
|
||||||
|
id: number;
|
||||||
|
alert_type: string;
|
||||||
|
severity: AlertSeverity;
|
||||||
|
message: string;
|
||||||
|
is_read: boolean;
|
||||||
|
project_id?: number;
|
||||||
|
worker_id?: number;
|
||||||
|
tenant_id: number;
|
||||||
|
created_at: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface AlertUnreadCount {
|
||||||
|
count: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ============ Webhooks ============
|
||||||
|
|
||||||
|
export interface Webhook {
|
||||||
|
id: number;
|
||||||
|
url: string;
|
||||||
|
events: string;
|
||||||
|
project_id: number;
|
||||||
|
secret?: string;
|
||||||
|
tenant_id: number;
|
||||||
|
created_at: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface WebhookCreate {
|
||||||
|
url: string;
|
||||||
|
events: string;
|
||||||
|
project_id: number;
|
||||||
|
secret?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ============ DAG Execution ============
|
||||||
|
|
||||||
|
export interface DagExecutePayload {
|
||||||
|
project_id: number;
|
||||||
|
task_ids: number[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface DagExecuteResult {
|
||||||
|
execution_id?: number;
|
||||||
|
status: string;
|
||||||
|
message?: string;
|
||||||
|
results?: Array<{
|
||||||
|
task_id: number;
|
||||||
|
status: string;
|
||||||
|
output?: string;
|
||||||
|
error?: string;
|
||||||
|
}>;
|
||||||
|
}
|
||||||
|
|
||||||
// ============ Generic ============
|
// ============ Generic ============
|
||||||
|
|
||||||
export interface ApiError {
|
export interface ApiError {
|
||||||
|
|||||||
Reference in New Issue
Block a user