Remove AI config approval flow

This commit is contained in:
npc0-hue
2026-09-22 15:33:32 +08:00
parent 20008b4043
commit a8b5d483a3
54 changed files with 364 additions and 875 deletions
+5 -17
View File
@@ -8,8 +8,6 @@ import type {
AiProviderUpdateRequest,
AIInvocationRequest,
AIInvocationResponse,
AIConfigDiffApprovalResponse,
AIConfigDiffListResponse,
ApiErrorResponse,
ArtifactContentChunk,
ArtifactDownloadReferenceResponse,
@@ -500,17 +498,6 @@ export class PlatformApiClient {
return this.request<PluginLifecycleActionResponse>(`/plugin-lifecycles/${encodeURIComponent(pluginId)}/actions`, { method: "POST", body: request });
}
async listAIConfigDiffs(filter: { serverInstanceId?: string; pluginId?: string; state?: string } = {}): Promise<AIConfigDiffListResponse> {
const params = new URLSearchParams();
Object.entries(filter).forEach(([key, value]) => { if (value) params.set(key, value); });
const query = params.toString();
return this.request<AIConfigDiffListResponse>(`/ai/config-diffs${query ? `?${query}` : ""}`);
}
async approveAIConfigDiff(id: string, idempotencyKey: string): Promise<AIConfigDiffApprovalResponse> {
return this.request<AIConfigDiffApprovalResponse>(`/ai/config-diffs/${encodeURIComponent(id)}/approve`, { method: "POST", body: { idempotencyKey } });
}
async listServerMetrics(): Promise<ServerMetricsListResponse> {
return this.request<ServerMetricsListResponse>("/metrics/server-instances");
}
@@ -641,8 +628,8 @@ export class PlatformApiClient {
return this.request<LogStreamListResponse>(`/log-streams${query}`);
}
openServerLogEvents(id: string): PlatformEventStream {
const url = this.serverLogEventsUrl(id);
openServerLogEvents(id: string, options: { jobId?: string } = {}): PlatformEventStream {
const url = this.serverLogEventsUrl(id, options);
const sessionToken = this.sessionTokenProvider();
if (!sessionToken) {
return new EventSource(url, { withCredentials: true });
@@ -650,8 +637,9 @@ export class PlatformApiClient {
return new FetchServerSentEventStream(url, sessionToken);
}
serverLogEventsUrl(id: string): string {
return `${this.baseUrl}/server-instances/${encodeURIComponent(id)}/logs/events`;
serverLogEventsUrl(id: string, options: { jobId?: string } = {}): string {
const query = options.jobId ? `?jobId=${encodeURIComponent(options.jobId)}` : "";
return `${this.baseUrl}/server-instances/${encodeURIComponent(id)}/logs/events${query}`;
}
async queryLogStream(request: LogStreamCursorRequest): Promise<LogStreamCursorResponse> {