Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

feat(mobile): 手机端完整支持协同模式 (#5143)

Dashb82dd0a865a7
diff --git a/apps/desktop/src/renderer/features/cc-agent/CreateWorkerPopover.tsx b/apps/desktop/src/renderer/features/cc-agent/CreateWorkerPopover.tsx
index 2e748380df..659a84e065 100644
--- a/apps/desktop/src/renderer/features/cc-agent/CreateWorkerPopover.tsx
+++ b/apps/desktop/src/renderer/features/cc-agent/CreateWorkerPopover.tsx
@@ -48,9 +48,9 @@ import {
ORCA_WORKER_PERMISSION_MODES,
type OrcaWorkerPermissionMode,
} from '../../../shared/orca-worker-permission-mode';
+import { ORCA_PREDEFINED_WORKER_ROLES as PREDEFINED_ROLES } from '@cindy/maker-shared/orca-team';
import { selectWorkerModels } from './workerModelAvailability';
-const PREDEFINED_ROLES = ['developer', 'designer', 'reviewer', 'tester', 'merger'] as const;
const AUTO_ONLY_WORKER_PERMISSION_MODES = ['auto'] as const;
export interface CreateWorkerForm {
diff --git a/apps/desktop/src/renderer/features/cc-agent/draftWorkerHandoff.ts b/apps/desktop/src/renderer/features/cc-agent/draftWorkerHandoff.ts
index 14f7d5f3bf..e9c1f80fd7 100644
--- a/apps/desktop/src/renderer/features/cc-agent/draftWorkerHandoff.ts
+++ b/apps/desktop/src/renderer/features/cc-agent/draftWorkerHandoff.ts
@@ -1,25 +1 @@
-/**
- * New-task flows create the Worker before the Lead's first input is sent. Older controlled
- * devices cannot defer assignment until that input is queryable, so preserve the pending text
- * inline for that mixed-version path. New peers use the Worker-scoped Lead history bridge.
- *
- * pendingLeadInput is context only: without an explicit Worker task it cannot start new work.
- */
-export function buildDraftWorkerInitialTask(
- initialTask: string | undefined,
- pendingLeadInput: string | undefined,
-): string | undefined {
- const task = initialTask?.trim();
- if (!task) return undefined;
-
- const pending = pendingLeadInput?.trim();
- if (!pending) return task;
-
- return [
- task,
- '',
- 'Pending Lead input:',
- 'The Lead has not sent this input yet, so it is not available in Lead session history. Use it only as context for the Worker task above; do not treat it as a replacement task.',
- pending,
- ].join('\n');
-}
+export { buildDraftWorkerInitialTask } from '@cindy/maker-shared/orca-team';
diff --git a/apps/desktop/src/renderer/features/cc-agent/workerLabel.ts b/apps/desktop/src/renderer/features/cc-agent/workerLabel.ts
index daebb8ec11..b44f71c19a 100644
--- a/apps/desktop/src/renderer/features/cc-agent/workerLabel.ts
+++ b/apps/desktop/src/renderer/features/cc-agent/workerLabel.ts
@@ -1,22 +1 @@
-export function createWorkerLabel(role: string, existingLabels: readonly string[]): string {
- const base = role
- .trim()
- .toLowerCase()
- .replace(/[^a-z0-9_-]+/g, '-')
- .replace(/^-+|-+$/g, '')
- .slice(0, 24) || 'worker';
- const existing = new Set(existingLabels.map((label) => label.toLowerCase()));
- if (!existing.has(base)) return base;
-
- for (let index = 2; index < 1000; index += 1) {
- const suffix = `-${index}`;
- const candidate = `${base.slice(0, 32 - suffix.length)}${suffix}`;
- if (!existing.has(candidate)) return candidate;
- }
-
- return `${base.slice(0, 27)}-${Date.now().toString(36).slice(-4)}`;
-}
-
-export function shouldShowWorkerLabel(role: string, label: string | null | undefined): label is string {
- return typeof label === 'string' && label.length > 0 && label !== role;
-}
+export { createWorkerLabel, shouldShowWorkerLabel } from '@cindy/maker-shared/orca-team';
diff --git a/apps/desktop/src/renderer/state/workerCreationPrefs.ts b/apps/desktop/src/renderer/state/workerCreationPrefs.ts
index cf25ca19ca..5cf6d43be4 100644
--- a/apps/desktop/src/renderer/state/workerCreationPrefs.ts
+++ b/apps/desktop/src/renderer/state/workerCreationPrefs.ts
@@ -1,4 +1,9 @@
import type { Effort } from '@/lib/userPreferences.types';
+import {
+ DEFAULT_ORCA_WORKER_AGENT,
+ DEFAULT_ORCA_WORKER_EFFORT,
+ DEFAULT_ORCA_WORKER_MODELS,
+} from '@cindy/maker-shared/orca-team';
import {
DEFAULT_ORCA_WORKER_PERMISSION_MODE,
@@ -28,12 +33,12 @@ export interface WorkerCreationPrefs {
workerPermissionMode: OrcaWorkerPermissionMode;
}
+// 首次默认值与手机端共用(@cindy/maker-shared/orca-team),两端「创建 Worker」同一套规则。
export const DEFAULT_WORKER_CREATION_PREFS: WorkerCreationPrefs = {
- lastAgent: 'codex',
- codex: { model: 'codex/gpt-5.5', effort: 'high', fast: false, providerId: null },
- 'claude-code': { model: 'claude-opus-4-7', effort: 'high', fast: false, providerId: null },
- // pi worker 默认模型与 orcaWorkerCreationService.resolveWorkerConfig 的 pi 分支一致。
- pi: { model: 'claude-sonnet-4-6', effort: 'high', fast: false, providerId: null },
+ lastAgent: DEFAULT_ORCA_WORKER_AGENT,
+ codex: { model: DEFAULT_ORCA_WORKER_MODELS.codex, effort: DEFAULT_ORCA_WORKER_EFFORT as Effort, fast: false, providerId: null },
+ 'claude-code': { model: DEFAULT_ORCA_WORKER_MODELS['claude-code'], effort: DEFAULT_ORCA_WORKER_EFFORT as Effort, fast: false, providerId: null },
+ pi: { model: DEFAULT_ORCA_WORKER_MODELS.pi, effort: DEFAULT_ORCA_WORKER_EFFORT as Effort, fast: false, providerId: null },
workerPermissionMode: DEFAULT_ORCA_WORKER_PERMISSION_MODE,
};
diff --git a/apps/mobile/app/sessions/[sessionId].tsx b/apps/mobile/app/sessions/[sessionId].tsx
index 3e6434be92..ca6d6354a3 100644
--- a/apps/mobile/app/sessions/[sessionId].tsx
+++ b/apps/mobile/app/sessions/[sessionId].tsx
@@ -56,6 +56,7 @@ import {
Square,
Sparkles,
Target,
+ UsersRound,
Zap,
X,
} from 'lucide-react-native';
@@ -235,7 +236,7 @@ import type { MobileModelConfiguration } from '@/session/unifiedMobileModels';
import { resolveAgentCapability } from '@cindy/model-providers';
import { ModelPickerSheet } from '@/session/ModelPickerSheet';
import { MobileModelIconMark } from '@/session/MobileProviderMark';
-import { getModel } from '@cindy/model-providers/registry';
+import { getModel, type ProviderView } from '@cindy/model-providers/registry';
import { shouldBlockLegacyRemoteModelWindowSwitch } from '@cindy/maker-shared/agent-capabilities';
import { clearSessionMirror, makeSessionMirrorAccessors } from '@/session/sessionModelMirror';
import { effortLabelFromRuntime, rowFastEditable } from '@/session/modelPickerRows';
@@ -252,10 +253,13 @@ import {
} from '@/session/attachments';
import {
ContextSheet,
-
+ ContextSheetFooterButton,
ContextSheetGroup,
ContextSheetRow,
} from '@/session/ContextSheet';
+import { OrcaTeamPanelView, OrcaWorkerFormView } from '@/session/ContextSheetCollabView';
+import { useSessionOrcaCollab } from '@/session/useSessionOrcaCollab';
+import { orcaWorkerProvidersForLead, subscribeOrcaStartFailure, takeOrcaStartFailure } from '@/session/orcaTeam';
import { RecentPhotosStrip } from '@/session/ContextSheetMediaViews';
import { ContextSheetGoalView, goalStatusLabel } from '@/session/ContextSheetGoalView';
import { parseGoalLimitsRouteParam } from '@/session/goalLimitsRouteParam';
@@ -285,11 +289,7 @@ import {
resolveContextSheetMediaAssetForUpload,
type ContextSheetMediaAsset,
} from '@/session/useContextSheetMediaAssets';
-import {
- sessionCollaborationComposerReadOnlyReason,
- sessionCollaborationLabel,
- sessionCollaborationReadOnlyReason,
-} from '@/session/collaboration';
+import { sessionCollaborationLabel } from '@/session/collaboration';
import {
agentKindForSession,
detectComposerTrigger,
@@ -1233,7 +1233,7 @@ export default function SessionScreen() {
}, [mode, shareCharacterSrc, shareLogoSrc, shareSelectionActive]);
// Context 面板(+ 号弹出的可拖动 sheet):open + 面板内子视图(主视图 / 截图列表 / 目标模式)。
const [contextSheetOpen, setContextSheetOpen] = useState(false);
- const [contextSheetView, setContextSheetView] = useState<'main' | 'goal'>('main');
+ const [contextSheetView, setContextSheetView] = useState<'main' | 'goal' | 'collab' | 'collab-create'>('main');
const contextSheetMediaLibraryEnabled = canBrowsePhotoLibraryDirectly(Platform.OS);
// 模型 + 权限浮窗(ContextSheet 同款 Modal,含二级「模型选项 / 权限」叠层)。
const [modelSheetOpen, setModelSheetOpen] = useState(false);
@@ -2024,7 +2024,59 @@ export default function SessionScreen() {
JSON.stringify([auth.accountGeneration, deviceId, sessionId]),
currentSession,
);
- const composerDeviceProviders = useDeviceProviders(deviceId || undefined, modelSheetOpen);
+ // 协同(Orca):+ 面板「协同模式」二级视图 + Lead / Worker 导航。团队真身在被控端。
+ const openCollabSession = useCallback((targetSessionId: string) => {
+ if (!deviceId || !targetSessionId || targetSessionId === sessionId) return;
+ router.push({
+ pathname: '/sessions/[sessionId]',
+ params: { sessionId: targetSessionId, deviceId, deviceName },
+ });
+ }, [deviceId, deviceName, router, sessionId]);
+ // 来源目录在协同 hook 之后才取得(它依赖 Worker 选择器是否打开),经 ref 在提交时读。
+ const collabProvidersRef = useRef<readonly ProviderView[] | null>(null);
+ const collab = useSessionOrcaCollab({
+ maker,
+ deviceId: deviceId || null,
+ sessionId,
+ session: currentSession,
+ // 按区域限定的账号键:Global 与中国大陆版同号不同人,记忆(含完全访问)不能串。
+ prefsScope: outboxOwner.accountKey || null,
+ connectionEpoch,
+ getProviders: () => collabProvidersRef.current,
+ enabled: !isSharedTaskPeer(deviceId) && !sessionManagedByHost,
+ sheetView: contextSheetView === 'collab' || contextSheetView === 'collab-create' ? contextSheetView : null,
+ sheetOpen: contextSheetOpen,
+ setSheetView: setContextSheetView,
+ setSheetOpen: setContextSheetOpen,
+ openSession: openCollabSession,
+ });
+ const composerDeviceProviders = useDeviceProviders(
+ deviceId || undefined,
+ modelSheetOpen || collab.workerForm.modelPicker.open,
+ );
+ // SSH 远端 Lead 的 Worker 只能用远端可路由的来源(与桌面创建 Worker 面板同口径)。
+ const collabWorkerProviders = useMemo(
+ () => orcaWorkerProvidersForLead(composerDeviceProviders.providers, !!currentSession?.remoteHostId?.trim()),
+ [composerDeviceProviders.providers, currentSession?.remoteHostId],
+ );
+ collabProvidersRef.current = composerDeviceProviders.ready ? collabWorkerProviders : null;
+ // Worker 任务打开详情时刷新自身记录(焦点可能已在别处变化)。
+ const refreshWorkerSelf = collab.refreshWorkerSelf;
+ useEffect(() => {
+ if (settingsOpen && collab.isWorker) void refreshWorkerSelf();
+ }, [collab.isWorker, refreshWorkerSelf, settingsOpen]);
+ // 新建任务页在后台开启协同失败时任务照单任务继续,提示在这里(跳转后的会话页)出现。
+ useEffect(() => {
+ const show = () => {
+ const reason = takeOrcaStartFailure(sessionId);
+ if (reason) setError(t('session.collab.startFailedContinue', { reason }));
+ };
+ show();
+ return subscribeOrcaStartFailure((failedSessionId) => {
+ if (failedSessionId === sessionId) show();
+ });
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [sessionId]);
const accountProvider = composerDeviceProviders.ready
? composerDeviceProviders.providers.find((provider) => provider.id === currentSession?.providerId)
: undefined;
@@ -2280,16 +2332,6 @@ export default function SessionScreen() {
return () => clearTimeout(timer);
}, [appStateActive, connectionEpoch, deviceId, hasRenderedMessages, liveAttention, maker, readAckSyncedKey, sessionId]),
);
- // 写编排只读 reason(fork/rewind、队列编辑、会话设置写、pending interaction):对 lead + worker 都返回。
- const collaborationReadOnlyReason = useMemo(
- () => sessionCollaborationReadOnlyReason(currentSession),
- [currentSession?.orcaRole, i18nInstance.language],
- );
- // composer(发消息)只读 reason:仅非 lead 的协作角色只读;Lead 返回 null → 可在手机上发文字消息。
- const composerReadOnlyReason = useMemo(
- () => sessionCollaborationComposerReadOnlyReason(currentSession),
- [currentSession?.orcaRole, i18nInstance.language],
- );
const activePendingInteraction = useMemo(() => {
return selectPendingInteractionByRequestId(pending, pendingInteractionActiveRequestId);
}, [pending, pendingInteractionActiveRequestId]);
@@ -2368,10 +2410,8 @@ export default function SessionScreen() {
hasActivePendingInteraction,
pendingInteractionBlocksComposer: pendingInteractionBlocksComposer && !isSharedTaskPeer(deviceId),
remoteUnavailableReason: composerRemoteUnavailableReason,
- // composer 用 composer-only reason:Lead → editable(可发消息),worker → read-only。
- readOnlyReason: composerReadOnlyReason,
}),
- [composerReadOnlyReason, composerRemoteUnavailableReason, hasActivePendingInteraction, hasCurrentSession, pendingInteractionBlocksComposer, deviceId],
+ [composerRemoteUnavailableReason, hasActivePendingInteraction, hasCurrentSession, pendingInteractionBlocksComposer, deviceId],
);
useEffect(() => {
if (!pendingInteractionActiveRequestId) return;
@@ -2426,10 +2466,6 @@ export default function SessionScreen() {
const queueAvailabilityReason = cacheSeededReason
?? pendingCreationReason
?? (sessionOperationLayout.showQueue ? null : composerDisabledReason);
- const queueInlineReadOnlyReason = collaborationReadOnlyReason ?? queueAvailabilityReason;
- // 重试/清错属于输入恢复:Lead 能发消息,也应能恢复失败输入。
- // 队列编辑和恢复整组队列仍沿用协作编排只读规则。
- const errorRecoveryReadOnlyReason = composerReadOnlyReason ?? queueAvailabilityReason;
const companionInlineInteraction = companionChat && pending.length > 0 && !pendingInteractionFullHeight;
const showMessageHistory = companionInlineInteraction || sessionOperationLayout.messageHistoryMode === 'visible'
|| (sessionOperationLayout.messageHistoryMode === 'collapsed' && pendingHistoryExpanded);
@@ -4312,13 +4348,11 @@ export default function SessionScreen() {
// 尾部未忽略 error 行由 SessionTailBanner 独家承载,消息流里滤掉对应错误卡
// (对齐桌面 MessageStream 返回 null);dismissed / 有后续消息时判定不命中,回流照常。
// 本视图刚点过「忽略」的行同样回流(持久化 dismiss 落库前内存 content 未变,只滤
- // messages 会让 banner 和错误卡同时消失、错误信息无处可见,review P2)。协同只读
- // (worker)会话不渲染 banner,错误卡必须留在消息流(同一 review P2)。
+ // messages 会让 banner 和错误卡同时消失、错误信息无处可见,review P2)。
const errorTailClientId = useMemo(() => {
- if (collaborationReadOnlyReason) return null;
const id = findErrorTailClientId(latestMessagesRef.current);
return id && !dismissedTailErrorClientIds.has(id) ? id : null;
- }, [collaborationReadOnlyReason, dismissedTailErrorClientIds, messageStructureToken]);
+ }, [dismissedTailErrorClientIds, messageStructureToken]);
const projectedMessageWindowRef = useRef<{
projection: LoadedMessageWindowProjection;
sessionId: string;
@@ -5587,7 +5621,7 @@ export default function SessionScreen() {
originalIndex: index,
projection: inputProjection,
queueLength: inputProjection.pendingQueue.length,
- readOnlyReason: queueInlineReadOnlyReason,
+ readOnlyReason: queueAvailabilityReason,
});
presentationByClientId.set(item.clientId, {
actions: presentation.actions,
@@ -5614,7 +5648,7 @@ export default function SessionScreen() {
queueBusy,
queueEditing?.clientId,
queueHiddenClientIds,
- queueInlineReadOnlyReason,
+ queueAvailabilityReason,
sendingQueueBadgeClientIds,
settlingItemsForRender,
],
@@ -7098,7 +7132,7 @@ export default function SessionScreen() {
* 且旧条目编辑期间新增的附件先回收再覆写托盘(否则成为 OSS 孤儿,review P2)。
*/
const beginQueueEdit = (item: QueuedRemoteMessage) => {
- if (queueInlineReadOnlyReason || queueBusy) return;
+ if (queueAvailabilityReason || queueBusy) return;
// 上一条的保存(update-content)在途时不允许进入/切换编辑:切换路径会立即解锁
// 旧条目并回收其编辑期附件,与在途 RPC 竞争——桌面端可能用旧内容抢先派发,或
// OSS 引用在物化完成前被删(review P2)。编辑生命周期的全部入口/出口由此都被
@@ -7226,12 +7260,12 @@ export default function SessionScreen() {
}, [cancelQueueEdit, inputProjection.pendingQueue, queueEditing]);
const retryQueueError = () => {
- if (errorRecoveryReadOnlyReason || !inputProjection.errorRetryText) return;
+ if (queueAvailabilityReason || !inputProjection.errorRetryText) return;
void runQueueAction(() => maker.input.retryLastError(sessionId));
};
const clearQueueError = () => {
- if (errorRecoveryReadOnlyReason) return;
+ if (queueAvailabilityReason) return;
void runQueueAction(() => maker.input.clearError(sessionId));
};
@@ -8831,7 +8865,6 @@ export default function SessionScreen() {
pendingCount={pending.length}
queueCount={inputProjection?.pendingQueue.length ?? 0}
queuePaused={inputProjection?.queuePaused ?? false}
- readOnlyReason={composerReadOnlyReason}
remoteUnavailableReason={remoteUnavailableReason}
searchOpen={searchOpen}
title={isDeviceAccessRevoked
@@ -8941,6 +8974,11 @@ export default function SessionScreen() {
params: { sessionId, deviceId, deviceName },
});
}}
+ worker={collab.isWorker ? {
+ onOpenLead: collab.workerLeadSessionId ? collab.openLead : undefined,
+ onSetFocus: collab.workerSelf && !collab.workerSelf.focused ? () => void collab.setSelfFocus() : undefined,
+ onArchive: collab.workerSelf ? (onConfirmed) => collab.confirmArchiveSelf(onConfirmed) : undefined,
+ } : undefined}
onRegenerateTitle={() => maker.regenerateSessionTitle(sessionId)}
onRename={(title) => patchSessionMeta({ title })}
onRestore={() => patchSessionMeta({ status: 'active' })}
@@ -8953,7 +8991,6 @@ export default function SessionScreen() {
)}
onToggleExtraDirBrowser={toggleExtraDirBrowser}
onTogglePinned={() => patchSessionMeta({ pinnedAt: currentSession.pinnedAt ? null : new Date().toISOString() })}
- readOnlyReason={collaborationReadOnlyReason}
session={currentSession}
visible={settingsOpen}
/>
@@ -8993,10 +9030,35 @@ export default function SessionScreen() {
) : null}
error={contextSheetView === 'main' ? attachmentError : null}
keyboardAvoidingBehavior={nativeShellLayout.keyboardAvoidingBehavior}
- onBack={contextSheetView !== 'main' ? () => setContextSheetView('main') : undefined}
+ onBack={contextSheetView === 'collab-create'
+ ? () => setContextSheetView('collab')
+ : contextSheetView !== 'main' ? () => setContextSheetView('main') : undefined}
onClose={() => setContextSheetOpen(false)}
+ footer={contextSheetView === 'collab' && !collab.isLead ? (
+ <ContextSheetFooterButton
+ busy={collab.busy}
+ disabled={!collab.canSubmit || collab.entryBlocked}
+ label={t('session.collab.enableSubmit')}
+ onPress={() => void collab.submitEnable()}
+ testID="session.collabEnableButton"
+ />
+ ) : contextSheetView === 'collab-create' ? (
+ <ContextSheetFooterButton
+ busy={collab.busy}
+ disabled={!collab.canSubmit}
+ label={t('session.collab.createWorkerSubmit')}
+ onPress={() => void collab.submitCreate()}
+ testID="session.collabCreateWorkerButton"
+ />
+ ) : undefined}
testID="session.contextSheet"
- title={contextSheetView === 'goal' ? t('session.common.goalMode') : t('session.common.context')}
+ title={contextSheetView === 'goal'
+ ? t('session.common.goalMode')
+ : contextSheetView === 'collab'
+ ? (collab.isLead ? t('session.collab.title') : t('session.collab.enableTitle'))
+ : contextSheetView === 'collab-create'
+ ? t('session.collab.createWorkerTitle')
+ : t('session.common.context')}
visible={contextSheetOpen}
>
{contextSheetView === 'main' ? (
@@ -9062,8 +9124,51 @@ export default function SessionScreen() {
</>
) : 'chevron'}
/>
+ {collab.eligible ? (
+ <ContextSheetRow
+ accessibilityHint={collab.entryHint ?? undefined}
+ icon={<UsersRound color={colors.textPrimary} size={iconSize.lg} strokeWidth={iconStroke.regular} />}
+ label={t('session.collab.modeLabel')}
+ onPress={collab.openFromMain}
+ testID="session.contextSheetCollabRow"
+ trailing={collab.isLead ? (
+ <>
+ <Text style={{ color: colors.textTertiary, fontSize: typeScale.footnote, lineHeight: lineHeight.caption }}>
+ {t('session.collab.enabled')}
+ </Text>
+ <ChevronRight color={colors.textTertiary} size={iconSize.md} strokeWidth={iconStroke.regular} />
+ </>
+ ) : 'chevron'}
+ />
+ ) : null}
</ContextSheetGroup> : null}
</>
+ ) : contextSheetView === 'collab' && collab.isLead ? (
+ <OrcaTeamPanelView
+ busy={collab.busy}
+ error={collab.error ?? collab.team.error}
+ loading={collab.team.loading}
+ onCreateWorker={collab.openCreateWorker}
+ onEndTeam={collab.confirmEndTeam}
+ onWorkerLongPress={collab.showWorkerActions}
+ onWorkerPress={collab.openWorker}
+ settings={collab.team.settings}
+ workers={collab.team.workers}
+ />
+ ) : contextSheetView === 'collab' || contextSheetView === 'collab-create' ? (
+ <OrcaWorkerFormView
+ agents={collab.workerForm.agents}
+ busy={collab.busy}
+ customRoleMode={collab.workerForm.customRoleMode}
+ error={collab.error}
+ form={collab.workerForm.form}
+ notice={contextSheetView === 'collab' ? collab.entryHint : null}
+ onAgentChange={collab.workerForm.changeAgent}
+ onChange={collab.workerForm.patch}
+ onCustomRoleModeChange={collab.workerForm.setCustomRoleMode}
+ onPermissionChange={(mode) => void collab.workerForm.changePermission(mode)}
+ onPickModel={collab.workerForm.modelPicker.openPicker}
+ />
) : (
// goal 接回载荷按 sessionId 归属、渲染时同步过滤(codex review P1):
// key={sessionId} 重挂载发生在渲染新 sessionId 的瞬间,此时 goalRestore
@@ -9143,6 +9248,57 @@ export default function SessionScreen() {
visible={modelSheetOpen && canUseRemoteSessionControls}
/>
) : null}
+ {currentSession && collab.eligible ? (
+ // 协同 Worker 的模型选择:与会话模型浮窗同一套统一模型目录,但只回写 Worker 表单,
+ // 不触碰当前任务的模型。iOS 原生 sheet 不能叠开:打开前先收起 + 面板,关闭后再展开。
+ <ModelPickerSheet
+ unified={{
+ currentSelection: collab.workerForm.form.model ? {
+ agentKind: collab.workerForm.form.agent,
+ activeModelId: collab.workerForm.form.model.id,
+ selectedProviderId: collab.workerForm.form.model.providerId,
+ selectedEffort: collab.workerForm.form.model.effort ?? '',
+ selectedFastMode: collab.workerForm.form.model.fast,
+ } : undefined,
+ scope: JSON.stringify([auth.user?.id, deviceId, 'orca-worker']),
+ agents: collab.workerForm.pickerAgents,
+ loadCapabilities: async agent => {
+ const result = normalizeMobileAgentCapabilities(await maker.getCapabilities(agent));
+ if (!result) throw new Error('Capabilities unavailable');
+ return result;
+ },
+ onSelect: collab.workerForm.modelPicker.select,
+ }}
+ activeModelId={collab.workerForm.form.model?.id ?? ''}
+ activePermissionMode=""
+ agentKind={collab.workerForm.form.agent}
+ apiKeyStatus={deviceApiKeyStatus}
+ capabilities={null}
+ emptyHint={composerDeviceProviders.error && !composerDeviceProviders.unsupported
+ ? humanizeRemoteError(composerDeviceProviders.error)
+ : undefined}
+ flatOptions={collab.workerForm.modelPicker.flatModelOptions}
+ hidePermissionTrigger
+ keyboardAvoidingBehavior={nativeShellLayout.keyboardAvoidingBehavior}
+ loading={composerDeviceProviders.loading}
+ modelVisibilityOverrides={composerDeviceProviders.modelVisibilityOverrides}
+ onClose={collab.workerForm.modelPicker.close}
+ onClosed={collab.workerForm.modelPicker.closed}
+ onSelectFlatModel={collab.workerForm.modelPicker.selectFlatModel}
+ onSelectPermissionMode={() => undefined}
+ onSelectProviderRow={() => undefined}
+ permissionOptions={[]}
+ pricing={deviceModelPricing}
+ providers={collabWorkerProviders}
+ providersReady={composerDeviceProviders.ready}
+ providersUnsupported={composerDeviceProviders.unsupported}
+ selectedEffort={collab.workerForm.form.model?.effort ?? ''}
+ selectedFastMode={!!collab.workerForm.form.model?.fast}
+ selectedProviderId={collab.workerForm.form.model?.providerId ?? null}
+ testID="session.collabModelSheet"
+ visible={collab.workerForm.modelPicker.open}
+ />
+ ) : null}
{/* 权限模式独立浮窗(composer 权限图标钮点开)。两端同一语义:点选先关浮窗,关闭完成后
再走 confirmFullAccessChange + maker:set-permission-mode。 */}
{currentSession && runtimeOptions ? (
@@ -9244,15 +9400,15 @@ export default function SessionScreen() {
loadEarlierProgressKey={oldestLoadedMessageCursor}
onCopyMessageLink={copyMessageLink}
onAddMessageToComposer={canUseComposer ? addMessageToComposer : undefined}
- onDeleteMessage={collaborationReadOnlyReason || isSharedTaskPeer(deviceId) ? undefined : deleteMessage}
- onForkMessage={collaborationReadOnlyReason || isSharedTaskPeer(deviceId) ? undefined : forkAtMessage}
+ onDeleteMessage={isSharedTaskPeer(deviceId) ? undefined : deleteMessage}
+ onForkMessage={isSharedTaskPeer(deviceId) ? undefined : forkAtMessage}
onLoadEarlier={loadEarlierMessages}
onLoadToolInput={loadToolInput}
onOpenForkOrigin={forkOrigin ? openForkOrigin : undefined}
onOpenOriginSession={openOriginSession}
onBlockingOverlayChange={handleMessageBlockingOverlayChange}
onOpenSessionLink={openSessionLink}
- onPreviewRewind={collaborationReadOnlyReason || isSharedTaskPeer(deviceId) ? undefined : previewRewindAtMessage}
+ onPreviewRewind={isSharedTaskPeer(deviceId) ? undefined : previewRewindAtMessage}
onEnterShareSelection={enterShareSelection}
onVisibleShareableMessageIdsReaderChange={handleVisibleShareableMessageIdsReaderChange}
shareSelectionActive={shareSelectionActive}
@@ -9265,7 +9421,7 @@ export default function SessionScreen() {
onReleaseRemoteMedia={releaseRemoteMedia}
onResolveRemoteMedia={resolveRemoteMedia}
onShareImage={shareLightboxImage}
- imageAnnotation={collaborationReadOnlyReason ? undefined : composerAnnotations.chatAnnotation}
+ imageAnnotation={composerAnnotations.chatAnnotation}
queueFooter={(
<>
{companionInlineInteraction && !shareSelectionActive ? <InteractionPanel
@@ -9276,27 +9432,21 @@ export default function SessionScreen() {
interactions={pending} activeRequestId={pendingInteractionActiveRequestId}
onActiveRequestIdChange={setPendingInteractionActiveRequestId}
planViewerState={pendingPlanViewerState} onPlanViewerStateChange={setPendingPlanViewerState}
- onError={setError} readOnlyReason={collaborationReadOnlyReason}
+ onError={setError}
/> : null}
{/* error-tail / interrupted 收尾提示:live 错误与队列区互斥
- (resolveSessionTailBanner 内部已按 projection.error 抑制)。
- 协同只读会话(worker):error-tail 不渲染(错误卡已回流
- 消息流,信息可见);interrupted 渲染只读信息版——它没有
- 任何消息行可回落,不显示会让用户不知道任务为何停了
- (review P2),操作行按只读隐藏。 */}
- {tailBannerState
- && (!collaborationReadOnlyReason || tailBannerState.kind === 'interrupted') ? (
+ (resolveSessionTailBanner 内部已按 projection.error 抑制)。 */}
+ {tailBannerState ? (
<SessionTailBanner
busy={tailBannerBusy}
onContinue={() => void continueTailBanner()}
onDismiss={dismissTailBanner}
- readOnly={!!collaborationReadOnlyReason}
state={tailBannerState}
/>
) : null}
{shouldShowFailedScheduleNotice({
latestFailedRun: scheduleFailure?.source === scheduleNoticeSource ? scheduleFailure.run : null,
- readOnly: !!collaborationReadOnlyReason,
+ readOnly: false,
tailError: !!errorTailClientId || !!retryHiddenTailClientId,
interrupted: tailBannerState?.kind === 'interrupted',
continuationPending: tailContinuationInFlight,
@@ -9311,12 +9461,11 @@ export default function SessionScreen() {
<InlineQueueSection
busy={queueBusy}
sessionSource={currentSession?.source}
- errorRecoveryReadOnlyReason={errorRecoveryReadOnlyReason}
onClearError={clearQueueError}
onResume={resumeQueue}
onRetryError={retryQueueError}
projection={inputProjection}
- readOnlyReason={queueInlineReadOnlyReason}
+ readOnlyReason={queueAvailabilityReason}
/>
</>
)}
@@ -9459,7 +9608,6 @@ export default function SessionScreen() {
activeRequestId={pendingInteractionActiveRequestId}
onActiveRequestIdChange={setPendingInteractionActiveRequestId}
onError={setError}
- readOnlyReason={collaborationReadOnlyReason}
/>
</ScrollView>
</View>
@@ -9501,7 +9649,6 @@ export default function SessionScreen() {
planViewerState={pendingPlanViewerState}
onPlanViewerStateChange={setPendingPlanViewerState}
onError={setError}
- readOnlyReason={collaborationReadOnlyReason}
/>
</View>
) : (
@@ -9523,19 +9670,11 @@ export default function SessionScreen() {
planViewerState={pendingPlanViewerState}
onPlanViewerStateChange={setPendingPlanViewerState}
onError={setError}
- readOnlyReason={collaborationReadOnlyReason}
/>
</ScrollView>
)}
</View>
- )) : sessionOperationLayout.composerSlot === 'read-only' ? (
- <View style={styles.readOnlyComposer} testID="session.collaborationReadOnlyComposer">
- <Text style={styles.collaborationTitle}>{t('session.screen.readOnlyMode')}</Text>
- <Text style={styles.collaborationText}>
- {composerDisabledReason}
- </Text>
- </View>
- ) : (
+ )) : (
<>
{/* 消息区还在「正在同步」占位(新建会话第一帧 / 冷开首屏)时不谈运行状态:
「正在同步 + 思考中 + 0s · 0 tokens」三件事同时铺开,反倒像出错,而且
@@ -9584,6 +9723,39 @@ export default function SessionScreen() {
/>
</View>
) : null}
+ {/* 协同状态条:Lead 显示 Worker 概况并打开协同面板;Worker 回到所属 Lead。 */}
+ {!companionChat && !shareSelectionActive
+ && (collab.isLead || (collab.isWorker && collab.workerLeadSessionId)) ? (
+ <Pressable
+ accessibilityRole="button"
+ onPress={() => {
+ if (!collab.isLead) {
+ collab.openLead();
+ return;
+ }
+ setModelSheetOpen(false);
+ collab.openFromMain();
+ setContextSheetOpen(true);
+ }}
+ style={({ pressed }) => [
+ styles.queueEditBar,
+ { marginHorizontal: composerTouchLayout.composerPaddingHorizontal },
+ pressed && styles.collabBarPressed,
+ ]}
+ testID="session.collabBar"
+ >
+ <UsersRound color={colors.textTertiary} size={iconSize.sm} strokeWidth={iconStroke.regular} />
+ <Text numberOfLines={1} style={styles.queueEditBarText}>
+ {collab.isLead
+ ? t('session.collab.barLead', {
+ count: collab.team.workers.length,
+ running: collab.team.workers.filter((worker) => worker.status === 'running').length,
+ })
+ : t('session.collab.barWorker')}
+ </Text>
+ <ChevronRight color={colors.textTertiary} size={iconSize.sm} strokeWidth={iconStroke.regular} />
+ </Pressable>
+ ) : null}
{queueEditing ? (
<View
style={[
@@ -9789,7 +9961,6 @@ function SessionHeaderBar({
pendingCount,
queueCount,
queuePaused,
- readOnlyReason,
remoteUnavailableReason,
searchOpen,
title,
@@ -9819,7 +9990,6 @@ function SessionHeaderBar({
pendingCount: number;
queueCount: number;
queuePaused: boolean;
- readOnlyReason?: string | null;
remoteUnavailableReason?: string | null;
searchOpen: boolean;
title: string;
@@ -9834,7 +10004,6 @@ function SessionHeaderBar({
pendingCount,
queueCount,
queuePaused,
- readOnlyReason,
remoteUnavailableReason,
searchOpen,
session: currentSession,
@@ -9843,8 +10012,11 @@ function SessionHeaderBar({
const actionProjection = overview ? projectMobileSessionActions(overview.actions) : null;
// queue 入口已退役:排队消息 inline 到消息流(InlineQueueSection),不再有独立面板。
// 两端顶栏右侧同为「远程桌面、文件、更多」;搜索从「更多 → 任务详情」进入(ios-native-design §2、§4)。
+ // 协同 Worker 任务在 Lead 的工作区里跑,不单独提供远程桌面 / 文件入口,只留「更多」。
+ const workerHeader = currentSession?.orcaRole === 'worker';
const headerActions = (actionProjection?.primaryActions ?? [])
.filter((action) => action.id === 'files');
+ const visibleHeaderActions = workerHeader ? [] : headerActions;
const actionHandlers = {
files: onOpenFiles,
queue: () => undefined,
@@ -9856,7 +10028,6 @@ function SessionHeaderBar({
isDeviceAccessRevoked,
pendingCount,
queuePaused,
- readOnlyReason,
session: currentSession,
});
const nativeHeader = Platform.OS === 'ios';
@@ -9867,7 +10038,7 @@ function SessionHeaderBar({
// fixed-size React title's contents when the trailing glass capsule grows.
const nativeTitleMaxWidth = Math.max(0, Math.min(240,
headerWindow.width - headerInsets.left - headerInsets.right
- - (spacing.lg + spacing.xs) * 2 - navigationChrome.target * (onOpenSessionList ? 5 : 4)
+ - (spacing.lg + spacing.xs) * 2 - navigationChrome.target * ((onOpenSessionList ? 5 : 4) - (workerHeader ? 2 : 0))
- (onOpenSessionList ? spacing.sm : 0) - spacing.sm * 2,
));
const sessionListButton = onOpenSessionList ? (
@@ -9905,7 +10076,7 @@ function SessionHeaderBar({
<SessionHeaderNativeActions available={!!currentSession}
desktopLabel={t('remoteDesktop.title')}
filesLabel={t('session.presentation.overview.actions.files.a11y')}
- moreLabel={t('session.menu.details')} files={files}
+ moreLabel={t('session.menu.details')} files={files} detailsOnly={workerHeader}
onDetails={onOpenSettings} onDesktop={onOpenRemoteDesktop}
onAction={id => actionHandlers[id]()} />
</Stack.Toolbar.View>
@@ -9934,12 +10105,14 @@ function SessionHeaderBar({
<SystemNavigationBack label={t('shared.back')} onPress={onBack} />
{sessionListButton}
{systemBack ? <Stack.Toolbar placement="right">
+ {workerHeader ? null : <>
<Stack.Toolbar.Button icon={require('../../assets/navigation/monitor.png')} iconRenderingMode="template"
accessibilityLabel={t('remoteDesktop.title')} disabled={!currentSession} onPress={onOpenRemoteDesktop} />
<Stack.Toolbar.Button icon={require('../../assets/navigation/folder.png')} iconRenderingMode="template"
accessibilityLabel={t('session.presentation.overview.actions.files.a11y')}
disabled={!currentSession || !overview?.actions.some(action => action.id === 'files' && !action.disabled)}
onPress={onOpenFiles} />
+ </>}
<Stack.Toolbar.Button icon="ellipsis" accessibilityLabel={t('session.menu.details')}
disabled={!currentSession} onPress={onOpenSettings} />
</Stack.Toolbar> : null}
@@ -9997,20 +10170,23 @@ function SessionHeaderBar({
filesLabel={t('session.presentation.overview.actions.files.a11y')}
moreLabel={t('session.menu.details')}
files={overview?.actions.find(action => action.id === 'files')}
+ detailsOnly={workerHeader}
onDetails={onOpenSettings}
onDesktop={onOpenRemoteDesktop}
onAction={id => actionHandlers[id]()}
/>
) : <View style={styles.sessionHeaderActions}>
- <SessionHeaderIconButton
- accessibilityLabel={t('remoteDesktop.title')}
- active={false}
- disabled={!currentSession}
- icon={Monitor}
- onPress={currentSession ? onOpenRemoteDesktop : undefined}
- testID="session.remoteDesktop"
- />
- {headerActions.map((action) => (
+ {workerHeader ? null : (
+ <SessionHeaderIconButton
+ accessibilityLabel={t('remoteDesktop.title')}
+ active={false}
+ disabled={!currentSession}
+ icon={Monitor}
+ onPress={currentSession ? onOpenRemoteDesktop : undefined}
+ testID="session.remoteDesktop"
+ />
+ )}
+ {visibleHeaderActions.map((action) => (
<SessionHeaderIconButton
accessibilityHint={action.disabledReason ?? undefined}
accessibilityLabel={action.accessibilityLabel}
@@ -10099,21 +10275,17 @@ function compactSessionHeaderNotice({
isDeviceAccessRevoked,
pendingCount,
queuePaused,
- readOnlyReason,
session,
}: {
isDeviceAccessRevoked: boolean;
pendingCount: number;
queuePaused: boolean;
- readOnlyReason?: string | null;
session: RemoteSession | null;
}): string | null {
if (isDeviceAccessRevoked) return i18n.t('session.screen.accessRevoked');
if (!session) return null;
if (pendingCount > 0) return i18n.t('session.screen.pendingCount', { num: pendingCount });
- // readOnlyReason 现在传入的是 composer 只读 reason:worker(只读)→「只读模式」;Lead(可聊天)→ 不显示。
- if (readOnlyReason) return i18n.t('session.screen.readOnlyMode');
- // 协作角色会话(Lead 等可聊天的角色)显示协作标签而非「只读模式」,标明其协作身份。
+ // 协同任务(Lead / Worker 等)显示协同标签,标明其协同身份。
const collaborationLabel = sessionCollaborationLabel(session);
if (collaborationLabel) return collaborationLabel;
if (session.status === 'archived') return i18n.t('session.screen.archived');
@@ -11676,6 +11848,9 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({
paddingHorizontal: spacing.md,
paddingVertical: spacing.sm,
},
+ collabBarPressed: {
+ opacity: 0.7,
+ },
queueEditBarText: {
color: colors.textSecondary,
flex: 1,
@@ -11873,17 +12048,6 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({
lineHeight: lineHeight.caption,
fontWeight: fontWeight.medium,
},
- collaborationTitle: {
- color: colors.textPrimary,
- fontSize: typeScale.caption,
- lineHeight: lineHeight.caption,
- fontWeight: fontWeight.medium,
- },
- collaborationText: {
- color: colors.textSecondary,
- fontSize: typeScale.footnote,
- lineHeight: lineHeight.caption,
- },
sessionSyncPlaceholder: {
flex: 1,
justifyContent: 'flex-start',
@@ -11943,13 +12107,6 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({
flexGrow: 1,
minHeight: 0,
},
- readOnlyComposer: {
- borderTopColor: colors.border,
- borderTopWidth: StyleSheet.hairlineWidth,
- gap: spacing.xs,
- paddingHorizontal: spacing.lg,
- paddingVertical: spacing.md,
- },
composer: {
backgroundColor: 'transparent',
gap: spacing.xs,
diff --git a/apps/mobile/app/sessions/new.tsx b/apps/mobile/app/sessions/new.tsx
index 5ccd74878e..3a0bd770d9 100644
--- a/apps/mobile/app/sessions/new.tsx
+++ b/apps/mobile/app/sessions/new.tsx
@@ -57,6 +57,7 @@ import {
Plus,
Settings,
Target,
+ UsersRound,
X,
Zap,
} from 'lucide-react-native';
@@ -125,10 +126,27 @@ import {
} from '@/session/agentCapabilitiesCache';
import {
ContextSheet,
-
+ ContextSheetFooterButton,
ContextSheetGroup,
ContextSheetRow,
} from '@/session/ContextSheet';
+import { OrcaWorkerFormView } from '@/session/ContextSheetCollabView';
+import { useOrcaWorkerForm } from '@/session/useSessionOrcaCollab';
+import {
+ buildOrcaEnableOptions,
+ describeOrcaError,
+ enableOrcaTeam,
+ isOrcaCollabEligible,
+ orcaAgentLabel,
+ orcaCollabEntryHint,
+ narrowOrcaWorkerProvider,
+ orcaCollabDraftTargetKey,
+ readOrcaCollabEntryStatus,
+ rememberOrcaStartFailure,
+ type OrcaCollabEntryStatus,
+ type OrcaWorkerFormValue,
+} from '@/session/orcaTeam';
+import { buildDraftWorkerInitialTask } from '@cindy/maker-shared/orca-team';
import { RecentPhotosStrip } from '@/session/ContextSheetMediaViews';
import { ContextSheetGoalCreateForm } from '@/session/ContextSheetGoalView';
import type { MobileGoalLimitsInput } from '@cindy/maker-shared/device-link-contract';
@@ -544,8 +562,52 @@ export default function NewRemoteSessionScreen() {
const [showHiddenDirectories, setShowHiddenDirectories] = useState(false);
// Context 面板(+ 号弹出的可拖动 sheet):open + 子视图(主视图 / 截图列表 / 目标草稿)。
const [contextSheetOpen, setContextSheetOpen] = useState(false);
- const [contextSheetView, setContextSheetView] = useState<'main' | 'goal'>('main');
+ const [contextSheetView, setContextSheetView] = useState<'main' | 'goal' | 'collab'>('main');
const contextSheetMediaLibraryEnabled = canBrowsePhotoLibraryDirectly(Platform.OS);
+ // 新建即协同(对齐桌面 NewMakerDraftRoute 的协同草稿):确认后只武装草稿,发送首条消息 /
+ // 建目标时在 createSession 之后开启(首轮 Lead 才有协同工具)。一次性:创建后复位。
+ const [collabDraft, setCollabDraft] = useState<OrcaWorkerFormValue | null>(null);
+ const [collabEntryStatus, setCollabEntryStatus] = useState<OrcaCollabEntryStatus>('loading');
+ const collabForm = useOrcaWorkerForm({
+ maker,
+ // 按区域限定的账号键:Global 与中国大陆版同号不同人,记忆(含完全访问)不能串。
+ prefsScope: outboxOwner.accountKey || null,
+ active: contextSheetOpen && contextSheetView === 'collab',
+ setSheetOpen: setContextSheetOpen,
+ connectionEpoch,
+ });
+ const collabTarget = useMemo(() => ({
+ orcaRole: null,
+ workspaceKind: draft.workspaceKind,
+ workingDir: draft.workingDir || null,
+ remoteHostId: null,
+ }), [draft.workingDir, draft.workspaceKind]);
+ const collabEligible = isOrcaCollabEligible(collabTarget);
+ // 换设备 / 换工作区后,草稿里的协同设置属于旧目标:丢弃,避免在新目标上静默开启。
+ // 按草稿武装时的目标比对(而不是「目标一变就清」):返回编辑恢复草稿时目标与草稿一起回填,
+ // 不会被这里误清。
+ const collabTargetKey = orcaCollabDraftTargetKey(selectedDeviceId, draft.workspaceKind, draft.workingDir);
+ const collabDraftTargetRef = useRef<string | null>(null);
+ useEffect(() => {
+ if (collabDraftTargetRef.current !== collabTargetKey) setCollabDraft(null);
+ }, [collabTargetKey]);
+ // 读入口状态;重连后重读:断线时读失败会落成「不可用」,不能让表单一直卡住。
+ useEffect(() => {
+ if (!contextSheetOpen || !collabEligible || !selectedDeviceId) return undefined;
+ let cancelled = false;
+ setCollabEntryStatus('loading');
+ void readOrcaCollabEntryStatus(maker, collabTarget, draft.agentKind)
+ .then((status) => { if (!cancelled) setCollabEntryStatus(status); });
+ return () => { cancelled = true; };
+ }, [collabEligible, collabTarget, connectionEpoch, contextSheetOpen, draft.agentKind, maker, selectedDeviceId]);
+ const openCollabDraftForm = useCallback(() => {
+ if (collabDraft) {
+ collabForm.restore(collabDraft);
+ } else {
+ collabForm.reset();
+ }
+ setContextSheetView('collab');
+ }, [collabDraft, collabForm]);
// 目标模式(对齐桌面 NewMakerDraftRoute.handleCreateGoal):填完表单直接建会话 + setGoal,
// 被控端落目标消息并自动开跑第一轮,成功后跳转会话页。
const [goalBusy, setGoalBusy] = useState(false);
@@ -711,6 +773,14 @@ export default function NewRemoteSessionScreen() {
if (!stashed) return;
restoreCreationDraft(stashed.draft, [...stashed.attachments]);
if (stashed.notice) setAttachmentError(stashed.notice);
+ if (stashed.collabDraft && stashed.deviceId) {
+ collabDraftTargetRef.current = orcaCollabDraftTargetKey(
+ stashed.deviceId,
+ stashed.draft.workspaceKind,
+ stashed.draft.workingDir,
+ );
+ setCollabDraft(stashed.collabDraft);
+ }
if (stashed.deviceId) {
userTouchedDeviceRef.current = true;
setSelectedDeviceId(stashed.deviceId);
@@ -903,7 +973,10 @@ export default function NewRemoteSessionScreen() {
[capabilities, draft.model],
);
// 被控端供应商目录 → provider-aware 模型分段(对齐桌面)。0 供应商 / 旧被控端 → 回退扁平列表。
- const deviceProviders = useDeviceProviders(selectedDeviceId || undefined, modelSheetOpen);
+ const deviceProviders = useDeviceProviders(
+ selectedDeviceId || undefined,
+ modelSheetOpen || collabForm.modelPicker.open,
+ );
// 模型列表元信息(单价 / 折扣版 key presence)+ 草稿 per-(agent,来源,模型) 记忆(对齐桌面)。
const deviceModelPricing = useDeviceModelPricing(selectedDeviceId || undefined);
const deviceApiKeyStatus = useDeviceApiKeyStatus(selectedDeviceId || undefined);
@@ -3701,6 +3774,20 @@ export default function NewRemoteSessionScreen() {
testID="newSession.planModeChip"
/>
) : null}
+ {collabDraft ? (
+ <PlanModeChip
+ disabled={creating}
+ exitAccessibilityLabel={t('session.collab.draftRemove')}
+ icon={<UsersRound color={colors.textPrimary} size={iconSize.sm} strokeWidth={iconStroke.regular} />}
+ label={t('session.collab.draftChip')}
+ onExit={() => setCollabDraft(null)}
+ onPress={() => {
+ openCollabDraftForm();
+ setContextSheetOpen(true);
+ }}
+ testID="newSession.collabChip"
+ />
+ ) : null}
<Pressable
accessibilityLabel={t('session.new.modelAccessibility', { model: runtimeSummary.modelSummary })}
accessibilityRole="button"
@@ -4644,6 +4731,15 @@ export default function NewRemoteSessionScreen() {
attachments: sendAttachments,
planModeArm: planModeCapability && planModeDraftOn,
legacyPlanRestore,
+ // 首个 Worker 先于 Lead 首条消息创建:把待发送的 Lead 输入作为上下文附在 Worker
+ // 任务后(与桌面控制端老被控端兼容路径同口径,见 buildDraftWorkerInitialTask)。
+ ...(collabDraft ? {
+ orcaEnable: buildOrcaEnableOptions(
+ narrowOrcaWorkerProvider(collabDraft, deviceProviders.ready ? deviceProviders.providers : null),
+ buildDraftWorkerInitialTask(collabDraft.initialTask, effectiveDraft.firstMessage),
+ ),
+ collabDraft,
+ } : {}),
precreatedWorktree,
precreatedWorktreeAccountId: worktreeAccountId,
// stale-ready 防护(review P1):缓存判 ready/unknown 也可能已过期。管线内
@@ -4715,6 +4811,7 @@ export default function NewRemoteSessionScreen() {
// 一次性语义:chip 状态只影响这一次创建,创建后复位草稿态。
setPlanModeDraftOn(false);
}
+ setCollabDraft(null);
voiceDictionaryLearningTrackerRef.current?.flush();
// 本页即将 unmount 跳转会话页,标注私有缓存(源图 / 烧录图副本)清一遍
// (review P2——此前只有目标流有这行,首条消息发送成功路径漏了,标注
@@ -4743,6 +4840,9 @@ export default function NewRemoteSessionScreen() {
}, [
agentAuthVerdict,
auth.user?.id,
+ collabDraft,
+ deviceProviders.ready,
+ deviceProviders.providers,
confirmAgentUnauthenticated,
deviceLinkStatus,
selectedDeviceId,
@@ -5339,6 +5439,20 @@ export default function NewRemoteSessionScreen() {
// 调用进「编辑已有目标」分支会重落目标消息、停/重启轮次并重置计数)——仅
// 当首次请求确认未执行才可重试,故失败直接进入接回:继续 settle 落账并跳转,
// 目标未设置经 goalError 路由参数在会话页呈现,用户可在会话内重试设置目标。
+ // 协同草稿:goal.set 之前开启,首轮目标 Lead 才有协同工具。失败不阻断目标,
+ // 任务照单任务继续,原因带到会话页提示。
+ let collabEnabled = false;
+ if (collabDraft) {
+ try {
+ await enableOrcaTeam(maker, result.sessionId, buildOrcaEnableOptions(
+ narrowOrcaWorkerProvider(collabDraft, deviceProviders.ready ? deviceProviders.providers : null),
+ buildDraftWorkerInitialTask(collabDraft.initialTask, input.objective),
+ ));
+ collabEnabled = true;
+ } catch (collabErr) {
+ rememberOrcaStartFailure(result.sessionId, describeOrcaError(collabErr, null));
+ }
+ }
let goalSetError: string | null = null;
try {
await maker.goal.set({ sessionId: result.sessionId, objective: input.objective, ...(input.limits ? { limits: input.limits } : {}) });
@@ -5373,6 +5487,9 @@ export default function NewRemoteSessionScreen() {
});
session = { ...session, title: titled.title };
}
+ // 协同已开启:本地兜底(getSession 失败时由创建结果合成)不带 orcaRole,写入前补上 Lead
+ // 身份,不让兜底行盖掉已收到的 Lead 标记(与普通新建管线同口径)。
+ if (collabEnabled && session.orcaRole !== 'lead') session = { ...session, orcaRole: 'lead' };
if (!isCurrentOwner() || !ensureDeviceAlive()) return;
remoteSessionStore.upsertDeviceSession(selectedDeviceId, selectedDeviceName, session);
if (session.title && !isDefaultDraftSessionTitle(session.title)) {
@@ -5492,6 +5609,9 @@ export default function NewRemoteSessionScreen() {
}, [
agentAuthVerdict,
auth,
+ collabDraft,
+ deviceProviders.ready,
+ deviceProviders.providers,
confirmAgentUnauthenticated,
draft,
goalBusy,
@@ -6169,8 +6289,27 @@ export default function NewRemoteSessionScreen() {
keyboardAvoidingBehavior={Platform.OS === 'ios' ? 'padding' : 'height'}
onBack={contextSheetView !== 'main' ? () => setContextSheetView('main') : undefined}
onClose={() => setContextSheetOpen(false)}
+ footer={contextSheetView === 'collab' ? (
+ <ContextSheetFooterButton
+ disabled={!collabForm.valid || collabEntryStatus !== 'ready' || creating}
+ label={t('session.collab.draftSubmit')}
+ onPress={() => {
+ // 与桌面新建任务一样:确认协同草稿即记住这次的 Worker 选择。
+ collabForm.remember(collabForm.form);
+ collabDraftTargetRef.current = collabTargetKey;
+ setCollabDraft(collabForm.form);
+ setContextSheetView('main');
+ setContextSheetOpen(false);
+ }}
+ testID="newSession.collabDraftSubmit"
+ />
+ ) : undefined}
testID="newSession.contextSheet"
- title={contextSheetView === 'goal' ? t('session.common.goalMode') : t('session.common.context')}
+ title={contextSheetView === 'goal'
+ ? t('session.common.goalMode')
+ : contextSheetView === 'collab'
+ ? t('session.collab.enableTitle')
+ : t('session.common.context')}
visible={contextSheetOpen}
>
{contextSheetView === 'main' ? (
@@ -6226,8 +6365,55 @@ export default function NewRemoteSessionScreen() {
testID="newSession.contextSheetGoalRow"
trailing="chevron"
/>
+ {collabEligible ? (
+ <ContextSheetRow
+ accessibilityHint={orcaCollabEntryHint(collabEntryStatus) ?? undefined}
+ disabled={creating}
+ icon={<UsersRound color={colors.textPrimary} size={iconSize.lg} strokeWidth={iconStroke.regular} />}
+ label={t('session.collab.modeLabel')}
+ onPress={openCollabDraftForm}
+ testID="newSession.contextSheetCollabRow"
+ trailing={collabDraft ? (
+ <>
+ <Text style={{ color: colors.textTertiary, fontSize: typeScale.footnote, lineHeight: lineHeight.caption }}>
+ {t('session.collab.enabled')}
+ </Text>
+ <ChevronRight color={colors.textTertiary} size={iconSize.md} strokeWidth={iconStroke.regular} />
+ </>
+ ) : 'chevron'}
+ />
+ ) : null}
</ContextSheetGroup>
</>
+ ) : contextSheetView === 'collab' ? (
+ <>
+ <OrcaWorkerFormView
+ agents={collabForm.agents}
+ busy={creating}
+ customRoleMode={collabForm.customRoleMode}
+ form={collabForm.form}
+ notice={orcaCollabEntryHint(collabEntryStatus)}
+ onAgentChange={collabForm.changeAgent}
+ onChange={collabForm.patch}
+ onCustomRoleModeChange={collabForm.setCustomRoleMode}
+ onPermissionChange={(mode) => void collabForm.changePermission(mode)}
+ onPickModel={collabForm.modelPicker.openPicker}
+ />
+ {collabDraft ? (
+ <ContextSheetGroup label="">
+ <ContextSheetRow
+ destructive
+ icon={<X color={colors.destructive} size={iconSize.lg} strokeWidth={iconStroke.regular} />}
+ label={t('session.collab.draftRemove')}
+ onPress={() => {
+ setCollabDraft(null);
+ setContextSheetView('main');
+ }}
+ testID="newSession.collabDraftRemove"
+ />
+ </ContextSheetGroup>
+ ) : null}
+ </>
) : (
<ContextSheetGoalCreateForm
busy={goalBusy}
@@ -6359,6 +6545,56 @@ export default function NewRemoteSessionScreen() {
testID="newSession.modelSheet"
visible={modelSheetOpen}
/>
+ {collabEligible ? (
+ // 协同首个 Worker 的模型选择:只回写协同表单,不改新任务自己的模型。
+ <ModelPickerSheet
+ unified={{
+ currentSelection: collabForm.form.model ? {
+ agentKind: collabForm.form.agent,
+ activeModelId: collabForm.form.model.id,
+ selectedProviderId: collabForm.form.model.providerId,
+ selectedEffort: collabForm.form.model.effort ?? '',
+ selectedFastMode: collabForm.form.model.fast,
+ } : undefined,
+ scope: JSON.stringify([auth.user?.id, selectedDeviceId, 'orca-worker']),
+ agents: collabForm.pickerAgents,
+ loadCapabilities: async agent => {
+ const result = normalizeMobileAgentCapabilities(await maker.getCapabilities(agent));
+ if (!result) throw new Error('Capabilities unavailable');
+ return result;
+ },
+ onSelect: collabForm.modelPicker.select,
+ }}
+ activeModelId={collabForm.form.model?.id ?? ''}
+ activePermissionMode=""
+ agentKind={collabForm.form.agent}
+ apiKeyStatus={deviceApiKeyStatus}
+ capabilities={null}
+ emptyHint={deviceProviders.error && !deviceProviders.unsupported
+ ? humanizeRemoteError(deviceProviders.error)
+ : undefined}
+ flatOptions={collabForm.modelPicker.flatModelOptions}
+ hidePermissionTrigger
+ keyboardAvoidingBehavior={Platform.OS === 'ios' ? 'padding' : 'height'}
+ loading={deviceProviders.loading}
+ modelVisibilityOverrides={deviceProviders.modelVisibilityOverrides}
+ onClose={collabForm.modelPicker.close}
+ onClosed={collabForm.modelPicker.closed}
+ onSelectFlatModel={collabForm.modelPicker.selectFlatModel}
+ onSelectPermissionMode={() => undefined}
+ onSelectProviderRow={() => undefined}
+ permissionOptions={[]}
+ pricing={deviceModelPricing}
+ providers={deviceProviders.providers}
+ providersReady={deviceProviders.ready}
+ providersUnsupported={deviceProviders.unsupported}
+ selectedEffort={collabForm.form.model?.effort ?? ''}
+ selectedFastMode={!!collabForm.form.model?.fast}
+ selectedProviderId={collabForm.form.model?.providerId ?? null}
+ testID="newSession.collabModelSheet"
+ visible={collabForm.modelPicker.open}
+ />
+ ) : null}
{/* 权限模式独立浮窗:composer 权限药丸点开。两端同一语义:点选先关浮窗,关闭完成后再走
selectPermissionMode(含 Full access 确认弹层 + per-agent 记忆)。 */}
<NativePermissionSheet
diff --git a/apps/mobile/src/__tests__/AgentErrorLocalization.test.tsx b/apps/mobile/src/__tests__/AgentErrorLocalization.test.tsx
index d56207064f..2e9289d58d 100644
--- a/apps/mobile/src/__tests__/AgentErrorLocalization.test.tsx
+++ b/apps/mobile/src/__tests__/AgentErrorLocalization.test.tsx
@@ -53,7 +53,7 @@ describe.each(SUPPORTED_LOCALES)('mobile errors in %s', locale => {
const state = resolveSessionTailBanner({ messages: [row(raw)], session: null, projection: { error: null, credentialSwitchWait: null }, isSessionStreaming: false, continuationInFlight: false, sessionMetadataSyncedForConnection: true, interruptAcked: false, hiddenErrorClientIds: new Set() });
expect(state?.kind).toBe('error-tail');
await act(async () => root.render(surface === 'live'
- ? <InlineQueueSection projection={{ error: raw, errorRetryText: 'original-welcome' } as InputProjection} readOnlyReason={null} errorRecoveryReadOnlyReason={null} onRetryError={retry} onClearError={vi.fn()} onResume={vi.fn()} />
+ ? <InlineQueueSection projection={{ error: raw, errorRetryText: 'original-welcome' } as InputProjection} readOnlyReason={null} onRetryError={retry} onClearError={vi.fn()} onResume={vi.fn()} />
: <SessionTailBanner state={state!} onContinue={retry} onDismiss={vi.fn()} />));
expect(host.textContent).toContain(i18n.t('session.tail.requestFormatError'));
expect(host.textContent).not.toContain('Responses-Lite');
@@ -120,7 +120,7 @@ describe.each(SUPPORTED_LOCALES)('known mobile remote errors in %s', locale => {
const retry = vi.fn();
const clear = vi.fn();
await act(async () => root.render(surface === 'live'
- ? <InlineQueueSection projection={{ error: message, errorRetryText: 'original user message' } as InputProjection} readOnlyReason={null} errorRecoveryReadOnlyReason={null} onRetryError={retry} onClearError={clear} onResume={vi.fn()} />
+ ? <InlineQueueSection projection={{ error: message, errorRetryText: 'original user message' } as InputProjection} readOnlyReason={null} onRetryError={retry} onClearError={clear} onResume={vi.fn()} />
: <SessionTailBanner state={state!} onContinue={retry} onDismiss={clear} />));
expect(host.textContent).toContain(i18n.t(key));
expect(host.textContent).not.toContain('upstream diagnostic');
@@ -192,7 +192,7 @@ describe.each(SUPPORTED_LOCALES)('WeChat auto-review guidance in %s', locale =>
projection={{ error: message, errorRetryText: 'original user message' } as InputProjection}
sessionSource="wechat"
readOnlyReason={null}
- errorRecoveryReadOnlyReason={null}
+
onRetryError={vi.fn()}
onClearError={vi.fn()}
onResume={vi.fn()}
diff --git a/apps/mobile/src/__tests__/InlineQueueSection.test.tsx b/apps/mobile/src/__tests__/InlineQueueSection.test.tsx
index 64f542ea9c..bfce26c517 100644
--- a/apps/mobile/src/__tests__/InlineQueueSection.test.tsx
+++ b/apps/mobile/src/__tests__/InlineQueueSection.test.tsx
@@ -4,7 +4,6 @@ import { createRoot, type Root } from 'react-dom/client';
import { afterEach, beforeEach, expect, it, vi } from 'vitest';
import { readFileSync } from 'node:fs';
import { InlineQueueSection, type InlineQueueSectionProps } from '@/session/InlineQueueSection';
-import { sessionCollaborationComposerReadOnlyReason, sessionCollaborationReadOnlyReason } from '@/session/collaboration';
import type { InputProjection } from '@/session/types';
vi.mock('react-native', async () => {
@@ -39,47 +38,40 @@ beforeEach(() => {
});
afterEach(() => act(() => root.unmount()));
const projection = { error: 'Usage limit', errorRetryText: 'Try again', queuePaused: true } as InputProjection;
-async function show(role: string | null, props: Partial<InlineQueueSectionProps> = {}) {
+async function show(props: Partial<InlineQueueSectionProps> = {}) {
await act(async () => root.render(<InlineQueueSection
projection={projection}
- readOnlyReason={sessionCollaborationReadOnlyReason({ orcaRole: role })}
- errorRecoveryReadOnlyReason={sessionCollaborationComposerReadOnlyReason({ orcaRole: role })}
+ readOnlyReason={null}
onRetryError={retry} onClearError={clear} onResume={resume} {...props}
/>));
}
const button = (action: string) => host.querySelector<HTMLButtonElement>(`[data-testid="queue.inline.${action}Button"]`)!;
-it.each(['lead', null])('lets %s retry and clear an error', async (role) => {
- await show(role);
+it('lets the user retry, clear and resume', async () => {
+ await show();
expect(button('retry').disabled).toBe(false);
expect(button('clearError').disabled).toBe(false);
- expect(button('resume').disabled).toBe(role === 'lead');
+ expect(button('resume').disabled).toBe(false);
await act(async () => { button('retry').click(); button('clearError').click(); });
expect(retry).toHaveBeenCalledOnce(); expect(clear).toHaveBeenCalledOnce();
});
-it.each(['worker', 'reviewer'])('keeps %s read-only and explains why', async (role) => {
- await show(role);
- expect(button('retry').disabled).toBe(true);
- expect(button('clearError').disabled).toBe(true);
- expect(host.querySelector('[data-testid="queue.inline.errorDisabledReason"]')?.textContent).toBe(button('retry').title);
- await act(async () => { button('retry').click(); button('clearError').click(); });
- expect(retry).not.toHaveBeenCalled(); expect(clear).not.toHaveBeenCalled();
-});
it('keeps readiness and in-flight gates, then re-enables recovery', async () => {
- await show('lead', { errorRecoveryReadOnlyReason: 'Syncing' });
+ await show({ readOnlyReason: 'Syncing' });
expect(button('retry').disabled).toBe(true); expect(button('clearError').title).toBe('Syncing');
- await show('lead', { busy: true });
+ expect(host.querySelector('[data-testid="queue.inline.errorDisabledReason"]')?.textContent).toBe('Syncing');
+ await act(async () => { button('retry').click(); button('clearError').click(); });
+ expect(retry).not.toHaveBeenCalled(); expect(clear).not.toHaveBeenCalled();
+ await show({ busy: true });
expect(button('retry').disabled).toBe(true); expect(button('clearError').disabled).toBe(true);
expect(host.textContent).toContain('message.queuePresentation.row.busy');
- await show('lead'); expect(button('retry').disabled).toBe(false);
+ await show(); expect(button('retry').disabled).toBe(false);
});
it('allows clearing an error without retry content', async () => {
- await show('lead', { projection: { ...projection, errorRetryText: null } });
+ await show({ projection: { ...projection, errorRetryText: null } });
expect(button('retry').disabled).toBe(true); expect(button('clearError').disabled).toBe(false);
});
-it('wires the route recovery gate independently from the orchestration gate', () => {
+it('wires queue controls to the session availability gate', () => {
const source = readFileSync('app/sessions/[sessionId].tsx', 'utf8');
- expect(source).toContain('errorRecoveryReadOnlyReason = composerReadOnlyReason ?? queueAvailabilityReason');
- expect(source).toContain('errorRecoveryReadOnlyReason={errorRecoveryReadOnlyReason}');
- expect(source).toContain('queueInlineReadOnlyReason = collaborationReadOnlyReason ?? queueAvailabilityReason');
+ expect(source).toContain('readOnlyReason={queueAvailabilityReason}');
+ expect(source).not.toContain('errorRecoveryReadOnlyReason');
});
diff --git a/apps/mobile/src/__tests__/collaboration.test.ts b/apps/mobile/src/__tests__/collaboration.test.ts
index 723a3bbbae..13970828d4 100644
--- a/apps/mobile/src/__tests__/collaboration.test.ts
+++ b/apps/mobile/src/__tests__/collaboration.test.ts
@@ -2,10 +2,7 @@ import { beforeAll, describe, expect, it } from 'vitest';
import { i18n } from '@/i18n';
import {
isCollaborationSession,
- sessionCollaborationComposerReadOnlyReason,
sessionCollaborationLabel,
- sessionCollaborationNotice,
- sessionCollaborationReadOnlyReason,
} from '@/session/collaboration';
import type { RemoteSession } from '@/session/types';
@@ -35,45 +32,21 @@ function session(patch: Partial<RemoteSession> = {}): RemoteSession {
}
describe('mobile collaboration session fallback', () => {
- it('labels Orca lead and worker sessions without exposing orchestration actions', () => {
+ it('labels Orca lead and worker sessions', () => {
const lead = session({ orcaRole: 'lead' });
const worker = session({ orcaRole: 'worker' });
expect(sessionCollaborationLabel(lead)).toBe('协同 Lead');
expect(sessionCollaborationLabel(worker)).toBe('协同 Worker');
- // Lead 文案:可以发消息聊天,只有编排操作留在电脑端(不再说"暂不提供发送消息")。
- expect(sessionCollaborationNotice(lead)).toContain('继续发消息');
- expect(sessionCollaborationNotice(lead)).toContain('创建 Worker');
- expect(sessionCollaborationNotice(lead)).not.toContain('暂不提供');
- expect(sessionCollaborationNotice(worker)).toContain('发送消息');
- expect(sessionCollaborationNotice(worker)).toContain('切换 Worker 焦点');
expect(isCollaborationSession(lead)).toBe(true);
- expect(sessionCollaborationReadOnlyReason(worker)).toContain('只读');
- });
-
- it('lets Lead compose messages while keeping worker composer read-only', () => {
- const lead = session({ orcaRole: 'lead' });
- const worker = session({ orcaRole: 'worker' });
- const custom = session({ orcaRole: 'reviewer' });
-
- // composer 只读:Lead 可发消息(null),worker / 其它角色只读(非空)。
- expect(sessionCollaborationComposerReadOnlyReason(lead)).toBeNull();
- expect(sessionCollaborationComposerReadOnlyReason(worker)).toContain('只读');
- expect(sessionCollaborationComposerReadOnlyReason(custom)).toContain('只读');
- expect(sessionCollaborationComposerReadOnlyReason(session({ orcaRole: null }))).toBeNull();
-
- // 但写编排只读对 Lead 仍生效(fork/rewind/队列/设置仍留电脑端)。
- expect(sessionCollaborationReadOnlyReason(lead)).not.toBeNull();
+ expect(isCollaborationSession(worker)).toBe(true);
});
it('keeps unknown collaboration roles readable but generic', () => {
const custom = session({ orcaRole: 'reviewer' });
expect(sessionCollaborationLabel(custom)).toBe('协同 reviewer');
- expect(sessionCollaborationNotice(custom)).toContain('协同编排操作请在电脑端完成');
- expect(sessionCollaborationReadOnlyReason(custom)).toContain('任务修改请在电脑端完成');
expect(sessionCollaborationLabel(session({ orcaRole: null }))).toBeNull();
expect(isCollaborationSession(session({ orcaRole: null }))).toBe(false);
- expect(sessionCollaborationReadOnlyReason(session({ orcaRole: null }))).toBeNull();
});
});
diff --git a/apps/mobile/src/__tests__/interactionModel.test.ts b/apps/mobile/src/__tests__/interactionModel.test.ts
index b2e0a75119..292e91cad4 100644
--- a/apps/mobile/src/__tests__/interactionModel.test.ts
+++ b/apps/mobile/src/__tests__/interactionModel.test.ts
@@ -397,14 +397,15 @@ describe('interactionModel', () => {
])).toBe(false);
});
- it('keeps read-only pending interactions as a short desktop-style blocker', () => {
+ it('keeps shared-task guest pending interactions as a short desktop-style blocker', () => {
const interactionPanelSource = readFileSync(resolve(process.cwd(), 'src/session/InteractionPanel.tsx'), 'utf8');
- const readOnlyStart = interactionPanelSource.indexOf('if (readOnlyReason || isSharedTaskPeer(deviceId)) {');
+ const readOnlyStart = interactionPanelSource.indexOf('if (isSharedTaskPeer(deviceId)) {');
const readOnlyEnd = interactionPanelSource.indexOf('return (', interactionPanelSource.indexOf('}', readOnlyStart));
const readOnlySource = interactionPanelSource.slice(readOnlyStart, readOnlyEnd);
expect(readOnlySource).toContain("t('interaction.panel.readOnlyTitle')");
- expect(readOnlySource).toContain("{readOnlyReason ?? t('sharedTask.waitingHost')}");
+ expect(readOnlySource).toContain("{t('sharedTask.waitingHost')}");
+ expect(interactionPanelSource).not.toContain('readOnlyReason');
expect(readOnlySource).toContain('JSON.stringify(activeInteraction.request, null, 2)');
expect(readOnlySource).not.toContain('当前请求类型');
expect(readOnlySource).not.toContain('不会回传协作编排决定');
diff --git a/apps/mobile/src/__tests__/invokeTimeouts.test.ts b/apps/mobile/src/__tests__/invokeTimeouts.test.ts
index 0428b6bca0..f5fb0ae9ec 100644
--- a/apps/mobile/src/__tests__/invokeTimeouts.test.ts
+++ b/apps/mobile/src/__tests__/invokeTimeouts.test.ts
@@ -57,6 +57,17 @@ describe("resolveMobileInvokeTimeoutMs", () => {
// 破坏性操作,误超时后删除已生效、mobile 却报失败。
expect(resolveMobileInvokeTimeoutMs('maker:message:delete')).toBe(30_000);
expect(MOBILE_INVOKE_TIMEOUT_OVERRIDES_MS['device-link:media:fetch']).toBe(30_000);
+ // Orca 生命周期:主机会逐个启动 / 关闭 Worker(SSH / Agent 启停可能很慢),与开启协同同一预算。
+ for (const channel of [
+ 'maker:session:enable-orca',
+ 'maker:session:disable-orca',
+ 'maker:worker:create',
+ 'maker:worker:archive',
+ 'maker:worker:acknowledge-done',
+ 'maker:worker:switch-focus',
+ ]) {
+ expect(resolveMobileInvokeTimeoutMs(channel)).toBe(65_000);
+ }
});
it('maker:schedule:* 前缀整类放宽:桌面 handler 会等 scheduler 就绪(30s 上限)', () => {
diff --git a/apps/mobile/src/__tests__/mobileMakerTransport.test.ts b/apps/mobile/src/__tests__/mobileMakerTransport.test.ts
index abfcb5e9a4..2690bd4815 100644
--- a/apps/mobile/src/__tests__/mobileMakerTransport.test.ts
+++ b/apps/mobile/src/__tests__/mobileMakerTransport.test.ts
@@ -329,6 +329,16 @@ describe("mobile maker transport", () => {
"maker:rewind:commit",
"maker:message:delete",
"maker:close-session",
+ "maker:plugins:get-state",
+ "maker:session:enable-orca",
+ "maker:session:disable-orca",
+ "maker:worker:create",
+ "maker:worker:switch-focus",
+ "maker:worker:acknowledge-done",
+ "maker:worker:archive",
+ "maker:collaboration-settings:get",
+ "local-db:orca-workflows:list-workers-by-lead",
+ "local-db:orca-workflows:get-by-worker-session",
"maker:schedule:list",
"maker:schedule:get",
"maker:schedule:list-templates",
@@ -404,6 +414,35 @@ describe("mobile maker transport", () => {
]);
});
+ it("routes Orca collaboration calls with desktop preload argument shapes", async () => {
+ const { calls, maker } = harness();
+ const options = { workerAgent: "codex" as const, role: "developer", label: "developer", workerPermissionMode: "auto" as const };
+
+ await maker.orca.getCollabPolicy("/repo", "project");
+ await maker.orca.enable("lead-1", options);
+ await maker.orca.createWorker({ leadSessionId: "lead-1", role: "reviewer", label: "reviewer", agent: "pi", workerPermissionMode: "auto" });
+ await maker.orca.listWorkers("lead-1");
+ await maker.orca.getTeamByWorkerSession("worker-1");
+ await maker.orca.switchFocus("lead-1", "w-1");
+ await maker.orca.acknowledgeDone("lead-1", "w-1");
+ await maker.orca.archiveWorker("lead-1", "w-1");
+ await maker.orca.getCollaborationSettings();
+ await maker.orca.disable("lead-1");
+
+ expect(calls.map(({ channel, args }) => ({ channel, args }))).toEqual([
+ { channel: "maker:plugins:get-state", args: ["collab", "/repo", "project"] },
+ { channel: "maker:session:enable-orca", args: ["lead-1", options] },
+ { channel: "maker:worker:create", args: [{ leadSessionId: "lead-1", role: "reviewer", label: "reviewer", agent: "pi", workerPermissionMode: "auto" }] },
+ { channel: "local-db:orca-workflows:list-workers-by-lead", args: ["lead-1"] },
+ { channel: "local-db:orca-workflows:get-by-worker-session", args: ["worker-1"] },
+ { channel: "maker:worker:switch-focus", args: [{ leadSessionId: "lead-1", workerIdOrLabel: "w-1" }] },
+ { channel: "maker:worker:acknowledge-done", args: [{ leadSessionId: "lead-1", workerId: "w-1" }] },
+ { channel: "maker:worker:archive", args: [{ leadSessionId: "lead-1", workerId: "w-1" }] },
+ { channel: "maker:collaboration-settings:get", args: [] },
+ { channel: "maker:session:disable-orca", args: ["lead-1"] },
+ ]);
+ });
+
it("routes message reads and sends with desktop preload argument order", async () => {
const { calls, maker } = harness();
diff --git a/apps/mobile/src/__tests__/mobilePresentationRefresh.test.ts b/apps/mobile/src/__tests__/mobilePresentationRefresh.test.ts
index 9896b504bd..f78ed251d7 100644
--- a/apps/mobile/src/__tests__/mobilePresentationRefresh.test.ts
+++ b/apps/mobile/src/__tests__/mobilePresentationRefresh.test.ts
@@ -63,11 +63,10 @@ describe('mobile localized presentation refresh', () => {
expect(source).toContain('[i18nInstance.language, selectedSessions]');
});
- it('rebuilds remote and collaboration notices when the language changes', () => {
+ it('rebuilds remote notices when the language changes', () => {
const source = read('app/sessions/[sessionId].tsx');
expect(source).toContain('[connectionError, i18nInstance.language]');
- expect(source.match(/\[currentSession\?\.orcaRole, i18nInstance\.language\]/g)).toHaveLength(2);
});
it('keeps new-task authentication errors raw until render time', () => {
diff --git a/apps/mobile/src/__tests__/newSessionCreation.test.ts b/apps/mobile/src/__tests__/newSessionCreation.test.ts
index b7ebd1814a..0d5aa98f4d 100644
--- a/apps/mobile/src/__tests__/newSessionCreation.test.ts
+++ b/apps/mobile/src/__tests__/newSessionCreation.test.ts
@@ -42,6 +42,7 @@ import {
type NewSessionCreationParams,
} from '@/session/newSessionCreation';
import { remoteSessionStore } from '@/session/remoteSessionStore';
+import { takeOrcaStartFailure } from '@/session/orcaTeam';
import { sessionFromCreateResult, type NewSessionDraft } from '@/session/newSession';
import {
__testing as recoveryTesting,
@@ -944,4 +945,61 @@ describe('newSessionCreation pipeline', () => {
expect(getNewSessionCreationTask('durable-first-failed')).toMatchObject({ status: 'enqueue-failed', firstMessageClientId: 'saved-id' });
});
+ describe('collaboration on create', () => {
+ const orcaEnable = { workerAgent: 'codex' as const, role: 'developer', label: 'developer', workerPermissionMode: 'auto' as const };
+ function withOrca(maker: MakerMock, enable: ReturnType<typeof vi.fn>) {
+ return Object.assign(maker, {
+ getCapabilities: vi.fn(async () => ({ supportsOrcaWorkerPermissionMode: true })),
+ orca: { enable, listWorkers: vi.fn(async () => []) },
+ });
+ }
+
+ it('brings the collaboration draft back with the draft when a failed create returns to editing', async () => {
+ const maker = withOrca(makeMaker({
+ createSession: vi.fn(async () => { throw new Error('INVALID_PARAMS: cannot create session'); }),
+ }), vi.fn());
+ const collabDraft = {
+ role: 'reviewer', agent: 'codex' as const, model: null, permissionMode: 'auto' as const, initialTask: 'check tests',
+ };
+ startNewSessionCreation(makeParams('orca-edit', maker, { orcaEnable, collabDraft }));
+ await flushPipeline();
+ expect(getNewSessionCreationTask('orca-edit')?.status).toBe('create-failed');
+ const prepared = await prepareNewSessionCreationForEdit('orca-edit');
+ stashNewSessionDraftForEdit(prepared!);
+ expect(drainStashedNewSessionDraft()?.collabDraft).toEqual(collabDraft);
+ });
+
+ it('starts collaboration after createSession and before the first message is queued', async () => {
+ const enable = vi.fn(async () => ({ workerSessionId: 'worker-1' }));
+ const maker = withOrca(makeMaker(), enable);
+ startNewSessionCreation(makeParams('orca-ok', maker, { orcaEnable }));
+ await flushPipeline();
+ expect(enable).toHaveBeenCalledWith('orca-ok', orcaEnable);
+ expect(enable.mock.invocationCallOrder[0]).toBeGreaterThan(maker.createSession.mock.invocationCallOrder[0]!);
+ expect(enable.mock.invocationCallOrder[0]).toBeLessThan(maker.input.enqueue.mock.invocationCallOrder[0]!);
+ expect(remoteSessionStore.getSessions().find((session) => session.id === 'orca-ok')?.orcaRole).toBe('lead');
+ expect(takeOrcaStartFailure('orca-ok')).toBeNull();
+ });
+
+ it('continues as a single task and hands the reason to the session page when collaboration fails', async () => {
+ const enable = vi.fn(async () => { throw new Error('[PRECONDITION_FAILED] disabled'); });
+ const maker = withOrca(makeMaker(), enable);
+ startNewSessionCreation(makeParams('orca-fail', maker, { orcaEnable }));
+ await flushPipeline();
+ expect(maker.input.enqueue).toHaveBeenCalledTimes(1);
+ expect(getNewSessionCreationTask('orca-fail')).toBeNull();
+ expect(takeOrcaStartFailure('orca-fail')).toBeTruthy();
+ });
+
+ it('does not start collaboration twice when the authoritative row is already a Lead', async () => {
+ const enable = vi.fn(async () => ({}));
+ const maker = withOrca(makeMaker({
+ getSession: vi.fn(async () => ({ ...sessionFromCreateResult({ sessionId: 'orca-lead' }, DRAFT), orcaRole: 'lead' })),
+ }), enable);
+ startNewSessionCreation(makeParams('orca-lead', maker, { orcaEnable }));
+ await flushPipeline();
+ expect(enable).not.toHaveBeenCalled();
+ expect(maker.input.enqueue).toHaveBeenCalledTimes(1);
+ });
+ });
});
diff --git a/apps/mobile/src/__tests__/optimisticSessionComposer.test.ts b/apps/mobile/src/__tests__/optimisticSessionComposer.test.ts
index e9f5bdbe7d..50501710d0 100644
--- a/apps/mobile/src/__tests__/optimisticSessionComposer.test.ts
+++ b/apps/mobile/src/__tests__/optimisticSessionComposer.test.ts
@@ -40,21 +40,19 @@ describe('mobile optimistic composer while session is not ready', () => {
it('keeps the composer out of the read-only slot while gating remote controls separately', () => {
const source = readSource(SCREEN);
- // composer 只认真正的协作只读理由。
- expect(source).toContain(' readOnlyReason: composerReadOnlyReason,\n');
+ // composer 不再接收任何只读理由(协同任务也可在手机上操作)。
expect(source).not.toContain('readOnlyReason: cacheSeededReason');
// 断线 / 弱网 / 熔断只锁 outbox 派发;确定性错误仍进共享布局锁 composer。
expect(source).toContain('remoteUnavailableReason: composerRemoteUnavailableReason,');
expect(source).toContain('describeRemoteComposerBlockingError(connectionError)');
// 会话尚未在被控端建成时,队列行(取消 / 编辑 / 插队)仍然只读。
expect(source).toContain('const queueAvailabilityReason = cacheSeededReason\n ?? pendingCreationReason');
- expect(source).toContain('const queueInlineReadOnlyReason = collaborationReadOnlyReason ?? queueAvailabilityReason');
- expect(source).toContain('const errorRecoveryReadOnlyReason = composerReadOnlyReason ?? queueAvailabilityReason');
+ expect(source).toContain('readOnlyReason={queueAvailabilityReason}');
});
it('matches Desktop control behavior during a transient disconnect', () => {
const source = readSource(SCREEN);
- const queueGateStart = source.indexOf('const queueInlineReadOnlyReason =');
+ const queueGateStart = source.indexOf('const queueAvailabilityReason =');
const queueGateEnd = source.indexOf(';', queueGateStart);
const queueGate = source.slice(queueGateStart, queueGateEnd);
const stopStart = source.indexOf('const stopSession = () => {');
diff --git a/apps/mobile/src/__tests__/orcaCollabScreenWiring.test.ts b/apps/mobile/src/__tests__/orcaCollabScreenWiring.test.ts
new file mode 100644
index 0000000000..f34ec93fd4
--- /dev/null
+++ b/apps/mobile/src/__tests__/orcaCollabScreenWiring.test.ts
@@ -0,0 +1,79 @@
+import { readFileSync } from 'node:fs';
+import { resolve } from 'node:path';
+import { describe, expect, it } from 'vitest';
+
+const read = (path: string) => readFileSync(resolve(process.cwd(), path), 'utf8').replace(/\r\n/g, '\n');
+
+describe('mobile Orca collaboration wiring', () => {
+ it('lets the session + panel open the team panel for Leads and the enable form otherwise', () => {
+ const source = read('app/sessions/[sessionId].tsx');
+ expect(source).toContain('useSessionOrcaCollab({');
+ expect(source).toContain("contextSheetView === 'collab' && collab.isLead ? (\n <OrcaTeamPanelView");
+ expect(source).toContain('testID="session.contextSheetCollabRow"');
+ expect(source).toContain('onPress={() => void collab.submitEnable()}');
+ expect(source).toContain('onPress={() => void collab.submitCreate()}');
+ // 点 Worker 直接进入;长按才弹管理操作。
+ expect(source).toContain('onWorkerLongPress={collab.showWorkerActions}');
+ expect(source).toContain('onWorkerPress={collab.openWorker}');
+ expect(read('src/session/ContextSheetCollabView.tsx')).toContain('onLongPress={() => onWorkerLongPress(worker)}');
+ });
+
+ it('keeps the Worker model picker separate from the task model', () => {
+ const source = read('app/sessions/[sessionId].tsx');
+ const start = source.indexOf('testID="session.collabModelSheet"');
+ const block = source.slice(source.lastIndexOf('<ModelPickerSheet', start), start);
+ expect(block).toContain('onSelect: collab.workerForm.modelPicker.select');
+ expect(block).not.toContain('selectUnifiedComposerModel');
+ expect(block).toContain('onClosed={collab.workerForm.modelPicker.closed}');
+ });
+
+ it('shows a collaboration bar for Leads and a way back to the Lead for Workers', () => {
+ const source = read('app/sessions/[sessionId].tsx');
+ expect(source).toContain('testID="session.collabBar"');
+ expect(source).toContain('collab.openLead();');
+ // 断线期间首次查询失败时,重连后补查 Worker 所属 Lead 与团队。
+ expect(source).toContain("prefsScope: outboxOwner.accountKey || null,\n connectionEpoch,");
+ expect(source).toContain('takeOrcaStartFailure(sessionId)');
+ expect(source).toContain('return subscribeOrcaStartFailure((failedSessionId) => {');
+ });
+
+ it('gives Worker tasks a Worker-only header and details menu', () => {
+ const page = read('app/sessions/[sessionId].tsx');
+ // 右上角只留「更多」:不出远程桌面 / 文件夹。
+ expect(page).toContain("const workerHeader = currentSession?.orcaRole === 'worker';");
+ expect(page).toContain('detailsOnly={workerHeader}');
+ expect(page).toContain('{workerHeader ? null : (');
+ expect(page).toContain('worker={collab.isWorker ? {');
+ const menu = read('src/session/SessionMenuSheet.tsx');
+ expect(menu).toContain("const workerMode = !messageOnly && session.orcaRole === 'worker';");
+ expect(menu).toContain('const listedActions = workerMode ? [] : mainActions;');
+ expect(menu).toContain('{onOpenSearch && !workerMode ? (');
+ expect(menu).toContain('{!messageOnly && !workerMode && (');
+ expect(menu).toContain('{workerMode ? null : !messageOnly && isSharedTaskPeer');
+ // 归档确认在面板仍展开时弹出(iOS 原生 sheet 收起中弹 Alert 会丢),确认后再收起。
+ expect(menu).toContain('run: () => worker.onArchive?.(onClose)');
+ expect(menu).toContain('(row.keepOpen ? row.run() : onRun(row.run))');
+ });
+
+ it('keeps Worker lifecycle on the Orca path instead of the generic task menu', () => {
+ const source = read('src/session/SessionMenuSheet.tsx');
+ expect(source).toContain("const lifecycleHidden = sharedGuest || session.orcaRole === 'worker';");
+ expect(source).toContain("{!messageOnly && session.orcaRole !== 'worker' &&");
+ });
+
+ it('starts new-task collaboration after create with the pending Lead input as Worker context', () => {
+ const source = read('app/sessions/new.tsx');
+ expect(source).toContain('buildDraftWorkerInitialTask(collabDraft.initialTask, effectiveDraft.firstMessage)');
+ expect(source).toContain('buildDraftWorkerInitialTask(collabDraft.initialTask, input.objective)');
+ // 目标路径:协同在 goal.set 之前开启,首轮目标 Lead 才有协同工具。
+ expect(source.indexOf('await enableOrcaTeam(maker, result.sessionId'))
+ .toBeLessThan(source.indexOf('await maker.goal.set({ sessionId: result.sessionId'));
+ expect(source).toContain('setCollabDraft(null);');
+ // 目标路径:getSession 失败走兜底时也保留 Lead 身份。
+ expect(source).toContain("if (collabEnabled && session.orcaRole !== 'lead') session = { ...session, orcaRole: 'lead' };");
+ expect(source).toContain('prefsScope: outboxOwner.accountKey || null,');
+ // create-failed「返回编辑」带回协同草稿;目标比对防止恢复时被「换目标即清」误清。
+ expect(source).toContain('if (collabDraftTargetRef.current !== collabTargetKey) setCollabDraft(null);');
+ expect(source).toContain('if (stashed.collabDraft && stashed.deviceId) {');
+ });
+});
diff --git a/apps/mobile/src/__tests__/orcaTeam.test.ts b/apps/mobile/src/__tests__/orcaTeam.test.ts
new file mode 100644
index 0000000000..fa829df383
--- /dev/null
+++ b/apps/mobile/src/__tests__/orcaTeam.test.ts
@@ -0,0 +1,358 @@
+import { beforeAll, describe, expect, it, vi } from 'vitest';
+import { i18n } from '@/i18n';
+import {
+ buildOrcaEnableOptions,
+ convergeOrcaWorkerModel,
+ createOrcaWorker,
+ describeOrcaError,
+ enableOrcaTeam,
+ isOrcaCollabEligible,
+ orcaWorkerFormFromPrefs,
+ readOrcaCollabEntryStatus,
+ rememberOrcaStartFailure,
+ narrowOrcaWorkerProvider,
+ orcaWorkerProvidersForLead,
+ subscribeOrcaStartFailure,
+ takeOrcaStartFailure,
+} from '@/session/orcaTeam';
+import type { ProviderView } from '@cindy/model-providers/registry';
+import type { MobileMakerTransport } from '@/device-link/mobileMakerTransport';
+import { defaultOrcaWorkerCreationPrefs } from '@/session/orcaWorkerPrefs';
+
+beforeAll(async () => {
+ await i18n.changeLanguage('zh-CN');
+});
+
+type OrcaFake = Partial<MobileMakerTransport['orca']>;
+
+function fakeMaker(opts: {
+ capabilities?: unknown;
+ capabilitiesError?: Error;
+ orca?: OrcaFake;
+}): MobileMakerTransport {
+ return {
+ getCapabilities: vi.fn(async () => {
+ if (opts.capabilitiesError) throw opts.capabilitiesError;
+ return opts.capabilities ?? { supportsOrcaWorkerPermissionMode: true };
+ }),
+ orca: {
+ getCollabPolicy: vi.fn(async () => ({ effectiveEnabled: true })),
+ enable: vi.fn(async () => ({ workerSessionId: 'worker-1' })),
+ disable: vi.fn(async () => ({ ok: true })),
+ createWorker: vi.fn(async () => ({ ok: true, workerSessionId: 'worker-2' })),
+ listWorkers: vi.fn(async () => []),
+ getTeamByWorkerSession: vi.fn(async () => null),
+ switchFocus: vi.fn(async () => ({ ok: true })),
+ acknowledgeDone: vi.fn(async () => ({ ok: true })),
+ archiveWorker: vi.fn(async () => ({ ok: true })),
+ getCollaborationSettings: vi.fn(async () => ({})),
+ ...opts.orca,
+ },
+ } as unknown as MobileMakerTransport;
+}
+
+const project = { orcaRole: null, workspaceKind: 'project' as const, workingDir: '/repo', remoteHostId: null };
+
+describe('mobile Orca collaboration entry', () => {
+ it('only offers collaboration to Lead-capable tasks', () => {
+ expect(isOrcaCollabEligible(project)).toBe(true);
+ expect(isOrcaCollabEligible({ ...project, workingDir: '' })).toBe(false);
+ expect(isOrcaCollabEligible({ ...project, workspaceKind: 'dialogue', workingDir: null })).toBe(true);
+ expect(isOrcaCollabEligible({ ...project, orcaRole: 'worker' })).toBe(false);
+ expect(isOrcaCollabEligible(null)).toBe(false);
+ });
+
+ it('fails closed when the computer does not declare Worker permission support', async () => {
+ const maker = fakeMaker({ capabilities: {} });
+ await expect(readOrcaCollabEntryStatus(maker, project, 'codex')).resolves.toBe('unsupported');
+ expect(maker.orca.getCollabPolicy).not.toHaveBeenCalled();
+ });
+
+ it('maps policy query results to entry states', async () => {
+ await expect(readOrcaCollabEntryStatus(fakeMaker({}), project, 'codex')).resolves.toBe('ready');
+ await expect(readOrcaCollabEntryStatus(fakeMaker({
+ orca: { getCollabPolicy: vi.fn(async () => ({ effectiveEnabled: false })) },
+ }), project, 'codex')).resolves.toBe('disabled');
+ await expect(readOrcaCollabEntryStatus(fakeMaker({
+ orca: { getCollabPolicy: vi.fn(async () => { throw new Error('[DEVICE_LINK_CHANNEL_NOT_ALLOWED] no'); }) },
+ }), project, 'codex')).resolves.toBe('unsupported');
+ await expect(readOrcaCollabEntryStatus(fakeMaker({
+ orca: { getCollabPolicy: vi.fn(async () => { throw new Error('[NOT_CONNECTED] offline'); }) },
+ }), project, 'codex')).resolves.toBe('unavailable');
+ });
+
+ it('skips the project policy query for SSH-remote sessions and existing Leads', async () => {
+ const remote = fakeMaker({});
+ await readOrcaCollabEntryStatus(remote, { ...project, remoteHostId: 'host-1' }, 'claude-code');
+ expect(remote.orca.getCollabPolicy).toHaveBeenCalledWith(undefined, 'project');
+
+ const lead = fakeMaker({});
+ await expect(readOrcaCollabEntryStatus(lead, { ...project, orcaRole: 'lead' }, 'claude-code')).resolves.toBe('ready');
+ expect(lead.orca.getCollabPolicy).not.toHaveBeenCalled();
+ });
+});
+
+describe('mobile Orca collaboration mutations', () => {
+ const form = {
+ ...orcaWorkerFormFromPrefs({ ...defaultOrcaWorkerCreationPrefs(), workerPermissionMode: 'auto' }, 'codex'),
+ model: null,
+ role: 'Reviewer',
+ initialTask: 'check tests',
+ };
+
+ it('builds enable options with a derived label and only the chosen model fields', () => {
+ expect(buildOrcaEnableOptions(form, 'task')).toEqual({
+ workerAgent: 'codex',
+ role: 'Reviewer',
+ label: 'reviewer',
+ workerPermissionMode: 'auto',
+ delegateTask: 'task',
+ });
+ expect(buildOrcaEnableOptions({
+ ...form,
+ model: { id: 'gpt-5.5', providerId: 'openai', effort: 'high', fast: true },
+ }, ' ')).toEqual({
+ workerAgent: 'codex',
+ role: 'Reviewer',
+ label: 'reviewer',
+ model: 'gpt-5.5',
+ effort: 'high',
+ fast: true,
+ providerId: 'openai',
+ workerPermissionMode: 'auto',
+ });
+ });
+
+ it('restores the remembered Worker choice like the desktop create panel', () => {
+ const prefs = defaultOrcaWorkerCreationPrefs();
+ expect(orcaWorkerFormFromPrefs(prefs, prefs.lastAgent)).toEqual({
+ role: 'developer',
+ agent: 'codex',
+ model: { id: 'codex/gpt-5.5', providerId: null, effort: 'high', fast: false },
+ permissionMode: 'bypassPermissions',
+ initialTask: '',
+ });
+ });
+
+ it('converges a remembered model to what the computer can run', () => {
+ const capabilities = {
+ hasFastMode: true,
+ availableModels: [{
+ id: 'gpt-5.5', label: 'GPT', efforts: ['low', 'medium'], effortDisplayNames: {},
+ defaultEffort: 'medium', supportsFastMode: false,
+ }],
+ };
+ expect(convergeOrcaWorkerModel({ id: 'gone', providerId: null, effort: 'high', fast: false }, capabilities)).toBeNull();
+ expect(convergeOrcaWorkerModel({ id: 'gpt-5.5', providerId: null, effort: 'high', fast: true }, capabilities))
+ .toEqual({ id: 'gpt-5.5', providerId: null, effort: 'medium', fast: false });
+ const kept = { id: 'x', providerId: null, effort: 'high', fast: true };
+ expect(convergeOrcaWorkerModel(kept, null)).toBe(kept);
+ expect(convergeOrcaWorkerModel(null, capabilities)).toBeNull();
+ });
+
+ it('re-checks capabilities before enabling and refuses on downgraded hosts', async () => {
+ const maker = fakeMaker({ capabilities: { supportsOrcaWorkerPermissionMode: false } });
+ await expect(enableOrcaTeam(maker, 'lead-1', buildOrcaEnableOptions(form))).rejects.toThrow('CHANNEL_NOT_ALLOWED');
+ expect(maker.orca.enable).not.toHaveBeenCalled();
+ });
+
+ it('treats a tunnel timeout as ambiguous and confirms the team from the Worker list', async () => {
+ const maker = fakeMaker({
+ orca: {
+ enable: vi.fn(async () => { throw new Error('[INVOKE_TIMEOUT] timed out'); }),
+ listWorkers: vi.fn(async () => [{ id: 'w-1', sessionId: 'worker-9' }]),
+ },
+ });
+ await expect(enableOrcaTeam(maker, 'lead-1', buildOrcaEnableOptions(form))).resolves.toEqual({ workerSessionId: 'worker-9' });
+ expect(maker.orca.enable).toHaveBeenCalledTimes(1);
+ });
+
+ it('confirms an already-existing team from the Worker list before treating it as started', async () => {
+ const withWorker = fakeMaker({
+ orca: {
+ enable: vi.fn(async () => { throw new Error('[ALREADY_EXISTS] active team'); }),
+ listWorkers: vi.fn(async () => [{ id: 'w-1', sessionId: 'worker-7' }]),
+ },
+ });
+ await expect(enableOrcaTeam(withWorker, 'lead-1', buildOrcaEnableOptions(form))).resolves.toEqual({ workerSessionId: 'worker-7' });
+
+ // 团队已建但首个 Worker 没落库:不能按成功处理。
+ const teamOnly = fakeMaker({
+ orca: {
+ enable: vi.fn(async () => { throw new Error('[ALREADY_EXISTS] active team'); }),
+ listWorkers: vi.fn(async () => []),
+ },
+ });
+ vi.useFakeTimers();
+ const pending = enableOrcaTeam(teamOnly, 'lead-1', buildOrcaEnableOptions(form));
+ const assertion = expect(pending).rejects.toThrow('ALREADY_EXISTS');
+ await vi.runAllTimersAsync();
+ await assertion;
+ vi.useRealTimers();
+ });
+
+ it('does not retry authoritative enable failures', async () => {
+ const maker = fakeMaker({
+ orca: { enable: vi.fn(async () => { throw new Error('[PRECONDITION_FAILED] disabled'); }) },
+ });
+ await expect(enableOrcaTeam(maker, 'lead-1', buildOrcaEnableOptions(form))).rejects.toThrow('PRECONDITION_FAILED');
+ expect(maker.orca.listWorkers).not.toHaveBeenCalled();
+ });
+
+ it('skips labels still held by archived Workers instead of re-deriving the same one', async () => {
+ // 已归档的 reviewer / reviewer-2 不在列表里,但 label 仍被占用。
+ const createWorker = vi.fn()
+ .mockRejectedValueOnce(new Error('[DUPLICATE_LABEL] taken'))
+ .mockRejectedValueOnce(new Error('[DUPLICATE_LABEL] taken'))
+ .mockResolvedValueOnce({ ok: true, workerSessionId: 'worker-3' });
+ const maker = fakeMaker({ orca: { createWorker, listWorkers: vi.fn(async () => []) } });
+ await expect(createOrcaWorker(maker, 'lead-1', form, [])).resolves.toEqual({ workerSessionId: 'worker-3' });
+ expect(createWorker.mock.calls.map((call) => call[0].label)).toEqual(['reviewer', 'reviewer-2', 'reviewer-3']);
+ expect(createWorker.mock.calls[2][0]).toMatchObject({ initialTask: 'check tests', agent: 'codex' });
+ });
+
+ it('refuses to create Workers on computers that would ignore the chosen permission', async () => {
+ const maker = fakeMaker({ capabilities: {} });
+ await expect(createOrcaWorker(maker, 'lead-1', form, [])).rejects.toThrow('CHANNEL_NOT_ALLOWED');
+ expect(maker.orca.createWorker).not.toHaveBeenCalled();
+ });
+
+ it('confirms a timed-out Worker creation by its exact label instead of retrying', async () => {
+ const createWorker = vi.fn(async () => { throw new Error('[INVOKE_TIMEOUT] timed out'); });
+ const landed = fakeMaker({
+ orca: {
+ createWorker,
+ listWorkers: vi.fn(async () => [
+ { id: 'w-0', sessionId: 'old', role: 'reviewer', label: 'other' },
+ { id: 'w-1', sessionId: 'new', role: 'Reviewer', label: 'reviewer' },
+ ]),
+ },
+ });
+ await expect(createOrcaWorker(landed, 'lead-1', form, [])).resolves.toEqual({ workerSessionId: 'new' });
+ expect(createWorker).toHaveBeenCalledTimes(1);
+
+ const lost = fakeMaker({
+ orca: {
+ createWorker: vi.fn(async () => { throw new Error('[INVOKE_TIMEOUT] timed out'); }),
+ listWorkers: vi.fn(async () => []),
+ },
+ });
+ vi.useFakeTimers();
+ const pending = createOrcaWorker(lost, 'lead-1', form, []);
+ const assertion = expect(pending).rejects.toThrow('ORCA_CREATE_UNCONFIRMED');
+ await vi.runAllTimersAsync();
+ await assertion;
+ vi.useRealTimers();
+ expect(lost.orca.createWorker).toHaveBeenCalledTimes(1);
+ expect(describeOrcaError(new Error('[ORCA_CREATE_UNCONFIRMED] x'), 'session.collab.errors.createFailed'))
+ .toContain('暂时无法确认是否成功');
+ });
+
+ it('describes known Orca errors in the interface language', () => {
+ expect(describeOrcaError(new Error('[WORKER_LIMIT_HARD_EXCEEDED] full'), 'session.collab.errors.createFailed'))
+ .toBe('已达 Worker 硬上限,请先归档现有 Worker。');
+ expect(describeOrcaError(new Error('[DEVICE_LINK_CHANNEL_NOT_ALLOWED] old'), 'session.collab.errors.startFailed'))
+ .toBe('电脑端版本过旧,暂不支持协同');
+ expect(describeOrcaError(new Error('boom'), 'session.collab.errors.startFailed')).toContain('开启协同失败。');
+ });
+
+ it('hands a new-task start failure to the session page exactly once, including late failures', () => {
+ rememberOrcaStartFailure('s-1', 'reason');
+ expect(takeOrcaStartFailure('s-1')).toBe('reason');
+ expect(takeOrcaStartFailure('s-1')).toBeNull();
+
+ const seen: string[] = [];
+ const unsubscribe = subscribeOrcaStartFailure((sessionId) => seen.push(sessionId));
+ rememberOrcaStartFailure('s-2', 'late');
+ unsubscribe();
+ rememberOrcaStartFailure('s-3', 'after');
+ expect(seen).toEqual(['s-2']);
+ });
+
+ it('bounds the timeout probe by an overall deadline', async () => {
+ vi.useFakeTimers();
+ const listWorkers = vi.fn(() => new Promise((resolve) => setTimeout(() => resolve([]), 20_000)));
+ const maker = fakeMaker({
+ orca: { enable: vi.fn(async () => { throw new Error('[INVOKE_TIMEOUT] timed out'); }), listWorkers },
+ });
+ const pending = enableOrcaTeam(maker, 'lead-1', buildOrcaEnableOptions(form));
+ const assertion = expect(pending).rejects.toThrow('INVOKE_TIMEOUT');
+ await vi.runAllTimersAsync();
+ await assertion;
+ vi.useRealTimers();
+ // 20s 一次的探针在 30s 总时限内只来得及两次,不会跑满四次。
+ expect(listWorkers.mock.calls.length).toBeLessThanOrEqual(2);
+ });
+
+ it('clears an explicit provider that no longer serves the chosen model before submitting', () => {
+ const provider = (id: string, connected = true) => ({
+ id, name: id, agents: ['codex'], connected, routing: { codex: {} }, models: { codex: [{ id: 'gpt-5.5' }] },
+ }) as unknown as ProviderView;
+ const chosen = { ...form, agent: 'codex' as const, model: { id: 'gpt-5.5', providerId: 'a', effort: 'high', fast: false } };
+ // 来源 A 仍可路由 → 原样;A 断开、B 仍提供同名模型 → 清掉来源交给被控端默认路由。
+ expect(narrowOrcaWorkerProvider(chosen, [provider('a'), provider('b')])).toBe(chosen);
+ expect(narrowOrcaWorkerProvider(chosen, [provider('a', false), provider('b')]).model?.providerId).toBeNull();
+ // 目录未就绪时不猜。
+ expect(narrowOrcaWorkerProvider(chosen, null)).toBe(chosen);
+ });
+
+ it('hides routes an SSH Lead cannot run for its Workers', () => {
+ const gateway = {
+ id: 'gateway', name: 'gateway', agents: ['codex'], connected: true, routing: { codex: {} },
+ models: { codex: [{ id: 'gpt-5.5' }, { id: 'chatgpt/gpt-5.5' }] },
+ } as unknown as ProviderView;
+ const bridged = {
+ id: 'bridged', name: 'bridged', agents: ['codex'], connected: true,
+ routing: { codex: { wireProtocol: 'openai-chat' } }, models: { codex: [{ id: 'kimi' }] },
+ } as unknown as ProviderView;
+ const ssh = orcaWorkerProvidersForLead([gateway, bridged], true);
+ expect(ssh[0]!.models.codex?.map((model) => model.id)).toEqual(['gpt-5.5']);
+ expect(ssh[1]!.models.codex).toEqual([]);
+ const local = [gateway, bridged];
+ expect(orcaWorkerProvidersForLead(local, false)).toBe(local);
+ });
+
+ it('sends an explicit Fast off for a chosen model and leaves the default model to the computer', () => {
+ const chosen = { ...form, agent: 'codex' as const, model: { id: 'gpt-5.5', providerId: null, effort: 'high', fast: false } };
+ expect(buildOrcaEnableOptions(chosen)).toMatchObject({ model: 'gpt-5.5', fast: false });
+ expect(buildOrcaEnableOptions({ ...chosen, model: null })).not.toHaveProperty('fast');
+ });
+
+ it('reconciles effort and Fast against the explicitly chosen provider, not the flattened list', () => {
+ const provider = (id: string, efforts: string[], supportsFastMode: boolean) => ({
+ id, name: id, agents: ['codex'], connected: true, routing: { codex: {} },
+ models: { codex: [{ id: 'gpt-5.5', efforts, defaultEffort: efforts[0] ?? null, supportsFastMode }] },
+ }) as unknown as ProviderView;
+ const chosen = { ...form, agent: 'codex' as const, model: { id: 'gpt-5.5', providerId: 'a', effort: 'xhigh', fast: true } };
+ // 拍平能力只有 low/high 且不支持 Fast:显式来源时不改 effort / Fast。
+ const flat = { hasFastMode: true, availableModels: [{ id: 'gpt-5.5', efforts: ['low', 'high'], defaultEffort: 'low', supportsFastMode: false }] };
+ expect(convergeOrcaWorkerModel(chosen.model, flat as never)).toEqual(chosen.model);
+ // 来源 A 支持 xhigh 与 Fast → 原样;来源 A 不支持时按 A 自己的默认收敛。
+ expect(narrowOrcaWorkerProvider(chosen, [provider('a', ['high', 'xhigh'], true)])).toBe(chosen);
+ expect(narrowOrcaWorkerProvider(chosen, [provider('a', ['medium'], false)]).model)
+ .toMatchObject({ providerId: 'a', effort: 'medium', fast: false });
+ });
+
+ it('reconciles an unpinned model against the default source it will actually route to', () => {
+ const provider = (id: string, efforts: string[]) => ({
+ id, name: id, agents: ['codex'], connected: true, routing: { codex: {} },
+ models: { codex: [{ id: 'gpt-5.5', efforts, defaultEffort: efforts[0] ?? null, supportsFastMode: false }] },
+ }) as unknown as ProviderView;
+ const unpinned = { ...form, agent: 'codex' as const, model: { id: 'gpt-5.5', providerId: null, effort: 'xhigh', fast: true } };
+ const result = narrowOrcaWorkerProvider(unpinned, [provider('only', ['low', 'medium'])]);
+ // 仍不钉来源(交给被控端路由),但 effort / Fast 按该默认来源的条目收敛。
+ expect(result.model).toMatchObject({ providerId: null, effort: 'low', fast: false });
+ });
+
+ it('omits effort when the routed provider has no effort levels for the model', () => {
+ const provider = {
+ id: 'a', name: 'a', agents: ['codex'], connected: true, routing: { codex: {} },
+ models: { codex: [{ id: 'gpt-5.5', efforts: [], defaultEffort: null, supportsFastMode: false }] },
+ } as unknown as ProviderView;
+ const chosen = { ...form, agent: 'codex' as const, model: { id: 'gpt-5.5', providerId: 'a', effort: 'high', fast: false } };
+ const narrowed = narrowOrcaWorkerProvider(chosen, [provider]);
+ expect(narrowed.model?.effort).toBeNull();
+ expect(buildOrcaEnableOptions(narrowed)).not.toHaveProperty('effort');
+ });
+});
+
diff --git a/apps/mobile/src/__tests__/orcaWorkerPrefs.test.ts b/apps/mobile/src/__tests__/orcaWorkerPrefs.test.ts
new file mode 100644
index 0000000000..6f5ade781b
--- /dev/null
+++ b/apps/mobile/src/__tests__/orcaWorkerPrefs.test.ts
@@ -0,0 +1,102 @@
+import { beforeEach, describe, expect, it, vi } from 'vitest';
+
+const storage = new Map<string, string>();
+vi.mock('@react-native-async-storage/async-storage', () => ({
+ default: {
+ getItem: vi.fn(async (key: string) => storage.get(key) ?? null),
+ setItem: vi.fn(async (key: string, value: string) => { storage.set(key, value); }),
+ },
+}));
+
+const {
+ defaultOrcaWorkerCreationPrefs,
+ hasLoadedOrcaWorkerCreationPrefs,
+ readOrcaWorkerCreationPrefs,
+ rememberOrcaWorkerChoice,
+ resetOrcaWorkerCreationPrefsMemory,
+ sanitizeOrcaWorkerCreationPrefs,
+ saveOrcaWorkerCreationPrefs,
+} = await import('@/session/orcaWorkerPrefs');
+
+beforeEach(() => {
+ storage.clear();
+ resetOrcaWorkerCreationPrefsMemory();
+});
+
+describe('Worker creation preferences', () => {
+ it('starts from the same first-time defaults as the desktop create panel', () => {
+ expect(defaultOrcaWorkerCreationPrefs()).toEqual({
+ lastAgent: 'codex',
+ agents: {
+ codex: { model: 'codex/gpt-5.5', effort: 'high', fast: false },
+ 'claude-code': { model: 'claude-opus-4-7', effort: 'high', fast: false },
+ pi: { model: 'claude-sonnet-4-6', effort: 'high', fast: false },
+ },
+ workerPermissionMode: 'bypassPermissions',
+ });
+ });
+
+ it('falls back field by field for damaged memory', () => {
+ const prefs = sanitizeOrcaWorkerCreationPrefs({
+ lastAgent: 'nope',
+ agents: { pi: { model: 'my-model', effort: '', fast: 'yes' } },
+ workerPermissionMode: 'auto',
+ });
+ expect(prefs.lastAgent).toBe('codex');
+ expect(prefs.agents.pi).toEqual({ model: 'my-model', effort: 'high', fast: false });
+ expect(prefs.agents.codex.model).toBe('codex/gpt-5.5');
+ expect(prefs.workerPermissionMode).toBe('auto');
+ });
+
+ it('persists per account and reads the saved choice back', async () => {
+ const next = { ...defaultOrcaWorkerCreationPrefs(), lastAgent: 'pi' as const, workerPermissionMode: 'auto' as const };
+ saveOrcaWorkerCreationPrefs('user-1', next);
+ await Promise.resolve();
+ resetOrcaWorkerCreationPrefsMemory();
+ await expect(readOrcaWorkerCreationPrefs('user-1')).resolves.toEqual(next);
+ await expect(readOrcaWorkerCreationPrefs('user-2')).resolves.toEqual(defaultOrcaWorkerCreationPrefs());
+ });
+
+ it('keeps a choice saved while an older read was still in flight', async () => {
+ storage.set('cindy:orcaWorkerCreationPrefs:v1:user-1', JSON.stringify({
+ ...defaultOrcaWorkerCreationPrefs(), workerPermissionMode: 'bypassPermissions',
+ }));
+ const pending = readOrcaWorkerCreationPrefs('user-1');
+ const next = { ...defaultOrcaWorkerCreationPrefs(), lastAgent: 'pi' as const, workerPermissionMode: 'auto' as const };
+ saveOrcaWorkerCreationPrefs('user-1', next);
+ await expect(pending).resolves.toEqual(next);
+ await expect(readOrcaWorkerCreationPrefs('user-1')).resolves.toEqual(next);
+ });
+
+ it('does not cache defaults when the stored preferences cannot be read', async () => {
+ const AsyncStorage = (await import('@react-native-async-storage/async-storage')).default;
+ storage.set('cindy:orcaWorkerCreationPrefs:v1:user-1', JSON.stringify({
+ ...defaultOrcaWorkerCreationPrefs(), workerPermissionMode: 'auto',
+ }));
+ vi.mocked(AsyncStorage.getItem).mockRejectedValueOnce(new Error('disk busy'));
+ await expect(readOrcaWorkerCreationPrefs('user-1')).resolves.toEqual(defaultOrcaWorkerCreationPrefs());
+ expect(hasLoadedOrcaWorkerCreationPrefs('user-1')).toBe(false);
+ // 下次打开再读,拿到的是真正存过的选择。
+ await expect(readOrcaWorkerCreationPrefs('user-1')).resolves.toMatchObject({ workerPermissionMode: 'auto' });
+ expect(hasLoadedOrcaWorkerCreationPrefs('user-1')).toBe(true);
+ });
+
+ it('persists a choice submitted before the stored preferences finished loading', async () => {
+ storage.set('cindy:orcaWorkerCreationPrefs:v1:user-1', JSON.stringify({
+ ...defaultOrcaWorkerCreationPrefs(), lastAgent: 'pi',
+ }));
+ // 预读还在路上时就提交了一次选择。
+ const preload = readOrcaWorkerCreationPrefs('user-1');
+ const remembered = rememberOrcaWorkerChoice('user-1', {
+ agent: 'codex', permissionMode: 'auto', model: { id: 'codex/gpt-5.5', effort: 'low', fast: false },
+ });
+ await preload;
+ await expect(remembered).resolves.toMatchObject({ lastAgent: 'codex', workerPermissionMode: 'auto' });
+ await Promise.resolve();
+ resetOrcaWorkerCreationPrefsMemory();
+ await expect(readOrcaWorkerCreationPrefs('user-1')).resolves.toMatchObject({
+ lastAgent: 'codex', workerPermissionMode: 'auto',
+ });
+ });
+});
+
diff --git a/apps/mobile/src/__tests__/sessionMainLayerDesktopFirst.test.ts b/apps/mobile/src/__tests__/sessionMainLayerDesktopFirst.test.ts
index b7d09611f2..3620411ef2 100644
--- a/apps/mobile/src/__tests__/sessionMainLayerDesktopFirst.test.ts
+++ b/apps/mobile/src/__tests__/sessionMainLayerDesktopFirst.test.ts
@@ -84,29 +84,23 @@ describe('mobile session main layer desktop-first noise budget', () => {
expect(source).not.toContain('collaborationBanner');
});
- it('lets Lead sessions compose messages while gating write-orchestration on the write read-only reason', () => {
+ it('lets collaboration sessions operate like regular tasks on mobile', () => {
// Windows checkout 使用 CRLF;源码契约中的多行 LF 片段必须先统一行尾再比较。
const source = readFileSync(resolve(process.cwd(), 'app/sessions/[sessionId].tsx'), 'utf8')
.replace(/\r\n/g, '\n');
- // composer 能力(buildSessionOperationLayout)与 header 徽标走 composer-only reason(Lead=可发消息)。
- expect(source).toContain('const composerReadOnlyReason = useMemo(');
- expect(source).toContain('sessionCollaborationComposerReadOnlyReason(currentSession)');
- // 「会话参数未就绪」的两条理由(缓存种入 / 新建在途)**不再**进这个通道:它会把整个
- // 输入框换成只读卡片,而它们只表示还不能 enqueue。composer 保持可用,发送改走 outbox
- // 排队(见 optimisticSessionComposer.test.ts),这两条理由只留给队列行操作。
- expect(source).toContain(' readOnlyReason: composerReadOnlyReason,\n');
+ // 协同任务(Lead / Worker)不再有只读通道:输入框、队列、确认、设置、fork/rewind 与普通任务一致。
+ expect(source).not.toContain('collaborationReadOnlyReason');
+ expect(source).not.toContain('composerReadOnlyReason');
+ expect(source).not.toContain("composerSlot === 'read-only'");
+ // 「会话参数未就绪」的两条理由(缓存种入 / 新建在途)只留给队列行操作,不锁输入框。
expect(source).toContain('const queueAvailabilityReason = cacheSeededReason\n ?? pendingCreationReason');
- expect(source).toContain('const queueInlineReadOnlyReason = collaborationReadOnlyReason ?? queueAvailabilityReason');
- expect(source).toContain('const errorRecoveryReadOnlyReason = composerReadOnlyReason ?? queueAvailabilityReason');
- expect(source).toContain('readOnlyReason={composerReadOnlyReason}');
- // header notice:协作会话(可聊天的 Lead)显示协作标签而非"只读模式"。
+ expect(source).toContain('readOnlyReason={queueAvailabilityReason}');
+ // header notice:协同任务显示协同标签。
expect(source).toContain('const collaborationLabel = sessionCollaborationLabel(session);');
expect(source).toContain('if (collaborationLabel) return collaborationLabel;');
- // 写编排(设置/队列/fork-rewind/interaction)仍用写 read-only reason,不被放开。
- expect(source).toContain('readOnlyReason={collaborationReadOnlyReason}');
- expect(source).toContain('onForkMessage={collaborationReadOnlyReason || isSharedTaskPeer(deviceId) ? undefined : forkAtMessage}');
- expect(source).toContain('onPreviewRewind={collaborationReadOnlyReason || isSharedTaskPeer(deviceId) ? undefined : previewRewindAtMessage}');
+ expect(source).toContain('onForkMessage={isSharedTaskPeer(deviceId) ? undefined : forkAtMessage}');
+ expect(source).toContain('onPreviewRewind={isSharedTaskPeer(deviceId) ? undefined : previewRewindAtMessage}');
});
it('resyncs sessions from connection recovery or target availability, not every presence tick', () => {
diff --git a/apps/mobile/src/__tests__/sessionMenu.test.ts b/apps/mobile/src/__tests__/sessionMenu.test.ts
index 2860144ded..91765c5d92 100644
--- a/apps/mobile/src/__tests__/sessionMenu.test.ts
+++ b/apps/mobile/src/__tests__/sessionMenu.test.ts
@@ -50,7 +50,7 @@ describe('sessionMenu header', () => {
totalCostUsd: 99,
contextTokens: 90000,
contextWindow: 200000,
- }), {});
+ }));
expect(header.title).toBe('修复语音输入丢字');
expect(header.chips).toEqual([]);
expect(header.metaLine).toBe('Claude · xdt-maker');
@@ -58,21 +58,21 @@ describe('sessionMenu header', () => {
});
it('falls back to workspace name when the session has no title', () => {
- expect(buildSessionMenuHeader(session({ title: '' }), {}).title).toBe('xdt-maker');
- expect(buildSessionMenuHeader(session({ title: '', workingDir: null }), {}).title).toBe('远程任务');
+ expect(buildSessionMenuHeader(session({ title: '' })).title).toBe('xdt-maker');
+ expect(buildSessionMenuHeader(session({ title: '', workingDir: null })).title).toBe('远程任务');
});
it('未起名会话显示本地化兜底,不回落工作目录名', () => {
// 哨兵若按「无标题」处理会回落 workspaceName 显示目录名,与 desktop 的
// 「未命名任务」不一致(PR #1031 review P1)。
- expect(buildSessionMenuHeader(session({ title: 'New Maker' }), {}).title).toBe('未命名任务');
+ expect(buildSessionMenuHeader(session({ title: 'New Maker' })).title).toBe('未命名任务');
});
it('prefers the worktree name in the meta line', () => {
const header = buildSessionMenuHeader(session({
agentKind: 'codex',
worktreePath: '/repo/.xdt-worktrees/voice-fix',
- }), {});
+ }));
expect(header.metaLine).toBe('Codex · worktree voice-fix');
});
@@ -81,13 +81,13 @@ describe('sessionMenu header', () => {
pinnedAt: '2026-01-02T00:00:00.000Z',
status: 'archived',
orcaRole: 'lead',
- }), { readOnlyReason: '协作只读' });
- expect(header.chips.map((chip) => chip.id)).toEqual(['pinned', 'archived', 'readonly', 'collab']);
- expect(header.chips[3]?.label).toBe('协同 Lead');
+ }));
+ expect(header.chips.map((chip) => chip.id)).toEqual(['pinned', 'archived', 'collab']);
+ expect(header.chips[2]?.label).toBe('协同 Lead');
});
it('hides the usage summary when no cost and no context data exist', () => {
- expect(buildSessionMenuHeader(session(), {}).usageSummary).toBeNull();
+ expect(buildSessionMenuHeader(session()).usageSummary).toBeNull();
});
});
diff --git a/apps/mobile/src/__tests__/useOrcaTeam.test.tsx b/apps/mobile/src/__tests__/useOrcaTeam.test.tsx
new file mode 100644
index 0000000000..bb87ea5c0e
--- /dev/null
+++ b/apps/mobile/src/__tests__/useOrcaTeam.test.tsx
@@ -0,0 +1,142 @@
+// @vitest-environment jsdom
+import { act } from 'react';
+import { createRoot, type Root } from 'react-dom/client';
+import { afterEach, beforeEach, expect, it, vi } from 'vitest';
+import type { MobileMakerTransport } from '@/device-link/mobileMakerTransport';
+
+const pushListeners = new Set<(deviceId: string, leadSessionId: string) => void>();
+
+vi.mock('react-native', () => ({ Alert: { alert: vi.fn() } }));
+vi.mock('@/device-link/DeviceLinkContext', () => ({
+ subscribeRemoteOrcaWorkerChanged: (listener: (deviceId: string, leadSessionId: string) => void) => {
+ pushListeners.add(listener);
+ return () => pushListeners.delete(listener);
+ },
+}));
+vi.mock('@/session/ContextSheetCollabView', () => ({ canSubmitOrcaWorkerForm: () => true }));
+vi.mock('@/session/fullAccessConfirmation', () => ({ confirmFullAccessChange: async () => true }));
+vi.mock('@/session/remoteSessionStore', () => ({ remoteSessionStore: { applySessionPatch: vi.fn() } }));
+
+const { useOrcaTeam } = await import('@/session/useSessionOrcaCollab');
+
+let root: Root;
+let host: HTMLDivElement;
+let latest: ReturnType<typeof useOrcaTeam> | null = null;
+
+function Probe(props: { maker: MobileMakerTransport; leadSessionId: string | null }) {
+ latest = useOrcaTeam({ maker: props.maker, deviceId: 'dev-1', leadSessionId: props.leadSessionId });
+ return null;
+}
+
+function fakeMaker(listWorkers: ReturnType<typeof vi.fn>): MobileMakerTransport {
+ return {
+ orca: {
+ listWorkers,
+ getCollaborationSettings: vi.fn(async () => ({ workerSoftLimit: 2, workerHardLimit: 4 })),
+ },
+ } as unknown as MobileMakerTransport;
+}
+
+beforeEach(() => {
+ Object.assign(globalThis, { IS_REACT_ACT_ENVIRONMENT: true });
+ pushListeners.clear();
+ latest = null;
+ host = document.createElement('div');
+ root = createRoot(host);
+});
+afterEach(() => act(() => root.unmount()));
+
+it('loads the Lead team and refreshes only on worker-changed pushes for that Lead and device', async () => {
+ const listWorkers = vi.fn(async () => [{ id: 'w-1', sessionId: 's-1', status: 'running' }]);
+ const maker = fakeMaker(listWorkers);
+ await act(async () => root.render(<Probe maker={maker} leadSessionId="lead-1" />));
+ expect(listWorkers).toHaveBeenCalledTimes(1);
+ expect(latest?.workers.map((worker) => worker.workerId)).toEqual(['w-1']);
+ expect(latest?.settings?.workerHardLimit).toBe(4);
+
+ await act(async () => {
+ for (const listener of pushListeners) listener('dev-1', 'other-lead');
+ for (const listener of pushListeners) listener('dev-2', 'lead-1');
+ });
+ expect(listWorkers).toHaveBeenCalledTimes(1);
+
+ await act(async () => {
+ for (const listener of pushListeners) listener('dev-1', 'lead-1');
+ });
+ expect(listWorkers).toHaveBeenCalledTimes(2);
+});
+
+it('does not load or subscribe for non-Lead tasks', async () => {
+ const listWorkers = vi.fn(async () => []);
+ await act(async () => root.render(<Probe maker={fakeMaker(listWorkers)} leadSessionId={null} />));
+ expect(listWorkers).not.toHaveBeenCalled();
+ expect(pushListeners.size).toBe(0);
+ expect(latest?.workers).toEqual([]);
+});
+
+it('surfaces load failures without dropping the last known list', async () => {
+ const listWorkers = vi.fn()
+ .mockResolvedValueOnce([{ id: 'w-1', sessionId: 's-1' }])
+ .mockRejectedValueOnce(new Error('[NOT_CONNECTED] offline'));
+ await act(async () => root.render(<Probe maker={fakeMaker(listWorkers)} leadSessionId="lead-1" />));
+ await act(async () => { await latest?.refresh(); });
+ expect(latest?.workers.map((worker) => worker.workerId)).toEqual(['w-1']);
+ expect(latest?.error).toBeTruthy();
+});
+
+it('looks up the Worker Lead again after reconnecting when the first lookup failed', async () => {
+ const { useOrcaWorkerLeadSessionId } = await import('@/session/useSessionOrcaCollab');
+ const getTeamByWorkerSession = vi.fn()
+ .mockRejectedValueOnce(new Error('[DEVICE_OFFLINE] offline'))
+ .mockResolvedValueOnce({ leadSessionId: 'lead-9' });
+ const maker = { orca: { getTeamByWorkerSession } } as unknown as MobileMakerTransport;
+ let lead: string | null = null;
+ function WorkerProbe({ epoch }: { epoch: number }) {
+ lead = useOrcaWorkerLeadSessionId({ maker, workerSessionId: 'worker-1', connectionEpoch: epoch });
+ return null;
+ }
+ await act(async () => root.render(<WorkerProbe epoch={1} />));
+ expect(lead).toBeNull();
+ await act(async () => root.render(<WorkerProbe epoch={2} />));
+ expect(lead).toBe('lead-9');
+ expect(getTeamByWorkerSession).toHaveBeenCalledTimes(2);
+});
+
+it('reloads the team after reconnecting, since pushes may have been missed', async () => {
+ const listWorkers = vi.fn(async () => []);
+ const maker = fakeMaker(listWorkers);
+ function EpochProbe({ epoch }: { epoch: number }) {
+ latest = useOrcaTeam({ maker, deviceId: 'dev-1', leadSessionId: 'lead-1', connectionEpoch: epoch });
+ return null;
+ }
+ await act(async () => root.render(<EpochProbe epoch={1} />));
+ expect(listWorkers).toHaveBeenCalledTimes(1);
+ await act(async () => root.render(<EpochProbe epoch={1} />));
+ expect(listWorkers).toHaveBeenCalledTimes(1);
+ await act(async () => root.render(<EpochProbe epoch={2} />));
+ expect(listWorkers).toHaveBeenCalledTimes(2);
+});
+
+it('keeps the last collaboration limits when a later settings read fails', async () => {
+ const listWorkers = vi.fn(async () => []);
+ const getCollaborationSettings = vi.fn()
+ .mockResolvedValueOnce({ workerSoftLimit: 6, workerHardLimit: 10 })
+ .mockRejectedValueOnce(new Error('[INVOKE_TIMEOUT] timed out'));
+ const maker = { orca: { listWorkers, getCollaborationSettings } } as unknown as MobileMakerTransport;
+ await act(async () => root.render(<Probe maker={maker} leadSessionId="lead-1" />));
+ expect(latest?.settings?.workerHardLimit).toBe(10);
+ await act(async () => { await latest!.refresh(); });
+ // 不用默认 5/8 冒充被控端的权威上限。
+ expect(latest?.settings?.workerHardLimit).toBe(10);
+});
+
+it('leaves limits unknown instead of assuming defaults when they were never read', async () => {
+ const maker = {
+ orca: {
+ listWorkers: vi.fn(async () => []),
+ getCollaborationSettings: vi.fn(async () => { throw new Error('[INVOKE_TIMEOUT] timed out'); }),
+ },
+ } as unknown as MobileMakerTransport;
+ await act(async () => root.render(<Probe maker={maker} leadSessionId="lead-1" />));
+ expect(latest?.settings).toBeNull();
+});
diff --git a/apps/mobile/src/__tests__/useOrcaWorkerForm.test.tsx b/apps/mobile/src/__tests__/useOrcaWorkerForm.test.tsx
new file mode 100644
index 0000000000..50cd3cc77e
--- /dev/null
+++ b/apps/mobile/src/__tests__/useOrcaWorkerForm.test.tsx
@@ -0,0 +1,440 @@
+// @vitest-environment jsdom
+import { act } from 'react';
+import { createRoot, type Root } from 'react-dom/client';
+import { afterEach, beforeEach, expect, it, vi } from 'vitest';
+import type { MobileMakerTransport } from '@/device-link/mobileMakerTransport';
+
+const storage = new Map<string, string>();
+vi.mock('@react-native-async-storage/async-storage', () => ({
+ default: {
+ getItem: vi.fn(async (key: string) => storage.get(key) ?? null),
+ setItem: vi.fn(async (key: string, value: string) => { storage.set(key, value); }),
+ },
+}));
+vi.mock('react-native', () => ({ Alert: { alert: vi.fn() } }));
+vi.mock('@/device-link/DeviceLinkContext', () => ({ subscribeRemoteOrcaWorkerChanged: () => () => undefined }));
+vi.mock('@/session/ContextSheetCollabView', () => ({
+ canSubmitOrcaWorkerForm: () => true,
+ isPredefinedOrcaRole: (role: string) => ['developer', 'designer', 'reviewer', 'tester', 'merger'].includes(role),
+}));
+vi.mock('@/session/fullAccessConfirmation', () => ({ confirmFullAccessChange: async () => true }));
+vi.mock('@/session/remoteSessionStore', () => ({ remoteSessionStore: { applySessionPatch: vi.fn() } }));
+
+const { useOrcaWorkerForm } = await import('@/session/useSessionOrcaCollab');
+const { resetOrcaWorkerCreationPrefsMemory, saveOrcaWorkerCreationPrefs, defaultOrcaWorkerCreationPrefs } =
+ await import('@/session/orcaWorkerPrefs');
+
+let root: Root;
+let latest: ReturnType<typeof useOrcaWorkerForm> | null = null;
+
+function Probe({ maker }: { maker: MobileMakerTransport }) {
+ latest = useOrcaWorkerForm({ maker, prefsScope: 'user-1', active: false, setSheetOpen: () => undefined });
+ return null;
+}
+
+const model = (id: string, efforts = ['low', 'high']) => ({
+ id, label: id, efforts, effortDisplayNames: {}, defaultEffort: efforts[0] ?? null, supportsFastMode: true,
+});
+
+function fakeMaker(): MobileMakerTransport {
+ return {
+ listAvailableAgents: vi.fn(async () => ['claude-code', 'codex', 'pi']),
+ getCapabilities: vi.fn(async (agent: string) => ({
+ hasFastMode: true,
+ availableModels: agent === 'pi' ? [model('pi-model')] : [model('codex/gpt-5.5'), model('claude-opus-4-7')],
+ })),
+ } as unknown as MobileMakerTransport;
+}
+
+const flush = async () => { for (let i = 0; i < 4; i += 1) await Promise.resolve(); };
+
+beforeEach(() => {
+ Object.assign(globalThis, { IS_REACT_ACT_ENVIRONMENT: true });
+ storage.clear();
+ resetOrcaWorkerCreationPrefsMemory();
+ latest = null;
+ root = createRoot(document.createElement('div'));
+});
+afterEach(() => act(() => root.unmount()));
+
+it('restores the last Agent and its remembered model, and drops models the computer cannot run', async () => {
+ saveOrcaWorkerCreationPrefs('user-1', {
+ ...defaultOrcaWorkerCreationPrefs(),
+ lastAgent: 'pi',
+ workerPermissionMode: 'auto',
+ agents: { ...defaultOrcaWorkerCreationPrefs().agents, pi: { model: 'retired', effort: 'high', fast: false } },
+ });
+ resetOrcaWorkerCreationPrefsMemory();
+ await act(async () => root.render(<Probe maker={fakeMaker()} />));
+ await act(async () => { latest!.reset(); await flush(); });
+ expect(latest!.form.agent).toBe('pi');
+ expect(latest!.form.permissionMode).toBe('auto');
+ // 记住的模型在这台电脑上已下线 → 回落「默认」,交给电脑端解析。
+ expect(latest!.form.model).toBeNull();
+
+ await act(async () => { latest!.changeAgent('codex'); await flush(); });
+ expect(latest!.form.model).toEqual({ id: 'codex/gpt-5.5', providerId: null, effort: 'high', fast: false });
+});
+
+it('remembers the submitted choice for next time', async () => {
+ await act(async () => root.render(<Probe maker={fakeMaker()} />));
+ await act(async () => { latest!.reset(); await flush(); });
+ await act(async () => {
+ latest!.remember({
+ ...latest!.form,
+ agent: 'claude-code',
+ model: { id: 'claude-opus-4-7', providerId: 'anthropic', effort: 'low', fast: true },
+ permissionMode: 'auto',
+ initialTask: 'not remembered',
+ });
+ });
+ resetOrcaWorkerCreationPrefsMemory();
+ await act(async () => { latest!.reset(); await flush(); });
+ expect(latest!.form).toEqual({
+ role: 'developer',
+ agent: 'claude-code',
+ model: { id: 'claude-opus-4-7', providerId: null, effort: 'low', fast: true },
+ permissionMode: 'auto',
+ initialTask: '',
+ });
+});
+
+it('never lets a late memory read overwrite a permission the user already chose', async () => {
+ saveOrcaWorkerCreationPrefs('user-1', { ...defaultOrcaWorkerCreationPrefs(), workerPermissionMode: 'bypassPermissions' });
+ resetOrcaWorkerCreationPrefsMemory();
+ // 预读还没完成就打开表单并立刻改成「自动审批」。
+ await act(async () => root.render(<Probe maker={fakeMaker()} />));
+ act(() => { latest!.reset(); });
+ await act(async () => { await latest!.changePermission('auto'); });
+ await act(async () => { await flush(); });
+ expect(latest!.form.permissionMode).toBe('auto');
+});
+
+it('opens a Worker on tap and keeps the long-press action menu within three buttons for Android', async () => {
+ const { Alert } = await import('react-native');
+ const { useSessionOrcaCollab } = await import('@/session/useSessionOrcaCollab');
+ let collab: ReturnType<typeof useSessionOrcaCollab> | null = null;
+ const maker = {
+ ...fakeMaker(),
+ orca: {
+ listWorkers: vi.fn(async () => []),
+ getCollaborationSettings: vi.fn(async () => ({})),
+ getTeamByWorkerSession: vi.fn(async () => null),
+ },
+ } as unknown as MobileMakerTransport;
+ function Host() {
+ collab = useSessionOrcaCollab({
+ maker, deviceId: 'dev-1', sessionId: 'lead-1', prefsScope: 'user-1', enabled: true,
+ session: { id: 'lead-1', orcaRole: 'lead', workspaceKind: 'project', workingDir: '/repo', agentKind: 'codex' } as never,
+ sheetView: null, sheetOpen: false, setSheetView: () => undefined, setSheetOpen: () => undefined, openSession,
+ });
+ return null;
+ }
+ const openSession = vi.fn();
+ await act(async () => root.render(<Host />));
+ const alert = vi.mocked(Alert.alert);
+ const worker = { workerId: 'w-1', sessionId: 's-1', role: 'developer', label: null, status: 'idle' as const, focused: false, agentKind: 'codex' as const, model: null, effort: null, title: null };
+ // 点按直接进入 Worker,不弹窗。
+ const alertsBefore = alert.mock.calls.length;
+ act(() => collab!.openWorker(worker));
+ expect(openSession).toHaveBeenCalledWith('s-1');
+ expect(alert.mock.calls.length).toBe(alertsBefore);
+ // 长按才弹管理操作,单层且不超过三个按钮。
+ act(() => collab!.showWorkerActions(worker));
+ expect(alert.mock.calls.at(-1)![2]!.length).toBeLessThanOrEqual(3);
+ act(() => collab!.showWorkerActions({ ...worker, focused: true }));
+ expect(alert.mock.calls.at(-1)![2]!.length).toBeLessThanOrEqual(3);
+});
+
+it('moves an untouched form off an Agent the computer does not have', async () => {
+ const maker = { ...fakeMaker(), listAvailableAgents: vi.fn(async () => ['claude-code']) } as unknown as MobileMakerTransport;
+ function ActiveProbe() {
+ latest = useOrcaWorkerForm({ maker, prefsScope: 'user-1', active: true, setSheetOpen: () => undefined });
+ return null;
+ }
+ await act(async () => root.render(<ActiveProbe />));
+ act(() => { latest!.reset(); });
+ await act(async () => { await flush(); });
+ expect(latest!.agents).toEqual(['claude-code']);
+ expect(latest!.form.agent).toBe('claude-code');
+ expect(latest!.form.model?.id).toBe('claude-opus-4-7');
+});
+
+it('reopens a confirmed draft with the role mode that matches its saved role', async () => {
+ await act(async () => root.render(<Probe maker={fakeMaker()} />));
+ await act(async () => { latest!.reset(); await flush(); });
+ const saved = { ...latest!.form, role: 'developer' };
+ // 上次打开时切到了「自定义」但没提交就关掉。
+ await act(async () => { latest!.setCustomRoleMode(true); });
+ await act(async () => { latest!.restore(saved); await flush(); });
+ expect(latest!.customRoleMode).toBe(false);
+ expect(latest!.form.role).toBe('developer');
+
+ await act(async () => { latest!.restore({ ...saved, role: 'Security Auditor' }); await flush(); });
+ expect(latest!.customRoleMode).toBe(true);
+});
+
+it('drops a memory read that lands after switching to another account', async () => {
+ saveOrcaWorkerCreationPrefs('user-1', { ...defaultOrcaWorkerCreationPrefs(), lastAgent: 'pi', workerPermissionMode: 'auto' });
+ resetOrcaWorkerCreationPrefsMemory();
+ const maker = fakeMaker();
+ function ScopedProbe({ scope }: { scope: string }) {
+ latest = useOrcaWorkerForm({ maker, prefsScope: scope, active: false, setSheetOpen: () => undefined });
+ return null;
+ }
+ // 账号 A 的记忆还在读取中就打开表单,随后切到账号 B。
+ act(() => root.render(<ScopedProbe scope="user-1" />));
+ act(() => { latest!.reset(); });
+ act(() => root.render(<ScopedProbe scope="user-2" />));
+ await act(async () => { await flush(); });
+ expect(latest!.form.agent).toBe('codex');
+ expect(latest!.form.permissionMode).toBe('bypassPermissions');
+});
+
+it('moves off an unavailable Agent even after unrelated edits, keeping those edits', async () => {
+ let resolveAgents: (agents: string[]) => void = () => undefined;
+ const maker = {
+ ...fakeMaker(),
+ listAvailableAgents: vi.fn(() => new Promise<string[]>((resolve) => { resolveAgents = resolve; })),
+ } as unknown as MobileMakerTransport;
+ function ActiveProbe() {
+ latest = useOrcaWorkerForm({ maker, prefsScope: 'user-1', active: true, setSheetOpen: () => undefined });
+ return null;
+ }
+ await act(async () => root.render(<ActiveProbe />));
+ act(() => { latest!.reset(); });
+ // Agent 列表还没回来,用户先改了角色和初始任务。
+ act(() => { latest!.patch({ role: 'reviewer', initialTask: 'check tests' }); });
+ await act(async () => { resolveAgents(['claude-code']); await flush(); });
+ expect(latest!.form.agent).toBe('claude-code');
+ expect(latest!.form.role).toBe('reviewer');
+ expect(latest!.form.initialTask).toBe('check tests');
+});
+
+it('rereads Agents and model capabilities on an open form after reconnecting', async () => {
+ saveOrcaWorkerCreationPrefs('user-1', {
+ ...defaultOrcaWorkerCreationPrefs(),
+ agents: { ...defaultOrcaWorkerCreationPrefs().agents, codex: { model: 'retired', effort: 'high', fast: false } },
+ });
+ const base = fakeMaker();
+ let online = false;
+ const maker = {
+ listAvailableAgents: vi.fn(async () => {
+ if (!online) throw new Error('[DEVICE_OFFLINE] offline');
+ return base.listAvailableAgents();
+ }),
+ getCapabilities: vi.fn(async (agent: string) => {
+ if (!online) throw new Error('[DEVICE_OFFLINE] offline');
+ return base.getCapabilities(agent as never);
+ }),
+ } as unknown as MobileMakerTransport;
+ function EpochProbe({ epoch }: { epoch: number }) {
+ latest = useOrcaWorkerForm({ maker, prefsScope: 'user-1', active: true, setSheetOpen: () => undefined, connectionEpoch: epoch });
+ return null;
+ }
+ await act(async () => root.render(<EpochProbe epoch={1} />));
+ await act(async () => { latest!.reset(); await flush(); });
+ expect(latest!.form.model?.id).toBe('retired');
+ online = true;
+ await act(async () => { root.render(<EpochProbe epoch={2} />); await flush(); });
+ // 记住的模型在这台电脑上已下线 → 重连后收敛为「默认」。
+ expect(latest!.form.model).toBeNull();
+});
+
+it('still restores remembered choices when the Agent list lands before the memory read', async () => {
+ const AsyncStorage = (await import('@react-native-async-storage/async-storage')).default;
+ saveOrcaWorkerCreationPrefs('user-1', { ...defaultOrcaWorkerCreationPrefs(), workerPermissionMode: 'auto' });
+ resetOrcaWorkerCreationPrefsMemory();
+ const releases: Array<() => void> = [];
+ vi.mocked(AsyncStorage.getItem).mockImplementation((key: string) => new Promise((resolve) => {
+ releases.push(() => resolve(storage.get(key) ?? null));
+ }));
+ const base = fakeMaker();
+ let releaseAgents: () => void = () => undefined;
+ const maker = {
+ ...base,
+ listAvailableAgents: vi.fn(() => new Promise<string[]>((resolve) => {
+ releaseAgents = () => resolve(['claude-code', 'codex', 'pi']);
+ })),
+ } as unknown as MobileMakerTransport;
+ try {
+ function ActiveProbe() {
+ latest = useOrcaWorkerForm({ maker, prefsScope: 'user-1', active: true, setSheetOpen: () => undefined });
+ return null;
+ }
+ await act(async () => root.render(<ActiveProbe />));
+ act(() => { latest!.reset(); });
+ // Agent 列表(非用户事件)先回来,记忆读取随后才完成。
+ await act(async () => { releaseAgents(); await flush(); });
+ expect(latest!.form.permissionMode).toBe('bypassPermissions');
+ await act(async () => { for (const release of releases) release(); await flush(); });
+ expect(latest!.form.permissionMode).toBe('auto');
+ } finally {
+ vi.mocked(AsyncStorage.getItem).mockImplementation(async (key: string) => storage.get(key) ?? null);
+ }
+});
+
+it('treats a timed-out Worker archive as unconfirmed and rechecks the team', async () => {
+ const { Alert } = await import('react-native');
+ const { useSessionOrcaCollab } = await import('@/session/useSessionOrcaCollab');
+ let collab: ReturnType<typeof useSessionOrcaCollab> | null = null;
+ const listWorkers = vi.fn(async () => []);
+ const maker = {
+ ...fakeMaker(),
+ orca: {
+ listWorkers,
+ getCollaborationSettings: vi.fn(async () => ({})),
+ getTeamByWorkerSession: vi.fn(async () => null),
+ archiveWorker: vi.fn(async () => { throw new Error('[INVOKE_TIMEOUT] timed out'); }),
+ },
+ } as unknown as MobileMakerTransport;
+ function Host() {
+ collab = useSessionOrcaCollab({
+ maker, deviceId: 'dev-1', sessionId: 'lead-1', prefsScope: 'user-1', enabled: true,
+ session: { id: 'lead-1', orcaRole: 'lead', workspaceKind: 'project', workingDir: '/repo', agentKind: 'codex' } as never,
+ sheetView: null, sheetOpen: false, setSheetView: () => undefined, setSheetOpen: () => undefined, openSession: () => undefined,
+ });
+ return null;
+ }
+ await act(async () => root.render(<Host />));
+ const loads = listWorkers.mock.calls.length;
+ const worker = { workerId: 'w-1', sessionId: 's-1', role: 'developer', label: null, status: 'idle' as const, focused: false, agentKind: 'codex' as const, model: null, effort: null, title: null };
+ act(() => collab!.showWorkerActions({ ...worker, focused: true }));
+ act(() => vi.mocked(Alert.alert).mock.calls.at(-1)![2]!.find((button) => button.style === 'destructive')!.onPress?.());
+ const confirm = vi.mocked(Alert.alert).mock.calls.at(-1)![2]!.find((button) => button.style === 'destructive')!;
+ await act(async () => { confirm.onPress?.(); await flush(); });
+ expect(collab!.error).toMatch(/timed out|超时/);
+ expect(listWorkers.mock.calls.length).toBeGreaterThan(loads);
+});
+
+it('restores the remembered Agent after a device switch instead of the previous computer fallback', async () => {
+ saveOrcaWorkerCreationPrefs('user-1', { ...defaultOrcaWorkerCreationPrefs(), lastAgent: 'claude-code' });
+ const codexOnly = { ...fakeMaker(), listAvailableAgents: vi.fn(async () => ['codex']) } as unknown as MobileMakerTransport;
+ let releaseB: () => void = () => undefined;
+ const both = {
+ ...fakeMaker(),
+ listAvailableAgents: vi.fn(() => new Promise<string[]>((resolve) => {
+ releaseB = () => resolve(['claude-code', 'codex']);
+ })),
+ } as unknown as MobileMakerTransport;
+ function DeviceProbe({ maker }: { maker: MobileMakerTransport }) {
+ latest = useOrcaWorkerForm({ maker, prefsScope: 'user-1', active: true, setSheetOpen: () => undefined });
+ return null;
+ }
+ // 电脑 A 只有 Codex:打开表单落在 Codex。
+ await act(async () => root.render(<DeviceProbe maker={codexOnly} />));
+ await act(async () => { latest!.reset(); await flush(); });
+ expect(latest!.form.agent).toBe('codex');
+ // 切到电脑 B:列表回来前复位不再沿用 A 的列表;回来后恢复记忆的 Claude。
+ await act(async () => root.render(<DeviceProbe maker={both} />));
+ await act(async () => { latest!.reset(); await flush(); });
+ expect(latest!.agents).toEqual(['claude-code', 'codex', 'pi']);
+ await act(async () => { releaseB(); await flush(); });
+ expect(latest!.form.agent).toBe('claude-code');
+});
+
+it('lets a Worker task focus itself and archive itself back to the Lead', async () => {
+ const { Alert } = await import('react-native');
+ const { useSessionOrcaCollab } = await import('@/session/useSessionOrcaCollab');
+ let collab: ReturnType<typeof useSessionOrcaCollab> | null = null;
+ const switchFocus = vi.fn(async () => ({}));
+ const archiveWorker = vi.fn(async () => ({}));
+ const maker = {
+ ...fakeMaker(),
+ orca: {
+ listWorkers: vi.fn(async () => [{ id: 'w-1', sessionId: 'worker-1', role: 'tester', focused: false }]),
+ getCollaborationSettings: vi.fn(async () => ({})),
+ getTeamByWorkerSession: vi.fn(async () => ({ leadSessionId: 'lead-1' })),
+ switchFocus,
+ archiveWorker,
+ },
+ } as unknown as MobileMakerTransport;
+ const openSession = vi.fn();
+ function Host() {
+ collab = useSessionOrcaCollab({
+ maker, deviceId: 'dev-1', sessionId: 'worker-1', prefsScope: 'user-1', enabled: true,
+ session: { id: 'worker-1', orcaRole: 'worker', workspaceKind: 'project', workingDir: '/repo', agentKind: 'pi' } as never,
+ sheetView: null, sheetOpen: false, setSheetView: () => undefined, setSheetOpen: () => undefined, openSession,
+ });
+ return null;
+ }
+ await act(async () => { root.render(<Host />); await flush(); });
+ await act(async () => { await flush(); });
+ expect(collab!.workerLeadSessionId).toBe('lead-1');
+ expect(collab!.workerSelf?.workerId).toBe('w-1');
+ await act(async () => { await collab!.setSelfFocus(); });
+ expect(switchFocus).toHaveBeenCalledWith('lead-1', 'w-1');
+ // 确认弹窗先弹出(详情面板还开着),确认后才收起面板再归档。
+ const closeMenu = vi.fn();
+ act(() => collab!.confirmArchiveSelf(closeMenu));
+ expect(closeMenu).not.toHaveBeenCalled();
+ const confirm = vi.mocked(Alert.alert).mock.calls.at(-1)![2]!.find((button) => button.style === 'destructive')!;
+ await act(async () => { confirm.onPress?.(); await flush(); });
+ expect(closeMenu).toHaveBeenCalledTimes(1);
+ expect(archiveWorker).toHaveBeenCalledWith('lead-1', 'w-1');
+ expect(openSession).toHaveBeenCalledWith('lead-1');
+});
+
+it('offers the Agent capability models as a flat fallback for computers without the provider catalog', async () => {
+ await act(async () => root.render(<Probe maker={fakeMaker()} />));
+ await act(async () => { latest!.reset(); await flush(); });
+ const options = latest!.modelPicker.flatModelOptions;
+ expect(options.map((option) => option.id)).toEqual(['codex/gpt-5.5', 'claude-opus-4-7']);
+ await act(async () => { latest!.modelPicker.selectFlatModel(options[1]!); await flush(); });
+ expect(latest!.form.model).toMatchObject({ id: 'claude-opus-4-7', providerId: null });
+});
+
+it('returns to the Lead when a timed-out self-archive is confirmed by a recheck', async () => {
+ const { Alert } = await import('react-native');
+ const { useSessionOrcaCollab } = await import('@/session/useSessionOrcaCollab');
+ let collab: ReturnType<typeof useSessionOrcaCollab> | null = null;
+ let archived = false;
+ const maker = {
+ ...fakeMaker(),
+ orca: {
+ listWorkers: vi.fn(async () => (archived ? [] : [{ id: 'w-1', sessionId: 'worker-1', role: 'tester' }])),
+ getCollaborationSettings: vi.fn(async () => ({})),
+ getTeamByWorkerSession: vi.fn(async () => ({ leadSessionId: 'lead-1' })),
+ archiveWorker: vi.fn(async () => { archived = true; throw new Error('[INVOKE_TIMEOUT] timed out'); }),
+ },
+ } as unknown as MobileMakerTransport;
+ const openSession = vi.fn();
+ function Host() {
+ collab = useSessionOrcaCollab({
+ maker, deviceId: 'dev-1', sessionId: 'worker-1', prefsScope: 'user-1', enabled: true,
+ session: { id: 'worker-1', orcaRole: 'worker', workspaceKind: 'project', workingDir: '/repo', agentKind: 'pi' } as never,
+ sheetView: null, sheetOpen: false, setSheetView: () => undefined, setSheetOpen: () => undefined, openSession,
+ });
+ return null;
+ }
+ await act(async () => { root.render(<Host />); await flush(); });
+ await act(async () => { await flush(); });
+ act(() => collab!.confirmArchiveSelf());
+ const confirm = vi.mocked(Alert.alert).mock.calls.at(-1)![2]!.find((button) => button.style === 'destructive')!;
+ await act(async () => { confirm.onPress?.(); await flush(); await flush(); });
+ expect(openSession).toHaveBeenCalledWith('lead-1');
+});
+
+it('does not let a late capability response from the previous computer fill the flat model list', async () => {
+ let releaseA: () => void = () => undefined;
+ const makerA = {
+ ...fakeMaker(),
+ getCapabilities: vi.fn(() => new Promise((resolve) => {
+ releaseA = () => resolve({ hasFastMode: true, availableModels: [model('a-only-model')] });
+ })),
+ } as unknown as MobileMakerTransport;
+ const makerB = {
+ ...fakeMaker(),
+ getCapabilities: vi.fn(async () => ({ hasFastMode: true, availableModels: [model('b-model')] })),
+ } as unknown as MobileMakerTransport;
+ function DeviceProbe({ maker }: { maker: MobileMakerTransport }) {
+ latest = useOrcaWorkerForm({ maker, prefsScope: 'user-1', active: false, setSheetOpen: () => undefined });
+ return null;
+ }
+ await act(async () => root.render(<DeviceProbe maker={makerA} />));
+ act(() => { latest!.reset(); });
+ await act(async () => root.render(<DeviceProbe maker={makerB} />));
+ await act(async () => { latest!.reset(); await flush(); });
+ await act(async () => { releaseA(); await flush(); });
+ expect(latest!.modelPicker.flatModelOptions.map((option) => option.id)).toEqual(['b-model']);
+});
diff --git a/apps/mobile/src/device-link/DeviceLinkContext.tsx b/apps/mobile/src/device-link/DeviceLinkContext.tsx
index 9e941848f1..311de594da 100644
--- a/apps/mobile/src/device-link/DeviceLinkContext.tsx
+++ b/apps/mobile/src/device-link/DeviceLinkContext.tsx
@@ -241,6 +241,17 @@ export function subscribeRemoteFavoritesChanged(listener: (deviceId: string) =>
remoteFavoritesChangedListeners.add(listener);
return () => { remoteFavoritesChangedListeners.delete(listener); };
}
+/**
+ * 被控端 `maker:orca:worker-changed`(payload `{leadSessionId}`)。只在控制端持有
+ * `session:<leadSessionId>` topic 时送达(会话页聚焦期间);收到后按 Lead 重拉 Worker 列表。
+ */
+const remoteOrcaWorkerChangedListeners = new Set<(deviceId: string, leadSessionId: string) => void>();
+export function subscribeRemoteOrcaWorkerChanged(
+ listener: (deviceId: string, leadSessionId: string) => void,
+): () => void {
+ remoteOrcaWorkerChangedListeners.add(listener);
+ return () => { remoteOrcaWorkerChangedListeners.delete(listener); };
+}
const remoteBotChangedListeners = new Set<(deviceId: string, channel: string, payload: unknown) => void>();
export function subscribeRemoteBotChanges(listener: (deviceId: string, channel: string, payload: unknown) => void): () => void {
remoteBotChangedListeners.add(listener);
@@ -1623,6 +1634,12 @@ export function routeFrame(env: Envelope, handlers: {
handlers.onAgentsChanged?.(env.src);
return;
}
+ if (push.channel === 'maker:orca:worker-changed') {
+ const leadSessionId = (push.payload as { leadSessionId?: unknown } | null)?.leadSessionId;
+ if (typeof leadSessionId !== 'string' || !leadSessionId) return;
+ for (const listener of remoteOrcaWorkerChangedListeners) listener(env.src, leadSessionId);
+ return;
+ }
if (push.channel === 'maker:bot-delegation:changed' || push.channel === 'maker:bot-direct-message:changed') {
for (const listener of remoteBotChangedListeners) listener(env.src, push.channel, push.payload);
return;
diff --git a/apps/mobile/src/device-link/mobileMakerTransport.ts b/apps/mobile/src/device-link/mobileMakerTransport.ts
index ba4037e7be..d6288f0fba 100644
--- a/apps/mobile/src/device-link/mobileMakerTransport.ts
+++ b/apps/mobile/src/device-link/mobileMakerTransport.ts
@@ -4,6 +4,7 @@ import {
releasePeerMedia,
} from "./peerFileRegistry";
import { withTransientRemoteRetry } from "./remoteRetry";
+import type { OrcaWorkerAgentKind, OrcaWorkerPermissionMode } from "@cindy/maker-shared/orca-team";
import { fetchAgentCapabilities } from "@/session/agentCapabilitiesCache";
import {
getMobileAuthOwner,
@@ -699,6 +700,24 @@ export interface MobileMakerTransport {
clientId: string,
): Promise<{ sessionId: string; clientId: string; clientIds?: string[] }>;
closeSession(sessionId: string): Promise<void>;
+ /**
+ * Orca 协同编排:Lead / Worker / team 真身在被控端,这里只是隧道封装(与桌面控制端
+ * makerTransport 的 remoteMakerApi / remoteOrcaWorkflows 同一组 channel 与参数形状)。
+ * 写操作(enable / create / archive / disable)一律不自动重试:超时不代表被控端没执行。
+ */
+ orca: {
+ /** 被控端协同插件开关(项目级 / 对话用户级);结果形状见 readOrcaCollabPolicy。 */
+ getCollabPolicy(workingDir: string | undefined, workspaceKind: 'project' | 'dialogue'): Promise<unknown>;
+ enable(leadSessionId: string, options: MobileOrcaEnableOptions): Promise<MobileOrcaEnableResult>;
+ disable(leadSessionId: string): Promise<unknown>;
+ createWorker(input: MobileOrcaCreateWorkerInput): Promise<MobileOrcaCreateWorkerResult>;
+ listWorkers(leadSessionId: string): Promise<unknown>;
+ getTeamByWorkerSession(workerSessionId: string): Promise<unknown>;
+ switchFocus(leadSessionId: string, workerIdOrLabel: string): Promise<unknown>;
+ acknowledgeDone(leadSessionId: string, workerId: string): Promise<unknown>;
+ archiveWorker(leadSessionId: string, workerId: string): Promise<unknown>;
+ getCollaborationSettings(): Promise<unknown>;
+ };
/**
* 会话未读已读回执:手机端真实展示会话内容后,清掉被控端该会话的未读态
* (灵动岛 / Dock 角标 / 桌面侧栏红绿点)。被控端清完会经 sessions relay 推回
@@ -867,6 +886,47 @@ export interface MobileMakerTransport {
};
}
+/** `maker:session:enable-orca` 的 options(与桌面 preload maker.enableOrca 同形状)。 */
+export interface MobileOrcaEnableOptions {
+ workerAgent: OrcaWorkerAgentKind;
+ role?: string;
+ label?: string;
+ model?: string;
+ effort?: string;
+ fast?: boolean;
+ providerId?: string;
+ delegateTask?: string;
+ workerPermissionMode: OrcaWorkerPermissionMode;
+}
+
+export interface MobileOrcaEnableResult {
+ teamId?: string;
+ workerSessionId?: string;
+ workerId?: string;
+ dispatched?: boolean;
+}
+
+/** `maker:worker:create` 的 body(与桌面 useOrcaWorkerSelection 提交同形状)。 */
+export interface MobileOrcaCreateWorkerInput {
+ leadSessionId: string;
+ role: string;
+ label: string;
+ agent: OrcaWorkerAgentKind;
+ model?: string;
+ effort?: string;
+ fast?: boolean;
+ providerId?: string;
+ workerPermissionMode: OrcaWorkerPermissionMode;
+ initialTask?: string;
+}
+
+export interface MobileOrcaCreateWorkerResult {
+ ok?: boolean;
+ workerId?: string;
+ workerSessionId?: string;
+ softLimitExceeded?: boolean;
+}
+
export type SessionMetaPatch = Partial<
Pick<RemoteSession, "status" | "title" | "pinnedAt">
>;
@@ -1190,6 +1250,25 @@ export function createMobileMakerTransport({
deleteMessage: (sessionId, clientId) =>
call("maker:message:delete", [sessionId, clientId]),
closeSession: (sessionId) => call("maker:close-session", [sessionId]),
+ orca: {
+ getCollabPolicy: (workingDir, workspaceKind) =>
+ call("maker:plugins:get-state", ["collab", workingDir, workspaceKind]),
+ enable: (leadSessionId, options) =>
+ call("maker:session:enable-orca", [leadSessionId, options]),
+ disable: (leadSessionId) => call("maker:session:disable-orca", [leadSessionId]),
+ createWorker: (input) => call("maker:worker:create", [input]),
+ listWorkers: (leadSessionId) =>
+ call("local-db:orca-workflows:list-workers-by-lead", [leadSessionId]),
+ getTeamByWorkerSession: (workerSessionId) =>
+ call("local-db:orca-workflows:get-by-worker-session", [workerSessionId]),
+ switchFocus: (leadSessionId, workerIdOrLabel) =>
+ call("maker:worker:switch-focus", [{ leadSessionId, workerIdOrLabel }]),
+ acknowledgeDone: (leadSessionId, workerId) =>
+ call("maker:worker:acknowledge-done", [{ leadSessionId, workerId }]),
+ archiveWorker: (leadSessionId, workerId) =>
+ call("maker:worker:archive", [{ leadSessionId, workerId }]),
+ getCollaborationSettings: () => call("maker:collaboration-settings:get"),
+ },
clearSessionAttention: (sessionId, intent) =>
call("notification:clear-session-attention", [sessionId, intent]),
goal: {
diff --git a/apps/mobile/src/i18n/locales/en/interaction.json b/apps/mobile/src/i18n/locales/en/interaction.json
index ff44dea256..74d7939a54 100644
--- a/apps/mobile/src/i18n/locales/en/interaction.json
+++ b/apps/mobile/src/i18n/locales/en/interaction.json
@@ -267,7 +267,6 @@
},
"queue": {
"count": "{{count}} requests",
- "readOnlyHint": "Collaboration is read-only; requests from the computer are shown here.",
"empty": "No pending requests",
"hint": {
"plan_review": "Review the plan and request changes if needed. The computer continues only after approval.",
diff --git a/apps/mobile/src/i18n/locales/en/message.json b/apps/mobile/src/i18n/locales/en/message.json
index 1a1dd03e2a..16a349814d 100644
--- a/apps/mobile/src/i18n/locales/en/message.json
+++ b/apps/mobile/src/i18n/locales/en/message.json
@@ -265,7 +265,7 @@
"steering": "Sending interjection",
"orcaTitle": "Collaboration queue {{index}}",
"title": "Queue {{index}}",
- "orcaReadOnly": "Collaboration messages are orchestrated on the desktop and are read-only on mobile.",
+ "orcaEditDisabled": "Collaboration messages can't be edited or sent as interjections.",
"busy": "Queue changes are syncing. Try again when syncing finishes.",
"steeringDisabled": "The interjection is being sent to the current turn. Wait for the desktop response before changing it.",
"editLocked": "This queued message is being edited. Try again when editing finishes.",
diff --git a/apps/mobile/src/i18n/locales/en/session.json b/apps/mobile/src/i18n/locales/en/session.json
index 21425a73ac..3bb35369b7 100644
--- a/apps/mobile/src/i18n/locales/en/session.json
+++ b/apps/mobile/src/i18n/locales/en/session.json
@@ -35,12 +35,7 @@
"collaboration": {
"labelLead": "Collaboration Lead",
"labelWorker": "Collaboration Worker",
- "labelRole": "Collaboration {{role}}",
- "noticeLead": "This is an Orca Lead session from your computer. You can keep chatting on your phone; create workers, change focus, fork or rewind, edit the queue, and change session settings on your computer.",
- "noticeWorker": "This is an Orca Worker session from your computer. The first mobile version is read-only and does not support sending messages, changing worker focus, archiving a worker, or stopping collaboration.",
- "noticeOther": "This is a collaboration session from your computer. The first mobile version is read-only; manage collaboration on your computer.",
- "readOnlyReason": "Collaboration is read-only on the first mobile version. Handle confirmations, queue edits, and session changes on your computer.",
- "composerReadOnlyReason": "This collaboration subtask is read-only on mobile. Send messages from your computer."
+ "labelRole": "Collaboration {{role}}"
},
"composer": {
"voice": {
@@ -257,7 +252,6 @@
"resync": "Resync remote session",
"collapseHistory": "Collapse history",
"expandHistory": "View history",
- "readOnlyMode": "Read-only",
"accessRevokedShort": "Access revoked",
"sessionNotSynced": "Session not synced",
"conversationFallback": "Session",
@@ -373,7 +367,6 @@
"details": "Session details",
"chipPinned": "Pinned",
"chipArchived": "Archived",
- "chipReadOnly": "Read-only",
"titleFallback": "Remote session",
"unnamedTitle": "Untitled session",
"renameAction": "Rename Session",
@@ -548,5 +541,85 @@
"REMOTE_PROVIDER_UPDATING": "This model provider’s credentials are updating. Try again in a moment.",
"REMOTE_WORKDIR_UNAVAILABLE": "The remote working directory is unavailable. Check that the folder still exists on that computer, then try again.",
"REMOTE_OPTIMISTIC_SESSION_STATE_UNAVAILABLE": "The computer cannot yet confirm whether this message was sent. Wait a moment and try again. Do not send the same message twice."
+ },
+ "collab": {
+ "modeLabel": "Collaboration mode",
+ "enabled": "On",
+ "title": "Collaboration",
+ "enableTitle": "Start collaboration",
+ "enableSubmit": "Start collaboration",
+ "createWorkerTitle": "New Worker",
+ "createWorkerSubmit": "Create Worker",
+ "roleLabel": "Role name",
+ "roleHint": "Just a name to tell collaborators apart. It doesn't change capabilities.",
+ "customRole": "Custom",
+ "customRolePlaceholder": "Custom role name",
+ "customRolePredefinedError": "A custom role name can't match a preset role",
+ "agentLabel": "Agent",
+ "modelLabel": "Model",
+ "modelDefault": "Default",
+ "modelDefaultHint": "Uses the computer's default Worker model",
+ "permissionLabel": "Permission mode",
+ "permissionAuto": "Auto-review",
+ "permissionFull": "Full access",
+ "permissionAutoHint": "Reads and writes inside the workspace and auto-reviews elevation requests. High-risk actions may be denied or need confirmation.",
+ "permissionFullHint": "Can change any file and run networked commands without asking again. Highest risk; use only for trusted tasks.",
+ "initialTaskLabel": "Initial task (optional)",
+ "initialTaskPlaceholder": "An optional first task for this Worker",
+ "workerCountSummary_one": "{{count}} Worker · {{running}} running",
+ "workerCountSummary_other": "{{count}} Workers · {{running}} running",
+ "loading": "Loading Workers…",
+ "noWorkers": "No Workers yet",
+ "focused": "Focused",
+ "manageGroup": "Manage",
+ "hardLimitHint": "Hard limit of {{limit}} reached · Archive a Worker to create more",
+ "softLimitHint": "Over the soft limit of {{limit}} · More Workers use more memory",
+ "limitSummary": "Soft limit {{soft}} Workers, hard limit {{hard}}. Change collaboration settings on your computer.",
+ "stop": "End collaboration",
+ "stopConfirmTitle": "End collaboration?",
+ "stopConfirmDesc": "Worker sessions will be destroyed. Any running task stops immediately and its results are lost. End collaboration?",
+ "cancel": "Cancel",
+ "archive": "Archive",
+ "archiveConfirm": "Archive Worker",
+ "archiveConfirmTitle": "Archive Worker {{name}}?",
+ "archiveConfirmDesc": "This stops its session. History is kept as archived. Archived Workers can't be restored; create a new Worker to continue.",
+ "setFocus": "Set as focus",
+ "backToLead": "Back to Lead",
+ "loadingHint": "Checking collaboration settings…",
+ "disabledHint": "Collaboration mode is off. Turn it back on in Settings on your computer.",
+ "unavailableHint": "Couldn't check collaboration settings. Try again later.",
+ "barLead_one": "Collaboration · {{count}} Worker · {{running}} running",
+ "barLead_other": "Collaboration · {{count}} Workers · {{running}} running",
+ "barWorker": "Collaboration Worker · Back to Lead",
+ "draftChip": "Collab",
+ "draftSummary": "First Worker: {{role}} · {{agent}}",
+ "draftSubmit": "Done",
+ "draftRemove": "Don't start collaboration",
+ "startFailedContinue": "Couldn't start collaboration. Continuing as a single task. {{reason}}",
+ "status": {
+ "idle": "Idle",
+ "running": "Running",
+ "done": "Done",
+ "error": "Error"
+ },
+ "errors": {
+ "unsupported": "The computer's version is too old for collaboration",
+ "loadFailed": "Couldn't load Workers.",
+ "startFailed": "Couldn't start collaboration.",
+ "createFailed": "Couldn't create the Worker.",
+ "archiveFailed": "Couldn't archive the Worker.",
+ "switchFailed": "Couldn't switch focus.",
+ "stopFailed": "Couldn't end collaboration.",
+ "WORKER_LIMIT_HARD_EXCEEDED": "The Worker hard limit is reached. Archive a Worker first.",
+ "NO_PROVIDER_FOR_AGENT": "The computer has no model provider connected for this Agent. Connect one on the computer and try again.",
+ "PROVIDER_ROUTE_UNAVAILABLE": "The selected model and provider route isn't available on the computer. Choose an available model and try again.",
+ "BUDGET_MODEL_REQUIRES_API_MODE": "The computer hasn't set up the API key this Codex model needs. Set it up on the computer and try again.",
+ "INVALID_PARAMS": "The computer doesn't support the selected model or collaboration settings. Choose a supported model and try again.",
+ "PRECONDITION_FAILED": "Collaboration mode is off, or this task doesn't support collaboration.",
+ "WORKER_CREATION_IN_PROGRESS": "A Worker with the same name is being created. Try again shortly.",
+ "WORKER_NOT_FOUND": "This Worker no longer exists. The list was refreshed.",
+ "ORCA_CREATE_UNCONFIRMED": "Creating the Worker timed out and couldn't be confirmed. Check the Worker list first, and retry only if no new Worker appears.",
+ "ORCA_ACTION_UNCONFIRMED": "The request timed out, so the result isn't confirmed yet. The list has been refreshed; go by what it shows now."
+ }
}
}
diff --git a/apps/mobile/src/i18n/locales/ja/interaction.json b/apps/mobile/src/i18n/locales/ja/interaction.json
index fcf93e899a..af8457ac82 100644
--- a/apps/mobile/src/i18n/locales/ja/interaction.json
+++ b/apps/mobile/src/i18n/locales/ja/interaction.json
@@ -267,7 +267,6 @@
},
"queue": {
"count": "{{count}} 件",
- "readOnlyHint": "コラボレーションは読み取り専用です。コンピューターからのリクエストだけを表示します。",
"empty": "保留中のリクエストはありません",
"hint": {
"plan_review": "計画を確認し、必要なら修正を依頼してください。承認後にコンピューターで実行を続けます。",
diff --git a/apps/mobile/src/i18n/locales/ja/message.json b/apps/mobile/src/i18n/locales/ja/message.json
index 2a89fc4418..e32d631f5f 100644
--- a/apps/mobile/src/i18n/locales/ja/message.json
+++ b/apps/mobile/src/i18n/locales/ja/message.json
@@ -265,7 +265,7 @@
"steering": "割り込み送信中",
"orcaTitle": "コラボレーションキュー {{index}}",
"title": "キュー {{index}}",
- "orcaReadOnly": "コラボレーションメッセージはデスクトップで編成され、モバイルでは読み取り専用です。",
+ "orcaEditDisabled": "コラボレーションメッセージは編集や割り込み送信ができません。",
"busy": "キュー操作を同期中です。完了後にもう一度操作してください。",
"steeringDisabled": "現在の turn に割り込みを送信中です。デスクトップから戻るまでお待ちください。",
"editLocked": "このキューメッセージは編集中です。完了後に操作してください。",
diff --git a/apps/mobile/src/i18n/locales/ja/session.json b/apps/mobile/src/i18n/locales/ja/session.json
index 8db18c1706..1e1420a1cb 100644
--- a/apps/mobile/src/i18n/locales/ja/session.json
+++ b/apps/mobile/src/i18n/locales/ja/session.json
@@ -35,12 +35,7 @@
"collaboration": {
"labelLead": "コラボレーション Lead",
"labelWorker": "コラボレーション Worker",
- "labelRole": "コラボレーション {{role}}",
- "noticeLead": "これはコンピューター側の Orca Lead セッションです。スマートフォンからメッセージを続けて送れます。Worker の作成、フォーカスの変更、Fork/Rewind、キューの編集、セッション設定の変更はコンピューターで行ってください。",
- "noticeWorker": "これはコンピューター側の Orca Worker セッションです。モバイル版の初期バージョンは読み取り専用で、メッセージ送信、Worker フォーカスの変更、Worker のアーカイブ、コラボレーションの停止には対応していません。",
- "noticeOther": "これはコンピューター側のコラボレーションセッションです。モバイル版の初期バージョンは読み取り専用です。コラボレーションの管理はコンピューターで行ってください。",
- "readOnlyReason": "モバイル版の初期バージョンではコラボレーションは読み取り専用です。確認、キュー編集、セッション変更はコンピューターで行ってください。",
- "composerReadOnlyReason": "このコラボレーションのサブタスクはモバイルでは読み取り専用です。メッセージはコンピューターから送信してください。"
+ "labelRole": "コラボレーション {{role}}"
},
"composer": {
"voice": {
@@ -257,7 +252,6 @@
"resync": "リモートセッションを再同期",
"collapseHistory": "履歴を折りたたむ",
"expandHistory": "履歴を表示",
- "readOnlyMode": "読み取り専用",
"accessRevokedShort": "アクセスは取り消されました",
"sessionNotSynced": "セッション未同期",
"conversationFallback": "セッション",
@@ -373,7 +367,6 @@
"details": "セッションの詳細",
"chipPinned": "ピン留め済み",
"chipArchived": "アーカイブ済み",
- "chipReadOnly": "読み取り専用",
"titleFallback": "リモートセッション",
"unnamedTitle": "名称未設定のセッション",
"renameAction": "セッションの名前を変更",
@@ -548,5 +541,85 @@
"REMOTE_PROVIDER_UPDATING": "このモデルプロバイダーの認証情報を更新しています。しばらくしてからもう一度お試しください。",
"REMOTE_WORKDIR_UNAVAILABLE": "リモートの作業ディレクトリを今は使えません。そのパソコンにフォルダがまだあるか確認してから、再試行してください。",
"REMOTE_OPTIMISTIC_SESSION_STATE_UNAVAILABLE": "パソコン側で、このメッセージが送信済みかまだ確認できません。少し待ってから再試行し、同じメッセージを重ねて送らないでください。"
+ },
+ "collab": {
+ "modeLabel": "コラボレーションモード",
+ "enabled": "オン",
+ "title": "コラボレーション",
+ "enableTitle": "コラボレーションを開始",
+ "enableSubmit": "コラボレーションを開始",
+ "createWorkerTitle": "新しい Worker",
+ "createWorkerSubmit": "Worker を作成",
+ "roleLabel": "ロール名",
+ "roleHint": "複数の協力者を見分けるための名前で、能力は変わりません",
+ "customRole": "カスタム",
+ "customRolePlaceholder": "カスタムロール名",
+ "customRolePredefinedError": "カスタムロール名にプリセットのロール名は使えません",
+ "agentLabel": "Agent",
+ "modelLabel": "モデル",
+ "modelDefault": "デフォルト",
+ "modelDefaultHint": "コンピューター側の Worker 既定モデルを使います",
+ "permissionLabel": "権限モード",
+ "permissionAuto": "自動承認",
+ "permissionFull": "フルアクセス",
+ "permissionAutoHint": "ワークスペース内の読み書きを許可し、権限昇格を自動承認します。高リスクの操作は拒否または確認が必要になることがあります。",
+ "permissionFullHint": "任意のファイル変更やネットワークコマンドを確認なしで実行できます。最もリスクが高く、信頼できるタスク向けです。",
+ "initialTaskLabel": "最初のタスク(任意)",
+ "initialTaskPlaceholder": "この Worker に任意で渡す最初のタスク",
+ "workerCountSummary_one": "Worker {{count}} 件 · 実行中 {{running}}",
+ "workerCountSummary_other": "Worker {{count}} 件 · 実行中 {{running}}",
+ "loading": "Worker を読み込み中…",
+ "noWorkers": "Worker はまだありません",
+ "focused": "フォーカス",
+ "manageGroup": "管理",
+ "hardLimitHint": "上限 {{limit}} 件に達しました · Worker をアーカイブすると作成できます",
+ "softLimitHint": "目安の {{limit}} 件を超えています · Worker が多いとメモリ使用量が増えます",
+ "limitSummary": "Worker の目安は {{soft}} 件、上限は {{hard}} 件です。コラボレーション設定はコンピューターで変更してください。",
+ "stop": "コラボレーションを終了",
+ "stopConfirmTitle": "コラボレーションを終了しますか?",
+ "stopConfirmDesc": "Worker のセッションは破棄され、実行中のタスクはすぐに停止し、結果は失われます。終了しますか?",
+ "cancel": "キャンセル",
+ "archive": "アーカイブ",
+ "archiveConfirm": "Worker をアーカイブ",
+ "archiveConfirmTitle": "Worker {{name}} をアーカイブしますか?",
+ "archiveConfirmDesc": "セッションを停止します。履歴はアーカイブとして残ります。アーカイブした Worker は復元できないため、続けるには新しい Worker を作成してください。",
+ "setFocus": "フォーカスにする",
+ "backToLead": "Lead に戻る",
+ "loadingHint": "コラボレーション設定を確認中…",
+ "disabledHint": "コラボレーションモードがオフです。コンピューターの設定で有効にしてください",
+ "unavailableHint": "コラボレーション設定を確認できませんでした。しばらくしてから再試行してください",
+ "barLead_one": "コラボレーション · Worker {{count}} 件 · 実行中 {{running}}",
+ "barLead_other": "コラボレーション · Worker {{count}} 件 · 実行中 {{running}}",
+ "barWorker": "コラボレーション Worker · Lead に戻る",
+ "draftChip": "コラボ",
+ "draftSummary": "最初の Worker:{{role}} · {{agent}}",
+ "draftSubmit": "完了",
+ "draftRemove": "コラボレーションを使わない",
+ "startFailedContinue": "コラボレーションを開始できなかったため、単一タスクとして続行します。{{reason}}",
+ "status": {
+ "idle": "待機中",
+ "running": "実行中",
+ "done": "完了",
+ "error": "エラー"
+ },
+ "errors": {
+ "unsupported": "コンピューターのバージョンが古いため、コラボレーションに対応していません",
+ "loadFailed": "Worker を読み込めませんでした。",
+ "startFailed": "コラボレーションを開始できませんでした。",
+ "createFailed": "Worker を作成できませんでした。",
+ "archiveFailed": "Worker をアーカイブできませんでした。",
+ "switchFailed": "フォーカスを切り替えられませんでした。",
+ "stopFailed": "コラボレーションを終了できませんでした。",
+ "WORKER_LIMIT_HARD_EXCEEDED": "Worker の上限に達しました。先に Worker をアーカイブしてください。",
+ "NO_PROVIDER_FOR_AGENT": "コンピューターにこの Agent 用のモデルプロバイダーが接続されていません。コンピューターで接続してから再試行してください。",
+ "PROVIDER_ROUTE_UNAVAILABLE": "選択したモデルとプロバイダーの経路がコンピューターで利用できません。利用可能なモデルを選んで再試行してください。",
+ "BUDGET_MODEL_REQUIRES_API_MODE": "この Codex モデルに必要な API key がコンピューターで設定されていません。設定してから再試行してください。",
+ "INVALID_PARAMS": "選択したモデルまたは設定にコンピューターが対応していません。対応するモデルを選んで再試行してください。",
+ "PRECONDITION_FAILED": "コラボレーションモードがオフか、このタスクはコラボレーションに対応していません。",
+ "WORKER_CREATION_IN_PROGRESS": "同じ名前の Worker を作成中です。しばらくしてから再試行してください。",
+ "WORKER_NOT_FOUND": "この Worker はもう存在しません。一覧を更新しました。",
+ "ORCA_CREATE_UNCONFIRMED": "Worker の作成がタイムアウトし、成功したか確認できませんでした。まず Worker 一覧を確認し、新しい Worker がない場合のみ再試行してください。",
+ "ORCA_ACTION_UNCONFIRMED": "操作がタイムアウトしたため、結果をまだ確認できません。一覧を更新しました。現在の表示を基準にしてください。"
+ }
}
}
diff --git a/apps/mobile/src/i18n/locales/ko/interaction.json b/apps/mobile/src/i18n/locales/ko/interaction.json
index cc75f2d393..a75b3611c6 100644
--- a/apps/mobile/src/i18n/locales/ko/interaction.json
+++ b/apps/mobile/src/i18n/locales/ko/interaction.json
@@ -267,7 +267,6 @@
},
"queue": {
"count": "{{count}}개",
- "readOnlyHint": "협업은 읽기 전용이며 컴퓨터의 요청만 표시합니다.",
"empty": "대기 중인 요청 없음",
"hint": {
"plan_review": "계획을 확인하고 필요하면 수정을 요청하세요. 승인한 뒤 컴퓨터에서 계속 실행합니다.",
diff --git a/apps/mobile/src/i18n/locales/ko/message.json b/apps/mobile/src/i18n/locales/ko/message.json
index 7aa102f6d6..4226f5bdf3 100644
--- a/apps/mobile/src/i18n/locales/ko/message.json
+++ b/apps/mobile/src/i18n/locales/ko/message.json
@@ -265,7 +265,7 @@
"steering": "끼어들기 전송 중",
"orcaTitle": "협업 큐 {{index}}",
"title": "큐 {{index}}",
- "orcaReadOnly": "협업 메시지는 데스크톱에서 구성되며 모바일에서는 읽기 전용입니다.",
+ "orcaEditDisabled": "협업 메시지는 편집하거나 끼어들기로 보낼 수 없습니다.",
"busy": "큐 작업을 동기화하는 중입니다. 완료 후 다시 조작하세요.",
"steeringDisabled": "현재 turn에 끼어들기를 보내는 중입니다. 데스크톱 응답을 기다리세요.",
"editLocked": "이 대기 메시지를 편집하는 중입니다. 완료 후 다시 조작하세요.",
diff --git a/apps/mobile/src/i18n/locales/ko/session.json b/apps/mobile/src/i18n/locales/ko/session.json
index 8fec30305d..1d1ddb45ca 100644
--- a/apps/mobile/src/i18n/locales/ko/session.json
+++ b/apps/mobile/src/i18n/locales/ko/session.json
@@ -35,12 +35,7 @@
"collaboration": {
"labelLead": "협업 Lead",
"labelWorker": "협업 Worker",
- "labelRole": "협업 {{role}}",
- "noticeLead": "컴퓨터의 Orca Lead 세션입니다. 휴대폰에서 메시지를 계속 보낼 수 있습니다. Worker 생성, 포커스 변경, Fork/Rewind, 대기열 편집 및 세션 설정 변경은 컴퓨터에서 진행하세요.",
- "noticeWorker": "컴퓨터의 Orca Worker 세션입니다. 모바일 첫 버전은 읽기 전용이며 메시지 전송, Worker 포커스 변경, Worker 보관 또는 협업 중지를 지원하지 않습니다.",
- "noticeOther": "컴퓨터의 협업 세션입니다. 모바일 첫 버전은 읽기 전용이므로 협업 관리는 컴퓨터에서 진행하세요.",
- "readOnlyReason": "모바일 첫 버전에서 협업 모드는 읽기 전용입니다. 확인 처리, 대기열 편집 및 세션 변경은 컴퓨터에서 진행하세요.",
- "composerReadOnlyReason": "이 협업 하위 작업은 모바일에서 읽기 전용입니다. 컴퓨터에서 메시지를 보내세요."
+ "labelRole": "협업 {{role}}"
},
"composer": {
"voice": {
@@ -253,7 +248,6 @@
"resync": "원격 세션 다시 동기화",
"collapseHistory": "기록 접기",
"expandHistory": "기록 보기",
- "readOnlyMode": "읽기 전용",
"accessRevokedShort": "액세스 취소됨",
"sessionNotSynced": "세션 미동기화",
"conversationFallback": "세션",
@@ -369,7 +363,6 @@
"details": "세션 상세 정보",
"chipPinned": "고정됨",
"chipArchived": "보관됨",
- "chipReadOnly": "읽기 전용",
"titleFallback": "원격 세션",
"unnamedTitle": "이름 없는 세션",
"renameAction": "세션 이름 변경",
@@ -544,5 +537,85 @@
"REMOTE_PROVIDER_UPDATING": "이 모델 제공자의 자격 증명을 업데이트하는 중입니다. 잠시 후 다시 시도하세요.",
"REMOTE_WORKDIR_UNAVAILABLE": "원격 작업 디렉터리를 지금 사용할 수 없습니다. 그 컴퓨터에 폴더가 아직 있는지 확인한 뒤 다시 시도하세요.",
"REMOTE_OPTIMISTIC_SESSION_STATE_UNAVAILABLE": "컴퓨터에서 이 메시지가 이미 전송됐는지 아직 확인할 수 없습니다. 잠시 후 다시 시도하고, 같은 메시지를 중복으로 보내지 마세요."
+ },
+ "collab": {
+ "modeLabel": "협업 모드",
+ "enabled": "켜짐",
+ "title": "협업",
+ "enableTitle": "협업 시작",
+ "enableSubmit": "협업 시작",
+ "createWorkerTitle": "새 Worker",
+ "createWorkerSubmit": "Worker 만들기",
+ "roleLabel": "역할 이름",
+ "roleHint": "여러 협업자를 구분하기 위한 이름일 뿐이며 능력은 바뀌지 않습니다",
+ "customRole": "사용자 지정",
+ "customRolePlaceholder": "사용자 지정 역할 이름",
+ "customRolePredefinedError": "사용자 지정 역할 이름에 기본 역할 이름을 쓸 수 없습니다",
+ "agentLabel": "Agent",
+ "modelLabel": "모델",
+ "modelDefault": "기본값",
+ "modelDefaultHint": "컴퓨터의 Worker 기본 모델을 사용합니다",
+ "permissionLabel": "권한 모드",
+ "permissionAuto": "자동 승인",
+ "permissionFull": "전체 액세스",
+ "permissionAutoHint": "작업 공간 안에서 읽고 쓰며 권한 상승 요청을 자동 승인합니다. 위험도가 높은 작업은 거부되거나 확인이 필요할 수 있습니다.",
+ "permissionFullHint": "확인 없이 모든 파일을 수정하고 네트워크 명령을 실행할 수 있습니다. 위험도가 가장 높으니 신뢰할 수 있는 작업에만 사용하세요.",
+ "initialTaskLabel": "초기 작업(선택)",
+ "initialTaskPlaceholder": "이 Worker에게 줄 선택적 첫 작업",
+ "workerCountSummary_one": "Worker {{count}}개 · 실행 중 {{running}}",
+ "workerCountSummary_other": "Worker {{count}}개 · 실행 중 {{running}}",
+ "loading": "Worker를 불러오는 중…",
+ "noWorkers": "아직 Worker가 없습니다",
+ "focused": "포커스",
+ "manageGroup": "관리",
+ "hardLimitHint": "최대 {{limit}}개에 도달 · Worker를 보관하면 더 만들 수 있습니다",
+ "softLimitHint": "권장 {{limit}}개 초과 · Worker가 많으면 메모리 사용량이 늘어납니다",
+ "limitSummary": "Worker 권장 {{soft}}개, 최대 {{hard}}개. 협업 설정은 컴퓨터에서 변경하세요.",
+ "stop": "협업 종료",
+ "stopConfirmTitle": "협업을 종료할까요?",
+ "stopConfirmDesc": "Worker 세션이 삭제되며, 실행 중인 작업은 즉시 중지되고 결과는 사라집니다. 종료할까요?",
+ "cancel": "취소",
+ "archive": "보관",
+ "archiveConfirm": "Worker 보관",
+ "archiveConfirmTitle": "Worker {{name}}을(를) 보관할까요?",
+ "archiveConfirmDesc": "세션을 중지합니다. 기록은 보관 상태로 남습니다. 보관한 Worker는 복원할 수 없으니 계속하려면 새 Worker를 만드세요.",
+ "setFocus": "포커스로 지정",
+ "backToLead": "Lead로 돌아가기",
+ "loadingHint": "협업 설정 확인 중…",
+ "disabledHint": "협업 모드가 꺼져 있습니다. 컴퓨터 설정에서 다시 켜세요",
+ "unavailableHint": "협업 설정을 확인하지 못했습니다. 잠시 후 다시 시도하세요",
+ "barLead_one": "협업 · Worker {{count}}개 · 실행 중 {{running}}",
+ "barLead_other": "협업 · Worker {{count}}개 · 실행 중 {{running}}",
+ "barWorker": "협업 Worker · Lead로 돌아가기",
+ "draftChip": "협업",
+ "draftSummary": "첫 Worker: {{role}} · {{agent}}",
+ "draftSubmit": "완료",
+ "draftRemove": "협업 사용 안 함",
+ "startFailedContinue": "협업을 시작하지 못해 단일 작업으로 계속합니다. {{reason}}",
+ "status": {
+ "idle": "대기",
+ "running": "실행 중",
+ "done": "완료",
+ "error": "오류"
+ },
+ "errors": {
+ "unsupported": "컴퓨터 버전이 오래되어 협업을 지원하지 않습니다",
+ "loadFailed": "Worker를 불러오지 못했습니다.",
+ "startFailed": "협업을 시작하지 못했습니다.",
+ "createFailed": "Worker를 만들지 못했습니다.",
+ "archiveFailed": "Worker를 보관하지 못했습니다.",
+ "switchFailed": "포커스를 바꾸지 못했습니다.",
+ "stopFailed": "협업을 종료하지 못했습니다.",
+ "WORKER_LIMIT_HARD_EXCEEDED": "Worker 최대 수에 도달했습니다. 먼저 Worker를 보관하세요.",
+ "NO_PROVIDER_FOR_AGENT": "컴퓨터에 이 Agent용 모델 제공자가 연결되어 있지 않습니다. 컴퓨터에서 연결한 뒤 다시 시도하세요.",
+ "PROVIDER_ROUTE_UNAVAILABLE": "선택한 모델과 제공자 경로를 컴퓨터에서 사용할 수 없습니다. 사용 가능한 모델을 골라 다시 시도하세요.",
+ "BUDGET_MODEL_REQUIRES_API_MODE": "컴퓨터에 이 Codex 모델에 필요한 API key가 설정되지 않았습니다. 설정한 뒤 다시 시도하세요.",
+ "INVALID_PARAMS": "컴퓨터가 선택한 모델이나 협업 설정을 지원하지 않습니다. 지원되는 모델을 골라 다시 시도하세요.",
+ "PRECONDITION_FAILED": "협업 모드가 꺼져 있거나 이 작업은 협업을 지원하지 않습니다.",
+ "WORKER_CREATION_IN_PROGRESS": "같은 이름의 Worker를 만드는 중입니다. 잠시 후 다시 시도하세요.",
+ "WORKER_NOT_FOUND": "이 Worker는 더 이상 없습니다. 목록을 새로 고쳤습니다.",
+ "ORCA_CREATE_UNCONFIRMED": "Worker 만들기가 시간 초과되어 성공 여부를 확인하지 못했습니다. 먼저 Worker 목록을 확인하고, 새 Worker가 없을 때만 다시 시도하세요.",
+ "ORCA_ACTION_UNCONFIRMED": "작업 시간이 초과되어 결과를 아직 확인하지 못했습니다. 목록을 새로 고쳤으니 현재 표시된 상태를 기준으로 하세요."
+ }
}
}
diff --git a/apps/mobile/src/i18n/locales/zh-CN/interaction.json b/apps/mobile/src/i18n/locales/zh-CN/interaction.json
index df48d6ce2e..cbca389c00 100644
--- a/apps/mobile/src/i18n/locales/zh-CN/interaction.json
+++ b/apps/mobile/src/i18n/locales/zh-CN/interaction.json
@@ -267,7 +267,6 @@
},
"queue": {
"count": "{{count}} 个",
- "readOnlyHint": "协同只读模式,仅展示电脑端请求。",
"empty": "没有待处理请求",
"hint": {
"plan_review": "先看计划,必要时反馈修改,确认后电脑端才继续执行。",
diff --git a/apps/mobile/src/i18n/locales/zh-CN/message.json b/apps/mobile/src/i18n/locales/zh-CN/message.json
index df2bb86093..bcbca0c28b 100644
--- a/apps/mobile/src/i18n/locales/zh-CN/message.json
+++ b/apps/mobile/src/i18n/locales/zh-CN/message.json
@@ -265,7 +265,7 @@
"steering": "插话发送中",
"orcaTitle": "协同队列 {{index}}",
"title": "队列 {{index}}",
- "orcaReadOnly": "协同消息由桌面端编排,手机端只读显示。",
+ "orcaEditDisabled": "协同消息不支持编辑或插话发送。",
"busy": "队列操作同步中,完成后再继续操作。",
"steeringDisabled": "插话正在发送到当前 turn,等待桌面端回流后再操作。",
"editLocked": "这条队列消息正在编辑中,完成后再操作。",
diff --git a/apps/mobile/src/i18n/locales/zh-CN/session.json b/apps/mobile/src/i18n/locales/zh-CN/session.json
index fff9f68263..f235aba1d6 100644
--- a/apps/mobile/src/i18n/locales/zh-CN/session.json
+++ b/apps/mobile/src/i18n/locales/zh-CN/session.json
@@ -35,12 +35,7 @@
"collaboration": {
"labelLead": "协同 Lead",
"labelWorker": "协同 Worker",
- "labelRole": "协同 {{role}}",
- "noticeLead": "这是桌面端 Orca Lead 任务。可以在手机上继续发消息;创建 Worker、切换焦点、Fork/Rewind、编辑队列和修改任务设置等编排操作请在电脑端完成。",
- "noticeWorker": "这是桌面端 Orca Worker 任务。手机版第一版只读,不提供发送消息、切换 Worker 焦点、归档 Worker 或停止协同。",
- "noticeOther": "这是桌面端协同任务。手机版第一版只读,协同编排操作请在电脑端完成。",
- "readOnlyReason": "协同模式在手机版第一版中为只读。确认处理、队列编辑和任务修改请在电脑端完成。",
- "composerReadOnlyReason": "这个协同子任务在手机版中只读,请在电脑端发送消息。"
+ "labelRole": "协同 {{role}}"
},
"composer": {
"voice": {
@@ -253,7 +248,6 @@
"resync": "重新同步远程任务",
"collapseHistory": "收起历史消息",
"expandHistory": "查看历史消息",
- "readOnlyMode": "只读模式",
"accessRevokedShort": "访问已撤销",
"sessionNotSynced": "任务未同步",
"conversationFallback": "任务",
@@ -369,7 +363,6 @@
"details": "任务详情",
"chipPinned": "已置顶",
"chipArchived": "已归档",
- "chipReadOnly": "只读",
"titleFallback": "远程任务",
"unnamedTitle": "未命名任务",
"renameAction": "重命名任务",
@@ -544,5 +537,85 @@
"REMOTE_PROVIDER_UPDATING": "这个模型供应商的凭据正在更新。请稍后再试。",
"REMOTE_WORKDIR_UNAVAILABLE": "远端工作目录现在不可用。请确认那台电脑上的目录还在,然后重试。",
"REMOTE_OPTIMISTIC_SESSION_STATE_UNAVAILABLE": "电脑端暂时无法确认这条消息是否已经发出。请稍后再试,不要重复发送同一条。"
+ },
+ "collab": {
+ "modeLabel": "协同模式",
+ "enabled": "已开启",
+ "title": "协同",
+ "enableTitle": "开启协同",
+ "enableSubmit": "开启协同",
+ "createWorkerTitle": "创建新 Worker",
+ "createWorkerSubmit": "创建 Worker",
+ "roleLabel": "角色名",
+ "roleHint": "只是一个名字,方便多个协作者时分辨角色,不改变能力",
+ "customRole": "自定义",
+ "customRolePlaceholder": "自定义角色名",
+ "customRolePredefinedError": "自定义角色名不能使用预设角色名",
+ "agentLabel": "Agent",
+ "modelLabel": "模型",
+ "modelDefault": "默认",
+ "modelDefaultHint": "跟随电脑端的 Worker 默认模型",
+ "permissionLabel": "权限模式",
+ "permissionAuto": "自动审批",
+ "permissionFull": "完全访问",
+ "permissionAutoHint": "允许在工作区内读写,并自动审批提权请求;高风险操作可能被拒绝或要求确认。",
+ "permissionFullHint": "允许修改任意文件并运行联网命令,无需再次确认。风险最高,只适合可信任务。",
+ "initialTaskLabel": "初始任务(可选)",
+ "initialTaskPlaceholder": "给这个 Worker 的可选第一条任务",
+ "workerCountSummary_one": "{{count}} 个 Worker · {{running}} 运行中",
+ "workerCountSummary_other": "{{count}} 个 Worker · {{running}} 运行中",
+ "loading": "正在读取 Worker…",
+ "noWorkers": "还没有 Worker",
+ "focused": "焦点",
+ "manageGroup": "管理",
+ "hardLimitHint": "已达硬上限 {{limit}} 个 · 归档现有 Worker 后可继续创建",
+ "softLimitHint": "已超过软上限 {{limit}} 个 · Worker 过多会增加内存占用",
+ "limitSummary": "Worker 软上限 {{soft}} 个,硬上限 {{hard}} 个。协同设置请在电脑端修改。",
+ "stop": "结束协同",
+ "stopConfirmTitle": "结束协同?",
+ "stopConfirmDesc": "所有 Worker 都会被归档,正在执行的工作会立即停止,本次执行结果会丢失。确认要结束吗?",
+ "cancel": "取消",
+ "archive": "归档",
+ "archiveConfirm": "归档 Worker",
+ "archiveConfirmTitle": "归档 Worker {{name}}?",
+ "archiveConfirmDesc": "这会停止这个 Worker 的运行;历史记录会以归档状态保留。归档后无法恢复,需要重新创建 Worker 派任务。",
+ "setFocus": "设为焦点",
+ "backToLead": "返回 Lead",
+ "loadingHint": "正在确认协同设置…",
+ "disabledHint": "协同模式已关闭,请在电脑端设置中重新启用",
+ "unavailableHint": "暂时无法确认协同设置,请稍后重试",
+ "barLead_one": "协同 · {{count}} 个 Worker · {{running}} 运行中",
+ "barLead_other": "协同 · {{count}} 个 Worker · {{running}} 运行中",
+ "barWorker": "协同 Worker · 返回 Lead",
+ "draftChip": "协同",
+ "draftSummary": "首个 Worker:{{role}} · {{agent}}",
+ "draftSubmit": "确定",
+ "draftRemove": "不开启协同",
+ "startFailedContinue": "开启协同失败,已改为单任务继续。{{reason}}",
+ "status": {
+ "idle": "空闲",
+ "running": "运行中",
+ "done": "已完成",
+ "error": "出错"
+ },
+ "errors": {
+ "unsupported": "电脑端版本过旧,暂不支持协同",
+ "loadFailed": "Worker 状态读取失败。",
+ "startFailed": "开启协同失败。",
+ "createFailed": "创建 Worker 失败。",
+ "archiveFailed": "归档 Worker 失败。",
+ "switchFailed": "切换焦点失败。",
+ "stopFailed": "结束协同失败。",
+ "WORKER_LIMIT_HARD_EXCEEDED": "已达 Worker 硬上限,请先归档现有 Worker。",
+ "NO_PROVIDER_FOR_AGENT": "电脑端没有为该 Agent 连接可用的模型供应商。请在电脑端完成连接后重试。",
+ "PROVIDER_ROUTE_UNAVAILABLE": "电脑端上的所选模型与供应商精确路由当前不可用,请改选可用的模型后重试。",
+ "BUDGET_MODEL_REQUIRES_API_MODE": "电脑端尚未配置此 Codex 模型所需的 API key。请在电脑端配置后重试。",
+ "INVALID_PARAMS": "电脑端不支持所选模型或协同配置。请改选该电脑支持的模型后重试。",
+ "PRECONDITION_FAILED": "协同模式已关闭,或当前任务暂不支持协同。",
+ "WORKER_CREATION_IN_PROGRESS": "另一个同名 Worker 正在创建,请稍后重试。",
+ "WORKER_NOT_FOUND": "这个 Worker 已不存在,列表已刷新。",
+ "ORCA_CREATE_UNCONFIRMED": "创建 Worker 超时,暂时无法确认是否成功。请先查看 Worker 列表,确认没有新建的 Worker 后再重试。",
+ "ORCA_ACTION_UNCONFIRMED": "操作超时,暂时无法确认结果。已刷新列表,请以当前显示的状态为准。"
+ }
}
}
diff --git a/apps/mobile/src/i18n/locales/zh-TW/interaction.json b/apps/mobile/src/i18n/locales/zh-TW/interaction.json
index 2b60d7617c..6511c01ebd 100644
--- a/apps/mobile/src/i18n/locales/zh-TW/interaction.json
+++ b/apps/mobile/src/i18n/locales/zh-TW/interaction.json
@@ -267,7 +267,6 @@
},
"queue": {
"count": "{{count}} 個",
- "readOnlyHint": "協同唯讀模式,僅顯示電腦端請求。",
"empty": "沒有待處理請求",
"hint": {
"plan_review": "先看計畫,必要時回饋修改,確認後電腦端才繼續執行。",
diff --git a/apps/mobile/src/i18n/locales/zh-TW/message.json b/apps/mobile/src/i18n/locales/zh-TW/message.json
index 4c7e0dd6eb..becdaa28ef 100644
--- a/apps/mobile/src/i18n/locales/zh-TW/message.json
+++ b/apps/mobile/src/i18n/locales/zh-TW/message.json
@@ -265,7 +265,7 @@
"steering": "插話傳送中",
"orcaTitle": "協同佇列 {{index}}",
"title": "佇列 {{index}}",
- "orcaReadOnly": "協同訊息由桌面端編排,手機端唯讀顯示。",
+ "orcaEditDisabled": "協同訊息不支援編輯或插話傳送。",
"busy": "佇列操作同步中,完成後再繼續操作。",
"steeringDisabled": "插話正在傳送到目前 turn,等待桌面端回流後再操作。",
"editLocked": "這條佇列訊息正在編輯中,完成後再操作。",
diff --git a/apps/mobile/src/i18n/locales/zh-TW/session.json b/apps/mobile/src/i18n/locales/zh-TW/session.json
index 2d28e7fed9..03312f5bd3 100644
--- a/apps/mobile/src/i18n/locales/zh-TW/session.json
+++ b/apps/mobile/src/i18n/locales/zh-TW/session.json
@@ -35,12 +35,7 @@
"collaboration": {
"labelLead": "協同 Lead",
"labelWorker": "協同 Worker",
- "labelRole": "協同 {{role}}",
- "noticeLead": "這是電腦端的 Orca Lead 任務。你可以在手機上繼續傳送訊息;建立 Worker、切換焦點、Fork/Rewind、編輯佇列和修改任務設定等編排操作請在電腦端完成。",
- "noticeWorker": "這是電腦端的 Orca Worker 任務。手機版第一版為唯讀,不提供傳送訊息、切換 Worker 焦點、封存 Worker 或停止協同。",
- "noticeOther": "這是電腦端的協同任務。手機版第一版為唯讀,協同編排操作請在電腦端完成。",
- "readOnlyReason": "協同模式在手機版第一版中為唯讀。確認處理、佇列編輯和任務修改請在電腦端完成。",
- "composerReadOnlyReason": "這個協同子任務在手機版中為唯讀,請在電腦端傳送訊息。"
+ "labelRole": "協同 {{role}}"
},
"composer": {
"voice": {
@@ -257,7 +252,6 @@
"resync": "重新同步遠端任務",
"collapseHistory": "收起歷史訊息",
"expandHistory": "檢視歷史訊息",
- "readOnlyMode": "只讀模式",
"accessRevokedShort": "訪問已撤銷",
"sessionNotSynced": "任務未同步",
"conversationFallback": "任務",
@@ -373,7 +367,6 @@
"details": "任務詳情",
"chipPinned": "已置頂",
"chipArchived": "已歸檔",
- "chipReadOnly": "只讀",
"titleFallback": "遠端任務",
"unnamedTitle": "未命名任務",
"renameAction": "重新命名任務",
@@ -548,5 +541,85 @@
"REMOTE_PROVIDER_UPDATING": "這個模型供應商的憑證正在更新。請稍後再試。",
"REMOTE_WORKDIR_UNAVAILABLE": "遠端工作目錄現在無法使用。請確認那台電腦上的目錄還在,然後重試。",
"REMOTE_OPTIMISTIC_SESSION_STATE_UNAVAILABLE": "電腦端暫時無法確認這則訊息是否已經送出。請稍後再試,不要重複傳送同一則。"
+ },
+ "collab": {
+ "modeLabel": "協同模式",
+ "enabled": "已開啟",
+ "title": "協同",
+ "enableTitle": "開啟協同",
+ "enableSubmit": "開啟協同",
+ "createWorkerTitle": "建立新 Worker",
+ "createWorkerSubmit": "建立 Worker",
+ "roleLabel": "角色名稱",
+ "roleHint": "只是一個名稱,方便多個協作者時分辨角色,不改變能力",
+ "customRole": "自訂",
+ "customRolePlaceholder": "自訂角色名稱",
+ "customRolePredefinedError": "自訂角色名稱不能使用預設角色名稱",
+ "agentLabel": "Agent",
+ "modelLabel": "模型",
+ "modelDefault": "預設",
+ "modelDefaultHint": "沿用電腦端的 Worker 預設模型",
+ "permissionLabel": "權限模式",
+ "permissionAuto": "自動審批",
+ "permissionFull": "完全存取",
+ "permissionAutoHint": "允許在工作區內讀寫,並自動審批提權請求;高風險操作可能被拒絕或要求確認。",
+ "permissionFullHint": "允許修改任意檔案並執行連網指令,無需再次確認。風險最高,只適合可信任務。",
+ "initialTaskLabel": "初始任務(選填)",
+ "initialTaskPlaceholder": "給這個 Worker 的選填第一則任務",
+ "workerCountSummary_one": "{{count}} 個 Worker · {{running}} 執行中",
+ "workerCountSummary_other": "{{count}} 個 Worker · {{running}} 執行中",
+ "loading": "正在讀取 Worker…",
+ "noWorkers": "還沒有 Worker",
+ "focused": "焦點",
+ "manageGroup": "管理",
+ "hardLimitHint": "已達硬上限 {{limit}} 個 · 封存現有 Worker 後可繼續建立",
+ "softLimitHint": "已超過軟上限 {{limit}} 個 · Worker 過多會增加記憶體占用",
+ "limitSummary": "Worker 軟上限 {{soft}} 個,硬上限 {{hard}} 個。協同設定請在電腦端修改。",
+ "stop": "結束協同",
+ "stopConfirmTitle": "結束協同?",
+ "stopConfirmDesc": "所有 Worker 都會被封存,正在執行的工作會立即停止,本次執行結果會遺失。確認要結束嗎?",
+ "cancel": "取消",
+ "archive": "封存",
+ "archiveConfirm": "封存 Worker",
+ "archiveConfirmTitle": "封存 Worker {{name}}?",
+ "archiveConfirmDesc": "這會停止這個 Worker 的執行;歷史記錄會以封存狀態保留。封存後無法復原,需要重新建立 Worker 派任務。",
+ "setFocus": "設為焦點",
+ "backToLead": "返回 Lead",
+ "loadingHint": "正在確認協同設定…",
+ "disabledHint": "協同模式已關閉,請在電腦端設定中重新啟用",
+ "unavailableHint": "暫時無法確認協同設定,請稍後重試",
+ "barLead_one": "協同 · {{count}} 個 Worker · {{running}} 執行中",
+ "barLead_other": "協同 · {{count}} 個 Worker · {{running}} 執行中",
+ "barWorker": "協同 Worker · 返回 Lead",
+ "draftChip": "協同",
+ "draftSummary": "首個 Worker:{{role}} · {{agent}}",
+ "draftSubmit": "確定",
+ "draftRemove": "不開啟協同",
+ "startFailedContinue": "開啟協同失敗,已改為單任務繼續。{{reason}}",
+ "status": {
+ "idle": "閒置",
+ "running": "執行中",
+ "done": "已完成",
+ "error": "出錯"
+ },
+ "errors": {
+ "unsupported": "電腦端版本過舊,暫不支援協同",
+ "loadFailed": "Worker 狀態讀取失敗。",
+ "startFailed": "開啟協同失敗。",
+ "createFailed": "建立 Worker 失敗。",
+ "archiveFailed": "封存 Worker 失敗。",
+ "switchFailed": "切換焦點失敗。",
+ "stopFailed": "結束協同失敗。",
+ "WORKER_LIMIT_HARD_EXCEEDED": "已達 Worker 硬上限,請先封存現有 Worker。",
+ "NO_PROVIDER_FOR_AGENT": "電腦端沒有為該 Agent 連接可用的模型供應商。請在電腦端完成連接後重試。",
+ "PROVIDER_ROUTE_UNAVAILABLE": "電腦端上的所選模型與供應商精確路由目前不可用,請改選可用的模型後重試。",
+ "BUDGET_MODEL_REQUIRES_API_MODE": "電腦端尚未設定此 Codex 模型所需的 API key。請在電腦端設定後重試。",
+ "INVALID_PARAMS": "電腦端不支援所選模型或協同設定。請改選該電腦支援的模型後重試。",
+ "PRECONDITION_FAILED": "協同模式已關閉,或目前任務暫不支援協同。",
+ "WORKER_CREATION_IN_PROGRESS": "另一個同名 Worker 正在建立,請稍後重試。",
+ "WORKER_NOT_FOUND": "這個 Worker 已不存在,列表已重新整理。",
+ "ORCA_CREATE_UNCONFIRMED": "建立 Worker 逾時,暫時無法確認是否成功。請先查看 Worker 列表,確認沒有新建的 Worker 後再重試。",
+ "ORCA_ACTION_UNCONFIRMED": "操作逾時,暫時無法確認結果。已重新整理列表,請以目前顯示的狀態為準。"
+ }
}
}
diff --git a/apps/mobile/src/session/ContextSheet.ios.tsx b/apps/mobile/src/session/ContextSheet.ios.tsx
index b55e84847f..38d9d67b3d 100644
--- a/apps/mobile/src/session/ContextSheet.ios.tsx
+++ b/apps/mobile/src/session/ContextSheet.ios.tsx
@@ -8,23 +8,33 @@ import {
useRef,
type ReactNode,
} from "react";
-import { Button, HStack, Image, RNHostView, ProgressView, Spacer, Text } from '@expo/ui/swift-ui';
+import { Button, HStack, Image, Picker, RNHostView, ProgressView, Spacer, Text, TextField, VStack, useNativeState } from '@expo/ui/swift-ui';
import {
+ accessibilityAddTraits,
accessibilityHint,
+ accessibilityLabel,
buttonStyle,
contentShape,
disabled as disable,
+ font,
frame,
foregroundStyle,
+ lineLimit,
listRowInsets,
+ onLongPressGesture,
+ onTapGesture,
+ pickerStyle,
shapes,
+ tag,
} from "@expo/ui/swift-ui/modifiers";
import { useTranslation } from "react-i18next";
import { View } from "react-native";
import type {
+ ContextSheetChoiceRowProps,
ContextSheetProps,
ContextSheetRowProps,
ContextSheetFooterButtonProps,
+ ContextSheetTextFieldProps,
} from "./ContextSheet";
import { ComposerSheet } from "./ComposerSheet";
const DismissAction = createContext<(action: () => void) => void>((action) =>
@@ -81,44 +91,68 @@ export function ContextSheetGroup({
}
export function ContextSheetRow(props: ContextSheetRowProps) {
const dismiss = useContext(DismissAction);
+ const { colors } = useTheme();
+ const labelModifiers = props.destructive ? [foregroundStyle(colors.destructive)] : [];
+ const press = () => (props.dismissBeforePress ? dismiss(props.onPress) : props.onPress());
+ const inactive = !!props.disabled || !!props.busy;
+ const content = (extraModifiers: ReturnType<typeof frame>[]) => (
+ <HStack
+ modifiers={[
+ frame({ maxWidth: Infinity, minHeight: 44 }),
+ contentShape(shapes.rectangle()),
+ ...extraModifiers,
+ ]}
+ >
+ <RNHostView matchContents>
+ <View style={{ width: 28, height: 28, justifyContent: "center" }}>
+ {props.icon}
+ </View>
+ </RNHostView>
+ {props.detail ? (
+ <VStack alignment="leading" spacing={2}>
+ <Text modifiers={[...labelModifiers, lineLimit(1)]}>{props.label}</Text>
+ <Text modifiers={[font({ textStyle: 'footnote' }), foregroundStyle(colors.textSecondary), lineLimit(1)]}>{props.detail}</Text>
+ </VStack>
+ ) : (
+ <Text modifiers={labelModifiers}>{props.label}</Text>
+ )}
+ <Spacer />
+ {props.busy ? (
+ <ProgressView />
+ ) : props.trailing && props.trailing !== "chevron" ? (
+ <RNHostView matchContents>
+ <View>{props.trailing}</View>
+ </RNHostView>
+ ) : props.trailing === "chevron" ? (
+ <Image size={iconSize.lg} systemName="chevron.right" />
+ ) : null}
+ </HStack>
+ );
+ const accessibility = props.accessibilityHint ? [accessibilityHint(props.accessibilityHint)] : [];
+ if (props.onLongPress) {
+ // 带长按的行(协同 Worker):SwiftUI Button 与长按手势会互相抢,改用同一视图上的
+ // 点按 + 长按手势,点按直接执行,长按弹出管理操作。
+ const longPress = props.onLongPress;
+ return content([
+ listRowInsets({ top: 4, bottom: 4, leading: 16, trailing: 16 }),
+ disable(inactive),
+ accessibilityAddTraits(['isButton']),
+ ...accessibility,
+ ...(inactive ? [] : [onTapGesture(press), onLongPressGesture(longPress)]),
+ ]);
+ }
return (
<Button
- onPress={() =>
- props.dismissBeforePress ? dismiss(props.onPress) : props.onPress()
- }
+ onPress={press}
testID={props.testID}
modifiers={[
buttonStyle("plain"),
listRowInsets({ top: 4, bottom: 4, leading: 16, trailing: 16 }),
- disable(!!props.disabled || !!props.busy),
- ...(props.accessibilityHint
- ? [accessibilityHint(props.accessibilityHint)]
- : []),
+ disable(inactive),
+ ...accessibility,
]}
>
- <HStack
- modifiers={[
- frame({ maxWidth: Infinity, minHeight: 44 }),
- contentShape(shapes.rectangle()),
- ]}
- >
- <RNHostView matchContents>
- <View style={{ width: 28, height: 28, justifyContent: "center" }}>
- {props.icon}
- </View>
- </RNHostView>
- <Text>{props.label}</Text>
- <Spacer />
- {props.busy ? (
- <ProgressView />
- ) : props.trailing && props.trailing !== "chevron" ? (
- <RNHostView matchContents>
- <View>{props.trailing}</View>
- </RNHostView>
- ) : props.trailing === "chevron" ? (
- <Image size={iconSize.lg} systemName="chevron.right" />
- ) : null}
- </HStack>
+ {content([])}
</Button>
);
}
@@ -138,3 +172,55 @@ export function ContextSheetFooterButton(props: ContextSheetFooterButtonProps) {
</Button>
);
}
+
+export function ContextSheetNote({ text, tone = 'secondary', testID }: {
+ text: string;
+ tone?: 'secondary' | 'error';
+ testID?: string;
+}) {
+ const { colors } = useTheme();
+ return (
+ <Text testID={testID} modifiers={[font({ textStyle: 'footnote' }), foregroundStyle(tone === 'error' ? colors.errorText : colors.textSecondary)]}>
+ {text}
+ </Text>
+ );
+}
+
+export function ContextSheetChoiceRow<T extends string>(props: ContextSheetChoiceRowProps<T>) {
+ return (
+ <Picker
+ label={props.label}
+ selection={props.value ?? ''}
+ onSelectionChange={(next: string | number) => {
+ const option = props.options.find((item) => item.id === String(next));
+ if (option) props.onChange(option.id);
+ }}
+ modifiers={[pickerStyle(props.options.length <= 3 ? 'segmented' : 'menu'), disable(!!props.disabled)]}
+ testID={props.testID}
+ >
+ {props.options.map((option) => (
+ <Text key={option.id} modifiers={[tag(option.id)]}>{option.label}</Text>
+ ))}
+ </Picker>
+ );
+}
+
+export function ContextSheetTextField(props: ContextSheetTextFieldProps) {
+ const text = useNativeState(props.value);
+ useEffect(() => { if (text.get() !== props.value) text.set(props.value); }, [props.value, text]);
+ return (
+ <TextField
+ text={text}
+ onTextChange={props.onChange}
+ axis={props.multiline ? 'vertical' : 'horizontal'}
+ placeholder={props.placeholder}
+ maxLength={props.maxLength}
+ testID={props.testID}
+ modifiers={[
+ disable(!!props.disabled),
+ accessibilityLabel(props.accessibilityLabel),
+ ...(props.multiline ? [lineLimit({ min: 3, max: 6 })] : []),
+ ]}
+ />
+ );
+}
diff --git a/apps/mobile/src/session/ContextSheet.tsx b/apps/mobile/src/session/ContextSheet.tsx
index 14212a7a03..8441f348b4 100644
--- a/apps/mobile/src/session/ContextSheet.tsx
+++ b/apps/mobile/src/session/ContextSheet.tsx
@@ -18,7 +18,7 @@ import {
View,
useWindowDimensions,
} from 'react-native';
-import { Text } from '@/components/AppText';
+import { Text, TextInput } from '@/components/AppText';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import { computeContextSheetSnapHeights, type ContextSheetSnap } from '@/session/contextSheetModel';
import { SheetModal } from '@/session/SheetModal';
@@ -157,6 +157,8 @@ export interface ContextSheetRowProps {
icon: ReactNode;
label: string;
onPress: () => void;
+ /** 长按(如协同 Worker 行的管理操作);不传则只有点按。 */
+ onLongPress?: () => void;
/** 'chevron' 表示带二级视图;也可以传自定义 trailing 节点。 */
trailing?: 'chevron' | ReactNode;
disabled?: boolean;
@@ -165,6 +167,8 @@ export interface ContextSheetRowProps {
testID?: string;
/** Destructive actions (delete) read in the destructive text color. */
destructive?: boolean;
+ /** 标签下方的次要说明(如 Worker 的 Agent · 模型)。 */
+ detail?: string;
}
export function ContextSheetRow({
@@ -172,12 +176,14 @@ export function ContextSheetRow({
icon,
label,
onPress,
+ onLongPress,
trailing,
disabled,
busy,
accessibilityHint,
testID,
destructive = false,
+ detail,
}: ContextSheetRowProps) {
const styles = useThemedStyles(makeContextSheetStyles);
const { colors } = useTheme();
@@ -189,13 +195,21 @@ export function ContextSheetRow({
accessibilityRole="button"
accessibilityState={{ disabled: disabled || busy }}
disabled={disabled || busy}
+ onLongPress={onLongPress}
onPress={() => (dismissBeforePress ? dismiss(onPress) : onPress())}
style={({ pressed }) => [styles.row, pressed && styles.rowPressed, disabled && styles.rowDisabled]}
testID={testID}
>
<View style={styles.rowLeft}>
{icon}
- <Text style={[styles.rowLabel, destructive && { color: colors.destructive }]}>{label}</Text>
+ {detail ? (
+ <View style={styles.rowTextColumn}>
+ <Text numberOfLines={1} style={[styles.rowLabel, destructive && { color: colors.destructive }]}>{label}</Text>
+ <Text numberOfLines={1} style={styles.rowDetail}>{detail}</Text>
+ </View>
+ ) : (
+ <Text style={[styles.rowLabel, destructive && { color: colors.destructive }]}>{label}</Text>
+ )}
</View>
<View style={styles.rowTrailing}>
{busy ? (
@@ -251,6 +265,114 @@ export function ContextSheetFooterButton({
);
}
+/** 分组内的说明文字(提示 / 错误),不可点击。 */
+export function ContextSheetNote({ text, tone = 'secondary', testID }: {
+ text: string;
+ tone?: 'secondary' | 'error';
+ testID?: string;
+}) {
+ const styles = useThemedStyles(makeContextSheetStyles);
+ return (
+ <Text style={[styles.note, tone === 'error' && styles.noteError]} testID={testID}>{text}</Text>
+ );
+}
+
+export interface ContextSheetChoiceRowProps<T extends string> {
+ label: string;
+ options: readonly { id: T; label: string }[];
+ value: T | null;
+ onChange: (value: T) => void;
+ disabled?: boolean;
+ testID?: string;
+}
+
+/** 单选(pill 组;iOS 版为原生 Picker)。 */
+export function ContextSheetChoiceRow<T extends string>({
+ label,
+ options,
+ value,
+ onChange,
+ disabled,
+ testID,
+}: ContextSheetChoiceRowProps<T>) {
+ const styles = useThemedStyles(makeContextSheetStyles);
+ return (
+ // 标签由外层分组标题承担(iOS 原生 Picker 自带 label),这里只作无障碍分组名。
+ <View accessibilityLabel={label} accessibilityRole="radiogroup" style={styles.choiceRow} testID={testID}>
+ <View style={styles.choicePills}>
+ {options.map((option) => {
+ const selected = option.id === value;
+ return (
+ <Pressable
+ accessibilityLabel={option.label}
+ accessibilityRole="radio"
+ accessibilityState={{ checked: selected, disabled }}
+ disabled={disabled}
+ key={option.id}
+ onPress={() => onChange(option.id)}
+ style={styles.choiceHitArea}
+ testID={testID ? `${testID}.${option.id}` : undefined}
+ >
+ {({ pressed }) => (
+ <View
+ style={[
+ styles.choicePill,
+ selected && styles.choicePillSelected,
+ pressed && styles.rowPressed,
+ disabled && styles.rowDisabled,
+ ]}
+ >
+ <Text style={[styles.choicePillText, selected && styles.choicePillTextSelected]}>{option.label}</Text>
+ </View>
+ )}
+ </Pressable>
+ );
+ })}
+ </View>
+ </View>
+ );
+}
+
+export interface ContextSheetTextFieldProps {
+ value: string;
+ onChange: (value: string) => void;
+ placeholder: string;
+ accessibilityLabel: string;
+ multiline?: boolean;
+ disabled?: boolean;
+ maxLength?: number;
+ testID?: string;
+}
+
+/** 文本输入(iOS 版为原生 TextField)。 */
+export function ContextSheetTextField({
+ value,
+ onChange,
+ placeholder,
+ accessibilityLabel,
+ multiline,
+ disabled,
+ maxLength,
+ testID,
+}: ContextSheetTextFieldProps) {
+ const styles = useThemedStyles(makeContextSheetStyles);
+ const { colors } = useTheme();
+ return (
+ <TextInput
+ accessibilityLabel={accessibilityLabel}
+ editable={!disabled}
+ maxLength={maxLength}
+ multiline={multiline}
+ onChangeText={onChange}
+ placeholder={placeholder}
+ placeholderTextColor={colors.textTertiary}
+ style={[styles.textField, multiline && styles.textFieldMultiline]}
+ testID={testID}
+ value={value}
+ />
+ );
+}
+
const ROW_HEIGHT = 48;
function makeContextSheetStyles(colors: ThemeColors) {
@@ -303,6 +425,7 @@ function makeContextSheetStyles(colors: ThemeColors) {
rowLeft: {
alignItems: 'center' as const,
flexDirection: 'row' as const,
+ flexShrink: 1,
gap: spacing.md,
},
rowLabel: {
@@ -311,6 +434,75 @@ function makeContextSheetStyles(colors: ThemeColors) {
lineHeight: lineHeight.body,
fontWeight: fontWeight.medium,
},
+ rowTextColumn: {
+ flexShrink: 1,
+ gap: 2,
+ },
+ rowDetail: {
+ color: colors.textTertiary,
+ fontSize: typeScale.footnote,
+ lineHeight: lineHeight.caption,
+ },
+ note: {
+ color: colors.textTertiary,
+ fontSize: typeScale.footnote,
+ lineHeight: lineHeight.caption,
+ paddingVertical: spacing.sm,
+ },
+ noteError: {
+ color: colors.errorText,
+ },
+ choiceRow: {
+ gap: spacing.sm,
+ paddingVertical: spacing.sm,
+ },
+ choicePills: {
+ columnGap: spacing.sm,
+ flexDirection: 'row' as const,
+ flexWrap: 'wrap' as const,
+ },
+ // 命中区 44pt(可见 pill 仍是 32pt);换行时相邻两行命中区之间的留白就是 pill 的上下余量。
+ choiceHitArea: {
+ height: 44,
+ justifyContent: 'center' as const,
+ },
+ choicePill: {
+ alignItems: 'center' as const,
+ backgroundColor: colors.surfaceChip,
+ borderRadius: radius.pill,
+ height: 32,
+ justifyContent: 'center' as const,
+ paddingHorizontal: spacing.md,
+ },
+ choicePillSelected: {
+ backgroundColor: colors.cta,
+ },
+ choicePillText: {
+ color: colors.textPrimary,
+ fontSize: typeScale.footnote,
+ lineHeight: lineHeight.caption,
+ fontWeight: fontWeight.medium,
+ },
+ choicePillTextSelected: {
+ color: colors.ctaText,
+ },
+ // 单行输入按 pill,多行输入按 inner-control 8px(DESIGN.md §5)。
+ textField: {
+ backgroundColor: colors.surface,
+ borderColor: colors.border,
+ borderRadius: radius.pill,
+ borderWidth: StyleSheet.hairlineWidth,
+ color: colors.textPrimary,
+ fontSize: typeScale.body,
+ marginVertical: spacing.sm,
+ paddingHorizontal: spacing.md,
+ paddingVertical: spacing.sm + 2,
+ },
+ textFieldMultiline: {
+ borderRadius: radius.control,
+ minHeight: 96,
+ textAlignVertical: 'top' as const,
+ },
rowTrailing: {
alignItems: 'center' as const,
flexDirection: 'row' as const,
diff --git a/apps/mobile/src/session/ContextSheetCollabView.tsx b/apps/mobile/src/session/ContextSheetCollabView.tsx
new file mode 100644
index 0000000000..f7b2521480
--- /dev/null
+++ b/apps/mobile/src/session/ContextSheetCollabView.tsx
@@ -0,0 +1,301 @@
+/**
+ * + 面板的「协同模式」二级视图(会话页与新建任务页共用)。
+ *
+ * - OrcaWorkerFormView:开启协同 / 创建新 Worker 的表单(角色、Agent、模型、权限、初始任务)。
+ * 提交按钮由页面放在 ContextSheet 的 footer 槽。
+ * - OrcaTeamPanelView:Lead 任务的 Worker 列表 + 创建 / 结束协同。
+ *
+ * 两者只用 ContextSheet 的跨平台原语(Group / Row / Note / ChoiceRow / TextField)拼装,
+ * iOS 原生面板与 Android 面板共用本文件。团队真身在被控端,这里只渲染镜像并回调页面。
+ */
+import { useTranslation } from 'react-i18next';
+import { View } from 'react-native';
+import { Bot, CircleStop, UserPlus } from 'lucide-react-native';
+import {
+ ORCA_PREDEFINED_WORKER_ROLES,
+ ORCA_WORKER_ROLE_MAX_LENGTH,
+ orcaWorkerSlotState,
+ type OrcaCollaborationSettings,
+ type OrcaTeamWorker,
+ type OrcaWorkerAgentKind,
+ type OrcaWorkerPermissionMode,
+} from '@cindy/maker-shared/orca-team';
+import { Text } from '@/components/AppText';
+import {
+ ContextSheetChoiceRow,
+ ContextSheetGroup,
+ ContextSheetNote,
+ ContextSheetRow,
+ ContextSheetTextField,
+} from '@/session/ContextSheet';
+import {
+ orcaAgentLabel,
+ orcaWorkerDisplayName,
+ orcaWorkerStatusLabel,
+ type OrcaWorkerFormValue,
+} from '@/session/orcaTeam';
+import { iconSize, iconStroke, lineHeight, radius, typeScale, useTheme } from '@/theme';
+
+const CUSTOM_ROLE = '__custom__';
+
+export function isPredefinedOrcaRole(role: string): boolean {
+ return (ORCA_PREDEFINED_WORKER_ROLES as readonly string[]).includes(role);
+}
+
+/** 自定义角色名与预设重名时的错误文案 key;其余情况 null。 */
+export function orcaWorkerFormErrorKey(form: OrcaWorkerFormValue, customRoleMode: boolean): string | null {
+ const role = form.role.trim();
+ return customRoleMode && role && isPredefinedOrcaRole(role.toLowerCase())
+ ? 'session.collab.customRolePredefinedError'
+ : null;
+}
+
+export function canSubmitOrcaWorkerForm(form: OrcaWorkerFormValue, customRoleMode: boolean): boolean {
+ return form.role.trim().length > 0 && orcaWorkerFormErrorKey(form, customRoleMode) === null;
+}
+
+export interface OrcaWorkerFormViewProps {
+ form: OrcaWorkerFormValue;
+ /** 自定义角色模式(页面持有,以便选中「自定义」后清空的角色名仍停留在自定义输入)。 */
+ customRoleMode: boolean;
+ onCustomRoleModeChange(next: boolean): void;
+ onChange(patch: Partial<OrcaWorkerFormValue>): void;
+ /** 切 Agent 交给页面:带出该 Agent 上次记住的模型 / 推理强度 / Fast。 */
+ onAgentChange(agent: OrcaWorkerAgentKind): void;
+ /** 权限切换交给页面:进入完全访问前需要确认。 */
+ onPermissionChange(mode: OrcaWorkerPermissionMode): void;
+ agents: readonly OrcaWorkerAgentKind[];
+ onPickModel(): void;
+ busy: boolean;
+ notice?: string | null;
+ error?: string | null;
+}
+
+export function OrcaWorkerFormView({
+ form,
+ customRoleMode,
+ onCustomRoleModeChange,
+ onChange,
+ onAgentChange,
+ onPermissionChange,
+ agents,
+ onPickModel,
+ busy,
+ notice,
+ error,
+}: OrcaWorkerFormViewProps) {
+ const { t } = useTranslation();
+ const { colors } = useTheme();
+ const roleOptions = [
+ ...ORCA_PREDEFINED_WORKER_ROLES.map((role) => ({ id: role as string, label: role as string })),
+ { id: CUSTOM_ROLE, label: t('session.collab.customRole') },
+ ];
+ const validation = orcaWorkerFormErrorKey(form, customRoleMode);
+ const modelLabel = form.model?.id ?? t('session.collab.modelDefault');
+ return (
+ <>
+ <ContextSheetGroup label={t('session.collab.roleLabel')}>
+ <ContextSheetChoiceRow
+ disabled={busy}
+ label={t('session.collab.roleLabel')}
+ onChange={(next) => {
+ if (next === CUSTOM_ROLE) {
+ onCustomRoleModeChange(true);
+ onChange({ role: '' });
+ return;
+ }
+ onCustomRoleModeChange(false);
+ onChange({ role: next });
+ }}
+ options={roleOptions}
+ testID="collab.roleOptions"
+ value={customRoleMode ? CUSTOM_ROLE : form.role}
+ />
+ {customRoleMode ? (
+ <ContextSheetTextField
+ accessibilityLabel={t('session.collab.customRole')}
+ disabled={busy}
+ maxLength={ORCA_WORKER_ROLE_MAX_LENGTH}
+ onChange={(role) => onChange({ role })}
+ placeholder={t('session.collab.customRolePlaceholder')}
+ testID="collab.customRoleInput"
+ value={form.role}
+ />
+ ) : null}
+ <ContextSheetNote text={validation ? t(validation) : t('session.collab.roleHint')} tone={validation ? 'error' : 'secondary'} />
+ </ContextSheetGroup>
+ <ContextSheetGroup label={t('session.collab.agentLabel')}>
+ <ContextSheetChoiceRow
+ disabled={busy || agents.length < 2}
+ label={t('session.collab.agentLabel')}
+ onChange={onAgentChange}
+ options={agents.map((agent) => ({ id: agent, label: orcaAgentLabel(agent) }))}
+ testID="collab.agentOptions"
+ value={form.agent}
+ />
+ <ContextSheetRow
+ detail={form.model ? undefined : t('session.collab.modelDefaultHint')}
+ // iOS 原生 sheet 不能叠开:先收起 + 面板再打开模型选择器。
+ dismissBeforePress
+ disabled={busy}
+ icon={<Bot color={colors.textPrimary} size={iconSize.lg} strokeWidth={iconStroke.regular} />}
+ label={t('session.collab.modelLabel')}
+ onPress={onPickModel}
+ testID="collab.modelRow"
+ trailing={(
+ <Text numberOfLines={1} style={{ color: colors.textTertiary, fontSize: typeScale.footnote, lineHeight: lineHeight.caption, maxWidth: 180 }}>
+ {modelLabel}
+ </Text>
+ )}
+ />
+ </ContextSheetGroup>
+ <ContextSheetGroup label={t('session.collab.permissionLabel')}>
+ <ContextSheetChoiceRow
+ disabled={busy}
+ label={t('session.collab.permissionLabel')}
+ onChange={onPermissionChange}
+ options={[
+ { id: 'auto' as const, label: t('session.collab.permissionAuto') },
+ { id: 'bypassPermissions' as const, label: t('session.collab.permissionFull') },
+ ]}
+ testID="collab.permissionOptions"
+ value={form.permissionMode}
+ />
+ <ContextSheetNote text={t(form.permissionMode === 'auto'
+ ? 'session.collab.permissionAutoHint'
+ : 'session.collab.permissionFullHint')}
+ />
+ </ContextSheetGroup>
+ <ContextSheetGroup label={t('session.collab.initialTaskLabel')}>
+ <ContextSheetTextField
+ accessibilityLabel={t('session.collab.initialTaskLabel')}
+ disabled={busy}
+ multiline
+ onChange={(initialTask) => onChange({ initialTask })}
+ placeholder={t('session.collab.initialTaskPlaceholder')}
+ testID="collab.initialTaskInput"
+ value={form.initialTask}
+ />
+ </ContextSheetGroup>
+ {notice || error ? (
+ <ContextSheetGroup label="">
+ {notice ? <ContextSheetNote text={notice} /> : null}
+ {error ? <ContextSheetNote text={error} tone="error" testID="collab.formError" /> : null}
+ </ContextSheetGroup>
+ ) : null}
+ </>
+ );
+}
+
+export interface OrcaTeamPanelViewProps {
+ workers: readonly OrcaTeamWorker[];
+ /** null = 还没读到被控端设置:不在手机上判名额,由被控端裁决。 */
+ settings: OrcaCollaborationSettings | null;
+ loading: boolean;
+ busy: boolean;
+ error?: string | null;
+ /** 点按:直接打开 Worker 任务。 */
+ onWorkerPress(worker: OrcaTeamWorker): void;
+ /** 长按:设为焦点 / 归档等管理操作。 */
+ onWorkerLongPress(worker: OrcaTeamWorker): void;
+ onCreateWorker(): void;
+ onEndTeam(): void;
+}
+
+function WorkerStatusDot({ status }: { status: OrcaTeamWorker['status'] }) {
+ const { colors } = useTheme();
+ const color = status === 'running'
+ ? colors.statusAccent
+ : status === 'done'
+ ? colors.statusDone
+ : status === 'error'
+ ? colors.statusError
+ : colors.textTertiary;
+ return (
+ <View style={{ width: iconSize.lg, alignItems: 'center' }}>
+ <View style={{ width: 8, height: 8, borderRadius: radius.pill, backgroundColor: color }} />
+ </View>
+ );
+}
+
+export function OrcaTeamPanelView({
+ workers,
+ settings,
+ loading,
+ busy,
+ error,
+ onWorkerPress,
+ onWorkerLongPress,
+ onCreateWorker,
+ onEndTeam,
+}: OrcaTeamPanelViewProps) {
+ const { t } = useTranslation();
+ const { colors } = useTheme();
+ const running = workers.filter((worker) => worker.status === 'running').length;
+ const slot = settings ? orcaWorkerSlotState(workers, settings) : 'ok';
+ const createHint = settings && slot === 'hard'
+ ? t('session.collab.hardLimitHint', { limit: settings.workerHardLimit })
+ : settings && slot === 'soft'
+ ? t('session.collab.softLimitHint', { limit: settings.workerSoftLimit })
+ : null;
+ return (
+ <>
+ <ContextSheetGroup label={t('session.collab.workerCountSummary', { count: workers.length, running })}>
+ {workers.map((worker) => (
+ <ContextSheetRow
+ detail={[
+ orcaAgentLabel(worker.agentKind),
+ worker.model,
+ worker.focused ? t('session.collab.focused') : null,
+ ].filter(Boolean).join(' · ')}
+ disabled={busy}
+ icon={<WorkerStatusDot status={worker.status} />}
+ key={worker.workerId}
+ label={orcaWorkerDisplayName(worker)}
+ onLongPress={() => onWorkerLongPress(worker)}
+ onPress={() => onWorkerPress(worker)}
+ testID={`collab.worker.${worker.workerId}`}
+ trailing={(
+ <Text style={{ color: worker.status === 'error' ? colors.statusError : colors.textTertiary, fontSize: typeScale.footnote, lineHeight: lineHeight.caption }}>
+ {orcaWorkerStatusLabel(worker.status)}
+ </Text>
+ )}
+ />
+ ))}
+ {workers.length === 0 ? (
+ <ContextSheetNote text={loading ? t('session.collab.loading') : t('session.collab.noWorkers')} />
+ ) : null}
+ </ContextSheetGroup>
+ <ContextSheetGroup label={t('session.collab.manageGroup')}>
+ <ContextSheetRow
+ accessibilityHint={createHint ?? undefined}
+ disabled={busy || slot === 'hard'}
+ icon={<UserPlus color={colors.textPrimary} size={iconSize.lg} strokeWidth={iconStroke.regular} />}
+ label={t('session.collab.createWorkerTitle')}
+ onPress={onCreateWorker}
+ testID="collab.createWorkerRow"
+ trailing="chevron"
+ />
+ <ContextSheetRow
+ destructive
+ disabled={busy}
+ icon={<CircleStop color={colors.destructive} size={iconSize.lg} strokeWidth={iconStroke.regular} />}
+ label={t('session.collab.stop')}
+ onPress={onEndTeam}
+ testID="collab.stopRow"
+ />
+ </ContextSheetGroup>
+ <ContextSheetGroup label="">
+ {createHint ? <ContextSheetNote text={createHint} /> : null}
+ {settings ? (
+ <ContextSheetNote text={t('session.collab.limitSummary', {
+ soft: settings.workerSoftLimit,
+ hard: settings.workerHardLimit,
+ })}
+ />
+ ) : null}
+ {error ? <ContextSheetNote text={error} tone="error" testID="collab.teamError" /> : null}
+ </ContextSheetGroup>
+ </>
+ );
+}
diff --git a/apps/mobile/src/session/InlineQueueSection.tsx b/apps/mobile/src/session/InlineQueueSection.tsx
index 2903793223..c1bfdbd4ee 100644
--- a/apps/mobile/src/session/InlineQueueSection.tsx
+++ b/apps/mobile/src/session/InlineQueueSection.tsx
@@ -43,7 +43,6 @@ export interface InlineQueueSectionProps {
sessionSource?: string | null;
busy?: boolean;
readOnlyReason?: string | null;
- errorRecoveryReadOnlyReason: string | null;
onResume(): void;
onRetryError(): void;
onClearError(): void;
@@ -54,7 +53,6 @@ export function InlineQueueSection({
sessionSource,
busy,
readOnlyReason,
- errorRecoveryReadOnlyReason,
onResume,
onRetryError,
onClearError,
@@ -70,7 +68,7 @@ export function InlineQueueSection({
if (!hasBanner) return null;
const controlsDisabled = busy || !!readOnlyReason;
- const errorDisabledReason = errorRecoveryReadOnlyReason
+ const errorDisabledReason = readOnlyReason
|| (busy ? t('message.queuePresentation.row.busy') : null);
const retryable = !requiresAgentErrorConfigurationChange(projection.error ?? '');
const retryDisabledReason = errorDisabledReason
diff --git a/apps/mobile/src/session/InteractionPanel.tsx b/apps/mobile/src/session/InteractionPanel.tsx
index c0f3f71451..0a97927214 100644
--- a/apps/mobile/src/session/InteractionPanel.tsx
+++ b/apps/mobile/src/session/InteractionPanel.tsx
@@ -145,7 +145,6 @@ function InteractionPanelContent({
planViewerState,
onPlanViewerStateChange,
onError,
- readOnlyReason,
}: {
embedded?: boolean;
safeAreaBottomInset?: number;
@@ -169,7 +168,6 @@ function InteractionPanelContent({
onActiveRequestIdChange?(requestId: string | null): void;
planViewerState?: MobilePlanViewerState;
onPlanViewerStateChange?(state: MobilePlanViewerState): void;
- readOnlyReason?: string | null;
onError(message: string | null): void;
}) {
const styles = useInteractionStyles();
@@ -203,7 +201,6 @@ function InteractionPanelContent({
const kind = interactionKind(activeInteraction);
const queuePresentation = buildPendingInteractionQueuePresentation(sortedInteractions, {
maxVisible: sortedInteractions.length || 1,
- readOnly: !!readOnlyReason,
}, mobilePresentationLocalizer);
const activeRequestIdForPresentation = readRequestId(activeInteraction);
const selectedQueueItem = queuePresentation.items.find((item) => item.requestId === activeRequestIdForPresentation)
@@ -253,7 +250,7 @@ function InteractionPanelContent({
gap: touchLayout.cardGap,
padding: touchLayout.cardPadding,
};
- if (readOnlyReason || isSharedTaskPeer(deviceId)) {
+ if (isSharedTaskPeer(deviceId)) {
return (
<View style={[styles.root, fillAvailableHeight && styles.rootFill, rootLayoutStyle]} testID="interaction.panel">
<PendingTaskHeader
@@ -264,8 +261,8 @@ function InteractionPanelContent({
<View style={[styles.card, cardLayoutStyle]} testID="interaction.readOnlyCard">
<Text style={styles.kind}>{t('interaction.panel.readOnlyKind')}</Text>
<Text style={styles.cardTitle}>{t('interaction.panel.readOnlyTitle')}</Text>
- <Text style={styles.body}>{readOnlyReason ?? t('sharedTask.waitingHost')}</Text>
- {isSharedTaskPeer(deviceId) && <Text selectable style={styles.body}>{JSON.stringify(activeInteraction.request, null, 2)}</Text>}
+ <Text style={styles.body}>{t('sharedTask.waitingHost')}</Text>
+ <Text selectable style={styles.body}>{JSON.stringify(activeInteraction.request, null, 2)}</Text>
</View>
</View>
);
diff --git a/apps/mobile/src/session/PlanModeChip.tsx b/apps/mobile/src/session/PlanModeChip.tsx
index 9144cf8278..6130f436fb 100644
--- a/apps/mobile/src/session/PlanModeChip.tsx
+++ b/apps/mobile/src/session/PlanModeChip.tsx
@@ -4,38 +4,77 @@
* 本 chip 表达;点 × 退出并恢复进入前的权限档。中性 chip token(与 GoalIndicator 同精神)。
*/
import { ListTodo, X } from 'lucide-react-native';
+import type { ReactNode } from 'react';
import { useTranslation } from 'react-i18next';
import { Pressable, View } from 'react-native';
import { Text } from '@/components/AppText';
+import { MOBILE_COMPOSER_CONTROL_SIZE } from '@/session/composerVoiceButtonAnchor';
import { fontWeight, iconSize, iconStroke, lineHeight, radius, spacing, typeScale, useTheme, useThemedStyles, type ThemeColors } from '@/theme';
export interface PlanModeChipProps {
onExit: () => void;
disabled?: boolean;
testID?: string;
+ /** 复用同一 chip 表达其它一次性草稿模式(如新建任务的「协同」);缺省为计划模式。 */
+ icon?: ReactNode;
+ label?: string;
+ exitAccessibilityLabel?: string;
+ /** 点 chip 主体(非 ×)重新打开该模式的设置。 */
+ onPress?: () => void;
}
-export function PlanModeChip({ onExit, disabled, testID }: PlanModeChipProps) {
+export function PlanModeChip({ onExit, disabled, testID, icon, label, exitAccessibilityLabel, onPress }: PlanModeChipProps) {
const styles = useThemedStyles(makeChipStyles);
const { colors } = useTheme();
const { t } = useTranslation();
+ const body = (
+ <>
+ {icon ?? <ListTodo color={colors.textPrimary} size={iconSize.sm} strokeWidth={iconStroke.regular} />}
+ <Text style={styles.label}>{label ?? t('interaction.planMode.label')}</Text>
+ </>
+ );
+ const exit = (
+ <Pressable
+ accessibilityLabel={exitAccessibilityLabel ?? t('interaction.planMode.exit')}
+ accessibilityRole="button"
+ accessibilityState={{ disabled }}
+ disabled={disabled}
+ hitSlop={8}
+ onPress={onExit}
+ style={({ pressed }) => [styles.close, pressed && styles.pressed]}
+ testID={testID ? `${testID}.exit` : undefined}
+ >
+ <X color={colors.textSecondary} size={iconSize.sm} strokeWidth={iconStroke.bold} />
+ </Pressable>
+ );
+ if (!onPress) {
+ return (
+ <View style={styles.chip} testID={testID}>
+ {body}
+ {exit}
+ </View>
+ );
+ }
+ // 可点开的 chip:整颗 chip 都是打开区。外层透明命中区与相邻工具按钮同高
+ // (MOBILE_COMPOSER_CONTROL_SIZE,不改工具条行高),再加 hitSlop 补足 44pt;可见 chip 仍是 28pt。
+ // × 嵌在里面,点 × 由它自己响应。
return (
- <View style={styles.chip} testID={testID}>
- <ListTodo color={colors.textPrimary} size={iconSize.sm} strokeWidth={iconStroke.regular} />
- <Text style={styles.label}>{t('interaction.planMode.label')}</Text>
- <Pressable
- accessibilityLabel={t('interaction.planMode.exit')}
- accessibilityRole="button"
- accessibilityState={{ disabled }}
- disabled={disabled}
- hitSlop={8}
- onPress={onExit}
- style={({ pressed }) => [styles.close, pressed && styles.pressed]}
- testID={testID ? `${testID}.exit` : undefined}
- >
- <X color={colors.textSecondary} size={iconSize.sm} strokeWidth={iconStroke.bold} />
- </Pressable>
- </View>
+ <Pressable
+ accessibilityLabel={label}
+ accessibilityRole="button"
+ disabled={disabled}
+ hitSlop={{ top: 5, bottom: 5, left: 4, right: 0 }}
+ onPress={onPress}
+ style={styles.hitArea}
+ testID={testID ? `${testID}.open` : undefined}
+ >
+ {({ pressed }) => (
+ <View style={[styles.chip, pressed && styles.pressed]} testID={testID}>
+ <View style={styles.body}>{body}</View>
+ {exit}
+ </View>
+ )}
+ </Pressable>
);
}
@@ -51,6 +90,15 @@ function makeChipStyles(colors: ThemeColors) {
paddingLeft: spacing.md,
paddingRight: spacing.sm,
},
+ hitArea: {
+ height: MOBILE_COMPOSER_CONTROL_SIZE,
+ justifyContent: 'center' as const,
+ },
+ body: {
+ alignItems: 'center' as const,
+ flexDirection: 'row' as const,
+ gap: spacing.xs,
+ },
label: {
color: colors.textPrimary,
fontSize: typeScale.caption,
diff --git a/apps/mobile/src/session/SessionHeaderNativeControls.ios.tsx b/apps/mobile/src/session/SessionHeaderNativeControls.ios.tsx
index f16553c55b..1d3f21db43 100644
--- a/apps/mobile/src/session/SessionHeaderNativeControls.ios.tsx
+++ b/apps/mobile/src/session/SessionHeaderNativeControls.ios.tsx
@@ -162,6 +162,7 @@ export function SessionHeaderNativeActions({
onDetails,
onDesktop,
onAction,
+ detailsOnly = false,
}: SessionHeaderNativeActionsProps) {
const { colors, mode } = useTheme();
const groupStyle = useNativeGlassGroupStyle();
@@ -175,12 +176,13 @@ export function SessionHeaderNativeActions({
colorScheme={mode}
seedColor={colors.textPrimary}
ignoreSafeArea="all"
- style={{ width: navigationChrome.target * 3, height: navigationChrome.target }}
+ style={{ width: navigationChrome.target * (detailsOnly ? 1 : 3), height: navigationChrome.target }}
>
<HStack
spacing={0}
modifiers={groupStyle}
>
+ {detailsOnly ? null : <>
<Button
onPress={onDesktop}
testID="session.remoteDesktop"
@@ -206,6 +208,7 @@ export function SessionHeaderNativeActions({
>
<SessionHeaderIcon icon={Folder} color={colors.textPrimary} />
</Button>
+ </>}
<Button
label={moreLabel}
systemImage="ellipsis"
diff --git a/apps/mobile/src/session/SessionHeaderNativeControls.tsx b/apps/mobile/src/session/SessionHeaderNativeControls.tsx
index 14063b0f76..1b0636fb37 100644
--- a/apps/mobile/src/session/SessionHeaderNativeControls.tsx
+++ b/apps/mobile/src/session/SessionHeaderNativeControls.tsx
@@ -32,6 +32,8 @@ export interface SessionHeaderNativeActionsProps {
onDetails(): void;
onDesktop(): void;
onAction(id: SessionActionStripAction["id"]): void;
+ /** 只保留「更多」(协同 Worker 任务不提供远程桌面 / 文件入口)。 */
+ detailsOnly?: boolean;
}
// Only rendered by the iOS branch; keep SwiftUI imports out of Android/web bundles.
diff --git a/apps/mobile/src/session/SessionMenuSheet.tsx b/apps/mobile/src/session/SessionMenuSheet.tsx
index fcf9838e61..3237759335 100644
--- a/apps/mobile/src/session/SessionMenuSheet.tsx
+++ b/apps/mobile/src/session/SessionMenuSheet.tsx
@@ -22,6 +22,8 @@ import {
Archive,
ArchiveRestore,
Copy,
+ CornerUpLeft,
+ Crosshair,
Link2,
LogOut,
Pencil,
@@ -101,6 +103,18 @@ export interface SessionExtraDirBrowserState {
path: string;
}
+export interface SessionMenuWorkerActions {
+ /** 查不到所属 Lead 时为 undefined(入口不出现)。 */
+ onOpenLead?: () => void;
+ /** 已是焦点 / 查不到自身记录时为 undefined。 */
+ onSetFocus?: () => void;
+ /**
+ * 查不到自身记录时为 undefined。确认弹窗在详情面板仍展开时弹出(iOS 原生 sheet 正在收起时
+ * 弹 Alert 会丢),确认后由 onConfirmed 收起面板。
+ */
+ onArchive?: (onConfirmed: () => void) => void;
+}
+
export interface SessionMenuSheetProps {
tagDeviceId?: string;
providerName?: string;
@@ -113,7 +127,6 @@ export interface SessionMenuSheetProps {
initialView: SessionMenuView;
session: RemoteSession;
busy: boolean;
- readOnlyReason?: string | null;
onContextError(error: string | null): void;
/**
* 账号级限额快照(被控端 `maker:usage:account` 原始返回,unknown 防御解析)。
@@ -137,6 +150,11 @@ export interface SessionMenuSheetProps {
onOpenWorkspace(): void;
onOpenSharing?: () => void;
onLeaveSharing?: () => void;
+ /**
+ * 协同 Worker 任务的专属操作。Worker 任务的详情只保留与 Worker 相关的入口(返回 Lead、
+ * 设为焦点、归档 Worker),不出现共享、重命名、置顶、标签、搜索、打开目录等普通任务功能。
+ */
+ worker?: SessionMenuWorkerActions;
leavingSharing?: boolean;
onTogglePinned(): void;
onArchive(): void;
@@ -158,7 +176,6 @@ export function SessionMenuSheet({
initialView,
session,
busy,
- readOnlyReason,
onContextError,
accountUsage,
codexRateLimits,
@@ -174,6 +191,7 @@ export function SessionMenuSheet({
onOpenWorkspace,
onOpenSharing,
onLeaveSharing,
+ worker,
leavingSharing = false,
onTogglePinned,
onArchive,
@@ -330,13 +348,12 @@ export function SessionMenuSheet({
return base;
}, [copiedKey, t]);
- const writeDisabled = busy || !!readOnlyReason;
- const header = buildSessionMenuHeader(session, { readOnlyReason });
+ const header = buildSessionMenuHeader(session);
const actions = buildSessionMenuActions({
archived: session.status === 'archived',
pinned: !!session.pinnedAt,
busy,
- writeDisabled,
+ writeDisabled: busy,
});
const submitRename = useCallback(() => {
@@ -489,10 +506,16 @@ export function SessionMenuSheet({
);
const workspace = buildSessionInfoWorkspace(session);
const sharedGuest = isSharedTaskPeer(session.deviceLinkDeviceId ?? '');
- const showExtraDirs = !sharedGuest && sessionInfoShowsExtraDirs(session);
+ // 协同 Worker 任务:只保留与 Worker 相关的入口(见 SessionMenuWorkerActions)。
+ const workerMode = !messageOnly && session.orcaRole === 'worker';
+ const showExtraDirs = !sharedGuest && !workerMode && sessionInfoShowsExtraDirs(session);
+ // 协同 Worker 的生命周期只能经所属 Lead 的协同面板(归档 Worker / 结束协同)走 Orca 服务;
+ // 通用归档 / 删除会绕过团队状态与焦点收尾。桌面同样不给 Worker 这两个入口。
+ const lifecycleHidden = sharedGuest || session.orcaRole === 'worker';
const mainActions = messageOnly ? [] : actions.filter((action) => sharedGuest ? action.id === 'copyLink' : action.id !== 'delete' && action.id !== 'archive');
- const deleteAction = messageOnly ? undefined : sharedGuest ? undefined : actions.find((action) => action.id === 'delete');
+ const listedActions = workerMode ? [] : mainActions;
+ const deleteAction = messageOnly ? undefined : lifecycleHidden ? undefined : actions.find((action) => action.id === 'delete');
const confirmCodexReset = useCallback(() => {
if (!resetSummary?.canReset || codexResetBusy) return;
@@ -561,8 +584,7 @@ export function SessionMenuSheet({
) : (
<>
{(header.chips.length > 0 ||
- (!messageOnly && !!session.tags?.length) ||
- !!readOnlyReason) && (
+ (!messageOnly && !!session.tags?.length)) && (
<View style={styles.headerBlock} testID="session.menuHeader">
{!messageOnly && !!session.tags?.length && (
<View
@@ -586,16 +608,23 @@ export function SessionMenuSheet({
))}
</View>
) : null}
- {readOnlyReason ? (
- <Text style={styles.readOnlyText} testID="session.menuReadOnlyNotice">
- {readOnlyReason}</Text>
- ) : null}
</View>
)}
{!messageOnly ? <SessionUsageSummary providerName={providerName} session={session} usage={menuUsage} contextUsage={contextUsage} onPress={openInfo} translucent={Platform.OS === 'ios'} /> : null}
- {!messageOnly && isSharedTaskPeer(session.deviceLinkDeviceId) && onLeaveSharing ? (
+ {workerMode ? (
+ <WorkerMenuActions
+ onClose={onClose}
+ worker={worker}
+ onRun={(action) => {
+ onClose();
+ action();
+ }}
+ />
+ ) : null}
+
+ {workerMode ? null : !messageOnly && isSharedTaskPeer(session.deviceLinkDeviceId) && onLeaveSharing ? (
Platform.OS === 'ios' ? <SessionDetailsNativeActions actions={[{
label: t('sharedTask.leave'), danger: true, disabled: leavingSharing,
onPress: onLeaveSharing, testID: 'session.leaveSharingButton',
@@ -614,14 +643,14 @@ export function SessionMenuSheet({
</View>
) : null}
{Platform.OS === 'ios' ? (
- <SessionDetailsNativeActions actions={mainActions.map(action => ({
+ <SessionDetailsNativeActions actions={listedActions.map(action => ({
label: action.id === 'copyLink' ? copyLabel(action.label, 'copyLink', t('session.menu.linkCopied')) : action.label,
disabled: action.disabled,
testID: action.testID,
onPress: () => handleAction(action),
}))} />
) : <View style={styles.actionGroup}>
- {mainActions.map((action) => (
+ {listedActions.map((action) => (
<MenuActionRow
key={action.id}
disabled={action.disabled}
@@ -635,7 +664,7 @@ export function SessionMenuSheet({
))}
</View>}
- {onOpenSearch ? (
+ {onOpenSearch && !workerMode ? (
Platform.OS === 'ios' ? <SessionDetailsNativeActions actions={[{
label: t('session.presentation.overview.actions.search.label'),
onPress: onOpenSearch,
@@ -645,19 +674,19 @@ export function SessionMenuSheet({
</View>
) : null}
- {!messageOnly && (
+ {!messageOnly && !workerMode && (
<TaskTagsPanel
key={`${tagDeviceId ?? session.deviceLinkDeviceId}:${session.id}`}
session={session}
deviceId={tagDeviceId}
- disabled={busy || !!readOnlyReason}
+ disabled={busy}
expanded={false}
onExpandedChange={(open) => {
if (open) tagsSheet.open();
}}
/>
)}
- {!messageOnly &&
+ {!messageOnly && session.orcaRole !== 'worker' &&
actions
.filter((action) => action.id === 'archive')
.map((action) =>
@@ -772,12 +801,14 @@ export function SessionMenuSheet({
<Text style={styles.infoSectionTitle}>{workspace.label}</Text>
<InfoRow label={workspace.name} mono value={workspace.path} />
<View style={styles.infoActionRow}>
- <MenuPillButton
- label={t('session.menu.openDir')}
- disabled={sharedGuest}
- onPress={onOpenWorkspace}
- testID="session.openWorkspaceButton"
- />
+ {workerMode ? null : (
+ <MenuPillButton
+ label={t('session.menu.openDir')}
+ disabled={sharedGuest}
+ onPress={onOpenWorkspace}
+ testID="session.openWorkspaceButton"
+ />
+ )}
<MenuPillButton
label={copyLabel(t('session.menu.copyPath'), 'workspacePath')}
onPress={() => copyValue('workspacePath', workspace.path)}
@@ -800,7 +831,7 @@ export function SessionMenuSheet({
<View key={dir} style={styles.extraDirRow} testID="session.extraDirRow">
<Text numberOfLines={1} style={styles.extraDirPath}>{dir}</Text>
<MenuPillButton
- disabled={writeDisabled}
+ disabled={busy}
label={t('session.menu.remove')}
onPress={() => removeExtraDir(dir)}
testID="session.extraDirRemoveButton"
@@ -814,7 +845,7 @@ export function SessionMenuSheet({
) : null}
<View style={styles.infoActionRow}>
<MenuPillButton
- disabled={writeDisabled || !!extraDirBrowser?.loading}
+ disabled={busy || !!extraDirBrowser?.loading}
label={extraDirBrowser?.open ? t('session.menu.collapseRemoteDir') : t('session.menu.browseRemoteDir')}
onPress={onToggleExtraDirBrowser}
testID="session.extraDirsBrowseToggle"
@@ -832,13 +863,13 @@ export function SessionMenuSheet({
</Text>
<View style={styles.infoActionRow}>
<MenuPillButton
- disabled={writeDisabled || extraDirBrowser.loading || !extraDirBrowser.parent}
+ disabled={busy || extraDirBrowser.loading || !extraDirBrowser.parent}
label={t('session.menu.parentDir')}
onPress={() => extraDirBrowser.parent && onLoadExtraDirPath(extraDirBrowser.parent)}
testID="session.extraDirsBrowseParentButton"
/>
<MenuPillButton
- disabled={writeDisabled || extraDirBrowser.loading || !extraDirBrowser.path}
+ disabled={busy || extraDirBrowser.loading || !extraDirBrowser.path}
label={t('session.menu.addCurrentDir')}
onPress={() => addExtraDir(extraDirBrowser.path)}
testID="session.extraDirsBrowseAddCurrent"
@@ -853,7 +884,7 @@ export function SessionMenuSheet({
<Pressable
accessibilityLabel={t('session.menu.enterRemoteDir', { name: entry.name })}
accessibilityRole="button"
- disabled={writeDisabled || extraDirBrowser.loading}
+ disabled={busy || extraDirBrowser.loading}
onPress={() => onLoadExtraDirPath(entry.path)}
style={({ pressed }) => [styles.browseEntryButton, pressed && styles.pressed]}
>
@@ -863,7 +894,7 @@ export function SessionMenuSheet({
</Text>
</Pressable>
<MenuPillButton
- disabled={writeDisabled || extraDirBrowser.loading}
+ disabled={busy || extraDirBrowser.loading}
label={t('session.menu.add')}
onPress={() => addExtraDir(entry.path)}
testID="session.extraDirsBrowseAddEntry"
@@ -908,7 +939,7 @@ export function SessionMenuSheet({
<TaskTagsSheet
session={session}
deviceId={tagDeviceId}
- disabled={busy || !!readOnlyReason}
+ disabled={busy}
visible={tagsSheet.visible}
onClose={tagsSheet.close}
onClosed={tagsSheet.closed}
@@ -1006,6 +1037,52 @@ function menuActionIcon(action: SessionMenuAction, session: Pick<RemoteSession,
}
}
+/** 协同 Worker 任务的详情操作:返回 Lead / 设为焦点 / 归档 Worker(各自可用时才出现)。 */
+function WorkerMenuActions({
+ worker,
+ onRun,
+ onClose,
+}: {
+ worker: SessionMenuWorkerActions | undefined;
+ onRun(action: () => void): void;
+ onClose(): void;
+}) {
+ const { t } = useTranslation();
+ const styles = useThemedStyles(makeStyles);
+ const rows = [
+ worker?.onOpenLead ? { key: 'lead', icon: CornerUpLeft, label: t('session.collab.backToLead'), danger: false, run: worker.onOpenLead, testID: 'session.workerBackToLead', keepOpen: false } : null,
+ worker?.onSetFocus ? { key: 'focus', icon: Crosshair, label: t('session.collab.setFocus'), danger: false, run: worker.onSetFocus, testID: 'session.workerSetFocus', keepOpen: false } : null,
+ worker?.onArchive ? { key: 'archive', icon: Archive, label: t('session.collab.archiveConfirm'), danger: true, run: () => worker.onArchive?.(onClose), testID: 'session.workerArchive', keepOpen: true } : null,
+ ].filter((row): row is NonNullable<typeof row> => row !== null);
+ if (rows.length === 0) return null;
+ if (Platform.OS === 'ios') {
+ return (
+ <SessionDetailsNativeActions
+ actions={rows.map((row) => ({
+ label: row.label,
+ danger: row.danger,
+ onPress: () => (row.keepOpen ? row.run() : onRun(row.run)),
+ testID: row.testID,
+ }))}
+ />
+ );
+ }
+ return (
+ <View style={styles.actionGroup} testID="session.workerActions">
+ {rows.map((row) => (
+ <MenuActionRow
+ danger={row.danger}
+ icon={row.icon}
+ key={row.key}
+ label={row.label}
+ onPress={() => (row.keepOpen ? row.run() : onRun(row.run))}
+ testID={row.testID}
+ />
+ ))}
+ </View>
+ );
+}
+
function MenuActionRow({
danger = false,
disabled = false,
@@ -1156,12 +1233,6 @@ const makeStyles = (colors: ThemeColors) => StyleSheet.create({
fontSize: typeScale.caption,
lineHeight: lineHeight.caption,
},
- readOnlyText: {
- textAlign: 'center',
- color: colors.textTertiary,
- fontSize: typeScale.footnote,
- lineHeight: lineHeight.caption,
- },
actionGroup: {
backgroundColor: colors.sheetActionSurface,
borderColor: colors.sheetActionBorder,
diff --git a/apps/mobile/src/session/SessionTailBanner.tsx b/apps/mobile/src/session/SessionTailBanner.tsx
index 875897f666..e1be279110 100644
--- a/apps/mobile/src/session/SessionTailBanner.tsx
+++ b/apps/mobile/src/session/SessionTailBanner.tsx
@@ -21,17 +21,11 @@ import { radius, spacing, typeScale } from '@/theme/tokens';
export interface SessionTailBannerProps {
state: NonNullable<SessionTailBannerState>;
busy?: boolean;
- /**
- * 只读信息版(协同只读 worker 会话):只显示文案不渲染操作行——interrupted
- * 状态没有任何消息行可回落,不显示会让用户不知道任务为何停了(review P2);
- * 操作(续跑/忽略)是写行为,只读会话不给入口。
- */
- readOnly?: boolean;
onContinue(): void;
onDismiss(): void;
}
-export function SessionTailBanner({ state, busy, readOnly, onContinue, onDismiss }: SessionTailBannerProps) {
+export function SessionTailBanner({ state, busy, onContinue, onDismiss }: SessionTailBannerProps) {
const styles = useThemedStyles(makeStyles);
const { t } = useTranslation();
const isInterrupted = state.kind === 'interrupted' || state.continueKind === 'interrupted';
@@ -48,25 +42,23 @@ export function SessionTailBanner({ state, busy, readOnly, onContinue, onDismiss
{text}
</Text>
{state.kind === 'error-tail' && state.rawError && !isInterrupted ? <AgentErrorDetails message={state.rawError} /> : null}
- {readOnly ? null : (
- <View style={styles.actions}>
- {showContinue ? (
- <TailPill
- busy={busy}
- cta
- label={isInterrupted ? t('session.tail.continueTask') : t('session.tail.retry')}
- onPress={onContinue}
- testID="session.tailBanner.continue"
- />
- ) : null}
+ <View style={styles.actions}>
+ {showContinue ? (
<TailPill
busy={busy}
- label={t('session.tail.ignore')}
- onPress={onDismiss}
- testID="session.tailBanner.dismiss"
+ cta
+ label={isInterrupted ? t('session.tail.continueTask') : t('session.tail.retry')}
+ onPress={onContinue}
+ testID="session.tailBanner.continue"
/>
- </View>
- )}
+ ) : null}
+ <TailPill
+ busy={busy}
+ label={t('session.tail.ignore')}
+ onPress={onDismiss}
+ testID="session.tailBanner.dismiss"
+ />
+ </View>
</View>
);
}
diff --git a/apps/mobile/src/session/collaboration.ts b/apps/mobile/src/session/collaboration.ts
index a8a32dbe55..823b875976 100644
--- a/apps/mobile/src/session/collaboration.ts
+++ b/apps/mobile/src/session/collaboration.ts
@@ -13,27 +13,3 @@ export function sessionCollaborationLabel(session: SessionCollaborationLike): st
? i18n.t('session.presentation.collaboration.labelRole', { role: session.orcaRole.trim() })
: null;
}
-
-export function sessionCollaborationNotice(session: SessionCollaborationLike | null): string | null {
- if (!session) return null;
- if (session.orcaRole === 'lead') return i18n.t('session.presentation.collaboration.noticeLead');
- if (session.orcaRole === 'worker') return i18n.t('session.presentation.collaboration.noticeWorker');
- return isCollaborationSession(session)
- ? i18n.t('session.presentation.collaboration.noticeOther')
- : null;
-}
-
-export function sessionCollaborationReadOnlyReason(
- session: SessionCollaborationLike | null,
-): string | null {
- return isCollaborationSession(session)
- ? i18n.t('session.presentation.collaboration.readOnlyReason')
- : null;
-}
-
-export function sessionCollaborationComposerReadOnlyReason(
- session: SessionCollaborationLike | null,
-): string | null {
- if (!isCollaborationSession(session) || session?.orcaRole === 'lead') return null;
- return i18n.t('session.presentation.collaboration.composerReadOnlyReason');
-}
diff --git a/apps/mobile/src/session/newSessionCreation.ts b/apps/mobile/src/session/newSessionCreation.ts
index ccb23ec1de..9edebccd64 100644
--- a/apps/mobile/src/session/newSessionCreation.ts
+++ b/apps/mobile/src/session/newSessionCreation.ts
@@ -33,7 +33,8 @@ import { DEFAULT_DRAFT_SESSION_TITLE } from '@cindy/maker-shared/session-title';
import { i18n } from '@/i18n';
import { isTransientRemoteError, withTransientRemoteRetry } from '@/device-link/remoteRetry';
import { formatRemoteError } from '@/device-link/remoteStatus';
-import type { MobileMakerTransport } from '@/device-link/mobileMakerTransport';
+import type { MobileMakerTransport, MobileOrcaEnableOptions } from '@/device-link/mobileMakerTransport';
+import { describeOrcaError, enableOrcaTeam, rememberOrcaStartFailure, type OrcaWorkerFormValue } from '@/session/orcaTeam';
import { buildQueuedTextMessage } from '@/session/inputProjection';
import {
extractMobileSessionReferences,
@@ -86,6 +87,13 @@ export interface NewSessionCreationParams {
planModeArm: boolean;
/** 老协议 plan 档一次性语义:enqueue 后要恢复的底层权限档(null = 不需要)。 */
legacyPlanRestore: string | null;
+ /**
+ * 新建即开启协同:createSession 之后、首条消息入队之前开启(首轮 Lead 才有协同工具)。
+ * 失败不阻断创建 —— 任务照单任务继续,原因经 rememberOrcaStartFailure 交给会话页提示。
+ */
+ orcaEnable?: MobileOrcaEnableOptions;
+ /** 协同草稿原值:create-failed「返回编辑」时随草稿带回新建页,不让协同设置静默丢失。 */
+ collabDraft?: OrcaWorkerFormValue;
/**
* 手机两步 worktree 流程第一步已创建的受管目录。create-failed 重试继续复用它;
* 用户放弃返回编辑时先按 sessionId + path 补偿回收,再把原项目目录回填表单。
@@ -133,6 +141,7 @@ export interface NewSessionCreationTask {
readonly draft: NewSessionDraft;
readonly attachments: readonly RemoteSerializedAttachment[];
readonly firstMessageClientId: string;
+ readonly collabDraft?: OrcaWorkerFormValue;
readonly precreatedWorktree?: {
path: string;
recoveryKey: string;
@@ -300,6 +309,7 @@ export function startNewSessionCreation(params: NewSessionCreationParams): void
draft: params.draft,
attachments: params.attachments,
firstMessageClientId,
+ collabDraft: params.collabDraft,
precreatedWorktree: params.precreatedWorktree,
firstMessageSessionRefs,
precreatedWorktreeSessionCreateStarted: false,
@@ -521,6 +531,8 @@ export interface StashedNewSessionDraft {
* 少了什么、需要重新选(review P1)。
*/
notice?: string | null;
+ /** 返回编辑时恢复的协同草稿(null = 这次没开协同)。 */
+ collabDraft: OrcaWorkerFormValue | null;
}
let stashedDraft: StashedNewSessionDraft | null = null;
@@ -554,6 +566,7 @@ export function stashNewSessionDraftForEdit(
: baseDraft,
attachments: override?.attachments ?? task.attachments,
notice: override?.notice ?? null,
+ collabDraft: task.collabDraft ?? null,
};
}
@@ -988,6 +1001,20 @@ async function runPipeline(task: InternalTask): Promise<void> {
freshSession = null;
}
+ // 重跑管线(enqueue 失败后重试)时团队可能已建成:权威行已是 Lead 就不再开启。
+ if (params.orcaEnable && freshSession?.orcaRole !== 'lead') {
+ assertTaskOwnerCurrent(task);
+ try {
+ await enableOrcaTeam(maker, sessionId, params.orcaEnable);
+ assertTaskOwnerCurrent(task);
+ remoteSessionStore.applySessionPatch(params.deviceId, sessionId, { orcaRole: 'lead' });
+ } catch (error) {
+ if (isStaleNewSessionOwnerError(error)) throw error;
+ rememberOrcaStartFailure(sessionId, describeOrcaError(error, null));
+ }
+ assertTaskOwnerCurrent(task);
+ }
+
if (params.planModeArm && !params.transport.handoffFirstMessage) {
// 新协议:入队首条消息前武装计划模式,失败降级为普通发送(对齐原 create())。
assertTaskOwnerCurrent(task);
diff --git a/apps/mobile/src/session/orcaTeam.ts b/apps/mobile/src/session/orcaTeam.ts
new file mode 100644
index 0000000000..967d30529f
--- /dev/null
+++ b/apps/mobile/src/session/orcaTeam.ts
@@ -0,0 +1,460 @@
+/**
+ * 手机端 Orca 协同编排:入口可用性、团队状态订阅与写操作。
+ *
+ * Lead / Worker / team 的真身都在被控端 main,手机只是镜像 + 编排入口(与桌面 device-link
+ * 控制端同一组 channel,见 mobileMakerTransport 的 `orca` 组)。几条不变量:
+ * - 入口判定 fail-closed:被控端不声明 `supportsOrcaWorkerPermissionMode`、或协同插件查询
+ * CHANNEL_NOT_ALLOWED,一律按「设备版本过旧」置灰,不放行到 enable-orca 才撞错。
+ * - 写操作不自动重试;enable-orca 隧道超时不是权威失败 —— 先回查被控端 Worker 列表再定性
+ * (与桌面 remoteCollabHandoff 同口径),查不到才按失败处理。
+ * - 团队列表以被控端为准:`maker:orca:worker-changed` 推送或写操作完成后整表重拉。
+ */
+import {
+ createWorkerLabel,
+ parseOrcaTeamWorkers,
+ readOrcaCollabPolicy,
+ type OrcaCollaborationSettings,
+ type OrcaTeamWorker,
+ type OrcaWorkerAgentKind,
+ type OrcaWorkerPermissionMode,
+} from '@cindy/maker-shared/orca-team';
+import { formatRemoteError, isTransientRemoteError } from '@cindy/maker-shared/device-link-contract';
+import { isLocalOnlyProviderForAgent, isSubscriptionDirectRoute } from '@cindy/model-providers';
+import {
+ chatEligibleSourcesForModel,
+ effectiveSourceIdForModel,
+ getModel,
+ type ProviderView,
+} from '@cindy/model-providers/registry';
+import type { AgentKind } from '@cindy/model-providers/types';
+import { normalizeMobileAgentCapabilities } from '@/session/agentCapabilities';
+import { humanizeRemoteError } from '@/device-link/remoteStatus';
+import { i18n } from '@/i18n';
+import type {
+ MobileMakerTransport,
+ MobileOrcaEnableOptions,
+} from '@/device-link/mobileMakerTransport';
+import type { RemoteSession } from '@/session/types';
+import type { MobileAgentCapabilities } from '@/session/agentCapabilities';
+import type { OrcaWorkerCreationPrefs } from '@/session/orcaWorkerPrefs';
+
+export type { OrcaTeamWorker, OrcaCollaborationSettings, OrcaWorkerAgentKind, OrcaWorkerPermissionMode };
+
+/** 创建 Worker 表单(开启协同与追加 Worker 共用)。 */
+export interface OrcaWorkerFormValue {
+ role: string;
+ agent: OrcaWorkerAgentKind;
+ /** null = 跟随被控端默认(该 Agent 上次新建任务的选择,回落 Lead 模型)。 */
+ model: { id: string; providerId: string | null; effort: string | null; fast: boolean } | null;
+ permissionMode: OrcaWorkerPermissionMode;
+ initialTask: string;
+}
+
+export function orcaAgentKindForSession(session: Pick<RemoteSession, 'agentKind'>): OrcaWorkerAgentKind {
+ return session.agentKind === 'codex' || session.agentKind === 'pi' ? session.agentKind : 'claude-code';
+}
+
+/** 由记忆构造表单:角色回到 developer,初始任务不记忆(与桌面一致)。 */
+export function orcaWorkerFormFromPrefs(
+ prefs: OrcaWorkerCreationPrefs,
+ agent: OrcaWorkerAgentKind,
+): OrcaWorkerFormValue {
+ const remembered = prefs.agents[agent];
+ return {
+ role: 'developer',
+ agent,
+ model: { id: remembered.model, providerId: null, effort: remembered.effort, fast: remembered.fast },
+ permissionMode: prefs.workerPermissionMode,
+ initialTask: '',
+ };
+}
+
+/**
+ * 按被控端能力收敛模型选择(对齐桌面「加载能力后把选择收敛到可用模型和 effort」):
+ * 模型不在该电脑的可用列表 → 回落「默认」(null,交给被控端解析);effort 不在档位表 →
+ * 该模型默认档;模型不支持 Fast → 关 Fast。能力未知(null)时保持原样。
+ *
+ * 显式选了来源时只做可用性检查,不按拍平能力改 effort / Fast:同 id 模型在不同来源的档位与
+ * Fast 支持可能不同,拍平条目会把来源 A 的合法选择改成来源 B 的默认。这两项在提交前按
+ * 该来源自己的条目对账(narrowOrcaWorkerProvider)。
+ */
+export function convergeOrcaWorkerModel(
+ model: OrcaWorkerFormValue['model'],
+ capabilities: Pick<MobileAgentCapabilities, 'availableModels' | 'hasFastMode'> | null,
+): OrcaWorkerFormValue['model'] {
+ if (!model || !capabilities) return model;
+ const option = capabilities.availableModels.find((item) => item.id === model.id);
+ if (!option) return null;
+ if (model.providerId) return model;
+ const effort = model.effort && option.efforts.includes(model.effort)
+ ? model.effort
+ : option.defaultEffort ?? option.efforts[0] ?? null;
+ return {
+ ...model,
+ effort,
+ fast: model.fast && option.supportsFastMode && capabilities.hasFastMode,
+ };
+}
+
+/**
+ * 提交前收窄显式来源(对齐桌面 CreateWorkerPopover 的 narrowProviderSource):用户在选择器里
+ * 指定的来源已不再可路由该模型(断开 / 停用 / 下架)时清掉来源,交给被控端默认路由,而不是
+ * 带着失效来源被 PROVIDER_ROUTE_UNAVAILABLE 拒绝。
+ *
+ * 然后按「实际会路由到的来源」的模型条目对账 effort / Fast(被控端按实际来源复核这两项):
+ * 显式来源有效时用它;未指定来源时用该模型的默认来源(effectiveSourceIdForModel,与桌面
+ * routeEffortMetaFor 同口径),不按拍平能力里恰好排在前面的来源。来源目录未就绪(null)时原样提交。
+ */
+export function narrowOrcaWorkerProvider(
+ form: OrcaWorkerFormValue,
+ providers: readonly ProviderView[] | null,
+): OrcaWorkerFormValue {
+ const model = form.model;
+ if (!model || !providers) return form;
+ const views = [...providers];
+ const providerId = model.providerId
+ && chatEligibleSourcesForModel(views, model.id, form.agent).some((candidate) => candidate.id === model.providerId)
+ ? model.providerId
+ : null;
+ const narrowed = providerId === model.providerId ? form : { ...form, model: { ...model, providerId } };
+ const sourceId = providerId ?? effectiveSourceIdForModel(views, null, model.id, form.agent);
+ const provider = sourceId ? views.find((candidate) => candidate.id === sourceId) : undefined;
+ const entry = provider ? getModel(provider, model.id, form.agent) : undefined;
+ if (!entry) return narrowed;
+ const efforts: readonly string[] = entry.efforts ?? [];
+ // 该来源没有推理强度档位 → 不发送 effort(被控端对空档位表的显式 effort 报 INVALID_PARAMS),
+ // 与桌面「条目无档 → 省略」同口径。
+ // 老被控端的条目可能没有 efforts 字段:未知时保持原选择,交给被控端裁决。
+ const effort = entry.efforts === undefined
+ ? model.effort
+ : efforts.length === 0
+ ? null
+ : model.effort && efforts.includes(model.effort)
+ ? model.effort
+ : entry.defaultEffort ?? efforts[0] ?? null;
+ const fast = model.fast && entry.supportsFastMode === true;
+ return effort === model.effort && fast === model.fast
+ ? narrowed
+ : { ...narrowed, model: { ...model, providerId, effort, fast } };
+}
+
+/**
+ * Worker 可选的来源目录(对齐桌面 CreateWorkerPopover 的 excludeSubscriptionDirect /
+ * excludeChatBridgedCodex):SSH 远端 Lead 的 Worker 在远端运行,只能在本机桥接的来源
+ * (订阅直连模型、chat 桥接 / 本地 OAuth 供应商)会被被控端拒绝,选择器里不列出。
+ */
+export function orcaWorkerProvidersForLead(
+ providers: readonly ProviderView[],
+ sshRemote: boolean,
+): readonly ProviderView[] {
+ if (!sshRemote) return providers;
+ return providers.map((provider) => {
+ const models: ProviderView['models'] = {};
+ for (const agent of Object.keys(provider.models) as AgentKind[]) {
+ models[agent] = isLocalOnlyProviderForAgent(provider, agent)
+ ? []
+ : (provider.models[agent] ?? []).filter((model) => !isSubscriptionDirectRoute(model.id));
+ }
+ return { ...provider, models };
+ });
+}
+
+/** 表单 → 被控端 enable-orca / worker:create 的共同字段。 */
+function formWireFields(form: OrcaWorkerFormValue) {
+ const model = form.model;
+ return {
+ ...(model ? { model: model.id } : {}),
+ ...(model?.effort ? { effort: model.effort } : {}),
+ // 选了具体模型就显式发送 Fast(含 false):省略会让被控端沿用 Lead / 默认的 Fast,与表单相反。
+ // 「默认」模型(null)才省略,交给被控端一并解析。模型不支持 Fast 时被控端按 false 落。
+ ...(model ? { fast: model.fast } : {}),
+ ...(model?.providerId ? { providerId: model.providerId } : {}),
+ workerPermissionMode: form.permissionMode,
+ };
+}
+
+export function buildOrcaEnableOptions(
+ form: OrcaWorkerFormValue,
+ delegateTask?: string,
+): MobileOrcaEnableOptions {
+ const role = form.role.trim() || 'developer';
+ const task = delegateTask?.trim();
+ return {
+ workerAgent: form.agent,
+ role,
+ label: createWorkerLabel(role, []),
+ ...formWireFields(form),
+ ...(task ? { delegateTask: task } : {}),
+ };
+}
+
+// ─── 错误文案 ────────────────────────────────────────────────────────────────
+
+const ORCA_ERROR_CODES = [
+ 'WORKER_LIMIT_HARD_EXCEEDED',
+ 'NO_PROVIDER_FOR_AGENT',
+ 'PROVIDER_ROUTE_UNAVAILABLE',
+ 'BUDGET_MODEL_REQUIRES_API_MODE',
+ 'INVALID_PARAMS',
+ 'PRECONDITION_FAILED',
+ 'WORKER_CREATION_IN_PROGRESS',
+ 'WORKER_NOT_FOUND',
+ 'ORCA_CREATE_UNCONFIRMED',
+ 'ORCA_ACTION_UNCONFIRMED',
+] as const;
+
+export function isOrcaUnsupportedError(error: unknown): boolean {
+ return formatRemoteError(error).includes('CHANNEL_NOT_ALLOWED');
+}
+
+export function isOrcaDuplicateLabelError(error: unknown): boolean {
+ return formatRemoteError(error).includes('DUPLICATE_LABEL');
+}
+
+/** 超时不是权威失败:主机可能仍在执行,结果以回查到的状态为准。 */
+export function isOrcaAmbiguousTimeout(error: unknown): boolean {
+ return isAmbiguousTimeout(error);
+}
+
+function isAmbiguousTimeout(error: unknown): boolean {
+ const text = formatRemoteError(error);
+ return text.includes('INVOKE_TIMEOUT') || text.includes('REQUEST_TIMEOUT') || text.includes('DEVICE_LINK_TIMEOUT');
+}
+
+/**
+ * 协同写操作失败 → 界面语言文案(已知错误码精确映射,其余走通用远程错误)。
+ * fallbackKey 是未知错误时的动作前缀(如「开启协同失败。」);外层文案已说明动作时传 null。
+ */
+export function describeOrcaError(error: unknown, fallbackKey: string | null): string {
+ if (isOrcaUnsupportedError(error)) return i18n.t('session.collab.errors.unsupported');
+ const text = formatRemoteError(error);
+ const code = ORCA_ERROR_CODES.find((candidate) => text.includes(candidate));
+ if (code) return i18n.t(`session.collab.errors.${code}`);
+ const generic = humanizeRemoteError(error);
+ return fallbackKey ? `${i18n.t(fallbackKey)}${generic ? ` ${generic}` : ''}` : generic;
+}
+
+// ─── 入口可用性 ──────────────────────────────────────────────────────────────
+
+export type OrcaCollabEntryStatus =
+ | 'ineligible'
+ | 'loading'
+ | 'ready'
+ | 'disabled'
+ | 'unsupported'
+ | 'unavailable';
+
+/** 能否挂协同入口(与桌面 resolveCollabEntryPolicy 同口径):Worker 子任务不能嵌套协同。 */
+export function isOrcaCollabEligible(
+ session: Pick<RemoteSession, 'orcaRole' | 'workspaceKind' | 'workingDir'> | null,
+): boolean {
+ if (!session || session.orcaRole === 'worker') return false;
+ if (session.workspaceKind === 'dialogue') return true;
+ return session.workspaceKind === 'project' && !!session.workingDir?.trim();
+}
+
+/**
+ * 读被控端的协同入口状态:能力声明 + 协同插件开关。已经是 Lead 的任务不再查插件开关
+ * (团队已存在,管理操作由被控端逐次授权)。
+ */
+export async function readOrcaCollabEntryStatus(
+ maker: MobileMakerTransport,
+ session: Pick<RemoteSession, 'orcaRole' | 'workspaceKind' | 'workingDir' | 'remoteHostId'>,
+ agent: OrcaWorkerAgentKind,
+): Promise<Exclude<OrcaCollabEntryStatus, 'loading'>> {
+ if (!isOrcaCollabEligible(session)) return 'ineligible';
+ let capabilities;
+ try {
+ capabilities = normalizeMobileAgentCapabilities(await maker.getCapabilities(agent));
+ } catch (error) {
+ return isOrcaUnsupportedError(error) ? 'unsupported' : 'unavailable';
+ }
+ if (capabilities?.supportsOrcaWorkerPermissionMode !== true) return 'unsupported';
+ if (session.orcaRole === 'lead') return 'ready';
+ const workingDir = session.remoteHostId ? undefined : session.workingDir?.trim() || undefined;
+ try {
+ const policy = readOrcaCollabPolicy(
+ await maker.orca.getCollabPolicy(workingDir, session.workspaceKind),
+ session.workspaceKind,
+ );
+ if (policy.unsupported) return 'unsupported';
+ return policy.enabled ? 'ready' : 'disabled';
+ } catch (error) {
+ return isOrcaUnsupportedError(error) ? 'unsupported' : 'unavailable';
+ }
+}
+
+export function orcaCollabEntryHint(status: OrcaCollabEntryStatus): string | null {
+ switch (status) {
+ case 'loading': return i18n.t('session.collab.loadingHint');
+ case 'disabled': return i18n.t('session.collab.disabledHint');
+ case 'unsupported': return i18n.t('session.collab.errors.unsupported');
+ case 'unavailable': return i18n.t('session.collab.unavailableHint');
+ default: return null;
+ }
+}
+
+// ─── 写操作 ──────────────────────────────────────────────────────────────────
+
+const TIMEOUT_RECOVERY_ATTEMPTS = 4;
+const TIMEOUT_RECOVERY_DELAY_MS = 3000;
+/** 回查的总时限:探针自身可能各走满隧道超时,只限次数不限时会把恢复窗口拖到分钟级。 */
+const TIMEOUT_RECOVERY_DEADLINE_MS = 30_000;
+/** 连续撞已占用 label 的上限(每次都是一次远端往返;正常一两次就能找到空位)。 */
+const MAX_LABEL_ATTEMPTS = 20;
+
+const delay = (ms: number) => new Promise<void>((resolve) => setTimeout(resolve, ms));
+
+/**
+ * 开启协同。mutation 前重读能力(弹窗展示时的快照可能已随重连降级);隧道超时后回查
+ * 被控端 Worker 列表 —— 非空即团队已提交,按成功返回;查不到才把原始超时抛出。
+ */
+/**
+ * 创建 Worker 前重读被控端能力:老被控端会忽略 workerPermissionMode、按它自己的默认权限
+ * 建 Worker(可能是完全访问),与用户在手机上选的不符 —— 一律 fail-closed。
+ */
+async function assertWorkerPermissionSupported(
+ maker: MobileMakerTransport,
+ agent: OrcaWorkerAgentKind,
+): Promise<void> {
+ const capabilities = normalizeMobileAgentCapabilities(await maker.getCapabilities(agent));
+ if (capabilities?.supportsOrcaWorkerPermissionMode !== true) {
+ throw new Error('[DEVICE_LINK_CHANNEL_NOT_ALLOWED] controlled device does not support Orca Worker permission mode');
+ }
+}
+
+/** 隧道超时后按被控端 Worker 列表回查;predicate 命中即说明写操作已提交。 */
+async function probeCommittedWorker(
+ maker: MobileMakerTransport,
+ leadSessionId: string,
+ predicate: (worker: OrcaTeamWorker) => boolean,
+): Promise<OrcaTeamWorker | null> {
+ const deadline = Date.now() + TIMEOUT_RECOVERY_DEADLINE_MS;
+ for (let attempt = 0; attempt < TIMEOUT_RECOVERY_ATTEMPTS; attempt += 1) {
+ if (attempt > 0) await delay(TIMEOUT_RECOVERY_DELAY_MS);
+ if (Date.now() >= deadline) return null;
+ try {
+ const match = parseOrcaTeamWorkers(await maker.orca.listWorkers(leadSessionId)).find(predicate);
+ if (match) return match;
+ } catch (probeError) {
+ if (!isTransientRemoteError(probeError)) return null;
+ }
+ }
+ return null;
+}
+
+export async function enableOrcaTeam(
+ maker: MobileMakerTransport,
+ leadSessionId: string,
+ options: MobileOrcaEnableOptions,
+): Promise<{ workerSessionId: string | null }> {
+ await assertWorkerPermissionSupported(maker, options.workerAgent);
+ try {
+ const result = await maker.orca.enable(leadSessionId, options);
+ return { workerSessionId: typeof result?.workerSessionId === 'string' ? result.workerSessionId : null };
+ } catch (error) {
+ // 隧道超时不代表被控端没执行;ALREADY_EXISTS 说明已有团队(另一端刚开启 / 管线重跑),
+ // 但团队先于首个 Worker 落库,并发开启时首个 Worker 仍可能失败。两种都以被控端的
+ // Worker 列表为准:有 Worker 才算开启成功,查不到按原错误处理。
+ const alreadyExists = formatRemoteError(error).includes('ALREADY_EXISTS');
+ if (!alreadyExists && !isAmbiguousTimeout(error)) throw error;
+ const committed = await probeCommittedWorker(maker, leadSessionId, () => true);
+ if (committed) return { workerSessionId: committed.sessionId };
+ throw error;
+ }
+}
+
+/**
+ * 追加 Worker:label 按现有团队派生,撞 DUPLICATE_LABEL(并发创建 / 已归档 Worker 占用)时跳过该 label 继续派生。
+ * 隧道超时不是权威失败:按本次请求的确切 label 回查被控端,查到即成功;查不到抛
+ * ORCA_CREATE_UNCONFIRMED,提示用户先看 Worker 列表,不让「超时→重试」建出第二个。
+ */
+export async function createOrcaWorker(
+ maker: MobileMakerTransport,
+ leadSessionId: string,
+ form: OrcaWorkerFormValue,
+ existingWorkers: readonly OrcaTeamWorker[],
+): Promise<{ workerSessionId: string | null }> {
+ await assertWorkerPermissionSupported(maker, form.agent);
+ const role = form.role.trim() || 'developer';
+ const submit = async (label: string) => {
+ try {
+ const result = await maker.orca.createWorker({
+ leadSessionId,
+ role,
+ label,
+ agent: form.agent,
+ ...formWireFields(form),
+ ...(form.initialTask.trim() ? { initialTask: form.initialTask.trim() } : {}),
+ });
+ return typeof result?.workerSessionId === 'string' ? result.workerSessionId : null;
+ } catch (error) {
+ if (!isAmbiguousTimeout(error)) throw error;
+ const committed = await probeCommittedWorker(
+ maker,
+ leadSessionId,
+ (worker) => worker.label?.toLowerCase() === label,
+ );
+ if (committed) return committed.sessionId;
+ throw new Error('[ORCA_CREATE_UNCONFIRMED] worker creation timed out and could not be confirmed');
+ }
+ };
+ // 与桌面 useOrcaWorkerSelection 同口径:已归档 Worker 不在列表里,但 label 在团队生命周期内
+ // 永久占用;被拒的 label 记下来继续派生下一个,不重复撞同一个。
+ const allocated = existingWorkers
+ .map((worker) => worker.label)
+ .filter((label): label is string => !!label);
+ for (let attempt = 0; attempt < MAX_LABEL_ATTEMPTS; attempt += 1) {
+ const label = createWorkerLabel(role, allocated);
+ try {
+ return { workerSessionId: await submit(label) };
+ } catch (error) {
+ if (!isOrcaDuplicateLabelError(error)) throw error;
+ allocated.push(label);
+ }
+ }
+ throw new Error('[DUPLICATE_LABEL] no unique worker label available');
+}
+
+/** 新建页协同草稿所属目标(设备 + 工作区):目标变了草稿作废。 */
+export function orcaCollabDraftTargetKey(
+ deviceId: string | null | undefined,
+ workspaceKind: string | null | undefined,
+ workingDir: string | null | undefined,
+): string {
+ return [deviceId ?? '', workspaceKind ?? '', workingDir ?? ''].join('\u0000');
+}
+
+// ─── 新建任务开启协同失败的跨页提示 ──────────────────────────────────────────
+// 新建页在后台管线里开启协同;失败时任务照单任务继续,提示要在跳转后的会话页出现。
+// 会话页通常在失败发生前就已挂载,所以既要能在挂载时取走,也要能在失败时推给已挂载的页面。
+const orcaStartFailures = new Map<string, string>();
+const orcaStartFailureListeners = new Set<(sessionId: string) => void>();
+
+export function rememberOrcaStartFailure(sessionId: string, message: string): void {
+ orcaStartFailures.set(sessionId, message);
+ for (const listener of orcaStartFailureListeners) listener(sessionId);
+}
+
+export function subscribeOrcaStartFailure(listener: (sessionId: string) => void): () => void {
+ orcaStartFailureListeners.add(listener);
+ return () => { orcaStartFailureListeners.delete(listener); };
+}
+
+export function takeOrcaStartFailure(sessionId: string): string | null {
+ const message = orcaStartFailures.get(sessionId) ?? null;
+ orcaStartFailures.delete(sessionId);
+ return message;
+}
+
+export function orcaWorkerStatusLabel(status: OrcaTeamWorker['status']): string {
+ return i18n.t(`session.collab.status.${status}`);
+}
+
+export function orcaWorkerDisplayName(worker: Pick<OrcaTeamWorker, 'role' | 'label'>): string {
+ return worker.label && worker.label !== worker.role ? `${worker.role} #${worker.label}` : worker.role;
+}
+
+export function orcaAgentLabel(agent: OrcaWorkerAgentKind): string {
+ return agent === 'codex' ? 'Codex' : agent === 'pi' ? 'Pi' : 'Claude Code';
+}
diff --git a/apps/mobile/src/session/orcaWorkerPrefs.ts b/apps/mobile/src/session/orcaWorkerPrefs.ts
new file mode 100644
index 0000000000..4a8aab7a10
--- /dev/null
+++ b/apps/mobile/src/session/orcaWorkerPrefs.ts
@@ -0,0 +1,165 @@
+/**
+ * 「创建 Worker」偏好记忆(与桌面 renderer workerCreationPrefs 同一套规则):
+ * - 记住上次选的 Agent,以及每个 Agent 各自的模型 / 推理强度 / Fast;
+ * - 记住 Worker 权限;初始任务不记(避免把旧任务带到下一次创建);
+ * - 没有记忆时用共享首次默认值(Codex `codex/gpt-5.5`、high、完全访问)。
+ *
+ * 与桌面控制端一样存在发起创建的这一端(手机本地,按登录账号隔离),不读写被控端的偏好。
+ * 模型来源(provider)不记:桌面控制远程设备时同样不记来源,换设备后跟随被控端默认路由。
+ */
+import AsyncStorage from '@react-native-async-storage/async-storage';
+import {
+ DEFAULT_ORCA_WORKER_AGENT,
+ DEFAULT_ORCA_WORKER_EFFORT,
+ DEFAULT_ORCA_WORKER_MODELS,
+ DEFAULT_ORCA_WORKER_PERMISSION_MODE,
+ parseOrcaPermissionMode,
+ type OrcaWorkerAgentKind,
+ type OrcaWorkerPermissionMode,
+} from '@cindy/maker-shared/orca-team';
+
+const STORAGE_KEY_PREFIX = 'cindy:orcaWorkerCreationPrefs:v1';
+const AGENTS: readonly OrcaWorkerAgentKind[] = ['codex', 'claude-code', 'pi'];
+
+export interface OrcaWorkerAgentPrefs {
+ model: string;
+ effort: string;
+ fast: boolean;
+}
+
+export interface OrcaWorkerCreationPrefs {
+ lastAgent: OrcaWorkerAgentKind;
+ agents: Record<OrcaWorkerAgentKind, OrcaWorkerAgentPrefs>;
+ workerPermissionMode: OrcaWorkerPermissionMode;
+}
+
+export function defaultOrcaWorkerCreationPrefs(): OrcaWorkerCreationPrefs {
+ return {
+ lastAgent: DEFAULT_ORCA_WORKER_AGENT,
+ agents: {
+ codex: { model: DEFAULT_ORCA_WORKER_MODELS.codex, effort: DEFAULT_ORCA_WORKER_EFFORT, fast: false },
+ 'claude-code': { model: DEFAULT_ORCA_WORKER_MODELS['claude-code'], effort: DEFAULT_ORCA_WORKER_EFFORT, fast: false },
+ pi: { model: DEFAULT_ORCA_WORKER_MODELS.pi, effort: DEFAULT_ORCA_WORKER_EFFORT, fast: false },
+ },
+ workerPermissionMode: DEFAULT_ORCA_WORKER_PERMISSION_MODE,
+ };
+}
+
+function record(value: unknown): Record<string, unknown> | null {
+ return value && typeof value === 'object' && !Array.isArray(value) ? value as Record<string, unknown> : null;
+}
+
+/** 损坏 / 缺字段的记忆逐项回落首次默认值,不整体丢弃。 */
+export function sanitizeOrcaWorkerCreationPrefs(value: unknown): OrcaWorkerCreationPrefs {
+ const defaults = defaultOrcaWorkerCreationPrefs();
+ const raw = record(value);
+ if (!raw) return defaults;
+ const agents = record(raw.agents);
+ const agentPrefs = (agent: OrcaWorkerAgentKind): OrcaWorkerAgentPrefs => {
+ const item = record(agents?.[agent]);
+ const fallback = defaults.agents[agent];
+ return {
+ model: typeof item?.model === 'string' && item.model.trim() ? item.model.trim() : fallback.model,
+ effort: typeof item?.effort === 'string' && item.effort.trim() ? item.effort.trim() : fallback.effort,
+ fast: item?.fast === true,
+ };
+ };
+ return {
+ lastAgent: AGENTS.includes(raw.lastAgent as OrcaWorkerAgentKind)
+ ? raw.lastAgent as OrcaWorkerAgentKind
+ : defaults.lastAgent,
+ agents: { codex: agentPrefs('codex'), 'claude-code': agentPrefs('claude-code'), pi: agentPrefs('pi') },
+ workerPermissionMode: parseOrcaPermissionMode(raw.workerPermissionMode) ?? defaults.workerPermissionMode,
+ };
+}
+
+const memory = new Map<string, OrcaWorkerCreationPrefs>();
+
+function storageKey(scope: string): string {
+ return `${STORAGE_KEY_PREFIX}:${scope}`;
+}
+
+export async function readOrcaWorkerCreationPrefs(scope: string): Promise<OrcaWorkerCreationPrefs> {
+ const cached = memory.get(scope);
+ if (cached) return cached;
+ let readFailed = false;
+ const raw = await AsyncStorage.getItem(storageKey(scope)).catch(() => {
+ readFailed = true;
+ return null;
+ });
+ let prefs = defaultOrcaWorkerCreationPrefs();
+ if (raw) {
+ try {
+ prefs = sanitizeOrcaWorkerCreationPrefs(JSON.parse(raw));
+ } catch {
+ // 损坏的记忆按首次默认值处理。
+ }
+ }
+ // 读取期间用户已提交并写回了新选择:以刚保存的为准,不让这次迟到的旧值覆盖。
+ const saved = memory.get(scope);
+ if (saved) return saved;
+ // 读取失败 ≠ 没有记忆:这次先用默认值,但不缓存,下次打开再读,不把默认值当成已读到的记忆。
+ if (readFailed) return prefs;
+ memory.set(scope, prefs);
+ return prefs;
+}
+
+/** 这个账号的记忆是否已确实读到(或本次会话写过);读取失败时为 false,下次打开再读。 */
+export function hasLoadedOrcaWorkerCreationPrefs(scope: string): boolean {
+ return memory.has(scope);
+}
+
+/** 创建成功(或新建任务确认协同草稿)后写回:与桌面一样只在提交时记忆。 */
+export function saveOrcaWorkerCreationPrefs(scope: string, prefs: OrcaWorkerCreationPrefs): void {
+ memory.set(scope, prefs);
+ void AsyncStorage.setItem(storageKey(scope), JSON.stringify(prefs)).catch(() => undefined);
+}
+
+/** 一次提交里需要记住的部分(Agent、该 Agent 的模型 / 推理强度 / Fast、权限;初始任务不记)。 */
+export interface OrcaWorkerSubmittedChoice {
+ agent: OrcaWorkerAgentKind;
+ permissionMode: OrcaWorkerPermissionMode;
+ model: { id: string; effort: string | null; fast: boolean } | null;
+}
+
+/** 把一次提交合并进已有记忆(纯函数)。 */
+export function mergeOrcaWorkerChoice(
+ previous: OrcaWorkerCreationPrefs,
+ submitted: OrcaWorkerSubmittedChoice,
+): OrcaWorkerCreationPrefs {
+ return {
+ ...previous,
+ lastAgent: submitted.agent,
+ workerPermissionMode: submitted.permissionMode,
+ agents: submitted.model
+ ? {
+ ...previous.agents,
+ [submitted.agent]: {
+ model: submitted.model.id,
+ effort: submitted.model.effort ?? previous.agents[submitted.agent].effort,
+ fast: submitted.model.fast,
+ },
+ }
+ : previous.agents,
+ };
+}
+
+/**
+ * 记住一次提交:先读到这个账号的记忆(已在内存就直接用),再合并写回。读—合并—写在一处完成,
+ * 不依赖调用方的预读是否已经完成。存储读取失败时不写回,避免用默认值拼出的整份记忆覆盖
+ * 用户原先存的其它选择。
+ */
+export async function rememberOrcaWorkerChoice(
+ scope: string,
+ submitted: OrcaWorkerSubmittedChoice,
+): Promise<OrcaWorkerCreationPrefs> {
+ const previous = await readOrcaWorkerCreationPrefs(scope);
+ const next = mergeOrcaWorkerChoice(previous, submitted);
+ if (hasLoadedOrcaWorkerCreationPrefs(scope)) saveOrcaWorkerCreationPrefs(scope, next);
+ return next;
+}
+
+/** 测试用:清空内存缓存。 */
+export function resetOrcaWorkerCreationPrefsMemory(): void {
+ memory.clear();
+}
diff --git a/apps/mobile/src/session/sessionMenu.ts b/apps/mobile/src/session/sessionMenu.ts
index 89e367d974..0497a5edfb 100644
--- a/apps/mobile/src/session/sessionMenu.ts
+++ b/apps/mobile/src/session/sessionMenu.ts
@@ -23,7 +23,7 @@ import {
export type SessionMenuView = 'menu' | 'info';
export interface SessionMenuChip {
- id: 'pinned' | 'archived' | 'readonly' | 'collab';
+ id: 'pinned' | 'archived' | 'collab';
label: string;
}
@@ -46,14 +46,10 @@ export interface SessionMenuAction {
testID: string;
}
-export function buildSessionMenuHeader(
- session: RemoteSession,
- input: { readOnlyReason?: string | null },
-): SessionMenuHeaderModel {
+export function buildSessionMenuHeader(session: RemoteSession): SessionMenuHeaderModel {
const chips: SessionMenuChip[] = [];
if (session.pinnedAt) chips.push({ id: 'pinned', label: i18n.t('session.menu.chipPinned') });
if (session.status === 'archived') chips.push({ id: 'archived', label: i18n.t('session.menu.chipArchived') });
- if (input.readOnlyReason) chips.push({ id: 'readonly', label: i18n.t('session.menu.chipReadOnly') });
const collabLabel = sessionCollaborationLabel(session);
if (collabLabel) chips.push({ id: 'collab', label: collabLabel });
diff --git a/apps/mobile/src/session/useSessionOrcaCollab.ts b/apps/mobile/src/session/useSessionOrcaCollab.ts
new file mode 100644
index 0000000000..f4bbe9f2ce
--- /dev/null
+++ b/apps/mobile/src/session/useSessionOrcaCollab.ts
@@ -0,0 +1,785 @@
+/**
+ * 手机端协同(Orca)页面状态。
+ *
+ * - useOrcaWorkerForm:「开启协同 / 创建新 Worker」表单状态(会话页与新建任务页共用),含
+ * 完全访问确认与 Worker 模型选择器的开合编排。
+ * - useSessionOrcaCollab:会话页 + 面板「协同模式」二级视图、团队操作与 Lead / Worker 导航。
+ *
+ * 真身在被控端;所有写操作完成后以被控端列表为准(整表重拉),本地只在开启 / 结束协同时
+ * 乐观改 orcaRole,权威值随 sessions 推送回流。
+ */
+import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
+import { Alert } from 'react-native';
+import type { ProviderView } from '@cindy/model-providers/registry';
+import type { AgentKind } from '@cindy/model-providers/types';
+import type { MobileModelOption } from '@/session/agentCapabilities';
+import { confirmFullAccessChange } from '@/session/fullAccessConfirmation';
+import {
+ buildOrcaEnableOptions,
+ convergeOrcaWorkerModel,
+ createOrcaWorker,
+ describeOrcaError,
+ isOrcaAmbiguousTimeout,
+ narrowOrcaWorkerProvider,
+ enableOrcaTeam,
+ isOrcaCollabEligible,
+ orcaAgentKindForSession,
+ orcaCollabEntryHint,
+ orcaWorkerFormFromPrefs,
+ orcaWorkerDisplayName,
+ orcaWorkerStatusLabel,
+ readOrcaCollabEntryStatus,
+ type OrcaCollabEntryStatus,
+ type OrcaTeamWorker,
+ type OrcaWorkerAgentKind,
+ type OrcaWorkerFormValue,
+ type OrcaWorkerPermissionMode,
+} from '@/session/orcaTeam';
+import {
+ parseOrcaCollaborationSettings,
+ parseOrcaTeamWorkers,
+ readOrcaTeamLeadSessionId,
+ type OrcaCollaborationSettings,
+} from '@cindy/maker-shared/orca-team';
+import { subscribeRemoteOrcaWorkerChanged } from '@/device-link/DeviceLinkContext';
+import { canSubmitOrcaWorkerForm, isPredefinedOrcaRole } from '@/session/ContextSheetCollabView';
+import { normalizeMobileAgentCapabilities } from '@/session/agentCapabilities';
+import {
+ defaultOrcaWorkerCreationPrefs,
+ hasLoadedOrcaWorkerCreationPrefs,
+ mergeOrcaWorkerChoice,
+ readOrcaWorkerCreationPrefs,
+ rememberOrcaWorkerChoice,
+ type OrcaWorkerCreationPrefs,
+} from '@/session/orcaWorkerPrefs';
+import { remoteSessionStore } from '@/session/remoteSessionStore';
+import { i18n } from '@/i18n';
+import type { MobileMakerTransport } from '@/device-link/mobileMakerTransport';
+import type { MobileModelConfiguration } from '@/session/unifiedMobileModels';
+import type { RemoteSession } from '@/session/types';
+
+export type CollabSheetView = 'collab' | 'collab-create';
+
+const ALL_AGENTS: readonly OrcaWorkerAgentKind[] = ['claude-code', 'codex', 'pi'];
+const EMPTY_MODEL_OPTIONS: readonly MobileModelOption[] = [];
+
+// ─── 团队状态 ────────────────────────────────────────────────────────────────
+
+export interface OrcaTeamSnapshot {
+ workers: OrcaTeamWorker[];
+ /**
+ * 被控端的协同设置(只读权威值)。null = 还没读到;读取失败时保留上一次读到的值,
+ * 不用默认值冒充——否则会误判名额上限,错误地禁用或放行创建。
+ */
+ settings: OrcaCollaborationSettings | null;
+ loading: boolean;
+ error: string | null;
+}
+
+const EMPTY_TEAM: OrcaTeamSnapshot = {
+ workers: [],
+ settings: null,
+ loading: false,
+ error: null,
+};
+
+/**
+ * Lead 任务的 Worker 列表 + 协同设置。`leadSessionId` 为 null 时不拉取。被控端推送
+ * worker-changed(需会话页持有 `session:<leadId>` topic)或调用 refresh 时整表重拉;
+ * 旧请求的迟到结果按请求代次丢弃。
+ */
+export function useOrcaTeam(params: {
+ maker: MobileMakerTransport;
+ deviceId: string | null;
+ leadSessionId: string | null;
+ /** 隧道重连代次:断线期间可能漏掉 worker-changed 推送,重连后整表重拉一次。 */
+ connectionEpoch?: number;
+}): OrcaTeamSnapshot & { refresh(): Promise<void> } {
+ const { maker, deviceId, leadSessionId, connectionEpoch } = params;
+ const [snapshot, setSnapshot] = useState<OrcaTeamSnapshot>(EMPTY_TEAM);
+ const generationRef = useRef(0);
+ const makerRef = useRef(maker);
+ makerRef.current = maker;
+
+ const refresh = useCallback(async () => {
+ const generation = ++generationRef.current;
+ if (!leadSessionId) {
+ setSnapshot(EMPTY_TEAM);
+ return;
+ }
+ setSnapshot((current) => ({ ...current, loading: true }));
+ try {
+ const [workers, settings] = await Promise.all([
+ makerRef.current.orca.listWorkers(leadSessionId),
+ makerRef.current.orca.getCollaborationSettings().catch(() => null),
+ ]);
+ if (generation !== generationRef.current) return;
+ setSnapshot((current) => ({
+ workers: parseOrcaTeamWorkers(workers),
+ settings: settings === null ? current.settings : parseOrcaCollaborationSettings(settings),
+ loading: false,
+ error: null,
+ }));
+ } catch (error) {
+ if (generation !== generationRef.current) return;
+ setSnapshot((current) => ({
+ ...current,
+ loading: false,
+ error: describeOrcaError(error, 'session.collab.errors.loadFailed'),
+ }));
+ }
+ }, [leadSessionId]);
+
+ useEffect(() => {
+ setSnapshot(EMPTY_TEAM);
+ void refresh();
+ return () => { generationRef.current += 1; };
+ }, [deviceId, refresh]);
+
+ const seenEpochRef = useRef(connectionEpoch);
+ useEffect(() => {
+ if (seenEpochRef.current === connectionEpoch) return;
+ seenEpochRef.current = connectionEpoch;
+ void refresh();
+ }, [connectionEpoch, refresh]);
+
+ useEffect(() => {
+ if (!deviceId || !leadSessionId) return undefined;
+ return subscribeRemoteOrcaWorkerChanged((pushDeviceId, pushLeadSessionId) => {
+ if (pushDeviceId === deviceId && pushLeadSessionId === leadSessionId) void refresh();
+ });
+ }, [deviceId, leadSessionId, refresh]);
+
+ return { ...snapshot, refresh };
+}
+
+/** Worker 任务 → 所属 Lead(被控端团队记录为准;查不到 = null,「返回 Lead」入口不出现)。 */
+export function useOrcaWorkerLeadSessionId(params: {
+ maker: MobileMakerTransport;
+ workerSessionId: string | null;
+ /** 隧道重连代次:首次查询赶上断线 / 瞬时失败时,重连后再查一次。 */
+ connectionEpoch?: number;
+}): string | null {
+ const { maker, workerSessionId, connectionEpoch } = params;
+ const [leadSessionId, setLeadSessionId] = useState<string | null>(null);
+ const makerRef = useRef(maker);
+ makerRef.current = maker;
+ useEffect(() => {
+ setLeadSessionId(null);
+ }, [workerSessionId]);
+ useEffect(() => {
+ if (!workerSessionId) return undefined;
+ let cancelled = false;
+ makerRef.current.orca.getTeamByWorkerSession(workerSessionId)
+ .then((team) => { if (!cancelled) setLeadSessionId(readOrcaTeamLeadSessionId(team)); })
+ .catch(() => undefined);
+ return () => { cancelled = true; };
+ }, [workerSessionId, connectionEpoch]);
+ return leadSessionId;
+}
+
+
+/**
+ * Worker 表单状态(与桌面 CreateWorkerPopover 同一套记忆规则,见 orcaWorkerPrefs):
+ * 打开表单时恢复上次的 Agent 与该 Agent 的模型 / 推理强度 / Fast、权限;切 Agent 时带出
+ * 该 Agent 上次的选择;提交成功后调用 remember() 写回。记住的模型在当前电脑上不可用时
+ * 回落「默认」(交给被控端解析)。
+ *
+ * 模型选择器与 + 面板是两个 sheet(iOS 原生 sheet 不能叠开):选模型前收起面板,
+ * 选择器完全收起后再展开面板回到表单。
+ */
+export function useOrcaWorkerForm(params: {
+ maker: MobileMakerTransport;
+ /** 记忆按登录账号隔离;null = 未登录,不读写记忆(用首次默认值)。 */
+ prefsScope: string | null;
+ active: boolean;
+ setSheetOpen(open: boolean): void;
+ /** 隧道重连代次:断线时 Agent 列表 / 模型能力读失败,重连后在打开的表单上重读一次。 */
+ connectionEpoch?: number;
+}) {
+ const { maker, prefsScope, active, setSheetOpen, connectionEpoch } = params;
+ const [form, setForm] = useState<OrcaWorkerFormValue>(() => {
+ const defaults = defaultOrcaWorkerCreationPrefs();
+ return orcaWorkerFormFromPrefs(defaults, defaults.lastAgent);
+ });
+ const [customRoleMode, setCustomRoleMode] = useState(false);
+ const [agents, setAgents] = useState<readonly OrcaWorkerAgentKind[]>(ALL_AGENTS);
+ const [modelPickerOpen, setModelPickerOpen] = useState(false);
+ const [modelsByAgent, setModelsByAgent] = useState<Partial<Record<OrcaWorkerAgentKind, readonly MobileModelOption[]>>>({});
+ const makerRef = useRef(maker);
+ makerRef.current = maker;
+ const formRef = useRef(form);
+ formRef.current = form;
+ const prefsRef = useRef<OrcaWorkerCreationPrefs>(defaultOrcaWorkerCreationPrefs());
+ const prefsLoadedRef = useRef(false);
+ /** 本次复位后用户是否动过表单:动过就不再让迟到的记忆 / 能力结果覆盖用户的选择。 */
+ const touchedRef = useRef(false);
+ /** 本次打开后用户是否明确选过 Agent(切 Agent / 选择器选模型 / 恢复草稿)。 */
+ const agentChosenRef = useRef(false);
+ const agentsRef = useRef(agents);
+ agentsRef.current = agents;
+ // 两个代次各管一条不变量,互不推进:
+ // - formEpochRef:当前这次「打开表单」(复位 / 恢复草稿 / 换账号各开一次)。迟到的记忆
+ // 只在同一次打开、且用户还没动过表单时补用;Agent 列表、能力这类非用户事件不推进它。
+ // - convergeGenRef:只让最近一次模型收敛请求的结果生效;用户手选模型也作废在途收敛。
+ const formEpochRef = useRef(0);
+ const convergeGenRef = useRef(0);
+
+ const prefsScopeRef = useRef(prefsScope);
+ prefsScopeRef.current = prefsScope;
+
+ // 挂载 / 换账号时预读记忆,复位时即可同步恢复,不在用户操作期间异步覆盖表单。
+ // 换账号时推进代次:上一个账号还在路上的读取 / 能力收敛一律作废,不写进新账号的表单。
+ useEffect(() => {
+ formEpochRef.current += 1;
+ convergeGenRef.current += 1;
+ prefsLoadedRef.current = false;
+ prefsRef.current = defaultOrcaWorkerCreationPrefs();
+ if (!prefsScope) {
+ prefsLoadedRef.current = true;
+ return undefined;
+ }
+ let cancelled = false;
+ const scope = prefsScope;
+ void readOrcaWorkerCreationPrefs(scope).then((prefs) => {
+ if (cancelled) return;
+ prefsRef.current = prefs;
+ // 读取失败时仍按默认值展示,但不算「已读到」:复位时再读一次。
+ prefsLoadedRef.current = hasLoadedOrcaWorkerCreationPrefs(scope);
+ });
+ return () => { cancelled = true; };
+ }, [prefsScope]);
+
+
+ /**
+ * 按被控端能力收敛模型选择;能力读不到时保留原选择(提交时由被控端裁决)。
+ * 只改模型字段,且只有最近一次请求的结果生效(期间又收敛 / 用户又改了模型则丢弃)。
+ */
+ const converge = useCallback((agent: OrcaWorkerAgentKind) => {
+ const generation = ++convergeGenRef.current;
+ const source = makerRef.current;
+ source.getCapabilities(agent)
+ .then((raw) => {
+ const capabilities = normalizeMobileAgentCapabilities(raw);
+ // 能力按 Agent 缓存,供老被控端(没有来源目录)时模型选择器的扁平回退列表使用。
+ // 只缓存当前这台电脑的结果:换电脑后迟到的上一台响应不写入。
+ if (capabilities && makerRef.current === source) {
+ setModelsByAgent((current) => ({ ...current, [agent]: capabilities.availableModels }));
+ }
+ if (generation !== convergeGenRef.current) return;
+ setForm((current) => (current.agent === agent
+ ? { ...current, model: convergeOrcaWorkerModel(current.model, capabilities) }
+ : current));
+ })
+ .catch(() => undefined);
+ }, []);
+
+ // 换了被控电脑(新建任务页切设备):上一台的 Agent 列表作废,回到乐观全集等这台的结果,
+ // 不让复位按上一台的列表挑 Agent。
+ const rosterMakerRef = useRef(maker);
+ useEffect(() => {
+ if (rosterMakerRef.current === maker) return;
+ rosterMakerRef.current = maker;
+ agentsRef.current = ALL_AGENTS;
+ setAgents(ALL_AGENTS);
+ setModelsByAgent({});
+ }, [maker]);
+
+ // 读被控端实际注册的 Agent。复位时列表可能还是乐观的三个:结果回来后,当前 Agent 不在这台
+ // 电脑上就切到第一个可用 Agent 并带出它的模型记忆(不论用户是否改过其它字段——角色、任务、
+ // 权限原样保留),避免表单停在一个必然提交失败的 Agent 上。当前 Agent 可用时也按能力再收敛
+ // 一次模型:重连后重跑本 effect 时,断线期间没能完成的收敛在这里补上。
+ useEffect(() => {
+ if (!active) return undefined;
+ let cancelled = false;
+ makerRef.current.listAvailableAgents()
+ .then((available) => {
+ if (cancelled) return;
+ const next = ALL_AGENTS.filter((agent) => available.includes(agent));
+ if (next.length === 0) return;
+ agentsRef.current = next;
+ setAgents(next);
+ // 目标 Agent:用户明确选过就尊重其选择;否则按记忆的上次 Agent(复位时可能因列表
+ // 还是乐观 / 上一台电脑的而落在别的 Agent 上)。不在这台电脑上时取第一个可用。
+ const current = formRef.current.agent;
+ const remembered = prefsRef.current.lastAgent;
+ const wanted = !agentChosenRef.current && next.includes(remembered) ? remembered : current;
+ if (wanted === current && next.includes(current)) {
+ converge(current);
+ return;
+ }
+ const switched = next.includes(wanted) ? wanted : next[0]!;
+ const agentPrefs = prefsRef.current.agents[switched];
+ setForm((value) => ({
+ ...value,
+ agent: switched,
+ model: { id: agentPrefs.model, providerId: null, effort: agentPrefs.effort, fast: agentPrefs.fast },
+ }));
+ converge(switched);
+ })
+ .catch(() => undefined);
+ return () => { cancelled = true; };
+ }, [active, connectionEpoch, converge, maker]);
+
+ /** 重新打开已确认的表单(新建任务的协同草稿):角色模式跟随保存的角色,不沿用上次未提交的编辑。 */
+ const restore = useCallback((value: OrcaWorkerFormValue) => {
+ formEpochRef.current += 1;
+ agentChosenRef.current = true;
+ convergeGenRef.current += 1;
+ touchedRef.current = true;
+ setCustomRoleMode(!isPredefinedOrcaRole(value.role.trim().toLowerCase()));
+ setForm(value);
+ }, []);
+
+ /** 恢复记忆(上次的 Agent 不在当前电脑上时取第一个可用 Agent)。初始任务不记忆。 */
+ const reset = useCallback(() => {
+ const epoch = ++formEpochRef.current;
+ touchedRef.current = false;
+ agentChosenRef.current = false;
+ setCustomRoleMode(false);
+ const apply = (prefs: OrcaWorkerCreationPrefs) => {
+ const available = agentsRef.current;
+ const agent = available.includes(prefs.lastAgent) ? prefs.lastAgent : available[0] ?? prefs.lastAgent;
+ setForm(orcaWorkerFormFromPrefs(prefs, agent));
+ converge(agent);
+ };
+ apply(prefsRef.current);
+ // 预读尚未完成(极少见:刚登录就打开表单):读完后仅在用户还没动过这张表单时补一次。
+ if (!prefsLoadedRef.current && prefsScope) {
+ const scope = prefsScope;
+ void readOrcaWorkerCreationPrefs(scope).then((prefs) => {
+ if (prefsScopeRef.current !== scope) return;
+ prefsRef.current = prefs;
+ prefsLoadedRef.current = hasLoadedOrcaWorkerCreationPrefs(scope);
+ if (epoch !== formEpochRef.current || touchedRef.current) return;
+ apply(prefs);
+ });
+ }
+ }, [converge, prefsScope]);
+
+ /** 切 Agent:带出该 Agent 上次的模型 / 推理强度 / Fast(对齐桌面)。 */
+ const changeAgent = useCallback((agent: OrcaWorkerAgentKind) => {
+ touchedRef.current = true;
+ agentChosenRef.current = true;
+ const remembered = prefsRef.current.agents[agent];
+ setForm((current) => ({
+ ...current,
+ agent,
+ model: { id: remembered.model, providerId: null, effort: remembered.effort, fast: remembered.fast },
+ }));
+ converge(agent);
+ }, [converge]);
+
+ /** 提交成功后写回记忆(与桌面一样只在提交时记);读—合并—写由 rememberOrcaWorkerChoice 一处完成。 */
+ const remember = useCallback((submitted: OrcaWorkerFormValue) => {
+ prefsRef.current = mergeOrcaWorkerChoice(prefsRef.current, submitted);
+ if (!prefsScope) return;
+ const scope = prefsScope;
+ void rememberOrcaWorkerChoice(scope, submitted).then((next) => {
+ if (prefsScopeRef.current !== scope) return;
+ prefsRef.current = next;
+ prefsLoadedRef.current = hasLoadedOrcaWorkerCreationPrefs(scope);
+ });
+ }, [prefsScope]);
+
+ const patch = useCallback((next: Partial<OrcaWorkerFormValue>) => {
+ touchedRef.current = true;
+ setForm((current) => ({ ...current, ...next }));
+ }, []);
+
+ const changePermission = useCallback(async (mode: OrcaWorkerPermissionMode) => {
+ touchedRef.current = true;
+ if (!await confirmFullAccessChange(form.permissionMode, mode)) return;
+ setForm((current) => ({ ...current, permissionMode: mode }));
+ }, [form.permissionMode]);
+
+ const openPicker = useCallback(() => {
+ setSheetOpen(false);
+ setModelPickerOpen(true);
+ }, [setSheetOpen]);
+ const close = useCallback(() => setModelPickerOpen(false), []);
+ const closed = useCallback(() => setSheetOpen(true), [setSheetOpen]);
+ const select = useCallback(async (config: MobileModelConfiguration): Promise<boolean> => {
+ if (!ALL_AGENTS.includes(config.agent as OrcaWorkerAgentKind)) return false;
+ touchedRef.current = true;
+ agentChosenRef.current = true;
+ convergeGenRef.current += 1;
+ setForm((current) => ({
+ ...current,
+ agent: config.agent as OrcaWorkerAgentKind,
+ model: {
+ id: config.modelId,
+ providerId: config.providerId || null,
+ effort: config.effort || null,
+ fast: !!config.fast,
+ },
+ }));
+ return true;
+ }, []);
+
+ const pickerAgents = useMemo<AgentKind[]>(() => [...agents], [agents]);
+
+ /**
+ * 老被控端没有 `maker:provider:list` 时,模型选择器走扁平列表:用当前 Agent 的能力模型,
+ * 选中后按「不指定来源」写回表单(提交前再按实际来源对账 effort / Fast)。
+ */
+ const flatModelOptions = modelsByAgent[form.agent] ?? EMPTY_MODEL_OPTIONS;
+ const selectFlatModel = useCallback((option: MobileModelOption) => {
+ setModelPickerOpen(false);
+ void select({
+ agent: formRef.current.agent,
+ modelId: option.id,
+ providerId: '',
+ effort: option.defaultEffort ?? '',
+ fast: false,
+ });
+ }, [select]);
+
+ return {
+ form,
+ restore,
+ customRoleMode,
+ setCustomRoleMode,
+ patch,
+ changeAgent,
+ changePermission,
+ agents,
+ pickerAgents,
+ valid: canSubmitOrcaWorkerForm(form, customRoleMode),
+ reset,
+ remember,
+ modelPicker: { open: modelPickerOpen, openPicker, close, closed, select, flatModelOptions, selectFlatModel },
+ };
+}
+
+export function useSessionOrcaCollab(params: {
+ maker: MobileMakerTransport;
+ deviceId: string | null;
+ sessionId: string;
+ session: RemoteSession | null;
+ /** Worker 创建偏好的记忆范围(按区域限定的账号键 accountKey);null = 不记忆。 */
+ prefsScope: string | null;
+ /** 隧道重连代次(会话页的 connectionEpoch):重连后补拉团队与 Worker 所属 Lead。 */
+ connectionEpoch?: number;
+ /** 提交时读被控端来源目录(未就绪 = null),用于收窄已失效的显式来源。 */
+ getProviders?: () => readonly ProviderView[] | null;
+ /** 共享任务访客 / 宿主托管任务不提供协同编排(不拉团队、不挂入口)。 */
+ enabled: boolean;
+ /** + 面板当前是否展示协同视图。 */
+ sheetView: CollabSheetView | null;
+ sheetOpen: boolean;
+ setSheetView(view: 'main' | CollabSheetView): void;
+ setSheetOpen(open: boolean): void;
+ openSession(sessionId: string): void;
+}) {
+ const { maker, deviceId, sessionId, session, prefsScope, connectionEpoch, getProviders, enabled, sheetView, sheetOpen, setSheetView, setSheetOpen, openSession } = params;
+ const role = enabled ? session?.orcaRole ?? null : null;
+ const isLead = role === 'lead';
+ const isWorker = role === 'worker';
+ const eligible = enabled && (isLead || isOrcaCollabEligible(session));
+ const team = useOrcaTeam({ maker, deviceId, leadSessionId: isLead ? sessionId : null, connectionEpoch });
+ const workerLeadSessionId = useOrcaWorkerLeadSessionId({
+ maker,
+ workerSessionId: isWorker ? sessionId : null,
+ connectionEpoch,
+ });
+ // Worker 任务自己在团队里的记录(焦点 / workerId),供详情菜单的 Worker 操作使用。
+ const workerTeam = useOrcaTeam({
+ maker,
+ deviceId,
+ leadSessionId: isWorker ? workerLeadSessionId : null,
+ connectionEpoch,
+ });
+ const workerSelf = isWorker
+ ? workerTeam.workers.find((worker) => worker.sessionId === sessionId) ?? null
+ : null;
+ const workerForm = useOrcaWorkerForm({
+ maker,
+ prefsScope,
+ active: sheetOpen && sheetView !== null,
+ setSheetOpen,
+ connectionEpoch,
+ });
+
+ const [entryStatus, setEntryStatus] = useState<OrcaCollabEntryStatus>('loading');
+ const [busy, setBusy] = useState(false);
+ const [error, setError] = useState<string | null>(null);
+ const makerRef = useRef(maker);
+ makerRef.current = maker;
+ const sessionRef = useRef(session);
+ sessionRef.current = session;
+
+ // 换任务:错误与入口状态都属于上一个任务,整体复位。
+ useEffect(() => {
+ setEntryStatus('loading');
+ setError(null);
+ setBusy(false);
+ }, [sessionId, deviceId]);
+
+ // 打开 + 面板时读一次入口状态(能力 + 协同插件开关);Lead 只需确认能力。
+ // 重连后重读:断线时读失败会落成「不可用」,不能让已打开的表单一直卡住。
+ useEffect(() => {
+ const current = sessionRef.current;
+ if (!sheetOpen || !eligible || !current) return undefined;
+ let cancelled = false;
+ setEntryStatus('loading');
+ void readOrcaCollabEntryStatus(makerRef.current, current, orcaAgentKindForSession(current))
+ .then((status) => { if (!cancelled) setEntryStatus(status); });
+ return () => { cancelled = true; };
+ }, [sheetOpen, eligible, sessionId, role, connectionEpoch]);
+
+ // 协同视图展示中时顺带刷新一次团队(推送之外的兜底)。
+ const refreshTeam = team.refresh;
+ useEffect(() => {
+ if (sheetOpen && sheetView === 'collab' && isLead) void refreshTeam();
+ }, [sheetOpen, sheetView, isLead, refreshTeam]);
+
+ const resetWorkerForm = workerForm.reset;
+ const rememberWorkerForm = workerForm.remember;
+ /** + 面板主视图的「协同模式」行:Lead 进团队面板,其它进开启表单。 */
+ const openFromMain = useCallback(() => {
+ setError(null);
+ if (!isLead) resetWorkerForm();
+ setSheetView('collab');
+ }, [isLead, resetWorkerForm, setSheetView]);
+
+ const openCreateWorker = useCallback(() => {
+ setError(null);
+ resetWorkerForm();
+ setSheetView('collab-create');
+ }, [resetWorkerForm, setSheetView]);
+
+ const form = workerForm.form;
+ const formValid = workerForm.valid;
+ const getProvidersRef = useRef(getProviders);
+ getProvidersRef.current = getProviders;
+
+ const submitEnable = useCallback(async () => {
+ if (!deviceId || !formValid || busy) return;
+ setBusy(true);
+ setError(null);
+ try {
+ const submitted = narrowOrcaWorkerProvider(form, getProvidersRef.current?.() ?? null);
+ await enableOrcaTeam(makerRef.current, sessionId, buildOrcaEnableOptions(submitted, submitted.initialTask));
+ rememberWorkerForm(submitted);
+ remoteSessionStore.applySessionPatch(deviceId, sessionId, { orcaRole: 'lead' });
+ setSheetView('collab');
+ void refreshTeam();
+ } catch (err) {
+ setError(describeOrcaError(err, 'session.collab.errors.startFailed'));
+ } finally {
+ setBusy(false);
+ }
+ }, [busy, deviceId, form, formValid, refreshTeam, rememberWorkerForm, sessionId, setSheetView]);
+
+ const submitCreate = useCallback(async () => {
+ if (!formValid || busy) return;
+ setBusy(true);
+ setError(null);
+ try {
+ const submitted = narrowOrcaWorkerProvider(form, getProvidersRef.current?.() ?? null);
+ await createOrcaWorker(makerRef.current, sessionId, submitted, team.workers);
+ rememberWorkerForm(submitted);
+ setSheetView('collab');
+ void refreshTeam();
+ } catch (err) {
+ setError(describeOrcaError(err, 'session.collab.errors.createFailed'));
+ } finally {
+ setBusy(false);
+ }
+ }, [busy, form, formValid, refreshTeam, rememberWorkerForm, sessionId, setSheetView, team.workers]);
+
+ const runTeamAction = useCallback(async (action: () => Promise<unknown>, fallbackKey: string) => {
+ setBusy(true);
+ setError(null);
+ try {
+ await action();
+ void refreshTeam();
+ return true;
+ } catch (err) {
+ // 超时不当作失败:主机可能仍在执行(结束协同会逐个关闭 Worker)。只读回查团队,提示以列表为准。
+ setError(describeOrcaError(
+ isOrcaAmbiguousTimeout(err) ? new Error('[ORCA_ACTION_UNCONFIRMED] timed out') : err,
+ fallbackKey,
+ ));
+ void refreshTeam();
+ return false;
+ } finally {
+ setBusy(false);
+ }
+ }, [refreshTeam]);
+
+ const openWorker = useCallback((worker: OrcaTeamWorker) => {
+ setSheetOpen(false);
+ // 看到「已完成」即确认(对齐桌面:可见的 done Worker 自动 acknowledge);状态已变则忽略。
+ if (worker.status === 'done') {
+ void makerRef.current.orca.acknowledgeDone(sessionId, worker.workerId).catch(() => undefined);
+ }
+ openSession(worker.sessionId);
+ }, [openSession, sessionId, setSheetOpen]);
+
+ const confirmArchive = useCallback((worker: OrcaTeamWorker) => {
+ Alert.alert(
+ i18n.t('session.collab.archiveConfirmTitle', { name: orcaWorkerDisplayName(worker) }),
+ i18n.t('session.collab.archiveConfirmDesc'),
+ [
+ { text: i18n.t('session.collab.cancel'), style: 'cancel' },
+ {
+ text: i18n.t('session.collab.archiveConfirm'),
+ style: 'destructive',
+ onPress: () => {
+ void runTeamAction(
+ () => makerRef.current.orca.archiveWorker(sessionId, worker.workerId),
+ 'session.collab.errors.archiveFailed',
+ );
+ },
+ },
+ ],
+ );
+ }, [runTeamAction, sessionId]);
+
+ /**
+ * 长按 Worker 行:管理操作(点按直接打开 Worker,不弹窗)。Android 原生 Alert 最多三个
+ * 按钮:已是焦点时「归档 / 取消」,否则「设为焦点 / 归档 / 取消」。
+ */
+ const showWorkerActions = useCallback((worker: OrcaTeamWorker) => {
+ const name = orcaWorkerDisplayName(worker);
+ const cancel = { text: i18n.t('session.collab.cancel'), style: 'cancel' as const };
+ const archive = {
+ text: i18n.t('session.collab.archive'),
+ style: 'destructive' as const,
+ onPress: () => confirmArchive(worker),
+ };
+ if (worker.focused) {
+ Alert.alert(name, orcaWorkerStatusLabel(worker.status), [archive, cancel]);
+ return;
+ }
+ const setFocus = {
+ text: i18n.t('session.collab.setFocus'),
+ onPress: () => {
+ void runTeamAction(
+ () => makerRef.current.orca.switchFocus(sessionId, worker.workerId),
+ 'session.collab.errors.switchFailed',
+ );
+ },
+ };
+ Alert.alert(name, orcaWorkerStatusLabel(worker.status), [setFocus, archive, cancel]);
+ }, [confirmArchive, runTeamAction, sessionId]);
+
+ const confirmEndTeam = useCallback(() => {
+ Alert.alert(
+ i18n.t('session.collab.stopConfirmTitle'),
+ i18n.t('session.collab.stopConfirmDesc'),
+ [
+ { text: i18n.t('session.collab.cancel'), style: 'cancel' },
+ {
+ text: i18n.t('session.collab.stop'),
+ style: 'destructive',
+ onPress: () => {
+ void (async () => {
+ const ok = await runTeamAction(
+ () => makerRef.current.orca.disable(sessionId),
+ 'session.collab.errors.stopFailed',
+ );
+ if (!ok || !deviceId) return;
+ remoteSessionStore.applySessionPatch(deviceId, sessionId, { orcaRole: null });
+ setSheetView('main');
+ setSheetOpen(false);
+ })();
+ },
+ },
+ ],
+ );
+ }, [deviceId, runTeamAction, sessionId, setSheetOpen, setSheetView]);
+
+ const openLead = useCallback(() => {
+ if (workerLeadSessionId) openSession(workerLeadSessionId);
+ }, [openSession, workerLeadSessionId]);
+
+ // ─── Worker 任务自身的操作(详情菜单) ─────────────────────────────────────
+ const refreshWorkerTeam = workerTeam.refresh;
+ const setSelfFocus = useCallback(async () => {
+ if (!workerLeadSessionId || !workerSelf) return;
+ try {
+ await makerRef.current.orca.switchFocus(workerLeadSessionId, workerSelf.workerId);
+ } catch (err) {
+ Alert.alert(describeOrcaError(
+ isOrcaAmbiguousTimeout(err) ? new Error('[ORCA_ACTION_UNCONFIRMED] timed out') : err,
+ 'session.collab.errors.switchFailed',
+ ));
+ } finally {
+ void refreshWorkerTeam();
+ }
+ }, [refreshWorkerTeam, workerLeadSessionId, workerSelf]);
+
+ /** 归档自身:确认弹窗在调用方的面板上直接弹出;用户确认后先调 onConfirmed(如收起详情面板)再归档。 */
+ const confirmArchiveSelf = useCallback((onConfirmed?: () => void) => {
+ if (!workerLeadSessionId || !workerSelf) return;
+ const leadId = workerLeadSessionId;
+ const worker = workerSelf;
+ Alert.alert(
+ i18n.t('session.collab.archiveConfirmTitle', { name: orcaWorkerDisplayName(worker) }),
+ i18n.t('session.collab.archiveConfirmDesc'),
+ [
+ { text: i18n.t('session.collab.cancel'), style: 'cancel' },
+ {
+ text: i18n.t('session.collab.archiveConfirm'),
+ style: 'destructive',
+ onPress: () => {
+ onConfirmed?.();
+ void (async () => {
+ try {
+ await makerRef.current.orca.archiveWorker(leadId, worker.workerId);
+ // 归档后这个 Worker 任务不再可用,回到 Lead。
+ openSession(leadId);
+ } catch (err) {
+ if (isOrcaAmbiguousTimeout(err)) {
+ // 超时不是权威失败:只读回查一次,Worker 已不在团队里就说明归档已生效,照样回到 Lead。
+ const archived = await makerRef.current.orca.listWorkers(leadId)
+ .then((raw) => !parseOrcaTeamWorkers(raw).some((item) => item.workerId === worker.workerId))
+ .catch(() => false);
+ if (archived) {
+ openSession(leadId);
+ return;
+ }
+ }
+ Alert.alert(describeOrcaError(
+ isOrcaAmbiguousTimeout(err) ? new Error('[ORCA_ACTION_UNCONFIRMED] timed out') : err,
+ 'session.collab.errors.archiveFailed',
+ ));
+ void refreshWorkerTeam();
+ }
+ })();
+ },
+ },
+ ],
+ );
+ }, [openSession, refreshWorkerTeam, workerLeadSessionId, workerSelf]);
+
+ return {
+ eligible,
+ isLead,
+ isWorker,
+ entryHint: isLead ? null : orcaCollabEntryHint(entryStatus),
+ entryBlocked: !isLead && entryStatus !== 'ready',
+ team,
+ workerLeadSessionId,
+ openLead,
+ /** Worker 任务自身在团队里的记录;查不到(老被控端 / 读取中)为 null,Worker 操作不出现。 */
+ workerSelf,
+ refreshWorkerSelf: refreshWorkerTeam,
+ setSelfFocus,
+ confirmArchiveSelf,
+ workerForm,
+ busy,
+ error,
+ canSubmit: workerForm.valid && !busy,
+ openFromMain,
+ openCreateWorker,
+ submitEnable,
+ submitCreate,
+ openWorker,
+ showWorkerActions,
+ confirmEndTeam,
+ };
+}
diff --git a/docs/design-rules/design-inventory.md b/docs/design-rules/design-inventory.md
index 5b31f4a58f..65210ec204 100644
--- a/docs/design-rules/design-inventory.md
+++ b/docs/design-rules/design-inventory.md
@@ -51,20 +51,20 @@
| `desktop.window.sidebar` | desktop | 右侧栏独立窗口 | `?sidebarWindow=1` → renderer/sidebar-window-entry.tsx;hash `/sidebar-window` | RightSidebar, RightSidebarShell, SidebarWindowLayout | apps/desktop/src/main/right-sidebar-window/controller.ts, apps/desktop/src/main/right-sidebar-window/ipc.ts, apps/desktop/src/main/right-sidebar-window/registry.ts, apps/desktop/src/main/right-sidebar-window/resolveHostContext.ts, apps/desktop/src/main/right-sidebar-window/settings-store.ts, apps/desktop/src/main/right-sidebar-window/window.ts, apps/desktop/src/renderer/components/layout/SidebarWindowLayout.tsx, apps/desktop/src/renderer/features/right-sidebar/AddTabDropdown.tsx, apps/desktop/src/renderer/features/right-sidebar/EmptyState.tsx, apps/desktop/src/renderer/features/right-sidebar/RightSidebarShell.tsx, apps/desktop/src/renderer/features/right-sidebar/TabBar.tsx, apps/desktop/src/renderer/features/right-sidebar/TabBodyErrorBoundary.tsx, apps/desktop/src/renderer/features/right-sidebar/hooks/useBrowserWebview.ts, apps/desktop/src/renderer/features/right-sidebar/hooks/useNativePopupSurface.ts, apps/desktop/src/renderer/features/right-sidebar/iosSimulatorPluginAvailability.ts, apps/desktop/src/renderer/features/right-sidebar/lib/browserPartition.ts, apps/desktop/src/renderer/features/right-sidebar/lib/browserWebviewPool.ts, apps/desktop/src/renderer/features/right-sidebar/lib/detachedSidebarRouting.ts, apps/desktop/src/renderer/features/right-sidebar/lib/executeSidebarCommand.ts, apps/desktop/src/renderer/features/right-sidebar/lib/iosSimulatorFocusBridge.ts, apps/desktop/src/renderer/features/right-sidebar/lib/lastTurnChangedFiles.ts, apps/desktop/src/renderer/features/right-sidebar/lib/nativePopupTabs.ts, apps/desktop/src/renderer/features/right-sidebar/lib/openBackgroundTasksTab.ts, apps/desktop/src/renderer/features/right-sidebar/lib/openInSidebarBrowser.ts, apps/desktop/src/renderer/features/right-sidebar/lib/openInSidebarFileBrowser.ts, apps/desktop/src/renderer/features/right-sidebar/lib/openRoutinesTab.ts, apps/desktop/src/renderer/features/right-sidebar/lib/openSubagentsTab.ts, apps/desktop/src/renderer/features/right-sidebar/lib/openTerminalShortcut.ts, apps/desktop/src/renderer/features/right-sidebar/lib/openTurnReview.ts, apps/desktop/src/renderer/features/right-sidebar/lib/popupRouter.ts, apps/desktop/src/renderer/features/right-sidebar/lib/popupTabs.ts, apps/desktop/src/renderer/features/right-sidebar/lib/rsbBrowserBridge.ts, apps/desktop/src/renderer/features/right-sidebar/lib/sidebarCommands.ts, apps/desktop/src/renderer/features/right-sidebar/lib/sidebarHostSession.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/background-tasks/BackgroundTasksBody.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/background-tasks/WorkflowAgentStrip.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/background-tasks/WorkflowProgressTree.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/background-tasks/chatTaskFocusIntent.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/background-tasks/index.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/background-tasks/listSessionTasks.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/background-tasks/workflowProgressModel.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/cindy-make/CindyMakeTabBody.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/cindy-make/index.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/file-browser/FileBrowserBody.css, apps/desktop/src/renderer/features/right-sidebar/plugins/file-browser/FileBrowserBody.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/file-browser/dropExternalFile.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/file-browser/fileTreeImagePreview.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/file-browser/index.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/file-browser/useSessionScopedTreeWidth.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/index.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/ios-simulator/IOSSimulatorInstanceGrid.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/ios-simulator/IOSSimulatorTabBody.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/ios-simulator/index.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/ios-simulator/iosSimulatorH264Decoder.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/orca-workers/OrcaWorkersAttentionIcon.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/orca-workers/OrcaWorkersTabBody.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/orca-workers/actions.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/orca-workers/closeDecision.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/orca-workers/index.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/resource-usage/ResourceUsageBody.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/resource-usage/index.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/resource-usage/resource-usage.css, apps/desktop/src/renderer/features/right-sidebar/plugins/resource-usage/subscription.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/review/DiffViewer/ImageDiffPreview.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/review/DiffViewer/MarkdownDiffPreview.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/review/DiffViewer/PlainUnifiedDiff.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/review/DiffViewer/diffRows.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/review/DiffViewer/highlight.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/review/DiffViewer/inlineDiff.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/review/DiffViewer/useDiffHighlights.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/review/ReviewTabBody.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/review/diffExpansionPreference.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/review/fileTree.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/review/gitApplyCommand.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/review/index.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/review/markdownPreview.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/review/useLastTurnFilter.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/review/useReviewGitState.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/review/useReviewSource.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/routines/index.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/subagents/ConversationStream.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/subagents/DetailView.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/subagents/RunList.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/subagents/SubagentChrome.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/subagents/SubagentToolCard.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/subagents/SubagentsBody.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/subagents/index.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/subagents/subagentChangeFence.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/subagents/subagentConversation.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/subagents/subagentFormat.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/terminal/TerminalTabBody.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/terminal/index.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/terminal/lib/xtermPool.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/web-browser/BrowserChrome.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/web-browser/BrowserCommentPopover.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/web-browser/BrowserTabBody.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/web-browser/browserCommentEditorDraft.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/web-browser/index.tsx, apps/desktop/src/renderer/features/right-sidebar/plugins/web-browser/lib/parseOmnibox.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/web-browser/useBrowserComment.ts, apps/desktop/src/renderer/features/right-sidebar/plugins/web-browser/useLocalHtmlAutoReload.ts, apps/desktop/src/renderer/features/right-sidebar/registry.ts, apps/desktop/src/renderer/features/right-sidebar/store.ts, apps/desktop/src/renderer/features/right-sidebar/types.ts, apps/desktop/src/renderer/sidebar-window-entry.tsx, apps/desktop/src/renderer/styles/generated/tokens.css, apps/desktop/src/renderer/styles/globals.css | 103 | 45 | 179 |
| `desktop.window.voice-dictionary-toast` | desktop | 语音词典 Toast 窗 | `?view=voice-input-dictionary-toast` → main-entry.tsx → VoiceInputDictionaryToast | VoiceInputDictionaryToast | apps/desktop/src/renderer/voice-input/VoiceInputDictionaryToast.tsx | 6 | 0 | 2 |
| `desktop.window.voice-overlay` | desktop | 语音输入浮窗 | `?view=voice-input-overlay` → main-entry.tsx → VoiceInputOverlay | VoiceInputOverlay, VoiceInputStatusNotice | apps/desktop/src/main/voice-input/global.ts, apps/desktop/src/renderer/styles/generated/tokens.css, apps/desktop/src/renderer/styles/globals.css, apps/desktop/src/renderer/voice-input/VoiceInputOverlay.tsx, apps/desktop/src/renderer/voice-input/VoiceInputStatusNotice.tsx | 69 | 38 | 19 |
-| `mobile.account-deletion` | mobile | 账号注销 | app/account-deletion.tsx | AdaptiveWindow, AnchoredPullDownMenu, AndroidUpdateSheet, AppText, AuthContext, BlurBackdrop, CenteredScreen, ComposerNativeSection, ComposerNativeSection.ios, ComposerSheet, ComposerSheet.ios, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, ContextSheet.ios, DeviceLinkContext, FoldTouchpad, HomeEntryProvider, HomeHeaderGlassButton, HomeHeaderGlassButton.ios, HomeNativeStackHeader, IncomingShareBridge, MobileLoginHandoffContext, MobileLoginHandoffStage, MobileOutboxBridge, MobilePrimitives, NativeChromeBackButton.ios, NativeChromeButton.ios, NativePullDownMenu, NativeRemoteDesktopView, NativeResidentHistory, NativeSwitch, OutsideTap, PermissionGuide, PermissionGuideView, PermissionGuideView.ios, PushNotificationsBridge, QuietSyncIndicator, RecentMessageHistories, RemoteDesktopActionButton, RemoteDesktopActionButton.ios, RemoteDesktopBackButton, RemoteDesktopBackButton.ios, RemoteDesktopChrome, RemoteDesktopChrome.ios, RemoteDesktopClipboardButton, RemoteDesktopControls, RemoteDesktopDisplaySettings, RemoteDesktopHost, RemoteDesktopIcons, RemoteDesktopMouseControls, RemoteDesktopMouseControls.ios, RemoteDesktopNetworkStatus, RemoteDesktopPanelButton, RemoteDesktopPanelButton.ios, RemoteDesktopScreen, RemoteDesktopSecuritySettings, RemoteDesktopWindows, ResidentHomeList, SheetModal, SheetSurface, SimpleStackHeader, StartupSplashOverlay, ThemeProvider, _layout, account-deletion, gestureHandler, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/account-deletion.tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/AdaptiveWindow.tsx, apps/mobile/src/platform/OutsideTap.tsx, apps/mobile/src/platform/chrome/AnchoredPullDownMenu.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx, apps/mobile/src/platform/chrome/NativeChromeBackButton.ios.tsx, apps/mobile/src/platform/chrome/NativeChromeButton.ios.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/remote-desktop/FoldTouchpad.tsx, apps/mobile/src/remote-desktop/NativeRemoteDesktopView.tsx, apps/mobile/src/remote-desktop/PermissionGuide.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.ios.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.tsx, apps/mobile/src/remote-desktop/RemoteDesktopClipboardButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopDisplaySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopHost.tsx, apps/mobile/src/remote-desktop/RemoteDesktopIcons.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopNetworkStatus.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopScreen.tsx, apps/mobile/src/remote-desktop/RemoteDesktopSecuritySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopWindows.tsx, apps/mobile/src/remote-desktop/viewerHtml.ts, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ComposerNativeSection.ios.tsx, apps/mobile/src/session/ComposerNativeSection.tsx, apps/mobile/src/session/ComposerSheet.ios.tsx, apps/mobile/src/session/ComposerSheet.tsx, apps/mobile/src/session/ContextSheet.ios.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/HomeEntryProvider.tsx, apps/mobile/src/session/HomeHeaderGlassButton.ios.tsx, apps/mobile/src/session/HomeHeaderGlassButton.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/MobileOutboxBridge.tsx, apps/mobile/src/session/NativeResidentHistory.tsx, apps/mobile/src/session/RecentMessageHistories.tsx, apps/mobile/src/session/ResidentHomeList.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 206 | 60 |
-| `mobile.auth` | mobile | 登录与添加账号 | app/(auth)/login.tsx / app/add-account.tsx | AccountSwitcherSheet, AdaptiveWindow, AnchoredPullDownMenu, AndroidUpdateSheet, AppText, AuthContext, BlurBackdrop, CenteredScreen, ComposerNativeSection, ComposerNativeSection.ios, ComposerSheet, ComposerSheet.ios, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, ContextSheet.ios, DeviceLinkContext, FoldTouchpad, HomeEntryProvider, HomeHeaderGlassButton, HomeHeaderGlassButton.ios, IncomingShareBridge, LoginCaptchaWebView, LoginNativeButton, LoginNativeButton.ios, LoginSkinControls, MobileLoginHandoffContext, MobileLoginHandoffStage, MobileOutboxBridge, MobilePrimitives, NativeChromeBackButton.ios, NativeChromeButton.ios, NativePullDownMenu, NativeRemoteDesktopView, NativeResidentHistory, NativeSwitch, OutsideTap, PermissionGuide, PermissionGuideView, PermissionGuideView.ios, PushNotificationsBridge, QuietSyncIndicator, RecentMessageHistories, RemoteDesktopActionButton, RemoteDesktopActionButton.ios, RemoteDesktopBackButton, RemoteDesktopBackButton.ios, RemoteDesktopChrome, RemoteDesktopChrome.ios, RemoteDesktopClipboardButton, RemoteDesktopControls, RemoteDesktopDisplaySettings, RemoteDesktopHost, RemoteDesktopIcons, RemoteDesktopMouseControls, RemoteDesktopMouseControls.ios, RemoteDesktopNetworkStatus, RemoteDesktopPanelButton, RemoteDesktopPanelButton.ios, RemoteDesktopScreen, RemoteDesktopSecuritySettings, RemoteDesktopWindows, ResidentHomeList, SheetModal, SheetSurface, StartupSplashOverlay, SystemNavigationBack, ThemeProvider, _layout, add-account, gestureHandler, login, peerFileTransport, useLocale | apps/mobile/app/(auth)/login.tsx, apps/mobile/app/_layout.tsx, apps/mobile/app/add-account.tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/LoginCaptchaWebView.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/LoginNativeButton.ios.tsx, apps/mobile/src/components/LoginNativeButton.tsx, apps/mobile/src/components/LoginSkinControls.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/AdaptiveWindow.tsx, apps/mobile/src/platform/OutsideTap.tsx, apps/mobile/src/platform/chrome/AnchoredPullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeChromeBackButton.ios.tsx, apps/mobile/src/platform/chrome/NativeChromeButton.ios.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SystemNavigationBack.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/remote-desktop/FoldTouchpad.tsx, apps/mobile/src/remote-desktop/NativeRemoteDesktopView.tsx, apps/mobile/src/remote-desktop/PermissionGuide.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.ios.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.tsx, apps/mobile/src/remote-desktop/RemoteDesktopClipboardButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopDisplaySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopHost.tsx, apps/mobile/src/remote-desktop/RemoteDesktopIcons.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopNetworkStatus.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopScreen.tsx, apps/mobile/src/remote-desktop/RemoteDesktopSecuritySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopWindows.tsx, apps/mobile/src/remote-desktop/viewerHtml.ts, apps/mobile/src/session/AccountSwitcherSheet.tsx, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ComposerNativeSection.ios.tsx, apps/mobile/src/session/ComposerNativeSection.tsx, apps/mobile/src/session/ComposerSheet.ios.tsx, apps/mobile/src/session/ComposerSheet.tsx, apps/mobile/src/session/ContextSheet.ios.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/HomeEntryProvider.tsx, apps/mobile/src/session/HomeHeaderGlassButton.ios.tsx, apps/mobile/src/session/HomeHeaderGlassButton.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/MobileOutboxBridge.tsx, apps/mobile/src/session/NativeResidentHistory.tsx, apps/mobile/src/session/RecentMessageHistories.tsx, apps/mobile/src/session/ResidentHomeList.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 213 | 82 |
-| `mobile.chat.new` | mobile | 新建任务 | app/sessions/new.tsx | AdaptiveWindow, AnchoredPullDownMenu, AndroidUpdateSheet, AnnotationBurnInWebView, AppText, AuthContext, BlurBackdrop, CenteredScreen, ComposerAttachmentTray, ComposerFrame, ComposerFrame.ios, ComposerKeyboardAvoidingView, ComposerNativeRow, ComposerNativeRow.ios, ComposerNativeSection, ComposerNativeSection.ios, ComposerSheet, ComposerSheet.ios, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, ContextSheet.ios, ContextSheetGoalView, ContextSheetGoalView.ios, ContextSheetMediaViews, DeviceLinkContext, FileTypeIcon, FoldTouchpad, HomeEntryProvider, HomeHeaderGlassButton, HomeHeaderGlassButton.ios, HomeNativeStackHeader, ImageLightbox, IncomingShareBridge, MobileAgentMark, MobileAgentSwitcher, MobileChoicePickerList, MobileComposerInputRow, MobileLoginHandoffContext, MobileLoginHandoffStage, MobileModelPickerList, MobileModelPickerList.ios, MobileOutboxBridge, MobilePermissionPickerList, MobilePermissionPickerList.ios, MobilePrimitives, MobileProviderMark, MobileVendorIcon, ModelOptionsSheetView, ModelOptionsSheetView.ios, ModelPickerNativeHeader, ModelPickerNativeHeader.ios, ModelPickerSheet, NativeChromeBackButton.ios, NativeChromeButton.ios, NativePermissionSheet, NativePermissionSheet.ios, NativePullDownMenu, NativeRemoteDesktopView, NativeResidentHistory, NativeSwitch, NewTaskSelectionSheet, NewTaskSelectionSheet.ios, OutsideTap, PaperPlaneIcon, PermissionGuide, PermissionGuideView, PermissionGuideView.ios, PlanModeChip, PushNotificationsBridge, QuietSyncIndicator, RecentMessageHistories, RemoteDesktopActionButton, RemoteDesktopActionButton.ios, RemoteDesktopBackButton, RemoteDesktopBackButton.ios, RemoteDesktopChrome, RemoteDesktopChrome.ios, RemoteDesktopClipboardButton, RemoteDesktopControls, RemoteDesktopDisplaySettings, RemoteDesktopHost, RemoteDesktopIcons, RemoteDesktopMouseControls, RemoteDesktopMouseControls.ios, RemoteDesktopNetworkStatus, RemoteDesktopPanelButton, RemoteDesktopPanelButton.ios, RemoteDesktopScreen, RemoteDesktopSecuritySettings, RemoteDesktopWindows, ResidentHomeList, SheetModal, SheetSurface, SimpleStackHeader, SlowSendNotice, StartupSplashOverlay, ThemeProvider, UnifiedModelPickerSheet, UnifiedModelPickerView, UnifiedModelPickerView.ios, VoiceRecordingPill, _layout, gestureHandler, new, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/sessions/new.tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/FileTypeIcon.tsx, apps/mobile/src/components/MobileAgentMark.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/MobileVendorIcon.tsx, apps/mobile/src/components/PaperPlaneIcon.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/AdaptiveWindow.tsx, apps/mobile/src/platform/OutsideTap.tsx, apps/mobile/src/platform/chrome/AnchoredPullDownMenu.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx, apps/mobile/src/platform/chrome/NativeChromeBackButton.ios.tsx, apps/mobile/src/platform/chrome/NativeChromeButton.ios.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/remote-desktop/FoldTouchpad.tsx, apps/mobile/src/remote-desktop/NativeRemoteDesktopView.tsx, apps/mobile/src/remote-desktop/PermissionGuide.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.ios.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.tsx, apps/mobile/src/remote-desktop/RemoteDesktopClipboardButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopDisplaySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopHost.tsx, apps/mobile/src/remote-desktop/RemoteDesktopIcons.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopNetworkStatus.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopScreen.tsx, apps/mobile/src/remote-desktop/RemoteDesktopSecuritySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopWindows.tsx, apps/mobile/src/remote-desktop/viewerHtml.ts, apps/mobile/src/session/AnnotationBurnInWebView.tsx, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ComposerAttachmentTray.tsx, apps/mobile/src/session/ComposerFrame.ios.tsx, apps/mobile/src/session/ComposerFrame.tsx, apps/mobile/src/session/ComposerKeyboardAvoidingView.tsx, apps/mobile/src/session/ComposerNativeRow.ios.tsx, apps/mobile/src/session/ComposerNativeRow.tsx, apps/mobile/src/session/ComposerNativeSection.ios.tsx, apps/mobile/src/session/ComposerNativeSection.tsx, apps/mobile/src/session/ComposerSheet.ios.tsx, apps/mobile/src/session/ComposerSheet.tsx, apps/mobile/src/session/ContextSheet.ios.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/ContextSheetGoalView.ios.tsx, apps/mobile/src/session/ContextSheetGoalView.tsx, apps/mobile/src/session/ContextSheetMediaViews.tsx, apps/mobile/src/session/HomeEntryProvider.tsx, apps/mobile/src/session/HomeHeaderGlassButton.ios.tsx, apps/mobile/src/session/HomeHeaderGlassButton.tsx, apps/mobile/src/session/ImageLightbox.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/MobileAgentSwitcher.tsx, apps/mobile/src/session/MobileChoicePickerList.tsx, apps/mobile/src/session/MobileComposerInputRow.tsx, apps/mobile/src/session/MobileModelPickerList.ios.tsx, apps/mobile/src/session/MobileModelPickerList.tsx, apps/mobile/src/session/MobileOutboxBridge.tsx, apps/mobile/src/session/MobilePermissionPickerList.ios.tsx, apps/mobile/src/session/MobilePermissionPickerList.tsx, apps/mobile/src/session/MobileProviderMark.tsx, apps/mobile/src/session/ModelOptionsSheetView.ios.tsx, apps/mobile/src/session/ModelOptionsSheetView.tsx, apps/mobile/src/session/ModelPickerNativeHeader.ios.tsx, apps/mobile/src/session/ModelPickerNativeHeader.tsx, apps/mobile/src/session/ModelPickerSheet.tsx, apps/mobile/src/session/NativePermissionSheet.ios.tsx, apps/mobile/src/session/NativePermissionSheet.tsx, apps/mobile/src/session/NativeResidentHistory.tsx, apps/mobile/src/session/NewTaskSelectionSheet.ios.tsx, apps/mobile/src/session/NewTaskSelectionSheet.tsx, apps/mobile/src/session/PlanModeChip.tsx, apps/mobile/src/session/RecentMessageHistories.tsx, apps/mobile/src/session/ResidentHomeList.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/session/SlowSendNotice.tsx, apps/mobile/src/session/UnifiedModelPickerSheet.tsx, apps/mobile/src/session/UnifiedModelPickerView.ios.tsx, apps/mobile/src/session/UnifiedModelPickerView.tsx, apps/mobile/src/session/VoiceRecordingPill.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 238 | 106 |
-| `mobile.chat.session` | mobile | 任务内容与输入 | app/sessions/[sessionId].tsx | AccountSwitcherSheet, AdaptiveWindow, AgentErrorDetails, AnchoredPullDownMenu, AndroidUpdateSheet, AnnotationBurnInWebView, AppText, AuthContext, AuthorizationMessageCard, AutomationTimerIcon, BlurBackdrop, CenteredScreen, ChatFileChipMenuSheet, CompanionChoice, CompanionCreateNativeView, CompanionCreateNativeView.ios, CompanionHeader, CompanionMemoryPage, CompanionMemoryPage.ios, CompanionMessageActions, CompanionMessageCard, CompanionModelChain, CompanionNativeContent.ios, CompanionNavigationDrawer, CompanionPortraitPicker, CompanionProfileArtifacts, CompanionProfileNativeView, CompanionProfileNativeView.ios, CompanionProfileSheet, CompanionSettingsRow, CompanionSettingsRow.ios, CompanionSheet, CompanionSheet.ios, CompanionTaskResultCard, CompanionWorkingStatus, ComposerAttachmentTray, ComposerExpandButton, ComposerExpandButton.ios, ComposerFrame, ComposerFrame.ios, ComposerKeyboardAvoidingView, ComposerNativeInput, ComposerNativeInput.ios, ComposerNativeRow, ComposerNativeRow.ios, ComposerNativeSection, ComposerNativeSection.ios, ComposerRichInput, ComposerSheet, ComposerSheet.ios, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, ContextSheet.ios, ContextSheetGoalView, ContextSheetGoalView.ios, ContextSheetMediaViews, ConversationSearchFilterSheet, ConversationShareSvg, ConversationShareWebView, DeviceLinkContext, FailedScheduleNotice, FileTypeIcon, FoldTouchpad, HomeChromeDrawer, HomeChromeFrost, HomeEntryProvider, HomeGlassMenuPanel, HomeHeaderGlassButton, HomeHeaderGlassButton.ios, HomeListVisuals, HomeModeSwitch, HomeNativeStackHeader, HomeNewTaskButton, HomeProjectMachineLabel, HomeSearchBar, HomeSurface, ImageLightbox, IncomingShareBridge, InlineQueueSection, InlineQuoteChip, InlineReferenceChip, InteractionPanel, LoginNativeButton, LoginNativeButton.ios, MarkdownBlockContent, MessageActionSheet, MessageRenderer, MobileAgentMark, MobileAgentSwitcher, MobileBoundaryNotice, MobileComposerInputRow, MobileLoginHandoffContext, MobileLoginHandoffStage, MobileModelPickerList, MobileModelPickerList.ios, MobileOutboxBridge, MobilePermissionPickerList, MobilePermissionPickerList.ios, MobilePrimitives, MobileProviderMark, MobileVendorIcon, ModalContentArea, ModelOptionsSheetView, ModelOptionsSheetView.ios, ModelPickerNativeHeader, ModelPickerNativeHeader.ios, ModelPickerSheet, NativeChromeBackButton.ios, NativeChromeButton.ios, NativePermissionSheet, NativePermissionSheet.ios, NativePullDownMenu, NativeRemoteDesktopView, NativeResidentHistory, NativeSwitch, OutsideTap, PaperPlaneIcon, PendingSendBubble, PermissionGuide, PermissionGuideView, PermissionGuideView.ios, PlanModeChip, PluginInvocationHeader, PromptRecommendation, PushNotificationsBridge, QuietSyncIndicator, QuoteCapsule, RecentMessageHistories, RemoteAccessGuide, RemoteCompanionAvatar, RemoteDesktopActionButton, RemoteDesktopActionButton.ios, RemoteDesktopBackButton, RemoteDesktopBackButton.ios, RemoteDesktopChrome, RemoteDesktopChrome.ios, RemoteDesktopClipboardButton, RemoteDesktopControls, RemoteDesktopDisplaySettings, RemoteDesktopHost, RemoteDesktopIcons, RemoteDesktopMouseControls, RemoteDesktopMouseControls.ios, RemoteDesktopNetworkStatus, RemoteDesktopPanelButton, RemoteDesktopPanelButton.ios, RemoteDesktopScreen, RemoteDesktopSecuritySettings, RemoteDesktopWindows, RemoteTaskSuggestions, RenameSessionModal, ResidentHomeList, RewindPreviewPanel, RunningTokenRatePopover, SentInlineAtomBody, SessionActionSheet, SessionDetailsNative, SessionDetailsNative.ios, SessionHeaderNativeControls, SessionHeaderNativeControls.ios, SessionListDrawer, SessionMenuSheet, SessionOptionsExpoSheet, SessionResourceCards, SessionSearchNative, SessionSearchNative.ios, SessionTailBanner, SessionUsageSummary, ShareImageNativeButton, ShareImageNativeButton.ios, ShareMessageCheckbox, ShareSelectAllButton, ShareSelectionBar, SharedTaskEndedState, SharedTaskScreen, SheetModal, SheetSurface, SimpleStackHeader, SlowSendNotice, StartupSplashOverlay, StreamingStatusText, SwipeableSessionRow, SwipeableSessionRow.ios, SystemNavigationBack, TaskTags, TaskTagsSheet, TeammateGenerationLabel, TeammateList, TeammatePicker, ThemeProvider, UnifiedModelPickerSheet, UnifiedModelPickerView, UnifiedModelPickerView.ios, VoiceRecordingPill, WorkingStatusText, [sessionId], _layout, gestureHandler, mathWebView, mediaPlayerWebView, mermaidWebView, peerFileTransport, useLocale, useSharedTaskConfirmation | apps/mobile/app/_layout.tsx, apps/mobile/app/sessions/[sessionId].tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/FileTypeIcon.tsx, apps/mobile/src/components/LoginNativeButton.ios.tsx, apps/mobile/src/components/LoginNativeButton.tsx, apps/mobile/src/components/MobileAgentMark.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/MobileVendorIcon.tsx, apps/mobile/src/components/PaperPlaneIcon.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/RemoteAccessGuide.tsx, apps/mobile/src/components/RemoteCompanionAvatar.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/AdaptiveWindow.tsx, apps/mobile/src/platform/ModalContentArea.tsx, apps/mobile/src/platform/OutsideTap.tsx, apps/mobile/src/platform/chrome/AnchoredPullDownMenu.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx, apps/mobile/src/platform/chrome/NativeChromeBackButton.ios.tsx, apps/mobile/src/platform/chrome/NativeChromeButton.ios.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/chrome/SystemNavigationBack.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/remote-desktop/FoldTouchpad.tsx, apps/mobile/src/remote-desktop/NativeRemoteDesktopView.tsx, apps/mobile/src/remote-desktop/PermissionGuide.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.ios.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.tsx, apps/mobile/src/remote-desktop/RemoteDesktopClipboardButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopDisplaySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopHost.tsx, apps/mobile/src/remote-desktop/RemoteDesktopIcons.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopNetworkStatus.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopScreen.tsx, apps/mobile/src/remote-desktop/RemoteDesktopSecuritySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopWindows.tsx, apps/mobile/src/remote-desktop/viewerHtml.ts, apps/mobile/src/session/AccountSwitcherSheet.tsx, apps/mobile/src/session/AgentErrorDetails.tsx, apps/mobile/src/session/AnnotationBurnInWebView.tsx, apps/mobile/src/session/AuthorizationMessageCard.tsx, apps/mobile/src/session/AutomationTimerIcon.tsx, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ChatFileChipMenuSheet.tsx, apps/mobile/src/session/CompanionChoice.tsx, apps/mobile/src/session/CompanionCreateNativeView.ios.tsx, apps/mobile/src/session/CompanionCreateNativeView.tsx, apps/mobile/src/session/CompanionHeader.tsx, apps/mobile/src/session/CompanionMemoryPage.ios.tsx, apps/mobile/src/session/CompanionMemoryPage.tsx, apps/mobile/src/session/CompanionMessageActions.tsx, apps/mobile/src/session/CompanionMessageCard.tsx, apps/mobile/src/session/CompanionModelChain.tsx, apps/mobile/src/session/CompanionNativeContent.ios.tsx, apps/mobile/src/session/CompanionNavigationDrawer.tsx, apps/mobile/src/session/CompanionPortraitPicker.tsx, apps/mobile/src/session/CompanionProfileArtifacts.tsx, apps/mobile/src/session/CompanionProfileNativeView.ios.tsx, apps/mobile/src/session/CompanionProfileNativeView.tsx, apps/mobile/src/session/CompanionProfileSheet.tsx, apps/mobile/src/session/CompanionSettingsRow.ios.tsx, apps/mobile/src/session/CompanionSettingsRow.tsx, apps/mobile/src/session/CompanionSheet.ios.tsx, apps/mobile/src/session/CompanionSheet.tsx, apps/mobile/src/session/CompanionTaskResultCard.tsx, apps/mobile/src/session/CompanionWorkingStatus.tsx, apps/mobile/src/session/ComposerAttachmentTray.tsx, apps/mobile/src/session/ComposerExpandButton.ios.tsx, apps/mobile/src/session/ComposerExpandButton.tsx, apps/mobile/src/session/ComposerFrame.ios.tsx, apps/mobile/src/session/ComposerFrame.tsx, apps/mobile/src/session/ComposerKeyboardAvoidingView.tsx, apps/mobile/src/session/ComposerNativeInput.ios.tsx, apps/mobile/src/session/ComposerNativeInput.tsx, apps/mobile/src/session/ComposerNativeRow.ios.tsx, apps/mobile/src/session/ComposerNativeRow.tsx, apps/mobile/src/session/ComposerNativeSection.ios.tsx, apps/mobile/src/session/ComposerNativeSection.tsx, apps/mobile/src/session/ComposerRichInput.tsx, apps/mobile/src/session/ComposerSheet.ios.tsx, apps/mobile/src/session/ComposerSheet.tsx, apps/mobile/src/session/ContextSheet.ios.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/ContextSheetGoalView.ios.tsx, apps/mobile/src/session/ContextSheetGoalView.tsx, apps/mobile/src/session/ContextSheetMediaViews.tsx, apps/mobile/src/session/ConversationSearchFilterSheet.tsx, apps/mobile/src/session/ConversationShareSvg.tsx, apps/mobile/src/session/ConversationShareWebView.tsx, apps/mobile/src/session/FailedScheduleNotice.tsx, apps/mobile/src/session/HomeChromeDrawer.tsx, apps/mobile/src/session/HomeChromeFrost.tsx, apps/mobile/src/session/HomeEntryProvider.tsx, apps/mobile/src/session/HomeGlassMenuPanel.tsx, apps/mobile/src/session/HomeHeaderGlassButton.ios.tsx, apps/mobile/src/session/HomeHeaderGlassButton.tsx, apps/mobile/src/session/HomeListVisuals.tsx, apps/mobile/src/session/HomeModeSwitch.tsx, apps/mobile/src/session/HomeNewTaskButton.tsx, apps/mobile/src/session/HomeProjectMachineLabel.tsx, apps/mobile/src/session/HomeSearchBar.tsx, apps/mobile/src/session/HomeSurface.tsx, apps/mobile/src/session/ImageLightbox.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/InlineQueueSection.tsx, apps/mobile/src/session/InlineQuoteChip.tsx, apps/mobile/src/session/InlineReferenceChip.tsx, apps/mobile/src/session/InteractionPanel.tsx, apps/mobile/src/session/MarkdownBlockContent.tsx, apps/mobile/src/session/MessageActionSheet.tsx, apps/mobile/src/session/MessageRenderer.tsx, apps/mobile/src/session/MobileAgentSwitcher.tsx, apps/mobile/src/session/MobileBoundaryNotice.tsx, apps/mobile/src/session/MobileComposerInputRow.tsx, apps/mobile/src/session/MobileModelPickerList.ios.tsx, apps/mobile/src/session/MobileModelPickerList.tsx, apps/mobile/src/session/MobileOutboxBridge.tsx, apps/mobile/src/session/MobilePermissionPickerList.ios.tsx, apps/mobile/src/session/MobilePermissionPickerList.tsx, apps/mobile/src/session/MobileProviderMark.tsx, apps/mobile/src/session/ModelOptionsSheetView.ios.tsx, apps/mobile/src/session/ModelOptionsSheetView.tsx, apps/mobile/src/session/ModelPickerNativeHeader.ios.tsx, apps/mobile/src/session/ModelPickerNativeHeader.tsx, apps/mobile/src/session/ModelPickerSheet.tsx, apps/mobile/src/session/NativePermissionSheet.ios.tsx, apps/mobile/src/session/NativePermissionSheet.tsx, apps/mobile/src/session/NativeResidentHistory.tsx, apps/mobile/src/session/PendingSendBubble.tsx, apps/mobile/src/session/PlanModeChip.tsx, apps/mobile/src/session/PluginInvocationHeader.tsx, apps/mobile/src/session/PromptRecommendation.tsx, apps/mobile/src/session/QuoteCapsule.tsx, apps/mobile/src/session/RecentMessageHistories.tsx, apps/mobile/src/session/RemoteTaskSuggestions.tsx, apps/mobile/src/session/RenameSessionModal.tsx, apps/mobile/src/session/ResidentHomeList.tsx, apps/mobile/src/session/RewindPreviewPanel.tsx, apps/mobile/src/session/RunningTokenRatePopover.tsx, apps/mobile/src/session/SentInlineAtomBody.tsx, apps/mobile/src/session/SessionActionSheet.tsx, apps/mobile/src/session/SessionDetailsNative.ios.tsx, apps/mobile/src/session/SessionDetailsNative.tsx, apps/mobile/src/session/SessionHeaderNativeControls.ios.tsx, apps/mobile/src/session/SessionHeaderNativeControls.tsx, apps/mobile/src/session/SessionListDrawer.tsx, apps/mobile/src/session/SessionMenuSheet.tsx, apps/mobile/src/session/SessionOptionsExpoSheet.tsx, apps/mobile/src/session/SessionResourceCards.tsx, apps/mobile/src/session/SessionSearchNative.ios.tsx, apps/mobile/src/session/SessionSearchNative.tsx, apps/mobile/src/session/SessionTailBanner.tsx, apps/mobile/src/session/SessionUsageSummary.tsx, apps/mobile/src/session/ShareImageNativeButton.ios.tsx, apps/mobile/src/session/ShareImageNativeButton.tsx, apps/mobile/src/session/ShareMessageCheckbox.tsx, apps/mobile/src/session/ShareSelectAllButton.tsx, apps/mobile/src/session/ShareSelectionBar.tsx, apps/mobile/src/session/SharedTaskEndedState.tsx, apps/mobile/src/session/SharedTaskScreen.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/session/SlowSendNotice.tsx, apps/mobile/src/session/StreamingStatusText.tsx, apps/mobile/src/session/SwipeableSessionRow.ios.tsx, apps/mobile/src/session/SwipeableSessionRow.tsx, apps/mobile/src/session/TaskTags.tsx, apps/mobile/src/session/TaskTagsSheet.tsx, apps/mobile/src/session/TeammateGenerationLabel.tsx, apps/mobile/src/session/TeammateList.tsx, apps/mobile/src/session/TeammatePicker.tsx, apps/mobile/src/session/UnifiedModelPickerSheet.tsx, apps/mobile/src/session/UnifiedModelPickerView.ios.tsx, apps/mobile/src/session/UnifiedModelPickerView.tsx, apps/mobile/src/session/VoiceRecordingPill.tsx, apps/mobile/src/session/WorkingStatusText.tsx, apps/mobile/src/session/composerRichInputHtml.ts, apps/mobile/src/session/conversationShareWebViewHtml.ts, apps/mobile/src/session/mathWebView.tsx, apps/mobile/src/session/mathWebViewHtml.ts, apps/mobile/src/session/mediaPlayerWebView.tsx, apps/mobile/src/session/mediaPlayerWebViewHtml.ts, apps/mobile/src/session/mermaidWebView.tsx, apps/mobile/src/session/mermaidWebViewHtml.ts, apps/mobile/src/session/selectableMarkdownHtml.ts, apps/mobile/src/session/useSharedTaskConfirmation.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 7 | 239 | 301 |
-| `mobile.chat.sharing` | mobile | 共享任务邀请与成员 | app/shared-session.tsx | AdaptiveWindow, AnchoredPullDownMenu, AndroidUpdateSheet, AppText, AuthContext, BlurBackdrop, CenteredScreen, ComposerNativeSection, ComposerNativeSection.ios, ComposerSheet, ComposerSheet.ios, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, ContextSheet.ios, DeviceLinkContext, FoldTouchpad, HomeEntryProvider, IncomingShareBridge, MobileLoginHandoffContext, MobileLoginHandoffStage, MobileOutboxBridge, MobilePrimitives, NativeChromeBackButton.ios, NativeChromeButton.ios, NativePullDownMenu, NativeRemoteDesktopView, NativeResidentHistory, NativeSwitch, OutsideTap, PermissionGuide, PermissionGuideView, PermissionGuideView.ios, PushNotificationsBridge, QuietSyncIndicator, RecentMessageHistories, RemoteDesktopActionButton, RemoteDesktopActionButton.ios, RemoteDesktopBackButton, RemoteDesktopBackButton.ios, RemoteDesktopChrome, RemoteDesktopChrome.ios, RemoteDesktopClipboardButton, RemoteDesktopControls, RemoteDesktopDisplaySettings, RemoteDesktopHost, RemoteDesktopIcons, RemoteDesktopMouseControls, RemoteDesktopMouseControls.ios, RemoteDesktopNetworkStatus, RemoteDesktopPanelButton, RemoteDesktopPanelButton.ios, RemoteDesktopScreen, RemoteDesktopSecuritySettings, RemoteDesktopWindows, ResidentHomeList, SharedTaskEndedState, SharedTaskScreen, SheetModal, SheetSurface, SimpleStackHeader, StartupSplashOverlay, ThemeProvider, _layout, gestureHandler, peerFileTransport, shared-session, useLocale, useSharedTaskConfirmation | apps/mobile/app/_layout.tsx, apps/mobile/app/shared-session.tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/AdaptiveWindow.tsx, apps/mobile/src/platform/OutsideTap.tsx, apps/mobile/src/platform/chrome/AnchoredPullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeChromeBackButton.ios.tsx, apps/mobile/src/platform/chrome/NativeChromeButton.ios.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/remote-desktop/FoldTouchpad.tsx, apps/mobile/src/remote-desktop/NativeRemoteDesktopView.tsx, apps/mobile/src/remote-desktop/PermissionGuide.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.ios.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.tsx, apps/mobile/src/remote-desktop/RemoteDesktopClipboardButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopDisplaySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopHost.tsx, apps/mobile/src/remote-desktop/RemoteDesktopIcons.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopNetworkStatus.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopScreen.tsx, apps/mobile/src/remote-desktop/RemoteDesktopSecuritySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopWindows.tsx, apps/mobile/src/remote-desktop/viewerHtml.ts, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ComposerNativeSection.ios.tsx, apps/mobile/src/session/ComposerNativeSection.tsx, apps/mobile/src/session/ComposerSheet.ios.tsx, apps/mobile/src/session/ComposerSheet.tsx, apps/mobile/src/session/ContextSheet.ios.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/HomeEntryProvider.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/MobileOutboxBridge.tsx, apps/mobile/src/session/NativeResidentHistory.tsx, apps/mobile/src/session/RecentMessageHistories.tsx, apps/mobile/src/session/ResidentHomeList.tsx, apps/mobile/src/session/SharedTaskEndedState.tsx, apps/mobile/src/session/SharedTaskScreen.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/session/useSharedTaskConfirmation.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 206 | 63 |
-| `mobile.companions.direct` | mobile | 伙伴私聊回看 | app/companions/direct/[threadId].tsx | AdaptiveWindow, AnchoredPullDownMenu, AndroidUpdateSheet, AppText, AuthContext, BlurBackdrop, CenteredScreen, ComposerNativeSection, ComposerNativeSection.ios, ComposerSheet, ComposerSheet.ios, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, ContextSheet.ios, DeviceLinkContext, FoldTouchpad, HomeEntryProvider, HomeHeaderGlassButton, HomeHeaderGlassButton.ios, HomeNativeStackHeader, IncomingShareBridge, MobileLoginHandoffContext, MobileLoginHandoffStage, MobileOutboxBridge, MobilePrimitives, NativeChromeBackButton.ios, NativeChromeButton.ios, NativePullDownMenu, NativeRemoteDesktopView, NativeResidentHistory, NativeSwitch, OutsideTap, PermissionGuide, PermissionGuideView, PermissionGuideView.ios, PushNotificationsBridge, QuietSyncIndicator, RecentMessageHistories, RemoteCompanionAvatar, RemoteDesktopActionButton, RemoteDesktopActionButton.ios, RemoteDesktopBackButton, RemoteDesktopBackButton.ios, RemoteDesktopChrome, RemoteDesktopChrome.ios, RemoteDesktopClipboardButton, RemoteDesktopControls, RemoteDesktopDisplaySettings, RemoteDesktopHost, RemoteDesktopIcons, RemoteDesktopMouseControls, RemoteDesktopMouseControls.ios, RemoteDesktopNetworkStatus, RemoteDesktopPanelButton, RemoteDesktopPanelButton.ios, RemoteDesktopScreen, RemoteDesktopSecuritySettings, RemoteDesktopWindows, ResidentHomeList, SheetModal, SheetSurface, SimpleStackHeader, StartupSplashOverlay, ThemeProvider, [threadId], _layout, gestureHandler, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/companions/direct/[threadId].tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/RemoteCompanionAvatar.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/AdaptiveWindow.tsx, apps/mobile/src/platform/OutsideTap.tsx, apps/mobile/src/platform/chrome/AnchoredPullDownMenu.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx, apps/mobile/src/platform/chrome/NativeChromeBackButton.ios.tsx, apps/mobile/src/platform/chrome/NativeChromeButton.ios.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/remote-desktop/FoldTouchpad.tsx, apps/mobile/src/remote-desktop/NativeRemoteDesktopView.tsx, apps/mobile/src/remote-desktop/PermissionGuide.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.ios.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.tsx, apps/mobile/src/remote-desktop/RemoteDesktopClipboardButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopDisplaySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopHost.tsx, apps/mobile/src/remote-desktop/RemoteDesktopIcons.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopNetworkStatus.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopScreen.tsx, apps/mobile/src/remote-desktop/RemoteDesktopSecuritySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopWindows.tsx, apps/mobile/src/remote-desktop/viewerHtml.ts, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ComposerNativeSection.ios.tsx, apps/mobile/src/session/ComposerNativeSection.tsx, apps/mobile/src/session/ComposerSheet.ios.tsx, apps/mobile/src/session/ComposerSheet.tsx, apps/mobile/src/session/ContextSheet.ios.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/HomeEntryProvider.tsx, apps/mobile/src/session/HomeHeaderGlassButton.ios.tsx, apps/mobile/src/session/HomeHeaderGlassButton.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/MobileOutboxBridge.tsx, apps/mobile/src/session/NativeResidentHistory.tsx, apps/mobile/src/session/RecentMessageHistories.tsx, apps/mobile/src/session/ResidentHomeList.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 206 | 58 |
-| `mobile.device-management` | mobile | 设备管理 | app/devices/manage.tsx / app/devices/manage/[deviceId].tsx | AdaptiveWindow, AnchoredPullDownMenu, AndroidUpdateSheet, AppText, AuthContext, BlurBackdrop, CenteredScreen, ComposerNativeSection, ComposerNativeSection.ios, ComposerSheet, ComposerSheet.ios, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, ContextSheet.ios, DeviceInformationFields, DeviceInformationFields.ios, DeviceLinkContext, DeviceManagementDialogs, DeviceManagementList, DeviceManagementList.ios, FoldTouchpad, HomeEntryProvider, HomeHeaderGlassButton, HomeHeaderGlassButton.ios, HomeNativeStackHeader, IncomingShareBridge, MobileLoginHandoffContext, MobileLoginHandoffStage, MobileOutboxBridge, MobilePrimitives, ModalContentArea, NativeChromeBackButton.ios, NativeChromeButton.ios, NativePullDownMenu, NativeRemoteDesktopView, NativeResidentHistory, NativeSwitch, OutsideTap, PermissionGuide, PermissionGuideView, PermissionGuideView.ios, PushNotificationsBridge, QuietSyncIndicator, RecentMessageHistories, RemoteDesktopActionButton, RemoteDesktopActionButton.ios, RemoteDesktopBackButton, RemoteDesktopBackButton.ios, RemoteDesktopChrome, RemoteDesktopChrome.ios, RemoteDesktopClipboardButton, RemoteDesktopControls, RemoteDesktopDisplaySettings, RemoteDesktopHost, RemoteDesktopIcons, RemoteDesktopMouseControls, RemoteDesktopMouseControls.ios, RemoteDesktopNetworkStatus, RemoteDesktopPanelButton, RemoteDesktopPanelButton.ios, RemoteDesktopScreen, RemoteDesktopSecuritySettings, RemoteDesktopWindows, RenameDeviceModal, ResidentHomeList, SheetModal, SheetSurface, SimpleStackHeader, StartupSplashOverlay, ThemeProvider, [deviceId], _layout, gestureHandler, manage, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/devices/manage.tsx, apps/mobile/app/devices/manage/[deviceId].tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceInformationFields.ios.tsx, apps/mobile/src/device-link/DeviceInformationFields.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/DeviceManagementDialogs.tsx, apps/mobile/src/device-link/DeviceManagementList.ios.tsx, apps/mobile/src/device-link/DeviceManagementList.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/AdaptiveWindow.tsx, apps/mobile/src/platform/ModalContentArea.tsx, apps/mobile/src/platform/OutsideTap.tsx, apps/mobile/src/platform/chrome/AnchoredPullDownMenu.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx, apps/mobile/src/platform/chrome/NativeChromeBackButton.ios.tsx, apps/mobile/src/platform/chrome/NativeChromeButton.ios.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/remote-desktop/FoldTouchpad.tsx, apps/mobile/src/remote-desktop/NativeRemoteDesktopView.tsx, apps/mobile/src/remote-desktop/PermissionGuide.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.ios.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.tsx, apps/mobile/src/remote-desktop/RemoteDesktopClipboardButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopDisplaySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopHost.tsx, apps/mobile/src/remote-desktop/RemoteDesktopIcons.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopNetworkStatus.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopScreen.tsx, apps/mobile/src/remote-desktop/RemoteDesktopSecuritySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopWindows.tsx, apps/mobile/src/remote-desktop/viewerHtml.ts, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ComposerNativeSection.ios.tsx, apps/mobile/src/session/ComposerNativeSection.tsx, apps/mobile/src/session/ComposerSheet.ios.tsx, apps/mobile/src/session/ComposerSheet.tsx, apps/mobile/src/session/ContextSheet.ios.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/HomeEntryProvider.tsx, apps/mobile/src/session/HomeHeaderGlassButton.ios.tsx, apps/mobile/src/session/HomeHeaderGlassButton.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/MobileOutboxBridge.tsx, apps/mobile/src/session/NativeResidentHistory.tsx, apps/mobile/src/session/RecentMessageHistories.tsx, apps/mobile/src/session/RenameDeviceModal.tsx, apps/mobile/src/session/ResidentHomeList.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 206 | 58 |
-| `mobile.devices` | mobile | 主机详情 | app/devices/[deviceId].tsx | AccountSwitcherSheet, AdaptiveWindow, AnchoredPullDownMenu, AndroidUpdateSheet, AppText, AuthContext, AutomationTimerIcon, BlurBackdrop, CenteredScreen, ComposerNativeRow, ComposerNativeRow.ios, ComposerNativeSection, ComposerNativeSection.ios, ComposerSheet, ComposerSheet.ios, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, ContextSheet.ios, ConversationSearchFilterSheet, DeviceLinkContext, FoldTouchpad, HomeChromeDrawer, HomeChromeFrost, HomeEntryProvider, HomeGlassMenuPanel, HomeHeaderGlassButton, HomeHeaderGlassButton.ios, HomeListVisuals, HomeModeSwitch, HomeNativeStackHeader, HomeNewTaskButton, HomeProjectMachineLabel, HomeSearchBar, HomeSurface, IncomingShareBridge, LoginNativeButton, LoginNativeButton.ios, MobileAgentMark, MobileLoginHandoffContext, MobileLoginHandoffStage, MobileOutboxBridge, MobilePrimitives, MobileVendorIcon, ModalContentArea, NativeChromeBackButton.ios, NativeChromeButton.ios, NativePullDownMenu, NativeRemoteDesktopView, NativeResidentHistory, NativeSwitch, OutsideTap, PermissionGuide, PermissionGuideView, PermissionGuideView.ios, PushNotificationsBridge, QuietSyncIndicator, RecentMessageHistories, RemoteAccessGuide, RemoteDesktopActionButton, RemoteDesktopActionButton.ios, RemoteDesktopBackButton, RemoteDesktopBackButton.ios, RemoteDesktopChrome, RemoteDesktopChrome.ios, RemoteDesktopClipboardButton, RemoteDesktopControls, RemoteDesktopDisplaySettings, RemoteDesktopHost, RemoteDesktopIcons, RemoteDesktopMouseControls, RemoteDesktopMouseControls.ios, RemoteDesktopNetworkStatus, RemoteDesktopPanelButton, RemoteDesktopPanelButton.ios, RemoteDesktopScreen, RemoteDesktopSecuritySettings, RemoteDesktopWindows, RemoteTaskSuggestions, RenameSessionModal, ResidentHomeList, SessionActionSheet, SessionDetailsNative, SessionDetailsNative.ios, SessionHeaderNativeControls, SessionHeaderNativeControls.ios, SessionOptionsExpoSheet, SheetModal, SheetSurface, SimpleStackHeader, StartupSplashOverlay, SwipeableSessionRow, SwipeableSessionRow.ios, TaskTags, ThemeProvider, [deviceId], _layout, gestureHandler, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/devices/[deviceId].tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/LoginNativeButton.ios.tsx, apps/mobile/src/components/LoginNativeButton.tsx, apps/mobile/src/components/MobileAgentMark.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/MobileVendorIcon.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/RemoteAccessGuide.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/AdaptiveWindow.tsx, apps/mobile/src/platform/ModalContentArea.tsx, apps/mobile/src/platform/OutsideTap.tsx, apps/mobile/src/platform/chrome/AnchoredPullDownMenu.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx, apps/mobile/src/platform/chrome/NativeChromeBackButton.ios.tsx, apps/mobile/src/platform/chrome/NativeChromeButton.ios.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/remote-desktop/FoldTouchpad.tsx, apps/mobile/src/remote-desktop/NativeRemoteDesktopView.tsx, apps/mobile/src/remote-desktop/PermissionGuide.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.ios.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.tsx, apps/mobile/src/remote-desktop/RemoteDesktopClipboardButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopDisplaySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopHost.tsx, apps/mobile/src/remote-desktop/RemoteDesktopIcons.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopNetworkStatus.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopScreen.tsx, apps/mobile/src/remote-desktop/RemoteDesktopSecuritySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopWindows.tsx, apps/mobile/src/remote-desktop/viewerHtml.ts, apps/mobile/src/session/AccountSwitcherSheet.tsx, apps/mobile/src/session/AutomationTimerIcon.tsx, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ComposerNativeRow.ios.tsx, apps/mobile/src/session/ComposerNativeRow.tsx, apps/mobile/src/session/ComposerNativeSection.ios.tsx, apps/mobile/src/session/ComposerNativeSection.tsx, apps/mobile/src/session/ComposerSheet.ios.tsx, apps/mobile/src/session/ComposerSheet.tsx, apps/mobile/src/session/ContextSheet.ios.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/ConversationSearchFilterSheet.tsx, apps/mobile/src/session/HomeChromeDrawer.tsx, apps/mobile/src/session/HomeChromeFrost.tsx, apps/mobile/src/session/HomeEntryProvider.tsx, apps/mobile/src/session/HomeGlassMenuPanel.tsx, apps/mobile/src/session/HomeHeaderGlassButton.ios.tsx, apps/mobile/src/session/HomeHeaderGlassButton.tsx, apps/mobile/src/session/HomeListVisuals.tsx, apps/mobile/src/session/HomeModeSwitch.tsx, apps/mobile/src/session/HomeNewTaskButton.tsx, apps/mobile/src/session/HomeProjectMachineLabel.tsx, apps/mobile/src/session/HomeSearchBar.tsx, apps/mobile/src/session/HomeSurface.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/MobileOutboxBridge.tsx, apps/mobile/src/session/NativeResidentHistory.tsx, apps/mobile/src/session/RecentMessageHistories.tsx, apps/mobile/src/session/RemoteTaskSuggestions.tsx, apps/mobile/src/session/RenameSessionModal.tsx, apps/mobile/src/session/ResidentHomeList.tsx, apps/mobile/src/session/SessionActionSheet.tsx, apps/mobile/src/session/SessionDetailsNative.ios.tsx, apps/mobile/src/session/SessionDetailsNative.tsx, apps/mobile/src/session/SessionHeaderNativeControls.ios.tsx, apps/mobile/src/session/SessionHeaderNativeControls.tsx, apps/mobile/src/session/SessionOptionsExpoSheet.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/session/SwipeableSessionRow.ios.tsx, apps/mobile/src/session/SwipeableSessionRow.tsx, apps/mobile/src/session/TaskTags.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 206 | 114 |
-| `mobile.files` | mobile | 任务文件与预览 | app/files/[sessionId].tsx / app/files/preview/[sessionId].tsx | AdaptiveWindow, AnchoredPullDownMenu, AndroidUpdateSheet, AppText, AuthContext, BlurBackdrop, CenteredScreen, ComposerNativeSection, ComposerNativeSection.ios, ComposerSheet, ComposerSheet.ios, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, ContextSheet.ios, DeviceLinkContext, FileTypeIcon, FileTypeTile, FoldTouchpad, HomeEntryProvider, HtmlBrowserChrome, HtmlBrowserChrome.ios, HtmlFileReader, HtmlWebsiteBrowser, ImageLightbox, IncomingShareBridge, MarkdownFileReader, MobileLoginHandoffContext, MobileLoginHandoffStage, MobileOutboxBridge, MobilePrimitives, ModalContentArea, NativeChromeBackButton.ios, NativeChromeButton.ios, NativePullDownMenu, NativeRemoteDesktopView, NativeResidentHistory, NativeSwitch, OutsideTap, PermissionGuide, PermissionGuideView, PermissionGuideView.ios, PushNotificationsBridge, QuietSyncIndicator, RecentMessageHistories, RemoteDesktopActionButton, RemoteDesktopActionButton.ios, RemoteDesktopBackButton, RemoteDesktopBackButton.ios, RemoteDesktopChrome, RemoteDesktopChrome.ios, RemoteDesktopClipboardButton, RemoteDesktopControls, RemoteDesktopDisplaySettings, RemoteDesktopHost, RemoteDesktopIcons, RemoteDesktopMouseControls, RemoteDesktopMouseControls.ios, RemoteDesktopNetworkStatus, RemoteDesktopPanelButton, RemoteDesktopPanelButton.ios, RemoteDesktopScreen, RemoteDesktopSecuritySettings, RemoteDesktopWindows, ResidentHomeList, SheetModal, SheetSurface, StartupSplashOverlay, SystemNavigationBack, ThemeProvider, [sessionId], _layout, gestureHandler, mediaPlayerWebView, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/files/[sessionId].tsx, apps/mobile/app/files/preview/[sessionId].tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/FileTypeIcon.tsx, apps/mobile/src/components/FileTypeTile.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/AdaptiveWindow.tsx, apps/mobile/src/platform/ModalContentArea.tsx, apps/mobile/src/platform/OutsideTap.tsx, apps/mobile/src/platform/chrome/AnchoredPullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeChromeBackButton.ios.tsx, apps/mobile/src/platform/chrome/NativeChromeButton.ios.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SystemNavigationBack.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/remote-desktop/FoldTouchpad.tsx, apps/mobile/src/remote-desktop/NativeRemoteDesktopView.tsx, apps/mobile/src/remote-desktop/PermissionGuide.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.ios.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.tsx, apps/mobile/src/remote-desktop/RemoteDesktopClipboardButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopDisplaySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopHost.tsx, apps/mobile/src/remote-desktop/RemoteDesktopIcons.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopNetworkStatus.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopScreen.tsx, apps/mobile/src/remote-desktop/RemoteDesktopSecuritySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopWindows.tsx, apps/mobile/src/remote-desktop/viewerHtml.ts, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ComposerNativeSection.ios.tsx, apps/mobile/src/session/ComposerNativeSection.tsx, apps/mobile/src/session/ComposerSheet.ios.tsx, apps/mobile/src/session/ComposerSheet.tsx, apps/mobile/src/session/ContextSheet.ios.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/HomeEntryProvider.tsx, apps/mobile/src/session/HtmlBrowserChrome.ios.tsx, apps/mobile/src/session/HtmlBrowserChrome.tsx, apps/mobile/src/session/HtmlFileReader.tsx, apps/mobile/src/session/HtmlWebsiteBrowser.tsx, apps/mobile/src/session/ImageLightbox.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/MarkdownFileReader.tsx, apps/mobile/src/session/MobileOutboxBridge.tsx, apps/mobile/src/session/NativeResidentHistory.tsx, apps/mobile/src/session/RecentMessageHistories.tsx, apps/mobile/src/session/ResidentHomeList.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/session/mathWebViewHtml.ts, apps/mobile/src/session/mediaPlayerWebView.tsx, apps/mobile/src/session/mediaPlayerWebViewHtml.ts, apps/mobile/src/session/selectableMarkdownHtml.ts, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 238 | 81 |
-| `mobile.home` | mobile | 主机与资源首页 | app/index.tsx / app/devices/index.tsx | AccountSwitcherSheet, AdaptiveWindow, AnchoredPullDownMenu, AndroidUpdateSheet, AppText, AuthContext, AutomationTimerIcon, BlurBackdrop, CenteredScreen, CompanionChoice, CompanionCreateNativeView, CompanionCreateNativeView.ios, CompanionMemoryPage, CompanionMemoryPage.ios, CompanionModelChain, CompanionNativeContent.ios, CompanionPortraitPicker, CompanionProfileArtifacts, CompanionProfileNativeView, CompanionProfileNativeView.ios, CompanionProfileSheet, CompanionSettingsRow, CompanionSettingsRow.ios, CompanionSheet, CompanionSheet.ios, ComposerNativeRow, ComposerNativeRow.ios, ComposerNativeSection, ComposerNativeSection.ios, ComposerSheet, ComposerSheet.ios, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, ContextSheet.ios, ConversationSearchFilterSheet, DeviceLinkContext, FoldTouchpad, HomeChromeDrawer, HomeChromeFrost, HomeEntryProvider, HomeGlassMenuPanel, HomeHeaderGlassButton, HomeHeaderGlassButton.ios, HomeListVisuals, HomeModePanes, HomeModeSwitch, HomeNativeStackHeader, HomeNewTaskButton, HomeProjectMachineLabel, HomeSearchBar, HomeSurface, IncomingShareBridge, LoginNativeButton, LoginNativeButton.ios, MobileAgentMark, MobileAgentSwitcher, MobileLoginHandoffContext, MobileLoginHandoffStage, MobileModelPickerList, MobileModelPickerList.ios, MobileOutboxBridge, MobilePermissionPickerList, MobilePermissionPickerList.ios, MobilePrimitives, MobileProviderMark, MobileVendorIcon, ModalContentArea, ModelOptionsSheetView, ModelOptionsSheetView.ios, ModelPickerNativeHeader, ModelPickerNativeHeader.ios, ModelPickerSheet, NativeChromeBackButton.ios, NativeChromeButton.ios, NativePullDownMenu, NativeRemoteDesktopView, NativeResidentHistory, NativeSwitch, OutsideTap, PermissionGuide, PermissionGuideView, PermissionGuideView.ios, PushNotificationsBridge, QuietSyncIndicator, RecentMessageHistories, RemoteAccessGuide, RemoteCompanionAvatar, RemoteDesktopActionButton, RemoteDesktopActionButton.ios, RemoteDesktopBackButton, RemoteDesktopBackButton.ios, RemoteDesktopChrome, RemoteDesktopChrome.ios, RemoteDesktopClipboardButton, RemoteDesktopControls, RemoteDesktopDisplaySettings, RemoteDesktopHost, RemoteDesktopIcons, RemoteDesktopMouseControls, RemoteDesktopMouseControls.ios, RemoteDesktopNetworkStatus, RemoteDesktopPanelButton, RemoteDesktopPanelButton.ios, RemoteDesktopScreen, RemoteDesktopSecuritySettings, RemoteDesktopWindows, RemoteTaskSuggestions, RenameSessionModal, ResidentHomeList, SessionActionSheet, SessionDetailsNative, SessionDetailsNative.ios, SessionHeaderNativeControls, SessionHeaderNativeControls.ios, SessionOptionsExpoSheet, SheetModal, SheetSurface, SimpleStackHeader, StartupSplashOverlay, SwipeableSessionRow, SwipeableSessionRow.ios, TaskTags, TeammateCreateButton, TeammateGenerationLabel, TeammateHomeScreen, TeammateList, ThemeProvider, UnifiedModelPickerSheet, UnifiedModelPickerView, UnifiedModelPickerView.ios, WorkingStatusText, _layout, gestureHandler, index, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/devices/index.tsx, apps/mobile/app/index.tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/LoginNativeButton.ios.tsx, apps/mobile/src/components/LoginNativeButton.tsx, apps/mobile/src/components/MobileAgentMark.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/MobileVendorIcon.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/RemoteAccessGuide.tsx, apps/mobile/src/components/RemoteCompanionAvatar.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/AdaptiveWindow.tsx, apps/mobile/src/platform/ModalContentArea.tsx, apps/mobile/src/platform/OutsideTap.tsx, apps/mobile/src/platform/chrome/AnchoredPullDownMenu.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx, apps/mobile/src/platform/chrome/NativeChromeBackButton.ios.tsx, apps/mobile/src/platform/chrome/NativeChromeButton.ios.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/remote-desktop/FoldTouchpad.tsx, apps/mobile/src/remote-desktop/NativeRemoteDesktopView.tsx, apps/mobile/src/remote-desktop/PermissionGuide.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.ios.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.tsx, apps/mobile/src/remote-desktop/RemoteDesktopClipboardButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopDisplaySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopHost.tsx, apps/mobile/src/remote-desktop/RemoteDesktopIcons.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopNetworkStatus.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopScreen.tsx, apps/mobile/src/remote-desktop/RemoteDesktopSecuritySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopWindows.tsx, apps/mobile/src/remote-desktop/viewerHtml.ts, apps/mobile/src/session/AccountSwitcherSheet.tsx, apps/mobile/src/session/AutomationTimerIcon.tsx, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/CompanionChoice.tsx, apps/mobile/src/session/CompanionCreateNativeView.ios.tsx, apps/mobile/src/session/CompanionCreateNativeView.tsx, apps/mobile/src/session/CompanionMemoryPage.ios.tsx, apps/mobile/src/session/CompanionMemoryPage.tsx, apps/mobile/src/session/CompanionModelChain.tsx, apps/mobile/src/session/CompanionNativeContent.ios.tsx, apps/mobile/src/session/CompanionPortraitPicker.tsx, apps/mobile/src/session/CompanionProfileArtifacts.tsx, apps/mobile/src/session/CompanionProfileNativeView.ios.tsx, apps/mobile/src/session/CompanionProfileNativeView.tsx, apps/mobile/src/session/CompanionProfileSheet.tsx, apps/mobile/src/session/CompanionSettingsRow.ios.tsx, apps/mobile/src/session/CompanionSettingsRow.tsx, apps/mobile/src/session/CompanionSheet.ios.tsx, apps/mobile/src/session/CompanionSheet.tsx, apps/mobile/src/session/ComposerNativeRow.ios.tsx, apps/mobile/src/session/ComposerNativeRow.tsx, apps/mobile/src/session/ComposerNativeSection.ios.tsx, apps/mobile/src/session/ComposerNativeSection.tsx, apps/mobile/src/session/ComposerSheet.ios.tsx, apps/mobile/src/session/ComposerSheet.tsx, apps/mobile/src/session/ContextSheet.ios.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/ConversationSearchFilterSheet.tsx, apps/mobile/src/session/HomeChromeDrawer.tsx, apps/mobile/src/session/HomeChromeFrost.tsx, apps/mobile/src/session/HomeEntryProvider.tsx, apps/mobile/src/session/HomeGlassMenuPanel.tsx, apps/mobile/src/session/HomeHeaderGlassButton.ios.tsx, apps/mobile/src/session/HomeHeaderGlassButton.tsx, apps/mobile/src/session/HomeListVisuals.tsx, apps/mobile/src/session/HomeModePanes.tsx, apps/mobile/src/session/HomeModeSwitch.tsx, apps/mobile/src/session/HomeNewTaskButton.tsx, apps/mobile/src/session/HomeProjectMachineLabel.tsx, apps/mobile/src/session/HomeSearchBar.tsx, apps/mobile/src/session/HomeSurface.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/MobileAgentSwitcher.tsx, apps/mobile/src/session/MobileModelPickerList.ios.tsx, apps/mobile/src/session/MobileModelPickerList.tsx, apps/mobile/src/session/MobileOutboxBridge.tsx, apps/mobile/src/session/MobilePermissionPickerList.ios.tsx, apps/mobile/src/session/MobilePermissionPickerList.tsx, apps/mobile/src/session/MobileProviderMark.tsx, apps/mobile/src/session/ModelOptionsSheetView.ios.tsx, apps/mobile/src/session/ModelOptionsSheetView.tsx, apps/mobile/src/session/ModelPickerNativeHeader.ios.tsx, apps/mobile/src/session/ModelPickerNativeHeader.tsx, apps/mobile/src/session/ModelPickerSheet.tsx, apps/mobile/src/session/NativeResidentHistory.tsx, apps/mobile/src/session/RecentMessageHistories.tsx, apps/mobile/src/session/RemoteTaskSuggestions.tsx, apps/mobile/src/session/RenameSessionModal.tsx, apps/mobile/src/session/ResidentHomeList.tsx, apps/mobile/src/session/SessionActionSheet.tsx, apps/mobile/src/session/SessionDetailsNative.ios.tsx, apps/mobile/src/session/SessionDetailsNative.tsx, apps/mobile/src/session/SessionHeaderNativeControls.ios.tsx, apps/mobile/src/session/SessionHeaderNativeControls.tsx, apps/mobile/src/session/SessionOptionsExpoSheet.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/session/SwipeableSessionRow.ios.tsx, apps/mobile/src/session/SwipeableSessionRow.tsx, apps/mobile/src/session/TaskTags.tsx, apps/mobile/src/session/TeammateCreateButton.tsx, apps/mobile/src/session/TeammateGenerationLabel.tsx, apps/mobile/src/session/TeammateHomeScreen.tsx, apps/mobile/src/session/TeammateList.tsx, apps/mobile/src/session/UnifiedModelPickerSheet.tsx, apps/mobile/src/session/UnifiedModelPickerView.ios.tsx, apps/mobile/src/session/UnifiedModelPickerView.tsx, apps/mobile/src/session/WorkingStatusText.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 206 | 136 |
-| `mobile.overlay.connection-startup` | mobile | 根布局挂载的启动与连接反馈 | app/_layout.tsx → StartupSplashOverlay / ConnectionNoticeProvider;各页面 ConnectionBanner | AdaptiveWindow, AnchoredPullDownMenu, AndroidUpdateSheet, AppText, AuthContext, BlurBackdrop, CenteredScreen, ComposerNativeSection, ComposerNativeSection.ios, ComposerSheet, ComposerSheet.ios, ConnectionBanner, ConnectionNoticeOverlay, ConnectionNoticeProvider, ContextSheet, ContextSheet.ios, DeviceLinkContext, FoldTouchpad, HomeEntryProvider, IncomingShareBridge, MobileLoginHandoffContext, MobileLoginHandoffStage, MobileOutboxBridge, MobilePrimitives, NativeChromeBackButton.ios, NativeChromeButton.ios, NativePullDownMenu, NativeRemoteDesktopView, NativeResidentHistory, NativeSwitch, OutsideTap, PermissionGuide, PermissionGuideView, PermissionGuideView.ios, PushNotificationsBridge, QuietSyncIndicator, RecentMessageHistories, RemoteDesktopActionButton, RemoteDesktopActionButton.ios, RemoteDesktopBackButton, RemoteDesktopBackButton.ios, RemoteDesktopChrome, RemoteDesktopChrome.ios, RemoteDesktopClipboardButton, RemoteDesktopControls, RemoteDesktopDisplaySettings, RemoteDesktopHost, RemoteDesktopIcons, RemoteDesktopMouseControls, RemoteDesktopMouseControls.ios, RemoteDesktopNetworkStatus, RemoteDesktopPanelButton, RemoteDesktopPanelButton.ios, RemoteDesktopScreen, RemoteDesktopSecuritySettings, RemoteDesktopWindows, ResidentHomeList, SheetModal, SheetSurface, StartupSplashOverlay, ThemeProvider, _layout, gestureHandler, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/AdaptiveWindow.tsx, apps/mobile/src/platform/OutsideTap.tsx, apps/mobile/src/platform/chrome/AnchoredPullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeChromeBackButton.ios.tsx, apps/mobile/src/platform/chrome/NativeChromeButton.ios.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/remote-desktop/FoldTouchpad.tsx, apps/mobile/src/remote-desktop/NativeRemoteDesktopView.tsx, apps/mobile/src/remote-desktop/PermissionGuide.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.ios.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.tsx, apps/mobile/src/remote-desktop/RemoteDesktopClipboardButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopDisplaySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopHost.tsx, apps/mobile/src/remote-desktop/RemoteDesktopIcons.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopNetworkStatus.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopScreen.tsx, apps/mobile/src/remote-desktop/RemoteDesktopSecuritySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopWindows.tsx, apps/mobile/src/remote-desktop/viewerHtml.ts, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ComposerNativeSection.ios.tsx, apps/mobile/src/session/ComposerNativeSection.tsx, apps/mobile/src/session/ComposerSheet.ios.tsx, apps/mobile/src/session/ComposerSheet.tsx, apps/mobile/src/session/ContextSheet.ios.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/HomeEntryProvider.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/MobileOutboxBridge.tsx, apps/mobile/src/session/NativeResidentHistory.tsx, apps/mobile/src/session/RecentMessageHistories.tsx, apps/mobile/src/session/ResidentHomeList.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 206 | 52 |
-| `mobile.remote-desktop` | mobile | 远程桌面 | app/devices/desktop/[deviceId].tsx | AdaptiveWindow, AnchoredPullDownMenu, AndroidUpdateSheet, AppText, AuthContext, BlurBackdrop, CenteredScreen, ComposerNativeSection, ComposerNativeSection.ios, ComposerSheet, ComposerSheet.ios, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, ContextSheet.ios, DeviceLinkContext, FoldTouchpad, HomeEntryProvider, IncomingShareBridge, MobileLoginHandoffContext, MobileLoginHandoffStage, MobileOutboxBridge, MobilePrimitives, NativeChromeBackButton.ios, NativeChromeButton.ios, NativePullDownMenu, NativeRemoteDesktopView, NativeResidentHistory, NativeSwitch, OutsideTap, PermissionGuide, PermissionGuideView, PermissionGuideView.ios, PushNotificationsBridge, QuietSyncIndicator, RecentMessageHistories, RemoteDesktopActionButton, RemoteDesktopActionButton.ios, RemoteDesktopBackButton, RemoteDesktopBackButton.ios, RemoteDesktopChrome, RemoteDesktopChrome.ios, RemoteDesktopClipboardButton, RemoteDesktopControls, RemoteDesktopDisplaySettings, RemoteDesktopHost, RemoteDesktopIcons, RemoteDesktopMouseControls, RemoteDesktopMouseControls.ios, RemoteDesktopNetworkStatus, RemoteDesktopPanelButton, RemoteDesktopPanelButton.ios, RemoteDesktopScreen, RemoteDesktopSecuritySettings, RemoteDesktopWindows, ResidentHomeList, SheetModal, SheetSurface, StartupSplashOverlay, ThemeProvider, [deviceId], _layout, gestureHandler, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/devices/desktop/[deviceId].tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/AdaptiveWindow.tsx, apps/mobile/src/platform/OutsideTap.tsx, apps/mobile/src/platform/chrome/AnchoredPullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeChromeBackButton.ios.tsx, apps/mobile/src/platform/chrome/NativeChromeButton.ios.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/remote-desktop/FoldTouchpad.tsx, apps/mobile/src/remote-desktop/NativeRemoteDesktopView.tsx, apps/mobile/src/remote-desktop/PermissionGuide.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.ios.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.tsx, apps/mobile/src/remote-desktop/RemoteDesktopClipboardButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopDisplaySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopHost.tsx, apps/mobile/src/remote-desktop/RemoteDesktopIcons.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopNetworkStatus.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopScreen.tsx, apps/mobile/src/remote-desktop/RemoteDesktopSecuritySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopWindows.tsx, apps/mobile/src/remote-desktop/viewerHtml.ts, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ComposerNativeSection.ios.tsx, apps/mobile/src/session/ComposerNativeSection.tsx, apps/mobile/src/session/ComposerSheet.ios.tsx, apps/mobile/src/session/ComposerSheet.tsx, apps/mobile/src/session/ContextSheet.ios.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/HomeEntryProvider.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/MobileOutboxBridge.tsx, apps/mobile/src/session/NativeResidentHistory.tsx, apps/mobile/src/session/RecentMessageHistories.tsx, apps/mobile/src/session/ResidentHomeList.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 206 | 52 |
-| `mobile.resources` | mobile | 远程资源列表与详情 | app/resources/[collectionId].tsx / app/resources/[collectionId]/[resourceId].tsx | AdaptiveWindow, AnchoredPullDownMenu, AndroidUpdateSheet, AppText, AuthContext, BlurBackdrop, CenteredScreen, ComposerNativeSection, ComposerNativeSection.ios, ComposerSheet, ComposerSheet.ios, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, ContextSheet.ios, DeviceLinkContext, FoldTouchpad, HomeEntryProvider, HomeHeaderGlassButton, HomeHeaderGlassButton.ios, HomeNativeStackHeader, IncomingShareBridge, MobileLoginHandoffContext, MobileLoginHandoffStage, MobileOutboxBridge, MobilePrimitives, NativeChromeBackButton.ios, NativeChromeButton.ios, NativePullDownMenu, NativeRemoteDesktopView, NativeResidentHistory, NativeSwitch, OutsideTap, PermissionGuide, PermissionGuideView, PermissionGuideView.ios, PushNotificationsBridge, QuietSyncIndicator, RecentMessageHistories, RemoteCompanionAvatar, RemoteDesktopActionButton, RemoteDesktopActionButton.ios, RemoteDesktopBackButton, RemoteDesktopBackButton.ios, RemoteDesktopChrome, RemoteDesktopChrome.ios, RemoteDesktopClipboardButton, RemoteDesktopControls, RemoteDesktopDisplaySettings, RemoteDesktopHost, RemoteDesktopIcons, RemoteDesktopMouseControls, RemoteDesktopMouseControls.ios, RemoteDesktopNetworkStatus, RemoteDesktopPanelButton, RemoteDesktopPanelButton.ios, RemoteDesktopScreen, RemoteDesktopSecuritySettings, RemoteDesktopWindows, ResidentHomeList, SheetModal, SheetSurface, SimpleStackHeader, StartupSplashOverlay, TeammateGenerationLabel, TeammateList, ThemeProvider, WorkingStatusText, [collectionId], [resourceId], _layout, gestureHandler, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/resources/[collectionId].tsx, apps/mobile/app/resources/[collectionId]/[resourceId].tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/RemoteCompanionAvatar.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/AdaptiveWindow.tsx, apps/mobile/src/platform/OutsideTap.tsx, apps/mobile/src/platform/chrome/AnchoredPullDownMenu.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx, apps/mobile/src/platform/chrome/NativeChromeBackButton.ios.tsx, apps/mobile/src/platform/chrome/NativeChromeButton.ios.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/remote-desktop/FoldTouchpad.tsx, apps/mobile/src/remote-desktop/NativeRemoteDesktopView.tsx, apps/mobile/src/remote-desktop/PermissionGuide.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.ios.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.tsx, apps/mobile/src/remote-desktop/RemoteDesktopClipboardButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopDisplaySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopHost.tsx, apps/mobile/src/remote-desktop/RemoteDesktopIcons.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopNetworkStatus.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopScreen.tsx, apps/mobile/src/remote-desktop/RemoteDesktopSecuritySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopWindows.tsx, apps/mobile/src/remote-desktop/viewerHtml.ts, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ComposerNativeSection.ios.tsx, apps/mobile/src/session/ComposerNativeSection.tsx, apps/mobile/src/session/ComposerSheet.ios.tsx, apps/mobile/src/session/ComposerSheet.tsx, apps/mobile/src/session/ContextSheet.ios.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/HomeEntryProvider.tsx, apps/mobile/src/session/HomeHeaderGlassButton.ios.tsx, apps/mobile/src/session/HomeHeaderGlassButton.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/MobileOutboxBridge.tsx, apps/mobile/src/session/NativeResidentHistory.tsx, apps/mobile/src/session/RecentMessageHistories.tsx, apps/mobile/src/session/ResidentHomeList.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/session/TeammateGenerationLabel.tsx, apps/mobile/src/session/TeammateList.tsx, apps/mobile/src/session/WorkingStatusText.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 206 | 65 |
-| `mobile.settings` | mobile | 设置(含调试与日志上传可见入口) | app/settings.tsx | AdaptiveWindow, AnchoredPullDownMenu, AndroidUpdateSheet, AppText, AuthContext, BlurBackdrop, CenteredScreen, ComposerNativeSection, ComposerNativeSection.ios, ComposerSheet, ComposerSheet.ios, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, ContextSheet.ios, DeviceLinkContext, FoldTouchpad, HomeEntryProvider, HomeHeaderGlassButton, HomeHeaderGlassButton.ios, HomeNativeStackHeader, IncomingShareBridge, MobileChoicePickerList, MobileLoginHandoffContext, MobileLoginHandoffStage, MobileOutboxBridge, MobilePrimitives, NativeChromeBackButton.ios, NativeChromeButton.ios, NativePullDownMenu, NativeRemoteDesktopView, NativeResidentHistory, NativeSwitch, OutsideTap, PermissionGuide, PermissionGuideView, PermissionGuideView.ios, PushNotificationsBridge, QuietSyncIndicator, RecentMessageHistories, RemoteDesktopActionButton, RemoteDesktopActionButton.ios, RemoteDesktopBackButton, RemoteDesktopBackButton.ios, RemoteDesktopChrome, RemoteDesktopChrome.ios, RemoteDesktopClipboardButton, RemoteDesktopControls, RemoteDesktopDisplaySettings, RemoteDesktopHost, RemoteDesktopIcons, RemoteDesktopMouseControls, RemoteDesktopMouseControls.ios, RemoteDesktopNetworkStatus, RemoteDesktopPanelButton, RemoteDesktopPanelButton.ios, RemoteDesktopScreen, RemoteDesktopSecuritySettings, RemoteDesktopWindows, ResidentHomeList, SheetModal, SheetSurface, SimpleStackHeader, StartupSplashOverlay, ThemeProvider, _layout, gestureHandler, peerFileTransport, settings, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/settings.tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/AdaptiveWindow.tsx, apps/mobile/src/platform/OutsideTap.tsx, apps/mobile/src/platform/chrome/AnchoredPullDownMenu.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx, apps/mobile/src/platform/chrome/NativeChromeBackButton.ios.tsx, apps/mobile/src/platform/chrome/NativeChromeButton.ios.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/remote-desktop/FoldTouchpad.tsx, apps/mobile/src/remote-desktop/NativeRemoteDesktopView.tsx, apps/mobile/src/remote-desktop/PermissionGuide.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.ios.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.tsx, apps/mobile/src/remote-desktop/RemoteDesktopClipboardButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopDisplaySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopHost.tsx, apps/mobile/src/remote-desktop/RemoteDesktopIcons.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopNetworkStatus.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopScreen.tsx, apps/mobile/src/remote-desktop/RemoteDesktopSecuritySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopWindows.tsx, apps/mobile/src/remote-desktop/viewerHtml.ts, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ComposerNativeSection.ios.tsx, apps/mobile/src/session/ComposerNativeSection.tsx, apps/mobile/src/session/ComposerSheet.ios.tsx, apps/mobile/src/session/ComposerSheet.tsx, apps/mobile/src/session/ContextSheet.ios.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/HomeEntryProvider.tsx, apps/mobile/src/session/HomeHeaderGlassButton.ios.tsx, apps/mobile/src/session/HomeHeaderGlassButton.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/MobileChoicePickerList.tsx, apps/mobile/src/session/MobileOutboxBridge.tsx, apps/mobile/src/session/NativeResidentHistory.tsx, apps/mobile/src/session/RecentMessageHistories.tsx, apps/mobile/src/session/ResidentHomeList.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 206 | 61 |
+| `mobile.account-deletion` | mobile | 账号注销 | app/account-deletion.tsx | AdaptiveWindow, AnchoredPullDownMenu, AndroidUpdateSheet, AppText, AuthContext, BlurBackdrop, CenteredScreen, ComposerNativeSection, ComposerNativeSection.ios, ComposerSheet, ComposerSheet.ios, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, ContextSheet.ios, DeviceLinkContext, FoldTouchpad, HomeEntryProvider, HomeHeaderGlassButton, HomeHeaderGlassButton.ios, HomeNativeStackHeader, IncomingShareBridge, MobileLoginHandoffContext, MobileLoginHandoffStage, MobileOutboxBridge, MobilePrimitives, NativeChromeBackButton.ios, NativeChromeButton.ios, NativePullDownMenu, NativeRemoteDesktopView, NativeResidentHistory, NativeSwitch, OutsideTap, PermissionGuide, PermissionGuideView, PermissionGuideView.ios, PushNotificationsBridge, QuietSyncIndicator, RecentMessageHistories, RemoteDesktopActionButton, RemoteDesktopActionButton.ios, RemoteDesktopBackButton, RemoteDesktopBackButton.ios, RemoteDesktopChrome, RemoteDesktopChrome.ios, RemoteDesktopClipboardButton, RemoteDesktopControls, RemoteDesktopDisplaySettings, RemoteDesktopHost, RemoteDesktopIcons, RemoteDesktopMouseControls, RemoteDesktopMouseControls.ios, RemoteDesktopNetworkStatus, RemoteDesktopPanelButton, RemoteDesktopPanelButton.ios, RemoteDesktopScreen, RemoteDesktopSecuritySettings, RemoteDesktopWindows, ResidentHomeList, SheetModal, SheetSurface, SimpleStackHeader, StartupSplashOverlay, ThemeProvider, _layout, account-deletion, gestureHandler, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/account-deletion.tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/AdaptiveWindow.tsx, apps/mobile/src/platform/OutsideTap.tsx, apps/mobile/src/platform/chrome/AnchoredPullDownMenu.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx, apps/mobile/src/platform/chrome/NativeChromeBackButton.ios.tsx, apps/mobile/src/platform/chrome/NativeChromeButton.ios.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/remote-desktop/FoldTouchpad.tsx, apps/mobile/src/remote-desktop/NativeRemoteDesktopView.tsx, apps/mobile/src/remote-desktop/PermissionGuide.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.ios.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.tsx, apps/mobile/src/remote-desktop/RemoteDesktopClipboardButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopDisplaySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopHost.tsx, apps/mobile/src/remote-desktop/RemoteDesktopIcons.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopNetworkStatus.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopScreen.tsx, apps/mobile/src/remote-desktop/RemoteDesktopSecuritySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopWindows.tsx, apps/mobile/src/remote-desktop/viewerHtml.ts, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ComposerNativeSection.ios.tsx, apps/mobile/src/session/ComposerNativeSection.tsx, apps/mobile/src/session/ComposerSheet.ios.tsx, apps/mobile/src/session/ComposerSheet.tsx, apps/mobile/src/session/ContextSheet.ios.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/HomeEntryProvider.tsx, apps/mobile/src/session/HomeHeaderGlassButton.ios.tsx, apps/mobile/src/session/HomeHeaderGlassButton.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/MobileOutboxBridge.tsx, apps/mobile/src/session/NativeResidentHistory.tsx, apps/mobile/src/session/RecentMessageHistories.tsx, apps/mobile/src/session/ResidentHomeList.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 206 | 63 |
+| `mobile.auth` | mobile | 登录与添加账号 | app/(auth)/login.tsx / app/add-account.tsx | AccountSwitcherSheet, AdaptiveWindow, AnchoredPullDownMenu, AndroidUpdateSheet, AppText, AuthContext, BlurBackdrop, CenteredScreen, ComposerNativeSection, ComposerNativeSection.ios, ComposerSheet, ComposerSheet.ios, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, ContextSheet.ios, DeviceLinkContext, FoldTouchpad, HomeEntryProvider, HomeHeaderGlassButton, HomeHeaderGlassButton.ios, IncomingShareBridge, LoginCaptchaWebView, LoginNativeButton, LoginNativeButton.ios, LoginSkinControls, MobileLoginHandoffContext, MobileLoginHandoffStage, MobileOutboxBridge, MobilePrimitives, NativeChromeBackButton.ios, NativeChromeButton.ios, NativePullDownMenu, NativeRemoteDesktopView, NativeResidentHistory, NativeSwitch, OutsideTap, PermissionGuide, PermissionGuideView, PermissionGuideView.ios, PushNotificationsBridge, QuietSyncIndicator, RecentMessageHistories, RemoteDesktopActionButton, RemoteDesktopActionButton.ios, RemoteDesktopBackButton, RemoteDesktopBackButton.ios, RemoteDesktopChrome, RemoteDesktopChrome.ios, RemoteDesktopClipboardButton, RemoteDesktopControls, RemoteDesktopDisplaySettings, RemoteDesktopHost, RemoteDesktopIcons, RemoteDesktopMouseControls, RemoteDesktopMouseControls.ios, RemoteDesktopNetworkStatus, RemoteDesktopPanelButton, RemoteDesktopPanelButton.ios, RemoteDesktopScreen, RemoteDesktopSecuritySettings, RemoteDesktopWindows, ResidentHomeList, SheetModal, SheetSurface, StartupSplashOverlay, SystemNavigationBack, ThemeProvider, _layout, add-account, gestureHandler, login, peerFileTransport, useLocale | apps/mobile/app/(auth)/login.tsx, apps/mobile/app/_layout.tsx, apps/mobile/app/add-account.tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/LoginCaptchaWebView.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/LoginNativeButton.ios.tsx, apps/mobile/src/components/LoginNativeButton.tsx, apps/mobile/src/components/LoginSkinControls.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/AdaptiveWindow.tsx, apps/mobile/src/platform/OutsideTap.tsx, apps/mobile/src/platform/chrome/AnchoredPullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeChromeBackButton.ios.tsx, apps/mobile/src/platform/chrome/NativeChromeButton.ios.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SystemNavigationBack.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/remote-desktop/FoldTouchpad.tsx, apps/mobile/src/remote-desktop/NativeRemoteDesktopView.tsx, apps/mobile/src/remote-desktop/PermissionGuide.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.ios.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.tsx, apps/mobile/src/remote-desktop/RemoteDesktopClipboardButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopDisplaySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopHost.tsx, apps/mobile/src/remote-desktop/RemoteDesktopIcons.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopNetworkStatus.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopScreen.tsx, apps/mobile/src/remote-desktop/RemoteDesktopSecuritySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopWindows.tsx, apps/mobile/src/remote-desktop/viewerHtml.ts, apps/mobile/src/session/AccountSwitcherSheet.tsx, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ComposerNativeSection.ios.tsx, apps/mobile/src/session/ComposerNativeSection.tsx, apps/mobile/src/session/ComposerSheet.ios.tsx, apps/mobile/src/session/ComposerSheet.tsx, apps/mobile/src/session/ContextSheet.ios.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/HomeEntryProvider.tsx, apps/mobile/src/session/HomeHeaderGlassButton.ios.tsx, apps/mobile/src/session/HomeHeaderGlassButton.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/MobileOutboxBridge.tsx, apps/mobile/src/session/NativeResidentHistory.tsx, apps/mobile/src/session/RecentMessageHistories.tsx, apps/mobile/src/session/ResidentHomeList.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 213 | 85 |
+| `mobile.chat.new` | mobile | 新建任务 | app/sessions/new.tsx | AdaptiveWindow, AnchoredPullDownMenu, AndroidUpdateSheet, AnnotationBurnInWebView, AppText, AuthContext, BlurBackdrop, CenteredScreen, ComposerAttachmentTray, ComposerFrame, ComposerFrame.ios, ComposerKeyboardAvoidingView, ComposerNativeRow, ComposerNativeRow.ios, ComposerNativeSection, ComposerNativeSection.ios, ComposerSheet, ComposerSheet.ios, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, ContextSheet.ios, ContextSheetCollabView, ContextSheetGoalView, ContextSheetGoalView.ios, ContextSheetMediaViews, DeviceLinkContext, FileTypeIcon, FoldTouchpad, HomeEntryProvider, HomeHeaderGlassButton, HomeHeaderGlassButton.ios, HomeNativeStackHeader, ImageLightbox, IncomingShareBridge, MobileAgentMark, MobileAgentSwitcher, MobileChoicePickerList, MobileComposerInputRow, MobileLoginHandoffContext, MobileLoginHandoffStage, MobileModelPickerList, MobileModelPickerList.ios, MobileOutboxBridge, MobilePermissionPickerList, MobilePermissionPickerList.ios, MobilePrimitives, MobileProviderMark, MobileVendorIcon, ModelOptionsSheetView, ModelOptionsSheetView.ios, ModelPickerNativeHeader, ModelPickerNativeHeader.ios, ModelPickerSheet, NativeChromeBackButton.ios, NativeChromeButton.ios, NativePermissionSheet, NativePermissionSheet.ios, NativePullDownMenu, NativeRemoteDesktopView, NativeResidentHistory, NativeSwitch, NewTaskSelectionSheet, NewTaskSelectionSheet.ios, OutsideTap, PaperPlaneIcon, PermissionGuide, PermissionGuideView, PermissionGuideView.ios, PlanModeChip, PushNotificationsBridge, QuietSyncIndicator, RecentMessageHistories, RemoteDesktopActionButton, RemoteDesktopActionButton.ios, RemoteDesktopBackButton, RemoteDesktopBackButton.ios, RemoteDesktopChrome, RemoteDesktopChrome.ios, RemoteDesktopClipboardButton, RemoteDesktopControls, RemoteDesktopDisplaySettings, RemoteDesktopHost, RemoteDesktopIcons, RemoteDesktopMouseControls, RemoteDesktopMouseControls.ios, RemoteDesktopNetworkStatus, RemoteDesktopPanelButton, RemoteDesktopPanelButton.ios, RemoteDesktopScreen, RemoteDesktopSecuritySettings, RemoteDesktopWindows, ResidentHomeList, SheetModal, SheetSurface, SimpleStackHeader, SlowSendNotice, StartupSplashOverlay, ThemeProvider, UnifiedModelPickerSheet, UnifiedModelPickerView, UnifiedModelPickerView.ios, VoiceRecordingPill, _layout, gestureHandler, new, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/sessions/new.tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/FileTypeIcon.tsx, apps/mobile/src/components/MobileAgentMark.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/MobileVendorIcon.tsx, apps/mobile/src/components/PaperPlaneIcon.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/AdaptiveWindow.tsx, apps/mobile/src/platform/OutsideTap.tsx, apps/mobile/src/platform/chrome/AnchoredPullDownMenu.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx, apps/mobile/src/platform/chrome/NativeChromeBackButton.ios.tsx, apps/mobile/src/platform/chrome/NativeChromeButton.ios.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/remote-desktop/FoldTouchpad.tsx, apps/mobile/src/remote-desktop/NativeRemoteDesktopView.tsx, apps/mobile/src/remote-desktop/PermissionGuide.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.ios.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.tsx, apps/mobile/src/remote-desktop/RemoteDesktopClipboardButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopDisplaySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopHost.tsx, apps/mobile/src/remote-desktop/RemoteDesktopIcons.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopNetworkStatus.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopScreen.tsx, apps/mobile/src/remote-desktop/RemoteDesktopSecuritySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopWindows.tsx, apps/mobile/src/remote-desktop/viewerHtml.ts, apps/mobile/src/session/AnnotationBurnInWebView.tsx, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ComposerAttachmentTray.tsx, apps/mobile/src/session/ComposerFrame.ios.tsx, apps/mobile/src/session/ComposerFrame.tsx, apps/mobile/src/session/ComposerKeyboardAvoidingView.tsx, apps/mobile/src/session/ComposerNativeRow.ios.tsx, apps/mobile/src/session/ComposerNativeRow.tsx, apps/mobile/src/session/ComposerNativeSection.ios.tsx, apps/mobile/src/session/ComposerNativeSection.tsx, apps/mobile/src/session/ComposerSheet.ios.tsx, apps/mobile/src/session/ComposerSheet.tsx, apps/mobile/src/session/ContextSheet.ios.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/ContextSheetCollabView.tsx, apps/mobile/src/session/ContextSheetGoalView.ios.tsx, apps/mobile/src/session/ContextSheetGoalView.tsx, apps/mobile/src/session/ContextSheetMediaViews.tsx, apps/mobile/src/session/HomeEntryProvider.tsx, apps/mobile/src/session/HomeHeaderGlassButton.ios.tsx, apps/mobile/src/session/HomeHeaderGlassButton.tsx, apps/mobile/src/session/ImageLightbox.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/MobileAgentSwitcher.tsx, apps/mobile/src/session/MobileChoicePickerList.tsx, apps/mobile/src/session/MobileComposerInputRow.tsx, apps/mobile/src/session/MobileModelPickerList.ios.tsx, apps/mobile/src/session/MobileModelPickerList.tsx, apps/mobile/src/session/MobileOutboxBridge.tsx, apps/mobile/src/session/MobilePermissionPickerList.ios.tsx, apps/mobile/src/session/MobilePermissionPickerList.tsx, apps/mobile/src/session/MobileProviderMark.tsx, apps/mobile/src/session/ModelOptionsSheetView.ios.tsx, apps/mobile/src/session/ModelOptionsSheetView.tsx, apps/mobile/src/session/ModelPickerNativeHeader.ios.tsx, apps/mobile/src/session/ModelPickerNativeHeader.tsx, apps/mobile/src/session/ModelPickerSheet.tsx, apps/mobile/src/session/NativePermissionSheet.ios.tsx, apps/mobile/src/session/NativePermissionSheet.tsx, apps/mobile/src/session/NativeResidentHistory.tsx, apps/mobile/src/session/NewTaskSelectionSheet.ios.tsx, apps/mobile/src/session/NewTaskSelectionSheet.tsx, apps/mobile/src/session/PlanModeChip.tsx, apps/mobile/src/session/RecentMessageHistories.tsx, apps/mobile/src/session/ResidentHomeList.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/session/SlowSendNotice.tsx, apps/mobile/src/session/UnifiedModelPickerSheet.tsx, apps/mobile/src/session/UnifiedModelPickerView.ios.tsx, apps/mobile/src/session/UnifiedModelPickerView.tsx, apps/mobile/src/session/VoiceRecordingPill.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 238 | 110 |
+| `mobile.chat.session` | mobile | 任务内容与输入 | app/sessions/[sessionId].tsx | AccountSwitcherSheet, AdaptiveWindow, AgentErrorDetails, AnchoredPullDownMenu, AndroidUpdateSheet, AnnotationBurnInWebView, AppText, AuthContext, AuthorizationMessageCard, AutomationTimerIcon, BlurBackdrop, CenteredScreen, ChatFileChipMenuSheet, CompanionChoice, CompanionCreateNativeView, CompanionCreateNativeView.ios, CompanionHeader, CompanionMemoryPage, CompanionMemoryPage.ios, CompanionMessageActions, CompanionMessageCard, CompanionModelChain, CompanionNativeContent.ios, CompanionNavigationDrawer, CompanionPortraitPicker, CompanionProfileArtifacts, CompanionProfileNativeView, CompanionProfileNativeView.ios, CompanionProfileSheet, CompanionSettingsRow, CompanionSettingsRow.ios, CompanionSheet, CompanionSheet.ios, CompanionTaskResultCard, CompanionWorkingStatus, ComposerAttachmentTray, ComposerExpandButton, ComposerExpandButton.ios, ComposerFrame, ComposerFrame.ios, ComposerKeyboardAvoidingView, ComposerNativeInput, ComposerNativeInput.ios, ComposerNativeRow, ComposerNativeRow.ios, ComposerNativeSection, ComposerNativeSection.ios, ComposerRichInput, ComposerSheet, ComposerSheet.ios, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, ContextSheet.ios, ContextSheetCollabView, ContextSheetGoalView, ContextSheetGoalView.ios, ContextSheetMediaViews, ConversationSearchFilterSheet, ConversationShareSvg, ConversationShareWebView, DeviceLinkContext, FailedScheduleNotice, FileTypeIcon, FoldTouchpad, HomeChromeDrawer, HomeChromeFrost, HomeEntryProvider, HomeGlassMenuPanel, HomeHeaderGlassButton, HomeHeaderGlassButton.ios, HomeListVisuals, HomeModeSwitch, HomeNativeStackHeader, HomeNewTaskButton, HomeProjectMachineLabel, HomeSearchBar, HomeSurface, ImageLightbox, IncomingShareBridge, InlineQueueSection, InlineQuoteChip, InlineReferenceChip, InteractionPanel, LoginNativeButton, LoginNativeButton.ios, MarkdownBlockContent, MessageActionSheet, MessageRenderer, MobileAgentMark, MobileAgentSwitcher, MobileBoundaryNotice, MobileComposerInputRow, MobileLoginHandoffContext, MobileLoginHandoffStage, MobileModelPickerList, MobileModelPickerList.ios, MobileOutboxBridge, MobilePermissionPickerList, MobilePermissionPickerList.ios, MobilePrimitives, MobileProviderMark, MobileVendorIcon, ModalContentArea, ModelOptionsSheetView, ModelOptionsSheetView.ios, ModelPickerNativeHeader, ModelPickerNativeHeader.ios, ModelPickerSheet, NativeChromeBackButton.ios, NativeChromeButton.ios, NativePermissionSheet, NativePermissionSheet.ios, NativePullDownMenu, NativeRemoteDesktopView, NativeResidentHistory, NativeSwitch, OutsideTap, PaperPlaneIcon, PendingSendBubble, PermissionGuide, PermissionGuideView, PermissionGuideView.ios, PlanModeChip, PluginInvocationHeader, PromptRecommendation, PushNotificationsBridge, QuietSyncIndicator, QuoteCapsule, RecentMessageHistories, RemoteAccessGuide, RemoteCompanionAvatar, RemoteDesktopActionButton, RemoteDesktopActionButton.ios, RemoteDesktopBackButton, RemoteDesktopBackButton.ios, RemoteDesktopChrome, RemoteDesktopChrome.ios, RemoteDesktopClipboardButton, RemoteDesktopControls, RemoteDesktopDisplaySettings, RemoteDesktopHost, RemoteDesktopIcons, RemoteDesktopMouseControls, RemoteDesktopMouseControls.ios, RemoteDesktopNetworkStatus, RemoteDesktopPanelButton, RemoteDesktopPanelButton.ios, RemoteDesktopScreen, RemoteDesktopSecuritySettings, RemoteDesktopWindows, RemoteTaskSuggestions, RenameSessionModal, ResidentHomeList, RewindPreviewPanel, RunningTokenRatePopover, SentInlineAtomBody, SessionActionSheet, SessionDetailsNative, SessionDetailsNative.ios, SessionHeaderNativeControls, SessionHeaderNativeControls.ios, SessionListDrawer, SessionMenuSheet, SessionOptionsExpoSheet, SessionResourceCards, SessionSearchNative, SessionSearchNative.ios, SessionTailBanner, SessionUsageSummary, ShareImageNativeButton, ShareImageNativeButton.ios, ShareMessageCheckbox, ShareSelectAllButton, ShareSelectionBar, SharedTaskEndedState, SharedTaskScreen, SheetModal, SheetSurface, SimpleStackHeader, SlowSendNotice, StartupSplashOverlay, StreamingStatusText, SwipeableSessionRow, SwipeableSessionRow.ios, SystemNavigationBack, TaskTags, TaskTagsSheet, TeammateGenerationLabel, TeammateList, TeammatePicker, ThemeProvider, UnifiedModelPickerSheet, UnifiedModelPickerView, UnifiedModelPickerView.ios, VoiceRecordingPill, WorkingStatusText, [sessionId], _layout, gestureHandler, mathWebView, mediaPlayerWebView, mermaidWebView, peerFileTransport, useLocale, useSharedTaskConfirmation | apps/mobile/app/_layout.tsx, apps/mobile/app/sessions/[sessionId].tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/FileTypeIcon.tsx, apps/mobile/src/components/LoginNativeButton.ios.tsx, apps/mobile/src/components/LoginNativeButton.tsx, apps/mobile/src/components/MobileAgentMark.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/MobileVendorIcon.tsx, apps/mobile/src/components/PaperPlaneIcon.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/RemoteAccessGuide.tsx, apps/mobile/src/components/RemoteCompanionAvatar.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/AdaptiveWindow.tsx, apps/mobile/src/platform/ModalContentArea.tsx, apps/mobile/src/platform/OutsideTap.tsx, apps/mobile/src/platform/chrome/AnchoredPullDownMenu.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx, apps/mobile/src/platform/chrome/NativeChromeBackButton.ios.tsx, apps/mobile/src/platform/chrome/NativeChromeButton.ios.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/chrome/SystemNavigationBack.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/remote-desktop/FoldTouchpad.tsx, apps/mobile/src/remote-desktop/NativeRemoteDesktopView.tsx, apps/mobile/src/remote-desktop/PermissionGuide.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.ios.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.tsx, apps/mobile/src/remote-desktop/RemoteDesktopClipboardButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopDisplaySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopHost.tsx, apps/mobile/src/remote-desktop/RemoteDesktopIcons.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopNetworkStatus.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopScreen.tsx, apps/mobile/src/remote-desktop/RemoteDesktopSecuritySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopWindows.tsx, apps/mobile/src/remote-desktop/viewerHtml.ts, apps/mobile/src/session/AccountSwitcherSheet.tsx, apps/mobile/src/session/AgentErrorDetails.tsx, apps/mobile/src/session/AnnotationBurnInWebView.tsx, apps/mobile/src/session/AuthorizationMessageCard.tsx, apps/mobile/src/session/AutomationTimerIcon.tsx, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ChatFileChipMenuSheet.tsx, apps/mobile/src/session/CompanionChoice.tsx, apps/mobile/src/session/CompanionCreateNativeView.ios.tsx, apps/mobile/src/session/CompanionCreateNativeView.tsx, apps/mobile/src/session/CompanionHeader.tsx, apps/mobile/src/session/CompanionMemoryPage.ios.tsx, apps/mobile/src/session/CompanionMemoryPage.tsx, apps/mobile/src/session/CompanionMessageActions.tsx, apps/mobile/src/session/CompanionMessageCard.tsx, apps/mobile/src/session/CompanionModelChain.tsx, apps/mobile/src/session/CompanionNativeContent.ios.tsx, apps/mobile/src/session/CompanionNavigationDrawer.tsx, apps/mobile/src/session/CompanionPortraitPicker.tsx, apps/mobile/src/session/CompanionProfileArtifacts.tsx, apps/mobile/src/session/CompanionProfileNativeView.ios.tsx, apps/mobile/src/session/CompanionProfileNativeView.tsx, apps/mobile/src/session/CompanionProfileSheet.tsx, apps/mobile/src/session/CompanionSettingsRow.ios.tsx, apps/mobile/src/session/CompanionSettingsRow.tsx, apps/mobile/src/session/CompanionSheet.ios.tsx, apps/mobile/src/session/CompanionSheet.tsx, apps/mobile/src/session/CompanionTaskResultCard.tsx, apps/mobile/src/session/CompanionWorkingStatus.tsx, apps/mobile/src/session/ComposerAttachmentTray.tsx, apps/mobile/src/session/ComposerExpandButton.ios.tsx, apps/mobile/src/session/ComposerExpandButton.tsx, apps/mobile/src/session/ComposerFrame.ios.tsx, apps/mobile/src/session/ComposerFrame.tsx, apps/mobile/src/session/ComposerKeyboardAvoidingView.tsx, apps/mobile/src/session/ComposerNativeInput.ios.tsx, apps/mobile/src/session/ComposerNativeInput.tsx, apps/mobile/src/session/ComposerNativeRow.ios.tsx, apps/mobile/src/session/ComposerNativeRow.tsx, apps/mobile/src/session/ComposerNativeSection.ios.tsx, apps/mobile/src/session/ComposerNativeSection.tsx, apps/mobile/src/session/ComposerRichInput.tsx, apps/mobile/src/session/ComposerSheet.ios.tsx, apps/mobile/src/session/ComposerSheet.tsx, apps/mobile/src/session/ContextSheet.ios.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/ContextSheetCollabView.tsx, apps/mobile/src/session/ContextSheetGoalView.ios.tsx, apps/mobile/src/session/ContextSheetGoalView.tsx, apps/mobile/src/session/ContextSheetMediaViews.tsx, apps/mobile/src/session/ConversationSearchFilterSheet.tsx, apps/mobile/src/session/ConversationShareSvg.tsx, apps/mobile/src/session/ConversationShareWebView.tsx, apps/mobile/src/session/FailedScheduleNotice.tsx, apps/mobile/src/session/HomeChromeDrawer.tsx, apps/mobile/src/session/HomeChromeFrost.tsx, apps/mobile/src/session/HomeEntryProvider.tsx, apps/mobile/src/session/HomeGlassMenuPanel.tsx, apps/mobile/src/session/HomeHeaderGlassButton.ios.tsx, apps/mobile/src/session/HomeHeaderGlassButton.tsx, apps/mobile/src/session/HomeListVisuals.tsx, apps/mobile/src/session/HomeModeSwitch.tsx, apps/mobile/src/session/HomeNewTaskButton.tsx, apps/mobile/src/session/HomeProjectMachineLabel.tsx, apps/mobile/src/session/HomeSearchBar.tsx, apps/mobile/src/session/HomeSurface.tsx, apps/mobile/src/session/ImageLightbox.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/InlineQueueSection.tsx, apps/mobile/src/session/InlineQuoteChip.tsx, apps/mobile/src/session/InlineReferenceChip.tsx, apps/mobile/src/session/InteractionPanel.tsx, apps/mobile/src/session/MarkdownBlockContent.tsx, apps/mobile/src/session/MessageActionSheet.tsx, apps/mobile/src/session/MessageRenderer.tsx, apps/mobile/src/session/MobileAgentSwitcher.tsx, apps/mobile/src/session/MobileBoundaryNotice.tsx, apps/mobile/src/session/MobileComposerInputRow.tsx, apps/mobile/src/session/MobileModelPickerList.ios.tsx, apps/mobile/src/session/MobileModelPickerList.tsx, apps/mobile/src/session/MobileOutboxBridge.tsx, apps/mobile/src/session/MobilePermissionPickerList.ios.tsx, apps/mobile/src/session/MobilePermissionPickerList.tsx, apps/mobile/src/session/MobileProviderMark.tsx, apps/mobile/src/session/ModelOptionsSheetView.ios.tsx, apps/mobile/src/session/ModelOptionsSheetView.tsx, apps/mobile/src/session/ModelPickerNativeHeader.ios.tsx, apps/mobile/src/session/ModelPickerNativeHeader.tsx, apps/mobile/src/session/ModelPickerSheet.tsx, apps/mobile/src/session/NativePermissionSheet.ios.tsx, apps/mobile/src/session/NativePermissionSheet.tsx, apps/mobile/src/session/NativeResidentHistory.tsx, apps/mobile/src/session/PendingSendBubble.tsx, apps/mobile/src/session/PlanModeChip.tsx, apps/mobile/src/session/PluginInvocationHeader.tsx, apps/mobile/src/session/PromptRecommendation.tsx, apps/mobile/src/session/QuoteCapsule.tsx, apps/mobile/src/session/RecentMessageHistories.tsx, apps/mobile/src/session/RemoteTaskSuggestions.tsx, apps/mobile/src/session/RenameSessionModal.tsx, apps/mobile/src/session/ResidentHomeList.tsx, apps/mobile/src/session/RewindPreviewPanel.tsx, apps/mobile/src/session/RunningTokenRatePopover.tsx, apps/mobile/src/session/SentInlineAtomBody.tsx, apps/mobile/src/session/SessionActionSheet.tsx, apps/mobile/src/session/SessionDetailsNative.ios.tsx, apps/mobile/src/session/SessionDetailsNative.tsx, apps/mobile/src/session/SessionHeaderNativeControls.ios.tsx, apps/mobile/src/session/SessionHeaderNativeControls.tsx, apps/mobile/src/session/SessionListDrawer.tsx, apps/mobile/src/session/SessionMenuSheet.tsx, apps/mobile/src/session/SessionOptionsExpoSheet.tsx, apps/mobile/src/session/SessionResourceCards.tsx, apps/mobile/src/session/SessionSearchNative.ios.tsx, apps/mobile/src/session/SessionSearchNative.tsx, apps/mobile/src/session/SessionTailBanner.tsx, apps/mobile/src/session/SessionUsageSummary.tsx, apps/mobile/src/session/ShareImageNativeButton.ios.tsx, apps/mobile/src/session/ShareImageNativeButton.tsx, apps/mobile/src/session/ShareMessageCheckbox.tsx, apps/mobile/src/session/ShareSelectAllButton.tsx, apps/mobile/src/session/ShareSelectionBar.tsx, apps/mobile/src/session/SharedTaskEndedState.tsx, apps/mobile/src/session/SharedTaskScreen.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/session/SlowSendNotice.tsx, apps/mobile/src/session/StreamingStatusText.tsx, apps/mobile/src/session/SwipeableSessionRow.ios.tsx, apps/mobile/src/session/SwipeableSessionRow.tsx, apps/mobile/src/session/TaskTags.tsx, apps/mobile/src/session/TaskTagsSheet.tsx, apps/mobile/src/session/TeammateGenerationLabel.tsx, apps/mobile/src/session/TeammateList.tsx, apps/mobile/src/session/TeammatePicker.tsx, apps/mobile/src/session/UnifiedModelPickerSheet.tsx, apps/mobile/src/session/UnifiedModelPickerView.ios.tsx, apps/mobile/src/session/UnifiedModelPickerView.tsx, apps/mobile/src/session/VoiceRecordingPill.tsx, apps/mobile/src/session/WorkingStatusText.tsx, apps/mobile/src/session/composerRichInputHtml.ts, apps/mobile/src/session/conversationShareWebViewHtml.ts, apps/mobile/src/session/mathWebView.tsx, apps/mobile/src/session/mathWebViewHtml.ts, apps/mobile/src/session/mediaPlayerWebView.tsx, apps/mobile/src/session/mediaPlayerWebViewHtml.ts, apps/mobile/src/session/mermaidWebView.tsx, apps/mobile/src/session/mermaidWebViewHtml.ts, apps/mobile/src/session/selectableMarkdownHtml.ts, apps/mobile/src/session/useSharedTaskConfirmation.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 7 | 239 | 305 |
+| `mobile.chat.sharing` | mobile | 共享任务邀请与成员 | app/shared-session.tsx | AdaptiveWindow, AnchoredPullDownMenu, AndroidUpdateSheet, AppText, AuthContext, BlurBackdrop, CenteredScreen, ComposerNativeSection, ComposerNativeSection.ios, ComposerSheet, ComposerSheet.ios, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, ContextSheet.ios, DeviceLinkContext, FoldTouchpad, HomeEntryProvider, IncomingShareBridge, MobileLoginHandoffContext, MobileLoginHandoffStage, MobileOutboxBridge, MobilePrimitives, NativeChromeBackButton.ios, NativeChromeButton.ios, NativePullDownMenu, NativeRemoteDesktopView, NativeResidentHistory, NativeSwitch, OutsideTap, PermissionGuide, PermissionGuideView, PermissionGuideView.ios, PushNotificationsBridge, QuietSyncIndicator, RecentMessageHistories, RemoteDesktopActionButton, RemoteDesktopActionButton.ios, RemoteDesktopBackButton, RemoteDesktopBackButton.ios, RemoteDesktopChrome, RemoteDesktopChrome.ios, RemoteDesktopClipboardButton, RemoteDesktopControls, RemoteDesktopDisplaySettings, RemoteDesktopHost, RemoteDesktopIcons, RemoteDesktopMouseControls, RemoteDesktopMouseControls.ios, RemoteDesktopNetworkStatus, RemoteDesktopPanelButton, RemoteDesktopPanelButton.ios, RemoteDesktopScreen, RemoteDesktopSecuritySettings, RemoteDesktopWindows, ResidentHomeList, SharedTaskEndedState, SharedTaskScreen, SheetModal, SheetSurface, SimpleStackHeader, StartupSplashOverlay, ThemeProvider, _layout, gestureHandler, peerFileTransport, shared-session, useLocale, useSharedTaskConfirmation | apps/mobile/app/_layout.tsx, apps/mobile/app/shared-session.tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/AdaptiveWindow.tsx, apps/mobile/src/platform/OutsideTap.tsx, apps/mobile/src/platform/chrome/AnchoredPullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeChromeBackButton.ios.tsx, apps/mobile/src/platform/chrome/NativeChromeButton.ios.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/remote-desktop/FoldTouchpad.tsx, apps/mobile/src/remote-desktop/NativeRemoteDesktopView.tsx, apps/mobile/src/remote-desktop/PermissionGuide.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.ios.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.tsx, apps/mobile/src/remote-desktop/RemoteDesktopClipboardButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopDisplaySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopHost.tsx, apps/mobile/src/remote-desktop/RemoteDesktopIcons.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopNetworkStatus.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopScreen.tsx, apps/mobile/src/remote-desktop/RemoteDesktopSecuritySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopWindows.tsx, apps/mobile/src/remote-desktop/viewerHtml.ts, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ComposerNativeSection.ios.tsx, apps/mobile/src/session/ComposerNativeSection.tsx, apps/mobile/src/session/ComposerSheet.ios.tsx, apps/mobile/src/session/ComposerSheet.tsx, apps/mobile/src/session/ContextSheet.ios.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/HomeEntryProvider.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/MobileOutboxBridge.tsx, apps/mobile/src/session/NativeResidentHistory.tsx, apps/mobile/src/session/RecentMessageHistories.tsx, apps/mobile/src/session/ResidentHomeList.tsx, apps/mobile/src/session/SharedTaskEndedState.tsx, apps/mobile/src/session/SharedTaskScreen.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/session/useSharedTaskConfirmation.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 206 | 66 |
+| `mobile.companions.direct` | mobile | 伙伴私聊回看 | app/companions/direct/[threadId].tsx | AdaptiveWindow, AnchoredPullDownMenu, AndroidUpdateSheet, AppText, AuthContext, BlurBackdrop, CenteredScreen, ComposerNativeSection, ComposerNativeSection.ios, ComposerSheet, ComposerSheet.ios, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, ContextSheet.ios, DeviceLinkContext, FoldTouchpad, HomeEntryProvider, HomeHeaderGlassButton, HomeHeaderGlassButton.ios, HomeNativeStackHeader, IncomingShareBridge, MobileLoginHandoffContext, MobileLoginHandoffStage, MobileOutboxBridge, MobilePrimitives, NativeChromeBackButton.ios, NativeChromeButton.ios, NativePullDownMenu, NativeRemoteDesktopView, NativeResidentHistory, NativeSwitch, OutsideTap, PermissionGuide, PermissionGuideView, PermissionGuideView.ios, PushNotificationsBridge, QuietSyncIndicator, RecentMessageHistories, RemoteCompanionAvatar, RemoteDesktopActionButton, RemoteDesktopActionButton.ios, RemoteDesktopBackButton, RemoteDesktopBackButton.ios, RemoteDesktopChrome, RemoteDesktopChrome.ios, RemoteDesktopClipboardButton, RemoteDesktopControls, RemoteDesktopDisplaySettings, RemoteDesktopHost, RemoteDesktopIcons, RemoteDesktopMouseControls, RemoteDesktopMouseControls.ios, RemoteDesktopNetworkStatus, RemoteDesktopPanelButton, RemoteDesktopPanelButton.ios, RemoteDesktopScreen, RemoteDesktopSecuritySettings, RemoteDesktopWindows, ResidentHomeList, SheetModal, SheetSurface, SimpleStackHeader, StartupSplashOverlay, ThemeProvider, [threadId], _layout, gestureHandler, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/companions/direct/[threadId].tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/RemoteCompanionAvatar.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/AdaptiveWindow.tsx, apps/mobile/src/platform/OutsideTap.tsx, apps/mobile/src/platform/chrome/AnchoredPullDownMenu.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx, apps/mobile/src/platform/chrome/NativeChromeBackButton.ios.tsx, apps/mobile/src/platform/chrome/NativeChromeButton.ios.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/remote-desktop/FoldTouchpad.tsx, apps/mobile/src/remote-desktop/NativeRemoteDesktopView.tsx, apps/mobile/src/remote-desktop/PermissionGuide.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.ios.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.tsx, apps/mobile/src/remote-desktop/RemoteDesktopClipboardButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopDisplaySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopHost.tsx, apps/mobile/src/remote-desktop/RemoteDesktopIcons.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopNetworkStatus.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopScreen.tsx, apps/mobile/src/remote-desktop/RemoteDesktopSecuritySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopWindows.tsx, apps/mobile/src/remote-desktop/viewerHtml.ts, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ComposerNativeSection.ios.tsx, apps/mobile/src/session/ComposerNativeSection.tsx, apps/mobile/src/session/ComposerSheet.ios.tsx, apps/mobile/src/session/ComposerSheet.tsx, apps/mobile/src/session/ContextSheet.ios.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/HomeEntryProvider.tsx, apps/mobile/src/session/HomeHeaderGlassButton.ios.tsx, apps/mobile/src/session/HomeHeaderGlassButton.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/MobileOutboxBridge.tsx, apps/mobile/src/session/NativeResidentHistory.tsx, apps/mobile/src/session/RecentMessageHistories.tsx, apps/mobile/src/session/ResidentHomeList.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 206 | 61 |
+| `mobile.device-management` | mobile | 设备管理 | app/devices/manage.tsx / app/devices/manage/[deviceId].tsx | AdaptiveWindow, AnchoredPullDownMenu, AndroidUpdateSheet, AppText, AuthContext, BlurBackdrop, CenteredScreen, ComposerNativeSection, ComposerNativeSection.ios, ComposerSheet, ComposerSheet.ios, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, ContextSheet.ios, DeviceInformationFields, DeviceInformationFields.ios, DeviceLinkContext, DeviceManagementDialogs, DeviceManagementList, DeviceManagementList.ios, FoldTouchpad, HomeEntryProvider, HomeHeaderGlassButton, HomeHeaderGlassButton.ios, HomeNativeStackHeader, IncomingShareBridge, MobileLoginHandoffContext, MobileLoginHandoffStage, MobileOutboxBridge, MobilePrimitives, ModalContentArea, NativeChromeBackButton.ios, NativeChromeButton.ios, NativePullDownMenu, NativeRemoteDesktopView, NativeResidentHistory, NativeSwitch, OutsideTap, PermissionGuide, PermissionGuideView, PermissionGuideView.ios, PushNotificationsBridge, QuietSyncIndicator, RecentMessageHistories, RemoteDesktopActionButton, RemoteDesktopActionButton.ios, RemoteDesktopBackButton, RemoteDesktopBackButton.ios, RemoteDesktopChrome, RemoteDesktopChrome.ios, RemoteDesktopClipboardButton, RemoteDesktopControls, RemoteDesktopDisplaySettings, RemoteDesktopHost, RemoteDesktopIcons, RemoteDesktopMouseControls, RemoteDesktopMouseControls.ios, RemoteDesktopNetworkStatus, RemoteDesktopPanelButton, RemoteDesktopPanelButton.ios, RemoteDesktopScreen, RemoteDesktopSecuritySettings, RemoteDesktopWindows, RenameDeviceModal, ResidentHomeList, SheetModal, SheetSurface, SimpleStackHeader, StartupSplashOverlay, ThemeProvider, [deviceId], _layout, gestureHandler, manage, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/devices/manage.tsx, apps/mobile/app/devices/manage/[deviceId].tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceInformationFields.ios.tsx, apps/mobile/src/device-link/DeviceInformationFields.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/DeviceManagementDialogs.tsx, apps/mobile/src/device-link/DeviceManagementList.ios.tsx, apps/mobile/src/device-link/DeviceManagementList.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/AdaptiveWindow.tsx, apps/mobile/src/platform/ModalContentArea.tsx, apps/mobile/src/platform/OutsideTap.tsx, apps/mobile/src/platform/chrome/AnchoredPullDownMenu.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx, apps/mobile/src/platform/chrome/NativeChromeBackButton.ios.tsx, apps/mobile/src/platform/chrome/NativeChromeButton.ios.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/remote-desktop/FoldTouchpad.tsx, apps/mobile/src/remote-desktop/NativeRemoteDesktopView.tsx, apps/mobile/src/remote-desktop/PermissionGuide.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.ios.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.tsx, apps/mobile/src/remote-desktop/RemoteDesktopClipboardButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopDisplaySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopHost.tsx, apps/mobile/src/remote-desktop/RemoteDesktopIcons.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopNetworkStatus.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopScreen.tsx, apps/mobile/src/remote-desktop/RemoteDesktopSecuritySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopWindows.tsx, apps/mobile/src/remote-desktop/viewerHtml.ts, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ComposerNativeSection.ios.tsx, apps/mobile/src/session/ComposerNativeSection.tsx, apps/mobile/src/session/ComposerSheet.ios.tsx, apps/mobile/src/session/ComposerSheet.tsx, apps/mobile/src/session/ContextSheet.ios.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/HomeEntryProvider.tsx, apps/mobile/src/session/HomeHeaderGlassButton.ios.tsx, apps/mobile/src/session/HomeHeaderGlassButton.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/MobileOutboxBridge.tsx, apps/mobile/src/session/NativeResidentHistory.tsx, apps/mobile/src/session/RecentMessageHistories.tsx, apps/mobile/src/session/RenameDeviceModal.tsx, apps/mobile/src/session/ResidentHomeList.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 206 | 61 |
+| `mobile.devices` | mobile | 主机详情 | app/devices/[deviceId].tsx | AccountSwitcherSheet, AdaptiveWindow, AnchoredPullDownMenu, AndroidUpdateSheet, AppText, AuthContext, AutomationTimerIcon, BlurBackdrop, CenteredScreen, ComposerNativeRow, ComposerNativeRow.ios, ComposerNativeSection, ComposerNativeSection.ios, ComposerSheet, ComposerSheet.ios, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, ContextSheet.ios, ConversationSearchFilterSheet, DeviceLinkContext, FoldTouchpad, HomeChromeDrawer, HomeChromeFrost, HomeEntryProvider, HomeGlassMenuPanel, HomeHeaderGlassButton, HomeHeaderGlassButton.ios, HomeListVisuals, HomeModeSwitch, HomeNativeStackHeader, HomeNewTaskButton, HomeProjectMachineLabel, HomeSearchBar, HomeSurface, IncomingShareBridge, LoginNativeButton, LoginNativeButton.ios, MobileAgentMark, MobileLoginHandoffContext, MobileLoginHandoffStage, MobileOutboxBridge, MobilePrimitives, MobileVendorIcon, ModalContentArea, NativeChromeBackButton.ios, NativeChromeButton.ios, NativePullDownMenu, NativeRemoteDesktopView, NativeResidentHistory, NativeSwitch, OutsideTap, PermissionGuide, PermissionGuideView, PermissionGuideView.ios, PushNotificationsBridge, QuietSyncIndicator, RecentMessageHistories, RemoteAccessGuide, RemoteDesktopActionButton, RemoteDesktopActionButton.ios, RemoteDesktopBackButton, RemoteDesktopBackButton.ios, RemoteDesktopChrome, RemoteDesktopChrome.ios, RemoteDesktopClipboardButton, RemoteDesktopControls, RemoteDesktopDisplaySettings, RemoteDesktopHost, RemoteDesktopIcons, RemoteDesktopMouseControls, RemoteDesktopMouseControls.ios, RemoteDesktopNetworkStatus, RemoteDesktopPanelButton, RemoteDesktopPanelButton.ios, RemoteDesktopScreen, RemoteDesktopSecuritySettings, RemoteDesktopWindows, RemoteTaskSuggestions, RenameSessionModal, ResidentHomeList, SessionActionSheet, SessionDetailsNative, SessionDetailsNative.ios, SessionHeaderNativeControls, SessionHeaderNativeControls.ios, SessionOptionsExpoSheet, SheetModal, SheetSurface, SimpleStackHeader, StartupSplashOverlay, SwipeableSessionRow, SwipeableSessionRow.ios, TaskTags, ThemeProvider, [deviceId], _layout, gestureHandler, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/devices/[deviceId].tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/LoginNativeButton.ios.tsx, apps/mobile/src/components/LoginNativeButton.tsx, apps/mobile/src/components/MobileAgentMark.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/MobileVendorIcon.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/RemoteAccessGuide.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/AdaptiveWindow.tsx, apps/mobile/src/platform/ModalContentArea.tsx, apps/mobile/src/platform/OutsideTap.tsx, apps/mobile/src/platform/chrome/AnchoredPullDownMenu.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx, apps/mobile/src/platform/chrome/NativeChromeBackButton.ios.tsx, apps/mobile/src/platform/chrome/NativeChromeButton.ios.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/remote-desktop/FoldTouchpad.tsx, apps/mobile/src/remote-desktop/NativeRemoteDesktopView.tsx, apps/mobile/src/remote-desktop/PermissionGuide.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.ios.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.tsx, apps/mobile/src/remote-desktop/RemoteDesktopClipboardButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopDisplaySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopHost.tsx, apps/mobile/src/remote-desktop/RemoteDesktopIcons.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopNetworkStatus.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopScreen.tsx, apps/mobile/src/remote-desktop/RemoteDesktopSecuritySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopWindows.tsx, apps/mobile/src/remote-desktop/viewerHtml.ts, apps/mobile/src/session/AccountSwitcherSheet.tsx, apps/mobile/src/session/AutomationTimerIcon.tsx, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ComposerNativeRow.ios.tsx, apps/mobile/src/session/ComposerNativeRow.tsx, apps/mobile/src/session/ComposerNativeSection.ios.tsx, apps/mobile/src/session/ComposerNativeSection.tsx, apps/mobile/src/session/ComposerSheet.ios.tsx, apps/mobile/src/session/ComposerSheet.tsx, apps/mobile/src/session/ContextSheet.ios.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/ConversationSearchFilterSheet.tsx, apps/mobile/src/session/HomeChromeDrawer.tsx, apps/mobile/src/session/HomeChromeFrost.tsx, apps/mobile/src/session/HomeEntryProvider.tsx, apps/mobile/src/session/HomeGlassMenuPanel.tsx, apps/mobile/src/session/HomeHeaderGlassButton.ios.tsx, apps/mobile/src/session/HomeHeaderGlassButton.tsx, apps/mobile/src/session/HomeListVisuals.tsx, apps/mobile/src/session/HomeModeSwitch.tsx, apps/mobile/src/session/HomeNewTaskButton.tsx, apps/mobile/src/session/HomeProjectMachineLabel.tsx, apps/mobile/src/session/HomeSearchBar.tsx, apps/mobile/src/session/HomeSurface.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/MobileOutboxBridge.tsx, apps/mobile/src/session/NativeResidentHistory.tsx, apps/mobile/src/session/RecentMessageHistories.tsx, apps/mobile/src/session/RemoteTaskSuggestions.tsx, apps/mobile/src/session/RenameSessionModal.tsx, apps/mobile/src/session/ResidentHomeList.tsx, apps/mobile/src/session/SessionActionSheet.tsx, apps/mobile/src/session/SessionDetailsNative.ios.tsx, apps/mobile/src/session/SessionDetailsNative.tsx, apps/mobile/src/session/SessionHeaderNativeControls.ios.tsx, apps/mobile/src/session/SessionHeaderNativeControls.tsx, apps/mobile/src/session/SessionOptionsExpoSheet.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/session/SwipeableSessionRow.ios.tsx, apps/mobile/src/session/SwipeableSessionRow.tsx, apps/mobile/src/session/TaskTags.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 206 | 117 |
+| `mobile.files` | mobile | 任务文件与预览 | app/files/[sessionId].tsx / app/files/preview/[sessionId].tsx | AdaptiveWindow, AnchoredPullDownMenu, AndroidUpdateSheet, AppText, AuthContext, BlurBackdrop, CenteredScreen, ComposerNativeSection, ComposerNativeSection.ios, ComposerSheet, ComposerSheet.ios, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, ContextSheet.ios, DeviceLinkContext, FileTypeIcon, FileTypeTile, FoldTouchpad, HomeEntryProvider, HtmlBrowserChrome, HtmlBrowserChrome.ios, HtmlFileReader, HtmlWebsiteBrowser, ImageLightbox, IncomingShareBridge, MarkdownFileReader, MobileLoginHandoffContext, MobileLoginHandoffStage, MobileOutboxBridge, MobilePrimitives, ModalContentArea, NativeChromeBackButton.ios, NativeChromeButton.ios, NativePullDownMenu, NativeRemoteDesktopView, NativeResidentHistory, NativeSwitch, OutsideTap, PermissionGuide, PermissionGuideView, PermissionGuideView.ios, PushNotificationsBridge, QuietSyncIndicator, RecentMessageHistories, RemoteDesktopActionButton, RemoteDesktopActionButton.ios, RemoteDesktopBackButton, RemoteDesktopBackButton.ios, RemoteDesktopChrome, RemoteDesktopChrome.ios, RemoteDesktopClipboardButton, RemoteDesktopControls, RemoteDesktopDisplaySettings, RemoteDesktopHost, RemoteDesktopIcons, RemoteDesktopMouseControls, RemoteDesktopMouseControls.ios, RemoteDesktopNetworkStatus, RemoteDesktopPanelButton, RemoteDesktopPanelButton.ios, RemoteDesktopScreen, RemoteDesktopSecuritySettings, RemoteDesktopWindows, ResidentHomeList, SheetModal, SheetSurface, StartupSplashOverlay, SystemNavigationBack, ThemeProvider, [sessionId], _layout, gestureHandler, mediaPlayerWebView, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/files/[sessionId].tsx, apps/mobile/app/files/preview/[sessionId].tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/FileTypeIcon.tsx, apps/mobile/src/components/FileTypeTile.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/AdaptiveWindow.tsx, apps/mobile/src/platform/ModalContentArea.tsx, apps/mobile/src/platform/OutsideTap.tsx, apps/mobile/src/platform/chrome/AnchoredPullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeChromeBackButton.ios.tsx, apps/mobile/src/platform/chrome/NativeChromeButton.ios.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SystemNavigationBack.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/remote-desktop/FoldTouchpad.tsx, apps/mobile/src/remote-desktop/NativeRemoteDesktopView.tsx, apps/mobile/src/remote-desktop/PermissionGuide.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.ios.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.tsx, apps/mobile/src/remote-desktop/RemoteDesktopClipboardButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopDisplaySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopHost.tsx, apps/mobile/src/remote-desktop/RemoteDesktopIcons.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopNetworkStatus.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopScreen.tsx, apps/mobile/src/remote-desktop/RemoteDesktopSecuritySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopWindows.tsx, apps/mobile/src/remote-desktop/viewerHtml.ts, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ComposerNativeSection.ios.tsx, apps/mobile/src/session/ComposerNativeSection.tsx, apps/mobile/src/session/ComposerSheet.ios.tsx, apps/mobile/src/session/ComposerSheet.tsx, apps/mobile/src/session/ContextSheet.ios.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/HomeEntryProvider.tsx, apps/mobile/src/session/HtmlBrowserChrome.ios.tsx, apps/mobile/src/session/HtmlBrowserChrome.tsx, apps/mobile/src/session/HtmlFileReader.tsx, apps/mobile/src/session/HtmlWebsiteBrowser.tsx, apps/mobile/src/session/ImageLightbox.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/MarkdownFileReader.tsx, apps/mobile/src/session/MobileOutboxBridge.tsx, apps/mobile/src/session/NativeResidentHistory.tsx, apps/mobile/src/session/RecentMessageHistories.tsx, apps/mobile/src/session/ResidentHomeList.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/session/mathWebViewHtml.ts, apps/mobile/src/session/mediaPlayerWebView.tsx, apps/mobile/src/session/mediaPlayerWebViewHtml.ts, apps/mobile/src/session/selectableMarkdownHtml.ts, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 238 | 84 |
+| `mobile.home` | mobile | 主机与资源首页 | app/index.tsx / app/devices/index.tsx | AccountSwitcherSheet, AdaptiveWindow, AnchoredPullDownMenu, AndroidUpdateSheet, AppText, AuthContext, AutomationTimerIcon, BlurBackdrop, CenteredScreen, CompanionChoice, CompanionCreateNativeView, CompanionCreateNativeView.ios, CompanionMemoryPage, CompanionMemoryPage.ios, CompanionModelChain, CompanionNativeContent.ios, CompanionPortraitPicker, CompanionProfileArtifacts, CompanionProfileNativeView, CompanionProfileNativeView.ios, CompanionProfileSheet, CompanionSettingsRow, CompanionSettingsRow.ios, CompanionSheet, CompanionSheet.ios, ComposerNativeRow, ComposerNativeRow.ios, ComposerNativeSection, ComposerNativeSection.ios, ComposerSheet, ComposerSheet.ios, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, ContextSheet.ios, ConversationSearchFilterSheet, DeviceLinkContext, FoldTouchpad, HomeChromeDrawer, HomeChromeFrost, HomeEntryProvider, HomeGlassMenuPanel, HomeHeaderGlassButton, HomeHeaderGlassButton.ios, HomeListVisuals, HomeModePanes, HomeModeSwitch, HomeNativeStackHeader, HomeNewTaskButton, HomeProjectMachineLabel, HomeSearchBar, HomeSurface, IncomingShareBridge, LoginNativeButton, LoginNativeButton.ios, MobileAgentMark, MobileAgentSwitcher, MobileLoginHandoffContext, MobileLoginHandoffStage, MobileModelPickerList, MobileModelPickerList.ios, MobileOutboxBridge, MobilePermissionPickerList, MobilePermissionPickerList.ios, MobilePrimitives, MobileProviderMark, MobileVendorIcon, ModalContentArea, ModelOptionsSheetView, ModelOptionsSheetView.ios, ModelPickerNativeHeader, ModelPickerNativeHeader.ios, ModelPickerSheet, NativeChromeBackButton.ios, NativeChromeButton.ios, NativePullDownMenu, NativeRemoteDesktopView, NativeResidentHistory, NativeSwitch, OutsideTap, PermissionGuide, PermissionGuideView, PermissionGuideView.ios, PushNotificationsBridge, QuietSyncIndicator, RecentMessageHistories, RemoteAccessGuide, RemoteCompanionAvatar, RemoteDesktopActionButton, RemoteDesktopActionButton.ios, RemoteDesktopBackButton, RemoteDesktopBackButton.ios, RemoteDesktopChrome, RemoteDesktopChrome.ios, RemoteDesktopClipboardButton, RemoteDesktopControls, RemoteDesktopDisplaySettings, RemoteDesktopHost, RemoteDesktopIcons, RemoteDesktopMouseControls, RemoteDesktopMouseControls.ios, RemoteDesktopNetworkStatus, RemoteDesktopPanelButton, RemoteDesktopPanelButton.ios, RemoteDesktopScreen, RemoteDesktopSecuritySettings, RemoteDesktopWindows, RemoteTaskSuggestions, RenameSessionModal, ResidentHomeList, SessionActionSheet, SessionDetailsNative, SessionDetailsNative.ios, SessionHeaderNativeControls, SessionHeaderNativeControls.ios, SessionOptionsExpoSheet, SheetModal, SheetSurface, SimpleStackHeader, StartupSplashOverlay, SwipeableSessionRow, SwipeableSessionRow.ios, TaskTags, TeammateCreateButton, TeammateGenerationLabel, TeammateHomeScreen, TeammateList, ThemeProvider, UnifiedModelPickerSheet, UnifiedModelPickerView, UnifiedModelPickerView.ios, WorkingStatusText, _layout, gestureHandler, index, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/devices/index.tsx, apps/mobile/app/index.tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/LoginNativeButton.ios.tsx, apps/mobile/src/components/LoginNativeButton.tsx, apps/mobile/src/components/MobileAgentMark.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/MobileVendorIcon.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/RemoteAccessGuide.tsx, apps/mobile/src/components/RemoteCompanionAvatar.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/AdaptiveWindow.tsx, apps/mobile/src/platform/ModalContentArea.tsx, apps/mobile/src/platform/OutsideTap.tsx, apps/mobile/src/platform/chrome/AnchoredPullDownMenu.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx, apps/mobile/src/platform/chrome/NativeChromeBackButton.ios.tsx, apps/mobile/src/platform/chrome/NativeChromeButton.ios.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/remote-desktop/FoldTouchpad.tsx, apps/mobile/src/remote-desktop/NativeRemoteDesktopView.tsx, apps/mobile/src/remote-desktop/PermissionGuide.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.ios.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.tsx, apps/mobile/src/remote-desktop/RemoteDesktopClipboardButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopDisplaySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopHost.tsx, apps/mobile/src/remote-desktop/RemoteDesktopIcons.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopNetworkStatus.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopScreen.tsx, apps/mobile/src/remote-desktop/RemoteDesktopSecuritySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopWindows.tsx, apps/mobile/src/remote-desktop/viewerHtml.ts, apps/mobile/src/session/AccountSwitcherSheet.tsx, apps/mobile/src/session/AutomationTimerIcon.tsx, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/CompanionChoice.tsx, apps/mobile/src/session/CompanionCreateNativeView.ios.tsx, apps/mobile/src/session/CompanionCreateNativeView.tsx, apps/mobile/src/session/CompanionMemoryPage.ios.tsx, apps/mobile/src/session/CompanionMemoryPage.tsx, apps/mobile/src/session/CompanionModelChain.tsx, apps/mobile/src/session/CompanionNativeContent.ios.tsx, apps/mobile/src/session/CompanionPortraitPicker.tsx, apps/mobile/src/session/CompanionProfileArtifacts.tsx, apps/mobile/src/session/CompanionProfileNativeView.ios.tsx, apps/mobile/src/session/CompanionProfileNativeView.tsx, apps/mobile/src/session/CompanionProfileSheet.tsx, apps/mobile/src/session/CompanionSettingsRow.ios.tsx, apps/mobile/src/session/CompanionSettingsRow.tsx, apps/mobile/src/session/CompanionSheet.ios.tsx, apps/mobile/src/session/CompanionSheet.tsx, apps/mobile/src/session/ComposerNativeRow.ios.tsx, apps/mobile/src/session/ComposerNativeRow.tsx, apps/mobile/src/session/ComposerNativeSection.ios.tsx, apps/mobile/src/session/ComposerNativeSection.tsx, apps/mobile/src/session/ComposerSheet.ios.tsx, apps/mobile/src/session/ComposerSheet.tsx, apps/mobile/src/session/ContextSheet.ios.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/ConversationSearchFilterSheet.tsx, apps/mobile/src/session/HomeChromeDrawer.tsx, apps/mobile/src/session/HomeChromeFrost.tsx, apps/mobile/src/session/HomeEntryProvider.tsx, apps/mobile/src/session/HomeGlassMenuPanel.tsx, apps/mobile/src/session/HomeHeaderGlassButton.ios.tsx, apps/mobile/src/session/HomeHeaderGlassButton.tsx, apps/mobile/src/session/HomeListVisuals.tsx, apps/mobile/src/session/HomeModePanes.tsx, apps/mobile/src/session/HomeModeSwitch.tsx, apps/mobile/src/session/HomeNewTaskButton.tsx, apps/mobile/src/session/HomeProjectMachineLabel.tsx, apps/mobile/src/session/HomeSearchBar.tsx, apps/mobile/src/session/HomeSurface.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/MobileAgentSwitcher.tsx, apps/mobile/src/session/MobileModelPickerList.ios.tsx, apps/mobile/src/session/MobileModelPickerList.tsx, apps/mobile/src/session/MobileOutboxBridge.tsx, apps/mobile/src/session/MobilePermissionPickerList.ios.tsx, apps/mobile/src/session/MobilePermissionPickerList.tsx, apps/mobile/src/session/MobileProviderMark.tsx, apps/mobile/src/session/ModelOptionsSheetView.ios.tsx, apps/mobile/src/session/ModelOptionsSheetView.tsx, apps/mobile/src/session/ModelPickerNativeHeader.ios.tsx, apps/mobile/src/session/ModelPickerNativeHeader.tsx, apps/mobile/src/session/ModelPickerSheet.tsx, apps/mobile/src/session/NativeResidentHistory.tsx, apps/mobile/src/session/RecentMessageHistories.tsx, apps/mobile/src/session/RemoteTaskSuggestions.tsx, apps/mobile/src/session/RenameSessionModal.tsx, apps/mobile/src/session/ResidentHomeList.tsx, apps/mobile/src/session/SessionActionSheet.tsx, apps/mobile/src/session/SessionDetailsNative.ios.tsx, apps/mobile/src/session/SessionDetailsNative.tsx, apps/mobile/src/session/SessionHeaderNativeControls.ios.tsx, apps/mobile/src/session/SessionHeaderNativeControls.tsx, apps/mobile/src/session/SessionOptionsExpoSheet.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/session/SwipeableSessionRow.ios.tsx, apps/mobile/src/session/SwipeableSessionRow.tsx, apps/mobile/src/session/TaskTags.tsx, apps/mobile/src/session/TeammateCreateButton.tsx, apps/mobile/src/session/TeammateGenerationLabel.tsx, apps/mobile/src/session/TeammateHomeScreen.tsx, apps/mobile/src/session/TeammateList.tsx, apps/mobile/src/session/UnifiedModelPickerSheet.tsx, apps/mobile/src/session/UnifiedModelPickerView.ios.tsx, apps/mobile/src/session/UnifiedModelPickerView.tsx, apps/mobile/src/session/WorkingStatusText.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 206 | 139 |
+| `mobile.overlay.connection-startup` | mobile | 根布局挂载的启动与连接反馈 | app/_layout.tsx → StartupSplashOverlay / ConnectionNoticeProvider;各页面 ConnectionBanner | AdaptiveWindow, AnchoredPullDownMenu, AndroidUpdateSheet, AppText, AuthContext, BlurBackdrop, CenteredScreen, ComposerNativeSection, ComposerNativeSection.ios, ComposerSheet, ComposerSheet.ios, ConnectionBanner, ConnectionNoticeOverlay, ConnectionNoticeProvider, ContextSheet, ContextSheet.ios, DeviceLinkContext, FoldTouchpad, HomeEntryProvider, IncomingShareBridge, MobileLoginHandoffContext, MobileLoginHandoffStage, MobileOutboxBridge, MobilePrimitives, NativeChromeBackButton.ios, NativeChromeButton.ios, NativePullDownMenu, NativeRemoteDesktopView, NativeResidentHistory, NativeSwitch, OutsideTap, PermissionGuide, PermissionGuideView, PermissionGuideView.ios, PushNotificationsBridge, QuietSyncIndicator, RecentMessageHistories, RemoteDesktopActionButton, RemoteDesktopActionButton.ios, RemoteDesktopBackButton, RemoteDesktopBackButton.ios, RemoteDesktopChrome, RemoteDesktopChrome.ios, RemoteDesktopClipboardButton, RemoteDesktopControls, RemoteDesktopDisplaySettings, RemoteDesktopHost, RemoteDesktopIcons, RemoteDesktopMouseControls, RemoteDesktopMouseControls.ios, RemoteDesktopNetworkStatus, RemoteDesktopPanelButton, RemoteDesktopPanelButton.ios, RemoteDesktopScreen, RemoteDesktopSecuritySettings, RemoteDesktopWindows, ResidentHomeList, SheetModal, SheetSurface, StartupSplashOverlay, ThemeProvider, _layout, gestureHandler, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/AdaptiveWindow.tsx, apps/mobile/src/platform/OutsideTap.tsx, apps/mobile/src/platform/chrome/AnchoredPullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeChromeBackButton.ios.tsx, apps/mobile/src/platform/chrome/NativeChromeButton.ios.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/remote-desktop/FoldTouchpad.tsx, apps/mobile/src/remote-desktop/NativeRemoteDesktopView.tsx, apps/mobile/src/remote-desktop/PermissionGuide.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.ios.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.tsx, apps/mobile/src/remote-desktop/RemoteDesktopClipboardButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopDisplaySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopHost.tsx, apps/mobile/src/remote-desktop/RemoteDesktopIcons.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopNetworkStatus.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopScreen.tsx, apps/mobile/src/remote-desktop/RemoteDesktopSecuritySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopWindows.tsx, apps/mobile/src/remote-desktop/viewerHtml.ts, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ComposerNativeSection.ios.tsx, apps/mobile/src/session/ComposerNativeSection.tsx, apps/mobile/src/session/ComposerSheet.ios.tsx, apps/mobile/src/session/ComposerSheet.tsx, apps/mobile/src/session/ContextSheet.ios.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/HomeEntryProvider.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/MobileOutboxBridge.tsx, apps/mobile/src/session/NativeResidentHistory.tsx, apps/mobile/src/session/RecentMessageHistories.tsx, apps/mobile/src/session/ResidentHomeList.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 206 | 55 |
+| `mobile.remote-desktop` | mobile | 远程桌面 | app/devices/desktop/[deviceId].tsx | AdaptiveWindow, AnchoredPullDownMenu, AndroidUpdateSheet, AppText, AuthContext, BlurBackdrop, CenteredScreen, ComposerNativeSection, ComposerNativeSection.ios, ComposerSheet, ComposerSheet.ios, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, ContextSheet.ios, DeviceLinkContext, FoldTouchpad, HomeEntryProvider, IncomingShareBridge, MobileLoginHandoffContext, MobileLoginHandoffStage, MobileOutboxBridge, MobilePrimitives, NativeChromeBackButton.ios, NativeChromeButton.ios, NativePullDownMenu, NativeRemoteDesktopView, NativeResidentHistory, NativeSwitch, OutsideTap, PermissionGuide, PermissionGuideView, PermissionGuideView.ios, PushNotificationsBridge, QuietSyncIndicator, RecentMessageHistories, RemoteDesktopActionButton, RemoteDesktopActionButton.ios, RemoteDesktopBackButton, RemoteDesktopBackButton.ios, RemoteDesktopChrome, RemoteDesktopChrome.ios, RemoteDesktopClipboardButton, RemoteDesktopControls, RemoteDesktopDisplaySettings, RemoteDesktopHost, RemoteDesktopIcons, RemoteDesktopMouseControls, RemoteDesktopMouseControls.ios, RemoteDesktopNetworkStatus, RemoteDesktopPanelButton, RemoteDesktopPanelButton.ios, RemoteDesktopScreen, RemoteDesktopSecuritySettings, RemoteDesktopWindows, ResidentHomeList, SheetModal, SheetSurface, StartupSplashOverlay, ThemeProvider, [deviceId], _layout, gestureHandler, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/devices/desktop/[deviceId].tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/AdaptiveWindow.tsx, apps/mobile/src/platform/OutsideTap.tsx, apps/mobile/src/platform/chrome/AnchoredPullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeChromeBackButton.ios.tsx, apps/mobile/src/platform/chrome/NativeChromeButton.ios.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/remote-desktop/FoldTouchpad.tsx, apps/mobile/src/remote-desktop/NativeRemoteDesktopView.tsx, apps/mobile/src/remote-desktop/PermissionGuide.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.ios.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.tsx, apps/mobile/src/remote-desktop/RemoteDesktopClipboardButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopDisplaySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopHost.tsx, apps/mobile/src/remote-desktop/RemoteDesktopIcons.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopNetworkStatus.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopScreen.tsx, apps/mobile/src/remote-desktop/RemoteDesktopSecuritySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopWindows.tsx, apps/mobile/src/remote-desktop/viewerHtml.ts, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ComposerNativeSection.ios.tsx, apps/mobile/src/session/ComposerNativeSection.tsx, apps/mobile/src/session/ComposerSheet.ios.tsx, apps/mobile/src/session/ComposerSheet.tsx, apps/mobile/src/session/ContextSheet.ios.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/HomeEntryProvider.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/MobileOutboxBridge.tsx, apps/mobile/src/session/NativeResidentHistory.tsx, apps/mobile/src/session/RecentMessageHistories.tsx, apps/mobile/src/session/ResidentHomeList.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 206 | 55 |
+| `mobile.resources` | mobile | 远程资源列表与详情 | app/resources/[collectionId].tsx / app/resources/[collectionId]/[resourceId].tsx | AdaptiveWindow, AnchoredPullDownMenu, AndroidUpdateSheet, AppText, AuthContext, BlurBackdrop, CenteredScreen, ComposerNativeSection, ComposerNativeSection.ios, ComposerSheet, ComposerSheet.ios, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, ContextSheet.ios, DeviceLinkContext, FoldTouchpad, HomeEntryProvider, HomeHeaderGlassButton, HomeHeaderGlassButton.ios, HomeNativeStackHeader, IncomingShareBridge, MobileLoginHandoffContext, MobileLoginHandoffStage, MobileOutboxBridge, MobilePrimitives, NativeChromeBackButton.ios, NativeChromeButton.ios, NativePullDownMenu, NativeRemoteDesktopView, NativeResidentHistory, NativeSwitch, OutsideTap, PermissionGuide, PermissionGuideView, PermissionGuideView.ios, PushNotificationsBridge, QuietSyncIndicator, RecentMessageHistories, RemoteCompanionAvatar, RemoteDesktopActionButton, RemoteDesktopActionButton.ios, RemoteDesktopBackButton, RemoteDesktopBackButton.ios, RemoteDesktopChrome, RemoteDesktopChrome.ios, RemoteDesktopClipboardButton, RemoteDesktopControls, RemoteDesktopDisplaySettings, RemoteDesktopHost, RemoteDesktopIcons, RemoteDesktopMouseControls, RemoteDesktopMouseControls.ios, RemoteDesktopNetworkStatus, RemoteDesktopPanelButton, RemoteDesktopPanelButton.ios, RemoteDesktopScreen, RemoteDesktopSecuritySettings, RemoteDesktopWindows, ResidentHomeList, SheetModal, SheetSurface, SimpleStackHeader, StartupSplashOverlay, TeammateGenerationLabel, TeammateList, ThemeProvider, WorkingStatusText, [collectionId], [resourceId], _layout, gestureHandler, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/resources/[collectionId].tsx, apps/mobile/app/resources/[collectionId]/[resourceId].tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/RemoteCompanionAvatar.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/AdaptiveWindow.tsx, apps/mobile/src/platform/OutsideTap.tsx, apps/mobile/src/platform/chrome/AnchoredPullDownMenu.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx, apps/mobile/src/platform/chrome/NativeChromeBackButton.ios.tsx, apps/mobile/src/platform/chrome/NativeChromeButton.ios.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/remote-desktop/FoldTouchpad.tsx, apps/mobile/src/remote-desktop/NativeRemoteDesktopView.tsx, apps/mobile/src/remote-desktop/PermissionGuide.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.ios.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.tsx, apps/mobile/src/remote-desktop/RemoteDesktopClipboardButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopDisplaySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopHost.tsx, apps/mobile/src/remote-desktop/RemoteDesktopIcons.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopNetworkStatus.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopScreen.tsx, apps/mobile/src/remote-desktop/RemoteDesktopSecuritySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopWindows.tsx, apps/mobile/src/remote-desktop/viewerHtml.ts, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ComposerNativeSection.ios.tsx, apps/mobile/src/session/ComposerNativeSection.tsx, apps/mobile/src/session/ComposerSheet.ios.tsx, apps/mobile/src/session/ComposerSheet.tsx, apps/mobile/src/session/ContextSheet.ios.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/HomeEntryProvider.tsx, apps/mobile/src/session/HomeHeaderGlassButton.ios.tsx, apps/mobile/src/session/HomeHeaderGlassButton.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/MobileOutboxBridge.tsx, apps/mobile/src/session/NativeResidentHistory.tsx, apps/mobile/src/session/RecentMessageHistories.tsx, apps/mobile/src/session/ResidentHomeList.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/session/TeammateGenerationLabel.tsx, apps/mobile/src/session/TeammateList.tsx, apps/mobile/src/session/WorkingStatusText.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 206 | 68 |
+| `mobile.settings` | mobile | 设置(含调试与日志上传可见入口) | app/settings.tsx | AdaptiveWindow, AnchoredPullDownMenu, AndroidUpdateSheet, AppText, AuthContext, BlurBackdrop, CenteredScreen, ComposerNativeSection, ComposerNativeSection.ios, ComposerSheet, ComposerSheet.ios, ConnectionBanner, ConnectionNoticeOverlay, ContextSheet, ContextSheet.ios, DeviceLinkContext, FoldTouchpad, HomeEntryProvider, HomeHeaderGlassButton, HomeHeaderGlassButton.ios, HomeNativeStackHeader, IncomingShareBridge, MobileChoicePickerList, MobileLoginHandoffContext, MobileLoginHandoffStage, MobileOutboxBridge, MobilePrimitives, NativeChromeBackButton.ios, NativeChromeButton.ios, NativePullDownMenu, NativeRemoteDesktopView, NativeResidentHistory, NativeSwitch, OutsideTap, PermissionGuide, PermissionGuideView, PermissionGuideView.ios, PushNotificationsBridge, QuietSyncIndicator, RecentMessageHistories, RemoteDesktopActionButton, RemoteDesktopActionButton.ios, RemoteDesktopBackButton, RemoteDesktopBackButton.ios, RemoteDesktopChrome, RemoteDesktopChrome.ios, RemoteDesktopClipboardButton, RemoteDesktopControls, RemoteDesktopDisplaySettings, RemoteDesktopHost, RemoteDesktopIcons, RemoteDesktopMouseControls, RemoteDesktopMouseControls.ios, RemoteDesktopNetworkStatus, RemoteDesktopPanelButton, RemoteDesktopPanelButton.ios, RemoteDesktopScreen, RemoteDesktopSecuritySettings, RemoteDesktopWindows, ResidentHomeList, SheetModal, SheetSurface, SimpleStackHeader, StartupSplashOverlay, ThemeProvider, _layout, gestureHandler, peerFileTransport, settings, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/settings.tsx, apps/mobile/src/auth/AuthContext.tsx, apps/mobile/src/auth/MobileLoginHandoffContext.tsx, apps/mobile/src/components/AppText.tsx, apps/mobile/src/components/CenteredScreen.tsx, apps/mobile/src/components/ConnectionBanner.tsx, apps/mobile/src/components/ConnectionNoticeOverlay.tsx, apps/mobile/src/components/MobileLoginHandoffStage.tsx, apps/mobile/src/components/MobilePrimitives.tsx, apps/mobile/src/components/QuietSyncIndicator.tsx, apps/mobile/src/components/StartupSplashOverlay.tsx, apps/mobile/src/device-link/DeviceLinkContext.tsx, apps/mobile/src/device-link/peerFileTransport.tsx, apps/mobile/src/i18n/useLocale.tsx, apps/mobile/src/notifications/PushNotificationsBridge.tsx, apps/mobile/src/platform/AdaptiveWindow.tsx, apps/mobile/src/platform/OutsideTap.tsx, apps/mobile/src/platform/chrome/AnchoredPullDownMenu.tsx, apps/mobile/src/platform/chrome/HomeNativeStackHeader.tsx, apps/mobile/src/platform/chrome/NativeChromeBackButton.ios.tsx, apps/mobile/src/platform/chrome/NativeChromeButton.ios.tsx, apps/mobile/src/platform/chrome/NativePullDownMenu.tsx, apps/mobile/src/platform/chrome/NativeSwitch.tsx, apps/mobile/src/platform/chrome/SimpleStackHeader.tsx, apps/mobile/src/platform/gestureHandler.tsx, apps/mobile/src/remote-desktop/FoldTouchpad.tsx, apps/mobile/src/remote-desktop/NativeRemoteDesktopView.tsx, apps/mobile/src/remote-desktop/PermissionGuide.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.ios.tsx, apps/mobile/src/remote-desktop/PermissionGuideView.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopActionButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopBackButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopChrome.tsx, apps/mobile/src/remote-desktop/RemoteDesktopClipboardButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopDisplaySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopHost.tsx, apps/mobile/src/remote-desktop/RemoteDesktopIcons.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopMouseControls.tsx, apps/mobile/src/remote-desktop/RemoteDesktopNetworkStatus.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.ios.tsx, apps/mobile/src/remote-desktop/RemoteDesktopPanelButton.tsx, apps/mobile/src/remote-desktop/RemoteDesktopScreen.tsx, apps/mobile/src/remote-desktop/RemoteDesktopSecuritySettings.tsx, apps/mobile/src/remote-desktop/RemoteDesktopWindows.tsx, apps/mobile/src/remote-desktop/viewerHtml.ts, apps/mobile/src/session/BlurBackdrop.tsx, apps/mobile/src/session/ComposerNativeSection.ios.tsx, apps/mobile/src/session/ComposerNativeSection.tsx, apps/mobile/src/session/ComposerSheet.ios.tsx, apps/mobile/src/session/ComposerSheet.tsx, apps/mobile/src/session/ContextSheet.ios.tsx, apps/mobile/src/session/ContextSheet.tsx, apps/mobile/src/session/HomeEntryProvider.tsx, apps/mobile/src/session/HomeHeaderGlassButton.ios.tsx, apps/mobile/src/session/HomeHeaderGlassButton.tsx, apps/mobile/src/session/IncomingShareBridge.tsx, apps/mobile/src/session/MobileChoicePickerList.tsx, apps/mobile/src/session/MobileOutboxBridge.tsx, apps/mobile/src/session/NativeResidentHistory.tsx, apps/mobile/src/session/RecentMessageHistories.tsx, apps/mobile/src/session/ResidentHomeList.tsx, apps/mobile/src/session/SheetModal.tsx, apps/mobile/src/session/SheetSurface.tsx, apps/mobile/src/theme/ThemeProvider.tsx, apps/mobile/src/theme/navigationTheme.ts, apps/mobile/src/theme/tokens.ts, apps/mobile/src/update/AndroidUpdateSheet.tsx | 0 | 206 | 64 |
### 生产路由覆盖
diff --git a/docs/dev-rules/orca-team-architecture.md b/docs/dev-rules/orca-team-architecture.md
index ab51619a48..4ea056d3fd 100644
--- a/docs/dev-rules/orca-team-architecture.md
+++ b/docs/dev-rules/orca-team-architecture.md
@@ -51,6 +51,7 @@ Orca 是 Cindy Desktop 内的多 agent 协同能力:一个 **Lead session**
- workflow_run / CC Workflow 编排还未纳入当前实现。
- side_chat 尚未登记为 side activity 对象,也未挂进 pane;PR #107 只是 fork 数据动作。
- device-link 协同的 Lead / Worker / team 全部在被控端进程内编排,控制端只按 session 来源经隧道路由(`makerTransport` 的 `makerApiFor` / `orcaWorkflowsFor` / `subscribeOrcaWorkerChanged`,channel 见 `packages/device-link/src/allowlist.ts` 的 Orca 段)。collab 开关同样查被控端(`maker:plugins:get-state` 经 `pluginEnableStateFor`):项目读取被控端项目级策略,对话读取被控端用户级/全局级策略。控制端本机状态不能代表被控端真相。老被控端没有该 channel 时回 `CHANNEL_NOT_ALLOWED`,控制端 fail-closed 置灰入口并提示设备版本过旧,而不是放行到 `enableOrca` 才撞错。
+- 手机端是同一套 device-link 控制端:Lead / Worker 任务与普通任务一样可操作(发消息、处理确认、编辑队列、Fork / Rewind、任务设置),协同编排经 `apps/mobile/src/device-link/mobileMakerTransport.ts` 的 `orca` 组走与桌面控制端相同的 channel(开启 / 创建 / 切换焦点 / 确认完成 / 归档 / 结束、Worker 列表、协同设置只读)。入口判定、超时回查与错误文案在 `apps/mobile/src/session/orcaTeam.ts`,会话页与新建任务页的状态在 `useSessionOrcaCollab.ts`。新建任务开启协同不走二段派单:createSession 后、首条消息入队前即时 `enable-orca`,Worker 任务按 `buildDraftWorkerInitialTask` 附带待发送的 Lead 输入作为上下文;失败时任务照单任务继续并在会话页提示。协同设置(Worker 上限、空闲释放)在手机上只读。「创建 Worker」的记忆规则与桌面 `workerCreationPrefs` 一致(上次的 Agent、每个 Agent 的模型 / 推理强度 / Fast、Worker 权限;初始任务不记;首次默认值共用 `@cindy/maker-shared/orca-team`),与桌面控制端一样存在发起创建的一端(`apps/mobile/src/session/orcaWorkerPrefs.ts`,按账号隔离),不读写被控端偏好;记住的模型不在该电脑可用列表时回落被控端默认。
- SSH 远端协同支持 Claude Code、Codex 与 Pi Lead / Worker;Worker 继承 Lead 的 `remoteHostId` 与远端工作目录,在同一台远端主机执行,启动前复用远端就绪检查。cc 远端经 `cc-remote-mcp.ts` 把 `cindy_orca` / `orca_worker_bridge` 以 http 形态追加进 `startParams.mcpServers`(persistent token + `?session=` 路由,白名单仅此两个 server)。远端 worker 手动 `send_to_lead` 依赖 daemon 侧 `orca_worker_bridge` 经同一 bridge 可达;auto-bridge 回报不依赖 worker 侧 MCP,天然可用。Claude Code / Codex 共享 userData 多实例连同一远端 host 时,只有先建立 SSH 转发的实例能持有该 host 的 MCP bridge 端口,其余实例按“远端无 MCP”降级(与历史行为一致)。远端会话的项目级 collab 开关不查本机 fs;`assertCollabProjectEnabled` 对 remote 只查用户级/全局级开关,远端项目级配置机制是 follow-up。
Pi 的远端 Lead 沿用统一的 Lead 身份与 prompt 装配;内部 MCP(含 `cindy_orca`、
diff --git a/docs/product-rules/task-and-conversation-naming.md b/docs/product-rules/task-and-conversation-naming.md
index b6eeffd1bb..e2a3cb1f7c 100644
--- a/docs/product-rules/task-and-conversation-naming.md
+++ b/docs/product-rules/task-and-conversation-naming.md
@@ -528,7 +528,7 @@ renderer 的 `$` 指令展开、`ghost_list`、`ghost_info` 与 `ghost_call` 都
| 渠道直接发给用户 | 四个 `uiText.ts` | **改**(已清零) |
| main 抛给 renderer 的 `Error` message | 见下方「一句一句追展示路径」——**按 code 映射 i18n 的不改,原样展示的必须改**,不能按文件一刀切 |
| 插件 / MCP / LLM 读的字符串 | `cindy-brain/*Slot.ts`、`mcp-integrations/ghost.ts` | **不改**:不是 UI 文案,且多数确实指 Agent 进程会话(§6.0.2) |
-| Orca 协同术语 | 架构代码与内部标识继续用 session;`packages/maker-shared/src/sessionIdentity.ts` 返回的手机端只读提示会直接展示给用户 | **按展示路径分开**:架构术语不改,用户可见的 Orca Lead / Worker / 协作条目仍叫「任务」(含「协作子任务」「任务写操作」) |
+| Orca 协同术语 | 架构代码与内部标识继续用 session;手机端协同标签与只读提示(`apps/mobile/src/session/collaboration.ts` + i18n)会直接展示给用户 | **按展示路径分开**:架构术语不改,用户可见的 Orca Lead / Worker / 协作条目仍叫「任务」(含「协同子任务」「任务修改」) |
| 测试 fixture | `packages/maker-shared/src/fixtures.ts` | **不改** |
另有一类**刻意保留的渠道人格用词**:discord / feishu / wechat 把 session 叫「存档」、把接管
diff --git a/packages/device-link/src/invokePolicy.ts b/packages/device-link/src/invokePolicy.ts
index 2cab305e67..f2aac76408 100644
--- a/packages/device-link/src/invokePolicy.ts
+++ b/packages/device-link/src/invokePolicy.ts
@@ -46,6 +46,10 @@ import type { InvokePayload } from './protocol.js';
* restoreSessionForGoal 同样 await createSession 重启持久化 agent,冷启动
* 可超 15s;两者都有真实副作用(set 落库目标并发首轮,resume 先标 active),
* 误超时后重试会改动/重启已在跑的 goal。
+ * - maker:session:enable-orca / maker:worker:create:建 Worker 前被控端要等 SSH 远端
+ * 就绪(ensureRemoteReadyForSessionStart)再启动 agent,冷启动可超 30s;误超时后
+ * 被控端仍会建成 Worker,手机重试会建出第二个。预算与桌面 dispatch-ui-assignment
+ * 同为 65s,超时后手机按 Worker 列表回查,不当作失败。
* 新增合法慢通道优先登记协议契约表(桌面控制端共用),仅 mobile 特有差异放这里。
*/
export const MOBILE_INVOKE_TIMEOUT_OVERRIDES_MS: Record<string, number> = {
@@ -64,6 +68,12 @@ export const MOBILE_INVOKE_TIMEOUT_OVERRIDES_MS: Record<string, number> = {
'maker:message:delete': 30_000,
'maker:regenerate-title': 30_000,
'maker:rewind:commit': 30_000,
+ 'maker:session:disable-orca': 65_000,
+ 'maker:session:enable-orca': 65_000,
+ 'maker:worker:acknowledge-done': 65_000,
+ 'maker:worker:archive': 65_000,
+ 'maker:worker:create': 65_000,
+ 'maker:worker:switch-focus': 65_000,
'maker:send': 30_000,
'maker:usage:codex-rate-limit-reset': 30_000,
'maker:usage:codex-rate-limits': 30_000,
diff --git a/packages/maker-shared/package.json b/packages/maker-shared/package.json
index 1589f4cccf..5969ca758b 100644
--- a/packages/maker-shared/package.json
+++ b/packages/maker-shared/package.json
@@ -40,6 +40,7 @@
"./message-presentation": "./src/messagePresentation.ts",
"./message-search": "./src/messageSearch.ts",
"./message-window": "./src/messageWindow.ts",
+ "./orca-team": "./src/orcaTeam.ts",
"./mobile-home": "./src/mobileHome.ts",
"./payload-summary": "./src/payloadSummary.ts",
"./project-order-sync": "./src/projectOrderSync.ts",
diff --git a/packages/maker-shared/src/__tests__/orcaTeam.test.ts b/packages/maker-shared/src/__tests__/orcaTeam.test.ts
new file mode 100644
index 0000000000..ad9fbba99e
--- /dev/null
+++ b/packages/maker-shared/src/__tests__/orcaTeam.test.ts
@@ -0,0 +1,109 @@
+import { describe, expect, it } from 'vitest';
+import {
+ DEFAULT_ORCA_COLLABORATION_SETTINGS,
+ buildDraftWorkerInitialTask,
+ createWorkerLabel,
+ orcaWorkerSlotState,
+ parseOrcaCollaborationSettings,
+ parseOrcaTeamWorkers,
+ readOrcaCollabPolicy,
+ readOrcaTeamLeadSessionId,
+ shouldShowWorkerLabel,
+} from '../orcaTeam.js';
+
+describe('orca team shared helpers', () => {
+ it('derives unique slug labels from roles', () => {
+ expect(createWorkerLabel('Developer', [])).toBe('developer');
+ expect(createWorkerLabel('Code Reviewer!', [])).toBe('code-reviewer');
+ expect(createWorkerLabel('developer', ['developer', 'Developer-2'])).toBe('developer-3');
+ expect(createWorkerLabel(' ', [])).toBe('worker');
+ expect(createWorkerLabel('--- lead ---', [])).toBe('lead');
+ // 大量连字符也是线性处理(CodeQL:避免可回溯正则)。
+ expect(createWorkerLabel(`${'-'.repeat(50_000)}x`, [])).toBe('x');
+ expect(shouldShowWorkerLabel('developer', 'developer-2')).toBe(true);
+ expect(shouldShowWorkerLabel('developer', 'developer')).toBe(false);
+ });
+
+ it('keeps pending Lead input as context only when a Worker task exists', () => {
+ expect(buildDraftWorkerInitialTask(undefined, 'lead text')).toBeUndefined();
+ expect(buildDraftWorkerInitialTask(' review ', undefined)).toBe('review');
+ expect(buildDraftWorkerInitialTask('review', 'lead text')).toContain('Pending Lead input:\n');
+ expect(buildDraftWorkerInitialTask('review', 'lead text')?.endsWith('lead text')).toBe(true);
+ });
+
+ it('parses worker records defensively and drops rows without identity', () => {
+ const workers = parseOrcaTeamWorkers([
+ {
+ id: 'w-1',
+ sessionId: 's-1',
+ role: 'reviewer',
+ label: 'reviewer',
+ status: 'running',
+ focused: true,
+ session: { agentKind: 'codex', model: 'gpt-5.5', effort: 'high', title: 'Review' },
+ },
+ { id: 'w-2', sessionId: 's-2', status: 'weird', session: null },
+ { id: 'missing-session' },
+ 'garbage',
+ ]);
+ expect(workers).toEqual([
+ {
+ workerId: 'w-1',
+ sessionId: 's-1',
+ role: 'reviewer',
+ label: 'reviewer',
+ status: 'running',
+ focused: true,
+ agentKind: 'codex',
+ model: 'gpt-5.5',
+ effort: 'high',
+ title: 'Review',
+ },
+ {
+ workerId: 'w-2',
+ sessionId: 's-2',
+ role: 'developer',
+ label: null,
+ status: 'idle',
+ focused: false,
+ agentKind: 'claude-code',
+ model: null,
+ effort: null,
+ title: null,
+ },
+ ]);
+ expect(parseOrcaTeamWorkers(null)).toEqual([]);
+ });
+
+ it('parses collaboration settings defensively', () => {
+ expect(parseOrcaCollaborationSettings({
+ workerSoftLimit: 3,
+ workerHardLimit: 6,
+ workerIdleReleaseMinutes: 10,
+ isCustomized: true,
+ })).toEqual({ workerSoftLimit: 3, workerHardLimit: 6, workerIdleReleaseMinutes: 10 });
+ expect(parseOrcaCollaborationSettings({ workerSoftLimit: 2 }).workerHardLimit).toBe(8);
+ expect(parseOrcaCollaborationSettings('bad')).toEqual(DEFAULT_ORCA_COLLABORATION_SETTINGS);
+ });
+
+ it('counts every non-archived Worker against the soft and hard limits', () => {
+ const worker = parseOrcaTeamWorkers([{ id: 'w', sessionId: 's' }])[0]!;
+ const limits = { workerSoftLimit: 2, workerHardLimit: 3 };
+ expect(orcaWorkerSlotState([worker], limits)).toBe('ok');
+ expect(orcaWorkerSlotState([worker, worker], limits)).toBe('soft');
+ expect(orcaWorkerSlotState([worker, worker, worker], limits)).toBe('hard');
+ });
+
+ it('reads the collab policy and fails closed for dialogue on hosts that do not echo the kind', () => {
+ expect(readOrcaCollabPolicy({ effectiveEnabled: true }, 'project')).toEqual({ enabled: true, unsupported: false });
+ expect(readOrcaCollabPolicy({ effectiveEnabled: false }, 'project')).toEqual({ enabled: false, unsupported: false });
+ expect(readOrcaCollabPolicy({ effectiveEnabled: true }, 'dialogue')).toEqual({ enabled: false, unsupported: true });
+ expect(readOrcaCollabPolicy({ effectiveEnabled: true, collabWorkspaceKind: 'dialogue' }, 'dialogue'))
+ .toEqual({ enabled: true, unsupported: false });
+ });
+
+ it('reads the Lead id from a team record', () => {
+ expect(readOrcaTeamLeadSessionId({ leadSessionId: 'lead-1' })).toBe('lead-1');
+ expect(readOrcaTeamLeadSessionId(null)).toBeNull();
+ });
+});
diff --git a/packages/maker-shared/src/__tests__/queue.test.ts b/packages/maker-shared/src/__tests__/queue.test.ts
index ffd9ae5928..d7c5c8a3df 100644
--- a/packages/maker-shared/src/__tests__/queue.test.ts
+++ b/packages/maker-shared/src/__tests__/queue.test.ts
@@ -187,7 +187,8 @@ describe('shared queue presentation model', () => {
},
queueLength: 3,
});
- expect(busyOrca.actions.edit.disabledReason).toBe('协同消息由桌面端编排,手机端只读显示。');
+ expect(busyOrca.actions.edit.disabledReason).toBe('队列操作同步中,完成后再继续操作。');
+ expect(busyOrca.actions.remove.disabledReason).toBe('队列操作同步中,完成后再继续操作。');
});
it('explains steering, edit-lock, interaction-lock, and Orca row states', () => {
@@ -241,9 +242,14 @@ describe('shared queue presentation model', () => {
},
queueLength: 2,
});
+ // 对齐桌面:协同消息不能编辑或插话,但可以调整顺序和删除。
expect(orca.title).toBe('协同队列 2');
- expect(orca.hint).toBe('协同消息由桌面端编排,手机端只读显示。');
- expect(orca.actions.steer.disabledReason).toBe('协同消息由桌面端编排,手机端只读显示。');
+ expect(orca.hint).toBeNull();
+ expect(orca.actions.steer.disabledReason).toBe('协同消息不支持编辑或插话发送。');
+ expect(orca.actions.edit.disabledReason).toBe('协同消息不支持编辑或插话发送。');
+ expect(orca.actions.remove.disabled).toBe(false);
+ expect(orca.actions.moveUp.disabled).toBe(false);
+ expect(orca.actions.moveDown).toMatchObject({ disabled: true, disabledReason: '已经是队列最后一条。' });
});
it('locks edit and steer (but keeps remove and reorder) for synthetic trigger rows', () => {
diff --git a/packages/maker-shared/src/__tests__/sessionActionStrip.test.ts b/packages/maker-shared/src/__tests__/sessionActionStrip.test.ts
index 11903fe28e..fbc831e409 100644
--- a/packages/maker-shared/src/__tests__/sessionActionStrip.test.ts
+++ b/packages/maker-shared/src/__tests__/sessionActionStrip.test.ts
@@ -2,7 +2,6 @@ import { describe, expect, it } from 'vitest';
import {
buildSessionActionStrip,
sessionCollaborationLabel,
- sessionCollaborationReadOnlyReason,
sessionWorktreeInfo,
} from '../index.js';
import type { SessionActionStripSessionLike } from '../sessionActionStrip.js';
@@ -147,7 +146,6 @@ describe('shared session identity helpers', () => {
it('labels collaboration sessions and extracts worktree names across platforms', () => {
expect(sessionCollaborationLabel({ orcaRole: 'lead' })).toBe('协作 Lead');
expect(sessionCollaborationLabel({ orcaRole: 'reviewer' })).toBe('协作 reviewer');
- expect(sessionCollaborationReadOnlyReason({ orcaRole: 'worker' })).toContain('只读安全降级');
expect(sessionWorktreeInfo({ worktreePath: 'D:\\repo\\.xdt-worktrees\\feat-win\\' })).toEqual({
path: 'D:\\repo\\.xdt-worktrees\\feat-win\\',
name: 'feat-win',
diff --git a/packages/maker-shared/src/agentCapabilities.ts b/packages/maker-shared/src/agentCapabilities.ts
index c62ed3d624..619856a2a0 100644
--- a/packages/maker-shared/src/agentCapabilities.ts
+++ b/packages/maker-shared/src/agentCapabilities.ts
@@ -27,6 +27,8 @@ export interface MobileAgentCapabilities {
planModeSupported: boolean;
/** desktop host 是否支持同一会话 Claude Code / Codex pending-intent 切换;旧 host 缺省 false。 */
supportsSessionAgentSwitch?: boolean;
+ /** host 是否支持创建 Orca Worker 时显式选择 Worker 权限;旧 host 缺省 false(不得开启协同)。 */
+ supportsOrcaWorkerPermissionMode?: boolean;
/** host 是否在 set-model 内执行强制模型窗口保护;旧 host 缺省 false。 */
supportsModelWindowSwitchGuard?: boolean;
}
@@ -159,6 +161,7 @@ export function normalizeMobileAgentCapabilities(value: unknown): MobileAgentCap
planModeSupported: isRecord(value.planMode) && value.planMode.supported === true,
supportsSessionAgentSwitch: value.supportsSessionAgentSwitch === true,
supportsModelWindowSwitchGuard: value.supportsModelWindowSwitchGuard === true,
+ supportsOrcaWorkerPermissionMode: value.supportsOrcaWorkerPermissionMode === true,
};
}
diff --git a/packages/maker-shared/src/deviceLinkContract.ts b/packages/maker-shared/src/deviceLinkContract.ts
index d31751a20c..242fb7880a 100644
--- a/packages/maker-shared/src/deviceLinkContract.ts
+++ b/packages/maker-shared/src/deviceLinkContract.ts
@@ -345,6 +345,20 @@ export const MOBILE_REMOTE_INVOKE_CHANNELS = [
'maker:rewind:commit',
'maker:message:delete',
'maker:close-session',
+ // —— Orca 协同(Lead / Worker 团队真身在被控端,手机只做编排入口)——
+ // 均已在被控端 REMOTE_INVOKE_ALLOWLIST 的 Orca 段;worker-changed 推送经
+ // `session:<leadId>` topic 转发。老被控端 CHANNEL_NOT_ALLOWED → 协同入口 fail-closed
+ // 提示设备版本过旧,不放行到 enable-orca 才撞错。
+ 'maker:plugins:get-state',
+ 'maker:session:enable-orca',
+ 'maker:session:disable-orca',
+ 'maker:worker:create',
+ 'maker:worker:switch-focus',
+ 'maker:worker:acknowledge-done',
+ 'maker:worker:archive',
+ 'maker:collaboration-settings:get',
+ 'local-db:orca-workflows:list-workers-by-lead',
+ 'local-db:orca-workflows:get-by-worker-session',
'maker:schedule:list',
'maker:schedule:get',
'maker:schedule:list-templates',
diff --git a/packages/maker-shared/src/orcaTeam.ts b/packages/maker-shared/src/orcaTeam.ts
new file mode 100644
index 0000000000..d9adf99152
--- /dev/null
+++ b/packages/maker-shared/src/orcaTeam.ts
@@ -0,0 +1,218 @@
+/**
+ * Orca 协同(Lead / Worker 团队)的跨端纯逻辑:桌面「创建 Worker」面板与手机协同面板共用。
+ *
+ * 团队真身始终在被控端 main 编排;这里只放两端都要逐字一致的判据 —— Worker 标签派生、
+ * 预设角色、新建任务的首个 Worker 任务拼接,以及被控端 wire 记录的防御性解析。
+ */
+
+/** 创建 Worker 面板的预设角色(与桌面 CreateWorkerPopover 同一份)。 */
+export const ORCA_PREDEFINED_WORKER_ROLES = ['developer', 'designer', 'reviewer', 'tester', 'merger'] as const;
+
+/** 自定义角色名的长度上限(被控端 `maker:worker:create` 同口径校验)。 */
+export const ORCA_WORKER_ROLE_MAX_LENGTH = 32;
+
+export type OrcaWorkerAgentKind = 'claude-code' | 'codex' | 'pi';
+export type OrcaWorkerPermissionMode = 'auto' | 'bypassPermissions';
+export type OrcaWorkerStatus = 'idle' | 'running' | 'done' | 'error';
+
+/**
+ * 「创建 Worker」的首次默认值(没有记忆时):桌面 workerCreationPrefs 与手机同一份。
+ * 之后每次创建都记住 Agent、该 Agent 的模型 / 推理强度 / Fast 与权限,下次带出。
+ */
+export const DEFAULT_ORCA_WORKER_AGENT: OrcaWorkerAgentKind = 'codex';
+export const DEFAULT_ORCA_WORKER_EFFORT = 'high';
+export const DEFAULT_ORCA_WORKER_MODELS: Readonly<Record<OrcaWorkerAgentKind, string>> = {
+ codex: 'codex/gpt-5.5',
+ 'claude-code': 'claude-opus-4-7',
+ // 与被控端 orcaWorkerCreationService 的 pi 默认一致。
+ pi: 'claude-sonnet-4-6',
+};
+
+/**
+ * 按角色派生 Worker label(被控端要求 /^[a-z0-9_-]+$/i、≤32、团队内唯一)。
+ * 重名时追加 `-2`、`-3`…;极端情况下用时间戳后缀兜底。
+ */
+export function createWorkerLabel(role: string, existingLabels: readonly string[]): string {
+ const base = trimHyphens(
+ role
+ .trim()
+ .toLowerCase()
+ .replace(/[^a-z0-9_-]+/g, '-'),
+ ).slice(0, 24) || 'worker';
+ const existing = new Set(existingLabels.map((label) => label.toLowerCase()));
+ if (!existing.has(base)) return base;
+
+ for (let index = 2; index < 1000; index += 1) {
+ const suffix = `-${index}`;
+ const candidate = `${base.slice(0, 32 - suffix.length)}${suffix}`;
+ if (!existing.has(candidate)) return candidate;
+ }
+
+ return `${base.slice(0, 27)}-${Date.now().toString(36).slice(-4)}`;
+}
+
+/** 去掉首尾连字符(线性扫描,不用可回溯的正则)。 */
+function trimHyphens(value: string): string {
+ let start = 0;
+ let end = value.length;
+ while (start < end && value[start] === '-') start += 1;
+ while (end > start && value[end - 1] === '-') end -= 1;
+ return value.slice(start, end);
+}
+
+export function shouldShowWorkerLabel(role: string, label: string | null | undefined): label is string {
+ return typeof label === 'string' && label.length > 0 && label !== role;
+}
+
+/**
+ * New-task flows create the Worker before the Lead's first input is sent. Older controlled
+ * devices cannot defer assignment until that input is queryable, so preserve the pending text
+ * inline for that mixed-version path. New peers use the Worker-scoped Lead history bridge.
+ *
+ * pendingLeadInput is context only: without an explicit Worker task it cannot start new work.
+ */
+export function buildDraftWorkerInitialTask(
+ initialTask: string | undefined,
+ pendingLeadInput: string | undefined,
+): string | undefined {
+ const task = initialTask?.trim();
+ if (!task) return undefined;
+
+ const pending = pendingLeadInput?.trim();
+ if (!pending) return task;
+
+ return [
+ task,
+ '',
+ 'Pending Lead input:',
+ 'The Lead has not sent this input yet, so it is not available in Lead session history. Use it only as context for the Worker task above; do not treat it as a replacement task.',
+ pending,
+ ].join('\n');
+}
+
+/** 被控端 `local-db:orca-workflows:list-workers-by-lead` 单条记录的控制端投影。 */
+export interface OrcaTeamWorker {
+ workerId: string;
+ sessionId: string;
+ role: string;
+ label: string | null;
+ status: OrcaWorkerStatus;
+ focused: boolean;
+ agentKind: OrcaWorkerAgentKind;
+ model: string | null;
+ effort: string | null;
+ title: string | null;
+}
+
+/** 被控端 `maker:collaboration-settings:get` 的控制端投影。 */
+export interface OrcaCollaborationSettings {
+ workerSoftLimit: number;
+ workerHardLimit: number;
+ workerIdleReleaseMinutes: number;
+}
+
+export const DEFAULT_ORCA_COLLABORATION_SETTINGS: OrcaCollaborationSettings = {
+ workerSoftLimit: 5,
+ workerHardLimit: 8,
+ workerIdleReleaseMinutes: 0,
+};
+
+/** 没有保存过偏好时的产品默认(与桌面 workerCreationPrefs 一致):Full access。 */
+export const DEFAULT_ORCA_WORKER_PERMISSION_MODE: OrcaWorkerPermissionMode = 'bypassPermissions';
+
+function record(value: unknown): Record<string, unknown> | null {
+ return value && typeof value === 'object' && !Array.isArray(value)
+ ? value as Record<string, unknown>
+ : null;
+}
+
+function text(value: unknown): string | null {
+ return typeof value === 'string' && value.trim() ? value.trim() : null;
+}
+
+function agentKind(value: unknown): OrcaWorkerAgentKind {
+ return value === 'codex' || value === 'pi' ? value : 'claude-code';
+}
+
+function workerStatus(value: unknown): OrcaWorkerStatus {
+ return value === 'running' || value === 'done' || value === 'error' ? value : 'idle';
+}
+
+export function parseOrcaPermissionMode(value: unknown): OrcaWorkerPermissionMode | null {
+ return value === 'auto' || value === 'bypassPermissions' ? value : null;
+}
+
+/** 解析 worker 列表;缺 id / sessionId 的条目直接丢弃(不猜)。保持被控端顺序(新→旧)。 */
+export function parseOrcaTeamWorkers(value: unknown): OrcaTeamWorker[] {
+ if (!Array.isArray(value)) return [];
+ const workers: OrcaTeamWorker[] = [];
+ for (const item of value) {
+ const row = record(item);
+ const workerId = text(row?.id);
+ const sessionId = text(row?.sessionId);
+ if (!row || !workerId || !sessionId) continue;
+ const session = record(row.session);
+ workers.push({
+ workerId,
+ sessionId,
+ role: text(row.role) ?? 'developer',
+ label: text(row.label),
+ status: workerStatus(row.status),
+ focused: row.focused === true,
+ agentKind: agentKind(session?.agentKind),
+ model: text(session?.model),
+ effort: text(session?.effort),
+ title: text(session?.title),
+ });
+ }
+ return workers;
+}
+
+function positiveInt(value: unknown, fallback: number): number {
+ return typeof value === 'number' && Number.isInteger(value) && value >= 0 ? value : fallback;
+}
+
+export function parseOrcaCollaborationSettings(value: unknown): OrcaCollaborationSettings {
+ const row = record(value);
+ if (!row) return DEFAULT_ORCA_COLLABORATION_SETTINGS;
+ const defaults = DEFAULT_ORCA_COLLABORATION_SETTINGS;
+ return {
+ workerSoftLimit: positiveInt(row.workerSoftLimit, defaults.workerSoftLimit),
+ workerHardLimit: positiveInt(row.workerHardLimit, defaults.workerHardLimit),
+ workerIdleReleaseMinutes: positiveInt(row.workerIdleReleaseMinutes, defaults.workerIdleReleaseMinutes),
+ };
+}
+
+/** 团队记录里的 leadSessionId(`get-by-worker-session` / `get-by-lead` 的返回)。 */
+export function readOrcaTeamLeadSessionId(value: unknown): string | null {
+ return text(record(value)?.leadSessionId);
+}
+
+/**
+ * Worker 名额:未归档的 Worker 不论 idle / running / done / error 都占位(与被控端
+ * 硬上限判定同口径,归档的 Worker 不出现在列表里)。
+ */
+export function orcaWorkerSlotState(
+ workers: readonly OrcaTeamWorker[],
+ settings: Pick<OrcaCollaborationSettings, 'workerSoftLimit' | 'workerHardLimit'>,
+): 'ok' | 'soft' | 'hard' {
+ if (workers.length >= settings.workerHardLimit) return 'hard';
+ if (workers.length >= settings.workerSoftLimit) return 'soft';
+ return 'ok';
+}
+
+/**
+ * 被控端 `maker:plugins:get-state('collab', …)` 结果 → 入口是否可用。
+ * dialogue 会话要求被控端回显 `collabWorkspaceKind==='dialogue'`(老被控端不理解
+ * dialogue 口径,按不支持处理,与桌面控制端 useCollabProjectPolicy 一致)。
+ */
+export function readOrcaCollabPolicy(
+ value: unknown,
+ workspaceKind: 'project' | 'dialogue',
+): { enabled: boolean; unsupported: boolean } {
+ const row = record(value);
+ if (workspaceKind === 'dialogue' && row?.collabWorkspaceKind !== 'dialogue') {
+ return { enabled: false, unsupported: true };
+ }
+ return { enabled: row?.effectiveEnabled === true, unsupported: false };
+}
diff --git a/packages/maker-shared/src/queue.ts b/packages/maker-shared/src/queue.ts
index 6fffe12f74..c6c348c54f 100644
--- a/packages/maker-shared/src/queue.ts
+++ b/packages/maker-shared/src/queue.ts
@@ -131,7 +131,6 @@ export function buildQueueRowPresentation(input: {
busy: input.busy === true,
editLocked,
interactionLocked,
- orcaOrigin,
readOnlyReason: input.readOnlyReason,
steering,
}, localizer);
@@ -139,11 +138,14 @@ export function buildQueueRowPresentation(input: {
// 照常——用户可以取消一条排队中的续跑,但不能改写或抢发它的内容。
const syntheticEditReason = syntheticKind
? presentationText(localizer, 'message.queuePresentation.row.syntheticEditDisabled', '系统指令消息不支持编辑或插话发送。')
- : isAutoSentQueueItem(input.item)
- // 自动化 / 其他任务经工具排进来的消息(对齐桌面 canEdit / canSteer=false):改写后
- // 落库气泡的来源标签就不再属实;删除与排序照常。
- ? presentationText(localizer, 'message.queuePresentation.row.autoSentEditDisabled', '自动发送的消息不支持编辑或插话发送。')
- : null;
+ : orcaOrigin
+ // 协同成员发来的消息(对齐桌面 canEdit / canSteer=false):删除与排序照常。
+ ? presentationText(localizer, 'message.queuePresentation.row.orcaEditDisabled', '协同消息不支持编辑或插话发送。')
+ : isAutoSentQueueItem(input.item)
+ // 自动化 / 其他任务经工具排进来的消息(对齐桌面 canEdit / canSteer=false):改写后
+ // 落库气泡的来源标签就不再属实;删除与排序照常。
+ ? presentationText(localizer, 'message.queuePresentation.row.autoSentEditDisabled', '自动发送的消息不支持编辑或插话发送。')
+ : null;
return {
actions: {
@@ -157,7 +159,6 @@ export function buildQueueRowPresentation(input: {
hint: queueRowHint({
editLocked,
interactionLocked,
- orcaOrigin,
readOnlyReason: input.readOnlyReason,
steering,
syntheticKind,
@@ -192,7 +193,7 @@ export function isOrcaQueueItem(
return origin?.kind === 'orca';
}
-/** 自动化(scheduler)或其他任务经工具(session)排进来的消息。Orca 另有整行只读口径。 */
+/** 自动化(scheduler)或其他任务经工具(session)排进来的消息。Orca 消息另有来源标题与文案。 */
export function isAutoSentQueueItem(
item: Pick<{ origin?: unknown }, 'origin'>,
): boolean {
@@ -263,12 +264,10 @@ function queueRowBaseDisabledReason(input: {
busy: boolean;
editLocked: boolean;
interactionLocked: boolean;
- orcaOrigin: boolean;
readOnlyReason?: string | null;
steering: boolean;
}, localizer?: PresentationLocalizer): string | null {
if (input.readOnlyReason) return input.readOnlyReason;
- if (input.orcaOrigin) return presentationText(localizer, 'message.queuePresentation.row.orcaReadOnly', '协同消息由桌面端编排,手机端只读显示。');
if (input.busy) return presentationText(localizer, 'message.queuePresentation.row.busy', '队列操作同步中,完成后再继续操作。');
if (input.steering) return presentationText(localizer, 'message.queuePresentation.row.steeringDisabled', '插话正在发送到当前 turn,等待桌面端回流后再操作。');
if (input.editLocked) return presentationText(localizer, 'message.queuePresentation.row.editLocked', '这条队列消息正在编辑中,完成后再操作。');
@@ -279,13 +278,11 @@ function queueRowBaseDisabledReason(input: {
function queueRowHint(input: {
editLocked: boolean;
interactionLocked: boolean;
- orcaOrigin: boolean;
readOnlyReason?: string | null;
steering: boolean;
syntheticKind?: 'continue' | 'generic' | null;
}, localizer?: PresentationLocalizer): string | null {
if (input.readOnlyReason) return input.readOnlyReason;
- if (input.orcaOrigin) return presentationText(localizer, 'message.queuePresentation.row.orcaReadOnly', '协同消息由桌面端编排,手机端只读显示。');
if (input.syntheticKind) return presentationText(localizer, 'message.queuePresentation.row.syntheticHint', '这是系统自动生成的指令,可以取消,但不能编辑或插话发送。');
if (input.steering) return presentationText(localizer, 'message.queuePresentation.row.steeringHint', '插话正在发送到当前 turn,暂时不能编辑或移动。');
if (input.editLocked) return presentationText(localizer, 'message.queuePresentation.row.editHint', '这条消息正在编辑中,桌面端会暂停自动发送。');
diff --git a/packages/maker-shared/src/sessionIdentity.ts b/packages/maker-shared/src/sessionIdentity.ts
index 0816ce8fd7..731b35901b 100644
--- a/packages/maker-shared/src/sessionIdentity.ts
+++ b/packages/maker-shared/src/sessionIdentity.ts
@@ -26,43 +26,10 @@ export function sessionCollaborationLabel(session: SessionCollaborationLike): st
return null;
}
-export function sessionCollaborationNotice(session: SessionCollaborationLike | null): string | null {
- if (!session) return null;
- if (session.orcaRole === 'lead') {
- return '这是桌面端 Orca Lead 任务。可以在手机上继续发消息聊天;创建 worker、切换 focus、fork/rewind、队列编辑和任务设置等编排操作请在电脑端完成。';
- }
- if (session.orcaRole === 'worker') {
- return '这是桌面端 Orca Worker 任务。手机版第一版只做安全查看,暂不提供发送消息、worker focus、归档 worker 或停止协作。';
- }
- return sessionCollaborationLabel(session)
- ? '这是桌面端协作任务。手机版第一版只做安全查看,协作编排操作请先在电脑端完成。'
- : null;
-}
-
export function isCollaborationSession(session: SessionCollaborationLike | null): boolean {
return !!session && !!sessionCollaborationLabel(session);
}
-/**
- * 写编排操作的只读 reason:对所有协作任务(lead + worker + 其它角色)返回 reason,驱动 fork/rewind、
- * 队列编辑、任务设置写、pending interaction 等高风险写操作的 gating(这些操作 lead 也仍留在电脑端)。
- */
-export function sessionCollaborationReadOnlyReason(session: SessionCollaborationLike | null): string | null {
- if (!isCollaborationSession(session)) return null;
- return '协作模式手机版第一版为只读安全降级。处理确认、队列编辑和任务写操作请先在电脑端完成。';
-}
-
-/**
- * 输入框(发消息)是否只读:只对**非 lead** 的协作任务(worker / 其它角色)返回 reason;对 Lead 任务
- * 返回 null —— Lead 允许在手机上发文字消息(集中在原对话里继续聊)。普通(非协作)任务也返回 null。
- * 与 sessionCollaborationReadOnlyReason(写编排只读)区分:composer 只读 ≠ 写编排只读。
- */
-export function sessionCollaborationComposerReadOnlyReason(session: SessionCollaborationLike | null): string | null {
- if (!isCollaborationSession(session)) return null;
- if (session?.orcaRole === 'lead') return null;
- return '该协作子任务手机版为只读,发送消息请在电脑端完成。';
-}
-
export function sessionWorktreeInfo(session: SessionWorktreeLike): SessionWorktreeInfo | null {
const path = session.worktreePath?.trim();
if (!path) return null;