Files
mcn-short-video/.workbuddy/skills/impeccable/scripts/live/completion.mjs
T
maogeigei 5f5b4f1cb7 feat(MCN工作台): 数据功能页+图标扁平化+多项UI优化
- 工作台大版本升级:hash 路由 + 6 数据功能页(周榜/热门账号/账号详情/视频详情/AI写脚本/AI写作复盘),只读复用 dsh 库副本 + 抖音榜单 JSON
- 数据库隔离:复制 dsh 库到 mcn-work-shop/,与 dsh 原库各访问各的(已 gitignore)
- 图标全面扁平化:Lucide 线性 SVG,功能图标亮色区分,文字标题去图标
- 首页重构:功能入口卡 + AI写剧本快捷卡片(2列/8个/5行预览) + 独立帮助页 + header 精简
- 新增设计技能 impeccable + taste-skill(生成网页时参考)
- 修复:fmtTime 跨 script 全局冲突(P0)、弹窗关闭、外链新标签打开等
2026-08-27 12:33:57 +08:00

29 lines
1.4 KiB
JavaScript

// A preview whose variants live in component modules rather than in the user's
// source. These leave no markers in the real file, so a failed accept gives the
// agent nothing to hand-edit and must be reported as a failure rather than
// reference/live.md's manual-cleanup handoff. Kept as a set: any future
// component-module preview mode belongs here the day it lands.
const PREVIEW_MODES_WITHOUT_SOURCE_MARKERS = new Set([
'svelte-component',
]);
export function completionTypeForAcceptResult(eventType, acceptResult) {
if (eventType === 'discard') return acceptResult?.handled === true ? 'discarded' : 'error';
if (acceptResult?.handled === true && acceptResult?.carbonize === true) return 'agent_done';
if (acceptResult?.handled === true) return 'complete';
if (acceptResult?.mode === 'error') return 'error';
if (eventType === 'accept' && PREVIEW_MODES_WITHOUT_SOURCE_MARKERS.has(acceptResult?.previewMode)) return 'error';
return 'agent_done';
}
export function completionAckForAcceptResult(eventId, completionType, acceptResult) {
const ack = { ok: true, type: completionType };
if (acceptResult?.handled === true && acceptResult?.carbonize === true) {
ack.final = false;
ack.requiresComplete = true;
ack.nextCommand = `live-complete.mjs --id ${eventId}`;
ack.message = 'Carbonize cleanup must be verified, then the session must be completed explicitly before polling again.';
}
return ack;
}