merge: fix/fix-latest-upload-summary-2026-09-23 (latest-upload summary + parse wait)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { applyPhaseEvent } from './phaseEventMapper';
|
||||
import { applyPhaseEvent, PHASE_META } from './phaseEventMapper';
|
||||
|
||||
test('applyPhaseEvent: appends first phase as running node', () => {
|
||||
const strip = applyPhaseEvent([], { phase_id: 'squad_assembly', message: '组建小队' });
|
||||
@@ -126,3 +126,17 @@ test('applyPhaseEvent: stores detail from phase.message', () => {
|
||||
const strip = applyPhaseEvent([], { phase_id: 'squad_assembly', message: '正在组建真实小队...' });
|
||||
assert.equal(strip[0].detail, '正在组建真实小队...');
|
||||
});
|
||||
|
||||
test('PHASE_META: document_parsing and document_summarizing are registered', () => {
|
||||
assert.equal(PHASE_META.document_parsing.icon, '📄');
|
||||
assert.equal(PHASE_META.document_parsing.label, '文档解析');
|
||||
assert.equal(PHASE_META.document_summarizing.icon, '📝');
|
||||
assert.equal(PHASE_META.document_summarizing.label, '正文总结');
|
||||
const strip = applyPhaseEvent([], {
|
||||
phase_id: 'document_parsing',
|
||||
message: '《说明书》正在解析中…已等待 4s',
|
||||
progress: 20,
|
||||
});
|
||||
assert.equal(strip[0].icon, '📄');
|
||||
assert.match(strip[0].label, /解析中/);
|
||||
});
|
||||
|
||||
@@ -24,6 +24,8 @@ export const PHASE_META: Record<string, { icon: string; label: string }> = {
|
||||
stage_completed: { icon: '🎉', label: '阶段完成' },
|
||||
step_failed: { icon: '⚠️', label: '步骤异常' },
|
||||
task_failed: { icon: '⚠️', label: '任务异常' },
|
||||
document_parsing: { icon: '📄', label: '文档解析' },
|
||||
document_summarizing: { icon: '📝', label: '正文总结' },
|
||||
};
|
||||
|
||||
/** 收口型 phase:不追加新节点,仅把当前 running 条目置为 completed */
|
||||
|
||||
Reference in New Issue
Block a user