| 123456789101112131415161718 |
- import { errorResult, okResult } from '../core/result-envelope.mjs';
- import { safeError } from '../core/redaction.mjs';
- import { buildImageSetPlan, toPublicPlan } from '../features/planning/planner.mjs';
- export async function runPlan(input = {}) {
- try {
- const plan = buildImageSetPlan(input);
- const publicPlan = toPublicPlan(plan);
- return okResult({
- assistantMessage: publicPlan.confirmationMessage,
- summary: { planId: plan.planId, preset: plan.preset, outputs: plan.items.length, requiresConfirmation: true },
- data: { plan: publicPlan },
- nextActions: ['逐项审核目标、模型、尺寸和提示词。', '确认后以 confirmed=true 调用 fmode_image_set_generate。']
- });
- } catch (error) {
- return errorResult('needs_input', safeError(error));
- }
- }
|