Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。
TypeScript agentai-agentai-assistantandroidclaude-codecodexelectroniosllmmacosreact-nativetypescriptwindows
fix(desktop): 灵动岛伙伴群聊报错卡点击后可消除,且只处置被点的那一张 (#6014)
Dash6ea2268214ad
diff --git a/apps/desktop/src/main/__tests__/deepLink.test.ts b/apps/desktop/src/main/__tests__/deepLink.test.tsindex 092bc10d44..7e39d122f7 100644--- a/apps/desktop/src/main/__tests__/deepLink.test.ts+++ b/apps/desktop/src/main/__tests__/deepLink.test.ts@@ -221,6 +221,14 @@ describe('parseDeepLink', () => {});});+ // islandEntryId 只由主进程的灵动岛点击写入;外部链接不能冒充一次点击去处置提醒。+ it('never derives an Agent Island click id from an external link', () => {+ expect(parseDeepLink('cindy://session/abc-123?islandEntryId=1')).toEqual({+ type: 'session',+ id: 'abc-123',+ });+ });+it('parses project payload with URL-encoded workingDir', () => {const encoded = encodeURIComponent('C:\\Some Path\\proj');expect(parseDeepLink(`xdt-maker://project/${encoded}`)).toEqual({diff --git a/apps/desktop/src/main/agent-island/__tests__/service.test.ts b/apps/desktop/src/main/agent-island/__tests__/service.test.tsindex 7c3184c110..0196227e22 100644--- a/apps/desktop/src/main/agent-island/__tests__/service.test.ts+++ b/apps/desktop/src/main/agent-island/__tests__/service.test.ts@@ -1,6 +1,8 @@+import { readFileSync } from 'node:fs';import { homedir } from 'node:os';import path from 'node:path';+import { ScriptTarget, transpileModule } from 'typescript';import { beforeEach, describe, expect, it, vi } from 'vitest';import type { BrowserWindow } from 'electron';import { SESSION_ACTIVITY_CHANNEL } from '@cindy/device-link';@@ -9,6 +11,7 @@ import { BRAND_NAME } from '@cindy/maker-shared/branding';import { computeAgentIslandWindowBounds, type AgentIslandLayoutPreference } from '../geometry.js';import {+ AGENT_ISLAND_CONSUME_ENTRY_ALERT_CHANNEL,AGENT_ISLAND_GET_DISPLAY_OPTIONS_CHANNEL,AGENT_ISLAND_PREVIEW_SOUND_CHANNEL,AGENT_ISLAND_SET_DISPLAY_TARGET_CHANNEL,@@ -87,6 +90,12 @@ const mocks = vi.hoisted(() => ({showMessageBox: vi.fn(),openExternal: vi.fn(),readdir: vi.fn<(...args: unknown[]) => Promise<string[]>>(() => Promise.resolve([])),+ assertTrustedAppRendererEvent: vi.fn(),+}));++vi.mock('../../security/trustedAppRenderer.js', async (importOriginal) => ({+ ...(await importOriginal<typeof import('../../security/trustedAppRenderer.js')>()),+ assertTrustedAppRendererEvent: mocks.assertTrustedAppRendererEvent,}));// 受保护目录引导会由 Main 亲自 readdir 核实一次;只替换这一个 API,其余 fs/promises@@ -154,6 +163,7 @@ beforeEach(() => {mocks.getPreferredSystemLanguages.mockReset();mocks.getLocale.mockReset();mocks.ipcHandle.mockReset();+ mocks.assertTrustedAppRendererEvent.mockReset();mocks.browserWindowFromWebContents.mockReset();mocks.browserWindowFromWebContents.mockReturnValue(null);mocks.browserWindowGetAllWindows.mockReset();@@ -2079,7 +2089,12 @@ describe('AgentIslandService native publishing', () => {expect(send).not.toHaveBeenCalled();expect(mainWindow.show).toHaveBeenCalled();expect(mainWindow.focus).toHaveBeenCalled();- expect(takePendingDeepLink()).toEqual({ type: 'session', id: 'completed-session' });+ // The click on an unread card also carries its click id for disposal on landing.+ expect(takePendingDeepLink()).toEqual({+ type: 'session',+ id: 'completed-session',+ islandEntryId: expect.any(String),+ });expect(takePendingDeepLink()).toBeNull();service.setAppFocused(true);@@ -6080,6 +6095,263 @@ describe('AgentIslandService session attention cleared bridge (error read semant});});+// 群专线 / 只读历史 / 不可用的伙伴任务没有报错横幅:灵动岛点击落地后由 renderer 请求+// 处置,main 只处置被点的那一张卡(点击时记下的身份),不碰之后出现的新提醒。+describe('AgentIslandService island-entry alert disposal', () => {+ async function setup() {+ const { AgentIslandService } = await import('../service.js');+ const { initAppBadgeService, clearAllSessionAttention } = await import('../../appBadgeService.js');+ clearAllSessionAttention();+ const mainWindow = {+ isDestroyed: () => false,+ isVisible: () => true,+ isMinimized: () => false,+ isFocused: () => true,+ restore: vi.fn(),+ show: vi.fn(),+ focus: vi.fn(),+ setAlwaysOnTop: vi.fn(),+ moveTop: vi.fn(),+ webContents: { send: vi.fn(), isLoading: () => true },+ } as unknown as BrowserWindow;+ setDeepLinkMainWindow(mainWindow);+ const publish = vi.fn((state: AgentIslandDisplayState) => {+ void state;+ return true;+ });+ const service = new AgentIslandService({+ getMainWindow: () => mainWindow,+ nativeHost: { failed: false, publish },+ });+ initAppBadgeService({+ getWindow: () => null,+ onSessionAttentionCleared: (sessionId, intent) => service.handleSessionAttentionCleared(sessionId, intent),+ });+ syncEnabledForTest(service, publish);+ service.registerIpc();+ /** A real island click; returns the click id main put into the deep link (null = none). */+ const click = (sessionId: string): string | null => {+ (service as unknown as { focusSession(id: string): void }).focusSession(sessionId);+ const payload = takePendingDeepLink() as { type: string; id?: string; islandEntryId?: string } | null;+ expect(payload).toMatchObject({ type: 'session', id: sessionId });+ return payload?.islandEntryId ?? null;+ };+ const consume = (sessionId: unknown, entryId: unknown, sender: unknown = mainWindow.webContents) =>+ registeredIpcHandler(AGENT_ISLAND_CONSUME_ENTRY_ALERT_CHANNEL)({ sender }, sessionId, entryId) as {+ ok: true;+ consumed: boolean;+ };+ const shown = () => (publish.mock.calls.at(-1)?.[0]?.sessions ?? []).map((session) => session.sessionId);+ const island = (service as unknown as {+ state: { sessions: Map<string, { phase: string; unread: boolean; pendingInteractionIds: Set<string> }> };+ }).state;+ return { service, click, consume, shown, island, mainWindow };+ }+ const lane = { sessionId: 'lane', agentKind: 'codex' as const };+ const other = { sessionId: 'other-err', agentKind: 'codex' as const };++ it('disposes only the clicked card for that click, once', async () => {+ const { service, click, consume, shown, island } = await setup();+ service.handleAgentEvent(lane, terminalErrorEvent('400 invalid_request_error'));+ service.handleAgentEvent(other, terminalErrorEvent('boom'));+ service.handleUserPrompt({ sessionId: 'done', agentKind: 'codex' }, 'run');+ service.handleAgentEvent({ sessionId: 'done', agentKind: 'codex' }, doneEvent());+ service.handleUserPrompt({ sessionId: 'running', agentKind: 'codex' }, 'run');+ handleInteractionRequestForTest(service, { sessionId: 'ask', agentKind: 'codex' }, {+ kind: 'permission',+ requestId: 'ask-r1',+ toolName: 'Bash',+ input: { command: 'pnpm test' },+ } as InteractionRequest);++ // URL-only entries carry no click id; a guessed one is not a click either.+ expect(consume('lane', '1')).toEqual({ ok: true, consumed: false });+ expect(island.sessions.get('lane')).toMatchObject({ phase: 'error', unread: true });++ const entryId = click('lane');+ expect(entryId).toEqual(expect.any(String));+ expect(consume('lane', entryId)).toEqual({ ok: true, consumed: true });+ expect(island.sessions.has('lane')).toBe(false);+ expect(shown()).not.toContain('lane');+ expect(shown()).toEqual(expect.arrayContaining(['other-err', 'done', 'running', 'ask']));+ expect(island.sessions.get('other-err')).toMatchObject({ phase: 'error', unread: true });+ expect(island.sessions.get('ask')?.pendingInteractionIds.has('ask-r1')).toBe(true);+ // The same click cannot dispose twice; clicking a card that is gone records nothing.+ expect(consume('lane', entryId)).toEqual({ ok: true, consumed: false });+ expect(click('lane')).toBeNull();+ // App badge / pending-alert re-marking the same old error cannot revive the card.+ service.handleSessionAttentionMarked('lane');+ expect(island.sessions.has('lane')).toBe(false);+ });++ it('a newer click on another card supersedes the earlier one, including a later manual visit', async () => {+ const { service, click, consume, island } = await setup();+ service.handleAgentEvent(lane, terminalErrorEvent('lane failure'));+ service.handleAgentEvent(other, terminalErrorEvent('other failure'));+ const laneEntry = click('lane');+ const otherEntry = click('other-err');+ // The unavailable page / any late request for A, inside the TTL, after B was clicked.+ expect(consume('lane', laneEntry)).toEqual({ ok: true, consumed: false });+ expect(island.sessions.get('lane')).toMatchObject({ phase: 'error', unread: true });+ // A stale request for A does not cancel B's own disposal.+ expect(consume('other-err', otherEntry)).toEqual({ ok: true, consumed: true });+ expect(island.sessions.get('lane')).toMatchObject({ phase: 'error', unread: true });+ });++ it('two clicks on the same card: a late first request never takes the second click', async () => {+ const { service, click, consume, island } = await setup();+ vi.useFakeTimers();+ try {+ vi.setSystemTime(1_000_000);+ service.handleAgentEvent(lane, terminalErrorEvent('first failure'));+ const first = click('lane');+ vi.setSystemTime(1_000_500);+ service.handleUserPrompt(lane, 'try again');+ vi.setSystemTime(1_001_000);+ service.handleAgentEvent(lane, terminalErrorEvent('second failure'));+ const second = click('lane');+ expect(first).not.toEqual(second);+ // The first click's navigation lands after the second click was recorded.+ expect(consume('lane', first)).toEqual({ ok: true, consumed: false });+ expect(island.sessions.get('lane')).toMatchObject({ phase: 'error', unread: true });+ expect(consume('lane', second)).toEqual({ ok: true, consumed: true });+ expect(island.sessions.has('lane')).toBe(false);++ // Unchanged card clicked twice: only the latest click disposes it.+ vi.setSystemTime(1_002_000);+ service.handleUserPrompt(lane, 'again');+ service.handleAgentEvent(lane, terminalErrorEvent('third failure'));+ const third = click('lane');+ const fourth = click('lane');+ expect(consume('lane', third)).toEqual({ ok: true, consumed: false });+ expect(consume('lane', fourth)).toEqual({ ok: true, consumed: true });+ } finally {+ vi.useRealTimers();+ }+ });++ it('keeps a failure that arrived after the click, and alerts on it normally', async () => {+ const { service, click, consume, island } = await setup();+ vi.useFakeTimers();+ try {+ vi.setSystemTime(1_000_000);+ service.handleAgentEvent(lane, terminalErrorEvent('first failure'));+ const first = click('lane');+ vi.setSystemTime(1_000_500);+ service.handleUserPrompt(lane, 'try again');+ // Still running when the stale click lands: the old card is no longer what it showed.+ expect(consume('lane', first)).toEqual({ ok: true, consumed: false });+ vi.setSystemTime(1_001_000);+ service.handleAgentEvent(lane, terminalErrorEvent('second failure'));+ expect(island.sessions.get('lane')).toMatchObject({ phase: 'error', unread: true });++ const second = click('lane');+ vi.setSystemTime(1_001_500);+ service.handleAgentEvent(lane, terminalErrorEvent('third failure'));+ expect(consume('lane', second)).toEqual({ ok: true, consumed: false });+ expect(island.sessions.get('lane')).toMatchObject({ phase: 'error', unread: true });+ } finally {+ vi.useRealTimers();+ }+ });++ // Review P1:重试在同一毫秒内又落新终态时,毫秒时间戳的身份会撞上,旧点击会误处置+ // 新提醒。卡片身份用无碰撞的活动代数后,新报错卡必须留下。+ it('a same-millisecond terminal after the click never gets consumed by the old click', async () => {+ const { service, click, consume, island } = await setup();+ vi.useFakeTimers();+ try {+ vi.setSystemTime(1_000_000);+ service.handleAgentEvent(lane, terminalErrorEvent('first failure'));+ const entryId = click('lane');+ // 同一毫秒内重试并再次失败:新的报错卡是新的提醒。+ service.handleUserPrompt(lane, 'try again');+ service.handleAgentEvent(lane, terminalErrorEvent('second failure'));+ expect(consume('lane', entryId)).toEqual({ ok: true, consumed: false });+ expect(island.sessions.get('lane')).toMatchObject({ phase: 'error', unread: true });+ } finally {+ vi.useRealTimers();+ }+ });++ // Review P1 后续:失败 turn 的收尾记账 done 保留同一张错误卡(completeAgentIslandSession+ // 主动 early-return),不得驱逐被点击的那张,否则迟到的处置会失败、卡留着。+ it('a trailing bookkeeping done keeps the clicked error card disposable', async () => {+ const { service, click, consume, island } = await setup();+ service.handleAgentEvent(lane, terminalErrorEvent('boom'));+ const entryId = click('lane');+ // 配对的收尾 done 不换卡(未获准替换报错)。+ service.handleAgentEvent(lane, doneEvent());+ expect(island.sessions.get('lane')).toMatchObject({ phase: 'error', unread: true });+ expect(consume('lane', entryId)).toEqual({ ok: true, consumed: true });+ expect(island.sessions.has('lane')).toBe(false);+ });++ // The read-only history page reports its session as visible; a click on that card+ // must still reach the renderer, whose navigator disposes it on the open target.+ it('delivers the click id even when the target is the visible, focused session', async () => {+ const { service, click, consume, island, mainWindow } = await setup();+ const history = { sessionId: 'history', agentKind: 'codex' as const };+ service.handleAgentEvent(history, terminalErrorEvent('history failure'));+ service.setAppFocused(true);+ mocks.browserWindowFromWebContents.mockReturnValue(mainWindow);+ await registeredIpcHandler(AGENT_ISLAND_SET_VISIBLE_SESSION_CHANNEL)({ sender: mainWindow.webContents }, 'history');+ // Passive visibility never clears an unread error.+ expect(island.sessions.get('history')).toMatchObject({ phase: 'error', unread: true });+ const entryId = click('history');+ expect(entryId).toEqual(expect.any(String));+ expect(consume('history', entryId)).toEqual({ ok: true, consumed: true });+ expect(island.sessions.has('history')).toBe(false);+ });++ // Run the production preload bridge source against the real registered handler, so+ // the renderer → main argument order (sessionId, islandEntryId) cannot drift.+ it('the production preload bridge reaches the handler with this click id', async () => {+ const preloadSource = readFileSync(new URL('../../../preload/preload.ts', import.meta.url), 'utf8');+ const start = preloadSource.indexOf(' consumeEntryAlert: (');+ const end = preloadSource.indexOf('\n', preloadSource.indexOf('AGENT_ISLAND_CONSUME_ENTRY_ALERT_CHANNEL, sessionId', start));+ expect(start).toBeGreaterThan(0);+ const compiled = transpileModule(`const bridge = {${preloadSource.slice(start, end)}};`, {+ compilerOptions: { target: ScriptTarget.ES2022 },+ }).outputText;+ const { service, click, island, mainWindow } = await setup();+ const ipcRenderer = {+ invoke: (channel: string, ...args: unknown[]) =>+ Promise.resolve(registeredIpcHandler(channel)({ sender: mainWindow.webContents }, ...args)),+ };+ const bridge = new Function('ipcRenderer', 'AGENT_ISLAND_CONSUME_ENTRY_ALERT_CHANNEL', `${compiled}; return bridge;`)(+ ipcRenderer,+ AGENT_ISLAND_CONSUME_ENTRY_ALERT_CHANNEL,+ ) as { consumeEntryAlert(sessionId: string, islandEntryId: string): Promise<{ ok: true; consumed: boolean }> };+ service.handleAgentEvent(lane, terminalErrorEvent('lane failure'));+ const entryId = click('lane');+ await expect(bridge.consumeEntryAlert('lane', 'not-this-click')).resolves.toEqual({ ok: true, consumed: false });+ await expect(bridge.consumeEntryAlert('lane', entryId!)).resolves.toEqual({ ok: true, consumed: true });+ expect(island.sessions.has('lane')).toBe(false);+ });++ it('expires an unconsumed click and rejects senders other than the main window', async () => {+ const { service, click, consume, island } = await setup();+ vi.useFakeTimers();+ try {+ vi.setSystemTime(2_000_000);+ service.handleAgentEvent(lane, terminalErrorEvent('boom'));+ const entryId = click('lane');+ expect(consume('lane', entryId, { other: true })).toEqual({ ok: true, consumed: false });+ vi.setSystemTime(2_000_000 + 60_001);+ expect(consume('lane', entryId)).toEqual({ ok: true, consumed: false });+ expect(island.sessions.get('lane')).toMatchObject({ phase: 'error', unread: true });+ expect(() => consume('', entryId)).toThrow();+ expect(() => consume('x'.repeat(129), entryId)).toThrow();+ expect(() => consume('lane', undefined)).toThrow();+ expect(() => consume('lane', 'x'.repeat(33))).toThrow();+ expect(mocks.assertTrustedAppRendererEvent).toHaveBeenCalled();+ } finally {+ vi.useRealTimers();+ }+ });+});+describe('会话关闭原因决定条目去留', () => {it('进程关闭保留仍在展示的完成卡片,归档/删除照常硬删', async () => {const { AgentIslandService } = await import('../service.js');diff --git a/apps/desktop/src/main/agent-island/__tests__/state.test.ts b/apps/desktop/src/main/agent-island/__tests__/state.test.tsindex 7d193c2ece..7855e3fff6 100644--- a/apps/desktop/src/main/agent-island/__tests__/state.test.ts+++ b/apps/desktop/src/main/agent-island/__tests__/state.test.ts@@ -2328,6 +2328,35 @@ describe('Agent Island error read semantics (已读以 App 内真实展示为准expect(state.sessions.get('err')?.unread).toBe(false);});+ // 伙伴群专线 / 只读历史没有报错横幅:灵动岛点击落地后,main 的+ // consumeIslandEntryAlert 在卡片身份未变时按 explicit 处置这一张卡。+ it('disposes only the clicked error card; replayed marks cannot revive it, a new failure still alerts', () => {+ const state = createAgentIslandState();+ const lane = { sessionId: 'lane', title: 'Cindy开发' };+ applyAgentIslandEvent(state, lane, terminalErrorEvent('400 invalid_request_error'), 2_000);+ applyAgentIslandEvent(state, { sessionId: 'other-err', title: 'Other' }, terminalErrorEvent('boom'), 2_100);+ applyAgentIslandEvent(state, { sessionId: 'done', title: 'Done' }, doneEvent(), 2_200);+ applyAgentIslandInteractionRequest(state, { sessionId: 'ask', title: 'Ask' }, permissionRequest('r1'), 2_300);++ expect(acknowledgeAgentIslandSessionRead(state, 'lane', 3_000, { source: 'explicit' })).toBe('cleared');+ expect(state.sessions.has('lane')).toBe(false);+ expect(state.remoteUnreadTerminals.has('lane')).toBe(false);+ // Repeat clicks and the pending-alert reconcile re-marking the same persisted+ // error tail leave the disposed card gone.+ expect(acknowledgeAgentIslandSessionRead(state, 'lane', 3_100, { source: 'explicit' })).toBe('not-found');+ expect(markAgentIslandSessionAttention(state, 'lane')).toBe(false);+ const afterAck = buildAgentIslandDisplayState(state, 3_200).sessions.map((session) => session.sessionId);+ expect(afterAck).not.toContain('lane');+ expect(afterAck).toEqual(expect.arrayContaining(['other-err', 'done', 'ask']));+ expect(state.sessions.get('other-err')).toMatchObject({ phase: 'error', unread: true });+ expect(state.sessions.get('ask')?.pendingInteractionIds.has('r1')).toBe(true);++ applyAgentIslandUserPrompt(state, lane, 'try again', 4_000);+ applyAgentIslandEvent(state, lane, terminalErrorEvent('400 again'), 5_000);+ expect(state.sessions.get('lane')).toMatchObject({ phase: 'error', unread: true });+ expect(buildAgentIslandDisplayState(state, 5_100).sessions.map((session) => session.sessionId)).toContain('lane');+ });+it('preserves error unread when a pending interaction is dismissed after the terminal error', () => {const state = createAgentIslandState();applyAgentIslandInteractionRequest(state, { sessionId: 'err', title: 'Err' }, permissionRequest('r1'), 1_000);diff --git a/apps/desktop/src/main/agent-island/service.ts b/apps/desktop/src/main/agent-island/service.tsindex e45838b3f1..686f6581e2 100644--- a/apps/desktop/src/main/agent-island/service.ts+++ b/apps/desktop/src/main/agent-island/service.ts@@ -22,9 +22,13 @@ import {} from '@cindy/maker-shared/turn-continuation';import type { ApplicationMenuCommand } from '../../shared/applicationMenuCommands.js';-import { hasSessionAttention as hasAppBadgeSessionAttention } from '../appBadgeService.js';+import {+ clearSessionAttention as clearAppBadgeSessionAttention,+ hasSessionAttention as hasAppBadgeSessionAttention,+} from '../appBadgeService.js';import { openMainWindowSession } from '../deepLink.js';import {+ AGENT_ISLAND_CONSUME_ENTRY_ALERT_CHANNEL,AGENT_ISLAND_MAX_RESIZABLE_WIDTH,AGENT_ISLAND_GET_DISPLAY_OPTIONS_CHANNEL,AGENT_ISLAND_PREVIEW_SOUND_CHANNEL,@@ -76,6 +80,7 @@ import { t } from '../i18n.js';import { isAppContentWindow, isFocusedAppContentWindow } from '../windowFocusClassifier.js';import {acknowledgeAgentIslandSessionRead,+ readAgentIslandUnreadTerminalStamp,applyAgentIslandEvent,applyAgentIslandInteractionDismissed,applyAgentIslandInteractionRequest,@@ -154,6 +159,10 @@ const REMOTE_DAEMON_CLOSED_REASON = 'remote_daemon_closed';// Remote close can legitimately consume the full 15s RPC timeout before the// renderer waits another 1.5s and resends. Keep the fallback beyond that window.const REMOTE_AUTH_ERROR_FALLBACK_MS = 30_000;+// 点击卡片到主窗导航落地之间可能隔着一次 renderer 冷加载,与主窗导航保留同量级。+const ISLAND_ENTRY_ALERT_TTL_MS = 60_000;+const MAX_ISLAND_ENTRY_SESSION_ID_LENGTH = 128;+const MAX_ISLAND_ENTRY_ID_LENGTH = 32;interface AgentIslandSessionMeta {sessionId: string;@@ -343,6 +352,14 @@ export class AgentIslandService {*/private unreadAttentionGenerationBySession = new Map<string, number>();private readonly sessionHadAttentionAtRunStart = new Map<string, boolean>();+ /**+ * 最近一次灵动岛卡片点击:点击编号 + 点击时那张卡的身份(readAgentIslandUnreadTerminalStamp)。+ * 只留最新一次 —— 任何新点击都会取代它,包括同一任务的再次点击。只给「目标页没有处置+ * 控件」的入口用(群专线、只读历史、不可用的委派任务):renderer 在目标地址真正提交后+ * 带上这次的点击编号调 consumeIslandEntryAlert,编号与卡片身份都一致才按 explicit 处置。+ */+ private islandEntryAlert: { sessionId: string; entryId: string; stamp: string; until: number } | null = null;+ private islandEntrySequence = 0;private readonly userPromptRollbackTokens = new Map<string, {state: AgentIslandUserPromptRollbackToken;attention: { existed: boolean; value: boolean };@@ -538,6 +555,23 @@ export class AgentIslandService {return { ok: true };});+ ipcMain.handle(AGENT_ISLAND_CONSUME_ENTRY_ALERT_CHANNEL, (event, rawSessionId: unknown, rawEntryId: unknown) => {+ assertTrustedAppRendererEvent(event);+ // 导航只发生在主窗;副窗也挂 MainLayout 级组件,不能替主窗处置提醒。+ const mainWindow = this.deps.getMainWindow();+ if (!mainWindow || mainWindow.isDestroyed() || mainWindow.webContents !== event.sender) {+ return { ok: true, consumed: false };+ }+ const sessionId = typeof rawSessionId === 'string' ? rawSessionId.trim() : '';+ if (!sessionId || sessionId.length > MAX_ISLAND_ENTRY_SESSION_ID_LENGTH) {+ throwIpcError('INVALID_PARAMS', 'sessionId is invalid');+ }+ if (typeof rawEntryId !== 'string' || !rawEntryId || rawEntryId.length > MAX_ISLAND_ENTRY_ID_LENGTH) {+ throwIpcError('INVALID_PARAMS', 'entryId is invalid');+ }+ return { ok: true, consumed: this.consumeIslandEntryAlert(sessionId, rawEntryId) };+ });+ipcMain.handle(AGENT_ISLAND_SET_ENABLED_CHANNEL, (_event, enabled: unknown) => {if (typeof enabled !== 'boolean') {throwIpcError('INVALID_PARAMS', 'enabled must be boolean');@@ -702,6 +736,7 @@ export class AgentIslandService {this.clearSilencedRunTimer(runId);}resetAgentIslandState(this.state);+ this.islandEntryAlert = null;this.emitSessionActivityTransitions([], Date.now());this.metadataCache.clear();this.metadataLoading.clear();@@ -2426,10 +2461,14 @@ export class AgentIslandService {const nextSessionId = typeof sessionId === 'string' && sessionId.trim() ? sessionId.trim() : null;if (!nextSessionId) return;const now = Date.now();+ const islandEntryId = this.recordIslandEntryAlert(nextSessionId, now);this.playConfiguredSound('select', now);if (this.state.appFocused && this.state.visibleSessionIds.has(nextSessionId)) {const focusChanged = requestAgentIslandSessionFocus(this.state, nextSessionId, now);if (focusChanged) this.publish();+ // 已在看的目标未必能处置这张卡(如只读历史):这次点击仍要交给 renderer,+ // 入口导航器发现目标地址已提交时直接按点击编号申请处置,不会再导航一次。+ if (islandEntryId) openMainWindowSession(nextSessionId, { islandEntryId });return;}@@ -2438,7 +2477,36 @@ export class AgentIslandService {// Reuse the primary-window handoff: it retains navigation while the// renderer reloads and restores macOS app focus. A one-shot notification// sent during loading is lost before MainLayout can acknowledge the task.- openMainWindowSession(nextSessionId);+ openMainWindowSession(nextSessionId, islandEntryId ? { islandEntryId } : undefined);+ }++ /** 记下这次点击并取代之前的任何一次;被点的卡不是未读完成 / 报错时不留可处置记录。 */+ private recordIslandEntryAlert(sessionId: string, now: number): string | null {+ const stamp = readAgentIslandUnreadTerminalStamp(this.state, sessionId);+ if (!stamp) {+ this.islandEntryAlert = null;+ return null;+ }+ const entryId = String(++this.islandEntrySequence);+ this.islandEntryAlert = { sessionId, entryId, stamp, until: now + ISLAND_ENTRY_ALERT_TTL_MS };+ return entryId;+ }++ /**+ * 处置用户最近一次点的那张卡,且只处置那一张:不是这次点击(被新点击取代,含同一任务的+ * 再次点击)、已过期、或点击后又有新活动(新一轮 / 新报错 / 新完成)都不动,新的提醒照常+ * 留着。一次点击只处置一次。走 appBadge 的 explicit 清除:岛卡、Dock 角标与远程回执即刻+ * 收掉,重打点也唤不回这张卡;按 cindy-bots-runtime.md 6.2 的合同,任务记录、失败状态与+ * 错误行都不动 —— 错误尾行派生的侧栏红点在报错被横幅 / 重试真正处理前仍会如实出现。+ */+ consumeIslandEntryAlert(sessionId: string, entryId: string, now = Date.now()): boolean {+ const entry = this.islandEntryAlert;+ if (!entry || entry.sessionId !== sessionId || entry.entryId !== entryId) return false;+ this.islandEntryAlert = null;+ if (entry.until <= now) return false;+ if (readAgentIslandUnreadTerminalStamp(this.state, sessionId) !== entry.stamp) return false;+ clearAppBadgeSessionAttention(sessionId, 'explicit');+ return true;}private dispatchMainWindowCommand(diff --git a/apps/desktop/src/main/agent-island/state.ts b/apps/desktop/src/main/agent-island/state.tsindex 348e94434a..4dff349b1e 100644--- a/apps/desktop/src/main/agent-island/state.ts+++ b/apps/desktop/src/main/agent-island/state.ts@@ -171,6 +171,12 @@ interface AgentIslandSessionState {*/sortActivityAt: number;lastActivityAt: number;+ /**+ * 无碰撞的卡片身份代数(全局单调不复用):只在真正换卡(新一轮 / 新失败 / 新完成)时+ * 推进,记账 / 样式事件不推进 —— 毫秒时间戳同毫秒会撞(review P1),无差别推进又会把+ * 收尾记账当成换卡(review P1 后续)。+ */+ activityGeneration: number;/*** 非 null = 镜像另一台设备(device-link「我控制它」)上运行的任务,生命周期由* {@link syncAgentIslandDeviceSessions} 的输入决定;本机 Maker 事件不会触达它。@@ -236,6 +242,25 @@ export interface AgentIslandRemoteUnreadTerminal {lastActivityAt: number;}+// 卡片身份的无碰撞活动代数:全局单调递增、不复用。不要退回毫秒时间戳 —— 重试在同一+// 毫秒内再落新终态时时间戳会撞上(review P1),旧点击会误处置新提醒。+let agentIslandActivityGeneration = 0;++function nextActivityGeneration(): number {+ return ++agentIslandActivityGeneration;+}++/** 活动时间戳照常推进;卡片身份不动 —— 记账 / 样式事件不得驱逐被点击的卡(review P1)。 */+function touchSessionActivity(session: AgentIslandSessionState, now: number): void {+ session.lastActivityAt = now;+}++/** 新一轮 / 新失败 / 新完成真正换卡时推进身份代数,被点击的旧卡随之失效。 */+function replaceAgentIslandCard(session: AgentIslandSessionState, now: number): void {+ session.lastActivityAt = now;+ session.activityGeneration = nextActivityGeneration();+}+export function createAgentIslandState(): AgentIslandState {return {sessions: new Map(),@@ -511,7 +536,7 @@ export function applyAgentIslandUserPrompt(const line = appendActivityLine(session, 'user', text);if (line) enqueueMessagePreview(session, line, now);session.sortActivityAt = now;- session.lastActivityAt = now;+ replaceAgentIslandCard(session, now);return true;}@@ -600,7 +625,7 @@ export function applyAgentIslandEvent(if (event.type === 'compact_boundary') {if (!foreground || !session.running || session.workingPhase !== 'compacting') return false;session.workingPhase = 'thinking';- session.lastActivityAt = now;+ touchSessionActivity(session, now);return true;}if (event.type === 'thinking') {@@ -608,13 +633,13 @@ export function applyAgentIslandEvent(// public status nor wake the roster/resource subscribers.if (!session.running || session.workingPhase === 'thinking' || session.workingPhase?.startsWith('reviewing-')) return false;session.workingPhase = 'thinking';- session.lastActivityAt = now;+ touchSessionActivity(session, now);return true;}if (event.type !== 'error') {session.reconnectStatus = null;}- session.lastActivityAt = now;+ touchSessionActivity(session, now);if (event.type === 'text') {if (foreground) session.workingPhase = 'replying';@@ -750,7 +775,7 @@ export function applyAgentIslandEvent(: session.detail;session.detailSource = 'interaction';session.completedUntil = null;- session.lastActivityAt = now;+ replaceAgentIslandCard(session, now);return true;}session.permissionRequestId = null;@@ -814,6 +839,8 @@ export function applyAgentIslandEvent(// 真实展示给用户)清除,否则条目会在 errorUntil 过期后被 prune 静默删除。requestAttentionReveal(state, session, now, AGENT_ISLAND_ERROR_REVEAL_DWELL_MS, { forceUnread: true });syncRemoteUnreadTerminal(state, session);+ // 新失败真正换卡:被点击的旧卡随之失效。+ replaceAgentIslandCard(session, now);return true;}@@ -848,7 +875,7 @@ export function applyAgentIslandInteractionRequest(session.pendingPermissionCanAllowForSession.delete(request.requestId);}if (!activateRequest) {- session.lastActivityAt = now;+ touchSessionActivity(session, now);return;}session.phase = 'needs-interaction';@@ -864,7 +891,7 @@ export function applyAgentIslandInteractionRequest(deferActiveTransientReveal(state, 'queued');requestAttentionReveal(state, session, now, AGENT_ISLAND_REVEAL_DWELL_MS);syncVisibleInteractionSuppression(state, now);- session.lastActivityAt = now;+ replaceAgentIslandCard(session, now);}export function applyAgentIslandInteractionDismissed(@@ -897,7 +924,7 @@ function dismissPendingInteraction(if (session.permissionRequestId === requestId) {restorePendingPermissionAction(session);}- session.lastActivityAt = now;+ touchSessionActivity(session, now);if (session.pendingInteractionIds.size > 0) {restorePendingInteractionKind(session);return;@@ -954,6 +981,22 @@ function dismissPendingInteraction(*/export type AgentIslandSessionReadAckResult = 'cleared' | 'noop' | 'not-found' | 'error-immune';+/**+ * 灵动岛上一张未读完成 / 报错卡的身份。点击时记下,导航落地后再比对:新一轮、新的失败+ * 或新的完成(真正换卡)都会改变它,旧点击因此不会处置后来的提醒;失败 turn 的收尾记账+ * 事件保留同一张卡、不改身份。身份用无碰撞的活动代数而非毫秒时间戳,同毫秒内的新终态+ * 也拉得开。+ * 只认本机会话当前展示的未读终态;运行中、等待交互或只剩远程账本时返回 null。+ */+export function readAgentIslandUnreadTerminalStamp(+ state: AgentIslandState,+ sessionId: string,+): string | null {+ const session = state.sessions.get(sessionId);+ if (!session || session.sourceDeviceId !== null || !isUnreadTerminalLedger(session)) return null;+ return `${session.phase}:${session.activityGeneration}`;+}+export function acknowledgeAgentIslandSessionRead(state: AgentIslandState,sessionId: string,@@ -1186,7 +1229,7 @@ function applyDeviceSessionPhase(session.workingPhase = workingPhase;session.detail = input.detail;session.detailSource = input.detail ? 'status' : null;- if (changed) session.lastActivityAt = now;+ if (changed) touchSessionActivity(session, now);return { changed, event: null };}case 'needs-interaction': {@@ -1196,7 +1239,7 @@ function applyDeviceSessionPhase(markSessionRunning(state, session, now);session.pendingInteractionIds.add(DEVICE_SESSION_INTERACTION_ID);session.phase = 'needs-interaction';- session.lastActivityAt = now;+ touchSessionActivity(session, now);if (previous !== null) {deferActiveTransientReveal(state, 'queued');requestAttentionReveal(state, session, now, AGENT_ISLAND_REVEAL_DWELL_MS);@@ -1221,7 +1264,7 @@ function applyDeviceSessionPhase(}clearDeviceSessionInteraction(session);session.running = false;- session.lastActivityAt = now;+ touchSessionActivity(session, now);// 先换掉上一轮的摘要,且必须先于 complete:有摘要可显示时就不再补「完成」占位。session.activityLines = [];mirrorDeviceSessionSummary(session, input.detail);@@ -1240,7 +1283,7 @@ function applyDeviceSessionPhase(session.detail = input.detail;session.detailSource = input.detail ? 'status' : null;session.completedUntil = null;- session.lastActivityAt = now;+ touchSessionActivity(session, now);if (observed) {session.errorUntil = now + AGENT_ISLAND_ERROR_DWELL_MS;requestAttentionReveal(state, session, now, AGENT_ISLAND_ERROR_REVEAL_DWELL_MS, { forceUnread: true });@@ -1690,7 +1733,11 @@ function markSessionRunning(session: AgentIslandSessionState,now: number,): void {- if (!session.running) session.startedAt = now;+ if (!session.running) {+ // 新一轮真正换卡:被点击的旧卡随之失效(记账 / 样式事件不走这条路)。+ replaceAgentIslandCard(session, now);+ session.startedAt = now;+ }session.completionNotification = undefined;session.running = true;session.completedUntil = null;@@ -1721,6 +1768,9 @@ function completeAgentIslandSession(// terminal error belongs to a verified flow that intentionally pairs a done.if (session.phase === 'error' && !session.completionAllowedAfterTerminalError) return;+ // 旧卡被真正的完成替换才换身份;失败 turn 的收尾记账 done / 重复 done 保留同一张+ // 卡,不得驱逐被点击的那张(review P1)。+ if (session.phase !== 'completed') replaceAgentIslandCard(session, now);session.phase = 'completed';session.completionNotification = options.suppressAttention ? 'silent' : undefined;session.interactionKind = undefined;@@ -2514,6 +2564,7 @@ function getOrCreateSession(startedAt: now,sortActivityAt: now,lastActivityAt: now,+ activityGeneration: nextActivityGeneration(),sourceDeviceId: null,};state.sessions.set(meta.sessionId, session);diff --git a/apps/desktop/src/main/deepLink.ts b/apps/desktop/src/main/deepLink.tsindex e359de2b68..5bdc939e8e 100644--- a/apps/desktop/src/main/deepLink.ts+++ b/apps/desktop/src/main/deepLink.ts@@ -73,7 +73,11 @@ export type DeepLinkPayload =| { type: 'shared-task-join'; invitation: string; server: string }/** 供应商分享链接:原样交给 Renderer 的申请弹窗,由主进程命令再解析与核对区域。 */| { type: 'provider-share-join'; link: string }- | { type: 'session'; id: string; messageClientId?: string }+ /**+ * islandEntryId 只由主进程的灵动岛点击写入(URL 解析从不产生它),标识这一次点击,+ * 供 renderer 在导航落地后申请处置被点的那张卡。+ */+ | { type: 'session'; id: string; messageClientId?: string; islandEntryId?: string }| { type: 'project'; workingDir: string }/*** 由 --open-folder argv 触发的 "新建对话 + 预填工作目录"。@@ -410,8 +414,16 @@ export function openMainWindowBillingTopUp(): void {* 主进程内部发起的会话聚焦(workspace 槽 focus:true)。复用 deep link 的* 前台 + renderer dispatch 通道,行为与用户点 cindy://session/<id> 一致。*/-export function openMainWindowSession(sessionId: string, options?: { focus?: boolean }): void {- dispatchDeepLink({ type: 'session', id: sessionId }, options?.focus !== false);+export function openMainWindowSession(+ sessionId: string,+ options?: { focus?: boolean; islandEntryId?: string },+): void {+ dispatchDeepLink(+ options?.islandEntryId+ ? { type: 'session', id: sessionId, islandEntryId: options.islandEntryId }+ : { type: 'session', id: sessionId },+ options?.focus !== false,+ );}/** Sends a typed internal event to the primary renderer without broadcasting to utility windows. */diff --git a/apps/desktop/src/main/localDb/ipc/__tests__/botCanonicalSession.test.ts b/apps/desktop/src/main/localDb/ipc/__tests__/botCanonicalSession.test.tsindex 2c2e4dc53d..6842d9d9ac 100644--- a/apps/desktop/src/main/localDb/ipc/__tests__/botCanonicalSession.test.ts+++ b/apps/desktop/src/main/localDb/ipc/__tests__/botCanonicalSession.test.ts@@ -4212,6 +4212,18 @@ describe('Bot Session task end-to-end runtime', () => {VALUES (?, 'bot-a', ?, 1, 'group', ?, 1)`).run(`${id}-link`, id, route);}+ it('projects the owning group of each hidden group lane so entries can return to that group', async () => {+ await seedPair();+ seedGroupLane('group-lane', 'group:fixture:access:owner:2');+ seedGroupLane('group-plan', 'group:fixture:plan:plan-1');+ const profile = await invoke('local-db:bots:get', 'bot-a') as { sessions: Array<Record<string, unknown>> };+ const byId = new Map(profile.sessions.map((session) => [session.id, session]));+ expect(byId.get('group-lane')).toMatchObject({ kind: 'group', role: 'group', groupId: 'fixture' });+ expect(byId.get('group-plan')).toMatchObject({ kind: 'group', role: 'group', groupId: 'fixture' });+ expect(byId.get('session-1')).toMatchObject({ kind: 'chat', role: 'canonical' });+ expect(byId.get('session-1')).not.toHaveProperty('groupId');+ });+it('starts owner-authorized group work without impersonation and returns cards/results to the owner private chat', async () => {await seedPair(); seedGroupLane();const release = registerGroupToolAuthority('group-lane', { botId: 'bot-a', mode: 'owner', isCurrent: () => true, validate: async () => {} });diff --git a/apps/desktop/src/main/localDb/ipc/bots.ts b/apps/desktop/src/main/localDb/ipc/bots.tsindex d16b3ec2ae..bd99699dd7 100644--- a/apps/desktop/src/main/localDb/ipc/bots.ts+++ b/apps/desktop/src/main/localDb/ipc/bots.ts@@ -107,7 +107,7 @@ import { BOT_DELEGATION_CLIENT_ID } from '../../../shared/botCollaboration.js';import { generateBotCreationDraft, readBotCreationDraft, generateBotCreationAvatar } from '../../maker-ipc/botCreationDraft.js';import { botInvitationProgress, type BotInvitationProgress } from '../../../shared/botInvitation.js';-import { botGroupLaneRouteKey, botGroupPlanRouteKey, chatGroupLaneRouteKey, type ChatLaneAccess } from '../../../shared/botGroupChat.js';+import { botGroupLaneRouteKey, botGroupPlanRouteKey, chatGroupLaneRouteKey, parseBotGroupIdFromRouteKey, type ChatLaneAccess } from '../../../shared/botGroupChat.js';import { queueBotInvitation as enqueueBotInvitation } from '../../maker-ipc/botInvitation.js';import { getMakerIfReady, validateBotCapabilityAdditions } from '../../maker-host/index.js';import type { BotCapabilityUpdate } from '../../maker-ipc/botCapabilityService.js';@@ -912,6 +912,7 @@ async function readProfile(sessions: links.flatMap((link) => {const row = byId.get(link.sessionId);if (!row) return [];+ const groupId = link.role === 'group' ? parseBotGroupIdFromRouteKey(link.routeKey) : null;return [{id: row.id,@@ -927,6 +928,8 @@ async function readProfile(updatedAt: row.updatedAt,status: row.status,role: link.role,+ // 群专线没有自己的页面:通知 / 灵动岛入口要据此回到它所在的群。+ ...(groupId ? { groupId } : {}),profileVersion: link.profileVersion,runtimeSnapshot: runtimeBySession.has(row.id)? (() => {diff --git a/apps/desktop/src/preload/__tests__/deepLinkIslandEntryBridge.test.ts b/apps/desktop/src/preload/__tests__/deepLinkIslandEntryBridge.test.tsnew file mode 100644index 0000000000..46fbdd3f79--- /dev/null+++ b/apps/desktop/src/preload/__tests__/deepLinkIslandEntryBridge.test.ts@@ -0,0 +1,73 @@+import { readFileSync } from 'node:fs';+import ts from 'typescript';+import { afterEach, describe, expect, it, vi } from 'vitest';+import type { BrowserWindow } from 'electron';++import { openMainWindowSession, setDeepLinkMainWindow } from '../../main/deepLink';++vi.mock('electron', () => ({ app: { focus: vi.fn() }, BrowserWindow: class {} }));+vi.mock('../../main/logger', () => ({ createLogger: () => ({ info: vi.fn(), warn: vi.fn(), debug: vi.fn() }) }));++// Execute the production preload `onDeepLinkNavigate` adapter, with its IPC+// subscription injected, so the main → preload → renderer session payload is+// exercised end to end instead of only through the renderer type declaration.+const source = readFileSync(new URL('../preload.ts', import.meta.url), 'utf8');+const start = source.indexOf(' onDeepLinkNavigate: (');+const end = source.indexOf(' // 冷启动时', start);+if (start < 0 || end <= start) throw new Error('onDeepLinkNavigate bridge not found');+const compiled = ts.transpileModule(`const bridge = {${source.slice(start, end)}};`, {+ compilerOptions: { target: ts.ScriptTarget.ES2022 },+}).outputText;++function connect() {+ let listener: ((payload: unknown) => void) | undefined;+ const bridge = new Function('fanOutDeepLinkNavigate', 'isDeepLinkProviderConnectId', `${compiled}; return bridge;`)(+ (callback: (payload: unknown) => void) => {+ listener = callback;+ return () => { listener = undefined; };+ },+ () => false,+ ) as { onDeepLinkNavigate(callback: (payload: unknown) => void): () => void };+ const received: unknown[] = [];+ bridge.onDeepLinkNavigate((payload) => received.push(payload));+ const win = {+ isDestroyed: () => false,+ isMinimized: () => false,+ isVisible: () => true,+ setAlwaysOnTop: vi.fn(),+ moveTop: vi.fn(),+ focus: vi.fn(),+ show: vi.fn(),+ webContents: { isLoading: () => false, send: (_channel: string, payload: unknown) => listener?.(payload) },+ } as unknown as BrowserWindow;+ setDeepLinkMainWindow(win);+ return { received, deliver: (payload: unknown) => listener?.(payload) };+}++afterEach(() => setDeepLinkMainWindow(null));++describe('Agent Island click id across the preload deep-link bridge', () => {+ it('carries the click id main put on a loaded main window session entry', () => {+ const { received } = connect();+ openMainWindowSession('lane-1', { islandEntryId: '42' });+ openMainWindowSession('plain-1');+ expect(received).toEqual([+ { type: 'session', id: 'lane-1', islandEntryId: '42' },+ { type: 'session', id: 'plain-1' },+ ]);+ });++ it('drops a malformed click id but still navigates', () => {+ const { received, deliver } = connect();+ deliver({ type: 'session', id: 's', islandEntryId: 'x'.repeat(33) });+ deliver({ type: 'session', id: 's', islandEntryId: 'abc' });+ deliver({ type: 'session', id: 's', islandEntryId: 7 });+ deliver({ type: 'session', id: 's', messageClientId: 'm-1', islandEntryId: '9' });+ expect(received).toEqual([+ { type: 'session', id: 's' },+ { type: 'session', id: 's' },+ { type: 'session', id: 's' },+ { type: 'session', id: 's', messageClientId: 'm-1', islandEntryId: '9' },+ ]);+ });+});diff --git a/apps/desktop/src/preload/preload.ts b/apps/desktop/src/preload/preload.tsindex 9087ae8fcf..29f4a99d60 100644--- a/apps/desktop/src/preload/preload.ts+++ b/apps/desktop/src/preload/preload.ts@@ -62,6 +62,7 @@ import {} from '../shared/projectOrderSettings';import type { SessionDragPreviewPalette } from '../shared/sessionDragPreview';import {+ AGENT_ISLAND_CONSUME_ENTRY_ALERT_CHANNEL,AGENT_ISLAND_GET_DISPLAY_OPTIONS_CHANNEL,AGENT_ISLAND_PREVIEW_SOUND_CHANNEL,AGENT_ISLAND_SELECT_SOUND_FILE_CHANNEL,@@ -2006,6 +2007,9 @@ contextBridge.exposeInMainWorld('electronAPI', {ipcRenderer.invoke(AGENT_ISLAND_SET_VISIBLE_SESSION_CHANNEL, sessionId),setEnabled: (enabled: boolean): Promise<{ ok: true }> =>ipcRenderer.invoke(AGENT_ISLAND_SET_ENABLED_CHANNEL, enabled),+ /** 灵动岛点击的目标地址已提交且没有处置控件:处置这次点击(islandEntryId)的那张卡。 */+ consumeEntryAlert: (sessionId: string, islandEntryId: string): Promise<{ ok: true; consumed: boolean }> =>+ ipcRenderer.invoke(AGENT_ISLAND_CONSUME_ENTRY_ALERT_CHANNEL, sessionId, islandEntryId),/** 按侧栏「任务范围」筛过的远程设备任务活动(灵动岛 / 桌面通知用)。 */setRemoteSessions: (sessions: AgentIslandRemoteSessionInput[]): Promise<{ ok: true }> =>ipcRenderer.invoke(AGENT_ISLAND_SET_REMOTE_SESSIONS_CHANNEL, sessions),@@ -3801,7 +3805,8 @@ contextBridge.exposeInMainWorld('electronAPI', {// cindy://(+ 历史 xdt-maker://)deep link / --open-folder 推送 — main 端解析后通过此 channel 通知 renderer。// payload 形态在 vite-env.d.ts 上声明:- // - { type: 'session', id, messageClientId? } : 跳路由到指定 session(可带消息锚点)+ // - { type: 'session', id, messageClientId?, islandEntryId? } : 跳路由到指定 session(可带消息锚点;+ // islandEntryId 只由主进程的灵动岛点击写入,供目标地址提交后处置被点的那张卡)// - { type: 'project', workingDir } : 聚焦已有 project 节点// - { type: 'new-session', workingDir }: 新建对话且预填 workingDir (右键 "通过 Cindy 打开")// - { type: 'share-import', filePath } : 打开 .cshare/.xdtshare 会话导入向导@@ -3811,7 +3816,7 @@ contextBridge.exposeInMainWorld('electronAPI', {onDeepLinkNavigate: (callback: (payload:- | { type: 'session'; id: string; messageClientId?: string }+ | { type: 'session'; id: string; messageClientId?: string; islandEntryId?: string }| { type: 'project'; workingDir: string }| { type: 'new-session'; workingDir: string }| { type: 'share-import'; filePath: string }@@ -3838,6 +3843,7 @@ contextBridge.exposeInMainWorld('electronAPI', {tab?: unknown;connect?: unknown;messageClientId?: unknown;+ islandEntryId?: unknown;};if (p.type === 'session' && typeof p.id === 'string' && p.id.length > 0) {callback({@@ -3846,6 +3852,10 @@ contextBridge.exposeInMainWorld('electronAPI', {...(typeof p.messageClientId === 'string' && p.messageClientId.length > 0? { messageClientId: p.messageClientId }: {}),+ // 主进程的点击编号是递增数字串;不合格时只丢这个字段,照常导航但不处置提醒。+ ...(typeof p.islandEntryId === 'string' && /^[0-9]{1,32}$/.test(p.islandEntryId)+ ? { islandEntryId: p.islandEntryId }+ : {}),});} else if (p.type === 'settings' && (p.tab === 'voice-input' || p.tab === 'providers')) {// connect 只对 providers 页有意义;主进程已做 id 白名单,这里按纵深防御@@ -3904,7 +3914,7 @@ contextBridge.exposeInMainWorld('electronAPI', {// MainLayout mount 和供应商导入唤醒事件共用此入口,take 一次清空。// 详见 main/deepLink.ts 的 pending buffer 段。takePendingDeepLink: (): Promise<- | { type: 'session'; id: string; messageClientId?: string }+ | { type: 'session'; id: string; messageClientId?: string; islandEntryId?: string }| { type: 'project'; workingDir: string }| { type: 'new-session'; workingDir: string }| { type: 'share-import'; filePath: string }diff --git a/apps/desktop/src/renderer/components/layout/MainLayout.tsx b/apps/desktop/src/renderer/components/layout/MainLayout.tsxindex 1d083b9d3c..cc7f2b2173 100644--- a/apps/desktop/src/renderer/components/layout/MainLayout.tsx+++ b/apps/desktop/src/renderer/components/layout/MainLayout.tsx@@ -107,6 +107,8 @@ import { makeGenericNewMakerRouteState } from '@/features/cc-agent/lib/genericNeimport { resolveSessionRoute } from '@/lib/orcaSessionIdentity';import { ensureBotProfilesLoaded, getBotProfiles } from '@/features/bots/botStore';import { createSessionEntryNavigator, resolveBotRouteForSessionEntry } from '@/features/bots/botSessionOwners';+import { useSessionEntryLocationCommits } from '@/features/bots/useSessionEntryLocationCommits';+import { islandEntryRouteState, requestIslandEntryAlertDisposal } from '@/features/bots/islandEntryAlert';import { requestProviderShareJoin } from '@/features/provider-share/joinIntent';import { ProviderShareGlobalHost } from '@/features/provider-share/ProviderShareGlobalHost';import { remoteProjectsStore } from '@/features/device-link/remoteProjectsStore';@@ -554,13 +556,26 @@ export function MainLayout() {readProfiles: getBotProfiles,loadProfiles: ensureBotProfilesLoaded,}),- openBotRoute: (route) => {- if (currentPathRef.current !== route) sessionEntryDepsRef.current.navigate(route);+ openBotRoute: (route, islandEntryId) => {+ // 只读历史由自己的归属门禁在显示后处置被点的卡:点击编号随路由状态交过去,已在该页也要重新交一次。+ if (islandEntryId) {+ sessionEntryDepsRef.current.navigate(route, {+ replace: currentPathRef.current === route,+ state: islandEntryRouteState(islandEntryId),+ });+ } else if (currentPathRef.current !== route) {+ sessionEntryDepsRef.current.navigate(route);+ }},+ // 群专线 / 不可用的委派任务没有可处置报错的横幅:目标地址提交后请 main+ // 处置这次点击的那张卡(main 只认最近一次点击与当时的卡片身份,见 BotSessionEntryTarget)。+ consumeAlert: requestIslandEntryAlertDisposal,openOrdinary: (sessionId, messageClientId, isLatest) =>sessionEntryDepsRef.current.navigateToOrdinarySession(sessionId, messageClientId, isLatest),}));navigateToSessionRef.current = navigateToSession;+ // 已提交的地址交给入口导航器:灵动岛卡片的处置等到目标地址真正提交后才发。+ useSessionEntryLocationCommits(navigateToSession);useEffect(() => {const unsubscribe = window.electronAPI.onNotificationFocusSession((sessionId) => {if (typeof sessionId !== 'string' || !sessionId) return;@@ -633,7 +648,7 @@ export function MainLayout() {const handleDeepLinkPayload = useCallback((payload:- | { type: 'session'; id: string; messageClientId?: string }+ | { type: 'session'; id: string; messageClientId?: string; islandEntryId?: string }| { type: 'project'; workingDir: string }| { type: 'new-session'; workingDir: string }| { type: 'share-import'; filePath: string }@@ -661,7 +676,7 @@ export function MainLayout() {return;}if (payload.type === 'session') {- navigateToSession(payload.id, payload.messageClientId);+ navigateToSession(payload.id, payload.messageClientId, payload.islandEntryId);return;}if (payload.type === 'project') {diff --git a/apps/desktop/src/renderer/features/bots/BotHistorySessionView.tsx b/apps/desktop/src/renderer/features/bots/BotHistorySessionView.tsxindex 38ab7b5d38..981b9f7a13 100644--- a/apps/desktop/src/renderer/features/bots/BotHistorySessionView.tsx+++ b/apps/desktop/src/renderer/features/bots/BotHistorySessionView.tsx@@ -1,9 +1,10 @@import { useEffect, useState } from 'react';-import { Navigate, useParams } from 'react-router-dom';+import { Navigate, useLocation, useParams } from 'react-router-dom';import { useTranslation } from 'react-i18next';import { CCAgentSessionView } from '@/features/cc-agent/CCAgentSessionView';import type { BotChatIdentity } from './BotSessionContentHeader';+import { readIslandEntryRouteState, requestIslandEntryAlertDisposal } from './islandEntryAlert';import { useBotIslandVisibleSession } from './useBotIslandVisibleSession';function readBotChatIdentity(bot: unknown, botId: string): BotChatIdentity | null {@@ -28,6 +29,11 @@ function BotHistorySessionGateView() {const { botId, sessionId } = useParams();const [allowed, setAllowed] = useState<boolean | null>(null);useBotIslandVisibleSession(allowed === true ? sessionId ?? null : null);+ // 灵动岛点进来的那张卡,只在本门禁确认并显示了这段历史后才处置;被重定向走则保留。+ const islandEntryId = readIslandEntryRouteState(useLocation().state);+ useEffect(() => {+ if (allowed === true && sessionId && islandEntryId) requestIslandEntryAlertDisposal(sessionId, islandEntryId);+ }, [allowed, sessionId, islandEntryId]);/*** 归档的对话里,那个伙伴仍然是那个伙伴:气泡挂 TA 的头像,顶栏是 TA 的 lockup。* 这个视图本来就已经查过 `bots.history(botId)` 确认归属,顺手把身份取回来即可diff --git a/apps/desktop/src/renderer/features/bots/__tests__/botIslandVisibility.test.tsx b/apps/desktop/src/renderer/features/bots/__tests__/botIslandVisibility.test.tsxindex 78982b597c..77d0500f3f 100644--- a/apps/desktop/src/renderer/features/bots/__tests__/botIslandVisibility.test.tsx+++ b/apps/desktop/src/renderer/features/bots/__tests__/botIslandVisibility.test.tsx@@ -4,10 +4,12 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';const mocks = vi.hoisted(() => ({params: { botId: 'bot-a', sessionId: 'chat-a' },+ location: { state: null as unknown },supported: true,}));vi.mock('react-router-dom', () => ({useParams: () => mocks.params,+ useLocation: () => mocks.location,useNavigate: () => vi.fn(),Navigate: () => null,}));@@ -24,6 +26,7 @@ import { BotSessionView } from '../BotSessionView';import { BotHistorySessionView } from '../BotHistorySessionView';const report = vi.fn();+const consumeEntryAlert = vi.fn(async () => ({ ok: true as const, consumed: true }));const get = vi.fn();const history = vi.fn();const profile = {@@ -34,12 +37,13 @@ const profile = {beforeEach(() => {vi.clearAllMocks();mocks.params = { botId: 'bot-a', sessionId: 'chat-a' };+ mocks.location = { state: null };mocks.supported = true;vi.spyOn(document, 'hasFocus').mockReturnValue(true);get.mockResolvedValue(profile);history.mockResolvedValue([{ id: 'chat-a' }]);Object.defineProperty(window, 'electronAPI', { configurable: true, value: {- agentIsland: { setVisibleSession: report },+ agentIsland: { setVisibleSession: report, consumeEntryAlert },localDb: { bots: { get, history, list: vi.fn(async () => []) } },} });});@@ -119,3 +123,77 @@ describe.each([expect(report).not.toHaveBeenCalled();});});++// 不可用页自己从不处置提醒:只有灵动岛入口导航器在目标地址提交后、带着那次点击的编号+// 才会请 main 处置(见 botSessionOwners)。直接打开地址、被新点击取代后再访问都不消费。+describe('unavailable Bot task page never disposes island alerts by itself', () => {+ it('shows the unavailable state without asking main to dispose anything', async () => {+ mocks.params = { botId: 'bot-a', sessionId: 'delegated-a' };+ get.mockResolvedValue({+ ...profile,+ sessions: [...profile.sessions, { id: 'delegated-a', kind: 'worker', role: 'delegation', status: 'active' }],+ });+ const view = render(<BotSessionView />);+ await waitFor(() => expect(view.getByText('bots.sessionUnavailableTitle')).toBeTruthy());+ view.rerender(<BotSessionView />);+ await act(async () => {});+ expect(consumeEntryAlert).not.toHaveBeenCalled();+ expect(report.mock.calls.every(([id]) => id === null)).toBe(true);+ });++ it('keeps the alert for a live chat and for a retryable load failure', async () => {+ const live = render(<BotSessionView />);+ await waitFor(() => expect(live.getByTestId('chat')).toBeTruthy());+ live.unmount();+ get.mockRejectedValue(new Error('db busy'));+ const failed = render(<BotSessionView />);+ await waitFor(() => expect(failed.getByText('bots.sessionLoadFailedTitle')).toBeTruthy());+ expect(consumeEntryAlert).not.toHaveBeenCalled();+ });+});++// 只读历史的提醒由它自己的归属门禁处置:灵动岛入口把点击编号放进路由状态,门禁确认并显示+// 这段历史后才请 main 处置;门禁不放行(会被重定向走)或没有点击编号都不处置。+describe('history ownership gate disposes the clicked island card', () => {+ beforeEach(() => {+ mocks.params = { botId: 'bot-a', sessionId: 'old-a' };+ mocks.location = { state: { islandEntryId: '42' } };+ });++ it('disposes only once its gate has shown the transcript', async () => {+ let resolveGate!: (rows: unknown[]) => void;+ history.mockReturnValueOnce(new Promise((resolve) => { resolveGate = resolve; }));+ const view = render(<BotHistorySessionView />);+ await act(async () => {});+ expect(consumeEntryAlert).not.toHaveBeenCalled();+ await act(async () => resolveGate([{ id: 'old-a' }]));+ expect(view.getByTestId('chat')).toBeTruthy();+ expect(consumeEntryAlert).toHaveBeenCalledExactlyOnceWith('old-a', '42');+ // Re-rendering the same entry does not ask again; a new click on the open page does.+ view.rerender(<BotHistorySessionView />);+ mocks.location = { state: { islandEntryId: '43' } };+ view.rerender(<BotHistorySessionView />);+ expect(consumeEntryAlert).toHaveBeenLastCalledWith('old-a', '43');+ expect(consumeEntryAlert).toHaveBeenCalledTimes(2);+ });++ it('keeps the card when its gate redirects away (record gone or read failed)', async () => {+ history.mockResolvedValueOnce([{ id: 'other' }]);+ const gone = render(<BotHistorySessionView />);+ await act(async () => {});+ expect(gone.queryByTestId('chat')).toBeNull();+ gone.unmount();+ history.mockRejectedValueOnce(new Error('db busy'));+ render(<BotHistorySessionView />);+ await act(async () => {});+ expect(consumeEntryAlert).not.toHaveBeenCalled();+ });++ it('never disposes without an island click id', async () => {+ mocks.location = { state: null };+ history.mockResolvedValueOnce([{ id: 'old-a' }]);+ const view = render(<BotHistorySessionView />);+ await waitFor(() => expect(view.getByTestId('chat')).toBeTruthy());+ expect(consumeEntryAlert).not.toHaveBeenCalled();+ });+});diff --git a/apps/desktop/src/renderer/features/bots/__tests__/botSessionOwners.test.ts b/apps/desktop/src/renderer/features/bots/__tests__/botSessionOwners.test.tsindex 806f437787..d9da446c2b 100644--- a/apps/desktop/src/renderer/features/bots/__tests__/botSessionOwners.test.ts+++ b/apps/desktop/src/renderer/features/bots/__tests__/botSessionOwners.test.ts@@ -18,6 +18,7 @@ import {createSessionEntryNavigator,findBotProfileForSession,resolveBotRouteForSessionEntry,+ type BotSessionEntryTarget,} from '../botSessionOwners';import type { BotProfile } from '../botStore';@@ -80,12 +81,53 @@ describe('伙伴归属表', () => {it('通知点击把主任务送回伙伴页,子任务保留自己的任务地址', () => {const bot = profile({ id: 'bot/a' });- expect(botRouteForOwnedSession([bot], 's-main')).toBe('/bots/bot%2Fa');- expect(botRouteForOwnedSession([bot], 's-telegram')).toBe(- '/bots/bot%2Fa/session/s-telegram',- );+ expect(botRouteForOwnedSession([bot], 's-main')).toEqual({ route: '/bots/bot%2Fa', consumesAlert: false });+ expect(botRouteForOwnedSession([bot], 's-telegram')).toEqual({+ route: '/bots/bot%2Fa/session/s-telegram',+ consumesAlert: false,+ });expect(botRouteForOwnedSession([bot], 'not-owned')).toBeNull();});++ // 伙伴任务页只挂活的主对话;其它角色送过去只会落到「这个伙伴任务已不可用」,+ // 那里没有能处置报错的横幅,灵动岛上的报错卡就永远消不掉。+ it('历史任务走只读历史路由,由历史页自己的归属门禁处置它的提醒', () => {+ expect(botRouteForOwnedSession([profile()], 's-old')).toEqual({+ route: '/bots/bot-a/history/s-old',+ consumesAlert: false,+ gateConsumesAlert: true,+ });+ });++ // 委派执行等非对话角色仍走原伙伴任务地址(路由不在本次改动范围),那里只会是+ // 「这个伙伴任务已不可用」;该页已打开时再点卡片不会重挂页面,所以入口自己就要处置。+ it('委派执行任务保留原地址,入口按不可用目标处置被点的卡', () => {+ const bot = profile({+ sessions: [+ { id: 's-main', role: 'canonical', kind: 'chat' },+ { id: 's-delegated', role: 'delegation', kind: 'worker' },+ ] as unknown as BotProfile['sessions'],+ });+ expect(botRouteForOwnedSession([bot], 's-delegated')).toEqual({+ route: '/bots/bot-a/session/s-delegated',+ consumesAlert: true,+ });+ });++ it('群专线回到它所在的群,点击即处置;缺群 id 的旧投影回伙伴主页', () => {+ const bot = profile({+ sessions: [+ { id: 's-main', role: 'canonical', kind: 'chat' },+ { id: 's-lane', role: 'group', kind: 'group', groupId: 'g/1' },+ { id: 's-plan', role: 'group', kind: 'group', groupId: 'g-2' },+ { id: 's-legacy-lane', role: 'group', kind: 'group' },+ ] as unknown as BotProfile['sessions'],+ });+ expect(botRouteForOwnedSession([bot], 's-lane')).toEqual({ route: '/bots/groups/g%2F1', consumesAlert: true });+ expect(botRouteForOwnedSession([bot], 's-plan')).toEqual({ route: '/bots/groups/g-2', consumesAlert: true });+ expect(botRouteForOwnedSession([bot], 's-legacy-lane')).toEqual({ route: '/bots/bot-a', consumesAlert: true });+ });+});describe('通知入口在伙伴投影未加载时的路由', () => {@@ -105,13 +147,20 @@ describe('通知入口在伙伴投影未加载时的路由', () => {it('投影已含该任务时直接回伙伴页,不重载', async () => {const { deps: d, loadProfiles } = deps({ current: [profile()] });- await expect(resolveBotRouteForSessionEntry('s-main', d)).resolves.toBe('/bots/bot-a');+ await expect(resolveBotRouteForSessionEntry('s-main', d)).resolves.toEqual({+ route: '/bots/bot-a',+ consumesAlert: false,+ });expect(loadProfiles).not.toHaveBeenCalled();});it('启动后从未进过伙伴页时先加载投影,再回伙伴页', async () => {const { deps: d, loadProfiles } = deps({ loaded: [profile()] });- await expect(resolveBotRouteForSessionEntry('s-old', d)).resolves.toBe('/bots/bot-a/session/s-old');+ await expect(resolveBotRouteForSessionEntry('s-old', d)).resolves.toEqual({+ route: '/bots/bot-a/history/s-old',+ consumesAlert: false,+ gateConsumesAlert: true,+ });expect(loadProfiles).toHaveBeenCalledWith(true);});@@ -126,9 +175,10 @@ describe('通知入口在伙伴投影未加载时的路由', () => {] as unknown as BotProfile['sessions'],});const { deps: d, loadProfiles } = deps({ current: [stale], loaded: [stale, delegated] });- await expect(resolveBotRouteForSessionEntry('s-delegated', d)).resolves.toBe(- '/bots/bot-b/session/s-delegated',- );+ await expect(resolveBotRouteForSessionEntry('s-delegated', d)).resolves.toEqual({+ route: '/bots/bot-b/session/s-delegated',+ consumesAlert: true,+ });expect(loadProfiles).toHaveBeenCalledWith(true);});@@ -139,12 +189,14 @@ describe('通知入口在伙伴投影未加载时的路由', () => {});it('连续点击时,先点的慢查询不会覆盖后点的导航', async () => {- const pending = new Map<string, (route: string | null) => void>();+ const pending = new Map<string, (target: BotSessionEntryTarget | null) => void>();const openBotRoute = vi.fn();const openOrdinary = vi.fn();+ const consumeAlert = vi.fn();const open = createSessionEntryNavigator({resolveBotRoute: (sessionId) => new Promise((resolve) => pending.set(sessionId, resolve)),openBotRoute,+ consumeAlert,openOrdinary,});open('first');@@ -152,9 +204,11 @@ describe('通知入口在伙伴投影未加载时的路由', () => {pending.get('second')!(null);await Promise.resolve();expect(openOrdinary).toHaveBeenCalledWith('second', 'message-1', expect.any(Function));- pending.get('first')!('/bots/bot-a');+ // A superseded click neither navigates nor disposes its Session's alert.+ pending.get('first')!({ route: '/bots/groups/g-1', consumesAlert: true });await Promise.resolve();expect(openBotRoute).not.toHaveBeenCalled();+ expect(consumeAlert).not.toHaveBeenCalled();// The ordinary path's own late async route checks the same latest gate.const isLatest = openOrdinary.mock.calls[0]![2] as () => boolean;expect(isLatest()).toBe(true);@@ -162,6 +216,167 @@ describe('通知入口在伙伴投影未加载时的路由', () => {expect(isLatest()).toBe(false);});+ describe('灵动岛点击的处置等目标地址提交后才发', () => {+ const targets: Record<string, BotSessionEntryTarget> = {+ 's-lane': { route: '/bots/groups/g-1', consumesAlert: true },+ 's-delegated': { route: '/bots/bot-a/session/s-delegated', consumesAlert: true },+ 's-main': { route: '/bots/bot-a', consumesAlert: false },+ 's-old': { route: '/bots/bot-a/history/s-old', consumesAlert: false, gateConsumesAlert: true },+ };+ function setup(over: { openBotRoute?: (route: string, islandEntryId?: string) => void } = {}) {+ const openBotRoute = vi.fn(over.openBotRoute ?? (() => undefined));+ const consumeAlert = vi.fn();+ const open = createSessionEntryNavigator({+ resolveBotRoute: async (sessionId) => targets[sessionId] ?? null,+ openBotRoute,+ consumeAlert,+ openOrdinary: vi.fn(),+ });+ return { open, openBotRoute, consumeAlert };+ }+ const settle = async () => {+ await Promise.resolve();+ await Promise.resolve();+ };++ it('navigate 返回不算落地:目标地址提交后才处置这次点击', async () => {+ const { open, openBotRoute, consumeAlert } = setup();+ open.locationCommitted('/cc-agent/new');+ open('s-lane', undefined, 'entry-1');+ await settle();+ expect(openBotRoute).toHaveBeenCalledWith('/bots/groups/g-1', undefined);+ expect(consumeAlert).not.toHaveBeenCalled();+ open.locationCommitted('/bots/groups/g-1');+ expect(consumeAlert).toHaveBeenCalledTimes(1);+ expect(consumeAlert).toHaveBeenCalledWith('s-lane', 'entry-1');+ // A later commit (e.g. coming back to the group) never re-sends it.+ open.locationCommitted('/cc-agent/new');+ open.locationCommitted('/bots/groups/g-1');+ expect(consumeAlert).toHaveBeenCalledTimes(1);+ });++ it('迟迟未提交、被重定向或改去别处时不处置', async () => {+ const { open, consumeAlert } = setup();+ open.locationCommitted('/cc-agent/new');+ open('s-lane', undefined, 'entry-1');+ await settle();+ // Delayed: nothing committed yet, nothing sent.+ expect(consumeAlert).not.toHaveBeenCalled();+ // The next commit is somewhere else: this click is done without disposal.+ open.locationCommitted('/bots/bot-a');+ open.locationCommitted('/bots/groups/g-1');+ expect(consumeAlert).not.toHaveBeenCalled();+ });++ it('落地前被新的入口取代时,旧点击即使随后提交到它的目标也不处置', async () => {+ const { open, consumeAlert } = setup();+ open.locationCommitted('/cc-agent/new');+ open('s-lane', undefined, 'entry-1');+ await settle();+ open('s-main');+ open.locationCommitted('/bots/groups/g-1');+ await settle();+ open.locationCommitted('/bots/bot-a');+ expect(consumeAlert).not.toHaveBeenCalled();+ });++ it('历史目标把点击编号交给历史页的归属门禁,导航器自己不处置', async () => {+ const { open, openBotRoute, consumeAlert } = setup();+ open.locationCommitted('/cc-agent/new');+ open('s-old', undefined, 'entry-6');+ await settle();+ expect(openBotRoute).toHaveBeenLastCalledWith('/bots/bot-a/history/s-old', 'entry-6');+ open.locationCommitted('/bots/bot-a/history/s-old');+ // Already open: the click id is handed over again rather than consumed here.+ open('s-old', undefined, 'entry-7');+ await settle();+ expect(openBotRoute).toHaveBeenLastCalledWith('/bots/bot-a/history/s-old', 'entry-7');+ // Entries without a click id, and other targets, hand nothing over.+ open('s-old');+ await settle();+ expect(openBotRoute).toHaveBeenLastCalledWith('/bots/bot-a/history/s-old', undefined);+ open('s-lane', undefined, 'entry-8');+ await settle();+ expect(openBotRoute).toHaveBeenLastCalledWith('/bots/groups/g-1', undefined);+ expect(consumeAlert).not.toHaveBeenCalled();+ });++ it('目标本已打开时 navigate 不会再提交,直接处置这次点击', async () => {+ const { open, consumeAlert } = setup();+ open.locationCommitted('/bots/bot-a/session/s-delegated');+ open('s-delegated', undefined, 'entry-2');+ await settle();+ expect(consumeAlert).toHaveBeenCalledWith('s-delegated', 'entry-2');+ });++ it('没有灵动岛点击编号的入口(系统通知、深链)和活的主对话都不处置', async () => {+ const { open, consumeAlert } = setup();+ open.locationCommitted('/cc-agent/new');+ open('s-lane');+ await settle();+ open.locationCommitted('/bots/groups/g-1');+ open('s-main', undefined, 'entry-3');+ await settle();+ open.locationCommitted('/bots/bot-a');+ expect(consumeAlert).not.toHaveBeenCalled();+ });++ it('解析尚未完成时地址已提交(改去别处或自己打开了目标):照常导航但不代为处置', async () => {+ let resolveTarget!: (target: BotSessionEntryTarget | null) => void;+ const openBotRoute = vi.fn();+ const consumeAlert = vi.fn();+ const open = createSessionEntryNavigator({+ resolveBotRoute: () => new Promise((resolve) => { resolveTarget = resolve; }),+ openBotRoute,+ consumeAlert,+ openOrdinary: vi.fn(),+ });+ open.locationCommitted('/cc-agent/new');+ // The user moves elsewhere while the Bot projection is still loading.+ open('s-lane', undefined, 'entry-5');+ open.locationCommitted('/elsewhere');+ resolveTarget(targets['s-lane']!);+ await settle();+ expect(openBotRoute).toHaveBeenCalledWith('/bots/groups/g-1', undefined);+ open.locationCommitted('/bots/groups/g-1');+ expect(consumeAlert).not.toHaveBeenCalled();++ // The user opens the target address themselves before the lookup returns.+ open('s-lane', undefined, 'entry-6');+ open.locationCommitted('/cc-agent/new');+ open.locationCommitted('/bots/groups/g-1');+ resolveTarget(targets['s-lane']!);+ await settle();+ open.locationCommitted('/bots/groups/g-1');+ expect(consumeAlert).not.toHaveBeenCalled();++ // A history target does not get the click id handed to its gate either.+ open('s-old', undefined, 'entry-9');+ open.locationCommitted('/elsewhere');+ resolveTarget(targets['s-old']!);+ await settle();+ expect(openBotRoute).toHaveBeenLastCalledWith('/bots/bot-a/history/s-old', undefined);+ });++ it('导航抛错时丢弃待处置,之后到达同一地址也不处置', async () => {+ const failures: unknown[] = [];+ const onRejection = (reason: unknown) => failures.push(reason);+ process.on('unhandledRejection', onRejection);+ try {+ const { open, consumeAlert } = setup({ openBotRoute: () => { throw new Error('blocked'); } });+ open.locationCommitted('/cc-agent/new');+ open('s-lane', undefined, 'entry-4');+ await settle();+ await new Promise((resolve) => setTimeout(resolve, 0));+ open.locationCommitted('/bots/groups/g-1');+ expect(consumeAlert).not.toHaveBeenCalled();+ } finally {+ process.off('unhandledRejection', onRejection);+ }+ expect(failures).toHaveLength(1);+ });+ });+it('加载投影失败时退回普通任务路由,不吞掉这次点击', async () => {const d = {readProfiles: () => [],diff --git a/apps/desktop/src/renderer/features/bots/__tests__/botSessionPresentation.test.tsx b/apps/desktop/src/renderer/features/bots/__tests__/botSessionPresentation.test.tsxindex b1b0b6453a..b6e7cedb22 100644--- a/apps/desktop/src/renderer/features/bots/__tests__/botSessionPresentation.test.tsx+++ b/apps/desktop/src/renderer/features/bots/__tests__/botSessionPresentation.test.tsx@@ -22,6 +22,7 @@ vi.mock('../botStore', async () => {});vi.mock('react-router-dom', () => ({useParams: () => h.params,+ useLocation: () => ({ state: null }),useNavigate: () => vi.fn(),Navigate: () => <div>unavailable</div>,}));diff --git a/apps/desktop/src/renderer/features/bots/__tests__/sessionEntryLocationCommits.test.tsx b/apps/desktop/src/renderer/features/bots/__tests__/sessionEntryLocationCommits.test.tsxnew file mode 100644index 0000000000..a2e770a028--- /dev/null+++ b/apps/desktop/src/renderer/features/bots/__tests__/sessionEntryLocationCommits.test.tsx@@ -0,0 +1,152 @@+// @vitest-environment jsdom+/**+ * 灵动岛卡片的处置等到 React Router 真正提交目标地址后才发。这里用真实的内存路由+ * (含延迟加载的目标)驱动入口导航器,与 MainLayout 用同一个上报 hook。+ */+import { transferableAbortController } from 'node:util';+import { act, cleanup, render, screen } from '@testing-library/react';+import { useState } from 'react';+import { Outlet, RouterProvider, createMemoryRouter, useNavigate } from 'react-router-dom';+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';++import { createSessionEntryNavigator, type BotSessionEntryTarget, type SessionEntryNavigator } from '../botSessionOwners';+import { useSessionEntryLocationCommits } from '../useSessionEntryLocationCommits';++const targets: Record<string, BotSessionEntryTarget> = {+ lane: { route: '/bots/groups/g-1', consumesAlert: true },+ slow: { route: '/bots/groups/slow', consumesAlert: true },+};+/** Sessions whose route lookup waits for releaseLookup (e.g. Bot profiles still loading). */+const slowLookups = new Set(['lane-slow-lookup']);++const routers: Array<ReturnType<typeof createMemoryRouter>> = [];++function setup() {+ const consumeAlert = vi.fn<(sessionId: string, islandEntryId: string) => void>();+ const pathsAtConsume: string[] = [];+ let navigator!: SessionEntryNavigator;+ let releaseSlow!: () => void;+ const slowGate = new Promise<null>((resolve) => { releaseSlow = () => resolve(null); });+ let releaseLookup!: () => void;+ const lookupGate = new Promise<void>((resolve) => { releaseLookup = resolve; });++ function Shell() {+ const navigate = useNavigate();+ const [entryNavigator] = useState(() => createSessionEntryNavigator({+ resolveBotRoute: async (sessionId) => {+ if (slowLookups.has(sessionId)) {+ await lookupGate;+ return targets.lane!;+ }+ return targets[sessionId] ?? null;+ },+ openBotRoute: (route) => { void navigate(route); },+ consumeAlert: (sessionId, islandEntryId) => {+ pathsAtConsume.push(router.state.location.pathname);+ consumeAlert(sessionId, islandEntryId);+ },+ openOrdinary: vi.fn(),+ }));+ navigator = entryNavigator;+ useSessionEntryLocationCommits(entryNavigator);+ return <Outlet />;+ }++ const router = createMemoryRouter([+ {+ element: <Shell />,+ children: [+ { path: '/cc-agent/new', element: <p>new task</p> },+ { path: '/bots/groups/g-1', element: <p>group page</p> },+ { path: '/bots/groups/slow', loader: () => slowGate, element: <p>slow group page</p> },+ { path: '/elsewhere', element: <p>elsewhere</p> },+ ],+ },+ ], { initialEntries: ['/cc-agent/new'] });+ routers.push(router);+ render(<RouterProvider router={router} />);+ return { router, consumeAlert, pathsAtConsume, open: () => navigator, releaseSlow, releaseLookup };+}++const flush = () => act(async () => {+ await new Promise((resolve) => setTimeout(resolve, 0));+});++// React Router's Node-native Request requires a matching native AbortSignal (jsdom's+// does not satisfy it on newer Node, e.g. 25.x).+const nativeAbortController = transferableAbortController();+beforeEach(() => {+ vi.stubGlobal('AbortController', nativeAbortController.constructor);+ vi.stubGlobal('AbortSignal', nativeAbortController.signal.constructor);+});+afterEach(() => {+ cleanup();+ // Abort pending navigations / loaders while the native signal globals are still in place.+ for (const router of routers.splice(0)) router.dispose();+ vi.unstubAllGlobals();+});++describe('island card disposal waits for the router to commit the target', () => {+ it('disposes once the target location is committed, never before', async () => {+ const { router, consumeAlert, pathsAtConsume, open } = setup();+ await screen.findByText('new task');+ await act(async () => open()('lane', undefined, 'entry-1'));+ await flush();+ expect(await screen.findByText('group page')).toBeTruthy();+ expect(consumeAlert).toHaveBeenCalledExactlyOnceWith('lane', 'entry-1');+ expect(pathsAtConsume).toEqual(['/bots/groups/g-1']);+ expect(router.state.location.pathname).toBe('/bots/groups/g-1');+ });++ it('a delayed target that is superseded before it commits is never disposed', async () => {+ const { router, consumeAlert, open, releaseSlow } = setup();+ await screen.findByText('new task');+ await act(async () => open()('slow', undefined, 'entry-2'));+ await flush();+ // Still loading: the location has not been committed yet.+ expect(router.state.location.pathname).toBe('/cc-agent/new');+ expect(consumeAlert).not.toHaveBeenCalled();+ await act(async () => { void router.navigate('/elsewhere'); });+ await screen.findByText('elsewhere');+ releaseSlow();+ await flush();+ expect(consumeAlert).not.toHaveBeenCalled();+ });++ it('a delayed target that does commit is disposed only then', async () => {+ const { router, consumeAlert, open, releaseSlow } = setup();+ await screen.findByText('new task');+ await act(async () => open()('slow', undefined, 'entry-3'));+ await flush();+ expect(consumeAlert).not.toHaveBeenCalled();+ releaseSlow();+ await screen.findByText('slow group page');+ await flush();+ expect(router.state.location.pathname).toBe('/bots/groups/slow');+ expect(consumeAlert).toHaveBeenCalledExactlyOnceWith('slow', 'entry-3');+ });++ it('a commit while the lookup is still resolving forfeits disposal but keeps navigation', async () => {+ const { router, consumeAlert, open, releaseLookup } = setup();+ await screen.findByText('new task');+ await act(async () => open()('lane-slow-lookup', undefined, 'entry-5'));+ await act(async () => { void router.navigate('/elsewhere'); });+ await screen.findByText('elsewhere');+ releaseLookup();+ await screen.findByText('group page');+ await flush();+ expect(router.state.location.pathname).toBe('/bots/groups/g-1');+ expect(consumeAlert).not.toHaveBeenCalled();+ });++ it('a target that is already open is disposed without another navigation', async () => {+ const { router, consumeAlert, open } = setup();+ await screen.findByText('new task');+ await act(async () => { void router.navigate('/bots/groups/g-1'); });+ await screen.findByText('group page');+ await flush();+ await act(async () => open()('lane', undefined, 'entry-4'));+ await flush();+ expect(consumeAlert).toHaveBeenCalledExactlyOnceWith('lane', 'entry-4');+ });+});diff --git a/apps/desktop/src/renderer/features/bots/botSessionOwners.ts b/apps/desktop/src/renderer/features/bots/botSessionOwners.tsindex cdb330b5c2..391df936f7 100644--- a/apps/desktop/src/renderer/features/bots/botSessionOwners.ts+++ b/apps/desktop/src/renderer/features/bots/botSessionOwners.ts@@ -11,6 +11,7 @@import type { BotSessionOwner } from '@/features/cc-agent/lib/projectGrouping';import type { BotProfile } from './botStore';+import { isBotGroupLaneSession } from './botGroupLane';/*** Find the Bot that owns a real Cindy Session through the projected@@ -27,23 +28,66 @@ export function findBotProfileForSession();}+/**+ * Where a session-only entry (notification / Agent Island click, task deep+ * link) lands for a Bot-owned Session, and whether that target can dispose the+ * clicked Agent Island card itself.+ *+ * Targets that render no disposal control for this Session's error dispose the+ * clicked card instead: a hidden group lane lives inside its group chat and a+ * delegation run lands on the Bot task page's unavailable gate (`consumesAlert`,+ * once the route commits); a read-only history transcript re-checks ownership+ * after it commits and may redirect away, so its gate disposes it once shown+ * (`gateConsumesAlert`). Unread errors are immune to passive visibility acks,+ * so without this the island card could never be cleared. Main only honours it+ * for the card that was actually clicked, and only while that card is unchanged+ * (see AgentIslandService.consumeIslandEntryAlert). A live chat keeps its own+ * ErrorBanner as the only disposal path.+ */+export interface BotSessionEntryTarget {+ route: string;+ /** The entry navigator disposes the clicked card once this route has committed. */+ consumesAlert: boolean;+ /** The route's own ownership gate disposes it instead, given the click id as route state. */+ gateConsumesAlert?: boolean;+}+/*** Resolve the public Bot route for a notification or other session-only entry.- * The stable main task stays on the short Bot route; child and historical tasks- * retain their own session id so opening a notification never loses context.+ * The stable main task stays on the short Bot route; history keeps its own+ * read-only route and a group lane returns to its group.+ * `/bots/:botId/session/:sessionId` only mounts a live chat; other roles (a+ * delegation run) still land on its unavailable gate.*/export function botRouteForOwnedSession(profiles: readonly BotProfile[],sessionId: string,-): string | null {+): BotSessionEntryTarget | null {const bot = findBotProfileForSession(profiles, sessionId);if (!bot) return null;+ const botRoute = `/bots/${encodeURIComponent(bot.id)}`;+ const projection = bot.sessions.find((session) => session.id === sessionId);+ if (isBotGroupLaneSession(projection)) {+ return {+ route: projection?.groupId ? `/bots/groups/${encodeURIComponent(projection.groupId)}` : botRoute,+ consumesAlert: true,+ };+ }+ if (projection?.kind === 'history' || projection?.role === 'history') {+ // Its ownership gate re-checks after the route commits and may redirect away, so the+ // gate itself disposes the card once it shows the transcript.+ return { route: `${botRoute}/history/${encodeURIComponent(sessionId)}`, consumesAlert: false, gateConsumesAlert: true };+ }const canonicalSessionId = bot.sessions.find((session) => session.role === 'canonical' || session.kind === 'chat',)?.id;- return canonicalSessionId === sessionId- ? `/bots/${encodeURIComponent(bot.id)}`- : `/bots/${encodeURIComponent(bot.id)}/session/${encodeURIComponent(sessionId)}`;+ if (canonicalSessionId === sessionId) return { route: botRoute, consumesAlert: false };+ return {+ route: `${botRoute}/session/${encodeURIComponent(sessionId)}`,+ // Only a live chat mounts there; a delegation run lands on the unavailable+ // gate, which has nothing to dispose the error with.+ consumesAlert: projection?.kind === 'worker' || projection?.role === 'delegation',+ };}export interface BotSessionEntryRouteDeps {@@ -63,38 +107,90 @@ export interface BotSessionEntryRouteDeps {export async function resolveBotRouteForSessionEntry(sessionId: string,deps: BotSessionEntryRouteDeps,-): Promise<string | null> {- const known = botRouteForOwnedSession(deps.readProfiles(), sessionId);- if (known) return known;+): Promise<BotSessionEntryTarget | null> {+ const current = deps.readProfiles();+ if (findBotProfileForSession(current, sessionId)) return botRouteForOwnedSession(current, sessionId);const profiles = await deps.loadProfiles(true).catch(() => []);return botRouteForOwnedSession(profiles, sessionId);}export interface SessionEntryNavigatorDeps {- resolveBotRoute: (sessionId: string) => Promise<string | null>;- openBotRoute: (route: string) => void;+ resolveBotRoute: (sessionId: string) => Promise<BotSessionEntryTarget | null>;+ /** `islandEntryId` is handed to a route whose gate disposes the card (gateConsumesAlert). */+ openBotRoute: (route: string, islandEntryId?: string) => void;+ /** Asks main to dispose the card of this island click (see BotSessionEntryTarget). */+ consumeAlert: (sessionId: string, islandEntryId: string) => void;/** `isLatest` lets the ordinary path drop its own late async route result too. */openOrdinary: (sessionId: string, messageClientId: string | undefined, isLatest: () => boolean) => void;}+export interface SessionEntryNavigator {+ (sessionId: string, messageClientId?: string, islandEntryId?: string): void;+ /** Report every location the router has committed (`pathname + search`). */+ locationCommitted: (path: string) => void;+}+/*** Session entries (notification clicks, task deep links) resolve asynchronously.* Only the latest entry may navigate, so a slow lookup for an earlier click can* never override a newer one.+ *+ * An Agent Island click (`islandEntryId`) into a target without a disposal+ * control asks main to dispose that card only once the router has committed the+ * target location: immediately when it is already the committed location,+ * otherwise on the next committed location if it is the target. A newer entry,+ * any location commit while the entry is still resolving (the user moved on, or+ * opened the target address themselves), or a commit to any other location+ * (redirect, another navigation) drops it, so the card stays and a later click+ * can still dispose it.*/export function createSessionEntryNavigator(deps: SessionEntryNavigatorDeps,-): (sessionId: string, messageClientId?: string) => void {+): SessionEntryNavigator {let sequence = 0;- return (sessionId, messageClientId) => {+ let committedPath: string | null = null;+ let commitCount = 0;+ let pending: { entry: number; sessionId: string; islandEntryId: string; route: string } | null = null;+ const open = (sessionId: string, messageClientId?: string, islandEntryId?: string) => {const entry = ++sequence;+ pending = null;+ const commitsAtOpen = commitCount;const isLatest = () => sequence === entry;- void deps.resolveBotRoute(sessionId).then((route) => {+ void deps.resolveBotRoute(sessionId).then((target) => {if (!isLatest()) return;- if (route) deps.openBotRoute(route);- else deps.openOrdinary(sessionId, messageClientId, isLatest);+ if (!target) {+ deps.openOrdinary(sessionId, messageClientId, isLatest);+ return;+ }+ // Navigation keeps its existing late-resolution behaviour; only disposal is forfeited.+ const disposalId = islandEntryId && commitCount === commitsAtOpen ? islandEntryId : undefined;+ if (target.consumesAlert && disposalId) {+ if (committedPath === target.route) {+ deps.consumeAlert(sessionId, disposalId);+ } else {+ pending = { entry, sessionId, islandEntryId: disposalId, route: target.route };+ }+ }+ try {+ deps.openBotRoute(target.route, target.gateConsumesAlert ? disposalId : undefined);+ } catch (error) {+ if (pending?.entry === entry) pending = null;+ throw error;+ }});};+ return Object.assign(open, {+ locationCommitted: (path: string) => {+ committedPath = path;+ commitCount += 1;+ const waiting = pending;+ if (!waiting) return;+ pending = null;+ if (waiting.entry === sequence && waiting.route === path) {+ deps.consumeAlert(waiting.sessionId, waiting.islandEntryId);+ }+ },+ });}export function buildBotSessionOwners(diff --git a/apps/desktop/src/renderer/features/bots/botStore.ts b/apps/desktop/src/renderer/features/bots/botStore.tsindex 4134ca742f..b976c53eb1 100644--- a/apps/desktop/src/renderer/features/bots/botStore.ts+++ b/apps/desktop/src/renderer/features/bots/botStore.ts@@ -146,6 +146,8 @@ export interface BotSessionProjection {updatedAt: number;status?: 'active' | 'archived' | 'deleted';role?: 'canonical' | 'delegation' | 'history' | 'group';+ /** Group-lane only: the group whose chat owns this hidden Session. */+ groupId?: string;profileVersion?: number;runtimeSnapshot?: {profileVersion: number;diff --git a/apps/desktop/src/renderer/features/bots/islandEntryAlert.ts b/apps/desktop/src/renderer/features/bots/islandEntryAlert.tsnew file mode 100644index 0000000000..dc6b7cf488--- /dev/null+++ b/apps/desktop/src/renderer/features/bots/islandEntryAlert.ts@@ -0,0 +1,18 @@+/**+ * Router state that hands an Agent Island click to a route whose own ownership+ * gate disposes the card once it has actually shown the Session (history).+ */+export function islandEntryRouteState(islandEntryId: string): { islandEntryId: string } {+ return { islandEntryId };+}++export function readIslandEntryRouteState(state: unknown): string | null {+ if (!state || typeof state !== 'object') return null;+ const value = (state as { islandEntryId?: unknown }).islandEntryId;+ return typeof value === 'string' && value ? value : null;+}++/** Main disposes the card only for its latest click and while that card is unchanged. */+export function requestIslandEntryAlertDisposal(sessionId: string, islandEntryId: string): void {+ void window.electronAPI.agentIsland?.consumeEntryAlert?.(sessionId, islandEntryId).catch(() => undefined);+}diff --git a/apps/desktop/src/renderer/features/bots/useSessionEntryLocationCommits.ts b/apps/desktop/src/renderer/features/bots/useSessionEntryLocationCommits.tsnew file mode 100644index 0000000000..57164330ee--- /dev/null+++ b/apps/desktop/src/renderer/features/bots/useSessionEntryLocationCommits.ts@@ -0,0 +1,17 @@+import { useEffect } from 'react';+import { useLocation } from 'react-router-dom';++import type { SessionEntryNavigator } from './botSessionOwners';++/**+ * Reports each location the router has committed to the session entry navigator.+ * An Agent Island click into a target without a disposal control is only+ * disposed once its target location shows up here (see createSessionEntryNavigator).+ */+export function useSessionEntryLocationCommits(navigator: SessionEntryNavigator): void {+ const location = useLocation();+ const committedPath = `${location.pathname}${location.search}`;+ useEffect(() => {+ navigator.locationCommitted(committedPath);+ }, [committedPath, navigator]);+}diff --git a/apps/desktop/src/renderer/vite-env.d.ts b/apps/desktop/src/renderer/vite-env.d.tsindex 799fae8de7..a9bc294a96 100644--- a/apps/desktop/src/renderer/vite-env.d.ts+++ b/apps/desktop/src/renderer/vite-env.d.ts@@ -2066,6 +2066,7 @@ interface ElectronAPI {agentIsland: {setVisibleSession: (sessionId: string | string[] | null) => Promise<{ ok: true }>;setEnabled: (enabled: boolean) => Promise<{ ok: true }>;+ consumeEntryAlert: (sessionId: string, islandEntryId: string) => Promise<{ ok: true; consumed: boolean }>;setRemoteSessions: (sessions: AgentIslandRemoteSessionInput[]) => Promise<{ ok: true }>;setSoundSettings: (settings: AgentIslandSoundSettings) => Promise<{ ok: true }>;setMascotSkin: (skin: AgentIslandMascotSkin) => Promise<{ ok: true }>;@@ -2930,7 +2931,7 @@ interface ElectronAPI {onDeepLinkNavigate: (callback: (payload:- | { type: 'session'; id: string; messageClientId?: string }+ | { type: 'session'; id: string; messageClientId?: string; islandEntryId?: string }| { type: 'project'; workingDir: string }| { type: 'new-session'; workingDir: string }| { type: 'share-import'; filePath: string }@@ -2950,7 +2951,7 @@ interface ElectronAPI {* Feishu OAuth 后能继续消费当时的"点击意图"。*/takePendingDeepLink: () => Promise<- | { type: 'session'; id: string; messageClientId?: string }+ | { type: 'session'; id: string; messageClientId?: string; islandEntryId?: string }| { type: 'project'; workingDir: string }| { type: 'new-session'; workingDir: string }| { type: 'share-import'; filePath: string }diff --git a/apps/desktop/src/shared/agentIsland.ts b/apps/desktop/src/shared/agentIsland.tsindex 0ea95aa81a..b29354ecff 100644--- a/apps/desktop/src/shared/agentIsland.ts+++ b/apps/desktop/src/shared/agentIsland.ts@@ -742,6 +742,12 @@ export function computeAgentIslandContentHeight(input: {/** main → renderer:per-session 活动快照(侧栏卡片用)。 */export const AGENT_ISLAND_SESSION_SNAPSHOTS_CHANNEL = 'agent-island:session-snapshots';export const AGENT_ISLAND_SET_VISIBLE_SESSION_CHANNEL = 'agent-island:set-visible-session';+/**+ * renderer(主窗)→ main:灵动岛点击的目标地址已提交,且目标没有处置控件(群专线所在的群、+ * 只读历史、不可用的委派任务),请求处置被点的那张卡。参数为 sessionId 与这次点击的+ * islandEntryId;main 只认最近一次点击、且卡片身份未变。+ */+export const AGENT_ISLAND_CONSUME_ENTRY_ALERT_CHANNEL = 'agent-island:consume-entry-alert';export const AGENT_ISLAND_SET_ENABLED_CHANNEL = 'agent-island:set-enabled';export const AGENT_ISLAND_SET_SOUND_SETTINGS_CHANNEL = 'agent-island:set-sound-settings';export const AGENT_ISLAND_SET_MASCOT_SKIN_CHANNEL = 'agent-island:set-mascot-skin';diff --git a/docs/design-rules/design-inventory.md b/docs/design-rules/design-inventory.mdindex 6c8d44f42e..208e9b27cd 100644--- a/docs/design-rules/design-inventory.md+++ b/docs/design-rules/design-inventory.md@@ -18,7 +18,7 @@| `desktop.auth.add-account` | desktop | 添加账号 | hash `/add-account`(ProtectedRoute → AddAccountLoginPage) | AddAccountLoginPage | apps/desktop/src/renderer/components/login/AddAccountLoginPage.tsx, apps/desktop/src/renderer/components/login/LoginBrandStage.tsx, apps/desktop/src/renderer/components/login/LoginCaptchaOverlay.tsx, apps/desktop/src/renderer/components/login/LoginControls.tsx, apps/desktop/src/renderer/components/login/LoginPage.tsx, apps/desktop/src/renderer/components/login/loginDesignTokens.ts | 59 | 0 | 20 || `desktop.auth.legacy-migration` | desktop | 首登数据迁移弹窗 | App 顶层挂载 LegacyMigrationDialog(仅主窗;main 检测到旧版 userData 经 `legacy-migration:state` 驱动) | LegacyMigrationDialog | apps/desktop/src/renderer/components/auth/LegacyMigrationDialog.tsx | 8 | 0 | 2 || `desktop.auth.login` | desktop | 登录页 | hash `/login`(GuestRoute → LoginPage) | LoginBrandStage, LoginCaptchaOverlay, LoginControls, LoginPage | apps/desktop/src/renderer/components/login/LoginBrandStage.tsx, apps/desktop/src/renderer/components/login/LoginCaptchaOverlay.tsx, apps/desktop/src/renderer/components/login/LoginControls.tsx, apps/desktop/src/renderer/components/login/LoginPage.tsx, apps/desktop/src/renderer/components/login/loginDesignTokens.ts | 59 | 0 | 20 |-| `desktop.bots` | desktop | 伙伴(列表 / 对话 / 设置 / 历史 / 伙伴私聊 / 群聊) | hash `/bots`、`/bots/list`、`/bots/:botId`、`/bots/roster` 及伙伴当前/历史任务、伙伴私聊、伙伴群聊路由(BotsFeatureLayout) | BotBasicProfileFields, BotCollaborationCard, BotDirectMessageView, BotGroupChatView, BotGroupCreateDialog, BotGroupSettingsDrawer, BotHistorySessionView, BotLifecycleSettings, BotModelChainEditor, BotRosterView, BotSessionView, BotSettingsDrawer, BotsHomeView, BotsListView, RemoteBotSessionView | apps/desktop/src/renderer/components/chat/AgentActionRow.tsx, apps/desktop/src/renderer/components/chat/AgentActionsBlock.tsx, apps/desktop/src/renderer/components/chat/AgentOnOtherDeviceContext.tsx, apps/desktop/src/renderer/components/chat/AgentTaskCard.tsx, apps/desktop/src/renderer/components/chat/AgentTaskLiveDetails.tsx, apps/desktop/src/renderer/components/chat/AnnotationStrokesSvg.tsx, apps/desktop/src/renderer/components/chat/AskUserQuestionBubble.tsx, apps/desktop/src/renderer/components/chat/AssistantMessage.tsx, apps/desktop/src/renderer/components/chat/AutomationOriginBadge.tsx, apps/desktop/src/renderer/components/chat/ChatAudioCard.tsx, apps/desktop/src/renderer/components/chat/ChatDisplaySnapshotContext.tsx, apps/desktop/src/renderer/components/chat/ChatImageView.tsx, apps/desktop/src/renderer/components/chat/ChatLoadingImage.tsx, apps/desktop/src/renderer/components/chat/ChatSessionFileContext.tsx, apps/desktop/src/renderer/components/chat/ChatSoundEffectCard.tsx, apps/desktop/src/renderer/components/chat/ChatVideoView.tsx, apps/desktop/src/renderer/components/chat/CindyMakeDoctorCard.tsx, apps/desktop/src/renderer/components/chat/CopyAsImageBlock.tsx, apps/desktop/src/renderer/components/chat/CredentialSwitchWaitBanner.tsx, apps/desktop/src/renderer/components/chat/DiffView.tsx, apps/desktop/src/renderer/components/chat/ErrorBanner.tsx, apps/desktop/src/renderer/components/chat/ErrorMessageCard.tsx, apps/desktop/src/renderer/components/chat/GeneratedFilesCard.tsx, apps/desktop/src/renderer/components/chat/GhostCardHostPrompts.tsx, apps/desktop/src/renderer/components/chat/GhostSummonCard.tsx, apps/desktop/src/renderer/components/chat/GhostToolCard.tsx, apps/desktop/src/renderer/components/chat/HookTaskCard.tsx, apps/desktop/src/renderer/components/chat/ImageGalleryContext.tsx, apps/desktop/src/renderer/components/chat/ImageHoverPreview.tsx, apps/desktop/src/renderer/components/chat/ImageLightbox.tsx, apps/desktop/src/renderer/components/chat/ImageMissingPlaceholder.tsx, apps/desktop/src/renderer/components/chat/InlineReferenceChip.tsx, apps/desktop/src/renderer/components/chat/InterruptedTurnBanner.tsx, apps/desktop/src/renderer/components/chat/JumpToBottomChip.tsx, apps/desktop/src/renderer/components/chat/MarkdownDiffBlock.tsx, apps/desktop/src/renderer/components/chat/MarkdownMermaidBlock.tsx, apps/desktop/src/renderer/components/chat/MarkdownRenderer.tsx, apps/desktop/src/renderer/components/chat/MermaidLightbox.tsx, apps/desktop/src/renderer/components/chat/MessageActionBar.tsx, apps/desktop/src/renderer/components/chat/MessageNavRail.tsx, apps/desktop/src/renderer/components/chat/MessageSourceLabels.tsx, apps/desktop/src/renderer/components/chat/MessageStream.tsx, apps/desktop/src/renderer/components/chat/MessageViewport.tsx, apps/desktop/src/renderer/components/chat/ModelLightbox.tsx, apps/desktop/src/renderer/components/chat/NewMessageIndicator.tsx, apps/desktop/src/renderer/components/chat/PlanReviewBubble.tsx, apps/desktop/src/renderer/components/chat/PrevMessageJumpChip.tsx, apps/desktop/src/renderer/components/chat/ProjectLinkChip.tsx, apps/desktop/src/renderer/components/chat/QuoteChip.tsx, apps/desktop/src/renderer/components/chat/RewindPreviewDialog.tsx, apps/desktop/src/renderer/components/chat/SelectionQuoteButton.tsx, apps/desktop/src/renderer/components/chat/SentAgentReferenceChip.tsx, apps/desktop/src/renderer/components/chat/SentInlineAtomBody.tsx, apps/desktop/src/renderer/components/chat/SessionHandoffCard.tsx, apps/desktop/src/renderer/components/chat/SessionLinkChip.tsx, apps/desktop/src/renderer/components/chat/ShareMessageCheckbox.tsx, apps/desktop/src/renderer/components/chat/ShareSelectionBar.tsx, apps/desktop/src/renderer/components/chat/SlackIcon.tsx, apps/desktop/src/renderer/components/chat/StreamFadeSpan.tsx, apps/desktop/src/renderer/components/chat/StreamingMarkdownChunk.tsx, apps/desktop/src/renderer/components/chat/SystemCard.tsx, apps/desktop/src/renderer/components/chat/TextLightbox.tsx, apps/desktop/src/renderer/components/chat/ThinkingCard.tsx, apps/desktop/src/renderer/components/chat/ThinkingText.tsx, apps/desktop/src/renderer/components/chat/TodoListCard.tsx, apps/desktop/src/renderer/components/chat/ToolCallCard.tsx, apps/desktop/src/renderer/components/chat/ToolPayloadLightbox.tsx, apps/desktop/src/renderer/components/chat/TopRightChipStack.tsx, apps/desktop/src/renderer/components/chat/TurnChangesCard.tsx, apps/desktop/src/renderer/components/chat/UnreadFailedScheduleBanner.tsx, apps/desktop/src/renderer/components/chat/UpgradeBanner.tsx, apps/desktop/src/renderer/components/chat/UserAttachmentChip.tsx, apps/desktop/src/renderer/components/chat/UserMessage.tsx, apps/desktop/src/renderer/components/chat/UserMessageEditBox.tsx, apps/desktop/src/renderer/components/chat/UserMessageUrlLink.tsx, apps/desktop/src/renderer/components/chat/VideoLightbox.tsx, apps/desktop/src/renderer/components/chat/WorkGroupBlock.tsx, apps/desktop/src/renderer/components/chat/WorktreeRestoreBanner.tsx, apps/desktop/src/renderer/components/chat/XIcon.tsx, apps/desktop/src/renderer/components/chat/activityRowChrome.ts, apps/desktop/src/renderer/components/chat/animateFocusScroll.ts, apps/desktop/src/renderer/components/chat/autoFollowIntent.ts, apps/desktop/src/renderer/components/chat/chatChrome.ts, apps/desktop/src/renderer/components/chat/errorReasonI18n.ts, apps/desktop/src/renderer/components/chat/generatedFilesProjection.ts, apps/desktop/src/renderer/components/chat/imageDisplaySize.ts, apps/desktop/src/renderer/components/chat/lightboxAnnotations.ts, apps/desktop/src/renderer/components/chat/lightboxGestures.ts, apps/desktop/src/renderer/components/chat/markdownImageTargets.ts, apps/desktop/src/renderer/components/chat/markdownMedia.ts, apps/desktop/src/renderer/components/chat/messageNavRailModel.ts, apps/desktop/src/renderer/components/chat/messageNavRailWheel.ts, apps/desktop/src/renderer/components/chat/messageNavigationProjection.ts, apps/desktop/src/renderer/components/chat/messageProjectionCache.ts, apps/desktop/src/renderer/components/chat/messageStreamIndicatorPosition.ts, apps/desktop/src/renderer/components/chat/messageViewportCompensation.ts, apps/desktop/src/renderer/components/chat/messageViewportGeometry.ts, apps/desktop/src/renderer/components/chat/messageWorkGroups.ts, apps/desktop/src/renderer/components/chat/observeProgrammaticScroll.ts, apps/desktop/src/renderer/components/chat/rehypeFencedCodeMarker.ts, apps/desktop/src/renderer/components/chat/rehypeHighlightShared.ts, apps/desktop/src/renderer/components/chat/rehypeMathBlockMarker.ts, apps/desktop/src/renderer/components/chat/rehypeStreamWordFade.ts, apps/desktop/src/renderer/components/chat/remarkHtmlImages.ts, apps/desktop/src/renderer/components/chat/remarkLocalPathLinks.ts, apps/desktop/src/renderer/components/chat/remarkPreserveRawLocalDestinations.ts, apps/desktop/src/renderer/components/chat/remarkSessionLinks.ts, apps/desktop/src/renderer/components/chat/remarkStrictInlineMath.ts, apps/desktop/src/renderer/components/chat/remarkTruncateCjkUrls.ts, apps/desktop/src/renderer/components/chat/repairStreamingMarkdown.ts, apps/desktop/src/renderer/components/chat/scrollAnchoringDetect.ts, apps/desktop/src/renderer/components/chat/shareSelectionStore.ts, apps/desktop/src/renderer/components/chat/streamingMarkdownBlocks.tsx, apps/desktop/src/renderer/components/chat/streamingMarkdownChunks.ts, apps/desktop/src/renderer/components/chat/streamingMessageProjection.ts, apps/desktop/src/renderer/components/chat/toolLoopI18n.ts, apps/desktop/src/renderer/components/chat/unreadCount.ts, apps/desktop/src/renderer/components/chat/useAutomaticHistoryLoadBudget.ts, apps/desktop/src/renderer/components/chat/useCopyAsImage.tsx, apps/desktop/src/renderer/components/chat/useDeleteMessage.ts, apps/desktop/src/renderer/components/chat/useFileChipContextMenu.tsx, apps/desktop/src/renderer/components/chat/useForkAtMessage.ts, apps/desktop/src/renderer/components/chat/useImageClipboard.ts, apps/desktop/src/renderer/components/chat/useImageLoadFailure.ts, apps/desktop/src/renderer/components/chat/useMessageViewport.ts, apps/desktop/src/renderer/components/chat/useNavigationKeyListener.ts, apps/desktop/src/renderer/components/chat/useOpenWithMenu.tsx, apps/desktop/src/renderer/components/chat/usePrevUserMessageInView.ts, apps/desktop/src/renderer/components/chat/useTurnChangeSets.ts, apps/desktop/src/renderer/components/chat/userMessageCollapse.ts, apps/desktop/src/renderer/components/chat/userMessageDisplayText.ts, apps/desktop/src/renderer/components/chat/userMessageLinkify.ts, apps/desktop/src/renderer/components/chat/viewportFillDetect.ts, apps/desktop/src/renderer/components/new-chat/AddRemoteProjectDialog.tsx, apps/desktop/src/renderer/components/new-chat/AgentSelect.tsx, apps/desktop/src/renderer/components/new-chat/AskUserQuestionPrompt.tsx, apps/desktop/src/renderer/components/new-chat/AtMentionPanel.tsx, apps/desktop/src/renderer/components/new-chat/AttachmentTypeThumb.tsx, apps/desktop/src/renderer/components/new-chat/ChatInput.tsx, apps/desktop/src/renderer/components/new-chat/CjkPunctDecoration.ts, apps/desktop/src/renderer/components/new-chat/CjkPunctuationUtils.ts, apps/desktop/src/renderer/components/new-chat/ComposerAttachments.tsx, apps/desktop/src/renderer/components/new-chat/ComposerListIndentDecoration.ts, apps/desktop/src/renderer/components/new-chat/ComposerListNodes.ts, apps/desktop/src/renderer/components/new-chat/ComposerQuoteNode.tsx, apps/desktop/src/renderer/components/new-chat/DeviceSwitcherPill.tsx, apps/desktop/src/renderer/components/new-chat/EffortSlider.tsx, apps/desktop/src/renderer/components/new-chat/EmptyDocSelectionGuard.ts, apps/desktop/src/renderer/components/new-chat/ExtraDirsButton.tsx, apps/desktop/src/renderer/components/new-chat/FastModeToggle.tsx, apps/desktop/src/renderer/components/new-chat/FolderPickerPopover.tsx, apps/desktop/src/renderer/components/new-chat/FullAccessConfirmContent.tsx, apps/desktop/src/renderer/components/new-chat/GhostCommandDecoration.ts, apps/desktop/src/renderer/components/new-chat/GoalAdvancedLimits.tsx, apps/desktop/src/renderer/components/new-chat/GoalIndicator.tsx, apps/desktop/src/renderer/components/new-chat/HomeUsageDashboard.tsx, apps/desktop/src/renderer/components/new-chat/ListComposerTextarea.tsx, apps/desktop/src/renderer/components/new-chat/LocalModelCatalogNotice.tsx, apps/desktop/src/renderer/components/new-chat/MentionChipNode.tsx, apps/desktop/src/renderer/components/new-chat/MentionDragCaretDecoration.ts, apps/desktop/src/renderer/components/new-chat/ModelCompatibilityNotice.tsx, apps/desktop/src/renderer/components/new-chat/ModelConfigFlyout.tsx, apps/desktop/src/renderer/components/new-chat/ModelHarnessPicker.tsx, apps/desktop/src/renderer/components/new-chat/ModelSelector.tsx, apps/desktop/src/renderer/components/new-chat/ModelSourceDetails.tsx, apps/desktop/src/renderer/components/new-chat/NewGoalDialog.tsx, apps/desktop/src/renderer/components/new-chat/PastedTextChipNode.tsx, apps/desktop/src/renderer/components/new-chat/PendingQueuePanel.tsx, apps/desktop/src/renderer/components/new-chat/PermissionPrompt.tsx, apps/desktop/src/renderer/components/new-chat/PermissionSelector.tsx, apps/desktop/src/renderer/components/new-chat/PinnedPlanPanel.tsx, apps/desktop/src/renderer/components/new-chat/PlanActionCard.tsx, apps/desktop/src/renderer/components/new-chat/PlanModeIndicator.tsx, apps/desktop/src/renderer/components/new-chat/PlanViewerCard.tsx, apps/desktop/src/renderer/components/new-chat/PluginConnectionForm.tsx, apps/desktop/src/renderer/components/new-chat/PluginOauthDeviceCode.tsx, apps/desktop/src/renderer/components/new-chat/PluginSetupPrompt.tsx, apps/desktop/src/renderer/components/new-chat/PluginSetupRemoteDesktopButton.tsx, apps/desktop/src/renderer/components/new-chat/PluginWriteAccessRecovery.tsx, apps/desktop/src/renderer/components/new-chat/QuickStartPillMark.ts, apps/desktop/src/renderer/components/new-chat/RemoteOauthSetupCard.tsx, apps/desktop/src/renderer/components/new-chat/SendButton.tsx, apps/desktop/src/renderer/components/new-chat/SlashCommandDecoration.ts, apps/desktop/src/renderer/components/new-chat/SlashCommandPalette.tsx, apps/desktop/src/renderer/components/new-chat/TakeoverMask.tsx, apps/desktop/src/renderer/components/new-chat/ThinkingToggle.tsx, apps/desktop/src/renderer/components/new-chat/UnifiedFlyoutHost.tsx, apps/desktop/src/renderer/components/new-chat/UnifiedModelPanel.tsx, apps/desktop/src/renderer/components/new-chat/UnifiedModelRail.tsx, apps/desktop/src/renderer/components/new-chat/UnifiedModelRow.tsx, apps/desktop/src/renderer/components/new-chat/UsageDailyBars.tsx, apps/desktop/src/renderer/components/new-chat/UsageHeatmap.tsx, apps/desktop/src/renderer/components/new-chat/VendorSegmentedSwitcher.tsx, apps/desktop/src/renderer/components/new-chat/VoiceInputDraftDecoration.ts, apps/desktop/src/renderer/components/new-chat/WindowsSelectionReplacement.ts, apps/desktop/src/renderer/components/new-chat/WorktreeChipsRow.tsx, apps/desktop/src/renderer/components/new-chat/WorktreeCreatingOverlay.tsx, apps/desktop/src/renderer/components/new-chat/agentOptions.ts, apps/desktop/src/renderer/components/new-chat/agentSwitchConfirmation.ts, apps/desktop/src/renderer/components/new-chat/branchPick.ts, apps/desktop/src/renderer/components/new-chat/composerBlankPointerFocus.ts, apps/desktop/src/renderer/components/new-chat/composerContentSerialization.ts, apps/desktop/src/renderer/components/new-chat/composerDocState.ts, apps/desktop/src/renderer/components/new-chat/composerFrameScheduler.ts, apps/desktop/src/renderer/components/new-chat/composerHistoryProjection.ts, apps/desktop/src/renderer/components/new-chat/composerModelSelection.ts, apps/desktop/src/renderer/components/new-chat/composerPromptRecommendation.ts, apps/desktop/src/renderer/components/new-chat/composerRenderGate.ts, apps/desktop/src/renderer/components/new-chat/composerSendOwnership.ts, apps/desktop/src/renderer/components/new-chat/composerSendSnapshot.ts, apps/desktop/src/renderer/components/new-chat/effortChangeQueue.ts, apps/desktop/src/renderer/components/new-chat/extraDirsActions.ts, apps/desktop/src/renderer/components/new-chat/ghostComposerPlacement.ts, apps/desktop/src/renderer/components/new-chat/localAttachmentPicker.ts, apps/desktop/src/renderer/components/new-chat/mentionChipInsertion.ts, apps/desktop/src/renderer/components/new-chat/modelWindowErrorToast.ts, apps/desktop/src/renderer/components/new-chat/pastePipeline.ts, apps/desktop/src/renderer/components/new-chat/pathPaste.ts, apps/desktop/src/renderer/components/new-chat/pendingQueueLocks.ts, apps/desktop/src/renderer/components/new-chat/pendingQueueRowActivity.ts, apps/desktop/src/renderer/components/new-chat/pendingQueueRowPresentation.ts, apps/desktop/src/renderer/components/new-chat/planModeComposerCommand.ts, apps/desktop/src/renderer/components/new-chat/priceTierMarks.tsx, apps/desktop/src/renderer/components/new-chat/remoteBrowseAdapters.ts, apps/desktop/src/renderer/components/new-chat/remoteExistingProjects.ts, apps/desktop/src/renderer/components/new-chat/restoreComposerDocument.ts, apps/desktop/src/renderer/components/new-chat/sessionLinkPaste.ts, apps/desktop/src/renderer/components/new-chat/sourceSwitch.ts, apps/desktop/src/renderer/components/new-chat/unifiedModelSelection.ts, apps/desktop/src/renderer/components/new-chat/usagePalette.ts, apps/desktop/src/renderer/components/new-chat/useComposerSendFocusRestore.ts, apps/desktop/src/renderer/components/new-chat/useModelDiscoveryPending.ts, apps/desktop/src/renderer/components/new-chat/useProviderWeeklyQuota.ts, apps/desktop/src/renderer/components/new-chat/useUnifiedRowActions.ts, apps/desktop/src/renderer/features/bots/BotAddToGroupMenu.tsx, apps/desktop/src/renderer/features/bots/BotAuthorizationCard.tsx, apps/desktop/src/renderer/features/bots/BotAvatar.tsx, apps/desktop/src/renderer/features/bots/BotBasicProfileFields.tsx, apps/desktop/src/renderer/features/bots/BotCapabilitySettings.tsx, apps/desktop/src/renderer/features/bots/BotCollaborationCard.tsx, apps/desktop/src/renderer/features/bots/BotConnectionStatus.tsx, apps/desktop/src/renderer/features/bots/BotCreateMenu.tsx, apps/desktop/src/renderer/features/bots/BotDeleteDialog.tsx, apps/desktop/src/renderer/features/bots/BotDirectMessageCard.tsx, apps/desktop/src/renderer/features/bots/BotDirectMessageView.tsx, apps/desktop/src/renderer/features/bots/BotFollowMark.tsx, apps/desktop/src/renderer/features/bots/BotGenerationLabel.tsx, apps/desktop/src/renderer/features/bots/BotGroupAvatars.tsx, apps/desktop/src/renderer/features/bots/BotGroupChatView.tsx, apps/desktop/src/renderer/features/bots/BotGroupComposer.tsx, apps/desktop/src/renderer/features/bots/BotGroupCreateDialog.tsx, apps/desktop/src/renderer/features/bots/BotGroupMessageAttachments.tsx, apps/desktop/src/renderer/features/bots/BotGroupPendingInteraction.tsx, apps/desktop/src/renderer/features/bots/BotGroupPlan.tsx, apps/desktop/src/renderer/features/bots/BotGroupQuote.tsx, apps/desktop/src/renderer/features/bots/BotGroupRuntimeFailureNotice.tsx, apps/desktop/src/renderer/features/bots/BotGroupSettingsDrawer.tsx, apps/desktop/src/renderer/features/bots/BotGroupSidebarRow.tsx, apps/desktop/src/renderer/features/bots/BotHistorySessionView.tsx, apps/desktop/src/renderer/features/bots/BotHomeComputerSetting.tsx, apps/desktop/src/renderer/features/bots/BotImportForm.tsx, apps/desktop/src/renderer/features/bots/BotInvitationWelcome.tsx, apps/desktop/src/renderer/features/bots/BotLearningFooter.tsx, apps/desktop/src/renderer/features/bots/BotLifecycleSettings.tsx, apps/desktop/src/renderer/features/bots/BotMemorySettings.tsx, apps/desktop/src/renderer/features/bots/BotModelChainEditor.tsx, apps/desktop/src/renderer/features/bots/BotPortraitPicker.tsx, apps/desktop/src/renderer/features/bots/BotRosterView.tsx, apps/desktop/src/renderer/features/bots/BotRoutines.tsx, apps/desktop/src/renderer/features/bots/BotSessionContentHeader.tsx, apps/desktop/src/renderer/features/bots/BotSessionTaskLink.tsx, apps/desktop/src/renderer/features/bots/BotSessionTaskResultCard.tsx, apps/desktop/src/renderer/features/bots/BotSessionView.tsx, apps/desktop/src/renderer/features/bots/BotSettingsBlock.tsx, apps/desktop/src/renderer/features/bots/BotSettingsDrawer.tsx, apps/desktop/src/renderer/features/bots/BotTaskCardHeader.tsx, apps/desktop/src/renderer/features/bots/BotTaskModelEditor.tsx, apps/desktop/src/renderer/features/bots/BotTodoList.tsx, apps/desktop/src/renderer/features/bots/BotWorkbench.tsx, apps/desktop/src/renderer/features/bots/BotWorkingStatus.tsx, apps/desktop/src/renderer/features/bots/BotsFeatureLayout.tsx, apps/desktop/src/renderer/features/bots/BotsGlobalSettingsSection.tsx, apps/desktop/src/renderer/features/bots/BotsHomeView.tsx, apps/desktop/src/renderer/features/bots/BotsListView.tsx, apps/desktop/src/renderer/features/bots/ChatBotAccessField.tsx, apps/desktop/src/renderer/features/bots/ChatGroupSettings.tsx, apps/desktop/src/renderer/features/bots/ChatInviteDialog.tsx, apps/desktop/src/renderer/features/bots/ChatInviteHost.tsx, apps/desktop/src/renderer/features/bots/ChatReactionButton.tsx, apps/desktop/src/renderer/features/bots/ChatServerControls.tsx, apps/desktop/src/renderer/features/bots/ChatThreadPanel.tsx, apps/desktop/src/renderer/features/bots/CindyDevicePicker.tsx, apps/desktop/src/renderer/features/bots/CindyDeviceRow.tsx, apps/desktop/src/renderer/features/bots/CloudCompanionOfflineView.tsx, apps/desktop/src/renderer/features/bots/CompanionShadowBanner.tsx, apps/desktop/src/renderer/features/bots/RemoteBotSessionView.tsx, apps/desktop/src/renderer/features/bots/RemoteBotSettings.tsx, apps/desktop/src/renderer/features/bots/TeammateSearchResults.tsx, apps/desktop/src/renderer/features/bots/TeammatesSection.tsx, apps/desktop/src/renderer/features/bots/WorkbenchSessionList.tsx, apps/desktop/src/renderer/features/bots/botAvatarIdentity.ts, apps/desktop/src/renderer/features/bots/botCapabilityDefaults.ts, apps/desktop/src/renderer/features/bots/botChatPresentation.ts, apps/desktop/src/renderer/features/bots/botConversationPresentation.ts, apps/desktop/src/renderer/features/bots/botConversationTimeline.ts, apps/desktop/src/renderer/features/bots/botDelegationLive.ts, apps/desktop/src/renderer/features/bots/botFollowScopes.ts, apps/desktop/src/renderer/features/bots/botGeneratedArtifacts.ts, apps/desktop/src/renderer/features/bots/botGroupAttachments.ts, apps/desktop/src/renderer/features/bots/botGroupComposerChrome.ts, apps/desktop/src/renderer/features/bots/botGroupLane.ts, apps/desktop/src/renderer/features/bots/botGroupMentions.ts, apps/desktop/src/renderer/features/bots/botGroupOutbox.ts, apps/desktop/src/renderer/features/bots/botGroupPresentation.ts, apps/desktop/src/renderer/features/bots/botGroupStore.ts, apps/desktop/src/renderer/features/bots/botListDisplay.ts, apps/desktop/src/renderer/features/bots/botNavigation.ts, apps/desktop/src/renderer/features/bots/botPronounContext.tsx, apps/desktop/src/renderer/features/bots/botReadState.ts, apps/desktop/src/renderer/features/bots/botRosterDisplay.ts, apps/desktop/src/renderer/features/bots/botSessionOwners.ts, apps/desktop/src/renderer/features/bots/botSettingsAutosave.ts, apps/desktop/src/renderer/features/bots/botStore.ts, apps/desktop/src/renderer/features/bots/botTodo.css, apps/desktop/src/renderer/features/bots/botWelcomeContext.ts, apps/desktop/src/renderer/features/bots/botWorkbenchProjection.ts, apps/desktop/src/renderer/features/bots/chatError.ts, apps/desktop/src/renderer/features/bots/cindyDeviceRoster.ts, apps/desktop/src/renderer/features/bots/companionCloudPresentation.ts, apps/desktop/src/renderer/features/bots/companionCloudStore.ts, apps/desktop/src/renderer/features/bots/remoteBotRoster.ts, apps/desktop/src/renderer/features/bots/remoteBotSettingsData.ts, apps/desktop/src/renderer/features/bots/teammatesSectionPrefs.ts, apps/desktop/src/renderer/features/bots/useBotGeneratedFileDeliveries.ts, apps/desktop/src/renderer/features/bots/useBotGroupMentionPicker.tsx, apps/desktop/src/renderer/features/bots/useBotIslandVisibleSession.ts, apps/desktop/src/renderer/features/bots/useBotSettingsAutosave.ts, apps/desktop/src/renderer/features/bots/useBotUnreadSync.ts, apps/desktop/src/renderer/features/bots/useRemoteBots.ts, apps/desktop/src/renderer/features/bots/useViewedBotSessionId.ts, apps/desktop/src/renderer/features/bots/useWorkbenchSessionPages.ts, apps/desktop/src/renderer/features/bots/useWorkingStatusCopy.ts, apps/desktop/src/renderer/features/cc-agent/CCAgentFeatureLayout.tsx, apps/desktop/src/renderer/features/cc-agent/CCAgentSessionView.tsx | 275 | 38 | 494 |+| `desktop.bots` | desktop | 伙伴(列表 / 对话 / 设置 / 历史 / 伙伴私聊 / 群聊) | hash `/bots`、`/bots/list`、`/bots/:botId`、`/bots/roster` 及伙伴当前/历史任务、伙伴私聊、伙伴群聊路由(BotsFeatureLayout) | BotBasicProfileFields, BotCollaborationCard, BotDirectMessageView, BotGroupChatView, BotGroupCreateDialog, BotGroupSettingsDrawer, BotHistorySessionView, BotLifecycleSettings, BotModelChainEditor, BotRosterView, BotSessionView, BotSettingsDrawer, BotsHomeView, BotsListView, RemoteBotSessionView | apps/desktop/src/renderer/components/chat/AgentActionRow.tsx, apps/desktop/src/renderer/components/chat/AgentActionsBlock.tsx, apps/desktop/src/renderer/components/chat/AgentOnOtherDeviceContext.tsx, apps/desktop/src/renderer/components/chat/AgentTaskCard.tsx, apps/desktop/src/renderer/components/chat/AgentTaskLiveDetails.tsx, apps/desktop/src/renderer/components/chat/AnnotationStrokesSvg.tsx, apps/desktop/src/renderer/components/chat/AskUserQuestionBubble.tsx, apps/desktop/src/renderer/components/chat/AssistantMessage.tsx, apps/desktop/src/renderer/components/chat/AutomationOriginBadge.tsx, apps/desktop/src/renderer/components/chat/ChatAudioCard.tsx, apps/desktop/src/renderer/components/chat/ChatDisplaySnapshotContext.tsx, apps/desktop/src/renderer/components/chat/ChatImageView.tsx, apps/desktop/src/renderer/components/chat/ChatLoadingImage.tsx, apps/desktop/src/renderer/components/chat/ChatSessionFileContext.tsx, apps/desktop/src/renderer/components/chat/ChatSoundEffectCard.tsx, apps/desktop/src/renderer/components/chat/ChatVideoView.tsx, apps/desktop/src/renderer/components/chat/CindyMakeDoctorCard.tsx, apps/desktop/src/renderer/components/chat/CopyAsImageBlock.tsx, apps/desktop/src/renderer/components/chat/CredentialSwitchWaitBanner.tsx, apps/desktop/src/renderer/components/chat/DiffView.tsx, apps/desktop/src/renderer/components/chat/ErrorBanner.tsx, apps/desktop/src/renderer/components/chat/ErrorMessageCard.tsx, apps/desktop/src/renderer/components/chat/GeneratedFilesCard.tsx, apps/desktop/src/renderer/components/chat/GhostCardHostPrompts.tsx, apps/desktop/src/renderer/components/chat/GhostSummonCard.tsx, apps/desktop/src/renderer/components/chat/GhostToolCard.tsx, apps/desktop/src/renderer/components/chat/HookTaskCard.tsx, apps/desktop/src/renderer/components/chat/ImageGalleryContext.tsx, apps/desktop/src/renderer/components/chat/ImageHoverPreview.tsx, apps/desktop/src/renderer/components/chat/ImageLightbox.tsx, apps/desktop/src/renderer/components/chat/ImageMissingPlaceholder.tsx, apps/desktop/src/renderer/components/chat/InlineReferenceChip.tsx, apps/desktop/src/renderer/components/chat/InterruptedTurnBanner.tsx, apps/desktop/src/renderer/components/chat/JumpToBottomChip.tsx, apps/desktop/src/renderer/components/chat/MarkdownDiffBlock.tsx, apps/desktop/src/renderer/components/chat/MarkdownMermaidBlock.tsx, apps/desktop/src/renderer/components/chat/MarkdownRenderer.tsx, apps/desktop/src/renderer/components/chat/MermaidLightbox.tsx, apps/desktop/src/renderer/components/chat/MessageActionBar.tsx, apps/desktop/src/renderer/components/chat/MessageNavRail.tsx, apps/desktop/src/renderer/components/chat/MessageSourceLabels.tsx, apps/desktop/src/renderer/components/chat/MessageStream.tsx, apps/desktop/src/renderer/components/chat/MessageViewport.tsx, apps/desktop/src/renderer/components/chat/ModelLightbox.tsx, apps/desktop/src/renderer/components/chat/NewMessageIndicator.tsx, apps/desktop/src/renderer/components/chat/PlanReviewBubble.tsx, apps/desktop/src/renderer/components/chat/PrevMessageJumpChip.tsx, apps/desktop/src/renderer/components/chat/ProjectLinkChip.tsx, apps/desktop/src/renderer/components/chat/QuoteChip.tsx, apps/desktop/src/renderer/components/chat/RewindPreviewDialog.tsx, apps/desktop/src/renderer/components/chat/SelectionQuoteButton.tsx, apps/desktop/src/renderer/components/chat/SentAgentReferenceChip.tsx, apps/desktop/src/renderer/components/chat/SentInlineAtomBody.tsx, apps/desktop/src/renderer/components/chat/SessionHandoffCard.tsx, apps/desktop/src/renderer/components/chat/SessionLinkChip.tsx, apps/desktop/src/renderer/components/chat/ShareMessageCheckbox.tsx, apps/desktop/src/renderer/components/chat/ShareSelectionBar.tsx, apps/desktop/src/renderer/components/chat/SlackIcon.tsx, apps/desktop/src/renderer/components/chat/StreamFadeSpan.tsx, apps/desktop/src/renderer/components/chat/StreamingMarkdownChunk.tsx, apps/desktop/src/renderer/components/chat/SystemCard.tsx, apps/desktop/src/renderer/components/chat/TextLightbox.tsx, apps/desktop/src/renderer/components/chat/ThinkingCard.tsx, apps/desktop/src/renderer/components/chat/ThinkingText.tsx, apps/desktop/src/renderer/components/chat/TodoListCard.tsx, apps/desktop/src/renderer/components/chat/ToolCallCard.tsx, apps/desktop/src/renderer/components/chat/ToolPayloadLightbox.tsx, apps/desktop/src/renderer/components/chat/TopRightChipStack.tsx, apps/desktop/src/renderer/components/chat/TurnChangesCard.tsx, apps/desktop/src/renderer/components/chat/UnreadFailedScheduleBanner.tsx, apps/desktop/src/renderer/components/chat/UpgradeBanner.tsx, apps/desktop/src/renderer/components/chat/UserAttachmentChip.tsx, apps/desktop/src/renderer/components/chat/UserMessage.tsx, apps/desktop/src/renderer/components/chat/UserMessageEditBox.tsx, apps/desktop/src/renderer/components/chat/UserMessageUrlLink.tsx, apps/desktop/src/renderer/components/chat/VideoLightbox.tsx, apps/desktop/src/renderer/components/chat/WorkGroupBlock.tsx, apps/desktop/src/renderer/components/chat/WorktreeRestoreBanner.tsx, apps/desktop/src/renderer/components/chat/XIcon.tsx, apps/desktop/src/renderer/components/chat/activityRowChrome.ts, apps/desktop/src/renderer/components/chat/animateFocusScroll.ts, apps/desktop/src/renderer/components/chat/autoFollowIntent.ts, apps/desktop/src/renderer/components/chat/chatChrome.ts, apps/desktop/src/renderer/components/chat/errorReasonI18n.ts, apps/desktop/src/renderer/components/chat/generatedFilesProjection.ts, apps/desktop/src/renderer/components/chat/imageDisplaySize.ts, apps/desktop/src/renderer/components/chat/lightboxAnnotations.ts, apps/desktop/src/renderer/components/chat/lightboxGestures.ts, apps/desktop/src/renderer/components/chat/markdownImageTargets.ts, apps/desktop/src/renderer/components/chat/markdownMedia.ts, apps/desktop/src/renderer/components/chat/messageNavRailModel.ts, apps/desktop/src/renderer/components/chat/messageNavRailWheel.ts, apps/desktop/src/renderer/components/chat/messageNavigationProjection.ts, apps/desktop/src/renderer/components/chat/messageProjectionCache.ts, apps/desktop/src/renderer/components/chat/messageStreamIndicatorPosition.ts, apps/desktop/src/renderer/components/chat/messageViewportCompensation.ts, apps/desktop/src/renderer/components/chat/messageViewportGeometry.ts, apps/desktop/src/renderer/components/chat/messageWorkGroups.ts, apps/desktop/src/renderer/components/chat/observeProgrammaticScroll.ts, apps/desktop/src/renderer/components/chat/rehypeFencedCodeMarker.ts, apps/desktop/src/renderer/components/chat/rehypeHighlightShared.ts, apps/desktop/src/renderer/components/chat/rehypeMathBlockMarker.ts, apps/desktop/src/renderer/components/chat/rehypeStreamWordFade.ts, apps/desktop/src/renderer/components/chat/remarkHtmlImages.ts, apps/desktop/src/renderer/components/chat/remarkLocalPathLinks.ts, apps/desktop/src/renderer/components/chat/remarkPreserveRawLocalDestinations.ts, apps/desktop/src/renderer/components/chat/remarkSessionLinks.ts, apps/desktop/src/renderer/components/chat/remarkStrictInlineMath.ts, apps/desktop/src/renderer/components/chat/remarkTruncateCjkUrls.ts, apps/desktop/src/renderer/components/chat/repairStreamingMarkdown.ts, apps/desktop/src/renderer/components/chat/scrollAnchoringDetect.ts, apps/desktop/src/renderer/components/chat/shareSelectionStore.ts, apps/desktop/src/renderer/components/chat/streamingMarkdownBlocks.tsx, apps/desktop/src/renderer/components/chat/streamingMarkdownChunks.ts, apps/desktop/src/renderer/components/chat/streamingMessageProjection.ts, apps/desktop/src/renderer/components/chat/toolLoopI18n.ts, apps/desktop/src/renderer/components/chat/unreadCount.ts, apps/desktop/src/renderer/components/chat/useAutomaticHistoryLoadBudget.ts, apps/desktop/src/renderer/components/chat/useCopyAsImage.tsx, apps/desktop/src/renderer/components/chat/useDeleteMessage.ts, apps/desktop/src/renderer/components/chat/useFileChipContextMenu.tsx, apps/desktop/src/renderer/components/chat/useForkAtMessage.ts, apps/desktop/src/renderer/components/chat/useImageClipboard.ts, apps/desktop/src/renderer/components/chat/useImageLoadFailure.ts, apps/desktop/src/renderer/components/chat/useMessageViewport.ts, apps/desktop/src/renderer/components/chat/useNavigationKeyListener.ts, apps/desktop/src/renderer/components/chat/useOpenWithMenu.tsx, apps/desktop/src/renderer/components/chat/usePrevUserMessageInView.ts, apps/desktop/src/renderer/components/chat/useTurnChangeSets.ts, apps/desktop/src/renderer/components/chat/userMessageCollapse.ts, apps/desktop/src/renderer/components/chat/userMessageDisplayText.ts, apps/desktop/src/renderer/components/chat/userMessageLinkify.ts, apps/desktop/src/renderer/components/chat/viewportFillDetect.ts, apps/desktop/src/renderer/components/new-chat/AddRemoteProjectDialog.tsx, apps/desktop/src/renderer/components/new-chat/AgentSelect.tsx, apps/desktop/src/renderer/components/new-chat/AskUserQuestionPrompt.tsx, apps/desktop/src/renderer/components/new-chat/AtMentionPanel.tsx, apps/desktop/src/renderer/components/new-chat/AttachmentTypeThumb.tsx, apps/desktop/src/renderer/components/new-chat/ChatInput.tsx, apps/desktop/src/renderer/components/new-chat/CjkPunctDecoration.ts, apps/desktop/src/renderer/components/new-chat/CjkPunctuationUtils.ts, apps/desktop/src/renderer/components/new-chat/ComposerAttachments.tsx, apps/desktop/src/renderer/components/new-chat/ComposerListIndentDecoration.ts, apps/desktop/src/renderer/components/new-chat/ComposerListNodes.ts, apps/desktop/src/renderer/components/new-chat/ComposerQuoteNode.tsx, apps/desktop/src/renderer/components/new-chat/DeviceSwitcherPill.tsx, apps/desktop/src/renderer/components/new-chat/EffortSlider.tsx, apps/desktop/src/renderer/components/new-chat/EmptyDocSelectionGuard.ts, apps/desktop/src/renderer/components/new-chat/ExtraDirsButton.tsx, apps/desktop/src/renderer/components/new-chat/FastModeToggle.tsx, apps/desktop/src/renderer/components/new-chat/FolderPickerPopover.tsx, apps/desktop/src/renderer/components/new-chat/FullAccessConfirmContent.tsx, apps/desktop/src/renderer/components/new-chat/GhostCommandDecoration.ts, apps/desktop/src/renderer/components/new-chat/GoalAdvancedLimits.tsx, apps/desktop/src/renderer/components/new-chat/GoalIndicator.tsx, apps/desktop/src/renderer/components/new-chat/HomeUsageDashboard.tsx, apps/desktop/src/renderer/components/new-chat/ListComposerTextarea.tsx, apps/desktop/src/renderer/components/new-chat/LocalModelCatalogNotice.tsx, apps/desktop/src/renderer/components/new-chat/MentionChipNode.tsx, apps/desktop/src/renderer/components/new-chat/MentionDragCaretDecoration.ts, apps/desktop/src/renderer/components/new-chat/ModelCompatibilityNotice.tsx, apps/desktop/src/renderer/components/new-chat/ModelConfigFlyout.tsx, apps/desktop/src/renderer/components/new-chat/ModelHarnessPicker.tsx, apps/desktop/src/renderer/components/new-chat/ModelSelector.tsx, apps/desktop/src/renderer/components/new-chat/ModelSourceDetails.tsx, apps/desktop/src/renderer/components/new-chat/NewGoalDialog.tsx, apps/desktop/src/renderer/components/new-chat/PastedTextChipNode.tsx, apps/desktop/src/renderer/components/new-chat/PendingQueuePanel.tsx, apps/desktop/src/renderer/components/new-chat/PermissionPrompt.tsx, apps/desktop/src/renderer/components/new-chat/PermissionSelector.tsx, apps/desktop/src/renderer/components/new-chat/PinnedPlanPanel.tsx, apps/desktop/src/renderer/components/new-chat/PlanActionCard.tsx, apps/desktop/src/renderer/components/new-chat/PlanModeIndicator.tsx, apps/desktop/src/renderer/components/new-chat/PlanViewerCard.tsx, apps/desktop/src/renderer/components/new-chat/PluginConnectionForm.tsx, apps/desktop/src/renderer/components/new-chat/PluginOauthDeviceCode.tsx, apps/desktop/src/renderer/components/new-chat/PluginSetupPrompt.tsx, apps/desktop/src/renderer/components/new-chat/PluginSetupRemoteDesktopButton.tsx, apps/desktop/src/renderer/components/new-chat/PluginWriteAccessRecovery.tsx, apps/desktop/src/renderer/components/new-chat/QuickStartPillMark.ts, apps/desktop/src/renderer/components/new-chat/RemoteOauthSetupCard.tsx, apps/desktop/src/renderer/components/new-chat/SendButton.tsx, apps/desktop/src/renderer/components/new-chat/SlashCommandDecoration.ts, apps/desktop/src/renderer/components/new-chat/SlashCommandPalette.tsx, apps/desktop/src/renderer/components/new-chat/TakeoverMask.tsx, apps/desktop/src/renderer/components/new-chat/ThinkingToggle.tsx, apps/desktop/src/renderer/components/new-chat/UnifiedFlyoutHost.tsx, apps/desktop/src/renderer/components/new-chat/UnifiedModelPanel.tsx, apps/desktop/src/renderer/components/new-chat/UnifiedModelRail.tsx, apps/desktop/src/renderer/components/new-chat/UnifiedModelRow.tsx, apps/desktop/src/renderer/components/new-chat/UsageDailyBars.tsx, apps/desktop/src/renderer/components/new-chat/UsageHeatmap.tsx, apps/desktop/src/renderer/components/new-chat/VendorSegmentedSwitcher.tsx, apps/desktop/src/renderer/components/new-chat/VoiceInputDraftDecoration.ts, apps/desktop/src/renderer/components/new-chat/WindowsSelectionReplacement.ts, apps/desktop/src/renderer/components/new-chat/WorktreeChipsRow.tsx, apps/desktop/src/renderer/components/new-chat/WorktreeCreatingOverlay.tsx, apps/desktop/src/renderer/components/new-chat/agentOptions.ts, apps/desktop/src/renderer/components/new-chat/agentSwitchConfirmation.ts, apps/desktop/src/renderer/components/new-chat/branchPick.ts, apps/desktop/src/renderer/components/new-chat/composerBlankPointerFocus.ts, apps/desktop/src/renderer/components/new-chat/composerContentSerialization.ts, apps/desktop/src/renderer/components/new-chat/composerDocState.ts, apps/desktop/src/renderer/components/new-chat/composerFrameScheduler.ts, apps/desktop/src/renderer/components/new-chat/composerHistoryProjection.ts, apps/desktop/src/renderer/components/new-chat/composerModelSelection.ts, apps/desktop/src/renderer/components/new-chat/composerPromptRecommendation.ts, apps/desktop/src/renderer/components/new-chat/composerRenderGate.ts, apps/desktop/src/renderer/components/new-chat/composerSendOwnership.ts, apps/desktop/src/renderer/components/new-chat/composerSendSnapshot.ts, apps/desktop/src/renderer/components/new-chat/effortChangeQueue.ts, apps/desktop/src/renderer/components/new-chat/extraDirsActions.ts, apps/desktop/src/renderer/components/new-chat/ghostComposerPlacement.ts, apps/desktop/src/renderer/components/new-chat/localAttachmentPicker.ts, apps/desktop/src/renderer/components/new-chat/mentionChipInsertion.ts, apps/desktop/src/renderer/components/new-chat/modelWindowErrorToast.ts, apps/desktop/src/renderer/components/new-chat/pastePipeline.ts, apps/desktop/src/renderer/components/new-chat/pathPaste.ts, apps/desktop/src/renderer/components/new-chat/pendingQueueLocks.ts, apps/desktop/src/renderer/components/new-chat/pendingQueueRowActivity.ts, apps/desktop/src/renderer/components/new-chat/pendingQueueRowPresentation.ts, apps/desktop/src/renderer/components/new-chat/planModeComposerCommand.ts, apps/desktop/src/renderer/components/new-chat/priceTierMarks.tsx, apps/desktop/src/renderer/components/new-chat/remoteBrowseAdapters.ts, apps/desktop/src/renderer/components/new-chat/remoteExistingProjects.ts, apps/desktop/src/renderer/components/new-chat/restoreComposerDocument.ts, apps/desktop/src/renderer/components/new-chat/sessionLinkPaste.ts, apps/desktop/src/renderer/components/new-chat/sourceSwitch.ts, apps/desktop/src/renderer/components/new-chat/unifiedModelSelection.ts, apps/desktop/src/renderer/components/new-chat/usagePalette.ts, apps/desktop/src/renderer/components/new-chat/useComposerSendFocusRestore.ts, apps/desktop/src/renderer/components/new-chat/useModelDiscoveryPending.ts, apps/desktop/src/renderer/components/new-chat/useProviderWeeklyQuota.ts, apps/desktop/src/renderer/components/new-chat/useUnifiedRowActions.ts, apps/desktop/src/renderer/features/bots/BotAddToGroupMenu.tsx, apps/desktop/src/renderer/features/bots/BotAuthorizationCard.tsx, apps/desktop/src/renderer/features/bots/BotAvatar.tsx, apps/desktop/src/renderer/features/bots/BotBasicProfileFields.tsx, apps/desktop/src/renderer/features/bots/BotCapabilitySettings.tsx, apps/desktop/src/renderer/features/bots/BotCollaborationCard.tsx, apps/desktop/src/renderer/features/bots/BotConnectionStatus.tsx, apps/desktop/src/renderer/features/bots/BotCreateMenu.tsx, apps/desktop/src/renderer/features/bots/BotDeleteDialog.tsx, apps/desktop/src/renderer/features/bots/BotDirectMessageCard.tsx, apps/desktop/src/renderer/features/bots/BotDirectMessageView.tsx, apps/desktop/src/renderer/features/bots/BotFollowMark.tsx, apps/desktop/src/renderer/features/bots/BotGenerationLabel.tsx, apps/desktop/src/renderer/features/bots/BotGroupAvatars.tsx, apps/desktop/src/renderer/features/bots/BotGroupChatView.tsx, apps/desktop/src/renderer/features/bots/BotGroupComposer.tsx, apps/desktop/src/renderer/features/bots/BotGroupCreateDialog.tsx, apps/desktop/src/renderer/features/bots/BotGroupMessageAttachments.tsx, apps/desktop/src/renderer/features/bots/BotGroupPendingInteraction.tsx, apps/desktop/src/renderer/features/bots/BotGroupPlan.tsx, apps/desktop/src/renderer/features/bots/BotGroupQuote.tsx, apps/desktop/src/renderer/features/bots/BotGroupRuntimeFailureNotice.tsx, apps/desktop/src/renderer/features/bots/BotGroupSettingsDrawer.tsx, apps/desktop/src/renderer/features/bots/BotGroupSidebarRow.tsx, apps/desktop/src/renderer/features/bots/BotHistorySessionView.tsx, apps/desktop/src/renderer/features/bots/BotHomeComputerSetting.tsx, apps/desktop/src/renderer/features/bots/BotImportForm.tsx, apps/desktop/src/renderer/features/bots/BotInvitationWelcome.tsx, apps/desktop/src/renderer/features/bots/BotLearningFooter.tsx, apps/desktop/src/renderer/features/bots/BotLifecycleSettings.tsx, apps/desktop/src/renderer/features/bots/BotMemorySettings.tsx, apps/desktop/src/renderer/features/bots/BotModelChainEditor.tsx, apps/desktop/src/renderer/features/bots/BotPortraitPicker.tsx, apps/desktop/src/renderer/features/bots/BotRosterView.tsx, apps/desktop/src/renderer/features/bots/BotRoutines.tsx, apps/desktop/src/renderer/features/bots/BotSessionContentHeader.tsx, apps/desktop/src/renderer/features/bots/BotSessionTaskLink.tsx, apps/desktop/src/renderer/features/bots/BotSessionTaskResultCard.tsx, apps/desktop/src/renderer/features/bots/BotSessionView.tsx, apps/desktop/src/renderer/features/bots/BotSettingsBlock.tsx, apps/desktop/src/renderer/features/bots/BotSettingsDrawer.tsx, apps/desktop/src/renderer/features/bots/BotTaskCardHeader.tsx, apps/desktop/src/renderer/features/bots/BotTaskModelEditor.tsx, apps/desktop/src/renderer/features/bots/BotTodoList.tsx, apps/desktop/src/renderer/features/bots/BotWorkbench.tsx, apps/desktop/src/renderer/features/bots/BotWorkingStatus.tsx, apps/desktop/src/renderer/features/bots/BotsFeatureLayout.tsx, apps/desktop/src/renderer/features/bots/BotsGlobalSettingsSection.tsx, apps/desktop/src/renderer/features/bots/BotsHomeView.tsx, apps/desktop/src/renderer/features/bots/BotsListView.tsx, apps/desktop/src/renderer/features/bots/ChatBotAccessField.tsx, apps/desktop/src/renderer/features/bots/ChatGroupSettings.tsx, apps/desktop/src/renderer/features/bots/ChatInviteDialog.tsx, apps/desktop/src/renderer/features/bots/ChatInviteHost.tsx, apps/desktop/src/renderer/features/bots/ChatReactionButton.tsx, apps/desktop/src/renderer/features/bots/ChatServerControls.tsx, apps/desktop/src/renderer/features/bots/ChatThreadPanel.tsx, apps/desktop/src/renderer/features/bots/CindyDevicePicker.tsx, apps/desktop/src/renderer/features/bots/CindyDeviceRow.tsx, apps/desktop/src/renderer/features/bots/CloudCompanionOfflineView.tsx, apps/desktop/src/renderer/features/bots/CompanionShadowBanner.tsx, apps/desktop/src/renderer/features/bots/RemoteBotSessionView.tsx, apps/desktop/src/renderer/features/bots/RemoteBotSettings.tsx, apps/desktop/src/renderer/features/bots/TeammateSearchResults.tsx, apps/desktop/src/renderer/features/bots/TeammatesSection.tsx, apps/desktop/src/renderer/features/bots/WorkbenchSessionList.tsx, apps/desktop/src/renderer/features/bots/botAvatarIdentity.ts, apps/desktop/src/renderer/features/bots/botCapabilityDefaults.ts, apps/desktop/src/renderer/features/bots/botChatPresentation.ts, apps/desktop/src/renderer/features/bots/botConversationPresentation.ts, apps/desktop/src/renderer/features/bots/botConversationTimeline.ts, apps/desktop/src/renderer/features/bots/botDelegationLive.ts, apps/desktop/src/renderer/features/bots/botFollowScopes.ts, apps/desktop/src/renderer/features/bots/botGeneratedArtifacts.ts, apps/desktop/src/renderer/features/bots/botGroupAttachments.ts, apps/desktop/src/renderer/features/bots/botGroupComposerChrome.ts, apps/desktop/src/renderer/features/bots/botGroupLane.ts, apps/desktop/src/renderer/features/bots/botGroupMentions.ts, apps/desktop/src/renderer/features/bots/botGroupOutbox.ts, apps/desktop/src/renderer/features/bots/botGroupPresentation.ts, apps/desktop/src/renderer/features/bots/botGroupStore.ts, apps/desktop/src/renderer/features/bots/botListDisplay.ts, apps/desktop/src/renderer/features/bots/botNavigation.ts, apps/desktop/src/renderer/features/bots/botPronounContext.tsx, apps/desktop/src/renderer/features/bots/botReadState.ts, apps/desktop/src/renderer/features/bots/botRosterDisplay.ts, apps/desktop/src/renderer/features/bots/botSessionOwners.ts, apps/desktop/src/renderer/features/bots/botSettingsAutosave.ts, apps/desktop/src/renderer/features/bots/botStore.ts, apps/desktop/src/renderer/features/bots/botTodo.css, apps/desktop/src/renderer/features/bots/botWelcomeContext.ts, apps/desktop/src/renderer/features/bots/botWorkbenchProjection.ts, apps/desktop/src/renderer/features/bots/chatError.ts, apps/desktop/src/renderer/features/bots/cindyDeviceRoster.ts, apps/desktop/src/renderer/features/bots/companionCloudPresentation.ts, apps/desktop/src/renderer/features/bots/companionCloudStore.ts, apps/desktop/src/renderer/features/bots/islandEntryAlert.ts, apps/desktop/src/renderer/features/bots/remoteBotRoster.ts, apps/desktop/src/renderer/features/bots/remoteBotSettingsData.ts, apps/desktop/src/renderer/features/bots/teammatesSectionPrefs.ts, apps/desktop/src/renderer/features/bots/useBotGeneratedFileDeliveries.ts, apps/desktop/src/renderer/features/bots/useBotGroupMentionPicker.tsx, apps/desktop/src/renderer/features/bots/useBotIslandVisibleSession.ts, apps/desktop/src/renderer/features/bots/useBotSettingsAutosave.ts, apps/desktop/src/renderer/features/bots/useBotUnreadSync.ts, apps/desktop/src/renderer/features/bots/useRemoteBots.ts, apps/desktop/src/renderer/features/bots/useSessionEntryLocationCommits.ts, apps/desktop/src/renderer/features/bots/useViewedBotSessionId.ts, apps/desktop/src/renderer/features/bots/useWorkbenchSessionPages.ts, apps/desktop/src/renderer/features/bots/useWorkingStatusCopy.ts, apps/desktop/src/renderer/features/cc-agent/CCAgentFeatureLayout.tsx, apps/desktop/src/renderer/features/cc-agent/CCAgentSessionView.tsx | 275 | 38 | 494 || `desktop.chat.files` | desktop | 工作目录文件浏览 | hash `/cc-agent/files/:sessionId`(WorkdirBrowseRoute) | FileBodyView, FileTreeView, WorkdirBrowseRoute | apps/desktop/src/renderer/features/cc-agent/workdir-browse/DocSearchBar.tsx, apps/desktop/src/renderer/features/cc-agent/workdir-browse/DrawioPreview.tsx, apps/desktop/src/renderer/features/cc-agent/workdir-browse/FileBodyView.tsx, apps/desktop/src/renderer/features/cc-agent/workdir-browse/FileFilterInput.tsx, apps/desktop/src/renderer/features/cc-agent/workdir-browse/FileTabsBar.tsx, apps/desktop/src/renderer/features/cc-agent/workdir-browse/FileTreeView.tsx, apps/desktop/src/renderer/features/cc-agent/workdir-browse/FilterResultList.tsx, apps/desktop/src/renderer/features/cc-agent/workdir-browse/ImagePreview.tsx, apps/desktop/src/renderer/features/cc-agent/workdir-browse/OpenInSystemActions.tsx, apps/desktop/src/renderer/features/cc-agent/workdir-browse/PdfPreview.tsx, apps/desktop/src/renderer/features/cc-agent/workdir-browse/SessionTabsBar.tsx, apps/desktop/src/renderer/features/cc-agent/workdir-browse/UnrenderablePlaceholder.tsx, apps/desktop/src/renderer/features/cc-agent/workdir-browse/WorkdirBrowseRoute.tsx, apps/desktop/src/renderer/features/cc-agent/workdir-browse/WorkdirBrowseSidebar.tsx, apps/desktop/src/renderer/features/cc-agent/workdir-browse/hooks/useChatRailCollapsed.ts, apps/desktop/src/renderer/features/cc-agent/workdir-browse/hooks/useChatRailResize.ts, apps/desktop/src/renderer/features/cc-agent/workdir-browse/hooks/useConfirmSwitchAwayIfDirty.ts, apps/desktop/src/renderer/features/cc-agent/workdir-browse/hooks/useDelayedFlag.ts, apps/desktop/src/renderer/features/cc-agent/workdir-browse/hooks/useFileContent.ts, apps/desktop/src/renderer/features/cc-agent/workdir-browse/hooks/useFileTree.ts, apps/desktop/src/renderer/features/cc-agent/workdir-browse/hooks/useOpenTabs.ts, apps/desktop/src/renderer/features/cc-agent/workdir-browse/hooks/useProjectFileList.ts, apps/desktop/src/renderer/features/cc-agent/workdir-browse/hooks/useRevealFileInTree.ts, apps/desktop/src/renderer/features/cc-agent/workdir-browse/lib/activeFileBodyHandle.ts, apps/desktop/src/renderer/features/cc-agent/workdir-browse/lib/docModeSwitchProjects.ts, apps/desktop/src/renderer/features/cc-agent/workdir-browse/lib/drawioExt.ts, apps/desktop/src/renderer/features/cc-agent/workdir-browse/lib/expandedStore.ts, apps/desktop/src/renderer/features/cc-agent/workdir-browse/lib/fileContentCache.ts, apps/desktop/src/renderer/features/cc-agent/workdir-browse/lib/fileIcon.ts, apps/desktop/src/renderer/features/cc-agent/workdir-browse/lib/fileMeta.ts, apps/desktop/src/renderer/features/cc-agent/workdir-browse/lib/fileScrollStore.ts, apps/desktop/src/renderer/features/cc-agent/workdir-browse/lib/fileSelectionParams.ts, apps/desktop/src/renderer/features/cc-agent/workdir-browse/lib/filterFiles.ts, apps/desktop/src/renderer/features/cc-agent/workdir-browse/lib/imageExt.ts, apps/desktop/src/renderer/features/cc-agent/workdir-browse/lib/markdownAutosave.ts, apps/desktop/src/renderer/features/cc-agent/workdir-browse/lib/openTabsStore.ts, apps/desktop/src/renderer/features/cc-agent/workdir-browse/lib/pdfExt.ts, apps/desktop/src/renderer/features/cc-agent/workdir-browse/lib/selectedFileStore.ts, apps/desktop/src/renderer/features/cc-agent/workdir-browse/search/SearchInput.tsx, apps/desktop/src/renderer/features/cc-agent/workdir-browse/search/SearchPanel.tsx, apps/desktop/src/renderer/features/cc-agent/workdir-browse/search/SearchResults.tsx, apps/desktop/src/renderer/features/cc-agent/workdir-browse/search/hooks/useProjectSearch.ts | 17 | 7 | 45 || `desktop.chat.new-draft` | desktop | 新建任务草稿页 | hash `/cc-agent/new`(NewMakerDraftRoute) | NewMakerDraftRoute | apps/desktop/src/renderer/features/cc-agent/NewMakerDraftRoute.tsx | 15 | 0 | 3 || `desktop.chat.orca-workflow` | desktop | Orca 协同工作台 | hash `/cc-agent/orca/:sessionId`(OrcaWorkflowRoute) | CCAgentSessionView, OrcaSplitView, OrcaWorkerPanel, OrcaWorkflowRoute | apps/desktop/src/renderer/components/chat/AgentActionRow.tsx, apps/desktop/src/renderer/components/chat/AgentActionsBlock.tsx, apps/desktop/src/renderer/components/chat/AgentOnOtherDeviceContext.tsx, apps/desktop/src/renderer/components/chat/AgentTaskCard.tsx, apps/desktop/src/renderer/components/chat/AgentTaskLiveDetails.tsx, apps/desktop/src/renderer/components/chat/AnnotationStrokesSvg.tsx, apps/desktop/src/renderer/components/chat/AskUserQuestionBubble.tsx, apps/desktop/src/renderer/components/chat/AssistantMessage.tsx, apps/desktop/src/renderer/components/chat/AutomationOriginBadge.tsx, apps/desktop/src/renderer/components/chat/ChatAudioCard.tsx, apps/desktop/src/renderer/components/chat/ChatDisplaySnapshotContext.tsx, apps/desktop/src/renderer/components/chat/ChatImageView.tsx, apps/desktop/src/renderer/components/chat/ChatLoadingImage.tsx, apps/desktop/src/renderer/components/chat/ChatSessionFileContext.tsx, apps/desktop/src/renderer/components/chat/ChatSoundEffectCard.tsx, apps/desktop/src/renderer/components/chat/ChatVideoView.tsx, apps/desktop/src/renderer/components/chat/CindyMakeDoctorCard.tsx, apps/desktop/src/renderer/components/chat/CopyAsImageBlock.tsx, apps/desktop/src/renderer/components/chat/CredentialSwitchWaitBanner.tsx, apps/desktop/src/renderer/components/chat/DiffView.tsx, apps/desktop/src/renderer/components/chat/ErrorBanner.tsx, apps/desktop/src/renderer/components/chat/ErrorMessageCard.tsx, apps/desktop/src/renderer/components/chat/GeneratedFilesCard.tsx, apps/desktop/src/renderer/components/chat/GhostCardHostPrompts.tsx, apps/desktop/src/renderer/components/chat/GhostSummonCard.tsx, apps/desktop/src/renderer/components/chat/GhostToolCard.tsx, apps/desktop/src/renderer/components/chat/HookTaskCard.tsx, apps/desktop/src/renderer/components/chat/ImageGalleryContext.tsx, apps/desktop/src/renderer/components/chat/ImageHoverPreview.tsx, apps/desktop/src/renderer/components/chat/ImageLightbox.tsx, apps/desktop/src/renderer/components/chat/ImageMissingPlaceholder.tsx, apps/desktop/src/renderer/components/chat/InlineReferenceChip.tsx, apps/desktop/src/renderer/components/chat/InterruptedTurnBanner.tsx, apps/desktop/src/renderer/components/chat/JumpToBottomChip.tsx, apps/desktop/src/renderer/components/chat/MarkdownDiffBlock.tsx, apps/desktop/src/renderer/components/chat/MarkdownMermaidBlock.tsx, apps/desktop/src/renderer/components/chat/MarkdownRenderer.tsx, apps/desktop/src/renderer/components/chat/MermaidLightbox.tsx, apps/desktop/src/renderer/components/chat/MessageActionBar.tsx, apps/desktop/src/renderer/components/chat/MessageNavRail.tsx, apps/desktop/src/renderer/components/chat/MessageSourceLabels.tsx, apps/desktop/src/renderer/components/chat/MessageStream.tsx, apps/desktop/src/renderer/components/chat/MessageViewport.tsx, apps/desktop/src/renderer/components/chat/ModelLightbox.tsx, apps/desktop/src/renderer/components/chat/NewMessageIndicator.tsx, apps/desktop/src/renderer/components/chat/PlanReviewBubble.tsx, apps/desktop/src/renderer/components/chat/PrevMessageJumpChip.tsx, apps/desktop/src/renderer/components/chat/ProjectLinkChip.tsx, apps/desktop/src/renderer/components/chat/QuoteChip.tsx, apps/desktop/src/renderer/components/chat/RewindPreviewDialog.tsx, apps/desktop/src/renderer/components/chat/SelectionQuoteButton.tsx, apps/desktop/src/renderer/components/chat/SentAgentReferenceChip.tsx, apps/desktop/src/renderer/components/chat/SentInlineAtomBody.tsx, apps/desktop/src/renderer/components/chat/SessionHandoffCard.tsx, apps/desktop/src/renderer/components/chat/SessionLinkChip.tsx, apps/desktop/src/renderer/components/chat/ShareMessageCheckbox.tsx, apps/desktop/src/renderer/components/chat/ShareSelectionBar.tsx, apps/desktop/src/renderer/components/chat/SlackIcon.tsx, apps/desktop/src/renderer/components/chat/StreamFadeSpan.tsx, apps/desktop/src/renderer/components/chat/StreamingMarkdownChunk.tsx, apps/desktop/src/renderer/components/chat/SystemCard.tsx, apps/desktop/src/renderer/components/chat/TextLightbox.tsx, apps/desktop/src/renderer/components/chat/ThinkingCard.tsx, apps/desktop/src/renderer/components/chat/ThinkingText.tsx, apps/desktop/src/renderer/components/chat/TodoListCard.tsx, apps/desktop/src/renderer/components/chat/ToolCallCard.tsx, apps/desktop/src/renderer/components/chat/ToolPayloadLightbox.tsx, apps/desktop/src/renderer/components/chat/TopRightChipStack.tsx, apps/desktop/src/renderer/components/chat/TurnChangesCard.tsx, apps/desktop/src/renderer/components/chat/UnreadFailedScheduleBanner.tsx, apps/desktop/src/renderer/components/chat/UpgradeBanner.tsx, apps/desktop/src/renderer/components/chat/UserAttachmentChip.tsx, apps/desktop/src/renderer/components/chat/UserMessage.tsx, apps/desktop/src/renderer/components/chat/UserMessageEditBox.tsx, apps/desktop/src/renderer/components/chat/UserMessageUrlLink.tsx, apps/desktop/src/renderer/components/chat/VideoLightbox.tsx, apps/desktop/src/renderer/components/chat/WorkGroupBlock.tsx, apps/desktop/src/renderer/components/chat/WorktreeRestoreBanner.tsx, apps/desktop/src/renderer/components/chat/XIcon.tsx, apps/desktop/src/renderer/components/chat/activityRowChrome.ts, apps/desktop/src/renderer/components/chat/animateFocusScroll.ts, apps/desktop/src/renderer/components/chat/autoFollowIntent.ts, apps/desktop/src/renderer/components/chat/chatChrome.ts, apps/desktop/src/renderer/components/chat/errorReasonI18n.ts, apps/desktop/src/renderer/components/chat/generatedFilesProjection.ts, apps/desktop/src/renderer/components/chat/imageDisplaySize.ts, apps/desktop/src/renderer/components/chat/lightboxAnnotations.ts, apps/desktop/src/renderer/components/chat/lightboxGestures.ts, apps/desktop/src/renderer/components/chat/markdownImageTargets.ts, apps/desktop/src/renderer/components/chat/markdownMedia.ts, apps/desktop/src/renderer/components/chat/messageNavRailModel.ts, apps/desktop/src/renderer/components/chat/messageNavRailWheel.ts, apps/desktop/src/renderer/components/chat/messageNavigationProjection.ts, apps/desktop/src/renderer/components/chat/messageProjectionCache.ts, apps/desktop/src/renderer/components/chat/messageStreamIndicatorPosition.ts, apps/desktop/src/renderer/components/chat/messageViewportCompensation.ts, apps/desktop/src/renderer/components/chat/messageViewportGeometry.ts, apps/desktop/src/renderer/components/chat/messageWorkGroups.ts, apps/desktop/src/renderer/components/chat/observeProgrammaticScroll.ts, apps/desktop/src/renderer/components/chat/rehypeFencedCodeMarker.ts, apps/desktop/src/renderer/components/chat/rehypeHighlightShared.ts, apps/desktop/src/renderer/components/chat/rehypeMathBlockMarker.ts, apps/desktop/src/renderer/components/chat/rehypeStreamWordFade.ts, apps/desktop/src/renderer/components/chat/remarkHtmlImages.ts, apps/desktop/src/renderer/components/chat/remarkLocalPathLinks.ts, apps/desktop/src/renderer/components/chat/remarkPreserveRawLocalDestinations.ts, apps/desktop/src/renderer/components/chat/remarkSessionLinks.ts, apps/desktop/src/renderer/components/chat/remarkStrictInlineMath.ts, apps/desktop/src/renderer/components/chat/remarkTruncateCjkUrls.ts, apps/desktop/src/renderer/components/chat/repairStreamingMarkdown.ts, apps/desktop/src/renderer/components/chat/scrollAnchoringDetect.ts, apps/desktop/src/renderer/components/chat/shareSelectionStore.ts, apps/desktop/src/renderer/components/chat/streamingMarkdownBlocks.tsx, apps/desktop/src/renderer/components/chat/streamingMarkdownChunks.ts, apps/desktop/src/renderer/components/chat/streamingMessageProjection.ts, apps/desktop/src/renderer/components/chat/toolLoopI18n.ts, apps/desktop/src/renderer/components/chat/unreadCount.ts, apps/desktop/src/renderer/components/chat/useAutomaticHistoryLoadBudget.ts, apps/desktop/src/renderer/components/chat/useCopyAsImage.tsx, apps/desktop/src/renderer/components/chat/useDeleteMessage.ts, apps/desktop/src/renderer/components/chat/useFileChipContextMenu.tsx, apps/desktop/src/renderer/components/chat/useForkAtMessage.ts, apps/desktop/src/renderer/components/chat/useImageClipboard.ts, apps/desktop/src/renderer/components/chat/useImageLoadFailure.ts, apps/desktop/src/renderer/components/chat/useMessageViewport.ts, apps/desktop/src/renderer/components/chat/useNavigationKeyListener.ts, apps/desktop/src/renderer/components/chat/useOpenWithMenu.tsx, apps/desktop/src/renderer/components/chat/usePrevUserMessageInView.ts, apps/desktop/src/renderer/components/chat/useTurnChangeSets.ts, apps/desktop/src/renderer/components/chat/userMessageCollapse.ts, apps/desktop/src/renderer/components/chat/userMessageDisplayText.ts, apps/desktop/src/renderer/components/chat/userMessageLinkify.ts, apps/desktop/src/renderer/components/chat/viewportFillDetect.ts, apps/desktop/src/renderer/components/new-chat/AddRemoteProjectDialog.tsx, apps/desktop/src/renderer/components/new-chat/AgentSelect.tsx, apps/desktop/src/renderer/components/new-chat/AskUserQuestionPrompt.tsx, apps/desktop/src/renderer/components/new-chat/AtMentionPanel.tsx, apps/desktop/src/renderer/components/new-chat/AttachmentTypeThumb.tsx, apps/desktop/src/renderer/components/new-chat/ChatInput.tsx, apps/desktop/src/renderer/components/new-chat/CjkPunctDecoration.ts, apps/desktop/src/renderer/components/new-chat/CjkPunctuationUtils.ts, apps/desktop/src/renderer/components/new-chat/ComposerAttachments.tsx, apps/desktop/src/renderer/components/new-chat/ComposerListIndentDecoration.ts, apps/desktop/src/renderer/components/new-chat/ComposerListNodes.ts, apps/desktop/src/renderer/components/new-chat/ComposerQuoteNode.tsx, apps/desktop/src/renderer/components/new-chat/DeviceSwitcherPill.tsx, apps/desktop/src/renderer/components/new-chat/EffortSlider.tsx, apps/desktop/src/renderer/components/new-chat/EmptyDocSelectionGuard.ts, apps/desktop/src/renderer/components/new-chat/ExtraDirsButton.tsx, apps/desktop/src/renderer/components/new-chat/FastModeToggle.tsx, apps/desktop/src/renderer/components/new-chat/FolderPickerPopover.tsx, apps/desktop/src/renderer/components/new-chat/FullAccessConfirmContent.tsx, apps/desktop/src/renderer/components/new-chat/GhostCommandDecoration.ts, apps/desktop/src/renderer/components/new-chat/GoalAdvancedLimits.tsx, apps/desktop/src/renderer/components/new-chat/GoalIndicator.tsx, apps/desktop/src/renderer/components/new-chat/HomeUsageDashboard.tsx, apps/desktop/src/renderer/components/new-chat/ListComposerTextarea.tsx, apps/desktop/src/renderer/components/new-chat/LocalModelCatalogNotice.tsx, apps/desktop/src/renderer/components/new-chat/MentionChipNode.tsx, apps/desktop/src/renderer/components/new-chat/MentionDragCaretDecoration.ts, apps/desktop/src/renderer/components/new-chat/ModelCompatibilityNotice.tsx, apps/desktop/src/renderer/components/new-chat/ModelConfigFlyout.tsx, apps/desktop/src/renderer/components/new-chat/ModelHarnessPicker.tsx, apps/desktop/src/renderer/components/new-chat/ModelSelector.tsx, apps/desktop/src/renderer/components/new-chat/ModelSourceDetails.tsx, apps/desktop/src/renderer/components/new-chat/NewGoalDialog.tsx, apps/desktop/src/renderer/components/new-chat/PastedTextChipNode.tsx, apps/desktop/src/renderer/components/new-chat/PendingQueuePanel.tsx, apps/desktop/src/renderer/components/new-chat/PermissionPrompt.tsx, apps/desktop/src/renderer/components/new-chat/PermissionSelector.tsx, apps/desktop/src/renderer/components/new-chat/PinnedPlanPanel.tsx, apps/desktop/src/renderer/components/new-chat/PlanActionCard.tsx, apps/desktop/src/renderer/components/new-chat/PlanModeIndicator.tsx, apps/desktop/src/renderer/components/new-chat/PlanViewerCard.tsx, apps/desktop/src/renderer/components/new-chat/PluginConnectionForm.tsx, apps/desktop/src/renderer/components/new-chat/PluginOauthDeviceCode.tsx, apps/desktop/src/renderer/components/new-chat/PluginSetupPrompt.tsx, apps/desktop/src/renderer/components/new-chat/PluginSetupRemoteDesktopButton.tsx, apps/desktop/src/renderer/components/new-chat/PluginWriteAccessRecovery.tsx, apps/desktop/src/renderer/components/new-chat/QuickStartPillMark.ts, apps/desktop/src/renderer/components/new-chat/RemoteOauthSetupCard.tsx, apps/desktop/src/renderer/components/new-chat/SendButton.tsx, apps/desktop/src/renderer/components/new-chat/SlashCommandDecoration.ts, apps/desktop/src/renderer/components/new-chat/SlashCommandPalette.tsx, apps/desktop/src/renderer/components/new-chat/TakeoverMask.tsx, apps/desktop/src/renderer/components/new-chat/ThinkingToggle.tsx, apps/desktop/src/renderer/components/new-chat/UnifiedFlyoutHost.tsx, apps/desktop/src/renderer/components/new-chat/UnifiedModelPanel.tsx, apps/desktop/src/renderer/components/new-chat/UnifiedModelRail.tsx, apps/desktop/src/renderer/components/new-chat/UnifiedModelRow.tsx, apps/desktop/src/renderer/components/new-chat/UsageDailyBars.tsx, apps/desktop/src/renderer/components/new-chat/UsageHeatmap.tsx, apps/desktop/src/renderer/components/new-chat/VendorSegmentedSwitcher.tsx, apps/desktop/src/renderer/components/new-chat/VoiceInputDraftDecoration.ts, apps/desktop/src/renderer/components/new-chat/WindowsSelectionReplacement.ts, apps/desktop/src/renderer/components/new-chat/WorktreeChipsRow.tsx, apps/desktop/src/renderer/components/new-chat/WorktreeCreatingOverlay.tsx, apps/desktop/src/renderer/components/new-chat/agentOptions.ts, apps/desktop/src/renderer/components/new-chat/agentSwitchConfirmation.ts, apps/desktop/src/renderer/components/new-chat/branchPick.ts, apps/desktop/src/renderer/components/new-chat/composerBlankPointerFocus.ts, apps/desktop/src/renderer/components/new-chat/composerContentSerialization.ts, apps/desktop/src/renderer/components/new-chat/composerDocState.ts, apps/desktop/src/renderer/components/new-chat/composerFrameScheduler.ts, apps/desktop/src/renderer/components/new-chat/composerHistoryProjection.ts, apps/desktop/src/renderer/components/new-chat/composerModelSelection.ts, apps/desktop/src/renderer/components/new-chat/composerPromptRecommendation.ts, apps/desktop/src/renderer/components/new-chat/composerRenderGate.ts, apps/desktop/src/renderer/components/new-chat/composerSendOwnership.ts, apps/desktop/src/renderer/components/new-chat/composerSendSnapshot.ts, apps/desktop/src/renderer/components/new-chat/effortChangeQueue.ts, apps/desktop/src/renderer/components/new-chat/extraDirsActions.ts, apps/desktop/src/renderer/components/new-chat/ghostComposerPlacement.ts, apps/desktop/src/renderer/components/new-chat/localAttachmentPicker.ts, apps/desktop/src/renderer/components/new-chat/mentionChipInsertion.ts, apps/desktop/src/renderer/components/new-chat/modelWindowErrorToast.ts, apps/desktop/src/renderer/components/new-chat/pastePipeline.ts, apps/desktop/src/renderer/components/new-chat/pathPaste.ts, apps/desktop/src/renderer/components/new-chat/pendingQueueLocks.ts, apps/desktop/src/renderer/components/new-chat/pendingQueueRowActivity.ts, apps/desktop/src/renderer/components/new-chat/pendingQueueRowPresentation.ts, apps/desktop/src/renderer/components/new-chat/planModeComposerCommand.ts, apps/desktop/src/renderer/components/new-chat/priceTierMarks.tsx, apps/desktop/src/renderer/components/new-chat/remoteBrowseAdapters.ts, apps/desktop/src/renderer/components/new-chat/remoteExistingProjects.ts, apps/desktop/src/renderer/components/new-chat/restoreComposerDocument.ts, apps/desktop/src/renderer/components/new-chat/sessionLinkPaste.ts, apps/desktop/src/renderer/components/new-chat/sourceSwitch.ts, apps/desktop/src/renderer/components/new-chat/unifiedModelSelection.ts, apps/desktop/src/renderer/components/new-chat/usagePalette.ts, apps/desktop/src/renderer/components/new-chat/useComposerSendFocusRestore.ts, apps/desktop/src/renderer/components/new-chat/useModelDiscoveryPending.ts, apps/desktop/src/renderer/components/new-chat/useProviderWeeklyQuota.ts, apps/desktop/src/renderer/components/new-chat/useUnifiedRowActions.ts, apps/desktop/src/renderer/features/cc-agent/CCAgentFeatureLayout.tsx, apps/desktop/src/renderer/features/cc-agent/CCAgentSessionView.tsx, apps/desktop/src/renderer/features/cc-agent/OrcaSplitView.tsx, apps/desktop/src/renderer/features/cc-agent/OrcaWorkerPanel.tsx, apps/desktop/src/renderer/features/cc-agent/OrcaWorkflowRoute.tsx | 249 | 38 | 337 |diff --git a/docs/product-rules/bot-group-chat.md b/docs/product-rules/bot-group-chat.mdindex eb0a68fc0b..e70256b6dc 100644--- a/docs/product-rules/bot-group-chat.md+++ b/docs/product-rules/bot-group-chat.md@@ -51,7 +51,8 @@`route_key = 'group:<groupId>'`。它与伙伴主任务共享同一个 Profile 与 Bot Home,按需在第一次轮到该伙伴发言时创建。- 群专线 Session 不进入任务列表、伙伴主时间线、历史会话列表、未读和系统通知(分工停下时的手机推送见 8.3);它随伙伴 Profile 更新推进- Profile 版本,权限档跟随伙伴主任务。+ Profile 版本,权限档跟随伙伴主任务。唯一的例外是灵动岛报错卡:群专线失败时灵动岛照常留下这张卡,点击回到它所在的群并+ 处置被点的那张卡,规则见 `cindy-bots-runtime.md` 6.2;失败本身仍按 4.4 显示在群时间线里。- 伙伴被删除时,其成员关系一并移除;群里已有的消息保留发言时的名字快照。- 删除群会删除群、成员与群消息,并归档各成员在该群的群专线 Session;伙伴本身、记忆与私聊不受影响。diff --git a/docs/product-rules/cindy-bots-runtime.md b/docs/product-rules/cindy-bots-runtime.mdindex 80c24de107..dfefa8e94a 100644--- a/docs/product-rules/cindy-bots-runtime.md+++ b/docs/product-rules/cindy-bots-runtime.md@@ -472,7 +472,12 @@ Session 任务遵守同一套机制与呈现契约:- 用户正在看对应任务时不发外部通知;后台时仍按全局桌面、飞书、移动端与灵动岛去重规则投递。- 伙伴私聊的结构化入口不触发通知;接收伙伴随后产出的正常回复才有提醒价值。- 点击伙伴任务的通知必须回到伙伴自己的主任务或历史任务路由,不能把隐藏的 `source=bot`- Session 丢进普通任务列表。+ Session 丢进普通任务列表。群专线回到它所在的群,历史任务进只读历史路由;委派执行仍是原伙伴+ 任务地址(会显示任务不可用)。这些目标没有可处置该任务报错的横幅,灵动岛点击的目标地址提交+ 后即处置被点的那张卡;只读历史要等历史页自己的归属校验通过、真正显示出这段历史后才处置。+ 只认最近一次点击时的那张卡:被新点击取代(含同一任务再点一次)、导航被重定向或改去别处(含历史+ 页校验不通过被重定向走)、点击后又开始新一轮、出现新的失败或完成,或只是直接打开地址,都不处置,+ 新的提醒照常出现。处置只清提醒,任务记录、失败状态与错误行不变。主任务仍只由报错横幅处置。- iOS 的伙伴正常回复使用系统通信通知:伙伴名字、头像与回复摘要,应用角标由系统绘制。普通任务、报错和待处理事项保留原通知语义。头像仅携带有界缩略图、内置头像标识或单个字符,不上传公开头像地址;缺失头像回退名字首字,扩展失败仍交付原通知。diff --git a/packages/maker-shared/src/botGroupChat.ts b/packages/maker-shared/src/botGroupChat.tsindex f916cb3cfb..4261b0757a 100644--- a/packages/maker-shared/src/botGroupChat.ts+++ b/packages/maker-shared/src/botGroupChat.ts@@ -541,6 +541,12 @@ export function botGroupPlanRouteKeyPrefix(groupId: string): string {return `group:${groupId}:plan:`;}+/** Group id of any lane or 分工 Session route key (`group:<groupId>…`), or null for other routes. */+export function parseBotGroupIdFromRouteKey(routeKey: string | null | undefined): string | null {+ const match = typeof routeKey === 'string' ? /^group:([^:]+)(?::|$)/.exec(routeKey) : null;+ return match ? match[1]! : null;+}+/** Plan id of a 分工 Session route key, or null for lanes and other routes. */export function parseBotGroupPlanRouteKey(routeKey: string | null | undefined): { groupId: string; planId: string } | null {const match = typeof routeKey === 'string' ? /^group:([^:]+)(?::access:(?:owner|tools|chat):[1-9][0-9]*)?:plan:([^:]+)$/.exec(routeKey) : null;