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
+1 -1
View File
@@ -24,7 +24,7 @@ Plugin pages build execution requests with `createBridgeExecutionRequest` and ha
Execution responses use `requestId`, plugin/page/server scope, action, status, optional result refs, and optional safe errors. Use `parseBridgeExecutionResponse` before reading results so plugin code handles denied, deferred, and failed states uniformly.
AI requests use `createAIInvocationRequest` with an explicit manifest-declared purpose, prompt, and scoped context refs. Use `parseAIInvocationResponse` to consume recommendations, reviewable `diffId` metadata, and safe errors. Plugin code must not choose or receive provider API keys, provider base URLs, bearer tokens, or direct transport details. Config writes require a separate Platform operator approval.
AI requests use `createAIInvocationRequest` with an explicit manifest-declared purpose, prompt, and scoped context refs. Use `parseAIInvocationResponse` to consume recommendations, optional `configExecution` job metadata, and safe errors. For config purposes Platform validates the current config and dispatches the bounded `config.write` job immediately; plugin code must not choose or receive provider API keys, provider base URLs, bearer tokens, or direct transport details.
Artifact open requests use `createArtifactOpenRequest` with an artifact ID that belongs to the current server/job scope. Use `parseArtifactReference` to consume the bridge result. Parsed references contain platform-owned download URLs, filename, content type, size, checksum, expiry, range support, and chunk size; they do not contain bytes or raw storage adapter locations.
+3 -2
View File
@@ -122,7 +122,8 @@ export interface PluginAIInvocationResponse {
purpose: AIPurpose;
status: "ok" | "denied" | "error" | string;
recommendation?: string;
configRecommendation?: { diffId: string; key: string; suggestedConfig: string; diffSummary: string; expiresAt: string };
configRecommendation?: { key: string; suggestedConfig: string; diffSummary: string };
configExecution?: { status: string; jobId: string; capability: string; targetKey?: string; inputRef?: string };
usage?: { model?: string; mocked?: boolean; inputTokens?: number; outputTokens?: number };
error?: PluginBridgeError;
}
@@ -574,7 +575,6 @@ export interface GamePluginManifest {
ai?: {
purposes?: AIPurpose[];
mediation: "platform";
configWritePolicy: "review-required";
};
}
@@ -866,6 +866,7 @@ export function parseAIInvocationResponse(response: PluginAIInvocationResponse):
status: response.status,
recommendation: response.recommendation,
configRecommendation: response.configRecommendation ? { ...response.configRecommendation } : undefined,
configExecution: response.configExecution ? { ...response.configExecution } : undefined,
usage: response.usage ? { ...response.usage } : undefined,
error: response.error ? bridgeError(response.error.code, response.error.message, response.error.details ?? []) : undefined
};