feat(position-roundtable): add standalone position collaboration

This commit is contained in:
fengxiangdebaozi committed 2026-07-21 17:50:24 +08:00
1 parent b93b82fcaf
commit 85e119db08
22 files changed
+3494 -201

No files matched your search

@@ -113,6 +113,8 @@ export interface UseStep1IntentReturn {
// ─── Handlers ────────────────────────────────────────────────────────
/** 清空当前 Step 1 状态并重新拉取 intent thread。 */
runStep1Init: () => void;
/** 清空当前状态但不创建线程,供宿主切换任务后重新进入 Step 1。 */
resetIntent: () => void;
/**
* 把 `userText` 作为用户气泡发给 intent agent,流式渲染回复。
* `files`:可选的本地文件,发送前先上传到 intent thread,再把引用随消息提交(后端
@@ -256,6 +258,20 @@ export function useStep1Intent(options: UseStep1IntentOptions): UseStep1IntentRe
})();
}, []);
const resetIntent = useCallback(() => {
stopIntentStream();
step1InitRef.current = false;
step1InitGenRef.current += 1;
setIntentThreadId(null);
setIntentReady(null);
setIntentInitError(null);
setIntentInitErrorDetail(null);
setPendingIntentClarificationMsgId(null);
setIntentClarificationSelections(new Map());
setInteractiveMessages([]);
setTimelineEntries([]);
}, [stopIntentStream]);
// 离开 Step 1 自动中断流;`currentStep === 1` 但还没初始化 → runStep1Init。
useEffect(() => {
if (currentStep !== 1) {
@@ -648,6 +664,7 @@ export function useStep1Intent(options: UseStep1IntentOptions): UseStep1IntentRe
timelineEntries,
setIntentClarificationSelections,
runStep1Init,
resetIntent,
sendIntentMessage,
submitIntentClarifications,
updateIntentReady,