Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。
TypeScript agentai-agentai-assistantandroidclaude-codecodexelectroniosllmmacosreact-nativetypescriptwindows
fix(cindy-make): 隐藏并禁用所有用户入口
MagicLizi68d62d3d9f85
diff --git a/apps/desktop/src/main/bootstrap-electron.ts b/apps/desktop/src/main/bootstrap-electron.tsindex 8210967337..1ad7722ad6 100644--- a/apps/desktop/src/main/bootstrap-electron.ts+++ b/apps/desktop/src/main/bootstrap-electron.ts@@ -88,6 +88,7 @@ import { execFile, execFileSync, spawn } from 'node:child_process';import { machineIdSync } from 'node-machine-id';import windowStateKeeper from 'electron-window-state';import { BRAND_NAME } from '@cindy/maker-shared/branding';+import { assertCindyMakeEnabled } from './cindy-make/featureGate.js';import {shouldRequestSingleInstanceLock,resolveSingleInstanceLockUserDataDir,@@ -7519,6 +7520,7 @@ const registerIpcHandlers = () => {// The path is derived in main so the renderer cannot choose an arbitrary folder.ipcMain.handle('app:open-cindy-make-tools-dir', async (event): Promise<{ success: boolean }> => {assertTrustedAppRendererEvent(event);+ assertCindyMakeEnabled();return openMakeToolsDirectory(app.getPath('userData'), {openPath: (directory) => shell.openPath(directory),});@@ -7530,10 +7532,12 @@ const registerIpcHandlers = () => {configureUpstreamMerge((id) => getMakerIfReady()?.getSession(id)?.isTurnRunning() ?? false);ipcMain.handle('app:cindy-make-merge', async (event, input: unknown) => {assertTrustedAppRendererEvent(event);+ assertCindyMakeEnabled();return actUpstreamMerge(input);});ipcMain.handle('app:get-cindy-make-source-status', async (event) => {assertTrustedAppRendererEvent(event);+ assertCindyMakeEnabled();const userData = app.getPath('userData');const root = makeSourceRoot(userData);const channel = !app.isPackaged@@ -7577,12 +7581,14 @@ const registerIpcHandlers = () => {);ipcMain.handle('app:get-cindy-make-settings', (event) => {assertTrustedAppRendererEvent(event);+ assertCindyMakeEnabled();return readCindyMakeSettings();});ipcMain.handle('app:set-cindy-make-sync-latest-before-build',(event, enabled: unknown) => {assertTrustedAppRendererEvent(event);+ assertCindyMakeEnabled();if (typeof enabled !== 'boolean')throwIpcError('INVALID_PARAMS', 'Invalid Cindy Make setting');return writeCindyMakeSyncLatestBeforeBuild(enabled);@@ -7590,6 +7596,7 @@ const registerIpcHandlers = () => {);ipcMain.handle('app:cindy-make-history', async (event, selected?: unknown) => {assertTrustedAppRendererEvent(event);+ assertCindyMakeEnabled();if (selected !== undefined &&(typeof selected !== 'string' || !/^[A-Za-z0-9-]{1,128}$/.test(selected))@@ -7617,6 +7624,7 @@ const registerIpcHandlers = () => {'app:cindy-make-history-action',async (event, runId: unknown, action: unknown) => {assertTrustedAppRendererEvent(event);+ assertCindyMakeEnabled();try {return await actCindyMakeHistory(runId, action);} catch (error) {@@ -7633,6 +7641,7 @@ const registerIpcHandlers = () => {);ipcMain.handle('app:cindy-make-history-build', async (event, selection: unknown) => {assertTrustedAppRendererEvent(event);+ assertCindyMakeEnabled();try {return await generateHistoryPersonalVersion(selection);} catch {@@ -7642,6 +7651,7 @@ const registerIpcHandlers = () => {app.once('will-quit', stopMakeHistoryBuild);ipcMain.handle('app:cindy-make-history-cancel-build', async (event, buildId: unknown) => {assertTrustedAppRendererEvent(event);+ assertCindyMakeEnabled();try {return await cancelHistoryPersonalVersion(buildId);} catch {@@ -7650,6 +7660,7 @@ const registerIpcHandlers = () => {});ipcMain.handle('app:cindy-make-history-open-build', async (event) => {assertTrustedAppRendererEvent(event);+ assertCindyMakeEnabled();try {await openHistoryPersonalBuild();} catch {@@ -7663,6 +7674,7 @@ const registerIpcHandlers = () => {);ipcMain.handle('app:cindy-versions-state', async (event) => {assertTrustedAppRendererEvent(event);+ assertCindyMakeEnabled();try {return await getCindyVersions();} catch {@@ -7671,6 +7683,7 @@ const registerIpcHandlers = () => {});ipcMain.handle('app:cindy-versions-action', async (event, action: unknown, id: unknown) => {assertTrustedAppRendererEvent(event);+ assertCindyMakeEnabled();return actCindyVersion(action, id);});onQuit('cindy-make-tests', () => cindyMakeTestController.stopAllAndWait(), 'async');@@ -7679,6 +7692,7 @@ const registerIpcHandlers = () => {'app:cindy-make-test',async (event, sessionId: unknown, completionId: unknown, action: unknown) => {assertTrustedAppRendererEvent(event);+ assertCindyMakeEnabled();return actCindyMakeTest(sessionId, completionId, action);},);@@ -7696,6 +7710,7 @@ const registerIpcHandlers = () => {);ipcMain.handle('app:get-cindy-make-state', async (event) => {assertTrustedAppRendererEvent(event);+ assertCindyMakeEnabled();refreshUpstreamMergeProjection();try {await restoreCindyMakeTaskState();@@ -7716,6 +7731,7 @@ const registerIpcHandlers = () => {'app:manage-cindy-make-task',async (event, sessionId: unknown, action: unknown) => {assertTrustedAppRendererEvent(event);+ assertCindyMakeEnabled();await manageCindyMakeTask(sessionId, action).catch((error) => {if (error instanceof Error && error.message.startsWith('[')) throw error;throwIpcError('INTERNAL', 'cleanupFailed');@@ -7724,11 +7740,13 @@ const registerIpcHandlers = () => {);ipcMain.handle('app:cancel-cindy-make-source', async (event): Promise<{ success: boolean }> => {assertTrustedAppRendererEvent(event);+ assertCindyMakeEnabled();return { success: cancelCindySourcePreparation() };});ipcMain.handle('app:open-cindy-make-source-dir', async (event): Promise<{ success: boolean }> => {assertTrustedAppRendererEvent(event);+ assertCindyMakeEnabled();return openMakeSourceDirectory(app.getPath('userData'), {openPath: (directory) => shell.openPath(directory),});@@ -7738,6 +7756,7 @@ const registerIpcHandlers = () => {// 只认 runId 形状;路径全部由 main 从 userData 派生,renderer 只拿回结果。ipcMain.handle('app:start-cindy-make-task', async (event, input: unknown) => {assertTrustedAppRendererEvent(event);+ assertCindyMakeEnabled();return startCindyMakeTask(input, event.sender.id).catch((error) => {if (error instanceof Error && error.message.startsWith('[')) throw error;throwIpcError('INTERNAL', 'Could not start Cindy Make preparation');@@ -7745,12 +7764,14 @@ const registerIpcHandlers = () => {});ipcMain.handle('app:cancel-cindy-make-task', async (event, runId: unknown) => {assertTrustedAppRendererEvent(event);+ assertCindyMakeEnabled();if (typeof runId !== 'string' || !CINDY_MAKE_RUN_ID_PATTERN.test(runId))throwIpcError('INVALID_PARAMS', 'Invalid Cindy Make run');return { success: cindyMakeManager.cancel(runId, event.sender.id) === 'cancelled' };});ipcMain.handle('app:prepare-cindy-make-workspace', async (event, runId: unknown) => {assertTrustedAppRendererEvent(event);+ assertCindyMakeEnabled();if (typeof runId !== 'string' || !CINDY_MAKE_RUN_ID_PATTERN.test(runId))throwIpcError('INVALID_PARAMS', 'Invalid Cindy Make run');const userData = app.getPath('userData');diff --git a/apps/desktop/src/main/cindy-make/__tests__/mcpProvider.test.ts b/apps/desktop/src/main/cindy-make/__tests__/mcpProvider.test.tsindex 2e6efe6b91..a81db436aa 100644--- a/apps/desktop/src/main/cindy-make/__tests__/mcpProvider.test.ts+++ b/apps/desktop/src/main/cindy-make/__tests__/mcpProvider.test.ts@@ -2,7 +2,7 @@ import { Client } from '@modelcontextprotocol/sdk/client/index.js';import { InMemoryTransport } from '@modelcontextprotocol/sdk/inMemory.js';import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';import type { McpProviderContext } from '@cindy/maker-core';-import { describe, expect, it, vi } from 'vitest';+import { beforeEach, describe, expect, it, vi } from 'vitest';import {CINDY_MAKE_MCP_SERVER_NAME,@@ -11,6 +11,14 @@ import {} from '../../../shared/cindyMakeSession';import { createCindyMakeMcpProvider, isCindyMakeServerVisible } from '../mcpProvider';++const feature = vi.hoisted(() => ({ enabled: true }));+vi.mock('@cindy/maker-shared/cindy-make-feature', async (importOriginal) => ({+ ...await importOriginal<typeof import('@cindy/maker-shared/cindy-make-feature')>(),+ get CINDY_MAKE_ENABLED() { return feature.enabled; },+}));+beforeEach(() => { feature.enabled = true; });+const logger = { info: vi.fn(), warn: vi.fn() };function marked(sessionId = 'make-1'): McpProviderContext {@@ -129,3 +137,15 @@ describe('cindy_make report_complete', () => {expect(JSON.stringify(result.content)).toContain('REPORT_FAILED');});});+describe('disabled Cindy Make', () => {+ it('hides marked sessions and global bridges and never registers the tool', () => {+ feature.enabled = false;+ for (const context of [marked(), { agentKind: 'codex', workingDir: '', vendorOptions: {} }, { agentKind: 'pi', workingDir: '', vendorOptions: {} }] as McpProviderContext[]) {+ expect(isCindyMakeServerVisible(context)).toBe(false);+ const reportCompletion = vi.fn();+ const provider = createCindyMakeMcpProvider({ reportCompletion, logger });+ expect(provider.toClaudeSdkConfig?.(context)).toBeNull();+ expect(reportCompletion).not.toHaveBeenCalled();+ }+ });+});diff --git a/apps/desktop/src/main/cindy-make/doctorCommand.ts b/apps/desktop/src/main/cindy-make/doctorCommand.tsindex 50d3aac71b..b111caeb35 100644--- a/apps/desktop/src/main/cindy-make/doctorCommand.ts+++ b/apps/desktop/src/main/cindy-make/doctorCommand.ts@@ -25,6 +25,7 @@ import {export function createMakeDoctorCommand<T extends MakeDoctorEnvironment>(deps: {name?: 'cindy-make-doctor' | 'cindy-make';+ isVisible?: DesktopCommandDefinition['isVisible'];environment: (ctx: DesktopCommandContext) => T | Promise<T>;allowInstallTest?: () => boolean;prepare?: (@@ -47,6 +48,7 @@ export function createMakeDoctorCommand<T extends MakeDoctorEnvironment>(deps: {const name = deps.name ?? 'cindy-make-doctor';return {name,+ ...(deps.isVisible ? { isVisible: deps.isVisible } : {}),get description() {return deps.description();},diff --git a/apps/desktop/src/main/cindy-make/featureGate.ts b/apps/desktop/src/main/cindy-make/featureGate.tsnew file mode 100644index 0000000000..bd7c0602f2--- /dev/null+++ b/apps/desktop/src/main/cindy-make/featureGate.ts@@ -0,0 +1,13 @@+import { CINDY_MAKE_ENABLED, isCindyMakeSource } from '@cindy/maker-shared/cindy-make-feature';+import { throwIpcError } from '../utils/ipcValidate.js';++export function assertCindyMakeEnabled(): void {+ if (!CINDY_MAKE_ENABLED) {+ throwIpcError('UNSUPPORTED_CAPABILITY', 'Cindy Make is currently unavailable');+ }+}++/** Check persisted purpose, including historical upstream-merge tasks. */+export function assertCindyMakeSessionAvailable(source: string | null | undefined): void {+ if (isCindyMakeSource(source)) assertCindyMakeEnabled();+}diff --git a/apps/desktop/src/main/cindy-make/mcpProvider.ts b/apps/desktop/src/main/cindy-make/mcpProvider.tsindex 9236222b0c..144b77dbd8 100644--- a/apps/desktop/src/main/cindy-make/mcpProvider.ts+++ b/apps/desktop/src/main/cindy-make/mcpProvider.ts@@ -1,5 +1,6 @@import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';import type { McpProvider, McpProviderContext } from '@cindy/maker-core';+import { CINDY_MAKE_ENABLED } from '@cindy/maker-shared/cindy-make-feature';import { resolveLiziMcpSessionContext } from '@cindy/mcps';import {CINDY_MAKE_MCP_SERVER_NAME,@@ -23,6 +24,7 @@ export interface CindyMakeMcpDeps {* server list (Pi) hides it, while each call still fails closed on the marker.*/export function isCindyMakeServerVisible(ctx: McpProviderContext): boolean {+ if (!CINDY_MAKE_ENABLED) return false;if (isCindyMakeVendorOptions(ctx.vendorOptions)) return true;return (ctx.agentKind === 'codex' || ctx.agentKind === 'pi') && !ctx.workingDir;}diff --git a/apps/desktop/src/main/cindy-make/remoteRuntime.ts b/apps/desktop/src/main/cindy-make/remoteRuntime.tsindex 12ce3ea0bc..4d5534849b 100644--- a/apps/desktop/src/main/cindy-make/remoteRuntime.ts+++ b/apps/desktop/src/main/cindy-make/remoteRuntime.ts@@ -24,6 +24,7 @@ import { createMakeRemoteProvider } from './remoteProvider.js';import { broadcastMakeRemoteChanged } from './remoteBroadcast.js';import { projectMakeRemoteCard, type MakeRemoteSnapshot } from './remoteProjection.js';import type { CindyMakeCompletionMeta } from '../../shared/cindyMakeSession.js';+import { CINDY_MAKE_ENABLED } from '@cindy/maker-shared/cindy-make-feature';const unavailable = () =>new RemoteResourceRegistryError('NOT_FOUND', 'Cindy Make task is unavailable');@@ -38,6 +39,7 @@ const parse = (raw: string | null): Record<string, unknown> => {/** Account-bound adapter. Only the explicit portable projection leaves this module. */export function registerMakeRemoteResources(isRunning: (id: string) => boolean): void {+ if (!CINDY_MAKE_ENABLED) return;let restored:{ client: ReturnType<typeof getDbClient>; stamp: string; ready: Promise<void> } | undefined;const load = async (sessionId: string) => {diff --git a/apps/desktop/src/main/commands/__tests__/builtinsRemoteRouting.test.ts b/apps/desktop/src/main/commands/__tests__/builtinsRemoteRouting.test.tsindex b3b2dd0dce..0193d59957 100644--- a/apps/desktop/src/main/commands/__tests__/builtinsRemoteRouting.test.ts+++ b/apps/desktop/src/main/commands/__tests__/builtinsRemoteRouting.test.ts@@ -57,13 +57,9 @@ beforeEach(() => {});describe('/cindy-make composer entry', () => {- it('appears in the built-in catalog under the final command name', () => {+ it('stays out of the built-in catalog while Cindy Make is disabled', () => {const { registry } = makeHarness();- expect(registry.list()).toContainEqual({- kind: 'desktop',- name: 'cindy-make',- description: expect.stringContaining('/cindy-make'),- });+ expect(registry.list().some((command) => command.name === 'cindy-make')).toBe(false);expect(registry.list().some((command) => command.name === 'cindy-maker')).toBe(false);expect(registry.list().some((command) => command.name === 'learn')).toBe(true);});@@ -73,7 +69,7 @@ describe('/cindy-make composer entry', () => {async (deviceId) => {const { registry, remoteInvoke } = makeHarness();await expect(registry.execute('cindy-make', { sessionId: 'source', deviceId })).rejects.toThrow(- '[INVALID_PARAMS]',+ 'unknown command "/cindy-make"',);expect(h.webContentsSend).not.toHaveBeenCalled();expect(remoteInvoke).not.toHaveBeenCalled();diff --git a/apps/desktop/src/main/commands/builtins.ts b/apps/desktop/src/main/commands/builtins.tsindex 00aa05f103..4a624f4675 100644--- a/apps/desktop/src/main/commands/builtins.ts+++ b/apps/desktop/src/main/commands/builtins.ts@@ -385,6 +385,7 @@ export function registerBuiltinDesktopCommands(registry.register(createMakeDoctorCommand({name,+ isVisible: () => false,description: () =>t(name === 'cindy-make' ? 'cindyMake.description' : 'cindyMakeDoctor.description'),environment: (ctx) =>diff --git a/apps/desktop/src/main/localDb/ipc/__tests__/sessionSourceGuard.test.ts b/apps/desktop/src/main/localDb/ipc/__tests__/sessionSourceGuard.test.tsindex 1a3a788f44..7aa16ae979 100644--- a/apps/desktop/src/main/localDb/ipc/__tests__/sessionSourceGuard.test.ts+++ b/apps/desktop/src/main/localDb/ipc/__tests__/sessionSourceGuard.test.ts@@ -19,16 +19,9 @@ describe('assertRendererSessionSourceAllowed', () => {).not.toThrow();});- it('accepts the Cindy Make purpose only for a managed task worktree', () => {- expect(() =>- assertRendererSessionSourceAllowed({- source: 'cindy-make',- workingDir: worktree,- remoteHostId: null,- userData,- }),- ).not.toThrow();+ it('rejects the Cindy Make purpose even for a managed task worktree while disabled', () => {for (const workingDir of [+ worktree,checkout,'C:\\repo',undefined,@@ -43,7 +36,7 @@ describe('assertRendererSessionSourceAllowed', () => {remoteHostId: null,userData,}),- ).toThrow(/\[INVALID_PARAMS\]/);+ ).toThrow(/\[UNSUPPORTED_CAPABILITY\]/);}});diff --git a/apps/desktop/src/main/localDb/ipc/sessionSourceGuard.ts b/apps/desktop/src/main/localDb/ipc/sessionSourceGuard.tsindex fcfad2b135..484f5e6ca0 100644--- a/apps/desktop/src/main/localDb/ipc/sessionSourceGuard.ts+++ b/apps/desktop/src/main/localDb/ipc/sessionSourceGuard.ts@@ -1,4 +1,5 @@import { CINDY_MAKE_SESSION_SOURCE } from '../../../shared/cindyMakeSession.js';+import { CINDY_MAKE_ENABLED } from '@cindy/maker-shared/cindy-make-feature';import { normalizeWorkingDirForStorage } from '../../../shared/workingDir.js';import { isCindyMakeWorktreePath } from '../../cindy-make/taskWorkspace.js';import { normalizeRemoteHostId } from '../mapper.js';@@ -23,6 +24,9 @@ export function assertRendererSessionSourceAllowed(input: {'Bot task creation is only available through the Bot lifecycle service',);}+ if (!CINDY_MAKE_ENABLED) {+ throwIpcError('UNSUPPORTED_CAPABILITY', 'Cindy Make is currently unavailable');+ }if (normalizeRemoteHostId(typeof input.remoteHostId === 'string' ? input.remoteHostId : null)) {throwIpcError('UNSUPPORTED_CAPABILITY', 'Cindy Make tasks are local-only');}diff --git a/apps/desktop/src/main/maker-ipc/__tests__/cindyMakeFeatureGate.test.ts b/apps/desktop/src/main/maker-ipc/__tests__/cindyMakeFeatureGate.test.tsnew file mode 100644index 0000000000..814b39c303--- /dev/null+++ b/apps/desktop/src/main/maker-ipc/__tests__/cindyMakeFeatureGate.test.ts@@ -0,0 +1,58 @@+import { readFileSync } from 'node:fs';+import { createSourceFile, forEachChild, isCallExpression, isFunctionDeclaration, isVariableDeclaration, ScriptTarget, transpileModule, type Node } from 'typescript';+import { describe, expect, it, vi } from 'vitest';+import { assertCindyMakeEnabled, assertCindyMakeSessionAvailable } from '../../cindy-make/featureGate';+import { assertReviewSessionExternalInputAllowed } from '../../reviewer/reviewSessionInputPolicy';++const source = createSourceFile('register.ts', readFileSync(new URL('../register.ts', import.meta.url), 'utf8'), ScriptTarget.Latest, true);++function expressionMatching(predicate: (node: Node) => Node | undefined): string {+ let found: Node | undefined;+ function visit(node: Node): void {+ found ??= predicate(node);+ if (!found) forEachChild(node, visit);+ }+ visit(source);+ if (!found) throw new Error('IPC wiring not found');+ return found.getText(source);+}++function bind(expression: string, deps: Record<string, unknown>) {+ const compiled = transpileModule(`return (${expression});`, { compilerOptions: { target: ScriptTarget.ES2022 } }).outputText;+ return new Function(...Object.keys(deps), compiled)(...Object.values(deps));+}++describe('disabled Cindy Make execution', () => {+ it('refuses direct feature operations and both persisted purposes but leaves ordinary sources available', () => {+ expect(assertCindyMakeEnabled).toThrow(/\[UNSUPPORTED_CAPABILITY\]/);+ for (const source of ['cindy-make', 'cindy-make-merge']) {+ expect(() => assertCindyMakeSessionAvailable(source)).toThrow(/\[UNSUPPORTED_CAPABILITY\]/);+ }+ for (const source of ['desktop', 'bot', 'review', null, undefined]) {+ expect(() => assertCindyMakeSessionAvailable(source)).not.toThrow();+ }+ });++ it.each(['cindy-make', 'cindy-make-merge'])('blocks enqueue, steer, resume and retry for %s before preparation or dispatch', async (sessionSource) => {+ const prepareSharedTaskInput = vi.fn();+ const inputCoordinator = { getGeneration: vi.fn(), enqueue: vi.fn(), steer: vi.fn(), resume: vi.fn(), retryLastError: vi.fn() };+ const readSessionSource = vi.fn(async () => sessionSource);+ const assertExternalInput = bind(expressionMatching(node =>+ isFunctionDeclaration(node) && node.name?.text === 'assertReviewExternalInputAllowed' ? node : undefined,+ ), { readSessionSource, assertCindyMakeSessionAvailable, assertReviewSessionExternalInputAllowed });+ const assertRemoteInputControlBoundary = bind(expressionMatching(node =>+ isVariableDeclaration(node) && node.name.getText(source) === 'assertRemoteInputControlBoundary' ? node.initializer : undefined,+ ), { assertReviewExternalInputAllowed: assertExternalInput, inputCoordinator });+ for (const channel of ['INPUT_ENQUEUE', 'INPUT_STEER', 'INPUT_RESUME', 'INPUT_RETRY_LAST_ERROR']) {+ const handler = bind(expressionMatching(node =>+ isCallExpression(node) && node.expression.getText(source) === 'ipcMain.handle'+ && node.arguments[0]?.getText(source) === `MAKER_INVOKE.${channel}` ? node.arguments[1] : undefined,+ ), { requireSessionId: (id: string) => id, isDeviceLinkInvoke: () => false,+ assertReviewExternalInputAllowed: assertExternalInput, assertRemoteInputControlBoundary,+ prepareSharedTaskInput, inputCoordinator });+ await expect(handler({}, 'old-make', {})).rejects.toThrow(/\[UNSUPPORTED_CAPABILITY\]/);+ }+ expect(prepareSharedTaskInput).not.toHaveBeenCalled();+ for (const action of Object.values(inputCoordinator)) expect(action).not.toHaveBeenCalled();+ });+});diff --git a/apps/desktop/src/main/maker-ipc/__tests__/cindyMakeSessionStart.test.ts b/apps/desktop/src/main/maker-ipc/__tests__/cindyMakeSessionStart.test.tsindex dd3570be17..b14894ce65 100644--- a/apps/desktop/src/main/maker-ipc/__tests__/cindyMakeSessionStart.test.ts+++ b/apps/desktop/src/main/maker-ipc/__tests__/cindyMakeSessionStart.test.ts@@ -1,9 +1,29 @@-import { describe, expect, it, vi } from 'vitest';+import { beforeEach, describe, expect, it, vi } from 'vitest';import { CINDY_MAKE_VENDOR_OPTION_KEY } from '../../../shared/cindyMakeSession';import { applyPersistedCindyMakeMarker } from '../cindyMakeSessionStart';+const feature = vi.hoisted(() => ({ enabled: true }));+vi.mock('@cindy/maker-shared/cindy-make-feature', async (importOriginal) => ({+ ...await importOriginal<typeof import('@cindy/maker-shared/cindy-make-feature')>(),+ get CINDY_MAKE_ENABLED() { return feature.enabled; },+}));+beforeEach(() => { feature.enabled = true; });+describe('applyPersistedCindyMakeMarker', () => {+ it.each(['cindy-make', 'cindy-make-merge'])('refuses to resume a persisted %s task while disabled', async (source) => {+ feature.enabled = false;+ const options = { id: 'old-task', vendorOptions: { source: 'draft' } };+ await expect(applyPersistedCindyMakeMarker(options, async () => source)).rejects.toThrow(+ /\[UNSUPPORTED_CAPABILITY\]/,+ );+ expect(options.vendorOptions).toEqual({ source: 'draft' });+ });++ it('still allows ordinary tasks while disabled', async () => {+ feature.enabled = false;+ await expect(applyPersistedCindyMakeMarker({ id: 'ordinary' }, async () => 'desktop')).resolves.toBe(false);+ });it('does not give an upstream merge task the personal-build harness', async () => {const options: { id: string; vendorOptions?: Record<string, unknown> } = { id: 'merge' };expect(await applyPersistedCindyMakeMarker(options, async () => 'cindy-make-merge')).toBe(false);diff --git a/apps/desktop/src/main/maker-ipc/cindyMakeSessionStart.ts b/apps/desktop/src/main/maker-ipc/cindyMakeSessionStart.tsindex 6ab7600acc..2c573a04da 100644--- a/apps/desktop/src/main/maker-ipc/cindyMakeSessionStart.ts+++ b/apps/desktop/src/main/maker-ipc/cindyMakeSessionStart.ts@@ -1,4 +1,5 @@import { throwIpcError } from '../utils/ipcValidate.js';+import { assertCindyMakeSessionAvailable } from '../cindy-make/featureGate.js';import {CINDY_MAKE_SESSION_SOURCE,CINDY_MAKE_VENDOR_OPTION_KEY,@@ -22,7 +23,9 @@ export async function applyPersistedCindyMakeMarker(readSource: (sessionId: string) => Promise<string | null>,): Promise<boolean> {if (typeof o.id !== 'string' || !o.id) return false;- if ((await readSource(o.id)) !== CINDY_MAKE_SESSION_SOURCE) return false;+ const source = await readSource(o.id);+ assertCindyMakeSessionAvailable(source);+ if (source !== CINDY_MAKE_SESSION_SOURCE) return false;if (o.remoteHostId) {throwIpcError('UNSUPPORTED_CAPABILITY', 'Cindy Make tasks are local-only');}diff --git a/apps/desktop/src/main/maker-ipc/register.ts b/apps/desktop/src/main/maker-ipc/register.tsindex 198cf9e3f6..8bdef5fbf7 100644--- a/apps/desktop/src/main/maker-ipc/register.ts+++ b/apps/desktop/src/main/maker-ipc/register.ts@@ -737,6 +737,7 @@ import {import { readXaiSubscriptionUsageSnapshotForDeviceLink, readClaudeSubscriptionUsageSnapshotForDeviceLink } from './usage.js';import { requireEnum, requireObject, throwIpcError } from '../utils/ipcValidate.js';import { applyPersistedCindyMakeMarker } from './cindyMakeSessionStart.js';+import { assertCindyMakeEnabled, assertCindyMakeSessionAvailable } from '../cindy-make/featureGate.js';import { CINDY_MAKE_SESSION_SOURCE } from '../../shared/cindyMakeSession.js';import { cindyMakeManager } from '../cindy-make/manager.js';import { assertCindyMakeWorkspace, withCindyMakeProjectUse } from '../cindy-make/projectAccess.js';@@ -6883,6 +6884,7 @@ export function registerMakerIpc(maker: Maker, options: RegisterMakerIpcOptions)ipcMain.handle(MAKER_INVOKE.EXECUTE_DESKTOP_COMMAND, async (e, name: unknown, ctx: unknown) => {if (name === 'cindy-make-doctor' || name === 'cindy-make') {assertTrustedAppRendererEvent(e);+ assertCindyMakeEnabled();if (ctx != null && (typeof ctx !== 'object' || Array.isArray(ctx)))throwIpcError('INVALID_PARAMS', 'Invalid Make context');}@@ -7366,7 +7368,9 @@ export function registerMakerIpc(maker: Maker, options: RegisterMakerIpcOptions)}async function assertReviewExternalInputAllowed(sessionId: string): Promise<void> {- await assertReviewSessionExternalInputAllowed(sessionId, readSessionSource);+ const source = await readSessionSource(sessionId);+ assertCindyMakeSessionAvailable(source);+ await assertReviewSessionExternalInputAllowed(sessionId, async () => source);}async function assertReviewSettingsUnlocked(sessionId: string): Promise<void> {@@ -7791,6 +7795,8 @@ export function registerMakerIpc(maker: Maker, options: RegisterMakerIpcOptions)didInjectOrcaInstructions: boolean;didInjectProjectContext: boolean;}> {+ assertAccess?.();+ await applyPersistedCindyMakeMarker(o, readSessionSource);assertAccess?.();// 协同远端 Worker 的代理任务行只承接计槽与回报,真实任务在运行设备上,绝不在本机起 Agent。if (o.id && await orcaRemoteWorkersForHost?.isRemoteWorker(o.id)) {@@ -7834,7 +7840,6 @@ export function registerMakerIpc(maker: Maker, options: RegisterMakerIpcOptions)}assertAccess?.();await applyPersistedReviewMode(o);- await applyPersistedCindyMakeMarker(o, readSessionSource);const didInjectOrcaInstructions = o.reviewMode === true ? false : applyOrcaInstructions(o);const didInjectProjectContext =o.reviewMode === true ? false : await applyProjectContextInjection(o);@@ -10157,6 +10162,7 @@ export function registerMakerIpc(maker: Maker, options: RegisterMakerIpcOptions)*/source?: { origin?: unknown; sourcePlugin?: unknown; persistedText?: string },): Promise<SessionSendResult> {+ assertCindyMakeSessionAvailable(await readSessionSource(session.id));const dispatchMergeTurn = prepareUpstreamMergeTurn(session.id);if (!session.remoteHostId && isCindyMakeWorktreePath(app.getPath('userData'), session.workDir)) {if (cindyMakeManager.isTaskPreparing(session.id))@@ -15796,6 +15802,7 @@ export function registerMakerIpc(maker: Maker, options: RegisterMakerIpcOptions).leftJoin(botProfiles, eq(botProfiles.id, botSessionLinks.botId)).where(eq(sessions.id, sessionId)).limit(1);+ assertCindyMakeSessionAvailable(botInput?.source);const blocked = botSessionInputBlockReason(botInput ?? null);if (args[2] && typeof args[2] === 'object') {if (botInput?.source === 'bot' && ['canonical', 'delegation', 'group'].includes(botInput.role ?? '')) {diff --git a/apps/desktop/src/renderer/__tests__/mainListModel.test.ts b/apps/desktop/src/renderer/__tests__/mainListModel.test.tsindex b3f52c79ef..1130e0d67a 100644--- a/apps/desktop/src/renderer/__tests__/mainListModel.test.ts+++ b/apps/desktop/src/renderer/__tests__/mainListModel.test.ts@@ -4,7 +4,14 @@* flat 平铺、自定义项目顺序只管项目行的收窄语义。*/-import { describe, expect, it } from 'vitest';+import { beforeEach, describe, expect, it, vi } from 'vitest';++const feature = vi.hoisted(() => ({ enabled: true }));+vi.mock('@cindy/maker-shared/cindy-make-feature', async (importOriginal) => ({+ ...await importOriginal<typeof import('@cindy/maker-shared/cindy-make-feature')>(),+ get CINDY_MAKE_ENABLED() { return feature.enabled; },+}));+beforeEach(() => { feature.enabled = true; });import { LIVE_TASK_PRIORITY } from '../../shared/liveTaskPriority';import type { Session } from '@/lib/ccAgent.types';@@ -86,6 +93,34 @@ const NO_PRIORITY = {};describe('Cindy Make sidebar group', () => {+ it('preserves empty saved projects and ordinary tasks in mixed projects while disabled', () => {+ feature.enabled = false;+ const updatedAt = '2026-10-12T00:00:00Z';+ const hidden = session({ id: 'make', source: 'cindy-make', updatedAt });+ const ordinary = session({ id: 'ordinary', source: 'desktop', updatedAt });+ const saved = project('saved', []);+ const mixed = project('mixed', [hidden, ordinary]);+ const entries = buildMainListEntries({+ projects: [saved, mixed], dialogues: [], unclassified: [], groupBy: 'project',+ groupDialogue: false, sortBy: 'recency', manualProjectOrder: [],+ });+ expect(entries.map(entry => entry.kind === 'project' ? entry.project.projectKey : entry.kind).sort()).toEqual(['local:mixed', 'local:saved']);+ expect(entries.flatMap(getMainListEntrySessions)).toEqual([ordinary]);+ expect(mixed.sessions).toEqual([hidden, ordinary]);+ });+ it.each(['project', 'flat'] as const)('hides all Make sources and their projects in %s mode when disabled', (groupBy) => {+ feature.enabled = false;+ const updatedAt = '2026-10-12T00:00:00Z';+ const make = session({ id: 'make', source: 'cindy-make', updatedAt });+ const merge = session({ id: 'merge', source: 'cindy-make-merge', updatedAt });+ const ordinary = session({ id: 'ordinary', title: 'Ordinary', source: 'desktop', updatedAt });+ const entries = buildMainListEntries({+ projects: [project('make', [make])], dialogues: [ordinary], unclassified: [merge],+ groupBy, groupDialogue: false, sortBy: 'recency', manualProjectOrder: [],+ });+ expect(labels(entries)).toEqual(['s:Ordinary']);+ expect(getMainListEntrySessions(entries[0])).toEqual([ordinary]);+ });it('groups a distinct upstream-merge source alongside personal-feature tasks', () => {const merge = session({ source: 'cindy-make-merge', workingDir: '/managed/merge-worktrees/abcd', workspaceKind: 'project', updatedAt: '2026-09-17T00:00:00Z' });const normal = session({ source: 'cindy-make', workingDir: '/managed/worktrees/efgh', workspaceKind: 'project', updatedAt: '2026-09-17T00:00:00Z' });diff --git a/apps/desktop/src/renderer/__tests__/onlineDeviceHeaders.test.tsx b/apps/desktop/src/renderer/__tests__/onlineDeviceHeaders.test.tsxindex 6f049e67d0..a39cf20e9a 100644--- a/apps/desktop/src/renderer/__tests__/onlineDeviceHeaders.test.tsx+++ b/apps/desktop/src/renderer/__tests__/onlineDeviceHeaders.test.tsx@@ -12,6 +12,12 @@ import {} from '../features/cc-agent/sidebar/sections/ProjectsSection';vi.mock('react-i18next', () => ({ useTranslation: () => ({ t: (key: string) => key }) }));+const feature = vi.hoisted(() => ({ enabled: true }));+vi.mock('@cindy/maker-shared/cindy-make-feature', async (importOriginal) => ({+ ...await importOriginal<typeof import('@cindy/maker-shared/cindy-make-feature')>(),+ get CINDY_MAKE_ENABLED() { return feature.enabled; },+}));+beforeEach(() => { feature.enabled = true; });vi.mock('@/components/ui/tooltip', () => ({Tip: ({ children }: { children: ReactNode }) => children,}));@@ -261,6 +267,14 @@ describe('Offline device header names', () => {});describe('Cindy Make sidebar entry', () => {+ it.each([false, true])('hides the label, old tasks and creation entry with device grouping %s when disabled', (groupDevice) => {+ feature.enabled = false;+ render(<ProjectsSection {...makeProps(groupDevice, false)} />);+ expect(screen.queryByText('settings.cindyMake.title')).toBeNull();+ expect(screen.queryByText('Make task')).toBeNull();+ expect(screen.queryByRole('button', { name: 'settings.cindyMake.create.title' })).toBeNull();+ expect(screen.getByText('Ordinary project')).toBeTruthy();+ });function makeProps(groupDevice: boolean, custom: boolean) {const p = props(groupDevice);const make = {diff --git a/apps/desktop/src/renderer/__tests__/orcaSessionIdentity.test.ts b/apps/desktop/src/renderer/__tests__/orcaSessionIdentity.test.tsindex 5fdb1986f0..ecfef5fd0f 100644--- a/apps/desktop/src/renderer/__tests__/orcaSessionIdentity.test.ts+++ b/apps/desktop/src/renderer/__tests__/orcaSessionIdentity.test.ts@@ -99,6 +99,14 @@ describe('orcaSessionIdentity', () => {expect(api.localDb.sessions.get).toHaveBeenCalledWith('lead-2');});+ it.each(['cindy-make', 'cindy-make-merge'] as const)('redirects old %s links to the task index', async (source) => {+ const api = electronApiMock();+ await expect(resolveSessionRoute('old-make', { orcaRole: null, source })).resolves.toBe('/cc-agent');+ api.localDb.sessions.get.mockResolvedValue({ orcaRole: null, source });+ await expect(resolveSessionRoute('old-make')).resolves.toBe('/cc-agent');+ expect(api.localDb.orcaWorkflows.getByWorkerSession).not.toHaveBeenCalled();+ });+it('routes orphaned Orca workers back through the index fallback', async () => {const api = electronApiMock();api.localDb.orcaWorkflows.getByWorkerSession.mockResolvedValue(null);diff --git a/apps/desktop/src/renderer/__tests__/remoteProjectsStore.test.ts b/apps/desktop/src/renderer/__tests__/remoteProjectsStore.test.tsindex f4052c7ed3..e2148b4905 100644--- a/apps/desktop/src/renderer/__tests__/remoteProjectsStore.test.ts+++ b/apps/desktop/src/renderer/__tests__/remoteProjectsStore.test.ts@@ -26,6 +26,7 @@ function mk(id: string, partial: Partial<Session> = {}): Session {return {id,userId: 'u',+ source: partial.source,title: partial.title ?? id,workingDir: partial.workingDir ?? `/proj/${id}`,workspaceKind: 'project',@@ -52,6 +53,24 @@ function mk(id: string, partial: Partial<Session> = {}): Session {}describe('remoteProjectsStore', () => {+ it('hides Make tasks from visible snapshots while preserving raw mirrors and origins', () => {+ remoteProjectsStore.clear();+ remoteProjectsStore.setDeviceSessions('dev-B', 'B', [+ mk('make', { source: 'cindy-make' }),+ mk('merge', { source: 'cindy-make-merge' }),+ mk('ordinary', { source: 'desktop' }),+ ]);+ expect(remoteProjectsStore.getMergedRemoteSessions()).toHaveLength(3);+ expect(getSessionDeviceId('make')).toBe('dev-B');+ const visible = remoteProjectsStore.getVisibleMergedRemoteSessions();+ expect(visible.map(session => session.id)).toEqual(['ordinary']);+ remoteProjectsStore.applyPatch('dev-B', 'make', { title: 'Hidden update' });+ expect(remoteProjectsStore.getVisibleMergedRemoteSessions()).toBe(visible);+ remoteProjectsStore.applyPatch('dev-B', 'ordinary', { source: 'cindy-make' });+ expect(remoteProjectsStore.getVisibleMergedRemoteSessions()).toEqual([]);+ remoteProjectsStore.clear();+ expect(remoteProjectsStore.getVisibleMergedRemoteSessions()).toEqual([]);+ });beforeEach(() => {setRemoteReseedImpl(null);setRemoteSessionBootstrapRetryImpl(null);diff --git a/apps/desktop/src/renderer/__tests__/sessionLinkPasteTitleProjection.test.ts b/apps/desktop/src/renderer/__tests__/sessionLinkPasteTitleProjection.test.tsindex 8f2ce54487..6520f7358c 100644--- a/apps/desktop/src/renderer/__tests__/sessionLinkPasteTitleProjection.test.ts+++ b/apps/desktop/src/renderer/__tests__/sessionLinkPasteTitleProjection.test.ts@@ -21,7 +21,7 @@ vi.mock('@/lib/sessionService', () => ({const getMergedRemoteSessions = vi.fn(() => [] as Array<{ id: string; title: string }>);vi.mock('@/features/device-link/remoteProjectsStore', () => ({remoteProjectsStore: {- getMergedRemoteSessions: () => getMergedRemoteSessions(),+ getVisibleMergedRemoteSessions: () => getMergedRemoteSessions(),},}));diff --git a/apps/desktop/src/renderer/__tests__/userInfoSectionHover.test.ts b/apps/desktop/src/renderer/__tests__/userInfoSectionHover.test.tsindex 82f3c04811..27bc16c939 100644--- a/apps/desktop/src/renderer/__tests__/userInfoSectionHover.test.ts+++ b/apps/desktop/src/renderer/__tests__/userInfoSectionHover.test.ts@@ -83,9 +83,6 @@ describe('UserInfoSection — version label', () => {/const appVersionLabel = appRegionLabel\s*\n\s*\? `\$\{appRegionLabel\} · \$\{appDisplayVersion\}`\s*\n\s*: appDisplayVersion;/,);expect(source).not.toContain('XD.Inc');- expect(source).toContain("import { useCindyVersions } from '@/lib/useCindyVersions';");- expect(source).toContain('const versions = useCindyVersions();');- expect(source).toContain("t('cindyMake.versions.personal')");expect(source).toContain('{visibleVersionLabel}');expect(source).toContain('title={visibleVersionLabelDetail}');});diff --git a/apps/desktop/src/renderer/__tests__/userInfoSectionUpdateFlame.test.tsx b/apps/desktop/src/renderer/__tests__/userInfoSectionUpdateFlame.test.tsxindex 3d9b593158..166bf607e6 100644--- a/apps/desktop/src/renderer/__tests__/userInfoSectionUpdateFlame.test.tsx+++ b/apps/desktop/src/renderer/__tests__/userInfoSectionUpdateFlame.test.tsx@@ -8,10 +8,6 @@import { cleanup, render, screen } from '@testing-library/react';import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';-const { useCindyVersionsMock } = vi.hoisted(() => ({- useCindyVersionsMock: vi.fn(),-}));-vi.mock('react-i18next', () => ({useTranslation: () => ({t: (key: string) => key,@@ -45,10 +41,6 @@ vi.mock('@/hooks/useBetaChannelSettings', () => ({}),}));-vi.mock('@/lib/useCindyVersions', () => ({- useCindyVersions: useCindyVersionsMock,-}));-vi.mock('@/hooks/useLogout', () => ({useLogout: () => ({ handleLogout: vi.fn() }),}));@@ -64,7 +56,6 @@ vi.mock('@/components/ui/tooltip', () => ({import { UserInfoSection } from '@/components/sidebar/UserInfoSection';beforeEach(() => {- useCindyVersionsMock.mockReturnValue({ state: undefined });Object.defineProperty(window, 'electronAPI', {configurable: true,value: {@@ -90,16 +81,10 @@ describe('UserInfoSection update flame vs rail', () => {expect(screen.getByRole('button', { name: 'sidebar.user.reopenUpdateBanner' })).toBeTruthy();});- it('shows the personal version label when the running app is personal', () => {- useCindyVersionsMock.mockReturnValue({- state: {- currentId: 'personal',- },- });-+ it('keeps the regular app version label for the personal build', () => {render(<UserInfoSection isCollapsed={false} />);- expect(screen.getByText('cindyMake.versions.personal')).toBeTruthy();- expect(screen.queryByText('1.0.0')).toBeNull();+ expect(screen.getByText('1.0.0')).toBeTruthy();+ expect(screen.queryByText('cindyMake.versions.personal')).toBeNull();});});diff --git a/apps/desktop/src/renderer/components/chat/SystemCard.tsx b/apps/desktop/src/renderer/components/chat/SystemCard.tsxindex 790814958d..002da3ff09 100644--- a/apps/desktop/src/renderer/components/chat/SystemCard.tsx+++ b/apps/desktop/src/renderer/components/chat/SystemCard.tsx@@ -51,9 +51,7 @@ import {ACTIVITY_ROW_RADIUS_CLASS,} from './activityRowChrome';import { MarkdownRenderer } from './MarkdownRenderer';-import { CindyMakeDoctorCard } from './CindyMakeDoctorCard';import { builtInSkillDescriptionKey } from '@/features/skillhub/lib/builtInSkillPresentation';-import { CindyMakeCompleteCard } from '@/components/cindy-make/CindyMakeCompleteCard';import { getSessionDeviceId } from '@/features/device-link/remoteProjectsStore';interface SystemCardProps {@@ -1394,10 +1392,12 @@ export function SystemCard({workingDir,autoResumeInFlight,}: SystemCardProps) {+ if (+ cardType === 'cindy-make-doctor' ||+ cardType === 'cindy-make' ||+ cardType === 'cindy-make-complete'+ ) return null;switch (cardType) {- case 'cindy-make-doctor':- case 'cindy-make':- return <CindyMakeDoctorCard data={data} sessionId={sessionId} />;case 'help':return <HelpCard data={data} />;case 'cost':@@ -1416,8 +1416,6 @@ export function SystemCard({return <GoalCompleteCard data={data} />;case 'goal-resumed':return <GoalResumedCard data={data as { kind?: string } | undefined} />;- case 'cindy-make-complete':- return <CindyMakeCompleteCard data={data} />;case 'auto-resume': {// 同一个卡类型承载两套自愈:带中断上下文的是本份的「重连」记录,没有的是 silent-stop// 的「已自动继续」分隔条 —— 后者保持原形态原文案,不被重连三态改写(copilot review)。diff --git a/apps/desktop/src/renderer/components/layout/MainLayout.tsx b/apps/desktop/src/renderer/components/layout/MainLayout.tsxindex a313279f1e..d963c8ded7 100644--- a/apps/desktop/src/renderer/components/layout/MainLayout.tsx+++ b/apps/desktop/src/renderer/components/layout/MainLayout.tsx@@ -509,7 +509,7 @@ export function MainLayout() {// redirect 到 orca 路由时会丢 searchJump 锚点。传入远程镜像的 session 对象,// 让 Orca 路由一步到位(Codex review P2,与 SessionLinkChip 同款处理)。const remoteSession =- remoteProjectsStore.getMergedRemoteSessions().find((s) => s.id === sessionId) ?? null;+ remoteProjectsStore.getVisibleMergedRemoteSessions().find((s) => s.id === sessionId) ?? null;void resolveSessionRoute(sessionId, remoteSession).then((target) => {if (!isLatest()) return;const visibleSession = resolveAgentIslandVisibleSessionFromRouteTarget(target);diff --git a/apps/desktop/src/renderer/components/new-chat/ChatInput.tsx b/apps/desktop/src/renderer/components/new-chat/ChatInput.tsxindex c287af015a..7efe2842b1 100644--- a/apps/desktop/src/renderer/components/new-chat/ChatInput.tsx+++ b/apps/desktop/src/renderer/components/new-chat/ChatInput.tsx@@ -18,6 +18,7 @@ import { buildLocalSkillPathRoute } from '@/features/skillhub/lib/localRoutes';import { Folder, MessageSquarePlus, Mic, TriangleAlert, X } from 'lucide-react';import { useStableTranslation as useTranslation } from '@/hooks/useStableTranslation';import type { AgentInputReference } from '@cindy/maker-shared/agent-input-projection';+import { CINDY_MAKE_ENABLED } from '@cindy/maker-shared/cindy-make-feature';import { requiresFullAccessConfirmation } from '@cindy/maker-shared/permission-mode';import { isAnnotationBurnInError } from '@/lib/annotationBurnIn';import { AttachmentRejectionStrip, ThumbnailStrip } from './ComposerAttachments';@@ -5325,6 +5326,7 @@ export function ChatInput({? commentsBeforeOptimisticClear: sourceOwnedExtras.comments;if (+ CINDY_MAKE_ENABLED &&classifyCindyMakeCommand(editorText, slashCommandsReady ? mergedCommands : null).kind !== 'none') {const isMakeSourceCurrent = () =>@@ -8520,7 +8522,7 @@ export function ChatInput({}, [showPromptPreview]);// 可见推荐本身就是一次可发送输入:按钮点击时会先把它同步写入正文,再走现有发送链。const canSend = hasComposerPayload || showRecommendationOverlay;- const makeNeedsNoModel = (noConnectedSource || selectedSourceDisconnected) && !!editor &&+ const makeNeedsNoModel = CINDY_MAKE_ENABLED && (noConnectedSource || selectedSourceDisconnected) && !!editor &&!hasAttachments && classifyCindyMakeCommand(serializeEditorContent(editor).text, slashCommandsReady ? mergedCommands : null,).kind === 'start';diff --git a/apps/desktop/src/renderer/components/new-chat/sessionLinkPaste.ts b/apps/desktop/src/renderer/components/new-chat/sessionLinkPaste.tsindex 8c798b2f62..d29b8ee87c 100644--- a/apps/desktop/src/renderer/components/new-chat/sessionLinkPaste.ts+++ b/apps/desktop/src/renderer/components/new-chat/sessionLinkPaste.ts@@ -141,7 +141,7 @@ export async function resolvePastedSessionTitle(sessionId: string): Promise<stri// 本地库没有(远程 / 未知会话)→ 走远程镜像降级}const { remoteProjectsStore } = await import('@/features/device-link/remoteProjectsStore');- const remote = remoteProjectsStore.getMergedRemoteSessions().find((s) => s.id === sessionId);+ const remote = remoteProjectsStore.getVisibleMergedRemoteSessions().find((s) => s.id === sessionId);const remoteTitle = remote?.title?.trim();return remoteTitle ? projectResolvedChipTitle(remoteTitle) : null;}diff --git a/apps/desktop/src/renderer/components/settings/CindyMakeSection.settings-search.ts b/apps/desktop/src/renderer/components/settings/CindyMakeSection.settings-search.tsindex 16e4a089d7..db362cf89f 100644--- a/apps/desktop/src/renderer/components/settings/CindyMakeSection.settings-search.ts+++ b/apps/desktop/src/renderer/components/settings/CindyMakeSection.settings-search.ts@@ -4,9 +4,5 @@ import type { SettingsSearchModule } from './settingsSearchTypes';export default {id: 'cindy-make',order: 14,- entries: [- { id: 'cindyMake', tab: 'cindy-make', targetId: 'settings-panel-cindy-make', titleKey: 'settings.tabs.cindyMake', sectionKey: 'settings.tabs.cindyMake' },- { id: 'settings.cindyMake.source.title', fallbackTargetId: 'settings-panel-cindy-make', tab: 'cindy-make', targetId: 'settings-search-settings-cindyMake-source-title', titleKey: 'settings.cindyMake.source.title', sectionKey: 'settings.tabs.cindyMake', descriptionKey: 'settings.cindyMake.source.description' },- { id: 'settings.cindyMake.syncBeforeBuild.title', fallbackTargetId: 'settings-panel-cindy-make', tab: 'cindy-make', targetId: 'settings-search-settings-cindyMake-syncBeforeBuild-title', titleKey: 'settings.cindyMake.syncBeforeBuild.title', sectionKey: 'settings.tabs.cindyMake', descriptionKey: 'settings.cindyMake.syncBeforeBuild.description' },- ],+ entries: [],} satisfies SettingsSearchModule;diff --git a/apps/desktop/src/renderer/components/settings/SettingsSidebarNav.tsx b/apps/desktop/src/renderer/components/settings/SettingsSidebarNav.tsxindex 09bbe0d2fb..eace0d8bb7 100644--- a/apps/desktop/src/renderer/components/settings/SettingsSidebarNav.tsx+++ b/apps/desktop/src/renderer/components/settings/SettingsSidebarNav.tsx@@ -4,7 +4,6 @@ import { useTranslation } from 'react-i18next';import type { LucideProps } from 'lucide-react';import {Boxes,- Hammer,ChartColumn,CircleDollarSign,CircleHelp,@@ -77,7 +76,6 @@ const TAB_ICON: Record<VisibleSettingsTab, SettingsNavIcon> = {ghosts: Plug,'builtin-tools': Wrench,'computer-use': MonitorCog,- 'cindy-make': Hammer,'im-bot': MessageCircle,help: CircleHelp,about: Info,@@ -132,18 +130,6 @@ export function SettingsSidebarNav({)}/><span className="leading-none">{t(TAB_LABEL_KEY[tabId])}</span>- {tabId === 'cindy-make' && (- <span- className={cn(- 'relative top-0.5 shrink-0 rounded-full border px-2 py-[1px] text-10 font-medium leading-[1.5]',- selected- ? 'border-current bg-transparent text-inherit'- : 'border-[var(--settings-badge-border)] bg-[var(--settings-badge-bg)] text-[var(--settings-menu-text)]',- )}- >- {t('cindyMake.beta')}- </span>- )}</button>);})}diff --git a/apps/desktop/src/renderer/components/settings/SettingsView.tsx b/apps/desktop/src/renderer/components/settings/SettingsView.tsxindex d9235913a3..f32ed63748 100644--- a/apps/desktop/src/renderer/components/settings/SettingsView.tsx+++ b/apps/desktop/src/renderer/components/settings/SettingsView.tsx@@ -52,7 +52,6 @@ import { CollaborationSection } from './CollaborationSection';import { BuiltinToolsSection } from './BuiltinToolsSection';import { ContactsSection } from './contacts/ContactsSection';import { ComputerUseSection } from './ComputerUseSection';-import { CindyMakeSection } from './CindyMakeSection';import { useAuth } from '@/contexts/AuthContext';import { SettingsCatalogPanel } from './SettingsCatalogPanel';import { getLastWorkingDir, subscribeToLastWorkingDir } from '@/state/lastWorkingDir';@@ -60,8 +59,6 @@ import { BillingSettingsSection } from '@/features/billing/BillingPage';import { BotsGlobalSettingsSection } from '@/features/bots/BotsGlobalSettingsSection';import { canAccessBillingSettings } from './billingVisibility';import { canAccessUsageSettings } from './usageVisibility';-import { canAccessCindyMakeSettings } from './cindyMakeVisibility';-import { useCindyVersions } from '@/lib/useCindyVersions';import { UsageHistorySection } from './usage/UsageHistorySection';import { CURRENT_CINDY_REGION } from '../../../shared/brandRegion';@@ -95,13 +92,6 @@ export function SettingsView() {// 用量历史对所有**已登录**身份开放 (local / cloud personal / cloud org),// 与 billing 的 canAccessBillingSettings 无关 —— #2785 维护者裁决。const canAccessUsage = canAccessUsageSettings({ mode });- const versions = useCindyVersions(!import.meta.env.DEV);- const canAccessCindyMake = canAccessCindyMakeSettings(- import.meta.env.DEV,- versions.state,- /-beta(?:\.|$)/i.test(window.electronAPI.appVersion ?? ''),- user,- );const activeTab = useMemo<SettingsTab>(() => {const raw = rawTab;@@ -113,10 +103,9 @@ export function SettingsView() {if (raw === 'tina') return 'im-bot';if (raw === 'billing' && !canAccessBilling) return 'general';if (raw === 'usage' && !canAccessUsage) return 'general';- if (raw === 'cindy-make' && !canAccessCindyMake) return 'general';if (raw === 'agent-island' && !isMac) return 'general';return isSettingsTab(raw) ? raw : 'general';- }, [canAccessBilling, canAccessCindyMake, canAccessUsage, isMac, rawTab]);+ }, [canAccessBilling, canAccessUsage, isMac, rawTab]);const piExtensionsPanelOpen =activeTab === 'general' &&(rawTab === 'pi-extensions' || searchParams.get('openPanel') === 'pi-extensions');@@ -131,6 +120,13 @@ export function SettingsView() {setSearchParams(next, { replace: true });}, [canAccessBilling, rawTab, searchParams, setSearchParams]);+ useEffect(() => {+ if (rawTab !== 'cindy-make') return;+ const next = new URLSearchParams(searchParams);+ next.delete('tab');+ setSearchParams(next, { replace: true });+ }, [rawTab, searchParams, setSearchParams]);+// 「IM 机器人」官方/个人已纵向同页展示;?imGroup=cindy|personal 只负责把// 深链滚动到对应分区。旧「飞书机器人」深链继续定位到「个人」。const activeImGroupRaw = activeTab === 'im-bot' ? searchParams.get('imGroup') : null;@@ -219,10 +215,9 @@ export function SettingsView() {(tabId) =>(isMac || tabId !== 'agent-island') &&(canAccessBilling || tabId !== 'billing') &&- (canAccessUsage || tabId !== 'usage') &&- (canAccessCindyMake || tabId !== 'cindy-make'),+ (canAccessUsage || tabId !== 'usage'),),- [canAccessBilling, canAccessCindyMake, canAccessUsage, isMac],+ [canAccessBilling, canAccessUsage, isMac],);const searchContext = useMemo<SettingsSearchContext>(() => ({region: CURRENT_CINDY_REGION,@@ -659,16 +654,6 @@ export function SettingsView() {</div>)}- {canAccessCindyMake && activeTab === 'cindy-make' && (- <div- role="tabpanel"- id="settings-panel-cindy-make"- aria-labelledby="settings-tab-cindy-make"- >- <CindyMakeSection key={`cindy-make:${mode}:${dataOwnerId ?? 'none'}`} />- </div>- )}-{activeTab === 'help' && (<div role="tabpanel" id="settings-panel-help" aria-labelledby="settings-tab-help"><section aria-label={t('settings.sections.help')}>diff --git a/apps/desktop/src/renderer/components/settings/__tests__/cindyMakeVisibility.test.ts b/apps/desktop/src/renderer/components/settings/__tests__/cindyMakeVisibility.test.tsindex 0a72939020..1ac64b2319 100644--- a/apps/desktop/src/renderer/components/settings/__tests__/cindyMakeVisibility.test.ts+++ b/apps/desktop/src/renderer/components/settings/__tests__/cindyMakeVisibility.test.ts@@ -3,11 +3,8 @@ import { describe, expect, it } from 'vitest';import { canAccessCindyMakeSettings } from '../cindyMakeVisibility';describe('cindyMakeVisibility', () => {- it('shows the settings tab only in development builds', () => {- expect(canAccessCindyMakeSettings(true)).toBe(true);- expect(canAccessCindyMakeSettings(false)).toBe(false);- });- it('keeps version management accessible in a packaged personal version', () => {+ it('keeps the settings entry unavailable in every build', () => {+ expect(canAccessCindyMakeSettings(true)).toBe(false);const personal = {id: 'personal-1',kind: 'personal' as const,@@ -21,11 +18,15 @@ describe('cindyMakeVisibility', () => {switching: false,versions: [original, personal],};- expect(canAccessCindyMakeSettings(false, state)).toBe(true);+ expect(canAccessCindyMakeSettings(true, state, true, {+ membershipKind: 'org',+ orgSlug: 'xd',+ orgName: '心动网络',+ })).toBe(false);expect(canAccessCindyMakeSettings(false, { ...state, currentId: 'original' })).toBe(false);- expect(canAccessCindyMakeSettings(false, { ...state, versions: [original] })).toBe(true);+ expect(canAccessCindyMakeSettings(false, { ...state, versions: [original] })).toBe(false);});- it('shows the packaged beta entry only to the XD organization', () => {+ it('keeps packaged beta hidden for organization and personal accounts', () => {const xdOrgUser = {membershipKind: 'org' as const,orgSlug: 'xd',@@ -33,7 +34,7 @@ describe('cindyMakeVisibility', () => {};const otherOrgUser = { ...xdOrgUser, orgSlug: 'other-org' };- expect(canAccessCindyMakeSettings(false, undefined, true, xdOrgUser)).toBe(true);+ expect(canAccessCindyMakeSettings(false, undefined, true, xdOrgUser)).toBe(false);expect(canAccessCindyMakeSettings(false, undefined, true, otherOrgUser)).toBe(false);expect(canAccessCindyMakeSettings(false, undefined, true, {diff --git a/apps/desktop/src/renderer/components/settings/cindyMakeVisibility.ts b/apps/desktop/src/renderer/components/settings/cindyMakeVisibility.tsindex 117f9985a2..19fb886bf3 100644--- a/apps/desktop/src/renderer/components/settings/cindyMakeVisibility.ts+++ b/apps/desktop/src/renderer/components/settings/cindyMakeVisibility.ts@@ -1,5 +1,6 @@import type { CindyVersionsState } from '../../../shared/cindyVersions';import { isXdOrgUser, type XdOrgIdentity } from '../../../shared/xdOrg';+import { CINDY_MAKE_ENABLED } from '@cindy/maker-shared/cindy-make-feature';export function canAccessCindyMakeSettings(isDevelopmentBuild: boolean,@@ -7,13 +8,9 @@ export function canAccessCindyMakeSettings(isBetaBuild = false,user?: XdOrgIdentity | null,): boolean {- // Main resolves the current executable identity. A missing/corrupt catalog entry- // must not hide the escape route back to the original application.+ if (!CINDY_MAKE_ENABLED) return false;if (isDevelopmentBuild || (!!versions?.currentId && versions.currentId !== 'original')) {return true;}- // Only a running packaged beta exposes Cindy Make to the XD organization.- // Do not use the device's selected-channel preference here: it can be- // written before the release process restarts into the beta build.return isBetaBuild && isXdOrgUser(user);}diff --git a/apps/desktop/src/renderer/components/sidebar/UserInfoSection.tsx b/apps/desktop/src/renderer/components/sidebar/UserInfoSection.tsxindex a721ff3a0b..68e148eb9e 100644--- a/apps/desktop/src/renderer/components/sidebar/UserInfoSection.tsx+++ b/apps/desktop/src/renderer/components/sidebar/UserInfoSection.tsx@@ -18,7 +18,6 @@ import { useOptionalConfirmDialog } from '@/components/ui/confirm-dialog-provideimport { useUpdateStatus } from '@/hooks/useUpdateStatus';import { useUpdateBannerDismiss } from '@/hooks/useUpdateBannerDismiss';import { useBetaChannelSettings } from '@/hooks/useBetaChannelSettings';-import { useCindyVersions } from '@/lib/useCindyVersions';import { Tip } from '@/components/ui/tooltip';import { Spinner } from '@/components/ui/spinner';import {@@ -94,7 +93,6 @@ export function UserInfoSection({ isCollapsed, onOpenUpdateNotice }: UserInfoSecconst { status } = useUpdateStatus();const { dismissed, restore } = useUpdateBannerDismiss();const { state: betaChannelState } = useBetaChannelSettings();- const versions = useCindyVersions();const hasPendingUpdate = status === 'ready' || status === 'superseding';const isFlameReopen = hasPendingUpdate && dismissed;const showBetaLabel = !betaChannelState.loading && betaChannelState.enableBeta;@@ -147,14 +145,8 @@ export function UserInfoSection({ isCollapsed, onOpenUpdateNotice }: UserInfoSecconst appVersionLabelDetail = appRegionLabel? `${appRegionLabel} · ${appDisplayVersionDetail}`: appDisplayVersionDetail;- const isPersonalVersion =- versions.state?.currentId !== undefined && versions.state.currentId !== 'original';- const visibleVersionLabel = isPersonalVersion- ? t('cindyMake.versions.personal')- : appVersionLabel;- const visibleVersionLabelDetail = isPersonalVersion- ? t('cindyMake.versions.personal') + ' · ' + appDisplayVersionDetail- : appVersionLabelDetail;+ const visibleVersionLabel = appVersionLabel;+ const visibleVersionLabelDetail = appVersionLabelDetail;const remoteAvailable = mode === 'cloud';const openSettings = () => {diff --git a/apps/desktop/src/renderer/components/ui/__tests__/sharedMenuCallers.test.tsx b/apps/desktop/src/renderer/components/ui/__tests__/sharedMenuCallers.test.tsxindex c91f41fb44..519692a2cd 100644--- a/apps/desktop/src/renderer/components/ui/__tests__/sharedMenuCallers.test.tsx+++ b/apps/desktop/src/renderer/components/ui/__tests__/sharedMenuCallers.test.tsx@@ -115,7 +115,7 @@ describe('right sidebar · add tab', () => {'rightSidebar.tabs.kinds.fileBrowser',);await chooseByKeyboard(1);- expect(onAdd).toHaveBeenCalledWith('cindy-make');+ expect(onAdd).toHaveBeenCalledWith('review');expect(screen.queryByRole('menu')).toBeNull();// Esc / select returns focus to the "+" button.expect(document.activeElement).toBe(add);diff --git a/apps/desktop/src/renderer/features/cc-agent/CCAgentIndexRedirect.tsx b/apps/desktop/src/renderer/features/cc-agent/CCAgentIndexRedirect.tsxindex 5d51346452..b5243c845c 100644--- a/apps/desktop/src/renderer/features/cc-agent/CCAgentIndexRedirect.tsx+++ b/apps/desktop/src/renderer/features/cc-agent/CCAgentIndexRedirect.tsx@@ -18,6 +18,7 @@import { useEffect, useRef } from 'react';import { useNavigate } from 'react-router-dom';import { useTranslation } from 'react-i18next';+import { CINDY_MAKE_ENABLED, isCindyMakeSource } from '@cindy/maker-shared/cindy-make-feature';import { useCCSessions } from '@/hooks/useCCSessions';import {@@ -42,6 +43,7 @@ export function CCAgentIndexRedirect() {const last = loadLastChatView();const sessionIdSet = new Set(sessions.map((s) => s.id));const routeForSession = async (session: typeof sessions[number]): Promise<string | null> => {+ if (!CINDY_MAKE_ENABLED && isCindyMakeSource(session.source)) return null;if (isOrcaLeadSession(session)) return `/cc-agent/${session.id}`;if (!isOrcaWorkerSession(session)) return `/cc-agent/${session.id}`;const workflow = await orcaWorkflowsFor(session.id)diff --git a/apps/desktop/src/renderer/features/cc-agent/CCAgentSessionView.tsx b/apps/desktop/src/renderer/features/cc-agent/CCAgentSessionView.tsxindex 54b9c3633b..fbb287fc6d 100644--- a/apps/desktop/src/renderer/features/cc-agent/CCAgentSessionView.tsx+++ b/apps/desktop/src/renderer/features/cc-agent/CCAgentSessionView.tsx@@ -27,7 +27,9 @@ import {useState,} from 'react';import type { CSSProperties, ReactNode } from 'react';-import { useLocation, useNavigate, useOutletContext, useParams } from 'react-router-dom';+import { Navigate, useLocation, useNavigate, useOutletContext, useParams } from 'react-router-dom';+import { CINDY_MAKE_ENABLED, isCindyMakeSource } from '@cindy/maker-shared/cindy-make-feature';+import { CindyMakeSessionGate } from './CindyMakeSessionGate';import { dbToMakerAgentKind, normalizeDbAgentKind } from '../../../shared/agentKindConversion';import { useTranslation } from 'react-i18next';import {@@ -762,7 +764,16 @@ export function createWritableDirRemovalQueue() {};}-export function CCAgentSessionView({+export function CCAgentSessionView(props: CCAgentSessionViewProps) {+ const { sessionId } = useParams<{ sessionId: string }>();+ return (+ <CindyMakeSessionGate sessionId={props.sessionIdProp ?? sessionId}>+ <CCAgentSessionContent {...props} />+ </CindyMakeSessionGate>+ );+}++function CCAgentSessionContent({sessionIdProp,routeOwner,compact,@@ -3330,6 +3341,9 @@ export function CCAgentSessionView({!slashMatch && agentKind === 'pi' ? leadingSlashInvocation(message) : undefined;if (!slashMatch && !leading) return { handled: false, accepted: false, message };const cmdName = (slashMatch?.[1] ?? leading!.name).toLowerCase();+ if (!CINDY_MAKE_ENABLED && (cmdName === 'cindy-make' || cmdName === 'cindy-make-doctor')) {+ return { handled: true, accepted: false, message };+ }const args = slashMatch?.[2] ?? '';const allowDesktopDispatch = options?.allowDesktopDispatch ?? true;const workingDir = options?.workingDirOverride ?? session?.workingDir;@@ -4758,6 +4772,10 @@ export function CCAgentSessionView({// - /clear 之后留在空 ChatView 已经在用,体验没问题,本来就跟"空 session"等价// 现在所有空消息流/有消息流都走同一套布局(全高 scroll container + sticky bottom// overlay),自然消除 view 翻转带来的 layout shift。+ if (!CINDY_MAKE_ENABLED && isCindyMakeSource(session?.source)) {+ return <Navigate to="/cc-agent" replace />;+ }+const composerDir = composerWorkingDirPath({workingDir: session?.workingDir,liveWorktree,diff --git a/apps/desktop/src/renderer/features/cc-agent/CCAgentSidebarUpper.tsx b/apps/desktop/src/renderer/features/cc-agent/CCAgentSidebarUpper.tsxindex fdbbebbb36..d9954098c7 100644--- a/apps/desktop/src/renderer/features/cc-agent/CCAgentSidebarUpper.tsx+++ b/apps/desktop/src/renderer/features/cc-agent/CCAgentSidebarUpper.tsx@@ -44,6 +44,7 @@ import {import { useNavigate, useMatch, useLocation } from 'react-router-dom';import { useTranslation } from 'react-i18next';import { projectDraftSessionTitle } from '@cindy/maker-shared/session-title';+import { CINDY_MAKE_ENABLED, isCindyMakeSource } from '@cindy/maker-shared/cindy-make-feature';import { cn } from '@/lib/utils';import { toast } from '@/lib/toast';@@ -422,8 +423,20 @@ export function CCAgentSidebarUpper() {const filter = useSidebarFilter(hiddenProjectKeys, sidebarSettingsSnapshot);const includeArchived = filter.status;const sessionsHook = useCCSessions({ includeArchived });- const { sessions: allSessionsForAttention } = useCCSessions({ includeArchived: 'all' });- const remoteProjectSessions = useRemoteProjectSessions();+ const { sessions: allSessionsForAttentionRaw } = useCCSessions({ includeArchived: 'all' });+ const allSessionsForAttention = useMemo(+ () => CINDY_MAKE_ENABLED+ ? allSessionsForAttentionRaw+ : allSessionsForAttentionRaw.filter((session) => !isCindyMakeSource(session.source)),+ [allSessionsForAttentionRaw],+ );+ const remoteProjectSessionsRaw = useRemoteProjectSessions();+ const remoteProjectSessions = useMemo(+ () => CINDY_MAKE_ENABLED+ ? remoteProjectSessionsRaw+ : remoteProjectSessionsRaw.filter((session) => !isCindyMakeSource(session.source)),+ [remoteProjectSessionsRaw],+ );const remoteDevices = useRemoteDevices();const selectedMachineId = useEffectiveSelectedMachineId();const searchProjectSessions = useMemo(@@ -571,6 +584,7 @@ export function CCAgentSidebarUpper() {}, [filter.status, remoteDevices, selectedMachineId]);const sessionsWithRemote = useMemo(() => selectVisibleSessions(sessionsHook.sessions, remoteProjectSessions, selectedMachineId)+ .filter((session) => CINDY_MAKE_ENABLED || !isCindyMakeSource(session.source)).filter(session => !session.deviceLinkDeviceId || !isSharedTaskPeer(session.deviceLinkDeviceId)),[sessionsHook.sessions, remoteProjectSessions, selectedMachineId],);@@ -850,7 +864,19 @@ function ExpandedView({const { t, i18n } = useTranslation();const location = useLocation();const localPlatform = window.electronAPI.platform;- const { sessions, refreshSessions, patchLocal, effectiveIncludeArchived } = sessionsHook;+ const sessions = useMemo(+ () => CINDY_MAKE_ENABLED+ ? sessionsHook.sessions+ : sessionsHook.sessions.filter((session) => !isCindyMakeSource(session.source)),+ [sessionsHook.sessions],+ );+ const visibleRemoteSessionsForNotification = useMemo(+ () => CINDY_MAKE_ENABLED+ ? remoteSessionsForNotification+ : remoteSessionsForNotification.filter((session) => !isCindyMakeSource(session.source)),+ [remoteSessionsForNotification],+ );+ const { refreshSessions, patchLocal, effectiveIncludeArchived } = sessionsHook;const {hiddenProjectKeys,setProjectHidden,@@ -1127,8 +1153,8 @@ function ExpandedView({// 不在 sessionsRef 里。保留同步查找和原有兜底,避免标题解析影响通知发送。const allSessionsForNotificationRef = useRef(allSessionsForAttention);allSessionsForNotificationRef.current = allSessionsForAttention;- const remoteSessionsForNotificationRef = useRef(remoteSessionsForNotification);- remoteSessionsForNotificationRef.current = remoteSessionsForNotification;+ const remoteSessionsForNotificationRef = useRef(visibleRemoteSessionsForNotification);+ remoteSessionsForNotificationRef.current = visibleRemoteSessionsForNotification;// 通知文案里的「尚未起名」兜底。走 ref 与 sessionsRef 同款:fireSessionNotification// 是 `[]` 依赖的稳定回调,直接闭包 t 会钉住首次渲染的语言。const unnamedLabelRef = useRef('');@@ -1290,7 +1316,13 @@ function ExpandedView({// device-link 跨设备远程控制:被控设备的会话(内存层,已打 deviceLinkDeviceId 标记)// 与本地会话一视同仁并入同一份列表 → groupSessions 自动归到独立 device: 远程项目。// 远端会话不在本地 DB,故走独立 store,不污染 sessionsStore / 本地链路。- const remoteProjectSessions = useRemoteProjectSessions();+ const remoteProjectSessionsRaw = useRemoteProjectSessions();+ const remoteProjectSessions = useMemo(+ () => CINDY_MAKE_ENABLED+ ? remoteProjectSessionsRaw+ : remoteProjectSessionsRaw.filter((session) => !isCindyMakeSource(session.source)),+ [remoteProjectSessionsRaw],+ );// 机器切换栏选中机器后整体过滤:本机 → 只本地会话;远程 → 只该机器会话。// 过滤在源头做,下游 grouping / pinned / projects / dialogues / date-grouped / search 自动继承。const selectedMachineId = useEffectiveSelectedMachineId();diff --git a/apps/desktop/src/renderer/features/cc-agent/CindyMakeSessionGate.tsx b/apps/desktop/src/renderer/features/cc-agent/CindyMakeSessionGate.tsxnew file mode 100644index 0000000000..15e3530ed3--- /dev/null+++ b/apps/desktop/src/renderer/features/cc-agent/CindyMakeSessionGate.tsx@@ -0,0 +1,36 @@+import { useEffect, useState, useSyncExternalStore, type ReactNode } from 'react';+import { Navigate } from 'react-router-dom';+import { CINDY_MAKE_ENABLED, isCindyMakeSource } from '@cindy/maker-shared/cindy-make-feature';+import { remoteProjectsStore } from '@/features/device-link/remoteProjectsStore';+import { getSessionFor } from '@/lib/makerTransport';+import { sessionsStore } from '@/lib/sessionsStore';++/** Resolve old links before mounting a chat composer or file browser. */+export function CindyMakeSessionGate({ sessionId, children }: {+ sessionId?: string;+ children: ReactNode;+}) {+ const remoteSource = useSyncExternalStore(remoteProjectsStore.subscribe, () =>+ remoteProjectsStore.getMergedRemoteSessions().find(session => session.id === sessionId)?.source,+ );+ const localSource = useSyncExternalStore(sessionsStore.subscribe, () =>+ sessionId ? sessionsStore.findById(sessionId)?.source : undefined,+ );+ const knownSource = remoteSource ?? localSource;+ const [loaded, setLoaded] = useState<{ id: string; source: string | null } | null>(null);+ useEffect(() => {+ if (CINDY_MAKE_ENABLED || !sessionId || knownSource !== undefined) return;+ let cancelled = false;+ void getSessionFor(sessionId).catch(() => null).then(session => {+ if (!cancelled) setLoaded({ id: sessionId, source: session?.source ?? null });+ });+ return () => { cancelled = true; };+ }, [sessionId, knownSource]);++ const source = knownSource ?? (loaded && loaded.id === sessionId ? loaded.source : undefined);+ if (!CINDY_MAKE_ENABLED && isCindyMakeSource(source)) {+ return <Navigate to="/cc-agent" replace />;+ }+ if (!CINDY_MAKE_ENABLED && sessionId && source === undefined) return null;+ return children;+}diff --git a/apps/desktop/src/renderer/features/cc-agent/SecondaryWindowBootGate.tsx b/apps/desktop/src/renderer/features/cc-agent/SecondaryWindowBootGate.tsxindex 30838a329c..6197e557df 100644--- a/apps/desktop/src/renderer/features/cc-agent/SecondaryWindowBootGate.tsx+++ b/apps/desktop/src/renderer/features/cc-agent/SecondaryWindowBootGate.tsx@@ -56,7 +56,7 @@ export function SecondaryWindowBootGate() {// the secondary window's remote mirror has not hydrated yet.remoteProjectsStore.pinSessionOrigin(bootDeviceId, bootSessionId);const mirroredSession = remoteProjectsStore- .getMergedRemoteSessions()+ .getVisibleMergedRemoteSessions().find((session) => session.id === bootSessionId);const remoteSession = mirroredSession ?? (await getSessionFor(bootSessionId));return resolveSessionRoute(bootSessionId, remoteSession);diff --git a/apps/desktop/src/renderer/features/cc-agent/__tests__/CindyMakeIndexRedirect.test.tsx b/apps/desktop/src/renderer/features/cc-agent/__tests__/CindyMakeIndexRedirect.test.tsxnew file mode 100644index 0000000000..9c5d60e250--- /dev/null+++ b/apps/desktop/src/renderer/features/cc-agent/__tests__/CindyMakeIndexRedirect.test.tsx@@ -0,0 +1,34 @@+// @vitest-environment jsdom+import { cleanup, render, waitFor } from '@testing-library/react';+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';+import type { Session } from '@/lib/ccAgent.types';+import { CCAgentIndexRedirect } from '../CCAgentIndexRedirect';++const state = vi.hoisted(() => ({ sessions: [] as Session[], navigate: vi.fn() }));+vi.mock('@/hooks/useCCSessions', () => ({ useCCSessions: () => ({ sessions: state.sessions, isLoading: false }) }));+vi.mock('react-router-dom', () => ({ useNavigate: () => state.navigate }));+vi.mock('react-i18next', () => ({ useTranslation: () => ({ t: (key: string) => key }) }));+vi.mock('../lib/lastViewStore', () => ({ loadLastChatView: () => ({ kind: 'session', sessionId: 'make' }) }));+vi.mock('@/lib/makerTransport', () => ({ getSessionFor: vi.fn(), orcaWorkflowsFor: vi.fn() }));+afterEach(cleanup);+beforeEach(() => { state.sessions = []; state.navigate.mockReset(); });++describe('startup after hiding Cindy Make', () => {+ it('skips the last Make task and hidden cached rows when restoring a task', async () => {+ state.sessions = [+ { id: 'make', source: 'cindy-make' },+ { id: 'merge', source: 'cindy-make-merge' },+ { id: 'ordinary', source: 'desktop' },+ ] as Session[];+ render(<CCAgentIndexRedirect />);+ await waitFor(() => expect(state.navigate).toHaveBeenCalledWith('/cc-agent/ordinary', { replace: true }));+ expect(state.navigate).toHaveBeenCalledTimes(1);+ });++ it('opens a draft when all cached tasks belong to Cindy Make', async () => {+ state.sessions = [{ id: 'make', source: 'cindy-make' }] as Session[];+ render(<CCAgentIndexRedirect />);+ await waitFor(() => expect(state.navigate).toHaveBeenCalledWith('/cc-agent/new', { replace: true }));+ expect(state.navigate).toHaveBeenCalledTimes(1);+ });+});diff --git a/apps/desktop/src/renderer/features/cc-agent/__tests__/CindyMakeSessionGate.test.tsx b/apps/desktop/src/renderer/features/cc-agent/__tests__/CindyMakeSessionGate.test.tsxnew file mode 100644index 0000000000..bce9b51449--- /dev/null+++ b/apps/desktop/src/renderer/features/cc-agent/__tests__/CindyMakeSessionGate.test.tsx@@ -0,0 +1,54 @@+// @vitest-environment jsdom+import { act, cleanup, render, screen } from '@testing-library/react';+import { MemoryRouter, Route, Routes } from 'react-router-dom';+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';+import { CindyMakeSessionGate } from '../CindyMakeSessionGate';++const state = vi.hoisted(() => ({ remote: [] as Array<{ id: string; source: string }>, localSource: undefined as string | undefined, getSession: vi.fn() }));+vi.mock('@/features/device-link/remoteProjectsStore', () => ({ remoteProjectsStore: {+ subscribe: () => () => {}, getMergedRemoteSessions: () => state.remote,+} }));+vi.mock('@/lib/sessionsStore', () => ({ sessionsStore: {+ subscribe: () => () => {}, findById: () => state.localSource ? { source: state.localSource } : null,+} }));+vi.mock('@/lib/makerTransport', () => ({ getSessionFor: state.getSession }));+afterEach(cleanup);+beforeEach(() => { state.remote = []; state.localSource = undefined; state.getSession.mockReset(); });++function mount(child: React.ReactNode = <div>Composer</div>) {+ return render(<MemoryRouter initialEntries={['/old-task']}>+ <Routes>+ <Route path="/old-task" element={<CindyMakeSessionGate sessionId="old-task">{child}</CindyMakeSessionGate>} />+ <Route path="/cc-agent" element={<div>Task list</div>} />+ </Routes>+ </MemoryRouter>);+}++describe('old Cindy Make links', () => {+ it.each(['cindy-make', 'cindy-make-merge'])('redirects a mirrored %s task before mounting its composer', (source) => {+ state.remote = [{ id: 'old-task', source }];+ const Composer = vi.fn(() => <div>Composer</div>);+ mount(<Composer />);+ expect(screen.getByText('Task list')).toBeTruthy();+ expect(Composer).not.toHaveBeenCalled();+ expect(state.getSession).not.toHaveBeenCalled();+ });++ it('waits for metadata and redirects a hidden task missing from visible lists', async () => {+ let resolve!: (value: { source: string }) => void;+ state.getSession.mockReturnValue(new Promise(res => { resolve = res; }));+ const Composer = vi.fn(() => <div>Composer</div>);+ mount(<Composer />);+ expect(Composer).not.toHaveBeenCalled();+ await act(async () => resolve({ source: 'cindy-make' }));+ expect(screen.getByText('Task list')).toBeTruthy();+ expect(Composer).not.toHaveBeenCalled();+ });++ it('opens an ordinary cached task without an extra metadata request', () => {+ state.localSource = 'desktop';+ mount();+ expect(screen.getByText('Composer')).toBeTruthy();+ expect(state.getSession).not.toHaveBeenCalled();+ });+});diff --git a/apps/desktop/src/renderer/features/cc-agent/__tests__/SecondaryWindowBootGate.test.tsx b/apps/desktop/src/renderer/features/cc-agent/__tests__/SecondaryWindowBootGate.test.tsxindex e2d218a602..00cd9223d0 100644--- a/apps/desktop/src/renderer/features/cc-agent/__tests__/SecondaryWindowBootGate.test.tsx+++ b/apps/desktop/src/renderer/features/cc-agent/__tests__/SecondaryWindowBootGate.test.tsx@@ -6,7 +6,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';const mocks = vi.hoisted(() => ({getBootDeviceId: vi.fn<() => string | null>(),getBootSessionId: vi.fn<() => string | null>(),- getMergedRemoteSessions: vi.fn<() => Array<Record<string, unknown>>>(),+ getVisibleMergedRemoteSessions: vi.fn<() => Array<Record<string, unknown>>>(),getSessionFor: vi.fn(),navigate: vi.fn(),pinSessionOrigin: vi.fn(),@@ -24,7 +24,7 @@ vi.mock('@/lib/secondaryWindow', () => ({vi.mock('@/features/device-link/remoteProjectsStore', () => ({remoteProjectsStore: {- getMergedRemoteSessions: mocks.getMergedRemoteSessions,+ getVisibleMergedRemoteSessions: mocks.getVisibleMergedRemoteSessions,pinSessionOrigin: mocks.pinSessionOrigin,},}));@@ -47,14 +47,14 @@ describe('SecondaryWindowBootGate', () => {beforeEach(() => {mocks.getBootDeviceId.mockReset();mocks.getBootSessionId.mockReset();- mocks.getMergedRemoteSessions.mockReset();+ mocks.getVisibleMergedRemoteSessions.mockReset();mocks.getSessionFor.mockReset();mocks.navigate.mockReset();mocks.pinSessionOrigin.mockReset();mocks.resolveSessionRoute.mockReset();mocks.getBootSessionId.mockReturnValue('worker-remote');mocks.getBootDeviceId.mockReturnValue('device-remote');- mocks.getMergedRemoteSessions.mockReturnValue([]);+ mocks.getVisibleMergedRemoteSessions.mockReturnValue([]);});afterEach(() => {diff --git a/apps/desktop/src/renderer/features/cc-agent/lib/mainListModel.ts b/apps/desktop/src/renderer/features/cc-agent/lib/mainListModel.tsindex df98851c7e..84e4a314a4 100644--- a/apps/desktop/src/renderer/features/cc-agent/lib/mainListModel.ts+++ b/apps/desktop/src/renderer/features/cc-agent/lib/mainListModel.ts@@ -24,6 +24,7 @@*/import type { Session } from '@/lib/ccAgent.types';+import { CINDY_MAKE_ENABLED } from '@cindy/maker-shared/cindy-make-feature';import { isCindyMakeFamilySource } from '../../../../shared/cindyMakeMerge';import {MACHINE_ALL,@@ -349,6 +350,21 @@ export function buildMainListEntries({scheduleSessionIndex,}: BuildMainListEntriesInput): MainListEntry[] {const ctx = priorityContext;+ if (!CINDY_MAKE_ENABLED) {+ const keep = (session: Session) => !isCindyMakeFamilySource(session.source);+ projects = projects.flatMap((project) => {+ const sessions = project.sessions.filter(keep);+ if (sessions.length === project.sessions.length) return [project];+ return sessions.length ? [{ ...project, sessions }] : [];+ });+ dialogues = dialogues.filter(keep);+ unclassified = unclassified.filter(keep);+ bots = bots.flatMap((bot) => {+ const sessions = bot.sessions.filter(keep);+ if (sessions.length === bot.sessions.length) return [bot];+ return sessions.length ? [{ ...bot, sessions }] : [];+ });+ }const entries: MainListEntry[] = [];const partitioned = partitionCindyMakeSessions({ projects, dialogues, unclassified });projects = partitioned.projects;diff --git a/apps/desktop/src/renderer/features/cc-agent/workdir-browse/WorkdirBrowseRoute.tsx b/apps/desktop/src/renderer/features/cc-agent/workdir-browse/WorkdirBrowseRoute.tsxindex 536bd078cb..3b550b4556 100644--- a/apps/desktop/src/renderer/features/cc-agent/workdir-browse/WorkdirBrowseRoute.tsx+++ b/apps/desktop/src/renderer/features/cc-agent/workdir-browse/WorkdirBrowseRoute.tsx@@ -46,6 +46,8 @@ import { isAgentIslandSupported } from '@/hooks/useAgentIslandSettings';import { resolveAgentIslandVisibleSessionIdForWorkdirBrowseRail } from '@/lib/agentIslandVisibleSessionRoute';import type { AgentKind } from '@/lib/ccAgent.types';import { CCAgentSessionView } from '../CCAgentSessionView';+import { CindyMakeSessionGate } from '../CindyMakeSessionGate';+import { CINDY_MAKE_ENABLED, isCindyMakeSource } from '@cindy/maker-shared/cindy-make-feature';import {comparePinnedByStatusThenPinnedDesc,compareSessionsByStatusThenSortTimeDesc,@@ -75,6 +77,15 @@ import {const log = createLogger('cc-agent.workdir-browse.route');export function WorkdirBrowseRoute() {+ const { sessionId } = useParams<{ sessionId: string }>();+ return (+ <CindyMakeSessionGate sessionId={sessionId}>+ <WorkdirBrowseContent />+ </CindyMakeSessionGate>+ );+}++function WorkdirBrowseContent() {const { t } = useTranslation();const { sessionId } = useParams<{ sessionId: string }>();const [searchParams, setSearchParams] = useSearchParams();@@ -93,7 +104,7 @@ export function WorkdirBrowseRoute() {// 断链/重连后列表变化会重渲染)。const remoteMirrorSessions = useSyncExternalStore(remoteProjectsStore.subscribe,- remoteProjectsStore.getMergedRemoteSessions,+ remoteProjectsStore.getVisibleMergedRemoteSessions,);const currentSession = useMemo(() =>@@ -159,6 +170,7 @@ export function WorkdirBrowseRoute() {(s) =>projectIdentityKeyForSession(s) === currentProjectKey &&s.status === 'active' &&+ (CINDY_MAKE_ENABLED || !isCindyMakeSource(s.source)) &&!isOrcaWorkerSession(s),);return list.slice().sort((a, b) => {diff --git a/apps/desktop/src/renderer/features/device-link/SharedTaskDialog.tsx b/apps/desktop/src/renderer/features/device-link/SharedTaskDialog.tsxindex 3b7a545995..319a89446a 100644--- a/apps/desktop/src/renderer/features/device-link/SharedTaskDialog.tsx+++ b/apps/desktop/src/renderer/features/device-link/SharedTaskDialog.tsx@@ -14,6 +14,7 @@ import { Textarea } from '@/components/ui/input';import { useAuth } from '@/contexts/AuthContext';import { getDataOwnerGeneration, isDataOwnerGenerationCurrent } from '@/contexts/dataOwnerGeneration';import type { Session } from '@/lib/ccAgent.types';+import { resolveSessionRoute } from '@/lib/orcaSessionIdentity';import { toast } from '@/lib/toast';import { bindSharedTaskPushOwner, resetRemoteDataOwnerPushFence } from '@/lib/remoteDataOwnerPushFence';import { remoteProjectsStore, isRemoteDeviceMarkedDisconnected } from './remoteProjectsStore';@@ -258,9 +259,11 @@ export function SharedTaskDialog({ open, onOpenChange, session, returnFocus, iniconst item = await window.electronAPI.sharedTask.account({ action: 'get', sharedTaskId }) as SharedTaskDetail;if (!current()) return;const peer = sharedTaskHostPeer(item.sharedTaskId, item.hostDeviceId);- const existing = remoteProjectsStore.getMergedRemoteSessions().find(s => s.id === item.sessionId && s.deviceLinkDeviceId === peer);+ const existing = remoteProjectsStore.getVisibleMergedRemoteSessions().find(s => s.id === item.sessionId && s.deviceLinkDeviceId === peer);if (existing && !isRemoteDeviceMarkedDisconnected(peer)) {- navigate('/cc-agent/' + encodeURIComponent(item.sessionId)); onOpenChange(false); return;+ const route = await resolveSessionRoute(item.sessionId, existing);+ if (current()) { navigate(route); onOpenChange(false); }+ return;}bindSharedTaskPushOwner(peer, item.ownerAccountId);await window.electronAPI.deviceLink.openLink(peer);@@ -268,10 +271,12 @@ export function SharedTaskDialog({ open, onOpenChange, session, returnFocus, iniconst remoteSession = await window.electronAPI.deviceLink.invoke(peer, 'local-db:sessions:get', [item.sessionId]) as Session;if (!current() || remoteSession?.id !== item.sessionId) return;remoteProjectsStore.setDeviceSessions(peer, item.title, [remoteSession]);- navigate('/cc-agent/' + encodeURIComponent(item.sessionId)); onOpenChange(false);+ const route = await resolveSessionRoute(item.sessionId, remoteSession);+ if (current()) { navigate(route); onOpenChange(false); }};const openTask = (sharedTaskId: string) => void run(current => enterTask(sharedTaskId, current));const openOwnedTask = (item: SharedTaskOwnedItem) => void run(async current => {+ let targetSession: Session | null = null;if (!item.local) {await window.electronAPI.deviceLink.openLink(item.hostDeviceId);if (!current()) return;@@ -279,10 +284,12 @@ export function SharedTaskDialog({ open, onOpenChange, session, returnFocus, iniconst remoteSession = await window.electronAPI.deviceLink.invoke(item.hostDeviceId, 'local-db:sessions:get', [item.sessionId]) as Session | null;if (!current()) return;if (!readIsCurrent() || remoteSession?.id !== item.sessionId) throw new Error('Remote session is unavailable');+ targetSession = remoteSession;remoteProjectsStore.mergeDeviceSessions(item.hostDeviceId, deviceName(item), [readIsCurrent.mergeActivity(remoteSession)]);remoteProjectsStore.pinSessionOrigin(item.hostDeviceId, item.sessionId);}- if (current()) { navigate('/cc-agent/' + encodeURIComponent(item.sessionId)); onOpenChange(false); }+ const route = await resolveSessionRoute(item.sessionId, targetSession);+ if (current()) { navigate(route); onOpenChange(false); }});useEffect(() => {if (!open || !isAuthenticated || !initialInvitation || invitation !== initialInvitationdiff --git a/apps/desktop/src/renderer/features/device-link/__tests__/JoinSharedTaskDialog.test.tsx b/apps/desktop/src/renderer/features/device-link/__tests__/JoinSharedTaskDialog.test.tsxindex 2d89644dc6..d3fc0e4ac1 100644--- a/apps/desktop/src/renderer/features/device-link/__tests__/JoinSharedTaskDialog.test.tsx+++ b/apps/desktop/src/renderer/features/device-link/__tests__/JoinSharedTaskDialog.test.tsx@@ -12,7 +12,7 @@ const state = vi.hoisted(() => ({ account: vi.fn(), host: vi.fn(), openLink: vi.vi.mock('react-i18next', () => ({ useTranslation: () => ({ t: (key: string, args?: { title?: string }) => key + (args?.title ? ':' + args.title : '') }) }));vi.mock('@/contexts/AuthContext', () => ({ useAuth: () => ({ dataOwnerId: 'guest', isAuthenticated: true, user: { name: 'Account Guest' } }) }));vi.mock('@/lib/toast', () => ({ toast: { error: vi.fn(), success: vi.fn() } }));-vi.mock('../remoteProjectsStore', () => ({ remoteProjectsStore: { getDeviceName: () => undefined, setDeviceSessions: state.setSessions, mergeDeviceSessions: state.mergeSessions, pinSessionOrigin: state.pin, captureSessionRead: state.captureRead, removeDevice: state.removeDevice, getMergedRemoteSessions: state.getSessions }, isRemoteDeviceMarkedDisconnected: () => false }));+vi.mock('../remoteProjectsStore', () => ({ remoteProjectsStore: { getDeviceName: () => undefined, setDeviceSessions: state.setSessions, mergeDeviceSessions: state.mergeSessions, pinSessionOrigin: state.pin, captureSessionRead: state.captureRead, removeDevice: state.removeDevice, getVisibleMergedRemoteSessions: state.getSessions }, isRemoteDeviceMarkedDisconnected: () => false }));vi.mock('@/lib/remoteDataOwnerPushFence', () => ({ bindSharedTaskPushOwner: state.bind, resetRemoteDataOwnerPushFence: state.reset }));const owned = [{ sharedTaskId: 'own-1', sessionId: 'local-task', ownerAccountId: 'guest', hostDeviceId: 'pc', revision: 1, title: 'First owned task', local: true },diff --git a/apps/desktop/src/renderer/features/device-link/remoteProjectsStore.ts b/apps/desktop/src/renderer/features/device-link/remoteProjectsStore.tsindex 4899c3d377..13e08a7a2c 100644--- a/apps/desktop/src/renderer/features/device-link/remoteProjectsStore.ts+++ b/apps/desktop/src/renderer/features/device-link/remoteProjectsStore.ts@@ -1,4 +1,5 @@import { normalizeTaskTags, reconcileTaskTags } from '@cindy/maker-shared';+import { CINDY_MAKE_ENABLED, isCindyMakeSource } from '@cindy/maker-shared/cindy-make-feature';/*** remoteProjectsStore —— 控制端「远程项目」内存层(device-link 跨设备远程控制)。* ---------------------------------------------------------------------------@@ -159,6 +160,8 @@ let bootstrapRetryImpl: ((deviceId: string) => void) | null = null;/** 扁平合并快照(缓存引用,变化时才换新)。 */let mergedSnapshot: Session[] = [];+/** UI 订阅使用的稳定投影;协议与传输层仍可读取 mergedSnapshot 原始镜像。 */+let visibleMergedSnapshot: Session[] = [];/** sessionId → deviceId 注册表(随分片变化重建)。 */const sessionDeviceIndex = new Map<string, string>();/** sessionId → 投影后标题(含标题预览),随 recompute 重建;供消息来源标签 O(1) 查询。 */@@ -467,6 +470,15 @@ function recompute(): void {}mergedSnapshot = flat;}+ const nextVisible = CINDY_MAKE_ENABLED+ ? mergedSnapshot+ : mergedSnapshot.filter((session) => !isCindyMakeSource(session.source));+ if (+ visibleMergedSnapshot.length !== nextVisible.length ||+ visibleMergedSnapshot.some((session, index) => session !== nextVisible[index])+ ) {+ visibleMergedSnapshot = nextVisible;+ }// 设备列表快照:按 deviceName(再 deviceId 兜底)稳定排序,避免 Map 插入序在设备增删时// 抖动导致切换栏 chip 乱跳;内容不变时保持旧引用(防 useRemoteDevices 无谓重渲染)。if (shards.size === 0) {@@ -1004,6 +1016,11 @@ const actions = {return mergedSnapshot;},+ /** 用户界面使用的远端会话投影;旧 Cindy Make 行保留在原始镜像中但不可见。 */+ getVisibleMergedRemoteSessions(): Session[] {+ return visibleMergedSnapshot;+ },+/*** 发送瞬间登记标题预览(见 {@link pendingTitlePreview})。只影响投影层显示,* 权威标题仍由被控端写回;被控端标题到达后本条自动失效。@@ -1390,7 +1407,7 @@ export function useRemoteSessionTitle(sessionId: string | undefined): string | n/** 组件内订阅:返回扁平远端会话快照(喂给 sidebar 合并点)。 */export function useRemoteProjectSessions(): Session[] {- return useSyncExternalStore(subscribe, actions.getMergedRemoteSessions);+ return useSyncExternalStore(subscribe, actions.getVisibleMergedRemoteSessions);}/** 组件内订阅:返回当前已连接的被控设备摘要列表(机器切换栏 chips)。 */diff --git a/apps/desktop/src/renderer/features/right-sidebar/AddTabDropdown.tsx b/apps/desktop/src/renderer/features/right-sidebar/AddTabDropdown.tsxindex cf1743b0ec..9120e1855c 100644--- a/apps/desktop/src/renderer/features/right-sidebar/AddTabDropdown.tsx+++ b/apps/desktop/src/renderer/features/right-sidebar/AddTabDropdown.tsx@@ -10,7 +10,7 @@import { useEffect } from 'react';import { useTranslation } from 'react-i18next';-import { Bot, FileDiff, FolderTree, Globe, ListTodo, Terminal, Wrench } from 'lucide-react';+import { Bot, FileDiff, FolderTree, Globe, ListTodo, Terminal } from 'lucide-react';import type { LucideIcon } from 'lucide-react';import {DropdownMenuContent,@@ -98,14 +98,6 @@ const MENU_ITEMS: TabKindMenuMeta[] = [order: 30,enabled: true,},- {- kind: 'cindy-make',- labelKey: 'settings.cindyMake.title',- icon: Wrench,- order: 12,- enabled: true,- singleton: true,- },];export function AddTabDropdown({diff --git a/apps/desktop/src/renderer/features/right-sidebar/RightSidebarShell.tsx b/apps/desktop/src/renderer/features/right-sidebar/RightSidebarShell.tsxindex ecab587f13..16bae6691f 100644--- a/apps/desktop/src/renderer/features/right-sidebar/RightSidebarShell.tsx+++ b/apps/desktop/src/renderer/features/right-sidebar/RightSidebarShell.tsx@@ -31,6 +31,7 @@ import {import { useTranslation } from 'react-i18next';import { createLogger } from '@/lib/logger';+import { CINDY_MAKE_ENABLED } from '@cindy/maker-shared/cindy-make-feature';import { toast } from '@/lib/toast';import { mapIpcErrorToI18nKey } from '@/utils/ipcError';import { useAppShortcut } from '@/hooks/useAppShortcut';@@ -404,6 +405,10 @@ export function RightSidebarShell({const handleAdd = useCallback((kind: TabKindId) => {+ if (kind === 'cindy-make' && !CINDY_MAKE_ENABLED) {+ log.warn('handleAdd ignored: Cindy Make is disabled');+ return;+ }if (!sessionId) {log.warn('handleAdd ignored: sessionId is null', { kind });return;diff --git a/apps/desktop/src/renderer/features/right-sidebar/__tests__/TabBar.test.tsx b/apps/desktop/src/renderer/features/right-sidebar/__tests__/TabBar.test.tsxindex 27e01fd343..b19983f844 100644--- a/apps/desktop/src/renderer/features/right-sidebar/__tests__/TabBar.test.tsx+++ b/apps/desktop/src/renderer/features/right-sidebar/__tests__/TabBar.test.tsx@@ -116,6 +116,26 @@ describe('TabStrip Pi Subagents gate', () => {});});+describe('TabStrip Cindy Make menu visibility', () => {+ it('keeps Cindy Make out of the add menu', () => {+ renderStrip();+ const addButton = screen.getByRole('button', { name: 'rightSidebar.tabs.addAria' });+ vi.spyOn(addButton.parentElement as HTMLElement, 'getBoundingClientRect').mockReturnValue({+ x: 20,+ y: 20,+ top: 20,+ right: 44,+ bottom: 44,+ left: 20,+ width: 24,+ height: 24,+ toJSON: () => ({}),+ });+ fireEvent.pointerDown(addButton, { button: 0, ctrlKey: false });+ expect(screen.queryByText('settings.cindyMake.title')).toBeNull();+ });+});+afterEach(() => cleanup());describe('TabStrip 中键关闭 tab', () => {diff --git a/apps/desktop/src/renderer/features/right-sidebar/__tests__/tabAvailability.test.ts b/apps/desktop/src/renderer/features/right-sidebar/__tests__/tabAvailability.test.tsindex 6bc29ffd21..ff37ce6f13 100644--- a/apps/desktop/src/renderer/features/right-sidebar/__tests__/tabAvailability.test.ts+++ b/apps/desktop/src/renderer/features/right-sidebar/__tests__/tabAvailability.test.ts@@ -13,6 +13,15 @@ const affected = {retirement: { id: 'embedded-ios-simulator', eligible: true, unread: true },} as InstalledGhost;describe('sidebar availability', () => {+ it('filters persisted Cindy Make tabs when the product is disabled', () => {+ const cindyTabs = [+ { id: 'file', kind: 'file-browser', state: null },+ { id: 'make', kind: 'cindy-make', state: null },+ ] as unknown as TabState[];+ const visible = projectAvailableTabs(cindyTabs, 'make', { installedGhosts: [], subagentsAvailable: true });+ expect(visible.tabs.map((tab) => tab.id)).toEqual(['file']);+ expect(visible.activeTabId).toBe('file');+ });it.each([true, false])('preserves an installed plugin old tab (migration eligible=%s)', (eligible) => {const visible = projectAvailableTabs(tabs, 'old', {installedGhosts: [{diff --git a/apps/desktop/src/renderer/features/right-sidebar/plugins/cindy-make/index.tsx b/apps/desktop/src/renderer/features/right-sidebar/plugins/cindy-make/index.tsxindex b11b3d85e2..25e4433b54 100644--- a/apps/desktop/src/renderer/features/right-sidebar/plugins/cindy-make/index.tsx+++ b/apps/desktop/src/renderer/features/right-sidebar/plugins/cindy-make/index.tsx@@ -36,6 +36,7 @@ const plugin: TabKindPlugin<CindyMakeState> = {icon: Wrench,order: 12,enabled: true,+ hiddenFromMenu: true,singleton: true,},TabPillTitle: CindyMakeTabPillTitle,diff --git a/apps/desktop/src/renderer/features/right-sidebar/plugins/index.ts b/apps/desktop/src/renderer/features/right-sidebar/plugins/index.tsindex 4dc6c93ec8..c3df787785 100644--- a/apps/desktop/src/renderer/features/right-sidebar/plugins/index.ts+++ b/apps/desktop/src/renderer/features/right-sidebar/plugins/index.ts@@ -20,4 +20,3 @@ import './background-tasks';import './resource-usage';import './routines';import './bot-workbench';-import './cindy-make';diff --git a/apps/desktop/src/renderer/features/right-sidebar/tabAvailability.ts b/apps/desktop/src/renderer/features/right-sidebar/tabAvailability.tsindex a53b54e18f..1987c0c21d 100644--- a/apps/desktop/src/renderer/features/right-sidebar/tabAvailability.ts+++ b/apps/desktop/src/renderer/features/right-sidebar/tabAvailability.ts@@ -1,4 +1,5 @@import type { InstalledGhost } from '../../../shared/ghost';+import { CINDY_MAKE_ENABLED } from '@cindy/maker-shared/cindy-make-feature';import { FEATURE_RETIREMENTS } from '../../../shared/featureRetirements';import type { TabState } from './types';@@ -29,6 +30,7 @@ function retiredTab(function isUnavailableTab(tab: TabState, availability: RightSidebarTabAvailability): boolean {return (+ (!CINDY_MAKE_ENABLED && tab.kind === 'cindy-make') ||retiredTab(tab, availability) === null ||(tab.kind === 'subagents' && !availability.subagentsAvailable));diff --git a/apps/desktop/src/renderer/lib/__tests__/conversationSearchFanout.test.ts b/apps/desktop/src/renderer/lib/__tests__/conversationSearchFanout.test.tsindex 24522f981c..8f54addff5 100644--- a/apps/desktop/src/renderer/lib/__tests__/conversationSearchFanout.test.ts+++ b/apps/desktop/src/renderer/lib/__tests__/conversationSearchFanout.test.ts@@ -283,6 +283,16 @@ describe('shouldReleaseConversationSearchLock', () => {});describe('merge and stamp', () => {+ it('excludes hidden Make tasks from indexed and reused remote results before limiting', () => {+ const page = response([+ result('make', 100, { source: 'cindy-make', deviceLinkDeviceId: 'dev-a' }),+ result('merge', 99, { source: 'cindy-make-merge', deviceLinkDeviceId: 'dev-a' }),+ result('ordinary', 1, { source: 'desktop', deviceLinkDeviceId: 'dev-a' }),+ ]);+ expect(mergeConversationSearchFanout([page], 1).results.map(item => item.session.id)).toEqual(['ordinary']);+ expect(remoteResultsFromFanoutPages([page]).map(item => item.session.id)).toEqual(['ordinary']);+ expect(filterResultsByRequestFilters(page, {}).results.map(item => item.session.id)).toEqual(['ordinary']);+ });it('keeps same-id hits from different devices and stamps origin', () => {const remote = stampRemoteSearchResponse(response([result('same', 10)]), {deviceId: 'dev-a',@@ -301,6 +311,15 @@ describe('merge and stamp', () => {});describe('searchCachedSessionsByTitle', () => {+ it('excludes both Make sources from cached titles even if explicitly requested', () => {+ const rows = [+ session({ id: 'make', title: 'needle', source: 'cindy-make' }),+ session({ id: 'merge', title: 'needle', source: 'cindy-make-merge' }),+ session({ id: 'ordinary', title: 'Needle notes', source: 'desktop' }),+ ];+ expect(searchCachedSessionsByTitle(rows, { query: 'needle', limit: 1 }).results.map(item => item.session.id)).toEqual(['ordinary']);+ expect(searchCachedSessionsByTitle(rows, { query: 'needle', filters: { sessionIds: ['make', 'merge'] } }).results).toEqual([]);+ });it('excludes active and archived companions before ranking and limiting title matches', () => {const rows = [session({ id: 'bot-active', title: 'needle', source: 'bot' }),diff --git a/apps/desktop/src/renderer/lib/conversationSearchFanout.ts b/apps/desktop/src/renderer/lib/conversationSearchFanout.tsindex b47c4234ba..f104078065 100644--- a/apps/desktop/src/renderer/lib/conversationSearchFanout.ts+++ b/apps/desktop/src/renderer/lib/conversationSearchFanout.ts@@ -30,6 +30,7 @@ import {projectKeyComparisonKey,} from '../../shared/projectKeys';import { normalizeWorkingDirForGrouping } from '../../shared/workingDir';+import { CINDY_MAKE_ENABLED, isCindyMakeSource } from '@cindy/maker-shared/cindy-make-feature';export interface ConversationSearchDevice {deviceId: string;@@ -257,6 +258,7 @@ export function remoteResultsFromFanoutPages(const byKey = new Map<string, ConversationSearchResultItem>();for (const page of pages) {for (const item of page.results) {+ if (!CINDY_MAKE_ENABLED && isCindyMakeSource(item.session.source)) continue;if (!item.session.deviceLinkDeviceId) continue;const key = conversationSearchResultKey(item);const existing = byKey.get(key);@@ -276,6 +278,7 @@ export function mergeConversationSearchFanout(const byKey = new Map<string, ConversationSearchResultItem>();for (const page of pages) {for (const item of page.results) {+ if (!CINDY_MAKE_ENABLED && isCindyMakeSource(item.session.source)) continue;const key = conversationSearchResultKey(item);const existing = byKey.get(key);if (!existing || item.rankScore > existing.rankScore) {@@ -321,7 +324,7 @@ export function searchCachedSessionsByTitle(sessions.forEach((session, index) => {// The mirror includes companion chat metadata; ordinary search must not expose it.- if (session.source === 'bot' || isOrcaWorkerSession(session)) return;+ if (session.source === 'bot' || (!CINDY_MAKE_ENABLED && isCindyMakeSource(session.source)) || isOrcaWorkerSession(session)) return;if (allowed && !allowed.has(session.id)) return;if (!matchesWorkingDirSet(session.workingDir, workingDirs)) return;if (!matchesStatus(session.status, filters.status ?? 'all')) return;@@ -418,6 +421,7 @@ export function filterResultsByRequestFilters(return {...response,results: response.results.filter((item) => {+ if (!CINDY_MAKE_ENABLED && isCindyMakeSource(item.session.source)) return false;if (!matchesWorkingDirSet(item.session.workingDir, allowedDirs)) return false;if (isOrcaWorkerSession(item.session)) return false;if (!matchesStatus(item.session.status, status)) return false;diff --git a/apps/desktop/src/renderer/lib/conversationSearchService.ts b/apps/desktop/src/renderer/lib/conversationSearchService.tsindex 7dba5c54bf..0f3374fa06 100644--- a/apps/desktop/src/renderer/lib/conversationSearchService.ts+++ b/apps/desktop/src/renderer/lib/conversationSearchService.ts@@ -222,7 +222,7 @@ export function searchConversations(window.electronAPI.deviceLink.invoke(deviceId, channel, args),listCachedRemoteSessions: (deviceId) =>remoteProjectsStore- .getMergedRemoteSessions()+ .getVisibleMergedRemoteSessions().filter((session) => session.deviceLinkDeviceId === deviceId),});}diff --git a/apps/desktop/src/renderer/lib/orcaSessionIdentity.ts b/apps/desktop/src/renderer/lib/orcaSessionIdentity.tsindex 33ec593c99..770ced0104 100644--- a/apps/desktop/src/renderer/lib/orcaSessionIdentity.ts+++ b/apps/desktop/src/renderer/lib/orcaSessionIdentity.ts@@ -1,6 +1,6 @@import type { OrcaRole, Session } from '@/lib/ccAgent.types';-import * as sessionService from '@/lib/sessionService';-import { orcaWorkflowsFor } from '@/lib/makerTransport';+import { getSessionFor, orcaWorkflowsFor } from '@/lib/makerTransport';+import { CINDY_MAKE_ENABLED, isCindyMakeSource } from '@cindy/maker-shared/cindy-make-feature';export function isOrcaLeadSession(session: { orcaRole?: OrcaRole | null }): boolean {return session.orcaRole === 'lead';@@ -39,9 +39,10 @@ export function getSessionRouteOwnerId(route: string): string | null {*/export async function resolveSessionRoute(sessionId: string,- session?: Pick<Session, 'orcaRole'> | null,+ session?: Pick<Session, 'orcaRole'> & Partial<Pick<Session, 'source'>> | null,): Promise<string> {- const targetSession = session ?? (await sessionService.get(sessionId).catch(() => null));+ const targetSession = session ?? (await getSessionFor(sessionId).catch(() => null));+ if (!CINDY_MAKE_ENABLED && isCindyMakeSource(targetSession?.source)) return '/cc-agent';if (targetSession && isOrcaLeadSession(targetSession)) {return `/cc-agent/${sessionId}`;diff --git a/apps/desktop/src/renderer/lib/tabLabels.ts b/apps/desktop/src/renderer/lib/tabLabels.tsindex 5aaaa6cc95..d26e6031eb 100644--- a/apps/desktop/src/renderer/lib/tabLabels.ts+++ b/apps/desktop/src/renderer/lib/tabLabels.ts@@ -57,7 +57,6 @@ export const TAB_IDS = ['ghosts','builtin-tools','computer-use',- 'cindy-make','storage','help','about',diff --git a/apps/desktop/src/shared/sessionSource.ts b/apps/desktop/src/shared/sessionSource.tsindex 4b4dd21aaf..0cb4a9c0f4 100644--- a/apps/desktop/src/shared/sessionSource.ts+++ b/apps/desktop/src/shared/sessionSource.ts@@ -1,3 +1,5 @@+import { CINDY_MAKE_ENABLED } from '@cindy/maker-shared/cindy-make-feature';+export const SESSION_SOURCES = ['desktop','feishu',@@ -83,8 +85,7 @@ export const DESKTOP_VISIBLE_SESSION_SOURCES: SessionSource[] = ['review','shared','plugin',- 'cindy-make',- 'cindy-make-merge',+ ...(CINDY_MAKE_ENABLED ? (['cindy-make', 'cindy-make-merge'] as const) : []),];export function normalizeSessionSource(source: unknown): SessionSource {diff --git a/apps/mobile/app/files/[sessionId].tsx b/apps/mobile/app/files/[sessionId].tsxindex 903aee8d4a..d7b82ac7fd 100644--- a/apps/mobile/app/files/[sessionId].tsx+++ b/apps/mobile/app/files/[sessionId].tsx@@ -114,6 +114,8 @@ import { imageMimeFromUrl } from '@/session/remoteMediaDiskCache';import { downloadRemoteMediaShareTemp } from '@/session/remoteMediaDiskCacheExpo';import type { FileBrowserSearchMatch, MobileMakerTransport } from '@/device-link/mobileMakerTransport';import { remoteSessionStore, useRemoteSessions } from '@/session/remoteSessionStore';+import { CindyMakeSessionGate } from '@/session/CindyMakeSessionGate';+import { CINDY_MAKE_ENABLED, isCindyMakeSource } from '@cindy/maker-shared/cindy-make-feature';import type { RemoteSession } from '@/session/types';import { fontWeight, lineHeight, monoFont, useTheme, useThemedStyles, type ThemeColors } from '@/theme';import { docThumbSnippetType, iconSize, iconStroke, radius, spacing, typeScale } from '@/theme/tokens';@@ -123,6 +125,15 @@ const NOTICE_DISMISS_MS = 2500;const SEARCH_FILES_CAP = 20000;export default function RemoteFileBrowserScreen() {+ const { sessionId } = useLocalSearchParams<{ sessionId: string }>();+ return (+ <CindyMakeSessionGate sessionId={String(sessionId ?? '')}>+ <RemoteFileBrowserContent />+ </CindyMakeSessionGate>+ );+}++function RemoteFileBrowserContent() {const styles = useThemedStyles(makeStyles);const { colors } = useTheme();const { t, i18n: i18nInstance } = useTranslation();@@ -225,16 +236,23 @@ export default function RemoteFileBrowserScreen() {return;}if (!deviceId || !sessionId) return;+ let cancelled = false;void withTransientRemoteRetry(async () => {await openLink(deviceId);return maker.getSession(sessionId);}).then((loaded) => {+ if (cancelled) return;+ if (!CINDY_MAKE_ENABLED && isCindyMakeSource(loaded?.source)) {+ router.replace('/');+ return;+ }setSession(loaded);setError(null);})- .catch((err) => setError(formatRemoteError(err)));- }, [deviceId, deviceUnresponsive, knownSession, maker, openLink, sessionId]);+ .catch((err) => { if (!cancelled) setError(formatRemoteError(err)); });+ return () => { cancelled = true; };+ }, [deviceId, deviceUnresponsive, knownSession, maker, openLink, router, sessionId]);// workdir 就绪后加载偏好(异步存储可能比同步内存新)。useEffect(() => {diff --git a/apps/mobile/app/files/preview/[sessionId].tsx b/apps/mobile/app/files/preview/[sessionId].tsxindex e9538fef23..5b7dd29f30 100644--- a/apps/mobile/app/files/preview/[sessionId].tsx+++ b/apps/mobile/app/files/preview/[sessionId].tsx@@ -95,6 +95,8 @@ import type { MobileMessageGalleryImage } from '@/session/messageGallery';import type { MobileRemoteMediaPresignResult } from '@/session/remoteMedia';import { downloadRemoteMediaShareTemp } from '@/session/remoteMediaDiskCacheExpo';import { remoteSessionStore, useRemoteSessions } from '@/session/remoteSessionStore';+import { CindyMakeSessionGate } from '@/session/CindyMakeSessionGate';+import { CINDY_MAKE_ENABLED, isCindyMakeSource } from '@cindy/maker-shared/cindy-make-feature';import type { RemoteSession } from '@/session/types';import { fontWeight, lineHeight, monoFont, useTheme, useThemedStyles, type ThemeColors } from '@/theme';import { iconSize, iconStroke, radius, spacing, typeScale } from '@/theme/tokens';@@ -159,6 +161,15 @@ function avKindFor(pathOrName: string): 'video' | 'audio' | null {}export default function RemoteFilePreviewScreen() {+ const { sessionId } = useLocalSearchParams<{ sessionId: string }>();+ return (+ <CindyMakeSessionGate sessionId={String(sessionId ?? '')}>+ <RemoteFilePreviewContent />+ </CindyMakeSessionGate>+ );+}++function RemoteFilePreviewContent() {const styles = useThemedStyles(makeStyles);const { colors } = useTheme();const { t, i18n: i18nInstance } = useTranslation();@@ -274,17 +285,24 @@ export default function RemoteFilePreviewScreen() {return;}if (!deviceId || !sessionId) return;+ let cancelled = false;void withTransientRemoteRetry(async () => {await openLink(deviceId);return maker.getSession(sessionId);}).then((loaded) => {+ if (cancelled) return;+ if (!CINDY_MAKE_ENABLED && isCindyMakeSource(loaded?.source)) {+ router.replace('/');+ return;+ }setSession(loaded);// 清掉熔断 open 期间留下的错误快照,恢复后不再残留降级横幅。setError(null);})- .catch((err) => setError(formatRemoteError(err)));- }, [deviceId, deviceUnresponsive, knownSession, maker, openLink, recoveryEpoch, sessionId]);+ .catch((err) => { if (!cancelled) setError(formatRemoteError(err)); });+ return () => { cancelled = true; };+ }, [deviceId, deviceUnresponsive, knownSession, maker, openLink, recoveryEpoch, router, sessionId]);// absPath 单文件模式:不列目录,直接以合成 item 装单页 pager。useEffect(() => {diff --git a/apps/mobile/app/sessions/[sessionId].tsx b/apps/mobile/app/sessions/[sessionId].tsxindex 21cbed8738..495312d8ea 100644--- a/apps/mobile/app/sessions/[sessionId].tsx+++ b/apps/mobile/app/sessions/[sessionId].tsx@@ -632,6 +632,7 @@ import {useSessionRunning,useSessionTaskUpdates,} from '@/session/remoteSessionStore';+import { CindyMakeSessionGate } from '@/session/CindyMakeSessionGate';import type {MobileGoalLimitsInput,MobileGoalStatusPayload,@@ -977,6 +978,15 @@ function composerDraftScopeKey(sessionId: string, routeDraft: string | null): st}export default function SessionScreen() {+ const { sessionId } = useLocalSearchParams<{ sessionId: string }>();+ return (+ <CindyMakeSessionGate sessionId={readRouteParam(sessionId) ?? ''}>+ <SessionScreenContent />+ </CindyMakeSessionGate>+ );+}++function SessionScreenContent() {const styles = useThemedStyles(makeStyles);const { colors, mode } = useTheme();const { t, i18n: i18nInstance } = useTranslation();diff --git a/apps/mobile/src/__tests__/cindyMakeHome.test.ts b/apps/mobile/src/__tests__/cindyMakeHome.test.tsindex ecc0f0f2bd..52179b9f0f 100644--- a/apps/mobile/src/__tests__/cindyMakeHome.test.ts+++ b/apps/mobile/src/__tests__/cindyMakeHome.test.ts@@ -1,8 +1,7 @@import { afterEach, describe, expect, it } from 'vitest';import { i18n } from '@/i18n';import { buildMobileHomePresentation, type MobileHomeSessionLike } from '@/session/mobileHome';-import { buildHomeSections, homeRowsShareRenderData, isFolderHomeRow } from '@/session/homeSections';-import { buildHomeProjectMachineIdentities } from '@/session/homeProjectMachineIdentity';+import { buildHomeSections } from '@/session/homeSections';const initialLanguage = i18n.language;afterEach(async () => { await i18n.changeLanguage(initialLanguage); });@@ -18,54 +17,58 @@ function session(id: string, patch: Partial<MobileHomeSessionLike> = {}): MobileupdatedAt: '2026-01-01T00:00:00.000Z',deviceLinkDeviceId: 'pc',deviceLinkDeviceName: 'My PC',- workingDir: `/data/make/${id}`,+ workingDir: '/data/make/' + id,source: 'cindy-make',...patch,};}-describe('Cindy Make home folder', () => {- it.each(['zh-CN', 'zh-TW', 'en', 'ja', 'ko'])('keeps one named folder in grouped and flat home views (%s)', async (locale) => {+describe('Cindy Make home visibility', () => {+ it.each(['zh-CN', 'zh-TW', 'en', 'ja', 'ko'])('hides Cindy Make rows in grouped and flat home views (%s)', async (locale) => {await i18n.changeLanguage(locale);const home = buildMobileHomePresentation({sessions: [session('feature'),session('merge', { source: 'cindy-make-merge' }),- session('project', { source: undefined, workingDir: '/repo/ordinary' }),+ session('ordinary', { source: undefined, workingDir: '/repo/ordinary' }),],});+ expect(home.projects.flatMap((project) => project.sessions.map((item) => item.session.id))).toEqual(['ordinary']);+ expect(home.pinned).toEqual([]);+ expect(home.chats).toEqual([]);for (const groupByProject of [true, false]) {const rows = buildHomeSections(home, groupByProject, false).flatMap((section) => section.data);- const folders = rows.filter((row) => row.kind === 'cindy-make');- expect(folders).toHaveLength(1);- expect(isFolderHomeRow(folders[0])).toBe(true);- expect(folders[0].project).toMatchObject({ title: 'Cindy Make', workingDir: '', subtitle: 'My PC' });- expect(folders[0].project.sessions.map((item) => item.session.id).sort()).toEqual(['feature', 'merge']);- expect(rows).toHaveLength(2);- const identities = buildHomeProjectMachineIdentities(home);- expect(identities.get(folders[0].key)?.displayLabel).toBe('My PC');+ const visibleIds = rows.flatMap((row) => {+ if (row.kind === 'session') return [row.item.session.id];+ if (row.kind === 'project' || row.kind === 'dialogue') {+ return row.project.sessions.map((item) => item.session.id);+ }+ return [];+ });+ expect(visibleIds).toEqual(['ordinary']);+ expect(rows.some((row) => row.kind === 'cindy-make')).toBe(false);}- const groupedFolder = buildHomeSections(home, true, false)[0].data.find((row) => row.kind === 'cindy-make')!;- const flatFolder = buildHomeSections(home, false, false)[0].data.find((row) => row.kind === 'cindy-make')!;- expect(homeRowsShareRenderData(groupedFolder, flatFolder)).toBe(true);});- it('keeps every task available in the flat task-switching drawer', () => {- const sessions = Array.from({ length: 12 }, (_, index) => session(`make-${index}`));+ it('does not put disabled Cindy Make tasks in the flat task-switching drawer', () => {+ const sessions = [+ ...Array.from({ length: 12 }, (_, index) => session('make-' + index)),+ session('ordinary', { source: undefined, workingDir: '/repo/ordinary' }),+ ];const home = buildMobileHomePresentation({ sessions });- const rows = buildHomeSections(home, false, false, { groupCindyMake: false }).flatMap((section) => section.data);- expect(rows).toHaveLength(sessions.length);- expect(rows.every((row) => row.kind === 'session' && row.sourceLabel === 'Cindy Make')).toBe(true);- expect(rows.flatMap((row) => row.kind === 'session' ? [row.item.session.id] : []).sort())- .toEqual(sessions.map((item) => item.id).sort());+ const rows = buildHomeSections(home, false, false, { groupCindyMake: false })+ .flatMap((section) => section.data);+ expect(rows).toHaveLength(1);+ expect(rows[0]?.kind).toBe('session');+ if (rows[0]?.kind === 'session') expect(rows[0].item.session.id).toBe('ordinary');});- it('sorts the folder and its tasks by priority while keeping pins separate', () => {+ it('keeps ordinary priority ordering while Cindy Make tasks are hidden', () => {const home = buildMobileHomePresentation({sessions: [session('waiting', { source: 'cindy-make-merge' }),- session('running'),- session('pinned', { pinnedAt: '2026-01-02T00:00:00.000Z' }),+ session('running', { source: undefined }),+ session('pinned', { source: undefined, pinnedAt: '2026-01-02T00:00:00.000Z' }),session('ordinary', { source: undefined, updatedAt: '2026-01-03T00:00:00.000Z' }),],pendingInteractionIndex: new Map([['waiting', 1]]),@@ -79,10 +82,7 @@ describe('Cindy Make home folder', () => {},});expect(sections[0].data.map((row) => row.kind === 'session' ? row.item.session.id : row.kind)).toEqual(['pinned']);- const first = sections[1].data[0];- expect(first.kind).toBe('cindy-make');- if (!isFolderHomeRow(first)) throw new Error('Expected the Cindy Make folder');- expect(first.project.sessions.map((item) => item.session.id)).toEqual(['waiting', 'running']);- expect(first.project.pendingInteractionCount).toBe(1);+ expect(sections[1].data.map((row) => row.kind === 'session' ? row.item.session.id : row.kind)).toEqual(['running', 'ordinary']);+ expect(sections.some((section) => section.data.some((row) => row.kind === 'cindy-make'))).toBe(false);});});diff --git a/apps/mobile/src/__tests__/cindyMakeSessionGate.test.tsx b/apps/mobile/src/__tests__/cindyMakeSessionGate.test.tsxnew file mode 100644index 0000000000..5cc9182e14--- /dev/null+++ b/apps/mobile/src/__tests__/cindyMakeSessionGate.test.tsx@@ -0,0 +1,55 @@+// @vitest-environment jsdom+import { act, createElement } from 'react';+import { createRoot, type Root } from 'react-dom/client';+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';+import { CindyMakeSessionGate } from '@/session/CindyMakeSessionGate';++const state = vi.hoisted(() => ({ sessions: [] as Array<{ id: string; source: string }>, listeners: new Set<() => void>() }));+vi.mock('@/session/remoteSessionStore', () => ({ remoteSessionStore: {+ getSessions: () => state.sessions,+ subscribe: (listener: () => void) => { state.listeners.add(listener); return () => { state.listeners.delete(listener); }; },+} }));+vi.mock('expo-router', () => ({ Redirect: ({ href }: { href: string }) => createElement('span', {}, `redirect:${href}`) }));++let root: Root;+let container: HTMLDivElement;+const reactActEnvironment = globalThis as typeof globalThis & { IS_REACT_ACT_ENVIRONMENT?: boolean };+let originalActEnvironment: boolean | undefined;+beforeEach(() => {+ originalActEnvironment = reactActEnvironment.IS_REACT_ACT_ENVIRONMENT;+ reactActEnvironment.IS_REACT_ACT_ENVIRONMENT = true;+ state.sessions = [];+ container = document.createElement('div');+ document.body.append(container);+ root = createRoot(container);+});+afterEach(() => {+ act(() => root.unmount());+ container.remove(); state.listeners.clear();+ reactActEnvironment.IS_REACT_ACT_ENVIRONMENT = originalActEnvironment;+});++describe('mobile Cindy Make links', () => {+ it.each(['cindy-make', 'cindy-make-merge'])('redirects %s to Home before mounting the task screen', (source) => {+ state.sessions = [{ id: 'old-task', source }];+ const Content = vi.fn(() => createElement('span', {}, 'Composer'));+ act(() => root.render(<CindyMakeSessionGate sessionId="old-task"><Content /></CindyMakeSessionGate>));+ expect(container.textContent).toBe('redirect:/');+ expect(Content).not.toHaveBeenCalled();+ });++ it('redirects when a cold link receives Make metadata and keeps ordinary tasks visible', () => {+ act(() => root.render(<CindyMakeSessionGate sessionId="old-task"><span>Composer</span></CindyMakeSessionGate>));+ expect(container.textContent).toBe('Composer');+ act(() => {+ state.sessions = [{ id: 'old-task', source: 'cindy-make' }];+ for (const listener of state.listeners) listener();+ });+ expect(container.textContent).toBe('redirect:/');+ act(() => {+ state.sessions = [{ id: 'old-task', source: 'desktop' }];+ for (const listener of state.listeners) listener();+ });+ expect(container.textContent).toBe('Composer');+ });+});diff --git a/apps/mobile/src/__tests__/conversationSearch.test.ts b/apps/mobile/src/__tests__/conversationSearch.test.tsindex ab7c62513b..f540860d4f 100644--- a/apps/mobile/src/__tests__/conversationSearch.test.ts+++ b/apps/mobile/src/__tests__/conversationSearch.test.ts@@ -77,6 +77,15 @@ const studio: ConversationSearchDeviceOrigin = {};describe('searchConversationsAcrossDevices', () => {+ it('excludes Make hits returned by an older desktop before the result limit', async () => {+ const indexed = indexedPage(['make', 'merge', 'ordinary']);+ indexed.results[0].session.source = 'cindy-make';+ indexed.results[1].session.source = 'cindy-make-merge';+ const page = await searchConversationsAcrossDevices([studio], { query: 'needle', limit: 1 }, {+ invoke: vi.fn(async () => indexed) as ConversationSearchInvoke, getCachedSessions: () => [],+ });+ expect(page.results.map(item => item.session.id)).toEqual(['ordinary']);+ });it('stamps indexed hits and keeps one device failure from wiping the rest', async () => {const invoke = vi.fn(async (deviceId: string, channel: string) => {if (channel !== 'local-db:conversations:search') throw new Error(`unexpected ${channel}`);@@ -208,6 +217,14 @@ describe('searchConversationsAcrossDevices', () => {});describe('searchCachedDeviceSessions', () => {+ it('excludes Make titles and previews from the cache', () => {+ const page = searchCachedDeviceSessions(studio, { query: 'needle', limit: 1 }, [+ session({ id: 'make', title: 'needle', source: 'cindy-make' }),+ session({ id: 'merge', title: 'Other', preview: 'needle', source: 'cindy-make-merge' }),+ session({ id: 'ordinary', title: 'Needle notes', source: 'desktop' }),+ ]);+ expect(page.results.map(item => item.session.id)).toEqual(['ordinary']);+ });it('matches the current device only', () => {const page = searchCachedDeviceSessions(studio,diff --git a/apps/mobile/src/__tests__/inactiveSessionListSubscriptions.test.ts b/apps/mobile/src/__tests__/inactiveSessionListSubscriptions.test.tsindex 41582ec3e7..12e8b2cc94 100644--- a/apps/mobile/src/__tests__/inactiveSessionListSubscriptions.test.ts+++ b/apps/mobile/src/__tests__/inactiveSessionListSubscriptions.test.ts@@ -23,7 +23,7 @@ describe('inactive session list subscriptions', () => {'gate ? gate.subscribe(subscribe, notify) : subscribe(notify)',);expect(store).toContain(- "usePausableRemoteSessionStoreSnapshot('sessions', remoteSessionStore.getSessions)",+ "usePausableRemoteSessionStoreSnapshot('sessions', remoteSessionStore.getVisibleSessions)",);const previewHook = store.slice(store.indexOf('export function useRemoteSessionMessagePreview'),diff --git a/apps/mobile/src/__tests__/remoteSessionStore.test.ts b/apps/mobile/src/__tests__/remoteSessionStore.test.tsindex 7af8f876ad..245848c5c4 100644--- a/apps/mobile/src/__tests__/remoteSessionStore.test.ts+++ b/apps/mobile/src/__tests__/remoteSessionStore.test.ts@@ -136,6 +136,26 @@ function pending(kind: string, requestId?: string, persistId?: string): PendingIdescribe('remoteSessionStore', () => {beforeEach(() => remoteSessionStore.clear());+ it('keeps Make mirrors for transport while excluding them from visible session snapshots', () => {+ remoteSessionStore.setDeviceSessions('dev-1', 'Mac', [+ session('make', { source: 'cindy-make' }),+ session('merge', { source: 'cindy-make-merge' }),+ session('ordinary', { source: 'desktop' }),+ ]);+ expect(remoteSessionStore.getSessions()).toHaveLength(3);+ expect(remoteSessionStore.getSessionDeviceId('make')).toBe('dev-1');+ const visible = remoteSessionStore.getVisibleSessions();+ expect(visible.map(item => item.id)).toEqual(['ordinary']);+ remoteSessionStore.applySessionPatch('dev-1', 'make', { totalCostUsd: 1 });+ expect(remoteSessionStore.getVisibleSessions()).toBe(visible);+ remoteSessionStore.applySessionPatch('dev-1', 'ordinary', { totalCostUsd: 2 });+ expect(remoteSessionStore.getVisibleSessions()[0].totalCostUsd).toBe(2);+ remoteSessionStore.applySessionPatch('dev-1', 'ordinary', { source: 'cindy-make-merge' });+ expect(remoteSessionStore.getVisibleSessions()).toEqual([]);+ remoteSessionStore.clear();+ expect(remoteSessionStore.getVisibleSessions()).toEqual([]);+ });+it('releases a large persisted tool input when the matching result is appended', () => {remoteSessionStore.setMessages('s1', [{...message('tool-use', 's1'),diff --git a/apps/mobile/src/session/CindyMakeSessionGate.tsx b/apps/mobile/src/session/CindyMakeSessionGate.tsxnew file mode 100644index 0000000000..1a0ba559b6--- /dev/null+++ b/apps/mobile/src/session/CindyMakeSessionGate.tsx@@ -0,0 +1,14 @@+import { useSyncExternalStore, type ReactNode } from 'react';+import { Redirect } from 'expo-router';+import { CINDY_MAKE_ENABLED, isCindyMakeSource } from '@cindy/maker-shared/cindy-make-feature';+import { remoteSessionStore } from './remoteSessionStore';++/** Use the raw mirror to recognize hidden tasks opened by an old link. */+export function CindyMakeSessionGate({ sessionId, children }: { sessionId: string; children: ReactNode }) {+ const hidden = useSyncExternalStore(remoteSessionStore.subscribe, () =>+ !CINDY_MAKE_ENABLED && isCindyMakeSource(+ remoteSessionStore.getSessions().find(session => session.id === sessionId)?.source,+ ),+ );+ return hidden ? <Redirect href="/" /> : children;+}diff --git a/apps/mobile/src/session/conversationSearch.ts b/apps/mobile/src/session/conversationSearch.tsindex aaef4b2b51..3fbc5c29e9 100644--- a/apps/mobile/src/session/conversationSearch.ts+++ b/apps/mobile/src/session/conversationSearch.ts@@ -27,6 +27,7 @@ import {} from '@cindy/maker-shared/session-list';import type { DeviceAccessState } from '@cindy/maker-shared/device-list';import { collapseWorktreeDirForGrouping } from '@cindy/maker-shared/worktree-paths';+import { CINDY_MAKE_ENABLED, isCindyMakeSource } from '@cindy/maker-shared/cindy-make-feature';import { mobilePresentationLocalizer } from '@/i18n/presentationLocalizer';import { createMobileMakerTransport } from '@/device-link/mobileMakerTransport';import { deviceMirrorCleanupDisposition } from '@/device-link/presenceDevices';@@ -181,7 +182,7 @@ export function searchCachedDeviceSessions(const hits: ConversationSearchResultItem[] = [];sessions.forEach((session, index) => {- if (session.orcaRole === 'worker') return;+ if ((!CINDY_MAKE_ENABLED && isCindyMakeSource(session.source)) || session.orcaRole === 'worker') return;if (!sessionBelongsToDevice(session, origin.deviceId)) return;const match = cachedConversationSearchMatch(session, query, request.unnamedLabel);if (!match) return;diff --git a/apps/mobile/src/session/remoteSessionStore.ts b/apps/mobile/src/session/remoteSessionStore.tsindex 09ce049489..d76208665a 100644--- a/apps/mobile/src/session/remoteSessionStore.ts+++ b/apps/mobile/src/session/remoteSessionStore.ts@@ -40,6 +40,7 @@ import {isTurnContinuationBoundaryEvent,} from '@cindy/maker-shared/turn-continuation';import { isDefaultDraftSessionTitle } from '@cindy/maker-shared/session-title';+import { CINDY_MAKE_ENABLED, isCindyMakeSource } from '@cindy/maker-shared/cindy-make-feature';import { EMPTY_INPUT_PROJECTION, normalizeInputProjection } from '@/session/inputProjection';import { sortPendingInteractions } from '@/session/interactionModel';import { applySessionModelPrefPush } from '@/session/sessionModelMirror';@@ -1347,6 +1348,8 @@ function applyMessageWriteRetention(sessionId: string): void {}let mergedSessions: RemoteSession[] = [];+/** Raw mirrors stay available to transport/reconciliation; UI hooks consume this filtered view. */+let visibleSessions: RemoteSession[] = [];// Retention and live-row anchoring run for every message write. Looking up each// cached window in the full list makes bulk hydration approach cubic work.const mergedSessionById = new Map<string, RemoteSession>();@@ -1645,6 +1648,7 @@ function recomputeSessions(): void {// useSyncExternalStore 快照经 Object.is 即可短路,消费屏对无关 emit 零重渲染。const sessionsChanged = !sameElementRefs(mergedSessions, next);if (sessionsChanged) mergedSessions = next;+ reconcileVisibleSessions();mergedSessionById.clear();for (const session of mergedSessions) mergedSessionById.set(session.id, session);// Usage-only patches bypass this projection and cannot change Home fields.@@ -1689,6 +1693,13 @@ function sameElementRefs<T>(a: readonly T[], b: readonly T[]): boolean {return true;}+function reconcileVisibleSessions(): void {+ const next = CINDY_MAKE_ENABLED+ ? mergedSessions+ : mergedSessions.filter((session) => !isCindyMakeSource(session.source));+ if (!sameElementRefs(visibleSessions, next)) visibleSessions = next;+}+function stamp(session: RemoteSession, deviceId: string, deviceName: string): RemoteSession {return { ...session, deviceLinkDeviceId: deviceId, deviceLinkDeviceName: deviceName };}@@ -3527,6 +3538,7 @@ export const remoteSessionStore = {mergedSessionById.set(sessionId, updated);return updated;});+ reconcileVisibleSessions();}emit();return;@@ -5321,6 +5333,7 @@ export const remoteSessionStore = {sessionListRefreshSeen.clear();pendingTitlePreview.clear();mergedSessions = [];+ visibleSessions = [];mergedSessionById.clear();homeSessionProjectionCache.clear();if (homeSessions.length > 0) {@@ -5369,6 +5382,10 @@ export const remoteSessionStore = {return mergedSessions;},+ getVisibleSessions(): RemoteSession[] {+ return visibleSessions;+ },+getHomeSessions(): RemoteSession[] {return homeSessions;},@@ -6007,7 +6024,7 @@ function usePausableRemoteSessionStoreSnapshot<T>(}export function useRemoteSessions(): RemoteSession[] {- return usePausableRemoteSessionStoreSnapshot('sessions', remoteSessionStore.getSessions);+ return usePausableRemoteSessionStoreSnapshot('sessions', remoteSessionStore.getVisibleSessions);}/** Home rows/actions do not consume usage; session details must use useRemoteSessions. */diff --git a/docs/cindy-make-upstream.md b/docs/cindy-make-upstream.mdindex 5646d2e61c..145cbdafaf 100644--- a/docs/cindy-make-upstream.md+++ b/docs/cindy-make-upstream.md@@ -1,5 +1,16 @@# Cindy Make 上游 PR 查询+## 当前可用性(2026-10-12)++按用户裁决,Cindy Make 对所有用户关闭:桌面与手机不展示标签、设置、创建入口、+制作任务或相关搜索结果;旧链接不能打开制作界面,已有制作与上游合并任务不能继续执行。+主进程同时拒绝源码准备、生成、测试、版本切换和相关命令。已有源码、任务历史与个人版文件保留。++共享开关见 [cindyMakeFeature](../packages/maker-shared/src/cindyMakeFeature.ts),+执行边界见 [featureGate](../apps/desktop/src/main/cindy-make/featureGate.ts) 与+[回归测试](../apps/desktop/src/main/maker-ipc/__tests__/cindyMakeFeatureGate.test.ts)。+下文记录保留实现的行为,当前不作为开放入口的依据。+查询目标是与用户需求相关、但当前运行的 Cindy 尚未确认包含的 PR,不是全部 Issue,也不是仅查询未合并或未发布内容。关键词命中只表示可能相关,不保证满足需求。diff --git a/packages/maker-shared/package.json b/packages/maker-shared/package.jsonindex 488f8486c4..32ec822f74 100644--- a/packages/maker-shared/package.json+++ b/packages/maker-shared/package.json@@ -17,6 +17,7 @@"./chat-quotes": "./src/chatQuotes.ts","./command-display": "./src/commandDisplay.ts","./client-endpoints": "./src/clientEndpoints.ts",+ "./cindy-make-feature": "./src/cindyMakeFeature.ts","./companion-import": "./src/companionImport.ts","./composer-palette": "./src/composerPalette.ts","./conversation-search": "./src/conversationSearch.ts",diff --git a/packages/maker-shared/src/__tests__/conversationSearch.test.ts b/packages/maker-shared/src/__tests__/conversationSearch.test.tsindex 036aaeefb2..3a7c082163 100644--- a/packages/maker-shared/src/__tests__/conversationSearch.test.ts+++ b/packages/maker-shared/src/__tests__/conversationSearch.test.ts@@ -51,6 +51,16 @@ function response(results: ConversationSearchResultItem[]): ConversationSearchRe}describe('merge and stamp', () => {+ it('excludes hidden Make sources before limiting indexed or reused remote hits', () => {+ const page = response([+ result('make', 100, { source: 'cindy-make', deviceLinkDeviceId: 'dev-a' }),+ result('merge', 99, { source: 'cindy-make-merge', deviceLinkDeviceId: 'dev-a' }),+ result('ordinary', 1, { source: 'desktop', deviceLinkDeviceId: 'dev-a' }),+ ]);+ expect(mergeConversationSearchFanout([page], 1).results.map(item => item.session.id)).toEqual(['ordinary']);+ expect(remoteResultsFromFanoutPages([page]).map(item => item.session.id)).toEqual(['ordinary']);+ expect(filterResultsByRequestFilters(page, {}).results.map(item => item.session.id)).toEqual(['ordinary']);+ });it('keeps same-id hits from different devices and stamps origin', () => {const remote = stampRemoteSearchResponse(response([result('same', 10)]), {deviceId: 'dev-a',diff --git a/packages/maker-shared/src/__tests__/mobileHome.test.ts b/packages/maker-shared/src/__tests__/mobileHome.test.tsindex 15828a5d99..fa3b846d93 100644--- a/packages/maker-shared/src/__tests__/mobileHome.test.ts+++ b/packages/maker-shared/src/__tests__/mobileHome.test.ts@@ -26,7 +26,7 @@ function session(id: string, patch: Partial<MobileHomeSessionLike> = {}): Mobile}describe('mobileHome', () => {- it('groups Cindy Make creation and merge tasks by source without changing their working directories', () => {+ it('hides Cindy Make creation and merge tasks from the home presentation', () => {const sessions = [session('make-a', { source: 'cindy-make', workingDir: 'C:\\Cindy\\tasks\\random-a' }),session('make-b', { source: 'cindy-make', workingDir: '/data/cindy/tasks/random-b' }),@@ -40,43 +40,29 @@ describe('mobileHome', () => {});expect(home.chats).toEqual([]);- expect(home.projects).toHaveLength(2);- const make = home.projects.find((project) => project.kind === 'cindy-make');- expect(make).toMatchObject({- key: 'cindy-make:pc',- title: 'Cindy Make',- subtitle: 'My PC',- workingDir: '',- sessionCount: 4,- pendingInteractionCount: 3,- });- expect(make?.sessions.map((item) => item.session.id).sort()).toEqual(['make-a', 'make-b', 'merge', 'no-dir']);- for (const item of make?.sessions ?? []) {- expect(item.session.workingDir).toBe(sessions.find((original) => original.id === item.session.id)?.workingDir);- }- expect(home.projects.find((project) => !project.kind)?.sessions.map((item) => item.session.id)).toEqual(['ordinary']);+ expect(home.projects).toHaveLength(1);+ expect(home.projects[0]?.sessions.map((item) => item.session.id)).toEqual(['ordinary']);});- it('keeps Cindy Make folders scoped to the selected computer and stable across task directory changes', () => {+ it('hides Cindy Make projects regardless of device selection or task directory', () => {const sessions = ['pc-a', 'pc-b'].map((deviceLinkDeviceId) => session(deviceLinkDeviceId, {deviceLinkDeviceId,source: 'cindy-make',}));const devices = sessions.map((item) => ({ deviceId: item.id, name: item.id }));const home = buildMobileHomePresentation({ devices, sessions });- expect(home.projects.map((project) => project.key).sort()).toEqual(['cindy-make:pc-a', 'cindy-make:pc-b']);+ expect(home.projects).toEqual([]);const selected = buildMobileHomePresentation({ devices, sessions, selectedDeviceId: 'pc-a' });- expect(selected.projects).toHaveLength(1);- expect(selected.projects[0].sessions.map((item) => item.session.id)).toEqual(['pc-a']);+ expect(selected.projects).toEqual([]);const moved = buildMobileHomePresentation({devices,sessions: [{ ...sessions[0], workingDir: '/another/checkout' }],});- expect(moved.projects[0].key).toBe(selected.projects[0].key);+ expect(moved.projects).toEqual([]);});- it('preserves pinning, archive filters and search when grouping Cindy Make tasks', () => {+ it('hides Cindy Make tasks from pinned, archived and search views', () => {const sessions = [session('pinned', { source: 'cindy-make', pinnedAt: '2026-01-01T00:00:00.000Z' }),session('active', { source: 'cindy-make' }),@@ -84,13 +70,13 @@ describe('mobileHome', () => {session('deleted', { source: 'cindy-make', status: 'deleted' }),];const home = buildMobileHomePresentation({ sessions });- expect(home.pinned.map((item) => item.session.id)).toEqual(['pinned']);- expect(home.projects[0].sessions.map((item) => item.session.id)).toEqual(['active']);+ expect(home.pinned).toEqual([]);+ expect(home.projects).toEqual([]);const archived = buildMobileHomePresentation({ sessions, statusFilter: 'archived' });expect(archived.pinned).toEqual([]);- expect(archived.projects[0].sessions.map((item) => item.session.id)).toEqual(['archived']);+ expect(archived.projects).toEqual([]);const searched = buildMobileHomePresentation({ sessions, searchQuery: 'active' });- expect(searched.projects[0].sessions.map((item) => item.session.id)).toEqual(['active']);+ expect(searched.projects).toEqual([]);expect(buildMobileHomePresentation({ sessions, searchQuery: 'absent' }).projects).toEqual([]);});diff --git a/packages/maker-shared/src/cindyMakeFeature.ts b/packages/maker-shared/src/cindyMakeFeature.tsnew file mode 100644index 0000000000..19f648a156--- /dev/null+++ b/packages/maker-shared/src/cindyMakeFeature.ts@@ -0,0 +1,13 @@+/**+ * Product gate for Cindy Make.+ *+ * Cindy Make remains on disk so existing source checkouts, history and personal+ * builds are not removed, but the product surface is currently unavailable to+ * users. Keep this value shared by desktop and mobile so a build cannot expose+ * one client while hiding the other.+ */+export const CINDY_MAKE_ENABLED = false;++export function isCindyMakeSource(source: string | null | undefined): boolean {+ return source === 'cindy-make' || source === 'cindy-make-merge';+}diff --git a/packages/maker-shared/src/conversationSearch.ts b/packages/maker-shared/src/conversationSearch.tsindex c1125dfcf0..c829bbe591 100644--- a/packages/maker-shared/src/conversationSearch.ts+++ b/packages/maker-shared/src/conversationSearch.ts@@ -1,5 +1,6 @@import { projectDraftSessionTitle } from './sessionTitle.js';import { collapseWorktreeDirForGrouping } from './worktreePaths.js';+import { CINDY_MAKE_ENABLED, isCindyMakeSource } from './cindyMakeFeature.js';/*** 任务搜索的跨端契约与纯合并函数。@@ -155,6 +156,7 @@ export function remoteResultsFromFanoutPages(const byKey = new Map<string, ConversationSearchResultItem>();for (const page of pages) {for (const item of page.results) {+ if (!CINDY_MAKE_ENABLED && isCindyMakeSource(item.session.source)) continue;if (!item.session.deviceLinkDeviceId) continue;const key = conversationSearchResultKey(item);const existing = byKey.get(key);@@ -174,6 +176,7 @@ export function mergeConversationSearchFanout(const byKey = new Map<string, ConversationSearchResultItem>();for (const page of pages) {for (const item of page.results) {+ if (!CINDY_MAKE_ENABLED && isCindyMakeSource(item.session.source)) continue;const key = conversationSearchResultKey(item);const existing = byKey.get(key);if (!existing || item.rankScore > existing.rankScore) {@@ -224,6 +227,7 @@ export function filterResultsByRequestFilters(return {...response,results: response.results.filter((item) => {+ if (!CINDY_MAKE_ENABLED && isCindyMakeSource(item.session.source)) return false;if (!matchesWorkingDirSet(item.session.workingDir, allowedDirs)) return false;if (item.session.orcaRole === 'worker') return false;if (!matchesStatus(item.session.status, status)) return false;diff --git a/packages/maker-shared/src/index.ts b/packages/maker-shared/src/index.tsindex 101e496b68..a8e71bbf61 100644--- a/packages/maker-shared/src/index.ts+++ b/packages/maker-shared/src/index.ts@@ -5,6 +5,7 @@ export * from './branding.js';export * from './brandIdentity.js';export * from './commandIntent.js';export * from './commandDisplay.js';+export * from './cindyMakeFeature.js';export * from './composerPalette.js';export * from './deviceList.js';export * from './fileBrowser.js';diff --git a/packages/maker-shared/src/mobileHome.ts b/packages/maker-shared/src/mobileHome.tsindex 4d3461c18b..6973cc6c71 100644--- a/packages/maker-shared/src/mobileHome.ts+++ b/packages/maker-shared/src/mobileHome.ts@@ -14,6 +14,7 @@ import type { PresentationLocalizer } from './presentationLocalization.js';import { stripTrailingPathSeparators } from './pathText.js';import { normalizeProjectOrderPath } from './projectOrderSync.js';import { collapseWorktreeDirForGrouping } from './worktreePaths.js';+import { CINDY_MAKE_ENABLED, isCindyMakeSource } from './cindyMakeFeature.js';export const MOBILE_HOME_ALL_DEVICES = 'all';@@ -149,15 +150,18 @@ export function buildMobileHomePresentation({unnamedLabel,localizer,}: MobileHomeOptions): MobileHomePresentation {+ const visibleSessions = CINDY_MAKE_ENABLED+ ? sessions+ : sessions.filter((session) => !isCindyMakeSource(session.source));// 设备身份归一化在管线源头对每个会话算出 canonicalDeviceId(写入字段,不改 deviceLinkDeviceId):// 后续设备筛选统计、matchesSelectedDevice 过滤、项目分组、概览、卡片 deviceId 全部按 canonicalDeviceId// 判断,保证「首页卡片 / 设备筛选 / 跳转参数」的设备维度一致;deviceLinkDeviceId 保持物理路由 key,// openSession / applySessionPatch 仍按它路由,不受归并影响。const deviceIdentity = buildDeviceIdentity(devices,- sessions.map((session) => ({ deviceId: session.deviceLinkDeviceId, name: session.deviceLinkDeviceName })),+ visibleSessions.map((session) => ({ deviceId: session.deviceLinkDeviceId, name: session.deviceLinkDeviceName })),);- const normalizedSessions = sessions.map((session) => canonicalizeSessionDevice(session, deviceIdentity));+ const normalizedSessions = visibleSessions.map((session) => canonicalizeSessionDevice(session, deviceIdentity));const deviceFilters = buildDeviceFilters(devices, normalizedSessions, pendingInteractionIndex, selectedDeviceId);const normalizedSelectedDeviceId = normalizeSelectedDeviceId(deviceFilters, selectedDeviceId);const query = normalizeSearchQuery(searchQuery);