/* ============================================================ * 工具(Tool)定义:Agent 可调用的 8 个生成工具 * buildGen(type, ctx) 返回结构化结果: * pre —— 助手开场白(应用内静态 HTML,非用户输入) * card —— 生成卡片结构(head / lines / foot / tips),由 GenCardView 渲染 * data —— 填入表单的结构化数据 * ============================================================ */ /** 自主发品 Agent 的 8 步任务清单 */ export const agentSteps = [ { label: '商品标题', type: 'title', note: '3 方案·已选高转化款填入' }, { label: '详细介绍', type: 'intro', note: '四段式卖点已填入' }, { label: '商品详情', type: 'detail', note: '图文结构已写入编辑器' }, { label: '商品图片', type: 'image', note: '6 张配图清单已添加' }, { label: '行程编辑', type: 'itinerary', note: '逐日行程已填入' }, { label: '价格库存', type: 'price', note: '5 个团期 + 定价已填入' }, { label: 'SEO 关键词', type: 'seo', note: '6 个高流量词已提取' }, { label: '合规检查', type: 'check', note: '扫描完成·0 极限词风险' } ] /** 一键发品的 6 步流程 */ export const ocStepsDef = [ { label: '商品标题', type: 'title', note: '已选高转化方案' }, { label: '详细介绍', type: 'intro', note: '四段式卖点' }, { label: '商品详情', type: 'detail', note: '图文结构就绪' }, { label: '商品图片', type: 'image', note: '配图清单 6 张' }, { label: '行程编辑', type: 'itinerary', note: '逐日框架就绪' }, { label: '价格库存', type: 'price', note: '团期+定价就绪' } ] /** 各工具的动作名称(对话中展示用) */ export const actionLabel = { title: '生成商品标题', intro: '生成详细介绍', detail: '生成商品详情', image: '配图建议', itinerary: '规划行程', price: '价格库存方案', seo: 'SEO 关键词', check: '合规检查' } /** 图片占位调色板 */ export const imgPalette = [ { g: 'linear-gradient(135deg,#ffb300,#ff7a1a)', em: '🚤' }, { g: 'linear-gradient(135deg,#f59e0b,#ef4444)', em: '🏮' }, { g: 'linear-gradient(135deg,#8b5cf6,#ec4899)', em: '🏔️' }, { g: 'linear-gradient(135deg,#22c55e,#ffb300)', em: '🏨' }, { g: 'linear-gradient(135deg,#f97316,#facc15)', em: '🍲' }, { g: 'linear-gradient(135deg,#6366f1,#ffb300)', em: '🌅' } ] /** 表单模块 → 卡片锚点(滚动定位用) */ export const cardMap = { title: 'card-title', intro: 'card-intro', detail: 'card-detail', image: 'card-img', itinerary: 'card-itinerary', price: 'card-price' } /** 生成 8 类工具的结构化结果(ctx 为当前表单上下文) */ export function buildGen(type, ctx) { const { dest, days, type: pType, theme } = ctx const isYn = dest === '云南' switch (type) { case 'title': { const t = [ `【纯玩无购物】${dest}${days}精品${pType}·5A景区全含·${theme}首选`, `${dest}${days}深度${pType}|一价全含0自费·住${isYn ? '海景' : '景区'}酒店`, `【${theme}必选】${dest}${days}${pType}·随走随停·金牌向导·赠${isYn ? '洱海游船' : '旅拍'}体验` ] return { pre: `结合 ${dest}·${days}·${pType}·${theme} 生成 3 个高点击标题(可多次点击填入切换方案):`, card: { head: '✨ 标题方案(三选一)', lines: t.map((x, i) => `${i + 1}. ${x}`), foot: { apply: 'title', label: '⚡ 一键填入「商品标题」', regen: true }, tips: [ { cls: 'ok-pill', text: '含目的地+天数+类型,利于搜索' }, { cls: '', text: '「无购物」为平台高转化词' } ] }, data: t } } case 'intro': { const d = `【${dest}${days}${pType}·${theme}优选】全程 0 购物 0 自费,景区门票一价全含,金牌持证导游全程讲解。\n精选 ${days === '3天2晚' ? '2' : '4'} 晚高分酒店,${isYn ? '大理海景房 + 丽江古城客栈' : '近景区步行可达'},住的舒心才是真度假。\n特色体验:${isYn ? '白族扎染 + 洱海游船 + 野生菌火锅' : '深度环线,不赶路'},孩子玩得开心、大人拍得尽兴。\n服务承诺:行程透明无隐形消费,24h 专属管家,未成团提前 3 天全额退款。` return { pre: `围绕「${theme}」人群痛点,按「亮点—住宿—体验—承诺」四段式生成详细介绍:`, card: { head: '✨ 详细介绍(列表页卖点摘要)', lines: d.split('\n'), foot: { apply: 'intro', label: '⚡ 一键填入「详细介绍」', regen: true }, tips: [ { cls: 'ok-pill', text: '约 200 字,符合最佳展示长度' }, { cls: '', text: '含服务承诺,降低决策门槛' } ] }, data: d } } case 'detail': { return { pre: '已生成结构化商品详情(亮点/住宿/餐饮/保障 + 配图占位),可直接在编辑器中继续润色:', card: { head: '✨ 商品详情(图文结构)', lines: [ `行程亮点 · 0购物0自费 / 经典IP全含 / ${theme}节奏`, `住宿安排 · ${isYn ? '海景房+古城客栈' : '高分酒店'}`, `舌尖体验 · ${isYn ? '野生菌火锅+风味餐' : '特色餐 3 次'}`, `服务保障 · 金牌导游 / 24h管家 / 全额退款承诺`, `配图占位 · 行程地图 / 酒店实拍 / 餐饮实拍` ], foot: { apply: 'detail', label: '⚡ 写入「商品详情」编辑器', regen: true }, tips: [] }, data: `