feat: 统一两端界面并扩展受权限约束的AI助手
This commit is contained in:
1 parent
79a31ebe9d
commit
0b35a58f07
141 files changed
+7999
-2213
No files matched your search
@@ -0,0 +1,54 @@
|
||||
export interface AiAttachment {
|
||||
id: string;
|
||||
name: string;
|
||||
size: number;
|
||||
sha256: string;
|
||||
}
|
||||
export interface AiOperation {
|
||||
action: string;
|
||||
target?: Record<string, string>;
|
||||
params?: Record<string, unknown>;
|
||||
query?: Record<string, unknown>;
|
||||
attachmentId?: string;
|
||||
}
|
||||
export interface AiCapability {
|
||||
action: string;
|
||||
label: string;
|
||||
kind: 'read' | 'write';
|
||||
dangerous: boolean;
|
||||
schema: Record<string, unknown>;
|
||||
sensitiveFields: string[];
|
||||
}
|
||||
export interface AiExecutionRequest {
|
||||
method: 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
||||
path: string;
|
||||
query: Record<string, unknown>;
|
||||
body: Record<string, unknown>;
|
||||
attachmentId?: string;
|
||||
sha256?: string;
|
||||
}
|
||||
export interface AiPlanStep extends AiOperation {
|
||||
id: string;
|
||||
label: string;
|
||||
status: 'draft' | 'prepared' | 'confirmed' | 'running' | 'succeeded' | 'failed' | 'blocked';
|
||||
summary: string;
|
||||
dangerous: boolean;
|
||||
sensitiveFields: string[];
|
||||
before?: unknown;
|
||||
preview?: unknown;
|
||||
result?: unknown;
|
||||
error?: string;
|
||||
request?: AiExecutionRequest;
|
||||
}
|
||||
export interface AiConversationRequest {
|
||||
text: string;
|
||||
classId?: string;
|
||||
messages?: { role: 'user' | 'assistant'; content: string }[];
|
||||
attachments?: AiAttachment[];
|
||||
}
|
||||
export interface AiConversationResult {
|
||||
planId: string | null;
|
||||
message: string;
|
||||
steps: AiPlanStep[];
|
||||
results: { action: string; label: string; data: unknown }[];
|
||||
}
|
||||
Reference in new issue
Block a user