代码提交

This commit is contained in:
fengxiangdebaozi committed 2026-06-04 18:50:31 +08:00
1 parent 47217e9158
commit 9d863f63e5
33 files changed
+2878 -163

No files matched your search

@@ -45,6 +45,48 @@ export interface DispatchChainNode {
lastSpokeCycle?: number;
}
/** 一条后台作业的完整快照(§2.5)——对齐后端 `RoundtableJobResponse`(camelCase)。 */
export interface RoundtableJob {
id: string;
draftId: string | null;
status: JobStatus;
phase: JobPhase;
cycle: number;
dispatchChain: DispatchChainNode[];
activeAgentId: string | null;
consensusPercentage: number;
pendingClarification: string | null;
orchestrationMode: "recommend" | "chain";
chain: { id: string; title: string } | null;
error: string | null;
createdAt: string | null;
updatedAt: string | null;
}
/** 启动一个后台作业的入参(对齐后端 `StartJobRequest`)。 */
export interface StartJobPayload {
draftId?: string | null;
/** 任务意图;缺省 seedMessage 时用它作第一轮 leader prompt。 */
intent: string;
/** 有序席位(recommend=选择顺序 / chain=链条顺序)。 */
agents: Array<{ agentId: string; name: string }>;
model?: string;
orchestrationMode?: "recommend" | "chain";
chain?: { id: string; title: string } | null;
/** 显式第一轮 leader prompt(覆盖 intent)。 */
seedMessage?: string;
/** 预建好的 thread 映射(Phase 3b 真网关用;模拟网关忽略)。 */
threadIds?: Record<string, string> | null;
coordinatorName?: string;
}
/** 终态集合——SSE/轮询判定作业是否结束。 */
export const TERMINAL_JOB_STATUSES: readonly JobStatus[] = ["done", "error", "cancelled"];
export function isTerminalJobStatus(status: JobStatus): boolean {
return TERMINAL_JOB_STATUSES.includes(status);
}
/** 归一化进度事件(§2.4)——SSE 推送。Phase 7 暂未用到,先占位。 */
export type JobProgressEvent =
| { type: "status"; status: JobStatus }