Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。
TypeScript agentai-agentai-assistantandroidclaude-codecodexelectroniosllmmacosreact-nativetypescriptwindows
feat(mobile): 移除自动化管理与例行任务 (#5150)
Dashdfd4b615ebc3
diff --git a/apps/mobile/README.md b/apps/mobile/README.mdindex 18d24bd740..5ea52db622 100644--- a/apps/mobile/README.md+++ b/apps/mobile/README.md@@ -69,13 +69,9 @@ The default flow covers mock login and device-list sync. Session control flows cpnpm --filter mobile test:e2e:maestro -- --flow remote_session_smoke.yamlpnpm --filter mobile test:e2e:create-sessionpnpm --filter mobile test:e2e:maestro -- --flow fork_rewind.yaml-pnpm --filter mobile test:e2e:maestro -- --flow automations.yaml-pnpm --filter mobile test:e2e:maestro -- --flow automations_create_edit.yamlpnpm --filter mobile test:e2e:maestro -- --flow file_browser.yaml```-`automations_create_edit.yaml` also touches the schedule template gallery before saving the created automation.-For local device-link smoke, use the preflight runner. It probes the local server, mock auth, device-link REST, controllable desktop presence, then runs the session flow:```bash@@ -94,7 +90,7 @@ To browse real local Cindy session/message data through the same mobile flow, uspnpm --filter mobile test:e2e:local:real-db:ios```-Use the full suite when changing remote controls, file preview, media preview, message selection, automations, or settings:+Use the full suite when changing remote controls, file preview, media preview, message selection, or settings:```bashpnpm --filter mobile test:e2e:local:full:iosdiff --git a/apps/mobile/app/automations/[deviceId].tsx b/apps/mobile/app/automations/[deviceId].tsxindex c449c0b1e5..96cf33216b 100644--- a/apps/mobile/app/automations/[deviceId].tsx+++ b/apps/mobile/app/automations/[deviceId].tsx@@ -1,2608 +1,6 @@-import { useLocalSearchParams, useRouter } from 'expo-router';-import { useCallback, useEffect, useMemo, useRef, useState } from 'react';-import { ChevronRight } from 'lucide-react-native';-import {- ActivityIndicator,- RefreshControl,- ScrollView,- StyleSheet,- View,- useWindowDimensions,-} from 'react-native';-import { Text, TextInput } from '@/components/AppText';-import { SafeAreaView } from 'react-native-safe-area-context';-import { useTranslation } from 'react-i18next';-import type { TFunction } from 'i18next';-import { mobilePresentationLocalizer } from '@/i18n/presentationLocalizer';-import { ConnectionBanner, useShowConnectionBanner } from '@/components/ConnectionBanner';-import { useUnresponsiveDevices } from '@/device-link/unresponsiveDevicesStore';-import { goBackGuarded } from '@/utils/backGuard';-import {- MainWindowActionButton,- MainWindowActionGroup,- MainWindowCardButton,- MainWindowEmptyState,- MainWindowMetric,- MainWindowOptionButton,- MainWindowRowButton,- RemoteListSyncingPlaceholder,- SummaryStrip,-} from '@/components/MobilePrimitives';-import {- SimpleStackHeader,- simpleScreenSafeAreaEdges,-} from '@/platform/chrome';-import { buildMainWindowLayout } from '@/components/mainWindowLayout';-import { useDeviceLink } from '@/device-link/DeviceLinkContext';-import { formatRemoteError } from '@/device-link/remoteStatus';-import { withTransientRemoteRetry } from '@/device-link/remoteRetry';-import { useRemoteSyncTask } from '@/device-link/remoteSyncTask';-import { useMobileMakerTransport } from '@/device-link/useMobileMakerTransport';-import {- DELETE_PREVIEW_RUN_LIMIT,- buildGeneratedSessionDispositionPatch,- buildScheduleDeletePreview,- buildScheduleDeleteTarget,- describeScheduleDeletePreview,- isProjectAutomationSchedule,- type ScheduleDeleteTarget,- type ScheduleGeneratedSessionDisposition,-} from '@/scheduler/scheduleDelete';-import {- displayRunsForMobile,- buildSchedulePauseConfirmation,- normalizeScheduleList,- normalizeScheduleRuns,- normalizeScheduleInflightCount,- sortSchedulesForMobile,- summarizeAutomationOverview,- summarizeRun,- summarizeSchedule,-} from '@/scheduler/scheduleModel';-import { shouldRefreshRunsForSchedule } from '@cindy/maker-shared/schedule-events';-import { projectDraftSessionTitle } from '@cindy/maker-shared/session-title';-import {- applyMobileTemplateParams,- applyScheduleWireCompat,- ScheduleModelSelectionUnsupportedError,- SchedulePreRunHookUnsupportedError,- applyTemplateToMobileScheduleDraft,- buildMobileScheduleInput,- createMobileScheduleDraft,- createTemplateParamDefaults,- deriveMobileScheduleSessionMode,- hasMobileScheduleRealBinding,- localizeScheduleDraftValidation,- localizeTemplateParamValidation,- MOBILE_SCHEDULE_PENDING_SESSION_ID,- resolveMobileScheduleBinding,- updateDraftAgentKind,- updateDraftBoundSessionId,- updateDraftCronExpr,- updateDraftIntervalMinutes,- updateDraftRunMode,- updateDraftTimezone,- updateDraftSessionMode,- updateDraftWorkspaceKind,- validateTemplateParamValues,- validateMobileScheduleDraft,- type MobileScheduleDraft,- type ScheduleDraftValidation,- type TemplateParamValidation,-} from '@/scheduler/scheduleFormModel';-import { useRemoteScheduleEventSnapshot } from '@/scheduler/remoteScheduleEvents';-import { formatScheduleInterval } from '@/scheduler/scheduleIntervalLabel';-import {- buildMobileTemplateOverrides,- isLocalizedBuiltinTemplate,-} from '@/scheduler/scheduleTemplateLocalization';-import type {- RemoteSchedule,- RemoteScheduleRun,- RemoteScheduleTemplate,- RemoteTemplateParameter,-} from '@/scheduler/types';-import { remoteSessionStore, useRemoteSessions } from '@/session/remoteSessionStore';-import { shouldSuppressRemoteListEmptyState } from '@/session/sessionEmptyState';-import type { RemoteSession } from '@/session/types';-import { mobileAgentLabelFromUnknown } from '@/session/sessionAgentSwitch';-import { fontWeight, lineHeight, useTheme, useThemedStyles, type ThemeColors } from '@/theme';-import { iconSize, iconStroke, radius, spacing, typeScale } from '@/theme/tokens';+import { Redirect } from 'expo-router';-const RUN_LIMIT = 50;--interface DeleteScheduleState {- schedule: RemoteSchedule;- target: ScheduleDeleteTarget;- disposition: ScheduleGeneratedSessionDisposition;- sessionIds: string[] | null;- inflightCount: number | null;- loading: boolean;- error: string | null;-}--interface PauseScheduleState {- schedule: RemoteSchedule;- inflightCount: number;- error: string | null;-}--interface DeleteRunState {- run: RemoteScheduleRun;- error: string | null;-}--export default function AutomationsScreen() {- const styles = useThemedStyles(makeStyles);- const { colors } = useTheme();- const { t } = useTranslation();- const params = useLocalSearchParams<{ deviceId: string; name?: string }>();- const deviceId = String(params.deviceId ?? '');- const deviceName = String(params.name ?? deviceId);- const router = useRouter();- const { width: screenWidth } = useWindowDimensions();- const { connectionIssue, openLink, status, subscribe, unsubscribe } = useDeviceLink();- // 熔断 open(电脑端未响应):relay 可能仍 online,banner 文案单独入参。- const unresponsiveDevices = useUnresponsiveDevices();- const deviceUnresponsive = !!deviceId && unresponsiveDevices.has(deviceId);- const maker = useMobileMakerTransport(deviceId);- const scheduleEventSnapshot = useRemoteScheduleEventSnapshot(deviceId);- const remoteSessions = useRemoteSessions();- const [schedules, setSchedules] = useState<RemoteSchedule[]>([]);- const [selectedId, setSelectedId] = useState<string | null>(null);- const [runsBySchedule, setRunsBySchedule] = useState<Map<string, RemoteScheduleRun[]>>(- () => new Map(),- );- const [loading, setLoading] = useState(false);- const [runsLoading, setRunsLoading] = useState(false);- const [busyAction, setBusyAction] = useState<string | null>(null);- const [openingRunId, setOpeningRunId] = useState<string | null>(null);- const [error, setError] = useState<string | null>(null);- const [lastSyncedAt, setLastSyncedAt] = useState<number | null>(null);- const [formMode, setFormMode] = useState<'create' | 'edit' | null>(null);- const [formDraft, setFormDraft] = useState<MobileScheduleDraft | null>(null);- const [supportsSchedulePreRunHook, setSupportsSchedulePreRunHook] = useState(false);- const [formScheduleId, setFormScheduleId] = useState<string | null>(null);- const [formError, setFormError] = useState<- string | ScheduleDraftValidation | TemplateParamValidation | null- >(null);- const [templates, setTemplates] = useState<RemoteScheduleTemplate[]>([]);- const [templatesLoading, setTemplatesLoading] = useState(false);- const [templateError, setTemplateError] = useState<string | null>(null);- const [selectedTemplate, setSelectedTemplate] = useState<RemoteScheduleTemplate | null>(null);- const [templateParamValues, setTemplateParamValues] = useState<Record<string, string>>({});- const [templatePromptDirty, setTemplatePromptDirty] = useState(false);- const [deleteState, setDeleteState] = useState<DeleteScheduleState | null>(null);- const [pauseState, setPauseState] = useState<PauseScheduleState | null>(null);- const [deleteRunState, setDeleteRunState] = useState<DeleteRunState | null>(null);-- const selectedSchedule = useMemo(- () => schedules.find((item) => item.id === selectedId) ?? schedules[0] ?? null,- [schedules, selectedId],- );- const selectedScheduleId = selectedSchedule?.id ?? null;- const selectedRuns = selectedSchedule ? (runsBySchedule.get(selectedSchedule.id) ?? []) : [];- const displayedRuns = useMemo(() => displayRunsForMobile(selectedRuns), [selectedRuns]);- const overview = useMemo(- () => summarizeAutomationOverview(schedules, runsBySchedule),- [runsBySchedule, schedules],- );- const selectedTemplatePresentation = useMemo(- () => selectedTemplate- ? localizeBuiltinTemplate(- templates.find((template) => template.id === selectedTemplate.id) ?? selectedTemplate,- t,- )- : null,- [selectedTemplate, t, templates],- );- const formErrorText = typeof formError === 'string'- ? formError- : formError- ? 'parameterKey' in formError && selectedTemplatePresentation- ? localizeTemplateParamValidation(- formError,- selectedTemplatePresentation,- mobilePresentationLocalizer,- )- : localizeScheduleDraftValidation(formError, mobilePresentationLocalizer)- : null;- const bindableSessions = useMemo(- () => selectBindableSessions(remoteSessions, deviceId),- [deviceId, remoteSessions],- );- const windowLayout = buildMainWindowLayout({- actionCount: 1,- kind: 'detail',- metricCount: 3,- screenWidth,- });-- const syncSchedules = useCallback(async () => {- if (!deviceId) return;- setLoading(true);- setError(null);- try {- const list = await withTransientRemoteRetry(async () => {- await openLink(deviceId);- await subscribe(`automations:${deviceId}`, deviceId, ['sessions']);- return maker.schedule.list();- });- const next = sortSchedulesForMobile(normalizeScheduleList(list));- setSchedules(next);- setSelectedId((prev) => {- if (prev && next.some((item) => item.id === prev)) return prev;- return next[0]?.id ?? null;- });- setLastSyncedAt(Date.now());- } catch (err) {- setError(formatRemoteError(err));- } finally {- setLoading(false);- }- }, [deviceId, maker, openLink, subscribe]);- const loadSchedules = useRemoteSyncTask(syncSchedules);-- const syncRuns = useCallback(async (scheduleId: string, options: { markRead?: boolean } = {}) => {- if (!deviceId || !scheduleId) return;- setRunsLoading(true);- setError(null);- try {- const list = await withTransientRemoteRetry(async () => {- await openLink(deviceId);- await subscribe(`automations:${deviceId}`, deviceId, ['sessions']);- return maker.schedule.listRuns(scheduleId, RUN_LIMIT);- });- const normalized = normalizeScheduleRuns(list);- let nextRuns = normalized;- if (options.markRead !== false) {- await maker.schedule.markScheduleRunsRead(scheduleId).catch(() => undefined);- nextRuns = markRunsReadLocally(normalized);- }- setRunsBySchedule((prev) => {- const next = new Map(prev);- next.set(scheduleId, nextRuns);- return next;- });- setLastSyncedAt(Date.now());- } catch (err) {- setError(formatRemoteError(err));- } finally {- setRunsLoading(false);- }- }, [deviceId, maker, openLink, subscribe]);-- useEffect(() => {- void loadSchedules();- return () => {- // Only drop our subscription. The device link is a shared resource (Home / session screens- // rely on it); closing it here tore it down out from under them. It's reaped on- // presence-offline / disconnect instead.- void unsubscribe(`automations:${deviceId}`, deviceId, ['sessions']).catch(() => undefined);- };- }, [deviceId, loadSchedules, unsubscribe]);-- useEffect(() => {- if (status === 'online') void loadSchedules();- }, [loadSchedules, status]);-- useEffect(() => {- if (selectedScheduleId) void syncRuns(selectedScheduleId);- }, [selectedScheduleId, syncRuns]);-- // 熔断恢复重载(review P1):首载撞上熔断快速失败时,探测成功关熔断不会重跑- // 本页加载(rehydrate 只回填 remoteSessionStore,不管本页的 schedules /- // runsBySchedule),列表会一直空/陈旧到手动同步或无关调度事件。只在- // open→closed 的翻转沿触发,平时零开销。- const prevDeviceUnresponsiveRef = useRef(deviceUnresponsive);- useEffect(() => {- const was = prevDeviceUnresponsiveRef.current;- prevDeviceUnresponsiveRef.current = deviceUnresponsive;- if (!was || deviceUnresponsive) return;- void loadSchedules();- if (selectedScheduleId) void syncRuns(selectedScheduleId);- }, [deviceUnresponsive, loadSchedules, selectedScheduleId, syncRuns]);-- useEffect(() => {- if (scheduleEventSnapshot.scheduleListVersion === 0) return;- void loadSchedules();- }, [loadSchedules, scheduleEventSnapshot.scheduleListVersion]);-- useEffect(() => {- if (scheduleEventSnapshot.runsVersion === 0 || !selectedScheduleId) return;- const intent = scheduleEventSnapshot.lastProjection?.refresh.runRefresh ?? { mode: 'all' };- if (shouldRefreshRunsForSchedule(intent, selectedScheduleId)) {- void syncRuns(selectedScheduleId);- }- }, [- scheduleEventSnapshot.lastProjection,- scheduleEventSnapshot.runsVersion,- selectedScheduleId,- syncRuns,- ]);-- const refreshAll = useCallback(async () => {- await loadSchedules();- if (selectedSchedule) await syncRuns(selectedSchedule.id);- }, [loadSchedules, selectedSchedule, syncRuns]);-- const loadTemplates = useCallback(async () => {- if (!deviceId) return;- setTemplatesLoading(true);- setTemplateError(null);- try {- const list = await withTransientRemoteRetry(async () => {- await openLink(deviceId);- await subscribe(`automations:${deviceId}`, deviceId, ['sessions']);- return maker.schedule.listTemplates();- });- setTemplates(sortTemplatesForMobile(list));- } catch (err) {- setTemplateError(formatRemoteError(err));- } finally {- setTemplatesLoading(false);- }- }, [deviceId, maker, openLink, subscribe]);-- const startCreateSchedule = useCallback(() => {- setSupportsSchedulePreRunHook(false);- setFormMode('create');- setFormScheduleId(null);- setFormError(null);- setSelectedTemplate(null);- setTemplateParamValues({});- setTemplatePromptDirty(false);- setFormDraft(createMobileScheduleDraft(null, {- fallbackWorkingDir: selectedSchedule?.workingDir ?? null,- }));- void loadTemplates();- }, [loadTemplates, selectedSchedule]);-- const startEditSchedule = useCallback((schedule: RemoteSchedule) => {- setSupportsSchedulePreRunHook(false);- setFormMode('edit');- setFormScheduleId(schedule.id);- setFormError(null);- setSelectedTemplate(null);- setTemplateParamValues({});- setTemplatePromptDirty(false);- setFormDraft(createMobileScheduleDraft(schedule));- }, []);-- const closeScheduleForm = useCallback(() => {- setSupportsSchedulePreRunHook(false);- setFormMode(null);- setFormScheduleId(null);- setFormDraft(null);- setFormError(null);- setSelectedTemplate(null);- setTemplateParamValues({});- setTemplatePromptDirty(false);- }, []);-- useEffect(() => {- if (!formDraft) return;- let active = true;- void maker.getCapabilities(formDraft.agentKind)- .then((raw) => {- const caps = raw as { supportsSchedulePreRunHook?: boolean } | null;- if (active) setSupportsSchedulePreRunHook(caps?.supportsSchedulePreRunHook === true);- })- .catch(() => {- if (active) setSupportsSchedulePreRunHook(false);- });- return () => { active = false; };- }, [formDraft?.agentKind, formMode, maker]);-- const selectTemplate = useCallback((template: RemoteScheduleTemplate) => {- const defaults = createTemplateParamDefaults(template);- setSelectedTemplate(template);- setTemplateParamValues(defaults);- setTemplatePromptDirty(false);- setFormError(null);- setFormDraft((prev) => {- const base = prev ?? createMobileScheduleDraft(null, {- fallbackWorkingDir: selectedSchedule?.workingDir ?? null,- });- try {- return applyTemplateToMobileScheduleDraft(base, template, defaults);- } catch {- return {- ...applyTemplateToMobileScheduleDraft(base, { ...template, prompt: '' }, defaults),- prompt: template.prompt ?? '',- };- }- });- }, [selectedSchedule]);-- const updateTemplateParam = useCallback((key: string, value: string) => {- const nextValues = { ...templateParamValues, [key]: value };- setTemplateParamValues(nextValues);- if (!selectedTemplate || templatePromptDirty) return;- setFormDraft((prev) => {- if (!prev) return prev;- try {- return {- ...prev,- prompt: applyMobileTemplateParams(- selectedTemplate.prompt ?? '',- nextValues,- selectedTemplate.parameters,- ),- };- } catch {- return prev;- }- });- }, [selectedTemplate, templateParamValues, templatePromptDirty]);-- const submitScheduleForm = useCallback(async () => {- if (!formDraft || busyAction) return;- const validation = validateMobileScheduleDraft(formDraft, mobilePresentationLocalizer);- if (validation) {- setFormError(validation);- return;- }- if (formMode === 'create' && selectedTemplate && !templatePromptDirty) {- const paramError = validateTemplateParamValues(- selectedTemplate,- templateParamValues,- mobilePresentationLocalizer,- );- if (paramError) {- setFormError(paramError);- return;- }- }- const actionKey = formMode === 'edit' ? `edit:${formScheduleId}` : 'create';- setBusyAction(actionKey);- setError(null);- setFormError(null);- try {- // Retry only the idempotent connection setup. update() is keyed by id so it is also safe to- // retry, but create()/createFromTemplate() run exactly once: a transient retry after the- // desktop already persisted the schedule (invoke result lost) would create a duplicate.- await withTransientRemoteRetry(async () => {- await openLink(deviceId);- await subscribe(`automations:${deviceId}`, deviceId, ['sessions']);- });- const resolvedDraft = await resolveMobileScheduleBinding(formDraft, async (id) =>- await maker.getSession(id) as RemoteSession);- const input = buildMobileScheduleInput(resolvedDraft);- // Negotiate on every save, including numeric intervals and template creation.- // Unknown/old hosts must not silently accept an unsupported bound selection.- const caps = await maker.getCapabilities(resolvedDraft.agentKind).catch(() => null) as {- supportsScheduleIntervalNullClear?: boolean;- supportsScheduleModelSelection?: boolean;- supportsSchedulePreRunHook?: boolean;- } | null;- const supportsModelSelection = caps?.supportsScheduleModelSelection === true;- const wireInput = applyScheduleWireCompat(input, {- supportsIntervalNullClear: caps?.supportsScheduleIntervalNullClear === true,- supportsModelSelection,- supportsPreRunHook: caps?.supportsSchedulePreRunHook === true,- });- const saved = await (async () => {- if (formMode === 'edit' && formScheduleId) {- return withTransientRemoteRetry(() => maker.schedule.update(formScheduleId, wireInput));- }- if (selectedTemplate && !templatePromptDirty && supportsModelSelection) {- return maker.schedule.createFromTemplate({- templateId: selectedTemplate.id,- paramValues: templateParamValues,- overrides: buildMobileTemplateOverrides(wireInput, selectedTemplate),- });- }- return maker.schedule.create(wireInput);- })();- closeScheduleForm();- if (saved?.id) {- setSelectedId(saved.id);- setSchedules((prev) => sortSchedulesForMobile([- ...prev.filter((item) => item.id !== saved.id),- saved,- ]));- await syncRuns(saved.id, { markRead: false }).catch(() => undefined);- }- await loadSchedules().catch(() => undefined);- } catch (err) {- setFormError(err instanceof ScheduleModelSelectionUnsupportedError || err instanceof SchedulePreRunHookUnsupportedError- ? t('deviceLink.remoteError.channelNotAllowed') : formatRemoteError(err));- } finally {- setBusyAction(null);- }- }, [- busyAction,- closeScheduleForm,- deviceId,- formDraft,- formMode,- formScheduleId,- loadSchedules,- maker,- openLink,- selectedTemplate,- subscribe,- syncRuns,- templateParamValues,- templatePromptDirty,- t,- ]);-- const runScheduleAction = useCallback(async (- actionKey: string,- schedule: RemoteSchedule,- action: () => Promise<void | RemoteSchedule>,- ) => {- if (busyAction) return;- setBusyAction(actionKey);- setError(null);- try {- const updated = await action();- if (updated && typeof updated === 'object') {- setSchedules((prev) => sortSchedulesForMobile(prev.map((item) =>- item.id === schedule.id ? { ...item, ...updated } : item,- )));- }- // Best-effort post-success refresh: the action already succeeded, so a resync blip must- // not surface as if the action itself failed.- await syncRuns(schedule.id, { markRead: false }).catch(() => undefined);- await loadSchedules().catch(() => undefined);- } catch (err) {- setError(formatRemoteError(err));- } finally {- setBusyAction(null);- }- }, [busyAction, loadSchedules, syncRuns]);-- const pauseScheduleNow = useCallback(async (schedule: RemoteSchedule) => {- setBusyAction(`pause:${schedule.id}`);- setError(null);- try {- const updated = await withTransientRemoteRetry(async () => {- await openLink(deviceId);- await subscribe(`automations:${deviceId}`, deviceId, ['sessions']);- return maker.schedule.pause(schedule.id);- });- setSchedules((prev) => sortSchedulesForMobile(prev.map((item) =>- item.id === schedule.id ? { ...item, ...updated } : item,- )));- setPauseState(null);- await syncRuns(schedule.id, { markRead: false }).catch(() => undefined);- await loadSchedules().catch(() => undefined);- } catch (err) {- const message = formatRemoteError(err);- setPauseState((prev) => (- prev && prev.schedule.id === schedule.id ? { ...prev, error: message } : prev- ));- setError(message);- } finally {- setBusyAction(null);- }- }, [deviceId, loadSchedules, maker, openLink, subscribe, syncRuns]);-- const requestPauseSchedule = useCallback((schedule: RemoteSchedule) => {- if (busyAction || schedule.status === 'paused' || schedule.status === 'expired') return;- setBusyAction(`pause-check:${schedule.id}`);- setError(null);- setPauseState(null);- void (async () => {- try {- const inflightCount = await withTransientRemoteRetry(async () => {- await openLink(deviceId);- await subscribe(`automations:${deviceId}`, deviceId, ['sessions']);- return maker.schedule.getInflightCount(schedule.id).catch(() => 0);- });- const count = normalizeScheduleInflightCount(inflightCount);- if (count > 0) {- setPauseState({ schedule, inflightCount: count, error: null });- return;- }- await pauseScheduleNow(schedule);- } catch (err) {- setError(formatRemoteError(err));- } finally {- setBusyAction((current) => (current === `pause-check:${schedule.id}` ? null : current));- }- })();- }, [busyAction, deviceId, maker, openLink, pauseScheduleNow, subscribe]);-- const runDeleteSchedule = useCallback(async (schedule: RemoteSchedule) => {- if (busyAction || !deleteState) return;- setBusyAction(`delete:${schedule.id}`);- setError(null);- const target = deleteState.target;- const disposition = deleteState.disposition;- const sessionIds = deleteState.sessionIds ?? [];- const failedSessionIds: string[] = [];- try {- if (target.source === 'project') {- if (!isProjectAutomationSchedule(target)) {- throw new Error(t('devices.automations.error.projectMissingConfig'));- }- await maker.projectAutomation.removeSchedule({- workingDir: target.workingDir!,- id: target.projectConfigId!,- });- } else {- await maker.schedule.delete(schedule.id);- }- const patch = buildGeneratedSessionDispositionPatch(disposition);- if (patch) {- for (const sessionId of sessionIds) {- try {- await maker.patchSessionMeta(sessionId, patch);- remoteSessionStore.applySessionPatch(deviceId, sessionId, patch);- } catch {- failedSessionIds.push(sessionId);- }- }- }- setRunsBySchedule((prev) => {- const next = new Map(prev);- next.delete(schedule.id);- return next;- });- setSchedules((prev) => sortSchedulesForMobile(prev.filter((item) => item.id !== schedule.id)));- setSelectedId((prev) => (prev === schedule.id ? null : prev));- setDeleteState(null);- if (failedSessionIds.length > 0) {- setError(t('devices.automations.error.deletePartial', { count: failedSessionIds.length }));- }- await loadSchedules();- } catch (err) {- setError(formatRemoteError(err));- } finally {- setBusyAction(null);- }- }, [busyAction, deleteState, deviceId, loadSchedules, maker, t]);-- const requestDeleteSchedule = useCallback((schedule: RemoteSchedule) => {- if (busyAction) return;- const target = buildScheduleDeleteTarget(schedule);- // 透传 schedule.targetSessionId 作为 excludeSessionId —— 手绑的用户既有会话必须- // 从预览/处置集合里排除,否则 runDeleteSchedule 的 patchSessionMeta 会误软删它- // (与桌面端收集层 isAutomationGeneratedSession 首选 + targetSessionId 保底同口径)。- const cachedPreview = buildScheduleDeletePreview(- runsBySchedule.get(schedule.id) ?? [],- 0,- [],- schedule.targetSessionId,- );- setDeleteState({- schedule,- target,- disposition: 'keep',- sessionIds: cachedPreview.sessionIds,- inflightCount: null,- loading: true,- error: null,- });- void (async () => {- try {- const [runs, inflight] = await withTransientRemoteRetry(async () => {- await openLink(deviceId);- await subscribe(`automations:${deviceId}`, deviceId, ['sessions']);- return Promise.all([- maker.schedule.listRuns(schedule.id, DELETE_PREVIEW_RUN_LIMIT),- maker.schedule.getInflightCount(schedule.id).catch(() => 0),- ]);- });- const preview = buildScheduleDeletePreview(- normalizeScheduleRuns(runs),- inflight,- [],- schedule.targetSessionId,- );- setDeleteState((prev) => {- if (!prev || prev.schedule.id !== schedule.id) return prev;- return {- ...prev,- sessionIds: preview.sessionIds,- inflightCount: preview.inflightCount,- loading: false,- error: null,- };- });- } catch (err) {- setDeleteState((prev) => {- if (!prev || prev.schedule.id !== schedule.id) return prev;- return {- ...prev,- inflightCount: cachedPreview.inflightCount,- loading: false,- error: formatRemoteError(err),- };- });- }- })();- }, [busyAction, deviceId, maker, openLink, runsBySchedule, subscribe]);-- const openRunSession = useCallback(async (run: RemoteScheduleRun) => {- if (!run.sessionId || openingRunId) return;- setOpeningRunId(run.id);- setError(null);- try {- const session = await maker.getSession(run.sessionId) as RemoteSession;- remoteSessionStore.upsertDeviceSession(deviceId, deviceName, session);- await maker.schedule.markRunRead(run.id).catch(() => undefined);- setRunsBySchedule((prev) => {- const next = new Map(prev);- next.set(run.scheduleId, markRunReadLocally(prev.get(run.scheduleId) ?? [], run.id));- return next;- });- router.push({- pathname: '/sessions/[sessionId]',- params: { sessionId: run.sessionId, deviceId, deviceName },- });- } catch (err) {- setError(formatRemoteError(err));- } finally {- setOpeningRunId(null);- }- }, [deviceId, deviceName, maker, openingRunId, router]);-- const markSingleRunRead = useCallback(async (run: RemoteScheduleRun) => {- if (busyAction) return;- const key = `run-read:${run.id}`;- setBusyAction(key);- setError(null);- try {- await withTransientRemoteRetry(async () => {- await openLink(deviceId);- await subscribe(`automations:${deviceId}`, deviceId, ['sessions']);- return maker.schedule.markRunRead(run.id);- });- setRunsBySchedule((prev) => {- const next = new Map(prev);- next.set(run.scheduleId, markRunReadLocally(prev.get(run.scheduleId) ?? [], run.id));- return next;- });- } catch (err) {- setError(formatRemoteError(err));- } finally {- setBusyAction((current) => (current === key ? null : current));- }- }, [busyAction, deviceId, maker, openLink, subscribe]);-- const restartRun = useCallback(async (run: RemoteScheduleRun) => {- if (busyAction) return;- const key = `run-restart:${run.id}`;- setBusyAction(key);- setError(null);- try {- // runNow is non-idempotent (each call fires a run), so it must not be inside the retry —- // retry only the link/subscribe setup; runNow runs exactly once.- await withTransientRemoteRetry(async () => {- await openLink(deviceId);- await subscribe(`automations:${deviceId}`, deviceId, ['sessions']);- });- await maker.schedule.runNow(run.scheduleId);- await syncRuns(run.scheduleId, { markRead: false }).catch(() => undefined);- await loadSchedules().catch(() => undefined);- } catch (err) {- setError(formatRemoteError(err));- } finally {- setBusyAction((current) => (current === key ? null : current));- }- }, [busyAction, deviceId, loadSchedules, maker, openLink, subscribe, syncRuns]);-- const requestDeleteRun = useCallback((run: RemoteScheduleRun) => {- if (busyAction || run.status === 'running') return;- setDeleteRunState({ run, error: null });- }, [busyAction]);-- const deleteRunNow = useCallback(async (run: RemoteScheduleRun) => {- if (busyAction) return;- const key = `run-delete:${run.id}`;- setBusyAction(key);- setError(null);- try {- // deleteRun runs exactly once: retry only the idempotent link/subscribe setup. A transient- // retry after the desktop already deleted the run (but the invoke result was lost) would- // re-send deleteRun, which the scheduler rejects as "run not found" → a false failure.- await withTransientRemoteRetry(async () => {- await openLink(deviceId);- await subscribe(`automations:${deviceId}`, deviceId, ['sessions']);- });- await maker.schedule.deleteRun(run.id);- setRunsBySchedule((prev) => {- const next = new Map(prev);- next.set(run.scheduleId, (prev.get(run.scheduleId) ?? []).filter((item) => item.id !== run.id));- return next;- });- setDeleteRunState(null);- await syncRuns(run.scheduleId, { markRead: false }).catch(() => undefined);- } catch (err) {- const message = formatRemoteError(err);- setDeleteRunState((prev) => (- prev && prev.run.id === run.id ? { ...prev, error: message } : prev- ));- setError(message);- } finally {- setBusyAction((current) => (current === key ? null : current));- }- }, [busyAction, deviceId, maker, openLink, subscribe, syncRuns]);-- const showConnectionBanner = useShowConnectionBanner(status, error, connectionIssue, deviceUnresponsive);- return (- <SafeAreaView edges={simpleScreenSafeAreaEdges()} style={styles.safeArea} testID="automations.screen">- <SimpleStackHeader- syncing={!showConnectionBanner && (loading || runsLoading || status === 'connecting')}- action={{- label: t('devices.common.create'),- onPress: busyAction ? undefined : startCreateSchedule,- testID: 'automations.createButton',- }}- backTestID="automations.backButton"- onBack={() => goBackGuarded(router)}- title={deviceName}- titleTestID="automations.title"- />-- <ConnectionBanner- deviceUnresponsive={deviceUnresponsive}- error={error}- issue={connectionIssue}- lastSyncedAt={lastSyncedAt}- loading={loading || runsLoading}- onSync={() => void refreshAll()}- status={status}- />-- <SummaryStrip- style={{- gap: windowLayout.summaryGap,- paddingHorizontal: windowLayout.contentPaddingHorizontal,- paddingVertical: windowLayout.contentPaddingVertical,- }}- testID="automations.summary"- >- <View style={[styles.summaryTopRow, { gap: windowLayout.metricGap }]}>- <MainWindowMetric- label={t('devices.automations.metric.running')}- style={{ minHeight: windowLayout.metricMinHeight, minWidth: windowLayout.metricMinWidth }}- value={overview.activeCount}- valueSize="large"- />- <MainWindowMetric- label={t('devices.automations.metric.unreadResults')}- style={{ minHeight: windowLayout.metricMinHeight, minWidth: windowLayout.metricMinWidth }}- urgent={overview.unreadRunCount > 0}- value={overview.unreadRunCount}- valueSize="large"- />- <MainWindowMetric- label={t('devices.automations.metric.executing')}- style={{ minHeight: windowLayout.metricMinHeight, minWidth: windowLayout.metricMinWidth }}- urgent={overview.runningRunCount > 0}- value={overview.runningRunCount}- valueSize="large"- />- </View>- <Text style={styles.summaryCopy} numberOfLines={2}>- {overview.pausedCount > 0- ? t('devices.automations.summary.paused', { count: overview.pausedCount })- : t('devices.automations.summary.default')}- </Text>- </SummaryStrip>-- <ScrollView- refreshControl={<RefreshControl refreshing={loading || runsLoading} onRefresh={refreshAll} />}- contentContainerStyle={[- styles.content,- {- gap: windowLayout.contentGap,- paddingHorizontal: windowLayout.contentPaddingHorizontal,- paddingVertical: windowLayout.contentPaddingVertical,- },- ]}- testID="automations.scroll"- >- {formDraft && (- <ScheduleFormCard- busy={busyAction === 'create' || busyAction === `edit:${formScheduleId}`}- draft={formDraft}- error={formErrorText}- mode={formMode ?? 'create'}- onCancel={closeScheduleForm}- onChange={setFormDraft}- onPromptChange={(value) => {- setTemplatePromptDirty(!!selectedTemplate);- setFormDraft((prev) => (prev ? { ...prev, prompt: value } : prev));- }}- onReloadTemplates={() => void loadTemplates()}- onSubmit={() => void submitScheduleForm()}- onSelectTemplate={selectTemplate}- onTemplateParamChange={updateTemplateParam}- selectedTemplateId={selectedTemplate?.id ?? null}- templateError={templateError}- templateParamValues={templateParamValues}- templates={templates}- templatesLoading={templatesLoading}- sessions={bindableSessions}- supportsPreRunHook={supportsSchedulePreRunHook}- />- )}-- {deleteState ? (- <ScheduleDeleteCard- busy={busyAction === `delete:${deleteState.schedule.id}`}- state={deleteState}- onCancel={() => setDeleteState(null)}- onConfirm={() => void runDeleteSchedule(deleteState.schedule)}- onDispositionChange={(disposition) => {- setDeleteState((prev) => (prev ? { ...prev, disposition } : prev));- }}- />- ) : null}-- {pauseState ? (- <SchedulePauseCard- busy={busyAction === `pause:${pauseState.schedule.id}`}- state={pauseState}- onCancel={() => setPauseState(null)}- onConfirm={() => void pauseScheduleNow(pauseState.schedule)}- />- ) : null}-- {deleteRunState ? (- <RunDeleteCard- busy={busyAction === `run-delete:${deleteRunState.run.id}`}- state={deleteRunState}- onCancel={() => setDeleteRunState(null)}- onConfirm={() => void deleteRunNow(deleteRunState.run)}- />- ) : null}-- {schedules.length === 0 ? (- // 首同步完成前(lastSyncedAt === null)抑制"暂无自动化"空状态,避免冷进先闪空态再跳成真列表- // (规则 7:不闪空白/不跳变)。同步失败时 ConnectionBanner 已有错误 + 重试入口,同样不谎报"暂无"。- // 抑制期渲染 RemoteListSyncingPlaceholder(800ms 内空白,超时浮现「正在同步」),慢链路下不再无限期纯白。- shouldSuppressRemoteListEmptyState({- itemCount: schedules.length,- hasSyncedThisOpen: lastSyncedAt !== null,- }) ? (- <RemoteListSyncingPlaceholder testID="automations.syncing" />- ) : (- <MainWindowEmptyState- copy={t('devices.automations.empty.copy')}- style={{- minHeight: windowLayout.emptyMinHeight,- padding: windowLayout.emptyPadding,- }}- testID="automations.empty"- title={t('devices.automations.empty.title')}- >- <MainWindowActionGroup- primaryActions={[- {- accessibilityLabel: t('devices.automations.createAutomation'),- disabled: !!busyAction,- label: t('devices.automations.createAutomation'),- onPress: startCreateSchedule,- testID: 'automations.emptyCreateButton',- tone: 'primary',- },- ]}- testID="automations.emptyActions"- />- </MainWindowEmptyState>- )- ) : (- <>- <View style={styles.scheduleList} testID="automations.scheduleList">- {schedules.map((schedule) => (- <ScheduleRow- key={schedule.id}- runs={runsBySchedule.get(schedule.id) ?? []}- schedule={schedule}- selected={schedule.id === selectedSchedule?.id}- onPress={() => setSelectedId(schedule.id)}- />- ))}- </View>-- {selectedSchedule && (- <View style={styles.detail} testID="automations.detail">- <ScheduleDetail- busyAction={busyAction}- onPause={() => requestPauseSchedule(selectedSchedule)}- onResume={() => void runScheduleAction(- `resume:${selectedSchedule.id}`,- selectedSchedule,- () => maker.schedule.resume(selectedSchedule.id),- )}- onRunNow={() => void runScheduleAction(- `run:${selectedSchedule.id}`,- selectedSchedule,- () => maker.schedule.runNow(selectedSchedule.id),- )}- onEdit={() => startEditSchedule(selectedSchedule)}- onDelete={() => requestDeleteSchedule(selectedSchedule)}- runs={displayedRuns}- runsLoading={runsLoading}- schedule={selectedSchedule}- />-- <View style={styles.runsHeader}>- <Text style={styles.sectionTitle}>{t('devices.automations.recentRuns')}</Text>- {runsLoading ? <ActivityIndicator color={colors.textSecondary} /> : null}- </View>- {displayedRuns.length === 0 ? (- <MainWindowEmptyState- copy={t('devices.automations.runs.emptyCopy', {- runNow: t('devices.automations.runNow'),- })}- style={styles.emptyInline}- title={t('devices.automations.runs.emptyTitle')}- />- ) : (- <View style={styles.runList} testID="automations.runList">- {displayedRuns.map((run) => (- <RunRow- busyAction={busyAction}- key={run.id}- opening={openingRunId === run.id}- onDelete={() => requestDeleteRun(run)}- onMarkRead={() => void markSingleRunRead(run)}- onOpenSession={() => void openRunSession(run)}- onRestart={() => void restartRun(run)}- run={run}- />- ))}- </View>- )}- </View>- )}- </>- )}- </ScrollView>- </SafeAreaView>- );-}--function ScheduleFormCard({- busy,- draft,- error,- mode,- onCancel,- onChange,- onPromptChange,- onReloadTemplates,- onSelectTemplate,- onSubmit,- onTemplateParamChange,- selectedTemplateId,- templateError,- templateParamValues,- templates,- templatesLoading,- sessions,- supportsPreRunHook,-}: {- busy: boolean;- draft: MobileScheduleDraft;- error: string | null;- mode: 'create' | 'edit';- onCancel: () => void;- onChange: (draft: MobileScheduleDraft) => void;- onPromptChange: (value: string) => void;- onReloadTemplates: () => void;- onSelectTemplate: (template: RemoteScheduleTemplate) => void;- onSubmit: () => void;- onTemplateParamChange: (key: string, value: string) => void;- selectedTemplateId: string | null;- templateError: string | null;- templateParamValues: Record<string, string>;- templates: readonly RemoteScheduleTemplate[];- templatesLoading: boolean;- sessions: readonly RemoteSession[];- supportsPreRunHook: boolean;-}) {- const styles = useThemedStyles(makeStyles);- const { colors } = useTheme();- const { t, i18n } = useTranslation();- const [advancedOpen, setAdvancedOpen] = useState(false);- const setField = <K extends keyof MobileScheduleDraft>(key: K, value: MobileScheduleDraft[K]) => {- onChange({ ...draft, [key]: value });- };- const sessionMode = deriveMobileScheduleSessionMode(draft);- const hasRealBinding = hasMobileScheduleRealBinding(draft);- const hideWorkspaceFields = sessionMode === 'bound' || hasRealBinding;- // 仅运行脚本任务(桌面端创建):会话模式/工作区切换/worktree/Agent/模型等- // agent-only 控件全部隐藏——引擎对 script 模式拒绝这些组合,留着控件等于- // 给用户一个"点了就保存失败"的开关(codex review 发现)。buildMobileScheduleInput- // 同时在序列化层把这些字段钉回 script 合法值,双保险。- const isScriptTask = draft.executionMode === 'script';- const boundSessionInputValue = draft.targetSessionId.trim() === MOBILE_SCHEDULE_PENDING_SESSION_ID- ? ''- : draft.targetSessionId;- const boundSessionOptions = useMemo(- () => buildBoundSessionOptions(sessions, boundSessionInputValue),- [boundSessionInputValue, sessions],- );- const sessionModeCopy = sessionMode === 'bound'- ? t('devices.automations.form.sessionMode.bound')- : sessionMode === 'persistent'- ? t('devices.automations.form.sessionMode.persistent')- : t('devices.automations.form.sessionMode.fresh');- const preservedIntervalMs = !draft.intervalMinutes- && !draft.intervalMinutesTouched- && typeof draft.sourceIntervalMs === 'number'- && Number.isFinite(draft.sourceIntervalMs)- && draft.sourceIntervalMs > 0- ? draft.sourceIntervalMs- : undefined;-- return (- <View style={styles.formCard} testID="automations.form">- <View style={styles.formHeader}>- <View>- <Text style={styles.formTitle}>{mode === 'edit' ? t('devices.automations.form.title.edit') : t('devices.automations.form.title.create')}</Text>- </View>- {busy ? <ActivityIndicator color={colors.textSecondary} /> : null}- </View>-- {error ? <Text style={styles.formError}>{error}</Text> : null}-- {mode === 'create' ? (- <TemplatePicker- busy={busy}- error={templateError}- loading={templatesLoading}- onParamChange={onTemplateParamChange}- onReload={onReloadTemplates}- onSelect={onSelectTemplate}- paramValues={templateParamValues}- selectedTemplateId={selectedTemplateId}- templates={templates}- />- ) : null}-- <View style={styles.fieldGroup}>- <Text style={styles.fieldLabel}>{t('devices.automations.form.field.name')}</Text>- <TextInput- autoCapitalize="none"- editable={!busy}- onChangeText={(value) => setField('name', value)}- placeholder={t('devices.automations.form.namePlaceholder')}- placeholderTextColor={colors.textPlaceholder}- style={styles.input}- testID="automations.form.nameInput"- value={draft.name}- />- </View>-- {draft.executionMode === 'script' ? (- <Text style={styles.fieldHint} testID="automations.form.scriptModeHint">- {t('devices.automations.form.scriptHint')}- </Text>- ) : (- <View style={styles.fieldGroup}>- <Text style={styles.fieldLabel}>{t('devices.automations.form.field.prompt')}</Text>- <TextInput- editable={!busy}- multiline- onChangeText={onPromptChange}- placeholder={t('devices.automations.form.promptPlaceholder')}- placeholderTextColor={colors.textPlaceholder}- style={[styles.input, styles.textArea]}- testID="automations.form.promptInput"- textAlignVertical="top"- value={draft.prompt}- />- </View>- )}-- <View style={styles.fieldGroup}>- <Text style={styles.fieldLabel}>{t('devices.automations.form.field.trigger')}</Text>- <View style={styles.segmentRow}>- <SegmentButton- active={draft.runMode === 'recurring'}- disabled={busy}- label={t('devices.automations.form.trigger.recurring')}- onPress={() => onChange(updateDraftRunMode(draft, 'recurring'))}- testID="automations.form.runModeRecurring"- />- <SegmentButton- active={draft.runMode === 'manual'}- disabled={busy}- label={t('devices.automations.form.trigger.manual')}- onPress={() => onChange(updateDraftRunMode(draft, 'manual'))}- testID="automations.form.runModeManual"- />- </View>- </View>-- {!isScriptTask ? (- <View style={styles.fieldGroup}>- <Text style={styles.fieldLabel}>{t('devices.automations.form.field.runSession')}</Text>- <View style={styles.segmentRow} testID="automations.form.sessionMode">- <SegmentButton- active={sessionMode === 'fresh'}- disabled={busy}- label={t('devices.automations.form.session.fresh')}- onPress={() => onChange(updateDraftSessionMode(draft, 'fresh'))}- testID="automations.form.sessionModeFresh"- />- <SegmentButton- active={sessionMode === 'persistent'}- disabled={busy}- label={t('devices.automations.form.session.persistent')}- onPress={() => onChange(updateDraftSessionMode(draft, 'persistent'))}- testID="automations.form.sessionModePersistent"- />- <SegmentButton- active={sessionMode === 'bound'}- disabled={busy}- label={t('devices.automations.form.session.bound')}- onPress={() => onChange(updateDraftSessionMode(draft, 'bound'))}- testID="automations.form.sessionModeBound"- />- </View>- <Text style={styles.fieldHint} testID="automations.form.sessionModeHint">- {sessionModeCopy}- </Text>- </View>- ) : null}-- {!isScriptTask && sessionMode === 'bound' ? (- <View style={styles.fieldGroup} testID="automations.form.boundSession">- <Text style={styles.fieldLabel}>{t('devices.automations.form.field.boundSession')}</Text>- {boundSessionOptions.length ? (- <View style={styles.boundSessionOptions} testID="automations.form.boundSessionOptions">- {boundSessionOptions.map((session) => (- <MainWindowRowButton- accessibilityLabel={t('devices.automations.form.boundSessionA11y', {- name: projectDraftSessionTitle(session.title, t('session.menu.unnamedTitle')) || session.id,- })}- accessibilityRole="radio"- accessibilityState={{ checked: session.id === boundSessionInputValue.trim() }}- disabled={busy}- key={session.id}- onPress={() => onChange(updateDraftBoundSessionId(draft, session.id, session.agentKind))}- selected={session.id === boundSessionInputValue.trim()}- style={styles.boundSessionOption}- testID="automations.form.boundSessionOption"- >- <View style={styles.boundSessionOptionText}>- <Text style={styles.boundSessionTitle} numberOfLines={1}>- {/* 哨兵过投影:绑定会话选择器同样不能露出内部哨兵。 */}- {projectDraftSessionTitle(session.title, t('session.menu.unnamedTitle'))- || session.workingDir || session.id}- </Text>- <Text style={styles.boundSessionMeta} numberOfLines={1}>- {formatSessionOptionMeta(- session,- t('devices.automations.form.workspace.dialogue'),- )}- </Text>- </View>- </MainWindowRowButton>- ))}- </View>- ) : null}- <TextInput- autoCapitalize="none"- editable={!busy}- onChangeText={(value) => onChange(updateDraftBoundSessionId(draft, value,- sessions.find((session) => session.id === value.trim())?.agentKind))}- placeholder="session id"- placeholderTextColor={colors.textPlaceholder}- style={styles.input}- testID="automations.form.targetSessionInput"- value={boundSessionInputValue}- />- </View>- ) : null}-- {draft.runMode === 'recurring' ? (- <>- <View style={styles.fieldGroup}>- <Text style={styles.fieldLabel}>{t('devices.automations.form.field.intervalMinutes')}</Text>- <TextInput- editable={!busy}- keyboardType="number-pad"- onChangeText={(value) => onChange(updateDraftIntervalMinutes(draft, value))}- placeholder={t('devices.automations.form.intervalPlaceholder')}- placeholderTextColor={colors.textPlaceholder}- style={styles.input}- testID="automations.form.intervalInput"- value={draft.intervalMinutes}- />- <Text style={styles.fieldHint} testID="automations.form.intervalHint">- {preservedIntervalMs !== undefined- ? t('devices.automations.form.intervalPreservedHint', {- duration: formatScheduleInterval(preservedIntervalMs, i18n.resolvedLanguage || i18n.language),- })- : t('devices.automations.form.intervalHint')}- </Text>- </View>- <View style={styles.fieldGroup}>- <Text style={styles.fieldLabel}>Cron</Text>- <TextInput- autoCapitalize="none"- editable={!busy}- onChangeText={(value) => onChange(updateDraftCronExpr(draft, value))}- placeholder="0 9 * * *"- placeholderTextColor={colors.textPlaceholder}- style={styles.input}- testID="automations.form.cronInput"- value={draft.cronExpr}- />- </View>- </>- ) : null}-- {!isScriptTask ? (- <View style={styles.fieldGroup}>- <Text style={styles.fieldLabel}>{t('devices.automations.form.field.workspace')}</Text>- <View style={styles.segmentRow}>- <SegmentButton- active={draft.workspaceKind === 'project'}- disabled={busy}- label={t('devices.automations.form.workspace.project')}- onPress={() => onChange(updateDraftWorkspaceKind(draft, 'project'))}- testID="automations.form.workspaceProject"- />- <SegmentButton- active={draft.workspaceKind === 'dialogue'}- disabled={busy}- label={t('devices.automations.form.workspace.dialogue')}- onPress={() => onChange(updateDraftWorkspaceKind(draft, 'dialogue'))}- testID="automations.form.workspaceDialogue"- />- </View>- </View>- ) : null}-- {(isScriptTask || draft.workspaceKind === 'project') && !hideWorkspaceFields ? (- <>- <View style={styles.fieldGroup}>- <Text style={styles.fieldLabel}>{t('devices.automations.form.field.projectDir')}</Text>- <TextInput- autoCapitalize="none"- editable={!busy}- onChangeText={(value) => setField('workingDir', value)}- placeholder="/Users/name/Code/project"- placeholderTextColor={colors.textPlaceholder}- style={styles.input}- testID="automations.form.workingDirInput"- value={draft.workingDir}- />- </View>- {!isScriptTask ? (- <ToggleRow- active={draft.useWorktree}- disabled={busy}- label={t('devices.automations.form.useWorktree')}- onPress={() => setField('useWorktree', !draft.useWorktree)}- testID="automations.form.worktreeToggle"- />- ) : null}- </>- ) : null}-- {!isScriptTask ? (- <>- <View style={styles.fieldGroup}>- <Text style={styles.fieldLabel}>Agent</Text>- <View style={styles.segmentRow}>- <SegmentButton- active={draft.agentKind === 'claude-code'}- disabled={busy || hasRealBinding}- label="Claude"- onPress={() => onChange(updateDraftAgentKind(draft, 'claude-code'))}- testID="automations.form.agentClaude"- />- <SegmentButton- active={draft.agentKind === 'codex'}- disabled={busy || hasRealBinding}- label="Codex"- onPress={() => onChange(updateDraftAgentKind(draft, 'codex'))}- testID="automations.form.agentCodex"- />- <SegmentButton- active={draft.agentKind === 'pi'}- disabled={busy || hasRealBinding}- label="Pi"- onPress={() => onChange(updateDraftAgentKind(draft, 'pi'))}- testID="automations.form.agentPi"- />- </View>- </View>-- <View style={styles.fieldGroup}>- <Text style={styles.fieldLabel}>{t('devices.automations.form.field.model')}</Text>- <TextInput- autoCapitalize="none"- editable={!busy}- onChangeText={(value) => setField('model', value)}- placeholder={hasRealBinding ? t('devices.automations.form.modelPlaceholderBound') : draft.agentKind === 'codex' ? 'gpt-5.5' : draft.agentKind === 'pi' ? t('devices.automations.form.modelPlaceholderPiDefault') : 'claude-sonnet-4-6'}- placeholderTextColor={colors.textPlaceholder}- style={styles.input}- testID="automations.form.modelInput"- value={draft.model}- />- </View>-- <View style={styles.fieldGroup}>- <Text style={styles.fieldLabel}>{t('devices.automations.form.field.effort')}</Text>- <TextInput- autoCapitalize="none"- editable={!busy}- onChangeText={(value) => setField('effort', value)}- placeholder="minimal / low / medium / high / xhigh / max / ultra"- placeholderTextColor={colors.textPlaceholder}- style={styles.input}- testID="automations.form.effortInput"- value={draft.effort}- />- </View>-- {(draft.agentKind === 'codex' || draft.agentKind === 'pi') && !hideWorkspaceFields ? (- <ToggleRow- active={draft.fastMode}- disabled={busy}- label={t('devices.automations.form.fastMode')}- onPress={() => setField('fastMode', !draft.fastMode)}- testID="automations.form.fastModeToggle"- />- ) : null}- </>- ) : null}-- <View style={styles.fieldGroup}>- <Text style={styles.fieldLabel}>{t('devices.automations.form.field.timezone')}</Text>- <TextInput- autoCapitalize="none"- editable={!busy}- onChangeText={(value) => onChange(updateDraftTimezone(draft, value))}- placeholder="Asia/Shanghai"- placeholderTextColor={colors.textPlaceholder}- style={styles.input}- testID="automations.form.timezoneInput"- value={draft.timezone}- />- </View>-- <MainWindowRowButton accessibilityLabel={t('devices.companions.automation.advanced')} expanded={advancedOpen} onPress={() => setAdvancedOpen(!advancedOpen)} testID="automations.form.advanced"><Text style={styles.fieldLabel}>{t('devices.companions.automation.advanced')}</Text></MainWindowRowButton>- {advancedOpen ? <View style={styles.fieldGroup}>- {draft.executionMode !== 'script' ? <ToggleRow active={draft.silentWhenIdle} disabled={busy}- label={t('devices.companions.automation.quiet')} onPress={() => setField('silentWhenIdle', !draft.silentWhenIdle)} testID="automations.form.quiet" /> : null}- {draft.executionMode !== 'script' ? <Text style={styles.fieldLabel}>{t('devices.companions.automation.quietHint')}</Text> : null}- {supportsPreRunHook ? <>- <Text style={styles.fieldLabel}>{t('devices.companions.automation.checkCommand')}</Text>- <TextInput accessibilityLabel={t('devices.companions.automation.checkCommand')} autoCapitalize="none" editable={!busy} multiline style={styles.input}- value={draft.preRunHook?.command ?? ''} onChangeText={(command) => setField('preRunHook', command ? { ...draft.preRunHook, command } : null)} />- <Text style={styles.fieldLabel}>{t('devices.companions.automation.checkHint')}</Text>- {draft.preRunHook ? <>- <Text style={styles.fieldLabel}>{t('devices.companions.automation.timeoutMs')}</Text>- <TextInput accessibilityLabel={t('devices.companions.automation.timeoutMs')} keyboardType="numeric" editable={!busy} style={styles.input}- value={draft.preRunHook.timeoutMs === undefined ? '' : String(draft.preRunHook.timeoutMs)} onChangeText={(value) => setField('preRunHook', { ...draft.preRunHook!, timeoutMs: value ? Number(value) : undefined })} />- </> : null}- </> : null}- </View> : null}-- <ToggleRow- active={draft.notifyDesktop}- disabled={busy}- label={t('devices.automations.form.notifyDesktop')}- onPress={() => setField('notifyDesktop', !draft.notifyDesktop)}- testID="automations.form.notifyDesktopToggle"- />-- <ToggleRow- active={draft.notifyFeishu}- disabled={busy}- label={t('devices.automations.form.notifyFeishu')}- onPress={() => setField('notifyFeishu', !draft.notifyFeishu)}- testID="automations.form.notifyFeishuToggle"- />-- <MainWindowActionGroup- primaryActions={[- {- accessibilityLabel: busy ? t('devices.automations.form.savingA11y') : t('devices.automations.form.saveA11y'),- disabled: busy,- label: busy ? t('devices.common.saving') : t('devices.common.save'),- onPress: onSubmit,- testID: 'automations.form.saveButton',- tone: 'primary',- },- ]}- cancelAction={{- accessibilityLabel: t('devices.automations.form.cancelA11y'),- disabled: busy,- label: t('devices.common.cancel'),- onPress: onCancel,- testID: 'automations.form.cancelButton',- }}- testID="automations.form.actions"- />- </View>- );-}--function ScheduleDeleteCard({- busy,- onCancel,- onConfirm,- onDispositionChange,- state,-}: {- busy: boolean;- onCancel: () => void;- onConfirm: () => void;- onDispositionChange: (value: ScheduleGeneratedSessionDisposition) => void;- state: DeleteScheduleState;-}) {- const styles = useThemedStyles(makeStyles);- const { colors } = useTheme();- const { t } = useTranslation();- const previewText = state.loading- ? t('devices.automations.delete.counting')- : describeScheduleDeletePreview({- sessionIds: state.sessionIds ?? [],- sessionCount: state.sessionIds?.length ?? 0,- inflightCount: state.inflightCount ?? 0,- }, mobilePresentationLocalizer);- const confirmText = state.disposition === 'delete'- ? t('devices.automations.delete.confirmDeleteBoth')- : state.disposition === 'archive'- ? t('devices.automations.delete.confirmArchive')- : t('devices.automations.delete.confirmTaskOnly');-- return (- <View style={styles.deleteCard} testID="automations.deleteDialog">- <View style={styles.deleteHeader}>- <View style={styles.deleteHeaderText}>- <Text style={styles.sectionTitle}>{t('devices.automations.heading.delete')}</Text>- <Text style={styles.deleteTitle} numberOfLines={2}>{t('devices.automations.delete.title', { name: state.schedule.name })}</Text>- </View>- {state.loading || busy ? <ActivityIndicator color={colors.textSecondary} /> : null}- </View>- <Text style={styles.deleteCopy}>- {t('devices.automations.delete.copy')}- </Text>- <Text style={styles.deletePreview} testID="automations.delete.preview">- {previewText}- </Text>- {state.error ? <Text style={styles.formError}>{state.error}</Text> : null}- <View- accessibilityLabel={t('devices.automations.delete.optionsA11y')}- accessibilityRole="radiogroup"- style={styles.deleteOptions}- testID="automations.delete.options"- >- <DeleteDispositionOption- description={t('devices.automations.delete.keepDesc')}- disabled={busy}- label={t('devices.automations.delete.keepLabel')}- onPress={() => onDispositionChange('keep')}- selected={state.disposition === 'keep'}- testID="automations.delete.option.keep"- />- <DeleteDispositionOption- description={t('devices.automations.delete.archiveDesc')}- disabled={busy}- label={t('devices.automations.delete.archiveLabel')}- onPress={() => onDispositionChange('archive')}- selected={state.disposition === 'archive'}- testID="automations.delete.option.archive"- />- <DeleteDispositionOption- description={t('devices.automations.delete.deleteDesc')}- disabled={busy}- label={t('devices.automations.delete.deleteLabel')}- onPress={() => onDispositionChange('delete')}- selected={state.disposition === 'delete'}- testID="automations.delete.option.delete"- />- </View>- <MainWindowActionGroup- cancelAction={{- accessibilityLabel: t('devices.automations.delete.cancelA11y'),- disabled: busy,- label: t('devices.common.cancel'),- onPress: onCancel,- testID: 'automations.delete.cancelButton',- }}- dangerActions={[- {- accessibilityLabel: t('devices.automations.delete.confirmA11y'),- disabled: busy || state.loading,- label: busy ? t('devices.common.deleting') : confirmText,- onPress: onConfirm,- testID: 'automations.delete.confirmButton',- tone: 'danger',- },- ]}- testID="automations.delete.actions"- />- </View>- );-}--function SchedulePauseCard({- busy,- onCancel,- onConfirm,- state,-}: {- busy: boolean;- onCancel: () => void;- onConfirm: () => void;- state: PauseScheduleState;-}) {- const styles = useThemedStyles(makeStyles);- const { colors } = useTheme();- const { t } = useTranslation();- const confirmation = buildSchedulePauseConfirmation(- state.schedule,- state.inflightCount,- mobilePresentationLocalizer,- );- return (- <View style={styles.pauseCard} testID="automations.pauseDialog">- <View style={styles.deleteHeader}>- <View style={styles.deleteHeaderText}>- <Text style={styles.sectionTitle}>{t('devices.automations.heading.pause')}</Text>- <Text style={styles.deleteTitle} numberOfLines={2}>- {confirmation?.title ?? t('devices.automations.pause.title', { name: state.schedule.name || state.schedule.id })}- </Text>- </View>- {busy ? <ActivityIndicator color={colors.textSecondary} /> : null}- </View>- <Text style={styles.deleteCopy}>- {confirmation?.detail ?? t('devices.automations.pause.detailFallback')}- </Text>- <Text style={styles.deletePreview} testID="automations.pause.preview">- {confirmation?.preview ?? t('devices.automations.pause.previewFallback')}- </Text>- {state.error ? <Text style={styles.formError}>{state.error}</Text> : null}- <MainWindowActionGroup- primaryActions={[- {- accessibilityLabel: t('devices.automations.pause.confirmA11y'),- disabled: busy,- label: busy ? t('devices.automations.pause.pausing') : t('devices.automations.pause.confirm'),- onPress: onConfirm,- testID: 'automations.pause.confirmButton',- tone: 'primary',- },- ]}- cancelAction={{- accessibilityLabel: t('devices.automations.pause.cancelA11y'),- disabled: busy,- label: t('devices.common.cancel'),- onPress: onCancel,- testID: 'automations.pause.cancelButton',- }}- testID="automations.pause.actions"- />- </View>- );-}--function RunDeleteCard({- busy,- onCancel,- onConfirm,- state,-}: {- busy: boolean;- onCancel: () => void;- onConfirm: () => void;- state: DeleteRunState;-}) {- const styles = useThemedStyles(makeStyles);- const { colors } = useTheme();- const { t } = useTranslation();- const summary = summarizeRun(state.run, Date.now(), mobilePresentationLocalizer);- return (- <View style={styles.pauseCard} testID="automations.runDeleteDialog">- <View style={styles.deleteHeader}>- <View style={styles.deleteHeaderText}>- <Text style={styles.sectionTitle}>{t('devices.automations.heading.deleteRun')}</Text>- <Text style={styles.deleteTitle} numberOfLines={2}>- {t('devices.automations.runDelete.title')}- </Text>- </View>- {busy ? <ActivityIndicator color={colors.textSecondary} /> : null}- </View>- <Text style={styles.deleteCopy}>- {t('devices.automations.runDelete.copy')}- </Text>- <Text style={styles.deletePreview} testID="automations.runDelete.preview">- {summary.title} · {summary.subtitle}- </Text>- {state.error ? <Text style={styles.formError}>{state.error}</Text> : null}- <MainWindowActionGroup- dangerActions={[- {- accessibilityLabel: t('devices.automations.runDelete.confirmA11y'),- disabled: busy,- label: busy ? t('devices.common.deleting') : t('devices.automations.runDelete.confirm'),- onPress: onConfirm,- testID: 'automations.runDelete.confirmButton',- tone: 'danger',- },- ]}- cancelAction={{- accessibilityLabel: t('devices.automations.runDelete.cancelA11y'),- disabled: busy,- label: t('devices.common.cancel'),- onPress: onCancel,- testID: 'automations.runDelete.cancelButton',- }}- testID="automations.runDelete.actions"- />- </View>- );-}--function DeleteDispositionOption({- description,- disabled,- label,- onPress,- selected,- testID,-}: {- description: string;- disabled: boolean;- label: string;- onPress: () => void;- selected: boolean;- testID: string;-}) {- const styles = useThemedStyles(makeStyles);- return (- <MainWindowCardButton- accessibilityLabel={label}- accessibilityRole="radio"- accessibilityState={{ checked: selected }}- disabled={disabled}- onPress={onPress}- selected={selected}- style={styles.deleteOption}- testID={testID}- >- <View style={[styles.radioMark, selected && styles.radioMarkSelected]}>- {selected ? <View style={styles.radioMarkDot} /> : null}- </View>- <View style={styles.deleteOptionText}>- <Text style={styles.deleteOptionTitle}>{label}</Text>- <Text style={styles.deleteOptionDescription}>{description}</Text>- </View>- </MainWindowCardButton>- );-}--function TemplatePicker({- busy,- error,- loading,- onParamChange,- onReload,- onSelect,- paramValues,- selectedTemplateId,- templates,-}: {- busy: boolean;- error: string | null;- loading: boolean;- onParamChange: (key: string, value: string) => void;- onReload: () => void;- onSelect: (template: RemoteScheduleTemplate) => void;- paramValues: Record<string, string>;- selectedTemplateId: string | null;- templates: readonly RemoteScheduleTemplate[];-}) {- const styles = useThemedStyles(makeStyles);- const { t } = useTranslation();- const localizedTemplates = useMemo(- () => templates.map((template) => localizeBuiltinTemplate(template, t)),- [t, templates],- );- const selected = localizedTemplates.find((template) => template.id === selectedTemplateId) ?? null;- return (- <View style={styles.templateSection} testID="automations.templateSection">- <View style={styles.templateHeader}>- <Text style={styles.fieldLabel}>{t('devices.automations.template.label')}</Text>- <MainWindowActionButton- action={{- accessibilityLabel: loading ? t('devices.automations.template.loadingA11y') : t('devices.automations.template.refreshA11y'),- disabled: busy || loading,- label: loading ? t('devices.automations.template.loading') : t('devices.automations.template.refresh'),- onPress: onReload,- testID: 'automations.templateReloadButton',- }}- density="compact"- style={styles.templateReloadButton}- />- </View>- {error ? <Text style={styles.templateError}>{error}</Text> : null}- <ScrollView- horizontal- showsHorizontalScrollIndicator={false}- contentContainerStyle={styles.templateList}- testID="automations.templateList"- >- {localizedTemplates.map((template) => (- <TemplateCard- key={template.id}- disabled={busy}- onPress={() => onSelect(template)}- selected={template.id === selectedTemplateId}- template={template}- />- ))}- </ScrollView>- {selected?.parameters?.length ? (- <View style={styles.templateParams} testID="automations.templateParams">- {selected.parameters.map((parameter) => (- <TemplateParamControl- key={parameter.key}- disabled={busy}- onChange={(value) => onParamChange(parameter.key, value)}- parameter={parameter}- value={paramValues[parameter.key] ?? ''}- />- ))}- </View>- ) : null}- </View>- );-}--function TemplateCard({- disabled,- onPress,- selected,- template,-}: {- disabled: boolean;- onPress: () => void;- selected: boolean;- template: RemoteScheduleTemplate;-}) {- const styles = useThemedStyles(makeStyles);- const { t } = useTranslation();- return (- <MainWindowCardButton- accessibilityLabel={t('devices.automations.template.cardA11y', { name: template.name })}- disabled={disabled}- onPress={onPress}- selected={selected}- style={styles.templateCard}- testID="automations.templateCard"- >- <Text style={styles.templateName} numberOfLines={1}>{template.name}</Text>- <Text style={styles.templateDescription} numberOfLines={3}>{template.description}</Text>- <Text style={styles.templateMeta} numberOfLines={1}>- {template.cronExpr ? template.cronExpr : t('devices.automations.template.manualConfig')}- </Text>- </MainWindowCardButton>- );-}--function TemplateParamControl({- disabled,- onChange,- parameter,- value,-}: {- disabled: boolean;- onChange: (value: string) => void;- parameter: RemoteTemplateParameter;- value: string;-}) {- const styles = useThemedStyles(makeStyles);- const { colors } = useTheme();- if (parameter.type === 'boolean') {- return (- <ToggleRow- active={value === 'true'}- disabled={disabled}- label={parameter.label}- onPress={() => onChange(value === 'true' ? 'false' : 'true')}- testID="automations.templateParamToggle"- />- );- }- if (parameter.type === 'select') {- return (- <View style={styles.fieldGroup} testID="automations.templateParamSelect">- <Text style={styles.fieldLabel}>{parameter.label}</Text>- <View style={styles.segmentRow}>- {(parameter.options ?? []).map((option) => (- <SegmentButton- key={option}- active={value === option}- disabled={disabled}- label={option}- onPress={() => onChange(option)}- testID="automations.templateParamOption"- />- ))}- </View>- </View>- );- }- return (- <View style={styles.fieldGroup}>- <Text style={styles.fieldLabel}>- {parameter.label}{parameter.required ? ' *' : ''}- </Text>- <TextInput- autoCapitalize="none"- editable={!disabled}- keyboardType={parameter.type === 'number' ? 'number-pad' : 'default'}- onChangeText={onChange}- placeholder={parameter.placeholder ?? parameter.default ?? ''}- placeholderTextColor={colors.textPlaceholder}- style={styles.input}- testID="automations.templateParamInput"- value={value}- />- </View>- );-}--function SegmentButton({- active,- disabled,- label,- onPress,- testID,-}: {- active: boolean;- disabled: boolean;- label: string;- onPress: () => void;- testID: string;-}) {- const styles = useThemedStyles(makeStyles);- return (- <MainWindowOptionButton- density="default"- disabled={disabled}- label={label}- onPress={onPress}- selected={active}- style={styles.segmentButton}- testID={testID}- variant="segmented"- />- );+/** Compatibility for saved links to the retired mobile automation manager. */+export default function LegacyAutomationsRedirect() {+ return <Redirect href="/devices" />;}--function ToggleRow({- active,- disabled,- label,- onPress,- testID,-}: {- active: boolean;- disabled: boolean;- label: string;- onPress: () => void;- testID: string;-}) {- const styles = useThemedStyles(makeStyles);- return (- <MainWindowRowButton- accessibilityLabel={label}- accessibilityRole="switch"- accessibilityState={{ checked: active }}- disabled={disabled}- onPress={onPress}- style={styles.toggleRow}- testID={testID}- >- <Text style={styles.toggleLabel}>{label}</Text>- <View style={[styles.togglePill, active && styles.togglePillActive]}>- <View style={[styles.toggleKnob, active && styles.toggleKnobActive]} />- </View>- </MainWindowRowButton>- );-}--function ScheduleRow({- runs,- schedule,- selected,- onPress,-}: {- runs: readonly RemoteScheduleRun[];- schedule: RemoteSchedule;- selected: boolean;- onPress: () => void;-}) {- const styles = useThemedStyles(makeStyles);- const { colors } = useTheme();- const { t } = useTranslation();- const summary = summarizeSchedule(schedule, runs, Date.now(), mobilePresentationLocalizer);- return (- <MainWindowRowButton- accessibilityLabel={t('devices.automations.scheduleRowA11y', { title: summary.title })}- onPress={onPress}- selected={selected}- style={styles.scheduleRow}- testID="automations.scheduleRow"- >- <View style={styles.scheduleText}>- <View style={styles.scheduleTitleRow}>- {summary.unreadCount > 0 ? <View style={styles.unreadDot} /> : null}- <Text style={styles.scheduleTitle} numberOfLines={1}>{summary.title}</Text>- <Text style={styles.scheduleStatus}>{summary.statusLabel}</Text>- </View>- <Text style={styles.scheduleSubtitle} numberOfLines={1}>{summary.subtitle}</Text>- <Text style={styles.scheduleDetail} numberOfLines={1}>{summary.detail}</Text>- </View>- <ChevronRight color={colors.textTertiary} size={iconSize.xl} strokeWidth={iconStroke.regular} />- </MainWindowRowButton>- );-}--function ScheduleDetail({- busyAction,- onPause,- onResume,- onDelete,- onEdit,- onRunNow,- runs,- runsLoading,- schedule,-}: {- busyAction: string | null;- onPause: () => void;- onResume: () => void;- onDelete: () => void;- onEdit: () => void;- onRunNow: () => void;- runs: readonly RemoteScheduleRun[];- runsLoading: boolean;- schedule: RemoteSchedule;-}) {- const styles = useThemedStyles(makeStyles);- const { t } = useTranslation();- const summary = summarizeSchedule(schedule, runs, Date.now(), mobilePresentationLocalizer);- const paused = schedule.status === 'paused';- const actionBusy = !!busyAction || runsLoading;- const pauseDisabled = actionBusy || schedule.status === 'expired';- return (- <View style={styles.detailCard} testID="automations.detailCard">- <Text style={styles.detailTitle} numberOfLines={2}>{summary.title}</Text>- <Text style={styles.detailMeta} numberOfLines={2}>{summary.detail}</Text>- {summary.runSessionDetail ? (- <Text style={styles.detailMeta} numberOfLines={1} testID="automations.runSessionDetail">- {summary.runSessionDetail}- </Text>- ) : null}- <Text style={styles.detailPrompt} numberOfLines={4}>- {schedule.prompt || (schedule.executionMode === 'script' ? t('devices.automations.detail.promptScriptFallback') : t('devices.automations.detail.promptEmpty'))}- </Text>- <MainWindowActionGroup- dangerActions={[{- accessibilityLabel: t('devices.automations.detail.deleteA11y'),- disabled: actionBusy,- label: t('devices.common.delete'),- onPress: onDelete,- testID: 'automations.deleteButton',- tone: 'danger',- }]}- primaryActions={[{- accessibilityLabel: t('devices.automations.detail.runNowA11y'),- disabled: actionBusy,- label: busyAction === `run:${schedule.id}`- ? t('devices.automations.detail.running')- : t('devices.automations.runNow'),- onPress: onRunNow,- testID: 'automations.runNowButton',- tone: 'primary',- }]}- secondaryActions={[{- accessibilityLabel: paused ? t('devices.automations.detail.resumeA11y') : t('devices.automations.detail.pauseA11y'),- disabled: pauseDisabled,- label: paused ? t('devices.automations.detail.resume') : t('devices.automations.detail.pause'),- onPress: paused ? onResume : onPause,- testID: paused ? 'automations.resumeButton' : 'automations.pauseButton',- tone: 'secondary',- }, {- accessibilityLabel: t('devices.automations.detail.editA11y'),- disabled: actionBusy,- label: t('devices.automations.detail.edit'),- onPress: onEdit,- testID: 'automations.editButton',- tone: 'secondary',- }]}- testID="automations.detailActions"- />- </View>- );-}--function RunRow({- busyAction,- opening,- onDelete,- onMarkRead,- onOpenSession,- onRestart,- run,-}: {- busyAction: string | null;- opening: boolean;- onDelete: () => void;- onMarkRead: () => void;- onOpenSession: () => void;- onRestart: () => void;- run: RemoteScheduleRun;-}) {- const styles = useThemedStyles(makeStyles);- const { t } = useTranslation();- const summary = summarizeRun(run, Date.now(), mobilePresentationLocalizer);- const actionBusy = !!busyAction || opening;- const hasActions = summary.canOpenSession || summary.canRestart || summary.canMarkRead || summary.canDelete;- return (- <View style={styles.runRow} testID="automations.runRow">- <View style={styles.runText}>- <View style={styles.runTitleRow}>- {summary.unread ? <View style={styles.unreadDot} /> : null}- <Text style={styles.runTitle}>{summary.title}</Text>- <Text style={styles.runTime}>{summary.subtitle}</Text>- </View>- <Text style={styles.runMeta} numberOfLines={1} testID="automations.runMeta">- {summary.meta}- </Text>- {summary.detail ? (- <Text style={styles.runDetail} numberOfLines={3}>{summary.detail}</Text>- ) : null}- </View>- {hasActions ? (- <View style={styles.runActions} testID="automations.runActions">- {summary.canOpenSession ? (- <MainWindowActionButton- action={{- accessibilityLabel: t('devices.automations.run.openSessionA11y'),- busy: opening,- disabled: actionBusy,- label: opening ? t('devices.automations.run.opening') : (summary.openSessionLabel ?? t('devices.automations.run.session')),- onPress: onOpenSession,- testID: 'automations.openRunSessionButton',- }}- density="compact"- style={styles.runActionButton}- />- ) : null}- {summary.canRestart ? (- <MainWindowActionButton- action={{- accessibilityLabel: t('devices.automations.run.restartA11y'),- busy: busyAction === `run-restart:${run.id}`,- disabled: actionBusy,- label: busyAction === `run-restart:${run.id}` ? t('devices.automations.run.restarting') : (summary.restartLabel ?? t('devices.automations.run.restart')),- onPress: onRestart,- testID: 'automations.restartRunButton',- }}- density="compact"- style={styles.runActionButton}- />- ) : null}- {summary.canMarkRead ? (- <MainWindowActionButton- action={{- accessibilityLabel: t('devices.automations.run.markReadA11y'),- busy: busyAction === `run-read:${run.id}`,- disabled: actionBusy,- label: busyAction === `run-read:${run.id}` ? t('devices.automations.run.marking') : (summary.markReadLabel ?? t('devices.automations.run.markRead')),- onPress: onMarkRead,- testID: 'automations.markRunReadButton',- }}- density="compact"- style={styles.runActionButton}- />- ) : null}- {summary.canDelete ? (- <MainWindowActionButton- action={{- accessibilityLabel: t('devices.automations.run.deleteA11y'),- busy: busyAction === `run-delete:${run.id}`,- disabled: actionBusy,- label: busyAction === `run-delete:${run.id}` ? t('devices.common.deleting') : (summary.deleteLabel ?? t('devices.common.delete')),- onPress: onDelete,- testID: 'automations.deleteRunButton',- tone: 'danger',- }}- density="compact"- style={styles.runActionButton}- />- ) : null}- </View>- ) : null}- </View>- );-}--function markRunsReadLocally(list: readonly RemoteScheduleRun[]): RemoteScheduleRun[] {- const readAt = Date.now();- return list.map((run) => {- if (run.status === 'running' || run.readAt) return run;- return { ...run, readAt };- });-}--function markRunReadLocally(list: readonly RemoteScheduleRun[], runId: string): RemoteScheduleRun[] {- const readAt = Date.now();- return list.map((run) => (run.id === runId ? { ...run, readAt } : run));-}--// 与 packages/maker-scheduler builtin-templates.ts 的 TEMPLATE_CATEGORIES order 保持一致。-const TEMPLATE_CATEGORY_RANK: Record<string, number> = {- 'dev-automation': 1,- 'info-radar': 2,- 'office-docs': 3,-};--function localizeBuiltinTemplate(- template: RemoteScheduleTemplate,- t: TFunction,-): RemoteScheduleTemplate {- if (!isLocalizedBuiltinTemplate(template)) return template;- const prefix = `devices.automations.template.builtin.${template.id}`;- const templateVariables = Object.fromEntries(- (template.parameters ?? []).map((parameter) => [parameter.key, `{{${parameter.key}}}`]),- );- return {- ...template,- name: t(`${prefix}.name`, { defaultValue: template.name }),- description: t(`${prefix}.description`, { defaultValue: template.description }),- prompt: template.prompt- ? t(`${prefix}.prompt`, { defaultValue: template.prompt, ...templateVariables })- : template.prompt,- parameters: template.parameters?.map((parameter) => ({- ...parameter,- label: t(`${prefix}.params.${parameter.key}.label`, { defaultValue: parameter.label }),- placeholder: parameter.placeholder- ? t(`${prefix}.params.${parameter.key}.placeholder`, { defaultValue: parameter.placeholder })- : parameter.placeholder,- })),- };-}--function sortTemplatesForMobile(- list: readonly RemoteScheduleTemplate[],-): RemoteScheduleTemplate[] {- return [...list].sort((a, b) => {- const rank = (TEMPLATE_CATEGORY_RANK[a.category] ?? 99) - (TEMPLATE_CATEGORY_RANK[b.category] ?? 99);- if (rank !== 0) return rank;- return a.name.localeCompare(b.name);- });-}--function selectBindableSessions(- sessions: readonly RemoteSession[],- deviceId: string,-): RemoteSession[] {- return sessions- .filter((session) => session.status === 'active')- .filter((session) => !deviceId || session.deviceLinkDeviceId === deviceId)- .sort((a, b) => sessionActivityTime(b) - sessionActivityTime(a))- .slice(0, 8);-}--function buildBoundSessionOptions(- sessions: readonly RemoteSession[],- selectedId: string,-): RemoteSession[] {- const options = sessions.slice(0, 6);- const selected = selectedId.trim()- ? sessions.find((session) => session.id === selectedId.trim())- : null;- if (!selected || options.some((session) => session.id === selected.id)) return options;- return [selected, ...options.slice(0, 5)];-}--function formatSessionOptionMeta(session: RemoteSession, dialogueLabel: string): string {- const agent = mobileAgentLabelFromUnknown(session.agentKind);- const workspace = session.workingDir ? lastPathSegment(session.workingDir) : dialogueLabel;- return `${agent} · ${workspace} · ${session.id.slice(0, 8)}`;-}--function lastPathSegment(path: string): string {- const parts = path.split(/[\\/]+/).filter(Boolean);- return parts.length ? parts[parts.length - 1] : path;-}--function sessionActivityTime(session: RemoteSession): number {- const time = Date.parse(session.userSendAt ?? session.updatedAt ?? session.createdAt);- return Number.isFinite(time) ? time : 0;-}--const makeStyles = (colors: ThemeColors) => StyleSheet.create({- safeArea: { flex: 1, backgroundColor: colors.surface },- summaryTopRow: {- alignItems: 'stretch',- flexDirection: 'row',- flexWrap: 'wrap',- gap: spacing.sm,- },- summaryCopy: {- color: colors.textSecondary,- fontSize: typeScale.footnote,- lineHeight: lineHeight.caption,- },- content: { gap: spacing.md, paddingHorizontal: spacing.lg, paddingVertical: spacing.md },- formCard: {- backgroundColor: colors.surfaceElevated,- borderColor: colors.border,- borderRadius: radius.container,- borderWidth: StyleSheet.hairlineWidth,- gap: spacing.md,- padding: spacing.lg,- },- formHeader: {- alignItems: 'center',- flexDirection: 'row',- justifyContent: 'space-between',- minHeight: 42,- },- formTitle: { color: colors.textPrimary, fontSize: typeScale.title, lineHeight: lineHeight.title, fontWeight: fontWeight.semibold },- formError: {- borderColor: colors.errorBorder,- borderRadius: radius.container,- borderWidth: StyleSheet.hairlineWidth,- color: colors.errorText,- fontSize: typeScale.footnote,- lineHeight: lineHeight.caption,- padding: spacing.md,- },- fieldGroup: { gap: spacing.xs },- fieldLabel: { color: colors.textTertiary, fontSize: typeScale.footnote, lineHeight: lineHeight.caption, fontWeight: fontWeight.regular },- fieldHint: { color: colors.textSecondary, fontSize: typeScale.footnote, lineHeight: lineHeight.caption },- input: {- backgroundColor: colors.surface,- borderColor: colors.border,- borderRadius: radius.container,- borderWidth: StyleSheet.hairlineWidth,- color: colors.textPrimary,- fontSize: typeScale.body,- minHeight: 46,- paddingHorizontal: spacing.md,- paddingVertical: spacing.sm,- },- textArea: { minHeight: 112 },- templateSection: { gap: spacing.sm },- templateHeader: {- alignItems: 'center',- flexDirection: 'row',- justifyContent: 'space-between',- minHeight: 32,- },- templateReloadButton: {- alignItems: 'center',- borderColor: colors.border,- borderRadius: radius.pill,- borderWidth: StyleSheet.hairlineWidth,- minHeight: 32,- justifyContent: 'center',- paddingHorizontal: spacing.md,- },- templateError: { color: colors.textSecondary, fontSize: typeScale.footnote, lineHeight: lineHeight.caption },- templateList: { gap: spacing.sm, paddingRight: spacing.md },- templateCard: {- borderColor: colors.border,- borderRadius: radius.container,- borderWidth: StyleSheet.hairlineWidth,- gap: spacing.xs,- minHeight: 128,- padding: spacing.md,- width: 212,- },- templateName: { color: colors.textPrimary, fontSize: typeScale.body, lineHeight: lineHeight.body, fontWeight: fontWeight.medium },- templateDescription: { color: colors.textSecondary, fontSize: typeScale.footnote, lineHeight: lineHeight.caption },- templateMeta: { color: colors.textTertiary, fontSize: typeScale.caption, lineHeight: lineHeight.caption, marginTop: 'auto' },- templateParams: { gap: spacing.md },- segmentRow: {- backgroundColor: colors.surface,- borderColor: colors.border,- borderRadius: radius.container,- borderWidth: StyleSheet.hairlineWidth,- flexDirection: 'row',- gap: spacing.xs,- padding: spacing.xs,- },- segmentButton: {- borderRadius: radius.container,- flex: 1,- minHeight: 38,- paddingHorizontal: spacing.sm,- },- toggleRow: {- alignItems: 'center',- borderColor: colors.border,- borderRadius: radius.container,- borderWidth: StyleSheet.hairlineWidth,- flexDirection: 'row',- justifyContent: 'space-between',- minHeight: 48,- paddingHorizontal: spacing.md,- },- toggleLabel: { color: colors.textPrimary, fontSize: typeScale.body, lineHeight: lineHeight.body, fontWeight: fontWeight.medium },- togglePill: {- alignItems: 'flex-start',- backgroundColor: colors.surfaceChip,- borderRadius: radius.pill,- height: 28,- justifyContent: 'center',- paddingHorizontal: 3,- width: 50,- },- togglePillActive: { alignItems: 'flex-end', backgroundColor: colors.cta },- toggleKnob: {- backgroundColor: colors.surfaceElevated,- borderRadius: radius.pill,- height: 22,- width: 22,- },- toggleKnobActive: { backgroundColor: colors.ctaText },- boundSessionOptions: { gap: spacing.xs },- boundSessionOption: {- borderColor: colors.border,- borderRadius: radius.container,- borderWidth: StyleSheet.hairlineWidth,- minHeight: 60,- paddingHorizontal: spacing.md,- paddingVertical: spacing.sm,- },- boundSessionOptionText: { flex: 1, gap: 2, minWidth: 0 },- boundSessionTitle: { color: colors.textPrimary, fontSize: typeScale.body, lineHeight: lineHeight.body, fontWeight: fontWeight.medium },- boundSessionMeta: { color: colors.textTertiary, fontSize: typeScale.caption, lineHeight: lineHeight.caption },- scheduleList: {- borderBottomColor: colors.border,- borderBottomWidth: StyleSheet.hairlineWidth,- },- scheduleRow: {- alignItems: 'center',- borderTopColor: colors.border,- borderTopWidth: StyleSheet.hairlineWidth,- borderBottomWidth: 0,- flexDirection: 'row',- minHeight: 94,- paddingHorizontal: spacing.md,- },- scheduleText: { flex: 1, gap: spacing.xs, minWidth: 0, paddingRight: spacing.md },- scheduleTitleRow: { alignItems: 'center', flexDirection: 'row', gap: spacing.sm, minWidth: 0 },- scheduleTitle: { color: colors.textPrimary, flex: 1, fontSize: typeScale.body, lineHeight: lineHeight.body, fontWeight: fontWeight.medium },- scheduleStatus: { color: colors.textTertiary, fontSize: typeScale.caption, lineHeight: lineHeight.caption, fontWeight: fontWeight.regular },- scheduleSubtitle: { color: colors.textSecondary, fontSize: typeScale.caption, lineHeight: lineHeight.caption },- scheduleDetail: { color: colors.textTertiary, fontSize: typeScale.caption, lineHeight: lineHeight.caption },- detail: { gap: spacing.md, paddingTop: spacing.lg },- detailCard: {- borderColor: colors.border,- borderRadius: radius.container,- borderWidth: StyleSheet.hairlineWidth,- gap: spacing.md,- padding: spacing.lg,- },- detailTitle: { color: colors.textPrimary, fontSize: typeScale.title, lineHeight: lineHeight.title, fontWeight: fontWeight.semibold },- detailMeta: { color: colors.textSecondary, fontSize: typeScale.caption, lineHeight: lineHeight.caption },- detailPrompt: { color: colors.textPrimary, fontSize: typeScale.body, lineHeight: lineHeight.body },- deleteCard: {- backgroundColor: colors.surfaceElevated,- borderColor: colors.errorBorder,- borderRadius: radius.container,- borderWidth: StyleSheet.hairlineWidth,- gap: spacing.md,- padding: spacing.lg,- },- pauseCard: {- backgroundColor: colors.surfaceElevated,- borderColor: colors.borderStrong,- borderRadius: radius.container,- borderWidth: StyleSheet.hairlineWidth,- gap: spacing.md,- padding: spacing.lg,- },- deleteHeader: {- alignItems: 'center',- flexDirection: 'row',- gap: spacing.md,- justifyContent: 'space-between',- minHeight: 42,- },- deleteHeaderText: { flex: 1, minWidth: 0 },- deleteTitle: { color: colors.textPrimary, fontSize: typeScale.title, lineHeight: lineHeight.title, fontWeight: fontWeight.semibold },- deleteCopy: { color: colors.textSecondary, fontSize: typeScale.body, lineHeight: lineHeight.body },- deletePreview: {- backgroundColor: colors.surface,- borderColor: colors.border,- borderRadius: radius.container,- borderWidth: StyleSheet.hairlineWidth,- color: colors.textSecondary,- fontSize: typeScale.footnote,- lineHeight: lineHeight.caption,- padding: spacing.md,- },- deleteOptions: { gap: spacing.sm },- deleteOption: {- alignItems: 'flex-start',- borderColor: colors.border,- borderRadius: radius.container,- borderWidth: StyleSheet.hairlineWidth,- flexDirection: 'row',- gap: spacing.md,- minHeight: 78,- padding: spacing.md,- },- radioMark: {- alignItems: 'center',- borderColor: colors.borderStrong,- borderRadius: radius.pill,- borderWidth: StyleSheet.hairlineWidth,- height: 22,- justifyContent: 'center',- marginTop: 2,- width: 22,- },- radioMarkSelected: { backgroundColor: colors.cta, borderColor: colors.cta },- radioMarkDot: {- backgroundColor: colors.ctaText,- borderRadius: radius.pill,- height: 8,- width: 8,- },- deleteOptionText: { flex: 1, gap: spacing.xs, minWidth: 0 },- deleteOptionTitle: { color: colors.textPrimary, fontSize: typeScale.body, lineHeight: lineHeight.body, fontWeight: fontWeight.medium },- deleteOptionDescription: { color: colors.textSecondary, fontSize: typeScale.footnote, lineHeight: lineHeight.caption },- runsHeader: {- alignItems: 'center',- flexDirection: 'row',- justifyContent: 'space-between',- minHeight: 28,- },- sectionTitle: {- color: colors.textTertiary,- fontSize: typeScale.footnote,- lineHeight: lineHeight.caption,- fontWeight: fontWeight.semibold,- textTransform: 'uppercase',- },- runList: { gap: spacing.sm },- runRow: {- alignItems: 'stretch',- borderColor: colors.border,- borderRadius: radius.container,- borderWidth: StyleSheet.hairlineWidth,- gap: spacing.md,- padding: spacing.md,- },- runText: { flex: 1, gap: spacing.xs, minWidth: 0 },- runTitleRow: { alignItems: 'center', flexDirection: 'row', gap: spacing.sm, minWidth: 0 },- runTitle: { color: colors.textPrimary, fontSize: typeScale.body, lineHeight: lineHeight.body, fontWeight: fontWeight.medium },- runTime: { color: colors.textTertiary, flex: 1, fontSize: typeScale.caption, lineHeight: lineHeight.caption, textAlign: 'right' },- runMeta: { color: colors.textTertiary, fontSize: typeScale.caption, lineHeight: lineHeight.caption },- runDetail: { color: colors.textSecondary, fontSize: typeScale.footnote, lineHeight: lineHeight.caption },- runActions: {- flexDirection: 'row',- flexWrap: 'wrap',- gap: spacing.sm,- },- runActionButton: { minHeight: 36, minWidth: 76 },- unreadDot: { backgroundColor: colors.textPrimary, borderRadius: radius.pill, height: 7, width: 7 },- emptyInline: {- borderColor: colors.border,- borderRadius: radius.container,- borderWidth: StyleSheet.hairlineWidth,- gap: spacing.sm,- padding: spacing.lg,- },-});diff --git a/apps/mobile/app/devices/[deviceId].tsx b/apps/mobile/app/devices/[deviceId].tsxindex 569251b1dd..45c526deae 100644--- a/apps/mobile/app/devices/[deviceId].tsx+++ b/apps/mobile/app/devices/[deviceId].tsx@@ -450,7 +450,6 @@ function DeviceDetailScreenContent() {);const bulkConfirmSummary = bulkConfirmAction ? bulkActionSummaries[bulkConfirmAction] : null;const selectionMode = selectionRequested || selectedSessionIds.length > 0;- const runningAutomationCount = filterCounts.runningAutomation;const controlsSummary = useMemo(() => remoteSessionControlsSummary(statusFilter, filterCounts),[filterCounts, statusFilter, t],@@ -942,27 +941,6 @@ function DeviceDetailScreenContent() {variant="pill"value={filterCounts.automation}/>- <View- style={{ minWidth: windowLayout.metricMinWidth }}- testID="deviceDetail.automationActions"- >- <MainWindowActionButton- action={{- accessibilityLabel: t('devices.detail.automationsButtonA11y'),- label: `${t('devices.detail.plan')}${runningAutomationCount > 0 ? ` · ${runningAutomationCount}` : ''}`,- onPress: () => guardedPush({- pathname: '/automations/[deviceId]',- params: { deviceId, name: deviceName },- }),- testID: 'deviceDetail.automationsButton',- }}- density="compact"- style={{- minHeight: windowLayout.metricMinHeight,- minWidth: windowLayout.metricMinWidth,- }}- />- </View>{loading ? <ActivityIndicator color={colors.textSecondary} /> : null}</View></SummaryStrip>diff --git a/apps/mobile/app/resources/[collectionId].tsx b/apps/mobile/app/resources/[collectionId].tsxindex 9fb6ab275d..4295d37c23 100644--- a/apps/mobile/app/resources/[collectionId].tsx+++ b/apps/mobile/app/resources/[collectionId].tsx@@ -1,6 +1,6 @@import { useRemoteResourceList } from '@/session/useRemoteResourceList';import { isRemoteResourceUnread } from '@/device-link/remoteResourceCache';-import { useLocalSearchParams, useRouter } from 'expo-router';+import { Redirect, useLocalSearchParams, useRouter } from 'expo-router';import { useCallback, useMemo } from 'react';import {ActivityIndicator,@@ -26,6 +26,7 @@ import { SimpleStackHeader, simpleScreenSafeAreaEdges } from '@/platform/chrome'import { useAuth } from '@/auth/AuthContext';import {type HostedRemoteCollectionItem,+ isMobileRemoteCollectionSupported,parseRemoteResourceTargets,} from '@/device-link/remoteResources';import { goBackGuarded } from '@/utils/backGuard';@@ -46,6 +47,13 @@ function timestampLabel(value: number | undefined, locale: string): string | nul}export default function RemoteCollectionScreen() {+ const params = useLocalSearchParams<{ collectionId?: string | string[] }>();+ const collectionId = Array.isArray(params.collectionId) ? params.collectionId[0] ?? '' : params.collectionId ?? '';+ if (!isMobileRemoteCollectionSupported(collectionId)) return <Redirect href="/devices" />;+ return <RemoteCollectionScreenContent />;+}++function RemoteCollectionScreenContent() {const styles = useThemedStyles(makeStyles);const { colors } = useTheme();const { t, i18n } = useTranslation();diff --git a/apps/mobile/app/resources/[collectionId]/[resourceId].tsx b/apps/mobile/app/resources/[collectionId]/[resourceId].tsxindex b2feb45269..14b3d9821c 100644--- a/apps/mobile/app/resources/[collectionId]/[resourceId].tsx+++ b/apps/mobile/app/resources/[collectionId]/[resourceId].tsx@@ -1,5 +1,5 @@import { useAuth } from '@/auth/AuthContext';-import { useFocusEffect, useLocalSearchParams, useRouter } from 'expo-router';+import { Redirect, useFocusEffect, useLocalSearchParams, useRouter } from 'expo-router';import { useCallback, useMemo, useRef, useState } from 'react';import { ActivityIndicator, AppState, StyleSheet, View } from 'react-native';import { SafeAreaView } from 'react-native-safe-area-context';@@ -11,7 +11,7 @@ import { startFocusedTopicSubscription } from '@/device-link/focusedTopicSubscriimport { Text } from '@/components/AppText';import { MainWindowActionButton, MainWindowEmptyState } from '@/components/MobilePrimitives';import { useDeviceLink } from '@/device-link/DeviceLinkContext';-import { getRemoteResource, invokeRemoteResourceAction, type RemoteResourceHostTarget } from '@/device-link/remoteResources';+import { getRemoteResource, invokeRemoteResourceAction, isMobileRemoteCollectionSupported, type RemoteResourceHostTarget } from '@/device-link/remoteResources';import { formatRemoteError } from '@/device-link/remoteStatus';import { SimpleStackHeader, simpleScreenSafeAreaEdges } from '@/platform/chrome';import { remoteSessionStore } from '@/session/remoteSessionStore';@@ -25,6 +25,12 @@ function firstParam(value: string | string[] | undefined): string {}export default function RemoteResourceResolverScreen() {+ const params = useLocalSearchParams<{ collectionId?: string | string[] }>();+ if (!isMobileRemoteCollectionSupported(firstParam(params.collectionId))) return <Redirect href="/devices" />;+ return <RemoteResourceResolverScreenContent />;+}++function RemoteResourceResolverScreenContent() {const styles = useThemedStyles(makeStyles);const { colors } = useTheme();const { t, i18n } = useTranslation();diff --git a/apps/mobile/docs/mobile-current-execution-plan.md b/apps/mobile/docs/mobile-current-execution-plan.mdindex 79e18b0802..60b92f5153 100644--- a/apps/mobile/docs/mobile-current-execution-plan.md+++ b/apps/mobile/docs/mobile-current-execution-plan.md@@ -1,5 +1,7 @@# Cindy Mobile Current Execution Plan+> 自动化范围修订(2026-09-27):手机已移除旧 Scheduler 管理页和 Routines,包括「所有任务」下拉及伙伴资料入口;不再把查看、创建、编辑或运行规则列为手机交付、后续计划或验收项。PC 管理与执行、已有任务数据和运行历史保留。本文所有旧自动化管理实现、原型验证和计划记录仅作历史背景,不代表待恢复功能;当前边界以[伙伴运行时合同](../../../docs/product-rules/cindy-bots-runtime.md)为准。+> 日期: 2026-06-19> 状态: 当前唯一执行合同。其它 mobile 文档保留源码审计、历史背景和长期能力矩阵。> 北极星: iOS 优先交付一个桌面同源、信息更少、动作更轻、真实可用的 Cindy 远程会话体验。@@ -198,7 +200,7 @@ Composer 是桌面 `ChatInput` 的触控版。- 完整 Orca 协作模式、lead / worker / focus 编排。- 完整文件编辑器、dirty conflict、远程 reveal/open/exec。-- 自动化计划的完整创建/编辑闭环。+- Scheduler / Routines 管理已移除,不属于延后待做项;PC 功能与已有任务运行历史保留。- Android 视觉 polish 和真机 baseline。- 复杂 dashboard、调试控制台、远程设备管理后台。diff --git a/apps/mobile/docs/mobile-desktop-source-inventory.md b/apps/mobile/docs/mobile-desktop-source-inventory.mdindex 6b77799974..bdd1f0ed5a 100644--- a/apps/mobile/docs/mobile-desktop-source-inventory.md+++ b/apps/mobile/docs/mobile-desktop-source-inventory.md@@ -1,5 +1,7 @@# Cindy Mobile Desktop Source Inventory+> 自动化范围修订(2026-09-27):手机已移除旧 Scheduler 管理页和 Routines,包括「所有任务」下拉及伙伴资料入口;不再把查看、创建、编辑或运行规则列为手机交付、后续计划或验收项。PC 管理与执行、已有任务数据和运行历史保留。本文所有旧自动化管理实现、原型验证和计划记录仅作历史背景,不代表待恢复功能;当前边界以[伙伴运行时合同](../../../docs/product-rules/cindy-bots-runtime.md)为准。+> 日期: 2026-06-17> 目标: 从桌面版源码逐项反推手机版远程控制需要覆盖的界面、内容、状态和测试条件。> V1 边界: 除完整协作 / Orca 编排外,把普通单会话远程控制和非协作附属能力做完整。协作会话 V1 只识别、只读、安全降级。@@ -48,7 +50,7 @@ V1 的判断标准:| 会话详情 | 消息流、发送、停止、队列、pending interactions、基础会话动作 | diff、context/cost detail、fork/rewind、媒体增强 | 多窗/多 pane 级能力 || 新会话 | 选择远程电脑、工作区、agent/model/permission/fast、首条消息 | extra dirs、附件、slash、@、语音 | 项目模板和高级工作流 || 文件 | 工具引用文件卡、只读文件预览 | 文件树、文件 tabs、同目录 session tabs | 完整编辑器、dirty/conflict/save |-| 自动化 | 查看 schedules、运行历史、run now、pause/resume | 创建/编辑普通 schedule、模板参数 | project automation 完整管理 |+| 自动化管理 | 手机已移除,保留已有任务与运行历史 | 不再计划手机创建/编辑 | 不再计划手机高级管理;PC 功能保留 || 协作 | 识别 lead/worker,安全只读提示 | worker 快速跳转 | 完整 Orca 移动编排 |## 4. 手机信息架构@@ -61,7 +63,7 @@ V1 的判断标准:| Devices | remote projects / controllable computers | 二级/调试入口。展示同账号电脑、不可控原因、撤权、同步失败和重新同步,不作为进入会话的必经路径。 || Session | `/cc-agent/:sessionId` | 主控制面。消息流常驻,底部根据 pending interaction 或 composer 切换。 || New | `/cc-agent/new` | 从选中电脑创建远程会话。手机不选择本机 cwd,只选择电脑端可用工作区。 |-| Automations | `/cc-agent/scheduled` | 移动版计划任务。V1 先看和运行,V1B 创建/编辑。 |+| Automations(已移除) | 桌面 Scheduler 继续保留 | 手机无管理入口,旧链接仅跳转设备页。 || Files | `/cc-agent/files/:sessionId` | V1B 只读文件页。完整编辑留 V2。 || Settings | 登录、设备、relay、debug | mock login / Feishu login / 退出、设备名、日志导出。手机版第一刀已拆成独立 `/settings` 主窗口;被控权限开关仍归桌面端设置。 |@@ -483,7 +485,9 @@ V1B:- search 可 V1B。- edit mode V2。-## 12. 自动化 / 计划+## 12. 自动化 / 计划(桌面事实与手机历史设计)++本节手机管理方案均已退役,不作为当前实现、后续排期或验收要求。桌面行为和已有任务运行历史不受影响。### 12.1 SchedulerPage@@ -846,13 +850,12 @@ V2 需要单独设计:- diff。- context/cost detail。- file preview。-- automations read/run/pause/resume。-- schedule create/edit basic。+- 手机管理入口保持移除;既有任务与运行历史仍可保留。验收:- 非协作常用桌面能力在手机端有入口。-- 文件编辑、完整 project automation、完整 Orca 明确降级。+- 文件编辑、完整 Orca 明确降级;project automation 管理仅保留桌面端。### Phase 7: 自动化回归和调优@@ -879,7 +882,7 @@ V1 完成不是“能发消息”,而是以下条件全部成立:- Permission / Ask User / Plan Review 都可完成;Issue Confirm 提示回桌面端处理。- 模型、effort、permission、fast 与桌面 session 状态同步。- fork/rewind/diff/context/cost 有移动入口或明确 V1B 完成项。-- 自动化计划至少可查看、运行、暂停、恢复;创建/编辑进入 V1B。+- 手机不提供 Scheduler / Routines 管理;旧链接安全跳转,已有任务和运行历史保留。- 文件引用可查看;完整编辑器明确 V2。- 协作 session 可识别并安全降级。- iOS Simulator 和 Android Emulator 至少各有一条自动 smoke 路径。diff --git a/apps/mobile/docs/mobile-v1-source-plan.md b/apps/mobile/docs/mobile-v1-source-plan.mdindex 4f83013610..df9ef1c2a5 100644--- a/apps/mobile/docs/mobile-v1-source-plan.md+++ b/apps/mobile/docs/mobile-v1-source-plan.md@@ -1,5 +1,7 @@# Cindy Mobile V1 Source-Based Implementation Plan+> 自动化范围修订(2026-09-27):手机已移除旧 Scheduler 管理页和 Routines,包括「所有任务」下拉及伙伴资料入口;不再把查看、创建、编辑或运行规则列为手机交付、后续计划或验收项。PC 管理与执行、已有任务数据和运行历史保留。本文所有旧自动化管理实现、原型验证和计划记录仅作历史背景,不代表待恢复功能;当前边界以[伙伴运行时合同](../../../docs/product-rules/cindy-bots-runtime.md)为准。+> 日期: 2026-06-18> 目标: 按桌面版源码逐项对齐手机版远程控制能力。> 边界: V1 做完除完整协作 / Orca 编排外的单会话远程控制能力;协作模式 V1 只识别、只读、安全降级。@@ -43,7 +45,7 @@ V1 不应做:- 完整 Orca lead / worker split 或 focus 编排。- 手机端完整文件编辑器和 dirty conflict 处理。- 手机端直接触发被控电脑 reveal/open/exec 这类远程执行入口。-- project automation 的高级管理闭环,除非后续专门补移动端设计。+- Scheduler / Routines 管理已退出手机范围,后续不安排高级编辑器。### 1.1 Shared Core 架构修正@@ -150,7 +152,7 @@ V1 不应做:| P0 | Composer 改成桌面 `ChatInput` 的 icon-first 触控版 | 附件/更多、输入框、语音、发送/停止按桌面顺序和语义渲染,语音在发送左侧。 | 不使用“附件 / 语音 / 发送”大文字按钮;不新增桌面没有的主层说明。 | `sessionComposer*` 单测锁顺序和图标化;typecheck;Maestro source anchor;截图检查。 || P1 | Pending / queue / controls sheet 降噪 | 权限、提问、计划、队列、设置进入 sheet,只显示当前必须处理的信息。 | 不把桌面右栏/hover/tooltip 内容展开到主层;Issue confirm 不做手机表单。 | shared interaction/queue/control tests + iOS 主要路径截图。 || P1 | 文件、payload、diff 只读承载 | 消息内 file/diff/media chip 进入 full-screen viewer 或只读文件页。 | V1 不做完整文件编辑器、dirty/conflict/save。 | file/payload shared fixture、viewer smoke、source anchor。 |-| P2 | 自动化基础查看和运行 | schedules 列表、run history、run now、pause/resume、基础创建/编辑。 | 不先做 project automation 高级管理闭环。 | schedule shared tests、mobile flow smoke。 |+| 已移除 | 手机自动化管理 | 不提供 schedules / routines 管理入口;保留已有任务和运行历史。 | PC 管理功能保留。 | 资源过滤及旧链接跳转回归;不再运行已删除的管理流程。 || P2 | Android 不埋坑 | 所有布局模型平台无关;保留 Android profile/doctor/dry-run。 | iOS 未验收前不把 Android baseline 作为阻断项。 | Android dry-run/profile 通过,不写 iOS-only 协议和布局假设。 |#### 1.4.3 每个界面的执行模板@@ -234,7 +236,7 @@ V1 不应做:聊天正文必须尽量在当前可见文本上直接选择部分内容。弹窗、整条复制、长按菜单只能是辅助,不能成为唯一复制路径。5. **主要窗口优先**- 先把首页和会话页打磨到能长期使用,再做文件、自动化、协作、Android baseline 等外围能力。Android 暂时可以简单,但 shared model 和布局不能写死 iOS-only 假设。+ 先把首页和会话页打磨到能长期使用,再做文件、协作、Android baseline 等外围能力。Android 暂时可以简单,但 shared model 和布局不能写死 iOS-only 假设。#### 1.6.2 Home 主窗口目标@@ -413,7 +415,7 @@ P1 在 P0 稳定后进入,目标是让主窗口的二级能力可用但不喧宾P2 继续后移:-- automations 的创建/编辑闭环。+- 不恢复已移除的 Scheduler / Routines 管理入口。- 完整文件编辑器、dirty conflict、远程 reveal/open/exec。- 完整 Orca 协作编排。- Android 视觉 baseline。Android 先保留 profile、doctor、dry-run 和不写死 iOS-only 假设。@@ -492,7 +494,7 @@ P2 继续后移:| Computer Detail | desktop sidebar filter/search/bulk affordances + remote device state | 二级/调试页。只承载设备级状态、不可用原因、撤权/离线提示、同步失败和高级调试;不再作为打开会话的必经首页。 || Session Detail | `CCAgentSessionView` | 单会话完整控制:消息流、输入、队列、pending interaction、会话设置、媒体、diff、fork/rewind。 || New Session | `NewMakerDraftRoute` + `ChatInput` | 远程项目/对话工作区、agent/model/effort/permission/fast、extra dirs、首条消息、附件、语音。 |-| Automations | `SchedulerPage` | 查看和基础管理自动化计划;V1B 补创建/编辑普通 schedule。 |+| Automations(已移除) | `SchedulerPage` 仅保留桌面管理 | 手机无管理页,旧链接仅跳转。 || Settings | desktop settings remote/device/login | 登录态、手机设备名、relay 状态、调试信息、退出登录。 |### 3.2 手机会话详情结构@@ -1044,6 +1046,8 @@ P2 继续后移:## 12. 自动化 / Scheduler+> 历史设计:手机版已移除自动化与例行任务管理入口及其 Maestro 流程,保留运行历史。当前测试命令以 [README](../README.md) 为准。+### 12.1 桌面事实`SchedulerPage` 的关键语义:@@ -1108,8 +1112,6 @@ V1 暂缓:- 当前已有 `scheduleModel.test` 覆盖 sort/filter/summary/run folding。- 当前已有 `scheduleFormModel.test` 覆盖 create/update/template input serialization。- 当前已有 `scheduleDelete.test` 覆盖生成会话 keep/archive/delete 删除策略。-- 当前已有 `automations.yaml` 覆盖 run now、pause/resume、open session。-- 当前已有 `automations_create_edit.yaml` 覆盖 template gallery、create/edit、delete dialog。## 13. 文件页和选项卡@@ -1282,7 +1284,7 @@ pnpm --filter mobile test -- <对应 mobile adapter 测试>- issue confirm。- media image/video/audio。- fork/rewind。-- automations run now。+- 旧自动化链接跳转,routines 集合不展示且不可调用管理动作。- device offline。- revoked。- reconnect rehydrate。@@ -1297,7 +1299,7 @@ pnpm --filter mobile test -- <对应 mobile adapter 测试>- Message: user、assistant、tool collapsed/expanded、todo、work group、system。- Payload: media、diff、tool result、file preview、Mermaid。- Interactions: permission、ask、plan、issue。-- Automations: list、detail、form。+- 已移除的 Automations 管理页不再纳入视觉矩阵。检查点:@@ -1344,7 +1346,7 @@ V1 验收线:| 7 | Media/diff/payload | 图片/视频/音频/diff/tool payload/Mermaid 完成。 || 8 | Fork/rewind | fork、preview、commit、回填 draft 完成。 || 9 | New session | project/dialogue、remote dir、agent settings、首条消息、附件/语音完成。 |-| 10 | Automations V1B | list/detail/run/pause/resume/delete/create/edit 普通 schedule 已完成基础闭环;fresh/persistent/bound 运行会话编辑第一刀已对齐桌面语义;project automation 完整编辑仍按 V2 级别继续对齐。 |+| 10 | Automations V1B(历史交付,已退役) | 手机管理页及入口已移除,不再继续补齐 project automation 编辑;PC 功能、已有任务及运行历史保留。 || 11 | File preview V1B | message file chip、diff 当前文件按需读取、独立 `/files/[sessionId]` 只读远程文件页、目录浏览、手动文件路径预览、路径复制、oversize/not_found/forbidden/read_failed 文案、PDF/drawio 降级卡片和 `file_preview.yaml` / `file_browser.yaml` 自动化锚点已完成;真实 native Maestro 点击运行待 CLI 可用后补。 || 12 | Collaboration safe degrade | lead/worker 识别、会话只读、pending interaction 只读、queue 只读、session controls 写操作禁用已完成;真实 Orca fixture 点击流待 Maestro 可用后补。 || 13 | E2E/visual/perf | web smoke、Maestro 静态锚点、本地 relay preflight、native doctor、local full preflight、1000 message 和 1000 session 性能门禁已跑通;`ios-iphone-17-pro-expo-go` 当前已接受 12 张视觉基线并可严格 hash 校验,包括 `visual-settings` 和 `visual-session-payload`;Android 设备 profile 后补。 |@@ -1416,7 +1418,7 @@ Shared core 迁移并不是额外阶段,而是 1-13 每个阶段的实现约束:1. **先迁共享语义**:schedule list/run overview、schedule form serialization、delete policy、device-link channel/error contract、allowlist drift fixture、shared fixture baseline、raw desktop-like message parity、schedule/file raw payload parity 已迁到 `packages/maker-shared`;后续新增业务语义仍先进入 shared core。2. **再重构移动端壳层**:保留 React Native 原生壳,但重新组织一级入口、详情页层级、sheet/full-screen route 和 debug surface。所有正式页面都只消费 shared model 或 typed mobile adapter,不直接解析桌面 raw payload。3. **然后做会话页视觉和触控 pass**:按 `docs/design-rules/cindy-design-system.md` 的黑白灰、无阴影、12px container、pill interactive、克制字重整理 header、消息、工具、队列、pending interaction、composer 和状态提示。手机端只因触控和窄屏调整布局,不改变桌面业务语义。-4. **最后补功能缺口和调优**:在 UI 层级稳定后,再补 project automation 完整编辑、worktree 创建设计、Orca V2、native share extension、真实 OSS 媒体播放 fixture 这些后续项。+4. **最后补功能缺口和调优**:在 UI 层级稳定后,再补 worktree 创建设计、Orca V2、native share extension、真实 OSS 媒体播放 fixture 这些后续项。当前下一批具体任务按产品化重构排序:@@ -1426,13 +1428,13 @@ Shared core 迁移并不是额外阶段,而是 1-13 每个阶段的实现约束:| P0 | Home/sidebar parity baseline | `PinnedSection`、`ProjectsSection`、`DialogueSection`、`ProjectNode`、`SessionItem`、`VendorIcon`、`formatSidebarTime` | 首页继续作为全局主窗口样板:保留 Projects / Chats / Pinned 层级、一行 session row、桌面同源图标、右侧短时间、attention dot 和真实可用 action;设备筛选 chip 只做筛选,不把“选电脑”变成一级流程。 | iOS 首页截图与桌面侧栏源码规则逐项对齐;不出现 Relay 成功态、debug 说明、session subtitle/preview/detail 这类桌面侧栏主层没有的信息。 || P0 | shared core 第一轮收口 | `MessageStream`、`PendingQueuePanel`、`PermissionPrompt`、`ScheduleFormDialog`、`WorkdirBrowseRoute`、device-link dispatch | 已完成 automation/schedule、device-link contract、fixture baseline、raw message parity、schedule/file raw payload parity;后续新增业务语义仍先进入 shared model。 | shared build/test、mobile typecheck/test、desktop parity、web smoke、Maestro 静态检查、local full check-only 全部可跑。 || P0 | shared core 剩余抽取边界 | tool input diff/summary projection、tool_result media extraction、attachment -> file/media payload projection、message normalize content preview / stable sort / tool_use parse / tool_result pairing、`MessageStream` search/window、`ChatInput` capability projection、scheduler event projection 和 payload preview/severity 第一刀已完成 | 只抽纯模型:后续若出现新的排序、状态优先级、disabled reason、payload body presentation 或 decision serialization,继续先进入 shared。纯触控尺寸、SafeArea、WebView、Audio、ImagePicker、SecureStore 留在 mobile。 | 每个抽取都有 shared fixture;mobile 保留 re-export 兼容;桌面消费前至少有 parity test。 |-| P1 | mobile shell 信息架构 | `App.tsx`、`router.tsx`、`CCAgentFeatureLayout`、desktop sidebar/settings | 重排 Home/Computer Detail/Session/New/Automations/Files/Settings;debug/local test 移入 dev panel;正式路径只显示真实远程控制任务。 | web smoke 和 Maestro anchor 可区分正式路径和 debug 路径;首次进入不出现本地联调说明、mock 表单或成功态连接噪音。 |-| P1 | 重要主窗口产品化 | `CCAgentFeatureLayout`、`NewMakerDraftRoute`、`SchedulerPage`、`WorkdirBrowseRoute`、desktop sidebar/session list | 以首页为样板逐一重做 Computer Detail、New Session、Session Detail、Files、Automations、Settings 的主层信息密度。每个主窗口只保留桌面同级主层信息;其它状态进入 sheet/full-screen/detail。 | iOS 主要路径窗口在 320/393 宽度下无挤压、无多余卡片嵌套、testID 不断;每个窗口有降噪清单和截图;Android 只消费同一布局模型和 dry-run profile。 |+| P1 | mobile shell 信息架构 | `App.tsx`、`router.tsx`、`CCAgentFeatureLayout`、desktop sidebar/settings | 重排 Home/Computer Detail/Session/New/Files/Settings;debug/local test 移入 dev panel;正式路径只显示真实远程控制任务。 | web smoke 和 Maestro anchor 可区分正式路径和 debug 路径;首次进入不出现本地联调说明、mock 表单或成功态连接噪音。 |+| P1 | 重要主窗口产品化 | `CCAgentFeatureLayout`、`NewMakerDraftRoute`、`SchedulerPage`、`WorkdirBrowseRoute`、desktop sidebar/session list | 以首页为样板逐一重做 Computer Detail、New Session、Session Detail、Files、Settings 的主层信息密度。每个主窗口只保留桌面同级主层信息;其它状态进入 sheet/full-screen/detail。 | iOS 主要路径窗口在 320/393 宽度下无挤压、无多余卡片嵌套、testID 不断;每个窗口有降噪清单和截图;Android 只消费同一布局模型和 dry-run profile。 || P1 | RN 视觉 primitives | `docs/design-rules/cindy-design-system.md`、桌面按钮/卡片/状态 chip 语义 | 在 `apps/mobile` 建轻量 touch primitives:screen header、status strip、action pill、segmented control、bottom sheet container。只共享语义,不共享桌面 React 组件。 | iPhone SE 宽度按钮文字不挤压;所有新增颜色可回指到 mobile token;不引入阴影和装饰性渐变。 || P1 | session detail shell | `CCAgentSessionView`、`SessionContentHeader`、`RemoteSessionBanner`、`TopRightChipStack` | 固定 header、connection strip、message list、bottom composer/interaction 四层;controls/queue/search/files/diff/context/cost 转为 action strip + sheet/full-screen。 | idle、running、pending、queue、offline、revoked 六个状态截图无重叠;消息列表不因打开 sheet 被卸载。 || P1 | composer/pending 触控重构 | `ChatInput`、`PendingQueuePanel`、`PermissionPrompt`、`AskUserQuestionPrompt`、`PlanViewerCard`;`IssueConfirmCard` desktop-only | composer 保持底部主入口;pending interaction 优先占用底部面板;queue 和 controls 用 sheet;resolve 操作防重复提交;Issue Confirm 只提示回桌面端处理。 | permission/ask/plan/queue/send/stop/resume 都有 mock host flow 或 unit;键盘弹出后最后消息仍可见。 || P2 | message/payload 视觉重构 | `UserMessage`、`AssistantMessage`、`AgentActionsBlock`、`TodoListCard`、`ToolPayloadLightbox` | 按 shared render item 渲染;tool/work/todo 默认折叠;payload、diff、media、Mermaid、file preview 全屏查看。 | 1000 message fixture 可滚动;长 tool result 和大 diff 不撑爆消息列表;媒体关闭释放中转对象。 |-| P2 | feature parity hardening | `NewMakerDraftRoute`、`SessionControlsPanel`、`SchedulerPage`、`WorkdirBrowseRoute`、`MessageActionBar` | UI 稳定后补 new session、session controls、automations、file preview、fork/rewind 的细节缺口;不在粗糙壳层上继续加入口。fork/rewind 已先把 preview 面板触控布局补成可测 mobile shell 模型。 | 每个缺口至少一个 unit 或 E2E;桌面协议 shape 用 shared fixture 或 desktop parity 锁定。 |+| P2 | feature parity hardening | `NewMakerDraftRoute`、`SessionControlsPanel`、`SchedulerPage`、`WorkdirBrowseRoute`、`MessageActionBar` | UI 稳定后补 new session、session controls、file preview、fork/rewind 的细节缺口;不在粗糙壳层上继续加入口。fork/rewind 已先把 preview 面板触控布局补成可测 mobile shell 模型。 | 每个缺口至少一个 unit 或 E2E;桌面协议 shape 用 shared fixture 或 desktop parity 锁定。 || P2 | release-grade gate | desktop remote runner、mock host、Maestro、visual baseline、performance fixture | iOS profile 先固定为主回归;Android 保留 profile/doctor/dry-run 防坑,最终 release 前补同级 native flow / visual baseline。 | 用户复测前脚本给出明确通过/失败原因;不能把手工点测当主回归。 |当前执行进展和下一步:@@ -1450,7 +1452,7 @@ Shared core 迁移并不是额外阶段,而是 1-13 每个阶段的实现约束:11. **重要主窗口优先第二十四刀已完成**:`mainWindowLayout.ts` 留在 mobile shell,按 screen width + window kind 输出 summary、toolbar、content、block、list、empty、inline action 的 padding/gap/min-size。设备列表、设备详情、新建会话、文件浏览、自动化窗口已接入;summary 指标支持小屏换行,文件路径输入在窄屏自动堆叠,空态和主内容边距统一;第二刀新增 `MainWindowMetric` / `MainWindowEmptyState`,把设备、新建会话、自动化和文件页的重复 metric / empty UI 收敛成移动端 primitives;第三刀新增 `MainWindowActionGroup`,自动化详情把 Run now 放主操作、暂停/恢复与编辑放次级操作、删除放危险操作,并用 `automations.detailActions` 锚点锁住层级;第四刀继续把新建会话底部提交区、文件浏览目录操作区和选中文件预览操作区接入 `MainWindowActionGroup`,新增 `newSession.actions`、`files.directoryActions`、`files.previewActions` 容器锚点;第五刀把设备详情顶部 toolbar、批量选择操作和批量确认操作接入 `MainWindowActionGroup`,新增 `deviceDetail.toolbarActions`、`deviceDetail.selectionHeaderActions`、`deviceDetail.bulkPrimaryActions`、`deviceDetail.bulkDangerActions`、`deviceDetail.bulkConfirmActions` 容器锚点,并给 toolbar/选择头补 compact density;第六刀把自动化空态创建、表单保存/取消、删除确认和暂停确认接入 `MainWindowActionGroup`,新增 `automations.emptyActions`、`automations.form.actions`、`automations.delete.actions`、`automations.pause.actions` 容器锚点;第七刀把设备列表顶部不可用设备切换和空态重新同步接入 `MainWindowActionGroup`,新增 `devices.filterActions`、`devices.emptyActions` 容器锚点;第八刀把新建会话远程目录浏览打开/刷新/上级/使用当前目录接入 `MainWindowActionGroup`,新增 `newSession.remoteBrowseActions`、`newSession.remoteBrowsePanelActions` 容器锚点;第九刀把文件页当前目录复制和路径前往动作改用 `MainWindowActionButton`,新增 `files.locationActions`、`files.pathInputActions` 容器锚点,并继续消费 `mainWindowLayout` 的 inline action 尺寸;第十刀把自动化运行历史打开会话动作改用 `MainWindowActionButton`,新增 `automations.runActions` 容器锚点;第十一刀把设备详情 summary 的自动化入口改用 `MainWindowActionButton`,新增 `deviceDetail.automationActions` 容器锚点;第十二刀新增 `MainWindowOptionButton` / `MainWindowRowButton`,设备详情筛选/分组/session row/自动化子 row 和新建会话最近项目/运行选项/远程目录行已接入统一 pressed / selected / expanded / disabled accessibility state;第十三刀把文件页面包屑/文件行和自动化 segment/schedule row 继续接入同一套 option/row primitive;第十四刀新增 `MainWindowCardButton`,设备列表行、自动化删除单选、模板刷新、模板卡片和 boolean toggle 已接入统一 pressed / selected / checked / disabled accessibility state;第十五刀把全局 `ConnectionBanner` 重新同步入口接入 busy-aware `MainWindowActionButton`;第十六刀把登录页 Feishu 登录、debug entry、dev modal 关闭、mock 登录、callback 兜底和 Web 关闭入口接入同一 action primitive;第十七刀把 `ScreenHeader` 右侧 action 接入 compact `MainWindowActionButton`,并删除旧 `PillButton`;第十八刀让主窗口 action/option/row/card primitive 把缺少 handler 的入口也视为 disabled,统一不可交互事实源;第十九刀给可点击 `MainWindowMetric` 补 selected accessibility state;第二十刀把 `ScreenHeader` 左侧返回入口抽成 `ScreenBackButton`,统一 pressed / disabled / accessibility state;第二十一刀把自动化表单的运行会话三态接入 shared schedule form model,并用当前设备会话选项 + ID 输入兜底承载 bound;第二十二刀让自动化列表/详情消费 shared schedule summary 显示新会话/持续会话/绑定会话,并新增 automations.runSessionDetail 锚点;第二十三刀让运行历史消费 shared run summary 显示耗时 meta 和会话短标识,并新增 automations.runMeta 锚点;第二十四刀让运行历史行消费 shared action capability,补齐打开会话、标已读、无会话异常重跑和删除确认,并新增 `automations.markRunReadButton`、`automations.restartRunButton`、`automations.deleteRunButton`、`automations.runDelete*` 锚点。路由和远程调用仍走现有 typed transport;run action 容器从 `automations.runSessionActions` 收敛为 `automations.runActions`。12. **Session route action primitive 第四刀已完成**:`app/sessions/[sessionId].tsx` 新增局部 `RouteActionButton` / `SheetBackdropButton`,composer 附件/语音/停止/发送、搜索上一条/下一条/加载更早、未同步重新同步、历史消息展开和 settings/queue/search backdrop 已统一 pressed / disabled / busy / selected accessibility state。第二刀补齐 `ActionPill` 的 selected/disabled accessibility state,并把 queue/search sheet header 的关闭入口接入 `RouteActionButton`;第三刀让 `RouteActionButton` 在 busy 期间不可重复触发;第四刀让 `ActionPill` 和 `RouteActionButton` 在缺少 handler 时也进入 disabled 状态。业务语义仍来自 shared composer/search/window/session operation model,route 只负责触控反馈、sheet 关闭和 native 输入能力。13. **Android baseline 后置**:Android 当前不作为 C/D 阶段阻断项;只保留 `android-pixel-expo-go` profile、doctor 和 dry-run 防坑。等 iOS 高标准验收后,再采集独立 Android baseline 目录并提升为发布前门禁。-14. **最后补剩余 parity 缺口**:在 shell 和视觉基线稳定后继续补 project automation、share extension、Orca V2 和真实 OSS 媒体 fixture;这些不能插队到 C1 前面。+14. **最后补剩余 parity 缺口**:在 shell 和视觉基线稳定后继续补 share extension、Orca V2 和真实 OSS 媒体 fixture;这些不能插队到 C1 前面。### 16.2 更新后的下一批执行批次@@ -1463,7 +1465,7 @@ Shared core 迁移并不是额外阶段,而是 1-13 每个阶段的实现约束:| C0 | Shared UI model increment | message normalize 已完成第一刀:`messageNormalize.ts` 输出 desktop content preview、stable key、createdAt stable sort、tool_use parse、tool_result by-id / legacy adjacency pairing 和 Orca 空通信结果隐藏;payload summary/body/preview/tool input diff/summary projection/tool_result media extraction/attachment projection 已完成第一刀:`payloadSummary.ts` 输出 payload kind/title/subtitle/copy/open target、body presentation、preview severity、primary action、compact meta、ToolCallCard 同款 summary、Edit/Write/MultiEdit diff projection、tool_result media extraction、attachment -> file/media payload projection、diff/media/file/mermaid/text 构造/格式化;message presentation 已完成第一刀:`messagePresentation.ts` 输出 bubble density/role、desktop-style fold header、todo progress/summary/status、错误识别和 diff 计数,不再产出 mobile-only badge/signals 字段;system card presentation 已完成第一刀:`systemCard.ts` 输出 help/context/cost/pwd/status/compact/cmd 的行、标题和正文模型;message window/search 已完成第一刀:`messageWindow.ts` / `messageSearch.ts` 输出滚动锚点、新消息提示、加载更早 action、搜索命中、preview 和 index wrap;capability projection 已完成第一刀:`agentCapabilities.ts` 输出远端能力归一、运行选项和跨模型切换确认;session action strip 已完成第一刀:`sessionActionStrip.ts` / `sessionIdentity.ts` 输出 header、state chips、action labels、disabled reason、协作/Worktree/Dialogue 标识;device list 已完成第一刀:`deviceList.ts` 输出可控性分类、排序、平台标签、可见性、header/filter/empty/toggle presentation;session list / bulk selection 已完成第一刀:`sessionList.ts` / `sessionSelection.ts` 输出筛选、搜索、分组、自动化组行、列表上下文、空状态和批量 patch projection;scheduler event projection 已完成第一刀:`scheduleEvents.ts` 输出 list/runs/session-index/unread refresh intent;mobile payload viewer、消息流、system card、controls、new session、action strip、device list、session list、schedule event store 和 payload preview 入口已消费。 | shared fixture + mobile adapter test;桌面消费前至少有 desktop parity test 或 fixture 对齐。 || C1 | Message/payload polish | 第二刀进行中:payload viewer header 统一使用 shared summary/preview,并提供复制 payload 内容 / 安全打开直接 URL 的触控动作;`payloadHeaderLayout.ts` 已把复制/打开/关闭/图库翻页的窄屏堆叠规则做成平台无关 mobile layout model;header 内复制、打开、上一张、下一张和关闭动作已统一到局部 `PayloadHeaderActionButton`;payload body 使用 shared media/file/text/Mermaid presentation;message bubble 使用 shared density/role;message action bar 已把 copy/more/fork/rewind 的 36px 触控尺寸和小屏宽度纳入 `messageActions.ts` 状态;tool row 使用 shared diff/媒体/输出/错误信号;todo card 使用 shared progress/active/summary/default expanded;work group 固定 `message.workGroupToggle` 锚点。`messageContentLayout.ts` 已把 markdown code/table/list、Mermaid preview、附件图片/file chip、媒体 preview、diff preview、tool result preview 的宽高/gap/行数转成 screen width 模型;媒体、文件、diff、tool result 和 Mermaid source 打开详情动作已统一到局部 `MessageContentOpenButton`,保留原 payload 语义和 testID。payload media viewer 已有 `visual_session_payload.yaml` 视觉 flow,后续 JDK 17 就绪后补 hash baseline。下一步在 iOS visual baseline 保护下继续做 diff/file/media/Mermaid body 的触控细节和视觉截图采集。 | 1000 message fixture 可滚动;长 tool result 和大 diff 不撑爆列表;payload header 在 320/360/393 宽度下不挤压标题或动作;payload header 原 action testID 保持稳定;message action bar 小屏可触达;markdown/附件/媒体 preview 在 320/393 宽度下不出现固定宽度挤压;消息内容打开详情入口保留 `message.mediaPreviewButton` / `message.filePreviewButton*` / `message.diffPreviewButton` / `message.toolPayloadButton` / `message.mermaidSourceButton` 锚点;媒体关闭释放中转对象;视觉 baseline hash 不被无意改动。 || C2 | Composer/pending/queue polish | 当前批次。先把 slot priority、send/stop/queue disabled reason、inflight guard、pending resolve 防重复提交和 controls sheet 入口状态整理成 shared model 或 typed mobile adapter;再调整键盘、附件、语音、slash/@、pending wizard、queue sheet、controls sheet 的触控节奏。`composerTouchLayout.ts` 已进入第二刀,把附件快捷动作 gap、远程路径行堆叠/gap、添加按钮宽度和 composer 横向 padding 纳入平台无关布局模型;`queueTouchLayout.ts` 已进入队列触控第二刀,把五动作队列行在 320/393 宽度下的 36px 可触达尺寸、compact gap 和容器 padding 锁成纯模型;`QueuePanel` 已新增局部 `QueueTouchButton`,统一 resume/retry/clear/error/edit/save/move/steer/remove/toggle 的 pressed/disabled accessibility 表达;`sessionControlsTouchLayout.ts` 已进入 controls sheet 第二刀,把 overview / tabs / inputs / actions / remote-dir browser 的窄屏节奏锁成纯模型,第三刀补齐 controls inline 入口、tabs、远程目录进入行和连接 banner sync 的 action primitive / accessibility state;`interactionTouchLayout.ts` 已进入 pending interaction 第二刀,把 permission/ask/plan/issue 动作行、Ask 输入行、plan preview 和 interaction queue chip 的窄屏节奏锁成纯模型;`InteractionPanel` 已新增局部 `InteractionTouchButton`,统一 Ask 选项、Plan 模式/目录/反馈、Issue 类型和 resolve 按钮的 pressed/disabled/selected accessibility 表达。 | send/stop/resume/permission/ask/plan/issue/queue/attachment/voice/controls 都有 unit 或 mock host flow;键盘弹起时最后消息仍可见;附件 picker 在 320/384/393 宽度下不挤压;队列五动作、controls sheet 和 pending interaction 主要按钮在 320/393 宽度下不出现过小触控目标;重复点击不会产生重复 resolve/enqueue。 |-| D1 | Feature parity hardening | 回到桌面源码矩阵,补 new session、session controls、automations、file preview、fork/rewind 的体验细节。 | 每个缺口至少一个 unit、desktop parity 或 E2E flow;不靠人工点测兜底。 |+| D1 | Feature parity hardening | 回到桌面源码矩阵,补 new session、session controls、file preview、fork/rewind 的体验细节。 | 每个缺口至少一个 unit、desktop parity 或 E2E flow;不靠人工点测兜底。 || E1 | Release-grade gate | iOS 先固定 native profile、visual baseline、reconnect、1000 message/session、日志/截图/残留进程输出;Android 等 iOS 验收后补同级 baseline。 | 用户复测前脚本先给出通过/失败原因;手工点测只做产品体验确认,不做主回归。 |### 16.3 C/D/E 当前执行拆解@@ -1499,7 +1501,7 @@ C 阶段只做会话页产品化和必要的 shared model 增量,不插入新的- 不再让手机主层展示比桌面同级主层更多的信息;额外说明、debug、成功态、长 meta、预览和高级状态必须进入 sheet/detail/debug surface。- 不再用近似图标、字符图标或临时图标替代桌面同源图标;自定义图标需要复用桌面 path 或明确加入 mobile icon source。- 不再放没有真实 handler 的按钮;桌面 hover action 未迁移为手机真实动作前,默认隐藏或进入后续清单。-- 不先做 project automation 高级编辑、share extension、完整 Orca、完整文件编辑器。+- 不先做 share extension、完整 Orca、完整文件编辑器。- 不因为某个页面“能点通”就算完成;必须有对应的 source parity、fixture、视觉或 E2E 证据。- 不要求桌面 UI 同步重写,但 shared model 新增时必须标明桌面来源和后续 parity 入口。diff --git a/apps/mobile/docs/remote-control-plan.md b/apps/mobile/docs/remote-control-plan.mdindex 3038c8a03f..79ac7fdb81 100644--- a/apps/mobile/docs/remote-control-plan.md+++ b/apps/mobile/docs/remote-control-plan.md@@ -1,5 +1,7 @@# Cindy Mobile Remote Control Plan+> 自动化范围修订(2026-09-27):手机已移除旧 Scheduler 管理页和 Routines,包括「所有任务」下拉及伙伴资料入口;不再把查看、创建、编辑或运行规则列为手机交付、后续计划或验收项。PC 管理与执行、已有任务数据和运行历史保留。本文所有旧自动化管理实现、原型验证和计划记录仅作历史背景,不代表待恢复功能;当前边界以[伙伴运行时合同](../../../docs/product-rules/cindy-bots-runtime.md)为准。+> 版本: 2026-06-16> 范围: 手机版作为 `device-link` 控制端,远程连接同账号电脑,控制电脑上的 Cindy。> 分支前提: 手机版工作基于 `feat/device-link-remote-control`;该分支已经实现远程连接必需的桌面端、服务端和 `device-link` 基础能力。@@ -36,7 +38,7 @@第一版建议定义为两个连续里程碑:- V1A: 桌面左侧会话列表 + 单会话控制体验完整可用。首页直接按桌面侧边栏逻辑展示所有可控电脑的会话,不先让用户选择电脑,不额外拆出桌面端没有的 Projects / Chats / Relay 信息层;会话页包含消息流、发送/停止/排队、权限确认、Ask User、Plan Review、基础会话管理;`issue_confirm` 只做桌面端处理提示。-- V1B: 非协作的桌面附属能力以“按需进入详情”的方式补齐。包含 diff/媒体/上下文用量、fork/rewind、模型/权限/fast mode、自动化 schedules 的查看和基础管理;所有附属能力默认不增加主会话页常驻信息。+- V1B: 非协作的桌面附属能力以“按需进入详情”的方式补齐。包含 diff/媒体/上下文用量、fork/rewind、模型/权限/fast mode;所有附属能力默认不增加主会话页常驻信息。协作模式 / Orca 单独做 V2,因为它不是单会话控制,而是 Lead + Worker + focus + split/toggle pane 的多会话编排,移动端需要重新设计。@@ -85,7 +87,7 @@| A | 已完成第一轮 | Shared core completion pass | automation/schedule model、device-link controller contract、shared fixture baseline、raw desktop-like message parity、schedule/file raw payload parity 已迁;保留 mobile re-export 兼容。 | `@cindy/maker-shared` build/test;mobile adapter 测试全绿;desktop parity 单测覆盖 schedule/file;shared 不依赖 RN/Electron/DOM。 || B | iOS baseline 已完成 | Mobile IA and shell baseline | RN primitives、Session Action Strip、会话页 chrome/main/bottom 层级、Queue/Search/Controls sheet、Usage 直达入口、debug/local path 分离、pending bottom surface、payload full-screen viewer shell 已完成;Session 六态 visual scenario / Maestro flow / baseline checker 已落地;payload modal 已补 `visual_session_payload.yaml` flow,Settings 已进入 `visual_smoke.yaml` 截图 flow。 | `ios-iphone-17-pro-expo-go` 下 12 张截图基线已接受并通过 hash 校验,包括设备列表、Settings、设备详情、会话、控制面板、payload full-screen viewer 和 idle/running/pending/queue/offline/revoked;revoked flow 已真实等待到“访问已撤销”。Android 当前只保留 profile/脚本护栏,不阻塞 iOS 高标准 polish。 || C | 当前进行 | Home and session desktop-first polish | 在视觉基线保护下先修首页和会话页:首页回到桌面左侧会话列表;会话页重做消息层级、消息动作、可见文本选择、composer、pending、payload/diff/media/file viewer、context/cost、queue/controls 的触控节奏。所有手机端额外统计、说明和调试信息先默认删除或收进详情。新展示语义先进入 shared model,手机只做承载。 | 首页常驻信息不超过桌面左侧栏;长消息可直接选择复制;消息动作在消息结束处且视觉轻量;composer icon-first;长消息、长工具、大 diff、媒体、键盘、sheet 打开/关闭在 iPhone SE 宽度无重叠、无空白帧、消息列表不被卸载。 |-| D | C 后收口 | Desktop parity pruning and hardening | 回到桌面源码矩阵,逐项补 new session、media/file、automations、fork/rewind、settings 的细节缺口;同时删除或下沉手机端比桌面端更多的状态表达。协作模式继续只读安全降级。 | 每个缺口必须有桌面来源、shared model 判断、mobile 承载说明和 unit / E2E / parity fixture 中至少一层验证;每个新增 UI 必须说明为什么没有让手机端更复杂。 |+| D | C 后收口 | Desktop parity pruning and hardening | 回到桌面源码矩阵,逐项补 new session、media/file、fork/rewind、settings 的细节缺口;同时删除或下沉手机端比桌面端更多的状态表达。协作模式继续只读安全降级。 | 每个缺口必须有桌面来源、shared model 判断、mobile 承载说明和 unit / E2E / parity fixture 中至少一层验证;每个新增 UI 必须说明为什么没有让手机端更复杂。 || E | 发布前 | Release-grade test and tuning | iOS profile 先固定 native flow、visual baseline、reconnect、1000 message/session、性能和残留进程清理;Android 在最终 release 前补同级 baseline 和 smoke。 | 本地 orchestrator 一键跑;失败输出日志、截图、profile、mock host/relay 线索和残留进程检查结果。 |阶段 gate:@@ -118,7 +120,7 @@- **正式路径**:Home(Desktop Sidebar Session List) -> Session Detail -> New Session -> Automations -> Files -> Settings;Devices 只作为 filter/debug/connection context,除非用户明确需要进入设备详情。- **辅助面板**:queue、session controls、pending interaction、payload、diff、media、file preview、context/cost 统一进入 sheet 或 full-screen route。- **调试路径**:mock login、本地联调、fixture 切换、protocol debug 只保留在 dev/debug panel,不进入正式用户操作路径。-- **视觉基线**:先锁首页列表、会话消息流、底部 composer、pending/queue、payload/detail 五类状态,再扩到自动化和文件页。+- **视觉基线**:先锁首页列表、会话消息流、底部 composer、pending/queue、payload/detail 五类状态,再扩到文件页。### 1.4 2026-06-18 当前执行快照@@ -141,7 +143,7 @@3. **底部输入器**:对齐桌面 `ChatInput` 的语义,附件、语音、发送、停止用图标;输入框是主入口,额外状态只在异常或处理中出现。4. **Pending / Queue / Controls**:全部作为辅助 sheet 或 full-screen route,不在主会话页常驻展开;只显示当前决策必须的信息。5. **Payload / Diff / Media / File**:按需打开详情,主消息流只放可识别的轻量预览和入口。-6. **Automations / Files / Settings**:作为二级能力补齐桌面已有语义,不抢首页和会话页优先级。+6. **Files / Settings**:作为二级能力补齐桌面已有语义,不抢首页和会话页优先级。7. **Android**:iOS 先跑到可验收质量;所有代码保持平台中立,不写死 iOS-only app id、safe area、深链或模拟器行为。这个优先级意味着接下来每轮实现都先问:这件事是否让首页或会话页更像桌面版、更少信息、更好操作。答案不是“是”的功能,排到后面。@@ -279,7 +281,7 @@| Issue Confirm | `IssueConfirmCard` 属于桌面端 `/issue` 反馈提交确认。 | 手机版 V1 不提供 Issue 编辑/提交表单;遇到 `issue_confirm` 只显示“请回到桌面端处理”的 unsupported card。 | shared 协议兼容单测;不纳入 mobile 主流程 E2E。 || 会话控制 | `ChatInput` model/effort/permission/fast/extraDirs 是 server-first;远程会话 await 隧道 setX,被控端 patch 回流为真相;跨厂商切换有历史兼容确认。 | 手机 `SessionControlsPanel` 不做乐观最终态;调用 setX 后等待 sessions patch;已通过被控端 `maker:get-capabilities` 渲染模型、effort、permission 和 fast 支持状态;已有历史消息且模型类别不兼容时会先显示跨厂商确认卡;Claude 项目会话支持 extraDirs 文本编辑,提交后以被控端校验结果为准;触控布局由 `sessionControlsTouchLayout.ts` 根据屏宽和控件密度输出,controls sheet 动作由局部 `ControlActionButton` 统一 tone/active/disabled/pressed,inline 入口、section tabs 和远程目录进入行分别由局部 primitive 承载 pressed / expanded / selected / disabled state,Android 后续复用同一模型。 | set model/effort/permission/fast/extraDirs 回流 smoke;能力列表 mock;`sessionControlsTouchLayout.test` 覆盖 320/393/未就绪宽度和 dense controls。 || Fork / Rewind | `MessageActionBar` + `useForkAtMessage` + `RewindPreviewDialog`;首条 user 不显示 rewind;commit 后用被控端快照替换。 | 消息动作行;fork 成功 upsert 并跳转;rewind preview 显示风险,commit 后替换消息并回填 composer draft。`rewindPreviewLayout.ts` 按屏宽控制 preview 面板 padding、可见文件行数和 40px action 触控高度,`RewindActionButton` 统一取消/确认/关闭反馈。 | fork/rewind 单测和 smoke;`rewindPreviewLayout.test` 覆盖 320/393/未就绪宽度。 |-| 自动化 | `SchedulerPage` 是 master-detail;`TaskListPane` 按 workingDir/dialogue 分组;active 包含 expired;`RunHistoryPane` 折叠同 session runs;`ScheduleFormDialog` 包含模板、fresh/persistent/bound、project automation。 | V1B 已做任务列表/详情/runs/run now/pause/resume/delete/mark read/open session、新建/编辑普通 schedule、模板创建、生成会话删除三选项;fresh/persistent/bound 运行会话编辑第一刀已对齐桌面状态机;project automation 完整编辑后续继续对齐桌面。 | scheduleModel/remote event/form 单测;Maestro run now/pause/open session/create-edit flow。 |+| 自动化 | `SchedulerPage` 是 master-detail;`TaskListPane` 按 workingDir/dialogue 分组;active 包含 expired;`RunHistoryPane` 折叠同 session runs;`ScheduleFormDialog` 包含模板、fresh/persistent/bound、project automation。 | 手机不再提供自动化管理;PC 功能及已有运行历史保留。 | 不再要求手机管理页或对应 Maestro 流程。 || 远程设置 | `ControlThisMacPanel` / `ControllableDevicesPanel` / `RemoteControlSection` 管本机允许被控、可控设备、撤销/重命名。 | 手机 Settings 显示登录、当前手机设备名、relay 状态、调试和退出;被控端允许开关仍在电脑端。 | `settings.yaml` + settings model 单测。 || 协作 / Orca | `ExtraDirsButton` 的协同模式项、`OrcaSplitView`、`CreateWorkerPopover` 支持 lead/worker split/toggle、worker focus、attention、create/archive/stop;远程 Orca 合并 local + remote sessions。 | V1 只识别 lead/worker 和 worker 通信,只读安全显示,不提供创建/切 focus/停止协作;V2 做手机专属 lead/worker toggle pane。 | V1 Orca fixture 不崩;V2 另建 E2E。 |@@ -308,7 +310,7 @@ Worktree 补充:| Ask User | `AskUserQuestionPrompt` 是多步 wizard;单选点击前进、多选 JSON array string、skip 空字符串、draft 跨 session 保留。 | 手机用底部/全屏 wizard,答案编码必须严格一致。 | V1 已完成。 || Plan Review | `PlanViewerCard` 有 expanded/half/minimized/edit 四态,outline 从 h1-h3 生成,编辑后由 hook 写回 plan file;`PlanActionCard` 负责 approve/feedback。 | 手机可用半屏/全屏替代桌面四态,但要保留 outline、编辑、approve with `editedPlan`、feedback。 | V1 已完成核心协议和 UI。 || Issue Confirm | `IssueConfirmCard` 可编辑 title/body/type,确认结果附 `uiLanguage`,取消是 `{ confirmed: false }`。 | 桌面反馈链路,手机版 V1 不做表单;只识别 `issue_confirm` 并提示回桌面端处理。 | Deferred / desktop-only。 |-| 自动化 | `SchedulerPage` 是 master-detail;切换任务时 RunHistoryPane 不 remount,旧 runs 保留到新数据回来防空白帧;排序是 active/expired 同 rank、paused 下沉、lastFiredAt desc。 | 手机自动化页切换任务也要保留旧数据直到新 runs 到达;排序/筛选/删除生成会话策略照桌面。 | V1B 已完成基础管理和删除三选项;project automation 完整编辑留后续。 |+| 自动化 | `SchedulerPage` 是 master-detail;切换任务时 RunHistoryPane 不 remount,旧 runs 保留到新数据回来防空白帧;排序是 active/expired 同 rank、paused 下沉、lastFiredAt desc。 | 手机不再提供自动化管理;PC 功能及已有运行历史保留。 | 不再要求手机管理页或对应 Maestro 流程。 || 远程设备 | `useDeviceLinkRemoteProjects` 是 subscribe sessions 后 bootstrap,created push 只触发 reseed;不把远程 session 写本地 SQLite。 | 手机只做镜像 store,按设备分片;所有 invoke 经 `mobileMakerTransport`;重连必须 replay topic registry。 | V1 已完成核心镜像和重连。 || 协作 / Orca | `CCAgentSessionView` 会自动把 lead 导到 Orca 路由;`ChatInput` 的 collaboration toggle 只负责入口;worker 管理由 `OrcaSplitView` / `CreateWorkerPopover` / `orcaWorkflowsFor` 接管。 | 手机第一版不能半吊子做 split/focus/worker 编排;只识别并安全只读显示。 | V2 独立设计。 |@@ -316,10 +318,10 @@ Worktree 补充:第一版的目标不是“把桌面 UI 缩小”,而是“完整控制一台电脑上的单会话 Cindy”。因此:-- 必做:设备发现、会话列表、新建会话、消息流、发送/停止/队列、pending interactions、会话控制、fork/rewind、context/spend、媒体/diff、基础 automations、断线重连和撤权。+- 必做:设备发现、会话列表、新建会话、消息流、发送/停止/队列、pending interactions、会话控制、fork/rewind、context/spend、媒体/diff、断线重连和撤权。- 必须按桌面源码统一:协议 shape、队列语义、interaction decision、session patch 回流、scheduler 排序和删除策略、远程媒体取件链路。- 手机优化只允许发生在交互承载层:桌面右栏改全屏面板、hover action 改长按/轻量动作行、master-detail 改 stack、TipTap 复杂 toolbar 改 bottom sheet。-- 暂不做:完整 Orca 协作编排、project automation 完整编辑器、worktree 创建、手机触发被控端升级、请求电脑 reveal/open 的远程执行入口。+- 暂不做:完整 Orca 协作编排、worktree 创建、手机触发被控端升级、请求电脑 reveal/open 的远程执行入口。- 暂不做不等于忽略:遇到协作会话、project automation、worktree、upgrade/error 时必须可识别、可读、安全退化,不能崩溃或误操作。## 3. 桌面端远程控制语义@@ -396,10 +398,10 @@ Worktree 补充:- `Devices`: 可控制电脑和远程设备状态。- `Sessions`: 当前可控制会话,默认按设备和项目分组。-- `Automations`: V1B 引入,查看自动化任务和运行记录。+- `Automations`: 手机入口已移除;已有任务与运行历史保留。- `Settings`: 登录态、当前手机设备名、调试、退出。-V1A 可以先只有 `Devices/Sessions/Settings`,但路由结构要给 `Automations` 留位置。+手机入口保留 `Devices/Sessions/Settings`;`Automations` 只保留旧链接兼容跳转,不预留管理页面。### 4.2 侧边栏 / 会话列表@@ -893,7 +895,7 @@ V1A 可以先只有 `Devices/Sessions/Settings`,但路由结构要给 `Automatio- 如果安全模型确认,再支持手机端触发被控端升级。-## 8. 自动化 Schedules+## 8. 自动化 Schedules(桌面能力与手机历史方案)桌面自动化能力:@@ -911,7 +913,7 @@ V1A 可以先只有 `Devices/Sessions/Settings`,但路由结构要给 `Automatio- pause / resume / delete / rename / promote to project / clone to user / reload project config。- schedule 生成的会话会在聊天侧边栏有绑定和未读标识。-手机版 V1B:+历史手机版 V1B 方案(已退役,不是当前要求):- `Automations` tab。- 查看任务列表、状态、最近运行、未读、累计费用。@@ -923,7 +925,7 @@ V1A 可以先只有 `Devices/Sessions/Settings`,但路由结构要给 `Automatio- 模板 gallery 基础创建:列出被控端模板,选择模板后预填字段和参数,保存走被控端 `maker:schedule:create-from-template`。- 查看绑定会话并跳转到会话。-手机版 V1 后续:+已取消的手机后续计划(不再安排):- project automation 管理。- 参数化模板编辑增强:复杂 select/boolean 参数、模板分类筛选、模板 prompt 手动编辑后的差异提示。@@ -1019,9 +1021,6 @@ apps/mobile/src/IssueConfirmSheet.tsxdevices/DeviceListScreen.tsx- automations/- AutomationListScreen.tsx- AutomationRunsScreen.tsxtheme/tokens.ts```@@ -1071,7 +1070,7 @@ apps/mobile/src/- 默认 flow 只覆盖 mock login + device list;`remote_session_smoke.yaml` 覆盖打开会话和发送消息。它可跑真实桌面 dev,也可通过 `test:e2e:local:fixture` 跑 mock host。- 已新增 `fixture_controls_smoke.yaml` + `pnpm --filter mobile test:e2e:local:controls`:mock host 使用 `controls` 场景,一次制造 pending queue、permission、ask_user、plan_review,并按真实 Maestro 流程验证队列编辑、交互处理和最终继续发送。- 已新增 `media_smoke.yaml` + `pnpm --filter mobile test:e2e:local:media`:mock host 在会话里制造 direct image / xdt-video / xdt-audio 媒体消息,Maestro 打开图片 payload 并验证缩放控件。- - 已新增 `pnpm --filter mobile test:e2e:local:full`:mock host 默认使用 `controls` 场景,把 create、remote session、pending controls、media、file preview、fork/rewind、automations 串进同一个 full flow suite;`--check-only` 可在未安装 Maestro 时验证 local server + relay + mock host preflight。+ - 已新增 `pnpm --filter mobile test:e2e:local:full`:mock host 默认使用 `controls` 场景,把 create、remote session、pending controls、media、file preview、fork/rewind 串进同一个 full flow suite;`--check-only` 可在未安装 Maestro 时验证 local server + relay + mock host preflight。- 当前验证命令已通过:- `pnpm --filter @cindy/maker-shared build`- `pnpm --filter @cindy/maker-shared test`@@ -1311,7 +1310,9 @@ apps/mobile/src/### Phase 7: Automations-当前进展:+当前范围调整:手机版已移除独立自动化管理页、设备详情的「计划」入口,以及「所有任务」下拉和伙伴资料页中的例行任务管理。以下为该阶段的历史实现记录,不代表当前手机入口;任务运行历史与桌面管理继续保留。当前可用资源过滤见 `src/device-link/remoteResources.ts`,回归见 `remoteResources.test.ts` 与 `remoteResourceCache.test.ts`。++历史进展:- 已确认 `feat/device-link-remote-control` 分支在 `packages/device-link/src/allowlist.ts` 开放 `maker:schedule:*`,且 `maker:schedule:event` 已进入 push forward allowlist;手机版不需要另起私有协议。- 已在 `mobileMakerTransport` 增加 `schedule.list/get/listTemplates/createFromTemplate/create/update/listRuns/runNow/pause/resume/delete/markRunRead/markScheduleRunsRead`,参数顺序对齐桌面 preload 的 `window.electronAPI.maker.schedule.*`。@@ -1440,13 +1441,11 @@ pnpm test:device-link当前进展:-- 已新增 `pnpm --filter mobile test:web-smoke`,用 Expo Web export 编译整套 mobile route bundle,并断言 `Device Link` / `Remote Device` / `Remote Session` / `Remote Automations` / `maker:schedule:delete` 等关键路由和能力 marker 存在。它不是替代真机点击 E2E,但能在无模拟器、无 Maestro 的机器上先拦住 route import、bundle compile、关键页面被 tree-shake/路由遗漏这类回归。+- 已新增 `pnpm --filter mobile test:web-smoke`,用 Expo Web export 编译整套 mobile route bundle,并断言 `Device Link` / `Remote Device` / `Remote Session` / `maker:schedule:delete` 等关键路由和能力 marker 存在。它不是替代真机点击 E2E,但能在无模拟器、无 Maestro 的机器上先拦住 route import、bundle compile、关键页面被 tree-shake/路由遗漏这类回归。- 已接入 Maestro 第一层真实点击流:默认 `remote_control_smoke.yaml` 覆盖 mock login 和设备列表;`remote_session_smoke.yaml` 覆盖打开会话和发送消息;`create_session_smoke.yaml` 覆盖从手机新建 dialogue 会话并发送首条消息;`fixture_controls_smoke.yaml` 覆盖队列和 pending interactions;`media_smoke.yaml` 覆盖媒体图片 payload 和缩放;`file_preview.yaml` 覆盖远程文件文本预览、PDF/drawio 降级、路径复制和 diff 当前文件预览;`test:e2e:local:fixture` / `test:e2e:local:create` / `test:e2e:local:controls` / `test:e2e:local:file` / `test:e2e:local:media` 用 mock host 让它进入可自动回归状态。-- 已新增 native E2E doctor 和 `test:e2e:local:full`:doctor 在真实 Maestro 前统一检查 CLI/模拟器/API base;full suite 用 controls mock host 串起 create、session、pending controls、media、file、fork/rewind、automations,并支持 `--check-only` 先验证本地 relay 和 mock host。+- 已新增 native E2E doctor 和 `test:e2e:local:full`:doctor 在真实 Maestro 前统一检查 CLI/模拟器/API base;full suite 用 controls mock host 串起 create、session、pending controls、media、file、fork/rewind,并支持 `--check-only` 先验证本地 relay 和 mock host。- 已新增 `visual_smoke.yaml`、`visual_session_idle.yaml`、`visual_session_running.yaml`、`visual_session_queue.yaml`、`visual_session_pending.yaml`、`visual_session_payload.yaml`、`visual_session_revoked.yaml`、`visual_session_offline.yaml` 和 `pnpm --filter mobile test:e2e:visual`,用 Maestro `takeScreenshot` 自动采集设备列表、Settings、设备详情、会话、会话控制面板、payload full-screen viewer、idle/running/pending/queue/offline/revoked 十二张关键截图;同时新增 `pnpm --filter mobile test:e2e:visual:update-baseline -- --profile <profile> --actual-dir <dir>` 和 `pnpm --filter mobile test:e2e:visual:baseline -- --profile <profile> --actual-dir <dir>`。local visual suite 会隔离每个 state flow 的 mock host 生命周期并清理 stale e2e 设备记录,避免长 flow 连续切 session 造成同步竞态或设备列表计数漂移。当前 `ios-iphone-17-pro-expo-go` baseline 已接受 12 张并通过裁掉顶部 120px 后的 sha256 严格比对;Android profile 需要单独目录保存。- 已新增 `fork_rewind.yaml`,覆盖发送一条消息后执行 rewind preview/confirm,再 fork 会话并进入 forked session。-- 已新增 `automations.yaml`,覆盖进入远程自动化页、Run now、pause/resume、打开自动化 run 对应会话。-- 已新增 `automations_create_edit.yaml`,覆盖远程自动化页里的 template gallery 和 create/edit 基础表单锚点。- `pnpm --filter mobile test:e2e:reconnect:local` 现与根 `pnpm test:device-link` 共用正式客户端的真实 WebSocket 集成套件,不再依赖拆仓前的 server/dev-login。默认使用本仓 contract fixture;独立测试 relay 的显式互操作入口与覆盖边界见 [Device Link 测试说明](../../../packages/device-link/TESTING.md)。优先用 Maestro 做第一版黑盒流程,原因是脚本短、可读、适合 AI 维护。Detox 留给后面需要深层 native assertion 时再引入。@@ -1469,8 +1468,6 @@ apps/mobile/e2e/maestro/plan_review.yamlvisual_smoke.yamlfork_rewind.yaml- automations.yaml- automations_create_edit.yaml```流程:@@ -1488,8 +1485,6 @@ apps/mobile/e2e/maestro/- `e2e/maestro/plan_review.yaml`- `e2e/maestro/visual_smoke.yaml`- `e2e/maestro/fork_rewind.yaml`-- `e2e/maestro/automations.yaml`-- `e2e/maestro/automations_create_edit.yaml`每条 flow 都要输出截图、失败时的 app 日志、relay/desktop/device-link 日志切片。视觉截图先用 `visual_smoke.yaml` / `visual_session_idle.yaml` / `visual_session_running.yaml` / `visual_session_queue.yaml` / `visual_session_pending.yaml` / `visual_session_revoked.yaml` / `visual_session_offline.yaml` 采集,确认目标设备 profile 后运行 `test:e2e:visual:update-baseline`,之后每次回归运行 `test:e2e:visual:baseline`;当前 iOS profile 已把 `visual-settings` 写入 manifest 并纳入普通 baseline check。当前基线脚本使用严格文件 hash,只有在固定模拟器 / 固定系统版本下才应作为阻断门禁,跨设备 profile 必须分目录保存。CI 或本机跑不过模拟器时,至少要跑 `test:web-smoke` 作为降级门禁,但不能把它当最终 E2E。Reconnect 已先用 headless relay smoke 覆盖真实断连补账;后续如果要做 native `reconnect.yaml`,必须复用同样的断连 fixture,不要写一个只点“重新同步”的伪断线 flow。@@ -1558,7 +1553,7 @@ V1B 完成标准:- 手机能 fork/rewind。- 手机能查看 context/spend/diff。- 手机能预览图片/视频/音频。-- 手机能查看和基础管理 automations。+- 手机不出现 Scheduler / Routines 管理入口;旧管理链接安全返回设备页,已有任务与运行历史保留。- 1000 条消息和媒体 fixture 通过性能测试。V2 完成标准:diff --git a/apps/mobile/e2e/maestro/automations.yaml b/apps/mobile/e2e/maestro/automations.yamldeleted file mode 100644index 08313c6c8d..0000000000--- a/apps/mobile/e2e/maestro/automations.yaml+++ /dev/null@@ -1,70 +0,0 @@-appId: ${APP_ID}------ runFlow: login_mock.yaml-- extendedWaitUntil:- visible:- id: "home.projectSessionRow"- timeout: 15000-- openLink:- link: "${XDT_MOBILE_E2E_HOST_AUTOMATIONS_URL}"-- waitForAnimationToEnd:- timeout: 30000-- extendedWaitUntil:- visible:- id: "automations.screen"- timeout: 15000-- assertVisible:- id: "automations.scheduleList"-- assertVisible:- id: "automations.detailCard"-- assertVisible:- id: "automations.detailActions"-- tapOn:- id: "automations.runNowButton"-- extendedWaitUntil:- visible:- id: "automations.runList"- timeout: 10000-- tapOn:- id: "automations.pauseButton"-- extendedWaitUntil:- visible:- id: "automations.pauseDialog"- timeout: 10000-- assertVisible:- id: "automations.pause.preview"-- assertVisible:- id: "automations.pause.actions"-- tapOn:- id: "automations.pause.confirmButton"-- extendedWaitUntil:- visible:- id: "automations.resumeButton"- timeout: 10000-- tapOn:- id: "automations.resumeButton"-- extendedWaitUntil:- visible:- id: "automations.pauseButton"- timeout: 10000-- extendedWaitUntil:- visible:- id: "automations.runActions"- timeout: 10000-- scrollUntilVisible:- element:- id: "automations.openRunSessionButton"- direction: DOWN- timeout: 10000-- extendedWaitUntil:- visible:- id: "automations.openRunSessionButton"- timeout: 10000-- tapOn:- id: "automations.openRunSessionButton"-- extendedWaitUntil:- visible:- id: "session.screen"- timeout: 15000-- assertVisible:- id: "session.messageList"diff --git a/apps/mobile/e2e/maestro/automations_create_edit.yaml b/apps/mobile/e2e/maestro/automations_create_edit.yamldeleted file mode 100644index d2e7893bcd..0000000000--- a/apps/mobile/e2e/maestro/automations_create_edit.yaml+++ /dev/null@@ -1,102 +0,0 @@-appId: ${APP_ID}------ runFlow: login_mock.yaml-- extendedWaitUntil:- visible:- id: "home.projectSessionRow"- timeout: 15000-- openLink:- link: "${XDT_MOBILE_E2E_HOST_AUTOMATIONS_URL}"-- waitForAnimationToEnd:- timeout: 30000-- extendedWaitUntil:- visible:- id: "automations.screen"- timeout: 15000-- tapOn:- id: "automations.createButton"-- extendedWaitUntil:- visible:- id: "automations.form"- timeout: 10000-- extendedWaitUntil:- visible:- id: "automations.templateList"- timeout: 10000-- tapOn:- id: "automations.templateCard"-- tapOn:- id: "automations.form.nameInput"-- eraseText-- inputText: "Mobile Created Automation"-- tapOn:- id: "automations.form.promptInput"-- inputText: "Run a mobile-created automation"-- hideKeyboard-- scrollUntilVisible:- element:- id: "automations.form.runModeManual"- direction: DOWN- timeout: 10000-- tapOn:- id: "automations.form.runModeManual"-- scrollUntilVisible:- element:- id: "automations.form.workspaceDialogue"- direction: DOWN- timeout: 10000-- tapOn:- id: "automations.form.workspaceDialogue"-- scrollUntilVisible:- element:- id: "automations.form.saveButton"- direction: DOWN- timeout: 10000-- assertVisible:- id: "automations.form.actions"-- tapOn:- id: "automations.form.saveButton"-- extendedWaitUntil:- visible:- id: "automations.detailCard"- timeout: 15000-- assertVisible:- id: "automations.detailActions"-- tapOn:- id: "automations.deleteButton"-- extendedWaitUntil:- visible:- id: "automations.deleteDialog"- timeout: 10000-- tapOn:- id: "automations.delete.option.archive"-- assertVisible:- id: "automations.delete.actions"-- tapOn:- id: "automations.delete.confirmButton"-- extendedWaitUntil:- visible:- id: "automations.scheduleList"- timeout: 15000-- tapOn:- id: "automations.editButton"-- extendedWaitUntil:- visible:- id: "automations.form"- timeout: 10000-- tapOn:- id: "automations.form.nameInput"-- eraseText-- inputText: "Mobile Edited Automation"-- hideKeyboard-- scrollUntilVisible:- element:- id: "automations.form.saveButton"- direction: DOWN- timeout: 10000-- tapOn:- id: "automations.form.saveButton"-- extendedWaitUntil:- visible:- id: "automations.detailCard"- timeout: 15000diff --git a/apps/mobile/e2e/maestro/visual_automations.yaml b/apps/mobile/e2e/maestro/visual_automations.yamldeleted file mode 100644index 146789e45e..0000000000--- a/apps/mobile/e2e/maestro/visual_automations.yaml+++ /dev/null@@ -1,39 +0,0 @@-appId: ${APP_ID}------ runFlow: login_mock_no_clear.yaml-- assertVisible:- id: "devices.list"-- extendedWaitUntil:- visible:- id: "home.projectSessionRow"- timeout: 15000-- openLink:- link: "${XDT_MOBILE_E2E_HOST_AUTOMATIONS_URL}"-- waitForAnimationToEnd:- timeout: 30000-- extendedWaitUntil:- visible:- id: "automations.screen"- timeout: 15000-- assertVisible:- id: "automations.scheduleList"-- assertVisible:- id: "automations.detailCard"-- assertVisible:- id: "automations.detailActions"-- takeScreenshot:- path: visual-automations-- tapOn:- id: "automations.createButton"-- extendedWaitUntil:- visible:- id: "automations.form"- timeout: 10000-- assertVisible:- id: "automations.form.nameInput"-- assertVisible:- id: "automations.form.promptInput"-- assertVisible:- id: "automations.form.runModeRecurring"-- takeScreenshot:- path: visual-automations-formdiff --git a/apps/mobile/scripts/expo-web-smoke.mjs b/apps/mobile/scripts/expo-web-smoke.mjsindex 61105372d7..39722f4d8c 100644--- a/apps/mobile/scripts/expo-web-smoke.mjs+++ b/apps/mobile/scripts/expo-web-smoke.mjs@@ -45,7 +45,6 @@ try {'session.screen','newSession.actions','newSession.createButton',- 'automations.screen','settings.screen','settings.logoutButton','maker:schedule:delete',diff --git a/apps/mobile/scripts/local-device-link-smoke.mjs b/apps/mobile/scripts/local-device-link-smoke.mjsindex 77043bbcb2..1c5a7b3786 100644--- a/apps/mobile/scripts/local-device-link-smoke.mjs+++ b/apps/mobile/scripts/local-device-link-smoke.mjs@@ -106,7 +106,7 @@ const waitForReadyMs = options.waitForReadyMsconst waitForExpoReadyMs = options.startExpo ? Math.max(waitForReadyMs, 60_000) : 0;const isolateMockHostFlows = options.mockHost&& !options.checkOnly- && (flowSuite === 'visual' || flowSuite === 'full' || flowSuite === 'file' || flowSuite === 'automations')+ && (flowSuite === 'visual' || flowSuite === 'full' || flowSuite === 'file')&& !options.flow&& flows.length > 1;const cleanupTasks = [];@@ -994,14 +994,12 @@ function resolveFlows({ appId, flow, flowSuite }) {];}if (flowSuite === 'file') return ['file_preview.yaml', 'file_browser.yaml'];- if (flowSuite === 'automations') return ['automations.yaml', 'automations_create_edit.yaml'];if (flowSuite === 'visual') {return ['visual_smoke.yaml','visual_session_list_controls.yaml','visual_new_session.yaml','visual_files.yaml',- 'visual_automations.yaml','visual_session_idle.yaml','visual_session_controls_session.yaml','visual_session_controls_usage.yaml',@@ -1026,8 +1024,6 @@ function resolveFlows({ appId, flow, flowSuite }) {'file_browser.yaml','fork_rewind.yaml','message_selection.yaml',- 'automations.yaml',- 'automations_create_edit.yaml','settings.yaml',];}diff --git a/apps/mobile/scripts/maestro-e2e.mjs b/apps/mobile/scripts/maestro-e2e.mjsindex d25edca281..31a156ee36 100644--- a/apps/mobile/scripts/maestro-e2e.mjs+++ b/apps/mobile/scripts/maestro-e2e.mjs@@ -32,8 +32,6 @@ const expoUrl = options.expoUrlconst hostDeviceId = process.env.XDT_MOBILE_E2E_HOST_DEVICE_ID ?? 'mobile-e2e-host';const hostDeviceChipId = process.env.XDT_MOBILE_E2E_HOST_DEVICE_CHIP_ID?? `home.deviceChip.${sanitizeTestIdSegment(hostDeviceId)}`;-const hostAutomationsUrl = process.env.XDT_MOBILE_E2E_HOST_AUTOMATIONS_URL- ?? (expoUrl ? expoUrlWithRoute(expoUrl, `/automations/${encodeURIComponent(hostDeviceId)}`) : '');const expoLaunchDelayMs = parseNonNegativeInteger(process.env.XDT_MOBILE_E2E_EXPO_LAUNCH_DELAY_MS ?? '20000','XDT_MOBILE_E2E_EXPO_LAUNCH_DELAY_MS',@@ -73,7 +71,6 @@ if (options.dryRun) {if (expoUrl) console.log(`- expo terminate before open: ${expoTerminateBeforeOpen}`);if (expoUrl) console.log(`- expo open before test: ${expoOpenBeforeTest}`);console.log(`- host device chip id: ${hostDeviceChipId}`);- if (hostAutomationsUrl) console.log(`- host automations url: ${hostAutomationsUrl}`);for (const flow of resolvedFlows) console.log(`- ${flow}`);process.exit(0);}@@ -124,8 +121,6 @@ for (const flow of resolvedFlows) {`XDT_MOBILE_E2E_HOST_DEVICE_ID=${hostDeviceId}`,'-e',`XDT_MOBILE_E2E_EXPO_URL=${expoUrl ?? ''}`,- '-e',- `XDT_MOBILE_E2E_HOST_AUTOMATIONS_URL=${hostAutomationsUrl}`,flow,],{@@ -136,7 +131,6 @@ for (const flow of resolvedFlows) {APP_ID: appId,CLEAR_STATE: clearState,XDT_MOBILE_E2E_EXPO_URL: expoUrl ?? '',- XDT_MOBILE_E2E_HOST_AUTOMATIONS_URL: hostAutomationsUrl,},stdio: 'inherit',},@@ -238,16 +232,6 @@ function flowIncludesLogin(flow, seen = new Set()) {});}-function expoUrlWithRoute(url, route) {- const marker = '--/';- const routeValue = String(route).replace(/^\/+/, '');- const markerIndex = url.indexOf(marker);- if (markerIndex >= 0) {- return `${url.slice(0, markerIndex + marker.length)}${routeValue}`;- }- return `${url.replace(/\/+$/, '')}/${marker}${routeValue}`;-}-function openExpoUrl(url, platform) {const targetPlatform = resolveExpoOpenPlatform(platform);if (targetPlatform === 'ios') {diff --git a/apps/mobile/scripts/maestro-flow-smoke.mjs b/apps/mobile/scripts/maestro-flow-smoke.mjsindex 1871e9fee5..9ec5294705 100644--- a/apps/mobile/scripts/maestro-flow-smoke.mjs+++ b/apps/mobile/scripts/maestro-flow-smoke.mjs@@ -28,8 +28,6 @@ const requiredFlows = ['file_browser.yaml','media_smoke.yaml','media_smoke_expo_go.yaml',- 'automations.yaml',- 'automations_create_edit.yaml','settings.yaml','voice_input_smoke.yaml','remote_control_smoke.yaml',@@ -38,7 +36,6 @@ const requiredFlows = ['visual_session_list_controls.yaml','visual_new_session.yaml','visual_files.yaml',- 'visual_automations.yaml','visual_session_idle.yaml','visual_session_controls_session.yaml','visual_session_controls_usage.yaml',@@ -132,23 +129,6 @@ const requiredFlowMarkers = ['filePreview.copyPath','filePreview.notice','message.imageLightbox',- 'XDT_MOBILE_E2E_HOST_AUTOMATIONS_URL',- 'automations.screen',- 'automations.form',- 'automations.templateList',- 'automations.templateCard',- 'automations.form.actions',- 'automations.form.saveButton',- 'automations.deleteDialog',- 'automations.delete.option.archive',- 'automations.delete.actions',- 'automations.delete.confirmButton',- 'automations.detailActions',- 'automations.runNowButton',- 'automations.pauseButton',- 'automations.pause.actions',- 'automations.runActions',- 'automations.openRunSessionButton','settings.screen','settings.accountHeader','settings.version',@@ -165,8 +145,6 @@ const requiredFlowMarkers = ['visual-new-session','visual-files','visual-files-preview',- 'visual-automations',- 'visual-automations-form','visual-session-idle','visual-session-running','visual-session-pending',@@ -331,66 +309,6 @@ const requiredSourceAnchors = ['session.noSessionSyncButton','rewind.panel','rewind.confirmButton',- 'deviceDetail.automationsButton',- 'automations.screen',- 'automations.createButton',- 'automations.emptyActions',- 'automations.emptyCreateButton',- 'automations.form',- 'automations.form.sessionMode',- 'automations.form.sessionModeFresh',- 'automations.form.sessionModePersistent',- 'automations.form.sessionModeBound',- 'automations.form.boundSession',- 'automations.form.boundSessionOptions',- 'automations.form.boundSessionOption',- 'automations.form.targetSessionInput',- 'automations.templateList',- 'automations.templateCard',- 'automations.templateReloadButton',- 'automations.templateParamInput',- 'automations.form.nameInput',- 'automations.form.promptInput',- 'automations.form.intervalInput',- 'automations.form.workingDirInput',- 'automations.form.actions',- 'automations.form.saveButton',- 'automations.form.cancelButton',- 'automations.scheduleList',- 'automations.detailCard',- 'automations.runSessionDetail',- 'automations.detailActions',- 'automations.editButton',- 'automations.deleteButton',- 'automations.runMeta',- 'automations.deleteDialog',- 'automations.delete.preview',- 'automations.delete.options',- 'automations.delete.option.keep',- 'automations.delete.option.archive',- 'automations.delete.option.delete',- 'automations.delete.actions',- 'automations.delete.cancelButton',- 'automations.delete.confirmButton',- 'automations.runNowButton',- 'automations.pauseButton',- 'automations.pauseDialog',- 'automations.pause.preview',- 'automations.pause.actions',- 'automations.pause.cancelButton',- 'automations.pause.confirmButton',- 'automations.resumeButton',- 'automations.runList',- 'automations.runActions',- 'automations.openRunSessionButton',- 'automations.restartRunButton',- 'automations.markRunReadButton',- 'automations.deleteRunButton',- 'automations.runDeleteDialog',- 'automations.runDelete.preview',- 'automations.runDelete.actions',- 'automations.runDelete.cancelButton',- 'automations.runDelete.confirmButton','settings.screen','settings.backButton','settings.title',diff --git a/apps/mobile/scripts/mobile-e2e-profile.mjs b/apps/mobile/scripts/mobile-e2e-profile.mjsindex b52009404a..36e76c8ab9 100644--- a/apps/mobile/scripts/mobile-e2e-profile.mjs+++ b/apps/mobile/scripts/mobile-e2e-profile.mjs@@ -66,12 +66,6 @@ const profiles = {'visual-files-preview': [iosSyncBannerMask,],- 'visual-automations': [- iosSyncBannerMask,- ],- 'visual-automations-form': [- iosSyncBannerMask,- ],},},'android-pixel-expo-go': {diff --git a/apps/mobile/scripts/visual-baseline-check.mjs b/apps/mobile/scripts/visual-baseline-check.mjsindex 1159be10bb..92e7d03150 100644--- a/apps/mobile/scripts/visual-baseline-check.mjs+++ b/apps/mobile/scripts/visual-baseline-check.mjs@@ -39,8 +39,6 @@ const acceptedScreenshotNames = ['visual-new-session','visual-files','visual-files-preview',- 'visual-automations',- 'visual-automations-form',];const pendingBaselineScreenshotNames = [];const imageExts = new Set(['.png', '.jpg', '.jpeg', '.webp']);diff --git a/apps/mobile/src/__tests__/CompanionAutomationSheet.test.tsx b/apps/mobile/src/__tests__/CompanionAutomationSheet.test.tsxdeleted file mode 100644index 5e543755db..0000000000--- a/apps/mobile/src/__tests__/CompanionAutomationSheet.test.tsx+++ /dev/null@@ -1,517 +0,0 @@-// @vitest-environment jsdom-import { act, useRef } from 'react';-import { createRoot, type Root } from 'react-dom/client';-import { afterEach, beforeEach, expect, it, vi } from 'vitest';-import { CompanionAutomationSheet } from '../session/CompanionAutomationSheet';-import { emptyRoutineDefinition, type RoutineDefinition } from '../session/companionRoutines';--const h = vi.hoisted(() => ({- read: vi.fn(), invoke: vi.fn(), openLink: vi.fn(), subscribe: vi.fn(), unsubscribe: vi.fn(), changed: vi.fn(), close: vi.fn(),- alert: vi.fn(), account: 1, foreground: null as null | ((state: string) => void), nativeWrites: vi.fn(),- definition: null as any, revision: 0, existing: false, now: 0, uuid: 0, perform: vi.fn(), sheet: null as any, platform: 'ios', preRun: false, legacySheet: null as any,- history: [] as { id: string; status: string; createdAt: number }[],-}));-vi.mock('react-i18next', () => { const t = (key: string) => key.split('.').at(-1)!; return { useTranslation: () => ({ t, i18n: { language: 'en' } }) }; });-vi.mock('react-native', () => ({- Platform: { get OS() { return h.platform; } }, StyleSheet: { create: (value: any) => value, hairlineWidth: 1 },- View: ({ children }: any) => <div>{children}</div>,- Pressable: ({ children, onPress, disabled, testID }: any) => <button disabled={disabled} onClick={onPress} data-testid={testID}>{children}</button>,- Switch: ({ value, onValueChange, disabled }: any) => <input type="checkbox" checked={value} disabled={disabled} onChange={e => onValueChange(e.currentTarget.checked)} />,- ScrollView: 'div', ActivityIndicator: () => <span>Loading</span>,- useWindowDimensions: () => ({ width: 402, height: 874 }), Alert: { alert: h.alert },- AppState: { addEventListener: (_name: string, fn: any) => { h.foreground = fn; return { remove() {} }; } },-}));-vi.mock('@/components/AppText', () => ({ Text: ({ children, style }: any) => <span data-color={[style].flat(Infinity).filter(Boolean).reduce((color: string | undefined, item: any) => item.color ?? color, undefined)}>{children}</span>, TextInput: (p: any) => {- if (h.platform === 'ios') throw new Error('iOS automation must not mount the RN input path');- return <input aria-label={p.accessibilityLabel} value={p.value} disabled={p.editable === false} maxLength={p.maxLength} data-keyboard={p.keyboardType ?? 'default'}- data-autocapitalize={p.autoCapitalize ?? 'sentences'} data-autocorrect={String(p.autoCorrect ?? true)} onInput={e => p.onChangeText(e.currentTarget.value)} onChange={() => {}} />;-} }));-vi.mock('lucide-react-native', () => ({ ChevronDown: () => <i data-chevron="down" />, ChevronRight: () => <i data-chevron="right" />, Clock3: () => null, Plus: () => null }));-vi.mock('expo-crypto', () => ({ randomUUID: () => `creation-request-${++h.uuid}` }));-vi.mock('@/auth/AuthContext', () => ({ useAuth: () => ({ accountGeneration: h.account }) }));-vi.mock('@/device-link/DeviceLinkContext', () => ({ useDeviceLink: () => ({ invoke: h.invoke, openLink: h.openLink, subscribe: h.subscribe, unsubscribe: h.unsubscribe, onRemoteResourceChanged: h.changed, connectionEpoch: 1 }) }));-vi.mock('@/device-link/focusedTopicSubscription', () => ({ startFocusedTopicSubscription: () => () => {} }));-vi.mock('@/device-link/remoteResources', () => ({ getRemoteResource: (...args: any[]) => h.read(...args), invokeRemoteResourceAction: (...args: any[]) => h.invoke(...args) }));-vi.mock('@/device-link/remoteStatus', () => ({ formatRemoteError: (error: Error) => error.message }));-vi.mock('@/theme', () => ({ iconSize: { action: 20, lg: 24, xs: 12 }, spacing: { xs: 4, sm: 8, md: 12 }, useTheme: () => ({ mode: 'light', colors: {} }),- // Styles resolve to token names so rendered colours are observable.- useThemedStyles: (make: (colors: unknown) => unknown) => make(new Proxy({}, { get: (_target, key) => String(key) })) }));-vi.mock('../session/CompanionChoice', () => ({ CompanionChoice: () => null }));-vi.mock('../session/CompanionSheet', () => ({ CompanionSheet: (props: any) => {- if (h.platform === 'ios') throw new Error('legacy automation sheet mounted');- h.legacySheet = props;- return <div data-testid="legacy-sheet">{props.children}{props.footer}</div>;-} }));-vi.mock('../session/CompanionAutomationNativeView', async () => import('../session/CompanionAutomationNativeView.ios'));-vi.mock('../session/ComposerSheet', async () => import('../session/ComposerSheet.ios'));-vi.mock('../session/ComposerNativeSection', () => ({ ComposerNativeSection: ({ title, children }: any) => <section aria-label={title}>{children}</section> }));-vi.mock('@expo/ui', () => ({ Host: ({ children }: any) => <div>{children}</div> }));-vi.mock('@expo/ui/swift-ui/modifiers', () => ({- ...Object.fromEntries(['accessibilityLabel', 'buttonStyle', 'contentShape', 'disabled', 'font', 'foregroundStyle', 'frame', 'keyboardType', 'lineLimit', 'pickerStyle', 'tag', 'textInputAutocapitalization', 'textSelection', 'padding', 'presentationDetents', 'interactiveDismissDisabled', 'presentationDragIndicator', 'scrollContentBackground'].map(name => [name, (value: any) => ({ name, value })])),- shapes: { rectangle: () => ({}) },-}));-vi.mock('@expo/ui/swift-ui', () => {- const Container = ({ children }: any) => <div>{children}</div>;- const mod = (props: any, name: string) => props.modifiers?.find((m: any) => m.name === name)?.value;- return {- Group: Container, HStack: Container, VStack: Container, ProgressView: () => <span>Loading</span>, Image: () => null, Spacer: () => null,- RNHostView: () => { throw new Error('native automation form must not mount RNHostView'); },- Form: ({ children }: any) => <div data-testid="native-form">{children}</div>,- BottomSheet: (props: any) => { h.sheet = props; return props.isPresented ? <div>{props.children}</div> : null; },- Text: (props: any) => mod(props, 'tag') !== undefined ? <option value={mod(props, 'tag')}>{props.children}</option> : <span data-native-selectable={mod(props, 'textSelection')}>{props.children}</span>,- Button: (props: any) => <button data-testid={props.testID} disabled={!!mod(props, 'disabled')} onClick={props.onPress}>{props.children}</button>,- Picker: (props: any) => <select aria-label={props.label} value={props.selection} disabled={!!mod(props, 'disabled')} onChange={e => props.onSelectionChange(e.currentTarget.value)}>{props.children}</select>,- Toggle: (props: any) => <input aria-label={props.label} type="checkbox" checked={props.isOn} disabled={!!mod(props, 'disabled')} onChange={e => props.onIsOnChange(e.currentTarget.checked)} />,- useNativeState: (initial: string) => {- const state = useRef<any>(null);- state.current ??= { value: initial, get() { return this.value; }, set(value: string) { h.nativeWrites(value); this.value = value; } };- return state.current;- },- // Native widget semantics: edits update native state first; callbacks then notify JS.- TextField: (props: any) => <input aria-label={mod(props, 'accessibilityLabel')} defaultValue={props.text.get()} maxLength={props.maxLength}- disabled={!!mod(props, 'disabled')} onInput={e => { props.text.value = e.currentTarget.value; props.onTextChange(e.currentTarget.value); }} />,- };-});-Object.assign(globalThis, { IS_REACT_ACT_ENVIRONMENT: true });-let root: Root; let container: HTMLDivElement;-let grantId = 0;-const grants = new Map<string, { operation: string; revision: number; expires: number }>();-function resource(id: string) {- const selected = id.includes('/');- const existing = selected && !id.endsWith('/new');- const revision = existing ? h.revision : 0;- const operations = existing ? ['routine-save', 'routine-run', 'routine-delete'] : ['routine-create'];- const operationActions = Object.fromEntries(operations.map(operation => {- const token = `opaque-${++grantId}`;- grants.set(token, { operation, revision, expires: h.now + 15 * 60_000 });- return [operation, token];- }));- return { ref: { collectionId: 'routines', kind: 'routine', id }, display: { title: 'Automations' }, links: [], revision: String(revision),- actions: Object.values(operationActions).map(id => ({ id, label: 'Action' })), blocks: [{ primitive: selected ? 'routine-detail' : 'routine-list', data: selected- ? { id: existing ? 'rule' : null, revision, editable: true, input: h.definition, supportsPreRunCheck: h.preRun, sources: [{ id: 'mail', name: 'Mail', status: 'ready', events: [{ type: 'received', name: 'Received', fields: ['sender', 'subject'] }] }], history: h.history, operationActions }- : { items: h.existing ? [{ id: 'rule', name: 'Existing', enabled: true, revision: h.revision, triggers: [] }] : [], operationActions } }] };-}-async function render(online = true) { await act(async () => root.render(<CompanionAutomationSheet visible online={online} onClose={h.close} botId="bot" collectionId="routines" deviceId="host" deviceName="Mac" />)); }-function input(label: string) { const node = container.querySelector<HTMLInputElement>(`input[aria-label="${label}"]`); if (!node) throw new Error(`Missing ${label}`); return node; }-async function type(label: string, value: string) { await act(async () => { const field = input(label); field.focus(); field.value = value; field.dispatchEvent(new Event('input', { bubbles: true })); }); }-async function click(label: string) { await act(async () => { const button = [...container.querySelectorAll('button')].find(node => node.textContent === label); if (!button) throw new Error(`Missing ${label}`); button.click(); }); }-async function select(label: string, value: string) { await act(async () => { const node = container.querySelector<HTMLSelectElement>(`select[aria-label="${label}"]`)!; node.value = value; node.dispatchEvent(new Event('change', { bubbles: true })); }); }-async function open() { await render(); await click('new'); }-beforeEach(() => {- vi.resetAllMocks(); h.account = 1; h.revision = 0; h.existing = false; h.now = 0; h.uuid = 0; h.platform = 'ios'; h.definition = emptyRoutineDefinition(); h.preRun = false; h.legacySheet = null;- h.history = [];- grants.clear(); grantId = 0;- h.changed.mockReturnValue(() => {}); h.openLink.mockResolvedValue(undefined);- h.read.mockImplementation((_invoke, _target, ref) => Promise.resolve(resource(ref.id)));- h.perform.mockResolvedValue({ effects: [] });- h.invoke.mockImplementation(async (_invoke, _target, request) => {- const grant = grants.get(request.actionId);- if (!grant || grant.expires <= h.now || grant.revision !== request.input.revision)- throw Object.assign(new Error('Refresh before retrying'), { code: 'PRECONDITION_FAILED' });- // Host consumes before running business validation, including rejected operations.- grants.delete(request.actionId);- return h.perform({ ...request, actionId: grant.operation });- });- container = document.createElement('div'); document.body.append(container); root = createRoot(container);-});-afterEach(() => { act(() => root.unmount()); container.remove(); });--it('keeps native editor identity through name changes and submits the edited time through the existing grant', async () => {- await open();- const name = input('name'); const hour = input('hour');- await type('name', '应该'); await type('instructions', 'Check the inbox');- for (const value of ['12', '1', '', '08']) await type('hour', value);- for (const value of ['30', '3', '', '05']) await type('minute', value);- expect(input('name')).toBe(name); expect(input('hour')).toBe(hour);- expect(document.activeElement).toBe(input('minute'));- expect(hour.hasAttribute('maxlength')).toBe(false);- expect(h.nativeWrites).not.toHaveBeenCalled();- expect(container.querySelector('[data-testid="native-form"]')).not.toBeNull();- const save = container.querySelector('[data-testid="companion.automation.save"]');- expect(save?.closest('section')).not.toBeNull();- expect(save?.closest('[data-testid="native-form"]')).toBe(hour.closest('[data-testid="native-form"]'));- await click('save');- expect(h.invoke).toHaveBeenCalledOnce();- expect(h.perform.mock.calls[0][0]).toMatchObject({ actionId: 'routine-create', input: { revision: 0, definition: { name: '应该', prompt: 'Check the inbox', triggers: [{ expression: '05 08 * * *' }] } } });-});--it('keeps editing and focus when a foreground refresh returns while the draft is dirty', async () => {- await open(); await type('name', 'Keep this'); const name = input('name');- h.definition = { ...emptyRoutineDefinition(), name: 'Remote' };- await act(async () => h.foreground?.('active'));- expect(input('name')).toBe(name); expect(name.value).toBe('Keep this'); expect(document.activeElement).toBe(name);- await type('instructions', 'Still editable');- expect(h.nativeWrites).not.toHaveBeenCalled();-});--it('loads fresh native field values when a clean remote draft changes', async () => {- await open(); const name = input('name');- h.definition = { ...emptyRoutineDefinition(), name: 'Remote', triggers: [{ id: 'daily', kind: 'cron', expression: '45 17 * * *', timezone: 'UTC' }] };- await act(async () => h.foreground?.('active'));- expect(input('name')).not.toBe(name); expect(input('name').value).toBe('Remote'); expect(input('hour').value).toBe('17'); expect(input('minute').value).toBe('45');-});--it.each(['ios', 'android'])('renews a consumed create action and keeps the draft and request ID on %s', async platform => {- h.platform = platform;- await open(); await type('name', 'Brief'); await type('instructions', 'Summarize'); await type('hour', '11');- const hour = input('hour');- h.perform.mockRejectedValueOnce(new Error('Host rejected the automation'));- await click('save');- expect(input('hour')).toBe(hour); expect(hour.value).toBe('11');- expect(container.textContent).toContain('Host rejected the automation');- if (platform === 'ios') expect([...container.querySelectorAll('[data-native-selectable="true"]')].some(node => node.textContent === 'Host rejected the automation')).toBe(true);- expect(h.invoke).toHaveBeenCalledTimes(1);- await type('hour', '12'); await click('save');- expect(h.perform).toHaveBeenCalledTimes(2);- expect(h.invoke.mock.calls[1][2].actionId).not.toBe(h.invoke.mock.calls[0][2].actionId);- expect(h.invoke.mock.calls[1][2].input.requestId).toBe(h.invoke.mock.calls[0][2].input.requestId);- expect(h.invoke.mock.calls[1][2].input.definition.triggers[0].expression).toBe('0 12 * * *');- expect(container.querySelector('input[aria-label="hour"]')).toBeNull();-});--it('preserves each trigger kind and the remaining native filter values after removing a filter', async () => {- h.definition = { ...emptyRoutineDefinition(), name: 'Mail', prompt: 'Summarize', triggers: [{ id: 'mail-trigger', kind: 'event', sourceId: 'mail', eventType: 'received', filters: [- { field: 'sender', operator: 'contains', value: 'Alice' }, { field: 'subject', operator: 'contains', value: 'Report' },- ] }] } satisfies RoutineDefinition;- await open(); await click('removeFilter');- expect(input('filterField').value).toBe('subject'); expect(input('filterValue').value).toBe('Report');- await select('triggerType', 'interval'); await type('minutes', '90');- await select('triggerType', 'cron'); await select('repeat', 'weekly'); await select('weekday', '5');- await type('hour', '18'); await type('minute', '30'); await click('save');- expect(h.invoke.mock.calls[0][2].input.definition.triggers).toEqual([{ id: 'mail-trigger', kind: 'cron', expression: '30 18 * * 5', timezone: expect.any(String) }]);-});--it.each(['ios', 'android'])('blocks invalid times before invoking and allows correction on %s', async platform => {- h.platform = platform;- await open(); await type('name', 'Brief'); await type('instructions', 'Summarize');- for (const [field, invalid, corrected] of [['hour', '25', '12'], ['hour', '', '08'], ['minute', '60', '30'], ['minute', '', '05']]) {- await type(field!, invalid!); await click('save');- expect(h.invoke).not.toHaveBeenCalled();- expect(input(field!).value).toBe(invalid);- expect(container.textContent).toContain('invalid');- await type(field!, corrected!);- }- await click('save');- expect(h.perform).toHaveBeenCalledOnce();- expect(h.perform.mock.calls[0][0].input.definition.triggers[0].expression).toBe('05 08 * * *');-});--async function openExisting() {- h.existing = true; h.revision = 1;- h.definition = { ...emptyRoutineDefinition(), name: 'Existing', prompt: 'Check the inbox' };- await render(); await click('Existing');-}--it.each(['ios', 'android'])('renews a consumed save action without replacing edited fields on %s', async platform => {- h.platform = platform;- await openExisting(); await type('hour', '11');- h.perform.mockRejectedValueOnce(new Error('Host rejected the automation'));- await click('save');- expect(input('hour').value).toBe('11');- await type('hour', '12'); await click('save');- expect(h.perform).toHaveBeenCalledTimes(2);- expect(h.perform.mock.calls[1][0]).toMatchObject({ actionId: 'routine-save', input: { revision: 1, definition: { triggers: [{ expression: '0 12 * * *' }] } } });- expect(h.invoke.mock.calls[1][2].actionId).not.toBe(h.invoke.mock.calls[0][2].actionId);-});--it('recovers from expiry without automatically repeating the write', async () => {- await openExisting(); await type('hour', '12'); h.now += 16 * 60_000;- await click('save');- expect(h.invoke).toHaveBeenCalledOnce(); expect(h.perform).not.toHaveBeenCalled();- expect(input('hour').value).toBe('12');- await click('save');- expect(h.perform).toHaveBeenCalledOnce();-});--it('reuses the creation intent after a lost acknowledgement without creating a duplicate', async () => {- await open(); await type('name', 'Brief'); await type('instructions', 'Summarize');- const created = new Map<string, unknown>();- h.perform.mockImplementation(async request => {- const { requestId, definition } = request.input;- if (!created.has(requestId)) {- created.set(requestId, definition);- throw new Error('Response lost');- }- expect(definition).toEqual(created.get(requestId));- return { effects: [] };- });- await click('save');- expect(h.invoke).toHaveBeenCalledOnce(); expect(created.size).toBe(1);- expect(input('name').value).toBe('Brief');- await click('save');- expect(created.size).toBe(1);- expect(container.querySelector('input[aria-label="name"]')).toBeNull();-});--it('keeps a failed refresh retryable without letting save reuse a consumed action', async () => {- await openExisting(); await type('hour', '12');- h.perform.mockRejectedValueOnce(new Error('Save rejected'));- h.read.mockRejectedValueOnce(new Error('Read unavailable'));- await click('save');- expect(container.textContent).toContain('Save rejected');- expect(container.textContent).toContain('loadFailed');- expect(container.querySelector<HTMLButtonElement>('[data-testid="companion.automation.save"]')!.disabled).toBe(true);- await click('save'); expect(h.invoke).toHaveBeenCalledOnce();- await click('retry');- expect(input('hour').value).toBe('12');- await click('save'); expect(h.perform).toHaveBeenCalledTimes(2);-});--it('preserves a dirty draft and blocks stale saves when the host version changed', async () => {- await openExisting(); await type('hour', '12');- h.perform.mockImplementationOnce(async () => {- h.revision = 2;- h.definition = { ...h.definition, name: 'Changed elsewhere' };- throw new Error('Response lost');- });- await click('save');- expect(container.textContent).toContain('Response lost');- expect(container.textContent).toContain('changed');- expect(input('name').value).toBe('Existing'); expect(input('hour').value).toBe('12');- expect(container.querySelector<HTMLButtonElement>('[data-testid="companion.automation.save"]')!.disabled).toBe(true);- await click('retry'); await click('save');- expect(h.invoke).toHaveBeenCalledOnce();-});--it.each(['ios', 'android'])('reconciles an acknowledged-by-read save without overwriting or locking the draft on %s', async platform => {- h.platform = platform;- await openExisting(); await type('hour', '12');- const hour = input('hour');- h.perform.mockImplementationOnce(async request => {- h.definition = request.input.definition; h.revision++;- throw new Error('Response lost');- });- await click('save');- expect(h.invoke).toHaveBeenCalledOnce();- expect(container.textContent).toContain('Response lost');- expect(container.textContent).not.toContain('changed');- expect(input('hour')).toBe(hour); expect(hour.value).toBe('12');- await type('hour', '13'); await click('save');- expect(h.perform).toHaveBeenCalledTimes(2);- expect(h.perform.mock.calls[1][0].input).toMatchObject({ revision: 2, definition: { triggers: [{ expression: '0 13 * * *' }] } });-});--it.each(['ios', 'android'])('shows the action error when the connection goes offline before it settles on %s', async platform => {- h.platform = platform;- await openExisting(); await type('hour', '12');- let reject!: (error: Error) => void;- h.perform.mockImplementationOnce(() => new Promise((_resolve, fail) => { reject = fail; }));- await click('save');- const reads = h.read.mock.calls.length;- await render(false);- await act(async () => reject(new Error('Host rejected the automation')));- expect(container.textContent).toContain('Host rejected the automation');- expect(container.textContent).toContain('offline');- expect(input('hour').value).toBe('12');- expect(h.read).toHaveBeenCalledTimes(reads);- await click('save'); expect(h.invoke).toHaveBeenCalledOnce();- await render(true); await click('save');- expect(h.perform).toHaveBeenCalledTimes(2);-});--it.each(['ios', 'android'])('disables run and delete during an ordinary refresh on %s', async platform => {- h.platform = platform;- await openExisting();- let finish!: (value: ReturnType<typeof resource>) => void;- h.read.mockImplementationOnce(() => new Promise(resolve => { finish = resolve; }));- await act(async () => h.foreground?.('active'));- for (const label of ['run', 'delete']) {- expect([...container.querySelectorAll('button')].find(node => node.textContent === label)?.disabled).toBe(true);- await click(label);- }- expect(h.invoke).not.toHaveBeenCalled(); expect(h.alert).not.toHaveBeenCalled();- await act(async () => finish(resource('bot:bot/rule')));- for (const label of ['run', 'delete']) {- expect([...container.querySelectorAll('button')].find(node => node.textContent === label)?.disabled).toBe(false);- }- await click('run'); expect(h.perform).toHaveBeenCalledOnce();-});--it.each(['ios', 'android'])('does not repeat a lost-acknowledgement run and blocks running or queued history on %s', async platform => {- h.platform = platform;- await openExisting();- h.perform.mockImplementationOnce(async () => {- h.history = [{ id: 'run-1', status: 'queued', createdAt: 1 }];- throw new Error('Response lost');- });- await click('run');- expect(h.invoke).toHaveBeenCalledOnce();- for (const status of ['queued', 'running']) {- h.history = [{ id: 'run-1', status, createdAt: 1 }];- await act(async () => h.foreground?.('active'));- expect([...container.querySelectorAll('button')].find(node => node.textContent === 'run')?.disabled).toBe(true);- await click('run'); expect(h.invoke).toHaveBeenCalledOnce();- }- h.history = [{ id: 'run-1', status: 'success', createdAt: 1 }];- await act(async () => h.foreground?.('active'));- expect(h.invoke).toHaveBeenCalledOnce();- expect(container.textContent).toContain('success');- await click('run'); expect(h.perform).toHaveBeenCalledTimes(2);-});--it('waits for reconciliation and discards a late read after switching accounts', async () => {- await openExisting(); await type('hour', '12');- h.perform.mockRejectedValueOnce(new Error('Save rejected'));- let finish!: (value: ReturnType<typeof resource>) => void;- const oldResult = resource('bot:bot/rule');- h.read.mockImplementationOnce(() => new Promise(resolve => { finish = resolve; }));- await click('save');- expect(container.querySelector<HTMLButtonElement>('[data-testid="companion.automation.save"]')!.disabled).toBe(true);- await click('save'); expect(h.invoke).toHaveBeenCalledOnce();- h.account++; h.existing = false;- await render();- await act(async () => finish(oldResult));- expect(container.querySelector('input[aria-label="hour"]')).toBeNull();- expect(container.textContent).not.toContain('Save rejected');-});--it.each(['run', 'delete'])('renews a consumed %s action for an explicit retry', async operation => {- await openExisting();- const perform = async () => {- await click(operation);- if (operation === 'delete') await act(async () => h.alert.mock.calls.at(-1)![2].find((item: any) => item.style === 'destructive').onPress());- };- h.perform.mockRejectedValueOnce(new Error('Operation rejected'));- await perform(); expect(h.invoke).toHaveBeenCalledOnce();- expect(container.textContent).toContain('Operation rejected');- await perform();- expect(h.perform).toHaveBeenCalledTimes(2);- expect(h.perform.mock.calls[1][0].actionId).toBe(`routine-${operation}`);- expect(h.invoke.mock.calls[1][2].actionId).not.toBe(h.invoke.mock.calls[0][2].actionId);-});--async function confirmDelete() {- await click('delete');- await act(async () => h.alert.mock.calls.at(-1)![2].find((item: any) => item.style === 'destructive').onPress());-}--it.each(['ios', 'android'])('returns to a fresh list when delete succeeded but its acknowledgement was lost on %s', async platform => {- h.platform = platform;- await openExisting();- h.perform.mockImplementationOnce(async () => {- h.existing = false;- throw new Error('Response lost');- });- h.read.mockImplementation((_invoke, _target, ref) => {- if (ref.id === 'bot:bot/rule' && !h.existing) {- // Device-link IPC transports a bracketed message; also accept structured errors.- throw platform === 'ios' ? new Error('[NOT_FOUND] Automation unavailable')- : Object.assign(new Error('Automation unavailable'), { code: 'NOT_FOUND' });- }- return Promise.resolve(resource(ref.id));- });- await confirmDelete();- expect(h.perform).toHaveBeenCalledOnce();- expect(h.perform.mock.calls[0][0].actionId).toBe('routine-delete');- expect(h.read.mock.calls.at(-1)![2].id).toBe('bot:bot');- expect(container.querySelector('input[aria-label="name"]')).toBeNull();- expect(container.textContent).toContain('empty');- expect(container.textContent).not.toContain('loadFailed');- expect(container.textContent).not.toContain('Existing');-});--it('retains delete reconciliation across a transient read failure and a manual retry', async () => {- await openExisting();- h.perform.mockRejectedValueOnce(new Error('Response lost'));- h.read.mockRejectedValueOnce(new Error('Read unavailable'));- await confirmDelete();- expect(container.textContent).toContain('Response lost');- expect(container.textContent).toContain('loadFailed');- expect(input('name').value).toBe('Existing');- h.existing = false;- h.read.mockRejectedValueOnce(Object.assign(new Error('Automation unavailable'), { code: 'NOT_FOUND' }));- await click('retry');- expect(h.invoke).toHaveBeenCalledOnce();- expect(container.querySelector('input[aria-label="name"]')).toBeNull();- expect(container.textContent).toContain('empty');-});--it('does not discard edits when a missing detail is unrelated to a pending delete', async () => {- await openExisting(); await type('hour', '12');- h.perform.mockRejectedValueOnce(new Error('Save rejected'));- h.read.mockRejectedValueOnce(Object.assign(new Error('Automation unavailable'), { code: 'NOT_FOUND' }));- await click('save');- expect(input('hour').value).toBe('12');- expect(container.textContent).toContain('Save rejected');- expect(container.textContent).toContain('loadFailed');-});--it('reconciles a lost delete response after reconnecting without sending delete again', async () => {- await openExisting();- let reject!: (error: Error) => void;- h.perform.mockImplementationOnce(() => new Promise((_resolve, fail) => { reject = fail; }));- await confirmDelete(); await render(false);- await act(async () => reject(new Error('Response lost')));- expect(input('name').value).toBe('Existing');- expect(container.textContent).toContain('Response lost');- h.existing = false;- h.read.mockRejectedValueOnce(Object.assign(new Error('Automation unavailable'), { code: 'NOT_FOUND' }));- await render(true);- expect(h.invoke).toHaveBeenCalledOnce();- expect(container.querySelector('input[aria-label="name"]')).toBeNull();- expect(container.textContent).toContain('empty');-});--it('keeps edits made after an uncertain delete when a retry finds the detail missing', async () => {- await openExisting();- h.perform.mockRejectedValueOnce(new Error('Response lost'));- h.read.mockRejectedValueOnce(new Error('Read unavailable'));- await confirmDelete();- await type('hour', '12');- h.read.mockRejectedValueOnce(Object.assign(new Error('Automation unavailable'), { code: 'NOT_FOUND' }));- await click('retry');- expect(h.invoke).toHaveBeenCalledOnce();- expect(input('hour').value).toBe('12');- expect(container.textContent).toContain('loadFailed');-});--it('keeps a successful save committed when the following run fails', async () => {- await openExisting(); await type('hour', '12');- h.perform.mockImplementationOnce(async request => {- h.definition = request.input.definition; h.revision++;- return { effects: [] };- }).mockRejectedValueOnce(new Error('Run rejected'));- await click('saveAndRun');- expect(h.perform.mock.calls.map(([request]) => request.actionId)).toEqual(['routine-save', 'routine-run']);- expect(input('hour').value).toBe('12');- expect(container.textContent).toContain('Run rejected');- await click('run');- expect(h.perform.mock.calls.map(([request]) => request.actionId)).toEqual(['routine-save', 'routine-run', 'routine-run']);- expect(h.perform.mock.calls[2][0].input.revision).toBe(2);-});--it('lays out the Android form like iOS: titled triggers, in-form save, disclosure chevron and literal or numeric inputs', async () => {- h.platform = 'android'; h.existing = true; h.revision = 1; h.preRun = true;- h.definition = { ...emptyRoutineDefinition(), name: 'Existing', prompt: 'Check', preRunHook: { command: 'git status', timeoutMs: 5000 }, triggers: [- { id: 'daily', kind: 'cron', expression: '0 9 * * *', timezone: 'UTC' }, { id: 'hourly', kind: 'interval', intervalMs: 3_600_000 },- ] } satisfies RoutineDefinition;- await render(); await click('Existing');- expect(h.legacySheet.footer).toBeUndefined();- const save = container.querySelector<HTMLButtonElement>('[data-testid="companion.automation.save"]')!;- expect(save.textContent).toBe('save');- // Save follows the last trigger control and precedes run / history, as the iOS sections do.- const addTrigger = [...container.querySelectorAll('button')].find(node => node.textContent === 'addTrigger')!;- const run = [...container.querySelectorAll('button')].find(node => node.textContent === 'run')!;- expect(addTrigger.compareDocumentPosition(save) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy();- expect(save.compareDocumentPosition(run) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy();- expect([...container.querySelectorAll('span')].filter(node => node.textContent === 'triggers')).toHaveLength(2);- const advanced = container.querySelector<HTMLButtonElement>('[data-testid="companion.automation.advanced"]')!;- expect(advanced.querySelector('[data-chevron="right"]')).not.toBeNull();- await act(async () => { advanced.click(); });- expect(advanced.querySelector('[data-chevron="down"]')).not.toBeNull();- for (const label of ['checkCommand', 'timezone']) {- expect(input(label).dataset.autocapitalize).toBe('none'); expect(input(label).dataset.autocorrect).toBe('false');- }- for (const label of ['timeoutMs', 'hour', 'minute', 'minutes']) expect(input(label).dataset.keyboard).toBe('number-pad');- for (const label of ['hour', 'minute']) expect(input(label).hasAttribute('maxlength')).toBe(false);- // Without a length cap, an over-long value is still rejected before any write.- await type('hour', '123'); await click('save');- expect(h.invoke).not.toHaveBeenCalled(); expect(container.textContent).toContain('invalid');-});--it('keeps the Android offline notice out of the error colour', async () => {- h.platform = 'android';- await render(false);- const notice = [...container.querySelectorAll('span')].find(node => node.textContent === 'offline')!;- expect(notice.dataset.color).toBe('textSecondary');-});diff --git a/apps/mobile/src/__tests__/CompanionHeaderNavigation.test.tsx b/apps/mobile/src/__tests__/CompanionHeaderNavigation.test.tsxindex c3aca34bab..6a8265fc90 100644--- a/apps/mobile/src/__tests__/CompanionHeaderNavigation.test.tsx+++ b/apps/mobile/src/__tests__/CompanionHeaderNavigation.test.tsx@@ -41,7 +41,6 @@ vi.mock('@/session/HomeHeaderGlassButton', () => ({ HomeHeaderGlassButton: ({ onvi.mock('@/session/TeammatePicker', () => ({ TeammatePicker: () => null }));vi.mock('@/session/CompanionProfileSheet', () => ({ CompanionCreateSheet: () => null,CompanionProfileSheet: (props: unknown) => { h.profile = props; return null; } }));-vi.mock('@/session/CompanionAutomationSheet', () => ({ CompanionAutomationSheet: () => null }));vi.mock('@/session/useTeammateNavigation', () => ({ useTeammateNavigation: () => ({ chooseMode: h.chooseMode }) }));vi.mock('@/utils/useGuardedPush', () => ({ useGuardedPush: () => h.push }));vi.mock('@/device-link/remoteStatus', () => ({ formatRemoteError: String }));diff --git a/apps/mobile/src/__tests__/CompanionProfileSheet.android.test.tsx b/apps/mobile/src/__tests__/CompanionProfileSheet.android.test.tsxindex a73ae020de..af7fefe350 100644--- a/apps/mobile/src/__tests__/CompanionProfileSheet.android.test.tsx+++ b/apps/mobile/src/__tests__/CompanionProfileSheet.android.test.tsx@@ -5,7 +5,7 @@ import { afterEach, beforeEach, expect, it, vi } from 'vitest';const h = vi.hoisted(() => ({sheet: null as any, choices: [] as any[], portrait: null as any, read: vi.fn(), openLink: vi.fn(), invoke: vi.fn(), alert: vi.fn(),- close: vi.fn(), closed: vi.fn(), automation: vi.fn(), search: vi.fn(), created: vi.fn(),+ close: vi.fn(), closed: vi.fn(), search: vi.fn(), created: vi.fn(),}));vi.mock('react-native', () => ({Platform: { OS: 'android' }, StyleSheet: { create: (v: unknown) => v, hairlineWidth: 1 }, Alert: { alert: h.alert }, Image: () => null,@@ -17,7 +17,7 @@ vi.mock('react-native', () => ({vi.mock('expo-router', () => ({ useRouter: () => ({ push: vi.fn() }) }));vi.mock('expo-crypto', () => ({ randomUUID: () => 'test-id' }));vi.mock('react-i18next', () => ({ useTranslation: () => ({ t: (key: string) => key, i18n: { language: 'en' } }) }));-vi.mock('lucide-react-native', () => Object.fromEntries(['Brain', 'Camera', 'Clock3', 'FileText', 'Hand', 'History', 'Info', 'Link2', 'Settings2', 'Sparkles']+vi.mock('lucide-react-native', () => Object.fromEntries(['Brain', 'Camera', 'FileText', 'Hand', 'History', 'Info', 'Link2', 'Settings2', 'Sparkles'].map(name => [name, Object.assign(() => null, { displayName: name })])));vi.mock('@/auth/AuthContext', () => ({ useAuth: () => ({ accountGeneration: 1 }) }));vi.mock('@/device-link/DeviceLinkContext', () => ({ useDeviceLink: () => ({ invoke: h.invoke, openLink: h.openLink }) }));@@ -68,7 +68,7 @@ async function type(label: string, value: string) {}async function render() {await act(async () => root.render(createElement(CompanionProfileSheet, { visible: true, resource: resource as any, collectionId: 'teammates', deviceId: 'host', deviceName: 'Mac', online: true,- onClose: h.close, onClosed: h.closed, onOpenSearch: h.search, onOpenAutomation: h.automation })));+ onClose: h.close, onClosed: h.closed, onOpenSearch: h.search })));await settle();}beforeEach(() => {@@ -86,19 +86,20 @@ it('lays out the iOS identity, entry groups, icons and host-ordered management aexpect(avatar.closest('button')).toBeNull();expect(container.textContent).toContain('Cindy'); expect(container.textContent).not.toContain('Teammate on Mac');const rows = buttons().map(node => node.dataset.testid ?? '').filter(id => /^companionProfile\.[a-z]+$/.test(id));- expect(rows).toEqual(['profile', 'memory', 'models', 'skills', 'automation', 'artifacts', 'search', 'permissions'].map(id => `companionProfile.${id}`));+ expect(rows).toEqual(['profile', 'memory', 'models', 'skills', 'artifacts', 'search', 'permissions'].map(id => `companionProfile.${id}`));const icons = Object.fromEntries(rows.map(id => [id.split('.')[1], byTest(id)!.dataset.icon]));// 图标与桌面 BotsHomeView 同一动作同一 lucide 图标(mobile-design-guide §6)。- expect(icons).toMatchObject({ profile: 'Info', memory: 'Brain', models: 'Sparkles', skills: 'Settings2', automation: 'Clock3', artifacts: 'FileText', search: 'History', permissions: 'Hand' });+ expect(icons).toMatchObject({ profile: 'Info', memory: 'Brain', models: 'Sparkles', skills: 'Settings2', artifacts: 'FileText', search: 'History', permissions: 'Hand' });expect(new Set(Object.values(icons)).size).toBe(rows.length);const actions = buttons().filter(node => node.dataset.testid?.startsWith('companionProfile.action.'));expect(actions.map(node => [node.dataset.testid, node.dataset.destructive])).toEqual([['companionProfile.action.delete', 'true'], ['companionProfile.action.restart', 'false']]);});-it('hands automation and search to the owner like iOS, without closing first', async () => {+it('keeps automation absent and hands search to the owner like iOS, without closing first', async () => {await render();- await press(byTest('companionProfile.automation')); await press(byTest('companionProfile.search'));- expect(h.automation).toHaveBeenCalledOnce(); expect(h.search).toHaveBeenCalledOnce(); expect(h.close).not.toHaveBeenCalled();+ expect(byTest('companionProfile.automation')).toBeNull();+ await press(byTest('companionProfile.search'));+ expect(h.search).toHaveBeenCalledOnce(); expect(h.close).not.toHaveBeenCalled();});it('renders confirmation fields for any confirmed action, not only delete', async () => {diff --git a/apps/mobile/src/__tests__/CompanionProfileSheet.test.tsx b/apps/mobile/src/__tests__/CompanionProfileSheet.test.tsxindex 1a8df601f5..4f162025d3 100644--- a/apps/mobile/src/__tests__/CompanionProfileSheet.test.tsx+++ b/apps/mobile/src/__tests__/CompanionProfileSheet.test.tsx@@ -29,7 +29,7 @@ Object.assign(globalThis, { IS_REACT_ACT_ENVIRONMENT: true });const resource = { ref: { collectionId: 'teammates', kind: 'bot', id: 'bot' }, display: { title: 'Cindy' }, links: [], revision: 'v1' };const panel = { id: 'profile', values: { name: 'Cindy' }, action: { id: 'grant', label: 'Save', fields: [{ id: 'name', label: 'Name', kind: 'text' }] } };let root: Root | undefined;-async function render() { root ??= createRoot(document.createElement('div')); await act(async () => root!.render(createElement(CompanionProfileSheet, { visible: true, resource, collectionId: 'teammates', deviceId: 'host', deviceName: 'Mac', online: true, onClose: h.close, onClosed: h.closed, onDeleted: h.deleted, onOpenSearch() {}, onOpenAutomation() {} }))); }+async function render() { root ??= createRoot(document.createElement('div')); await act(async () => root!.render(createElement(CompanionProfileSheet, { visible: true, resource, collectionId: 'teammates', deviceId: 'host', deviceName: 'Mac', online: true, onClose: h.close, onClosed: h.closed, onDeleted: h.deleted, onOpenSearch() {} }))); }beforeEach(() => { vi.clearAllMocks(); h.account = 1; h.read.mockResolvedValue({ resource, panels: [panel, { ...panel, id: 'models', values: { modelChain: '[]', followsDefault: false }, action: { id: 'model-grant', fields: [{ id: 'modelChain', kind: 'multiline' }, { id: 'followsDefault', kind: 'toggle' }] } }] }); h.invoke.mockResolvedValue({ effects: [] }); });afterEach(() => { act(() => root?.unmount()); root = undefined; });it('keeps the draft and page when saving during dismissal fails', async () => {diff --git a/apps/mobile/src/__tests__/CompanionProfileSheetDraft.android.test.tsx b/apps/mobile/src/__tests__/CompanionProfileSheetDraft.android.test.tsxindex b1396dd890..c09ee3bee9 100644--- a/apps/mobile/src/__tests__/CompanionProfileSheetDraft.android.test.tsx+++ b/apps/mobile/src/__tests__/CompanionProfileSheetDraft.android.test.tsx@@ -54,7 +54,7 @@ const profilePanel = (disabled = false) => ({ id: 'profile', values: { name: 'Cilet root: Root | undefined;async function render(online = true) {root ??= createRoot(document.createElement('div'));- await act(async () => root!.render(createElement(CompanionProfileSheet, { visible: true, resource, collectionId: 'teammates', deviceId: 'host', deviceName: 'Mac', online, onClose: h.close, onOpenSearch() {}, onOpenAutomation() {} } as any)));+ await act(async () => root!.render(createElement(CompanionProfileSheet, { visible: true, resource, collectionId: 'teammates', deviceId: 'host', deviceName: 'Mac', online, onClose: h.close, onOpenSearch() {} } as any)));}async function openProfile() {// 与 iOS 相同,个人资料从首页「个人资料」行进入。diff --git a/apps/mobile/src/__tests__/companionRoutines.test.ts b/apps/mobile/src/__tests__/companionRoutines.test.tsdeleted file mode 100644index 6400c8def0..0000000000--- a/apps/mobile/src/__tests__/companionRoutines.test.ts+++ /dev/null@@ -1,62 +0,0 @@-import { describe, expect, it } from 'vitest';-import { emptyRoutineDefinition, getRoutineActionId, parseRoutineDefinition, parseRoutineDetail, parseRoutineSummaries, routineDraftValid } from '../session/companionRoutines';--describe('companion automation data boundary', () => {- it('does not treat an empty new draft as a saved rule', () => {- const draft = emptyRoutineDefinition();- expect(draft.silentWhenIdle).toBe(false);- expect(routineDraftValid(draft)).toBe(false);- expect(routineDraftValid({ ...draft, name: 'Daily brief', prompt: 'Summarize my inbox' })).toBe(true);- });- it.each(['0 25 * * *', '60 9 * * *', '0 * * *', ' 9 * * *', '0 -1 * * *', '0 9.5 * * *', '0 9 32 * *', '0 9 * 13 *'])('rejects incomplete or out-of-range literal cron fields: %s', expression => {- const draft = { ...emptyRoutineDefinition(), name: 'Brief', prompt: 'Check', triggers: [{ id: 'daily', kind: 'cron' as const, expression, timezone: 'UTC' }] };- // Partial values remain editable; only submission is blocked.- expect(parseRoutineDefinition(draft)).toEqual(draft);- expect(routineDraftValid(draft)).toBe(false);- });- it.each(['00 00 * * *', '59 23 * * *', '05 08 * * 1-5', '0 9 31 * *', '0 9 * * 7', '*/15 8-18 * * 1,3,5'])('keeps valid presets and custom cron syntax available: %s', expression => {- expect(routineDraftValid({ ...emptyRoutineDefinition(), name: 'Brief', prompt: 'Check', triggers: [{ id: 'daily', kind: 'cron', expression, timezone: 'UTC' }] })).toBe(true);- });- it('keeps mixed OR triggers and event filters intact while editing', () => {- const draft = { name: 'Brief', prompt: 'Check', enabled: true, triggers: [- { id: 'a', kind: 'cron', expression: '30 8 * * 1-5', timezone: 'Asia/Shanghai' },- { id: 'b', kind: 'interval', intervalMs: 60_000 },- { id: 'c', kind: 'event', sourceId: 'mail', eventType: 'new', filters: [{ field: 'sender', operator: 'contains', value: 'team' }] },- ] };- expect(parseRoutineDefinition(draft)).toEqual(draft);- });- it('rejects unsupported trigger types rather than dropping them from a saved rule', () => {- expect(parseRoutineDefinition({ ...emptyRoutineDefinition(), triggers: [{ id: 'future', kind: 'future-trigger' }] })).toBeNull();- expect(parseRoutineDefinition({ ...emptyRoutineDefinition(), triggers: [{ id: 'invalid', kind: 'interval', intervalMs: 1 }] })).toBeNull();- });- it('separates activity from enabled state and never derives running from a title', () => {- expect(parseRoutineSummaries({ items: [{ id: 'a', name: 'Running daily', enabled: true, revision: 2, triggers: [] }] })[0]?.activity).toBeUndefined();- expect(parseRoutineSummaries({ items: [{ id: 'a', name: 'Daily', enabled: false, revision: 2, activity: 'running', triggers: [] }] })[0]?.activity).toBe('running');- });- it('requires an explicit operation-to-capability mapping, not a guessed fixed operation id', () => {- const resource = { ref: { collectionId: 'teammates', kind: 'bot', id: 'routine:b/r' }, display: { title: 'Daily' }, links: [], revision: '1',- actions: [{ id: 'opaque-token', label: 'Save' }], blocks: [{ id: 'r', primitive: 'routine-detail', fallbackMarkdown: 'Daily', data: { operationActions: { 'routine-save': 'opaque-token' } } }] };- expect(getRoutineActionId(resource, 'routine-save')).toBe('opaque-token');- expect(getRoutineActionId({ ...resource, actions: [] }, 'routine-save')).toBeNull();- expect(getRoutineActionId({ ...resource, blocks: [], actions: [{ id: 'routine-save', label: 'Save' }] }, 'routine-save')).toBeNull();- });- it('keeps oversized definitions read-only and omits malformed source/history entries', () => {- const detail = parseRoutineDetail({ id: 'a', revision: 1, editable: false, input: null, sources: [null], history: [null] });- expect(detail).toMatchObject({ editable: false, input: null, sources: [], history: [] });- expect(() => parseRoutineDetail({ id: 'a', revision: 1, editable: true, input: { bad: true }, sources: [], history: [] })).toThrow();- });-});---it('round trips quiet settings and distinguishes model skips without guessing host support', () => {- const input = { ...emptyRoutineDefinition(), name: 'Check', prompt: 'Check', silentWhenIdle: false, preRunHook: { command: 'node check.mjs', timeoutMs: 2000 } };- expect(parseRoutineDefinition(input)).toEqual(input);- expect(parseRoutineDefinition({ ...input, preRunHook: null })?.preRunHook).toBeNull();- expect(parseRoutineDefinition({ ...input, preRunHook: { command: 'check', timeoutMs: -1 } })).toBeNull();- const detail = { id: 'check', revision: 1, editable: true, input, sources: [], history: [{ id: 'run', status: 'skipped', createdAt: 1 }] };- expect(parseRoutineDetail(detail).supportsPreRunCheck).toBe(false);- expect(parseRoutineDetail({ ...detail, supportsPreRunCheck: true })).toMatchObject({ supportsPreRunCheck: true, input, history: [{ status: 'skipped' }] });- const legacy = { ...detail, input: { name: input.name, prompt: input.prompt, enabled: input.enabled, triggers: input.triggers } };- expect(parseRoutineDetail({ ...legacy, supportsPreRunCheck: true }).input?.silentWhenIdle).toBe(true);- expect(parseRoutineDetail(legacy).input?.silentWhenIdle).toBeUndefined();-});diff --git a/apps/mobile/src/__tests__/iosChromeActionMenu.test.ts b/apps/mobile/src/__tests__/iosChromeActionMenu.test.tsindex 5fabb4b611..0ffebca8df 100644--- a/apps/mobile/src/__tests__/iosChromeActionMenu.test.ts+++ b/apps/mobile/src/__tests__/iosChromeActionMenu.test.ts@@ -153,10 +153,6 @@ describe("iOS chrome presenters stay on the system menu path", () => {resolve(process.cwd(), "app/account-deletion.tsx"),"utf8",);- const automations = readTextLf(- resolve(process.cwd(), "app/automations/[deviceId].tsx"),- "utf8",- );const deviceDetail = readTextLf(resolve(process.cwd(), "app/devices/[deviceId].tsx"),"utf8",@@ -175,9 +171,6 @@ describe("iOS chrome presenters stay on the system menu path", () => {expect(accountDeletion).toContain('backTestID="accountDeletion.backButton"',);- expect(automations).toContain("<SimpleStackHeader");- expect(automations).toContain('backTestID="automations.backButton"');- expect(automations).not.toContain('eyebrow=');expect(deviceDetail).not.toContain('eyebrow=');expect(deviceDetail).toContain("<SimpleStackHeader");expect(deviceDetail).toContain('backTestID="deviceDetail.backButton"');diff --git a/apps/mobile/src/__tests__/mobilePresentationRefresh.test.ts b/apps/mobile/src/__tests__/mobilePresentationRefresh.test.tsindex 91247f86a8..9896b504bd 100644--- a/apps/mobile/src/__tests__/mobilePresentationRefresh.test.ts+++ b/apps/mobile/src/__tests__/mobilePresentationRefresh.test.ts@@ -10,17 +10,6 @@ function read(relPath: string): string {}describe('mobile localized presentation refresh', () => {- it('renders the automation form title once', () => {- const source = read('app/automations/[deviceId].tsx');- const formHeader = source.slice(- source.indexOf('<View style={styles.formHeader}>'),- source.indexOf('{error ? <Text style={styles.formError}>'),- );-- expect(formHeader.match(/devices\.automations\.form\.title\.edit/g)).toHaveLength(1);- expect(formHeader.match(/devices\.automations\.form\.title\.create/g)).toHaveLength(1);- });-it('rebuilds the cached composer presentation when the language changes', () => {const source = read('app/sessions/[sessionId].tsx');const composerProjection = source.slice(@@ -88,22 +77,6 @@ describe('mobile localized presentation refresh', () => {expect(source).toContain('{describeAgentAuthError(error) ?? error}');});- it('keeps schedule validation metadata until render time', () => {- const source = read('app/automations/[deviceId].tsx');-- expect(source).toContain('setFormError(validation)');- expect(source).toContain('localizeScheduleDraftValidation(formError, mobilePresentationLocalizer)');- expect(source).toContain('error={formErrorText}');- });-- it('keeps template-parameter validation metadata until render time', () => {- const source = read('app/automations/[deviceId].tsx');-- expect(source).toContain('setFormError(paramError)');- expect(source).toContain('selectedTemplatePresentation,');- expect(source).toContain('localizeTemplateParamValidation(');- });-it('rebuilds localized session sections when the language changes', () => {const source = read('app/devices/[deviceId].tsx');const sectionProjection = source.slice(diff --git a/apps/mobile/src/__tests__/nativeE2eEnvironment.test.ts b/apps/mobile/src/__tests__/nativeE2eEnvironment.test.tsindex ea0c79a658..61242b0c30 100644--- a/apps/mobile/src/__tests__/nativeE2eEnvironment.test.ts+++ b/apps/mobile/src/__tests__/nativeE2eEnvironment.test.ts@@ -127,8 +127,6 @@ describe('native e2e environment', () => {expect(runner).toContain("process.env.XDT_MOBILE_E2E_EXPO_TERMINATE_BEFORE_OPEN ?? 'true'");expect(runner).toContain("process.env.XDT_MOBILE_E2E_EXPO_OPEN_BEFORE_TEST ?? 'true'");expect(runner).toContain("if (expoUrl && expoTerminateBeforeOpen === 'true') terminateExpoApp(platform);");- expect(runner).toContain('function expoUrlWithRoute(url, route)');- expect(runner).toContain('XDT_MOBILE_E2E_HOST_AUTOMATIONS_URL');expect(runner).toContain('function terminateExpoApp(platform)');expect(runner).toContain('function terminateApp(targetAppId, platform)');expect(runner).toContain('function launchNativeApp(targetAppId, platform)');@@ -213,7 +211,7 @@ describe('native e2e environment', () => {expect(localSmoke).toContain('async function assertExpoReady(url');expect(localSmoke).toContain('Expo Go native E2E needs Metro before Maestro opens the app.');expect(localSmoke).toContain('EXPO_PUBLIC_XDT_API_BASE_URL: apiBase');- expect(localSmoke).toContain("&& (flowSuite === 'visual' || flowSuite === 'full' || flowSuite === 'file' || flowSuite === 'automations')");+ expect(localSmoke).toContain("&& (flowSuite === 'visual' || flowSuite === 'full' || flowSuite === 'file')");expect(localSmoke).toContain("flowSuite === 'visual' ? `${mockHostDeviceId}-${flowSlug(flow)}` : mockHostDeviceId");expect(localSmoke).toContain("if (flowSuite === 'full' && flow === 'fixture_controls_smoke.yaml') return 'controls';");expect(localSmoke).toContain("if (suite === 'controls') return 'controls';");diff --git a/apps/mobile/src/__tests__/remoteResourceCache.test.ts b/apps/mobile/src/__tests__/remoteResourceCache.test.tsindex 7f8f88c51b..67340cf137 100644--- a/apps/mobile/src/__tests__/remoteResourceCache.test.ts+++ b/apps/mobile/src/__tests__/remoteResourceCache.test.ts@@ -13,6 +13,26 @@ const rows = (deviceId: string, lastReplyAt: number) => [{item: { ref: { collectionId: 'teammates', kind: 'bot', id: 'writer' }, display: { title: 'Writer', lastReplyAt }, revision: '1', links: [] },}];beforeEach(async () => { await clearRemoteResourceCache(); disk.clear(); });+it('does not restore routines from an old offline snapshot while retaining companions', async () => {+ const home = [+ { id: 'routines', title: '例行任务', resourceKind: 'routine', targets: [{ deviceId: 'home', deviceName: 'Home' }] },+ { id: 'teammates', title: 'Companions', resourceKind: 'bot', targets: [{ deviceId: 'home', deviceName: 'Home' }] },+ ];+ disk.set('cindy.remoteResources.v1.alice', JSON.stringify({+ home,+ items: { teammates: rows('home', 100), routines: [{+ ...rows('home', 100)[0],+ item: { ref: { collectionId: 'routines', kind: 'routine', id: 'daily' }, display: { title: 'Daily' }, revision: '1', links: [] },+ }] },+ read: {},+ }));+ const snapshot = await readRemoteResourceSnapshot('alice');+ expect(snapshot.home.map((item) => item.id)).toEqual(['teammates']);+ expect(snapshot.items.routines).toBeUndefined();+ expect(snapshot.items.teammates).toHaveLength(1);+ await cacheRemoteResourceHome('alice', home);+ expect((await readRemoteResourceSnapshot('alice')).home.map((item) => item.id)).toEqual(['teammates']);+});it('keeps device-qualified read positions and treats only later host replies as unread', async () => {await cacheRemoteResourceItems('alice', 'teammates', [...rows('home', 100), ...rows('office', 100)]);expect(isRemoteResourceUnread('alice', 'home', 'writer', 100)).toBe(false);diff --git a/apps/mobile/src/__tests__/remoteResourceContent.test.ts b/apps/mobile/src/__tests__/remoteResourceContent.test.tsindex a5671b2dfc..6cd7556cd2 100644--- a/apps/mobile/src/__tests__/remoteResourceContent.test.ts+++ b/apps/mobile/src/__tests__/remoteResourceContent.test.ts@@ -1,7 +1,6 @@import { describe, expect, it, vi } from 'vitest';import { getRemoteResource, MOBILE_REMOTE_RESOURCE_PRIMITIVES } from '../device-link/remoteResources';import { normalizeRemoteActions, normalizeRemoteBlocks } from '../device-link/remoteResourceContent';-import { getRoutineActionId, parseRoutineDetail } from '../session/companionRoutines';import type { RemoteInvoke } from '../device-link/mobileMakerTransport';const ref = { collectionId: 'teammates', kind: 'bot', id: 'routine:b/r' };const action = { id: 'opaque', label: 'Save', fields: [{ id: 'name', label: 'Name', kind: 'text' }] };@@ -13,8 +12,8 @@ describe('resource content through the actual mobile API boundary', () => {it('retains the complete routine and opaque actions instead of projecting them away as a list item', async () => {const invoke = vi.fn(async () => ({ ref, display: { title: 'Daily' }, revision: '1', links: [], actions: [action], blocks: [block] })) as RemoteInvoke;const result = await getRemoteResource(invoke, { deviceId: 'host', deviceName: 'Mac' }, ref, 'en', ['routine-detail']);- expect(getRoutineActionId(result, 'routine-save')).toBe('opaque');- expect(parseRoutineDetail(result.blocks![0]!.data).input).toEqual(block.data.input);+ expect(result.actions).toEqual([action]);+ expect(result.blocks).toEqual([block]);expect(vi.mocked(invoke).mock.calls[0]![2]).toMatchObject([{ client: { primitives: [...MOBILE_REMOTE_RESOURCE_PRIMITIVES, 'routine-detail'] } }]);});it('keeps only public invitation progress for the ordinary teammate resolver', async () => {diff --git a/apps/mobile/src/__tests__/remoteResourceInvitation.test.tsx b/apps/mobile/src/__tests__/remoteResourceInvitation.test.tsxindex b1299f332e..133496a914 100644--- a/apps/mobile/src/__tests__/remoteResourceInvitation.test.tsx+++ b/apps/mobile/src/__tests__/remoteResourceInvitation.test.tsx@@ -16,7 +16,7 @@ vi.mock('react-native', async () => {});vi.mock('expo-router', async () => {const { useEffect } = await import('react');- return { useFocusEffect: (effect: () => void | (() => void)) => useEffect(effect, [effect]), useRouter: () => h.router, useLocalSearchParams: () => h.params };+ return { Redirect: ({ href }: { href: string }) => { useEffect(() => h.router.replace(href), [href]); return null; }, useFocusEffect: (effect: () => void | (() => void)) => useEffect(effect, [effect]), useRouter: () => h.router, useLocalSearchParams: () => h.params };});vi.mock('react-i18next', () => ({ useTranslation: () => h.translation }));vi.mock('react-native-safe-area-context', async () => { const { createElement: el } = await import('react'); return { SafeAreaView: ({ children }: any) => el('div', {}, children) }; });@@ -31,7 +31,7 @@ vi.mock('@/auth/AuthContext', () => ({ useAuth: () => ({ accountGeneration: h.gevi.mock('@/device-link/DeviceLinkContext', () => ({ useDeviceLink: () => h.link }));vi.mock('@/device-link/remoteStatus', () => ({ formatRemoteError: String }));vi.mock('@/device-link/focusedTopicSubscription', () => ({ startFocusedTopicSubscription: () => () => {} }));-vi.mock('@/device-link/remoteResources', () => ({ getRemoteResource: h.read, invokeRemoteResourceAction: h.action }));+vi.mock('@/device-link/remoteResources', async (importOriginal) => ({ ...await importOriginal<typeof import('../device-link/remoteResources')>(), getRemoteResource: h.read, invokeRemoteResourceAction: h.action }));vi.mock('@/session/remoteSessionStore', () => ({ remoteSessionStore: { getSessionDeviceId: () => null, upsertDeviceSession: h.upsert } }));vi.mock('@/theme', () => ({ useThemedStyles: () => ({}), useTheme: () => ({ colors: {} }) }));vi.mock('@/utils/backGuard', () => ({ goBackGuarded: vi.fn() }));@@ -41,7 +41,7 @@ const resource = (stage: string) => ({ ref: { collectionId: 'teammates', kind: 'let container: HTMLDivElement;let root: ReturnType<typeof createRoot>;beforeEach(() => {- vi.clearAllMocks(); h.generation = 1;+ vi.clearAllMocks(); h.generation = 1; h.params.collectionId = 'teammates';h.link.onRemoteResourceChanged.mockImplementation(callback => { h.push = callback; return () => { h.push = null; }; });h.link.invoke.mockResolvedValue({ id: 'chat-1', source: 'bot' });container = document.createElement('div'); root = createRoot(container);@@ -92,3 +92,12 @@ it('reassures the user while preparing and shows the live stage beside the spinnexpect(container.textContent).toContain('devices.companions.invitation.background');expect(container.querySelector('[data-testid="remoteResourceResolver.preparationStage"]')?.textContent).toBe('devices.companions.invitation.profile');});++it('redirects stale routine links without reading or subscribing to the host', async () => {+ h.params.collectionId = 'routines';+ await act(async () => root.render(createElement(Screen)));+ expect(h.router.replace).toHaveBeenCalledWith('/devices');+ expect(h.read).not.toHaveBeenCalled();+ expect(h.action).not.toHaveBeenCalled();+ expect(h.link.onRemoteResourceChanged).not.toHaveBeenCalled();+});diff --git a/apps/mobile/src/__tests__/remoteResources.test.ts b/apps/mobile/src/__tests__/remoteResources.test.tsindex 65b38de784..ae440f37a0 100644--- a/apps/mobile/src/__tests__/remoteResources.test.ts+++ b/apps/mobile/src/__tests__/remoteResources.test.ts@@ -4,6 +4,9 @@ import { DeviceLinkError } from '@cindy/device-link';import {MOBILE_REMOTE_RESOURCE_PRIMITIVES,getRemoteResource,+ invokeRemoteResourceAction,+ listRemoteCollection,+ loadRemoteResourceManifest,discoverRemoteHomeCollections,remoteResourceDiscoveryTargets,isRemoteResourcesUnsupported,@@ -20,6 +23,33 @@ const targets = [];describe('remote resource discovery', () => {+ it('omits desktop routines from live discovery and offline fallback while keeping other collections', async () => {+ const collections = [+ { id: 'routines', title: '例行任务', resourceKind: 'routine', placement: 'home-scope', targets },+ { id: 'teammates', title: 'Companions', resourceKind: 'bot', placement: 'home-scope', targets },+ { id: 'future-module', title: 'Future', resourceKind: 'future', placement: 'home-scope', targets },+ ];+ const invoke = vi.fn(async () => ({ protocolVersion: 1, collections })) as RemoteInvoke;+ const manifest = await loadRemoteResourceManifest(invoke, targets[0]);+ expect(manifest?.collections.map((item) => item.id)).toEqual(['teammates', 'future-module']);+ const live = await discoverRemoteHomeCollections(invoke, targets);+ expect(live.map((item) => item.id)).toEqual(['teammates', 'future-module']);+ const offline = vi.fn(async () => { throw new Error('offline'); }) as RemoteInvoke;+ const restored = await discoverRemoteHomeCollections(offline, targets, 'en', collections);+ expect(restored.map((item) => item.id)).toEqual(['teammates', 'future-module']);+ });++ it('does not send routine reads or actions from stale mobile links', async () => {+ const invoke = vi.fn() as RemoteInvoke;+ const ref = { collectionId: 'routines', kind: 'routine', id: 'daily' };+ await expect(listRemoteCollection(invoke, targets[0], 'routines')).rejects.toThrow('Unsupported mobile resource collection');+ await expect(getRemoteResource(invoke, targets[0], ref)).rejects.toThrow('Unsupported mobile resource collection');+ await expect(invokeRemoteResourceAction(invoke, targets[0], {+ collectionId: 'routines', actionId: 'run-now', resourceRef: ref,+ })).rejects.toThrow('Unsupported mobile resource collection');+ expect(invoke).not.toHaveBeenCalled();+ });+it('keeps a discovered offline host while excluding revoked and disabled hosts', async () => {const previous = [{ id: 'teammates', title: 'Teammates', resourceKind: 'bot', placement: 'home-scope', targets }];const selected = remoteResourceDiscoveryTargets([diff --git a/apps/mobile/src/__tests__/scheduleIntervalLabel.test.ts b/apps/mobile/src/__tests__/scheduleIntervalLabel.test.tsdeleted file mode 100644index 01f7c5cb5f..0000000000--- a/apps/mobile/src/__tests__/scheduleIntervalLabel.test.ts+++ /dev/null@@ -1,49 +0,0 @@-import { describe, expect, it } from 'vitest';-import { createInstance } from 'i18next';-import { formatScheduleInterval } from '@/scheduler/scheduleIntervalLabel';-import { buildMobileScheduleInput, createMobileScheduleDraft } from '@/scheduler/scheduleFormModel';-import en from '@/i18n/locales/en/devices.json';-import zhCN from '@/i18n/locales/zh-CN/devices.json';-import zhTW from '@/i18n/locales/zh-TW/devices.json';-import ja from '@/i18n/locales/ja/devices.json';-import ko from '@/i18n/locales/ko/devices.json';--describe('preserved schedule interval labels', () => {- it.each([- [61_000, '1 minute 1 second'],- [450_000, '7 minutes 30 seconds'],- [28 * 60_000, '28 minutes'],- [59 * 60_000, '59 minutes'],- [59_000, '59 seconds'],- [61_001, '1 minute 1 second 1 millisecond'],- [1, '1 millisecond'],- ])('formats %i ms without a repeating minute fraction', (ms, expected) => {- expect(formatScheduleInterval(ms, 'en')).toBe(expected);- });-- it.each([- ['en', en, '1 minute 1 second'],- ['zh-CN', zhCN, '1分钟 1秒钟'],- ['zh-TW', zhTW, '1 分鐘 1 秒'],- ['ja', ja, '1 分 1 秒'],- ['ko', ko, '1분 1초'],- ] as const)('interpolates a localized duration in %s', async (locale, resources, expected) => {- const i18n = createInstance();- await i18n.init({ lng: locale, resources: { [locale]: { translation: resources } } });- const duration = formatScheduleInterval(61_000, locale);- expect(duration).toBe(expected);- const hint = i18n.t('automations.form.intervalPreservedHint', { duration });- expect(hint).toContain(expected);- expect(hint).not.toContain('{{');- expect(hint).not.toContain('1.016666');- });-- it('does not change the stored interval when formatting an untouched draft', () => {- const draft = {- ...createMobileScheduleDraft(null), name: 'Legacy', prompt: 'run',- intervalMinutes: '', sourceIntervalMs: 61_001, intervalMinutesTouched: false,- };- formatScheduleInterval(draft.sourceIntervalMs, 'en');- expect(buildMobileScheduleInput(draft).intervalMs).toBe(61_001);- });-});diff --git a/apps/mobile/src/__tests__/sessionTitleProjection.test.ts b/apps/mobile/src/__tests__/sessionTitleProjection.test.tsindex 00b114dec2..c2e7e07f2c 100644--- a/apps/mobile/src/__tests__/sessionTitleProjection.test.ts+++ b/apps/mobile/src/__tests__/sessionTitleProjection.test.ts@@ -23,7 +23,6 @@ function read(relPath: string): string {const sessionScreen = read('app/sessions/[sessionId].tsx');const sessionListActions = read('src/session/useSessionListActions.ts');-const automationsScreen = read('app/automations/[deviceId].tsx');const menuSheet = read('src/session/SessionMenuSheet.tsx');describe('mobile 会话标题投影出口', () => {@@ -39,12 +38,6 @@ describe('mobile 会话标题投影出口', () => {);});- it('自动化绑定会话选择器过投影', () => {- expect(automationsScreen).toContain(- "projectDraftSessionTitle(session.title, t('session.menu.unnamedTitle'))",- );- });-it('两个重命名入口都用投影值预填', () => {expect(sessionListActions).toContain("setRenameSessionDraft(projectDraftSessionTitle(session.title, t('session.menu.unnamedTitle')))",diff --git a/apps/mobile/src/device-link/remoteResourceCache.ts b/apps/mobile/src/device-link/remoteResourceCache.tsindex 397cce3d57..791519b822 100644--- a/apps/mobile/src/device-link/remoteResourceCache.ts+++ b/apps/mobile/src/device-link/remoteResourceCache.ts@@ -1,5 +1,5 @@import AsyncStorage from '@react-native-async-storage/async-storage';-import { normalizeRemoteCollectionItems, parseRemoteResourceTargets, type HostedRemoteCollectionItem, type RemoteHomeCollection } from './remoteResources';+import { isMobileRemoteCollectionSupported, normalizeRemoteCollectionItems, parseRemoteResourceTargets, type HostedRemoteCollectionItem, type RemoteHomeCollection } from './remoteResources';const PREFIX = 'cindy.remoteResources.v1.';const MAX_CHARS = 256 * 1024;@@ -21,10 +21,11 @@ function normalize(raw: unknown): Snapshot {const value = raw as Partial<Snapshot>;if (Array.isArray(value.home)) for (const row of value.home.slice(0, 32)) {if (!row || typeof row.id !== 'string' || row.id.length > 160 || typeof row.title !== 'string' || typeof row.resourceKind !== 'string') continue;+ if (!isMobileRemoteCollectionSupported(row.id)) continue;out.home.push({ id: row.id, title: row.title.slice(0, 512), resourceKind: row.resourceKind.slice(0,160), placement: 'home-scope', targets: parseRemoteResourceTargets(JSON.stringify(row.targets)) });}if (value.items && typeof value.items === 'object') for (const [id, rows] of Object.entries(value.items).slice(0, 32)) {- if (id.length > 160 || !Array.isArray(rows)) continue;+ if (id.length > 160 || !Array.isArray(rows) || !isMobileRemoteCollectionSupported(id)) continue;out.items[id] = rows.slice(0, 200).flatMap((row) => {if (!row) return [];const [host] = parseRemoteResourceTargets(JSON.stringify([row.host]));diff --git a/apps/mobile/src/device-link/remoteResources.ts b/apps/mobile/src/device-link/remoteResources.tsindex bb4d164211..d81eb86061 100644--- a/apps/mobile/src/device-link/remoteResources.ts+++ b/apps/mobile/src/device-link/remoteResources.ts@@ -31,6 +31,17 @@ export const MOBILE_REMOTE_RESOURCE_PRIMITIVES = ['session-controls',] as const;+/** Routines remain a desktop feature; other portable collections stay available. */+export function isMobileRemoteCollectionSupported(collectionId: string): boolean {+ return collectionId !== 'routines';+}++function assertMobileRemoteCollectionSupported(collectionId: string): void {+ if (!isMobileRemoteCollectionSupported(collectionId)) {+ throw new Error('Unsupported mobile resource collection');+ }+}+export interface RemoteResourceHostTarget {deviceId: string;deviceName: string;@@ -205,7 +216,7 @@ function normalizeManifest(value: unknown): RemoteResourceManifestResponse | nulif (!record || !Array.isArray(record.collections)) return null;const collections = record.collections.flatMap((item) => {const descriptor = validDescriptor(item);- return descriptor ? [descriptor] : [];+ return descriptor && isMobileRemoteCollectionSupported(descriptor.id) ? [descriptor] : [];});const protocolVersion = typeof record.protocolVersion === 'number'? record.protocolVersion@@ -245,7 +256,7 @@ export async function loadRemoteResourceManifest(/*** Merge the same host-advertised collection across computers. The mobile shell- * only understands placement and portable display primitives, not module ids.+ * uses placement and portable display primitives after applying mobile availability.*/export async function discoverRemoteHomeCollections(invoke: RemoteInvoke,@@ -288,7 +299,7 @@ export async function discoverRemoteHomeCollections(const byId = new Map<string, RemoteHomeCollection>();for (const { target, manifest } of discovered) {for (const collection of manifest?.collections ?? []) {- if (collection.placement !== 'home-scope') continue;+ if (collection.placement !== 'home-scope' || !isMobileRemoteCollectionSupported(collection.id)) continue;const existing = byId.get(collection.id);if (existing && existing.resourceKind === collection.resourceKind) {existing.targets.push(target);@@ -319,6 +330,8 @@ export async function invokeRemoteResourceAction(},locale?: string,): Promise<RemoteActionInvokeResponse> {+ assertMobileRemoteCollectionSupported(request.collectionId);+ if (request.resourceRef) assertMobileRemoteCollectionSupported(request.resourceRef.collectionId);return invoke<RemoteActionInvokeResponse>(target.deviceId, REMOTE_RESOURCE_INVOKE_CHANNEL, [{client: clientDescriptor(locale),...request,@@ -332,6 +345,7 @@ export async function getRemoteResource(locale?: string,supportedPrimitives: readonly string[] = [],): Promise<RemoteResource> {+ assertMobileRemoteCollectionSupported(ref.collectionId);const raw = await invoke<unknown>(target.deviceId, REMOTE_RESOURCE_GET_CHANNEL, [{client: { ...clientDescriptor(locale), primitives: [...MOBILE_REMOTE_RESOURCE_PRIMITIVES, ...supportedPrimitives] },ref,@@ -408,6 +422,7 @@ export function normalizeRemoteCollectionItems(value: unknown,collectionId: string,): RemoteCollectionItem[] {+ if (!isMobileRemoteCollectionSupported(collectionId)) return [];const record = recordOf(value);if (!record || !Array.isArray(record.items)) return [];return record.items.slice(0, 200).flatMap((candidate) => {@@ -440,6 +455,7 @@ export async function listRemoteCollection(collectionId: string,locale?: string,): Promise<RemoteCollectionListResponse> {+ assertMobileRemoteCollectionSupported(collectionId);return invoke<RemoteCollectionListResponse>(target.deviceId, REMOTE_RESOURCE_LIST_CHANNEL, [{client: clientDescriptor(locale),collectionId,diff --git a/apps/mobile/src/i18n/locales/en/devices.json b/apps/mobile/src/i18n/locales/en/devices.jsonindex 3e6ce99565..2e1d776b14 100644--- a/apps/mobile/src/i18n/locales/en/devices.json+++ b/apps/mobile/src/i18n/locales/en/devices.json@@ -450,8 +450,6 @@"waitingA11y": "Filter pending sessions","automationA11y": "Filter automation sessions"},- "plan": "Schedule",- "automationsButtonA11y": "Open remote automations","search": {"openA11y": "Search remote sessions","closeA11y": "Close remote session search",@@ -529,288 +527,6 @@},"viewAllRuns": "View all {{count}} runs"},- "automations": {- "heading": {- "delete": "Delete Automation",- "pause": "Pause Automation",- "deleteRun": "Delete Run"- },- "runNow": "Run now",- "error": {- "projectMissingConfig": "This project automation is missing projectConfigId. Delete it on the desktop.",- "deletePartial": "Automation deleted, but {{count}} generated sessions couldn't be updated. Check them on the desktop."- },- "subtitle": "{{active}} running · {{total}} tasks",- "metric": {- "running": "Running",- "unreadResults": "Unread Results",- "executing": "In Progress"- },- "summary": {- "paused": "{{count}} tasks paused. Select a task to run, pause, edit, or open its latest session.",- "default": "Select a task to run, pause, edit, or open its latest session."- },- "empty": {- "copy": "Create your first automation right from your phone, or create one on the desktop and sync it here.",- "title": "No automations on this device"- },- "createAutomation": "New Automation",- "recentRuns": "Recent Runs",- "runs": {- "emptyCopy": "After you tap {{runNow}}, new runs show up here.",- "emptyTitle": "No runs yet"- },- "form": {- "title": {- "create": "New Automation",- "edit": "Edit Automation"- },- "sessionMode": {- "bound": "Once bound to an existing session, the directory, worktree, Agent, and Fast mode follow that session.",- "persistent": "The first trigger creates a persistent session; later triggers continue in the same one.",- "fresh": "Each trigger creates a new session."- },- "field": {- "name": "Name",- "prompt": "Prompt",- "trigger": "Trigger",- "runSession": "Run Session",- "boundSession": "Bound Session",- "intervalMinutes": "Interval (minutes)",- "workspace": "Workspace",- "projectDir": "Project Directory",- "model": "Model",- "effort": "Reasoning Effort",- "timezone": "Time Zone"- },- "namePlaceholder": "e.g. Daily project check",- "scriptHint": "This is a script-only task; its script config can only be edited on the desktop. Here you can change the name, trigger, notifications, and other fields.",- "promptPlaceholder": "Describe clearly what {{appName}} should do on each run",- "trigger": {- "recurring": "Recurring",- "manual": "Manual"- },- "session": {- "fresh": "New Session",- "persistent": "Persistent",- "bound": "Bound"- },- "boundSessionA11y": "Bind session {{name}}",- "intervalPlaceholder": "Leave empty to use cron",- "intervalHint": "For minute intervals, use 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, or 30 minutes. For whole-hour intervals, enter a multiple of 60 from 60 to 1380 minutes (1–23 hours).",- "intervalPreservedHint": "This task's exact interval is {{duration}} and will be preserved until you edit or clear it.",- "workspace": {- "project": "Project",- "dialogue": "Chat"- },- "useWorktree": "Use worktree",- "modelPlaceholderBound": "Follow session",- "modelPlaceholderPiDefault": "Leave blank for default model",- "fastMode": "Fast Mode",- "notifyDesktop": "Desktop Notifications",- "notifyFeishu": "Feishu Notifications",- "savingA11y": "Saving automation",- "saveA11y": "Save automation",- "cancelA11y": "Cancel editing automation"- },- "delete": {- "counting": "Counting the sessions this automation generated…",- "confirmDeleteBoth": "Delete Task and Sessions",- "confirmArchive": "Delete Task and Archive Sessions",- "confirmTaskOnly": "Delete Task Only",- "title": "Delete {{name}}",- "copy": "Deleting an automation task doesn't interrupt runs already in progress. Generated sessions are handled by the option below, matching the desktop.",- "optionsA11y": "Choose how to handle generated sessions",- "keepDesc": "Delete only this automation task; past sessions stay in their original list.",- "keepLabel": "Keep Generated Sessions",- "archiveDesc": "After deleting the task, move its generated sessions to the archive, still searchable later.",- "archiveLabel": "Archive Generated Sessions",- "deleteDesc": "After deleting the task, also mark its generated sessions as deleted. This can't be undone from your phone.",- "deleteLabel": "Delete Generated Sessions",- "cancelA11y": "Cancel deleting automation",- "confirmA11y": "Confirm deleting automation"- },- "pause": {- "title": "Pause {{name}}",- "detailFallback": "Pausing stops this automation from triggering.",- "previewFallback": "No runs in progress",- "confirmA11y": "Confirm pausing automation",- "pausing": "Pausing",- "confirm": "Confirm Pause",- "cancelA11y": "Cancel pausing automation"- },- "runDelete": {- "title": "Delete this run record",- "copy": "This deletes only this automation run record. It won't delete the sessions it opened, and it won't affect future automatic triggers.",- "confirmA11y": "Confirm deleting run record",- "confirm": "Delete Record",- "cancelA11y": "Cancel deleting run record"- },- "template": {- "label": "Template",- "loadingA11y": "Loading templates",- "refreshA11y": "Refresh automation templates",- "loading": "Loading",- "refresh": "Refresh",- "cardA11y": "Automation template {{name}}",- "manualConfig": "Manual config",- "builtin": {- "nightly-test-heal": {- "name": "Nightly test self-healing",- "description": "Run tests every night and attempt minimal fixes for failures in an isolated worktree",- "prompt": "Run the project's test suite. If there are failures, attempt a minimal fix in an isolated worktree.\nConstraints:\n- Determine the standard test command from the repo docs or package scripts before running the full suite\n- Only fix issues backed by clear failing evidence; prefer the smallest possible change and avoid drive-by refactoring\n- Re-run the affected tests after fixing to confirm they pass, and review the full diff\n- Deliver fixes through the repo's workflow (e.g. create a branch and open a PR); never commit directly to the main branch\n- For failures that cannot be fixed safely, report the cause, suspicious files, and suggested next steps"- },- "pr-gatekeeper": {- "name": "PR gatekeeper",- "description": "Pre-review new changes on open PRs each weekday and report risks by severity",- "prompt": "Review the repository's open PRs and pre-screen their new changes.\nConstraints:\n- Go through open PRs with new commits in the past 24 hours (on Monday, look back over the whole weekend), citing PR numbers, file paths, and concrete diffs\n- Focus on correctness, security, data-loss, and compatibility issues, graded by severity\n- Only report issues backed by evidence and describe the failure scenario; do not nitpick on style preferences\n- Unless explicitly authorized, only output review conclusions; do not comment on PRs or change code"- },- "domain-radar": {- "name": "Domain radar",- "description": "Periodically collect the latest updates in a topic you follow and deliver an opinionated digest",- "prompt": "Collect the latest developments about \"{{topic}}\" from the past 24 hours (on Monday, look back over the whole weekend) and produce an opinionated digest.\nConstraints:\n- Use web search, cross-check multiple sources before trusting a claim, and cite the source link for every item\n- Prefer substantive developments (releases, research, policy, notable discussions); filter out marketing fluff and reposts\n- For each item, add a one-line judgement on why it matters instead of dumping links\n- When information is scarce or sources are questionable, say so honestly; never fabricate",- "params": {- "topic": {- "label": "Topic to follow",- "placeholder": "e.g. AI agents, EV market, frontend frameworks"- }- }- },- "competitor-watch": {- "name": "Competitor watch",- "description": "Weekly roundup of competitors' product and market moves, with impact analysis",- "prompt": "Track the past week's activity of these competitors: {{competitors}}.\nConstraints:\n- Use web search to cover product updates, releases, pricing changes, market moves, and user sentiment, citing sources\n- Distinguish official information from third-party accounts; clearly mark unverified rumors\n- For each significant update, analyze what it means for us and suggest a response\n- If nothing substantive happened, say so honestly instead of padding the report",- "params": {- "competitors": {- "label": "Competitors",- "placeholder": "e.g. Notion, Linear, Figma"- }- }- },- "weekly-work-draft": {- "name": "Weekly report drafter",- "description": "Compile this week's work from documents in the working directory into a report draft",- "prompt": "Based on this week's changes to documents, notes, and deliverables in the working directory, compile a weekly report draft.\nConstraints:\n- Only use content with actual modification traces in the working directory as evidence, citing the files\n- Organize as \"Done this week / In progress / Next week / Needs coordination\", concise enough to submit directly\n- Separate substantive progress from routine chores and highlight valuable output\n- Leave placeholders with notes where the material is insufficient so the user can fill them in"- },- "knowledge-freshness": {- "name": "Knowledge base freshness check",- "description": "Monthly health check of working-directory docs for outdated or conflicting content",- "prompt": "Health-check the documents in the working directory and find content that needs updating.\nConstraints:\n- Look for outdated information (stale dates, dead links, deprecated processes or tools), contradictions, and duplication\n- Cite the file path and location for every issue and explain the reasoning\n- Categorize as \"update / merge / delete\" suggestions and produce a revision checklist\n- Only output the report; do not modify the documents"- }- }- },- "scheduleRowA11y": "Automation task {{title}}",- "detail": {- "promptScriptFallback": "Script-only task; config can only be edited on the desktop",- "promptEmpty": "No task prompt saved",- "deleteA11y": "Delete automation",- "runNowA11y": "Run automation now",- "running": "Running",- "resumeA11y": "Resume automation",- "pauseA11y": "Pause automation",- "resume": "Resume",- "pause": "Pause",- "editA11y": "Edit automation",- "edit": "Edit"- },- "run": {- "openSessionA11y": "Open automation session",- "opening": "Opening",- "session": "Session",- "restartA11y": "Re-run automation",- "restarting": "Re-running",- "restart": "Re-run",- "markReadA11y": "Mark run record as read",- "marking": "Marking",- "markRead": "Read",- "deleteA11y": "Delete run record"- },- "presentation": {- "validation": {- "templateParameter": "Enter the template parameter: {{label}}",- "name": "Enter a task name",- "prompt": "Enter a task prompt",- "timezone": "Enter a time zone",- "boundSession": "Choose a task to bind",- "cron": "Enter a cron expression",- "workingDir": "Enter a project directory",- "effort": "Reasoning effort must be one of: {{values}}",- "intervalPositiveInteger": "The interval in minutes must be a positive integer",- "preRunHookTimeout": "Check timeout must be a positive whole number of milliseconds",- "intervalUnsupported": "Minute intervals must divide an hour: use 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, or 30 minutes, or whole-hour intervals from 1–23 hours"- },- "schedule": {- "paused": "Paused",- "manual": "Manual trigger",- "once": "One-time task",- "waitingFirstRun": "Waiting for the first run",- "every": "Every {{duration}}",- "recurring": "Recurring task",- "dialogueWorkspace": "Chat workspace",- "noDirectory": "No directory set",- "lastRun": "Last run {{relative}}",- "imminent": "Running soon",- "nextRun": "In {{duration}}",- "status": {- "active": "Running",- "paused": "Paused",- "expired": "Completed"- },- "session": {- "persistent": "Persistent task",- "bound": "Bound task",- "fresh": "New task",- "persistentWithId": "Persistent task {{id}}",- "persistentDetail": "Reuse the same task after the first trigger",- "boundWithId": "Bound to {{id}}"- }- },- "run": {- "session": "Task {{id}}",- "delete": "Delete",- "markRead": "Read",- "canRestart": "Can run again",- "noSession": "No task created",- "open": "Open",- "restart": "Re-run",- "durationUnknown": "Duration unknown",- "runningFor": "Running for {{duration}}",- "duration": "Duration {{duration}}",- "unknownTime": "Unknown time",- "status": {- "running": "Running",- "success": "Succeeded",- "failed": "Failed",- "aborted": "Aborted",- "interrupted": "Interrupted",- "skipped": "Skipped"- }- },- "pause": {- "title": "Pause {{name}}",- "detail": "This automation currently has {{count}} runs in progress. Pausing stops future triggers immediately and stops these active runs.",- "preview": "Runs in progress: {{count}}"- },- "delete": {- "noSessions": "No tasks generated by this automation were found",- "sessions": "Found {{count}} tasks generated by this automation",- "withInflight": "{{sessions}}, with {{count}} runs still in progress"- },- "duration": {- "seconds": "{{count}} sec",- "minutesSeconds": "{{minutes}} min {{seconds}} sec",- "minutes": "{{count}} min",- "hours": "{{count}} hr",- "days": "{{count}} days"- },- "relative": {- "justNow": "just now",- "minutesAgo": "{{count}} min ago",- "hoursAgo": "{{count}} hr ago",- "daysAgo": "{{count}} days ago"- }- }- },"companions": {"messageSent": "Message sent to background task","sentTo": "Sent a message to {{name}}",@@ -858,90 +574,9 @@"startChat": "Start the conversation","preferenceSaveFailed": "Couldn’t save your view preference. Try switching views again.","automation": {- "unsupported": "Update Cindy on your computer, then retry to manage automations.",- "changed": "This automation changed elsewhere. Your edits are retained. Go back and reopen it to load the latest version.",- "unknown": "Unknown status","unsavedTitle": "Discard Changes?","unsavedBody": "Your changes haven’t been saved.",- "continueEditing": "Continue Editing",- "discard": "Discard Changes",- "invalid": "Check the name, instructions, and trigger settings, then save again.",- "failed": "The automation change did not finish.",- "everyMinutes": "Every {{count}} minutes",- "everyMinutes_one": "Every {{count}} minute",- "everyMinutes_other": "Every {{count}} minutes",- "paused": "Paused",- "new": "New Automation",- "save": "Save Automation",- "offline": "Reconnect to your computer to manage automations.",- "retry": "Retry Loading",- "inProgress": "In Progress",- "scheduled": "Scheduled",- "empty": "No automations yet. Create one to get started.",- "name": "Name",- "enabled": "Enabled",- "instructions": "Instructions",- "triggers": "Triggers",- "triggerType": "Trigger Type",- "cron": "Schedule",- "interval": "Interval",- "event": "Event",- "minutes": "Interval (Minutes)",- "source": "Event Source",- "filterField": "Filter Field",- "operator": "Condition",- "equals": "Equals",- "contains": "Contains",- "not-equals": "Does Not Equal",- "filterValue": "Filter Value",- "removeFilter": "Remove Filter",- "addFilter": "Add Filter",- "removeTrigger": "Remove Trigger",- "addTrigger": "Add Trigger",- "largeDefinition": "This automation is too large to edit here. Edit it on your computer.",- "run": "Run Now",- "runTitle": "Run This Automation Now?",- "cancel": "Cancel",- "history": "Run History",- "noRuns": "No runs yet. Run this automation to get started.",- "delete": "Delete Automation",- "deleteTitle": "Delete This Automation?",- "deleteBody": "This automation will no longer trigger. This can’t be undone.",- "queued": "Queued",- "running": "Running",- "success": "Completed",- "failed": "Failed",- "interrupted": "Interrupted",- "cancelled": "Cancelled",- "repeat": "Repeat",- "hourly": "Hourly",- "daily": "Daily",- "weekdays": "Weekdays",- "weekly": "Weekly",- "custom": "Custom",- "weekday": "Day of Week",- "day0": "Sunday",- "day1": "Monday",- "day2": "Tuesday",- "day3": "Wednesday",- "day4": "Thursday",- "day5": "Friday",- "day6": "Saturday",- "time": "Time",- "hour": "Hour",- "minute": "Minute",- "cronExpression": "Cron Expression",- "timezone": "Time Zone",- "monthly": "Monthly",- "monthDay": "Day of month",- "saveAndRun": "Save and run",- "advanced": "Advanced settings",- "quiet": "Stay quiet when checks find nothing",- "quietHint": "Report changes or problems only. Turn off for reminders and scheduled messages.",- "checkCommand": "Pre-run check command",- "checkHint": "Optional. Checks on the computer before each run: exit 2 skips the run, exit 0 continues, errors stay visible. Clear to remove.",- "timeoutMs": "Check timeout (ms, blank for no limit)",- "skipped": "Checked · model skipped"+ "discard": "Discard Changes"},"openNavigation": "Open navigation","openProfile": "View {{name}}'s profile",@@ -1022,7 +657,6 @@"skills": "Skills & Connections","artifacts": "Artifacts","direct": "Teammate Messages",- "automation": "Automations","settings": "Models & Permissions","search": "Search Messages","models": "Model Chain",diff --git a/apps/mobile/src/i18n/locales/ja/devices.json b/apps/mobile/src/i18n/locales/ja/devices.jsonindex 97eed25ad8..dbc7aec6ae 100644--- a/apps/mobile/src/i18n/locales/ja/devices.json+++ b/apps/mobile/src/i18n/locales/ja/devices.json@@ -450,8 +450,6 @@"waitingA11y": "対応待ちのセッションで絞り込み","automationA11y": "自動化のセッションで絞り込み"},- "plan": "スケジュール",- "automationsButtonA11y": "リモート自動化を開く","search": {"openA11y": "リモートセッションを検索","closeA11y": "リモートセッションの検索を閉じる",@@ -529,288 +527,6 @@},"viewAllRuns": "すべての実行 {{count}} 回を表示"},- "automations": {- "heading": {- "delete": "自動化を削除",- "pause": "自動化を一時停止",- "deleteRun": "実行記録を削除"- },- "runNow": "今すぐ実行",- "error": {- "projectMissingConfig": "プロジェクト自動化に projectConfigId がありません。デスクトップで削除してください。",- "deletePartial": "自動化を削除しましたが、{{count}} 件の生成されたセッションの状態を更新できませんでした。デスクトップでこれらのセッションを確認してください。"- },- "subtitle": "実行中 {{active}} 件 · タスク {{total}} 件",- "metric": {- "running": "実行中",- "unreadResults": "未読の結果",- "executing": "処理中"- },- "summary": {- "paused": "{{count}} 件のタスクが一時停止中です。タスクを選ぶと実行・一時停止・編集や最近のセッションを開けます。",- "default": "タスクを選ぶと実行・一時停止・編集や最近のセッションを開けます。"- },- "empty": {- "copy": "最初の自動化タスクをスマホから直接作成するか、デスクトップで作成してここに同期できます。",- "title": "このデバイスには自動化がありません"- },- "createAutomation": "自動化を新規作成",- "recentRuns": "最近の実行",- "runs": {- "emptyCopy": "「{{runNow}}」をタップすると、新しい実行がここに表示されます。",- "emptyTitle": "まだ実行記録がありません"- },- "form": {- "title": {- "create": "自動化を新規作成",- "edit": "自動化を編集"- },- "sessionMode": {- "bound": "既存のセッションにひも付けると、ディレクトリ、worktree、Agent、Fast モードがそのセッションに従います。",- "persistent": "最初のトリガーで継続セッションを作成し、以降のトリガーは同じセッションに続けます。",- "fresh": "トリガーごとに新しいセッションを作成します。"- },- "field": {- "name": "名前",- "prompt": "プロンプト",- "trigger": "トリガー方式",- "runSession": "実行セッション",- "boundSession": "ひも付けセッション",- "intervalMinutes": "間隔(分)",- "workspace": "ワークスペース",- "projectDir": "プロジェクトディレクトリ",- "model": "モデル",- "effort": "推論強度",- "timezone": "タイムゾーン"- },- "namePlaceholder": "例:毎日のプロジェクト点検",- "scriptHint": "これはスクリプトのみのタスクです。スクリプト設定はデスクトップでのみ編集できます。ここでは名前、トリガー方式、通知などのその他の項目を変更できます。",- "promptPlaceholder": "毎回の自動実行で {{appName}} に何をさせたいかを明確に書いてください",- "trigger": {- "recurring": "定期",- "manual": "手動"- },- "session": {- "fresh": "新しいセッション",- "persistent": "継続",- "bound": "ひも付け"- },- "boundSessionA11y": "セッション {{name}} をひも付け",- "intervalPlaceholder": "空欄の場合は cron を使用",- "intervalHint": "分間隔は 1、2、3、4、5、6、10、12、15、20、30 分から選択してください。整数時間の間隔は、60~1380 分(1~23 時間)の範囲で 60 の倍数を入力してください。",- "intervalPreservedHint": "このタスクの正確な間隔は {{duration}} です。編集または消去するまで保持されます。",- "workspace": {- "project": "プロジェクト",- "dialogue": "会話"- },- "useWorktree": "worktree を使用",- "modelPlaceholderBound": "セッションに従う",- "modelPlaceholderPiDefault": "空欄でデフォルトモデル",- "fastMode": "Fast モード",- "notifyDesktop": "デスクトップ通知",- "notifyFeishu": "Feishu 通知",- "savingA11y": "自動化を保存中",- "saveA11y": "自動化を保存",- "cancelA11y": "自動化の編集をキャンセル"- },- "delete": {- "counting": "この自動化が生成したセッションを集計中…",- "confirmDeleteBoth": "タスクとセッションを削除",- "confirmArchive": "タスクを削除してセッションをアーカイブ",- "confirmTaskOnly": "タスクのみ削除",- "title": "{{name}} を削除",- "copy": "自動化タスクを削除しても、すでに開始された実行は中断されません。生成されたセッションは下のオプションに従って処理され、デスクトップと同じ挙動になります。",- "optionsA11y": "生成されたセッションの処理方法を選択",- "keepDesc": "この自動化タスクだけを削除し、過去のセッションは元のリストに残します。",- "keepLabel": "生成されたセッションを残す",- "archiveDesc": "タスクを削除した後、生成されたセッションをアーカイブに移動します。後で検索できます。",- "archiveLabel": "生成されたセッションをアーカイブ",- "deleteDesc": "タスクを削除した後、生成されたセッションも削除済みとして扱います。この操作はスマホからは元に戻せません。",- "deleteLabel": "生成されたセッションを削除",- "cancelA11y": "自動化の削除をキャンセル",- "confirmA11y": "自動化の削除を確定"- },- "pause": {- "title": "{{name}} を一時停止",- "detailFallback": "一時停止すると、この自動化のトリガーが止まります。",- "previewFallback": "実行中の run はありません",- "confirmA11y": "自動化の一時停止を確定",- "pausing": "一時停止中",- "confirm": "一時停止を確定",- "cancelA11y": "自動化の一時停止をキャンセル"- },- "runDelete": {- "title": "この実行記録を削除",- "copy": "この自動化の実行記録のみを削除します。開いたセッションは削除されず、以降の自動トリガーにも影響しません。",- "confirmA11y": "実行記録の削除を確定",- "confirm": "記録を削除",- "cancelA11y": "実行記録の削除をキャンセル"- },- "template": {- "label": "テンプレート",- "loadingA11y": "テンプレートを読み込み中",- "refreshA11y": "自動化テンプレートを更新",- "loading": "読み込み中",- "refresh": "更新",- "cardA11y": "自動化テンプレート {{name}}",- "manualConfig": "手動設定",- "builtin": {- "nightly-test-heal": {- "name": "夜間セルフヒーリングテスト",- "description": "毎晩テストを実行し、失敗項目を分離ワークツリーで最小修正",- "prompt": "プロジェクトのテストスイートを実行し、失敗があれば隔離された worktree で最小限の修正を試みてください。\n制約:\n- リポジトリのドキュメントまたは package スクリプトから標準のテストコマンドを特定してから、テストスイート全体を実行する\n- 明確な失敗の証拠がある問題だけを修正し、影響範囲が最小の変更を優先して、ついでのリファクタリングは避ける\n- 修正後は関連テストを再実行して成功を確認し、diff 全体をレビューする\n- リポジトリのワークフローに従って修正を提出する(例:ブランチを作成して PR を開く)。main ブランチを直接変更しない\n- 安全に修正できない失敗については、原因、疑わしいファイル、推奨する調査手順を報告する"- },- "pr-gatekeeper": {- "name": "PR ゲートキーパー",- "description": "平日にオープン PR の新規変更を事前レビューし、重大度別にリスクを報告",- "prompt": "リポジトリで現在オープンな PR を確認し、新しい変更を事前レビューしてください。\n制約:\n- 過去 24 時間以内に新しいコミットがあるオープン PR を 1 件ずつ確認する(月曜日は週末全体を対象)。PR 番号、ファイルパス、具体的な diff を引用する\n- 正確性、セキュリティ、データ損失、互換性の問題に重点を置き、深刻度別に分類する\n- 証拠で裏付けられる問題だけを報告し、失敗シナリオを説明する。スタイル上の好みだけで指摘しない\n- ユーザーが明示的に許可しない限り、レビュー結果のみを出力し、PR へのコメントやコード変更は行わない"- },- "domain-radar": {- "name": "分野レーダー",- "description": "注目分野の最新動向を定期収集し、見解付きサマリーを出力",- "prompt": "テーマ「{{topic}}」について過去 24 時間の最新動向(月曜日は週末全体)を収集し、見解を含むダイジェストを作成してください。\n制約:\n- Web 検索を使い、複数の情報源で照合してから採用し、各項目に出典リンクを付ける\n- リリース、研究、政策、重要な議論など実質的な進展を優先し、宣伝記事や転載を除外する\n- リンクを並べるだけでなく、各動向に「なぜ注目すべきか」を 1 文で示す\n- 情報が少ない場合や情報源に疑義がある場合は率直に明記し、推測で補わない",- "params": {- "topic": {- "label": "注目テーマ",- "placeholder": "例:AI エージェント、新エネルギー、フロントエンド"- }- }- },- "competitor-watch": {- "name": "競合ウォッチ",- "description": "競合の製品・市場動向を週次でまとめ、自社への影響を分析",- "prompt": "次の競合の過去 1 週間の動向を追跡してください:{{competitors}}。\n制約:\n- Web 検索で製品更新、リリース、価格変更、市場動向、ユーザー評価を調べ、出典を示す\n- 公式情報と第三者による情報を区別し、未確認の噂は明示する\n- 重要な動向ごとに、それが自社に何を意味するかを分析し、対応案を示す\n- 実質的な動きがない場合は、水増しせず率直にその旨を伝える",- "params": {- "competitors": {- "label": "競合リスト",- "placeholder": "例:Notion、Linear、Figma"- }- }- },- "weekly-work-draft": {- "name": "週報ドラフトアシスタント",- "description": "作業ディレクトリのドキュメントから今週の作業を整理し、週報ドラフトを生成",- "prompt": "作業ディレクトリ内で今週変更されたドキュメント、メモ、成果物を基に、週報の下書きを作成してください。\n制約:\n- 作業ディレクトリ内に実際の変更履歴がある内容だけを根拠とし、対応するファイルを示す\n- 「今週完了 / 進行中 / 来週の予定 / 調整が必要」の構成で、そのまま提出できる簡潔な文章にする\n- 実質的な進捗と定常作業を区別し、価値のある成果を強調する\n- 判断材料が足りない箇所には説明付きのプレースホルダーを残し、ユーザーが追記できるようにする"- },- "knowledge-freshness": {- "name": "ナレッジベース鮮度チェック",- "description": "毎月ドキュメントを点検し、古い内容や矛盾を洗い出す",- "prompt": "作業ディレクトリ内のドキュメントを点検し、更新が必要な内容を見つけてください。\n制約:\n- 古い情報(過去の日付、無効なリンク、廃止された手順やツール)、矛盾、重複を確認する\n- 各問題についてファイルパスと具体的な場所を示し、判断理由を説明する\n- 「更新を推奨 / 統合を推奨 / 削除を推奨」に分類し、修正チェックリストを作成する\n- 点検レポートだけを出力し、ドキュメント自体は変更しない"- }- }- },- "scheduleRowA11y": "自動化タスク {{title}}",- "detail": {- "promptScriptFallback": "スクリプトのみのタスク。設定はデスクトップでのみ編集できます",- "promptEmpty": "タスクのプロンプトが保存されていません",- "deleteA11y": "自動化を削除",- "runNowA11y": "自動化を今すぐ実行",- "running": "実行中",- "resumeA11y": "自動化を再開",- "pauseA11y": "自動化を一時停止",- "resume": "再開",- "pause": "一時停止",- "editA11y": "自動化を編集",- "edit": "編集"- },- "run": {- "openSessionA11y": "自動化セッションを開く",- "opening": "開いています",- "session": "セッション",- "restartA11y": "自動化を再実行",- "restarting": "再実行中",- "restart": "再実行",- "markReadA11y": "実行記録を既読にする",- "marking": "マーク中",- "markRead": "既読",- "deleteA11y": "実行記録を削除"- },- "presentation": {- "validation": {- "templateParameter": "テンプレートパラメーターを入力してください:{{label}}",- "name": "タスク名を入力してください",- "prompt": "タスクのプロンプトを入力してください",- "timezone": "タイムゾーンを入力してください",- "boundSession": "ひも付けるタスクを選択してください",- "cron": "cron 式を入力してください",- "workingDir": "プロジェクトディレクトリを入力してください",- "effort": "推論強度は次のいずれかを指定してください:{{values}}",- "intervalPositiveInteger": "間隔(分)は正の整数で入力してください",- "preRunHookTimeout": "確認のタイムアウトは正の整数のミリ秒で入力してください",- "intervalUnsupported": "分間隔は 1 時間を割り切れる値(1、2、3、4、5、6、10、12、15、20、30 分)、または 1~23 時間の正時で指定してください"- },- "schedule": {- "paused": "一時停止中",- "manual": "手動トリガー",- "once": "単発タスク",- "waitingFirstRun": "初回実行待ち",- "every": "{{duration}}ごと",- "recurring": "定期タスク",- "dialogueWorkspace": "会話ワークスペース",- "noDirectory": "ディレクトリ未設定",- "lastRun": "前回 {{relative}}",- "imminent": "まもなく実行",- "nextRun": "{{duration}}後",- "status": {- "active": "実行中",- "paused": "一時停止中",- "expired": "完了"- },- "session": {- "persistent": "継続タスク",- "bound": "ひも付けタスク",- "fresh": "新規タスク",- "persistentWithId": "継続タスク {{id}}",- "persistentDetail": "初回トリガー後も同じタスクを再利用します",- "boundWithId": "{{id}} にひも付け"- }- },- "run": {- "session": "タスク {{id}}",- "delete": "削除",- "markRead": "既読",- "canRestart": "再実行できます",- "noSession": "タスク未作成",- "open": "開く",- "restart": "再実行",- "durationUnknown": "所要時間不明",- "runningFor": "実行時間 {{duration}}",- "duration": "所要時間 {{duration}}",- "unknownTime": "時刻不明",- "status": {- "running": "実行中",- "success": "成功",- "failed": "失敗",- "aborted": "中止済み",- "interrupted": "中断",- "skipped": "スキップ"- }- },- "pause": {- "title": "{{name}} を一時停止",- "detail": "この自動化では現在 {{count}} 件の実行が進行中です。一時停止すると今後のトリガーを直ちに止め、進行中の実行も停止します。",- "preview": "実行中:{{count}} 件"- },- "delete": {- "noSessions": "この自動化が生成したタスクは見つかりませんでした",- "sessions": "この自動化が生成したタスクが {{count}} 件見つかりました",- "withInflight": "{{sessions}}。さらに {{count}} 件の実行が進行中です"- },- "duration": {- "seconds": "{{count}} 秒",- "minutesSeconds": "{{minutes}} 分 {{seconds}} 秒",- "minutes": "{{count}} 分",- "hours": "{{count}} 時間",- "days": "{{count}} 日"- },- "relative": {- "justNow": "たった今",- "minutesAgo": "{{count}} 分前",- "hoursAgo": "{{count}} 時間前",- "daysAgo": "{{count}} 日前"- }- }- },"companions": {"messageSent": "バックグラウンドタスクにメッセージを送信しました","sentTo": "{{name}} にメッセージを送信",@@ -858,90 +574,9 @@"startChat": "会話を始める","preferenceSaveFailed": "表示設定を保存できませんでした。もう一度表示を切り替えてください。","automation": {- "unsupported": "自動化を管理するには、パソコンの Cindy を更新して再試行してください。",- "changed": "この自動化は別の場所で変更されました。編集内容は保持されています。戻って開き直すと最新の内容を読み込めます。",- "unknown": "状態不明","unsavedTitle": "変更を破棄しますか?","unsavedBody": "変更はまだ保存されていません。",- "continueEditing": "編集を続ける",- "discard": "変更を破棄",- "invalid": "名前、実行内容、トリガー設定を確認して、もう一度保存してください。",- "failed": "自動化の操作は完了しませんでした。",- "everyMinutes": "{{count}} 分ごと",- "everyMinutes_one": "{{count}} 分ごと",- "everyMinutes_other": "{{count}} 分ごと",- "paused": "一時停止中",- "new": "自動化を作成",- "save": "自動化を保存",- "offline": "自動化を管理するには、パソコンに再接続してください。",- "retry": "再読み込み",- "inProgress": "進行中",- "scheduled": "予定済み",- "empty": "自動化はまだありません。作成して始めましょう。",- "name": "名前",- "enabled": "有効",- "instructions": "実行内容",- "triggers": "トリガー",- "triggerType": "トリガーの種類",- "cron": "スケジュール",- "interval": "間隔",- "event": "イベント",- "minutes": "間隔(分)",- "source": "イベントのソース",- "filterField": "フィルターの項目",- "operator": "条件",- "equals": "等しい",- "contains": "含む",- "not-equals": "等しくない",- "filterValue": "フィルターの値",- "removeFilter": "フィルターを削除",- "addFilter": "フィルターを追加",- "removeTrigger": "トリガーを削除",- "addTrigger": "トリガーを追加",- "largeDefinition": "この自動化は大きすぎるため、ここでは編集できません。パソコンで編集してください。",- "run": "今すぐ実行",- "runTitle": "この自動化を今すぐ実行しますか?",- "cancel": "キャンセル",- "history": "実行履歴",- "noRuns": "実行履歴はまだありません。自動化を実行してみましょう。",- "delete": "自動化を削除",- "deleteTitle": "この自動化を削除しますか?",- "deleteBody": "今後この自動化は起動しなくなります。この操作は元に戻せません。",- "queued": "開始待ち",- "running": "実行中",- "success": "完了",- "failed": "失敗",- "interrupted": "中断",- "cancelled": "キャンセル済み",- "repeat": "繰り返し",- "hourly": "毎時",- "daily": "毎日",- "weekdays": "月曜日から金曜日",- "weekly": "毎週",- "custom": "カスタム",- "weekday": "曜日",- "day0": "日曜日",- "day1": "月曜日",- "day2": "火曜日",- "day3": "水曜日",- "day4": "木曜日",- "day5": "金曜日",- "day6": "土曜日",- "time": "時刻",- "hour": "時",- "minute": "分",- "cronExpression": "Cron 式",- "timezone": "タイムゾーン",- "monthly": "毎月",- "monthDay": "毎月の日付",- "saveAndRun": "保存して実行",- "advanced": "詳細設定",- "quiet": "確認で変化がなければ通知しない",- "quietHint": "変化や問題のみ報告します。リマインダーや定時送信ではオフにできます。",- "checkCommand": "事前確認コマンド",- "checkHint": "任意。コンピューターで先に確認します。終了コード 2 は今回の実行をスキップし、0 は続行します。エラーは報告されます。空欄で解除します。",- "timeoutMs": "確認のタイムアウト(ミリ秒、空欄は無制限)",- "skipped": "確認済み · モデル起動なし"+ "discard": "変更を破棄"},"openNavigation": "ナビゲーションを開く","openProfile": "{{name}}のプロフィールを表示",@@ -1022,7 +657,6 @@"skills": "スキルと接続","artifacts": "成果物","direct": "チームメイト間のメッセージ",- "automation": "自動化","settings": "モデルと権限","search": "メッセージを検索","models": "モデル候補",diff --git a/apps/mobile/src/i18n/locales/ko/devices.json b/apps/mobile/src/i18n/locales/ko/devices.jsonindex 60c88e9ac9..4be5164576 100644--- a/apps/mobile/src/i18n/locales/ko/devices.json+++ b/apps/mobile/src/i18n/locales/ko/devices.json@@ -450,8 +450,6 @@"waitingA11y": "대기 중인 세션으로 필터링","automationA11y": "자동화 세션으로 필터링"},- "plan": "스케줄",- "automationsButtonA11y": "원격 자동화 열기","search": {"openA11y": "원격 세션 검색","closeA11y": "원격 세션 검색 닫기",@@ -529,288 +527,6 @@},"viewAllRuns": "실행 {{count}}회 모두 보기"},- "automations": {- "heading": {- "delete": "자동화 삭제",- "pause": "자동화 일시 중지",- "deleteRun": "실행 기록 삭제"- },- "runNow": "지금 실행",- "error": {- "projectMissingConfig": "프로젝트 자동화에 projectConfigId가 없습니다. 데스크톱에서 삭제하세요.",- "deletePartial": "자동화를 삭제했지만 생성된 세션 {{count}}개의 상태를 업데이트하지 못했습니다. 데스크톱에서 이 세션들을 확인하세요."- },- "subtitle": "실행 중 {{active}}개 · 작업 {{total}}개",- "metric": {- "running": "실행 중",- "unreadResults": "읽지 않은 결과",- "executing": "처리 중"- },- "summary": {- "paused": "작업 {{count}}개가 일시 중지되었습니다. 작업을 선택하면 실행·일시 중지·편집하거나 최근 세션을 열 수 있습니다.",- "default": "작업을 선택하면 실행·일시 중지·편집하거나 최근 세션을 열 수 있습니다."- },- "empty": {- "copy": "휴대폰에서 첫 자동화 작업을 바로 만들거나, 데스크톱에서 만든 후 여기로 동기화할 수 있습니다.",- "title": "이 기기에는 자동화가 없습니다"- },- "createAutomation": "자동화 새로 만들기",- "recentRuns": "최근 실행",- "runs": {- "emptyCopy": "‘{{runNow}}’을 누르면 새 실행이 여기에 표시됩니다.",- "emptyTitle": "아직 실행 기록이 없습니다"- },- "form": {- "title": {- "create": "자동화 새로 만들기",- "edit": "자동화 편집"- },- "sessionMode": {- "bound": "기존 세션에 연결하면 디렉터리, worktree, Agent, Fast 모드가 해당 세션을 따릅니다.",- "persistent": "첫 트리거에서 지속 세션을 만들고, 이후 트리거는 같은 세션에서 이어집니다.",- "fresh": "트리거할 때마다 새 세션을 만듭니다."- },- "field": {- "name": "이름",- "prompt": "프롬프트",- "trigger": "트리거 방식",- "runSession": "실행 세션",- "boundSession": "연결 세션",- "intervalMinutes": "간격(분)",- "workspace": "작업 공간",- "projectDir": "프로젝트 디렉터리",- "model": "모델",- "effort": "추론 강도",- "timezone": "시간대"- },- "namePlaceholder": "예: 매일 프로젝트 점검",- "scriptHint": "이것은 스크립트 전용 작업입니다. 스크립트 설정은 데스크톱에서만 편집할 수 있습니다. 여기서는 이름, 트리거 방식, 알림 등 다른 항목을 변경할 수 있습니다.",- "promptPlaceholder": "매번 자동 실행할 때 {{appName}}이(가) 무엇을 하기를 원하는지 명확하게 작성하세요",- "trigger": {- "recurring": "주기",- "manual": "수동"- },- "session": {- "fresh": "새 세션",- "persistent": "지속",- "bound": "연결"- },- "boundSessionA11y": "세션 {{name}} 연결",- "intervalPlaceholder": "비워 두면 cron 사용",- "intervalHint": "분 간격은 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30분을 사용하세요. 정수 시간 간격은 60~1380분(1~23시간) 범위에서 60의 배수로 입력하세요.",- "intervalPreservedHint": "이 작업의 정확한 간격은 {{duration}}이며, 수정하거나 지우기 전까지 유지됩니다.",- "workspace": {- "project": "프로젝트",- "dialogue": "대화"- },- "useWorktree": "worktree 사용",- "modelPlaceholderBound": "세션 따르기",- "modelPlaceholderPiDefault": "비워두면 기본 모델",- "fastMode": "Fast 모드",- "notifyDesktop": "데스크톱 알림",- "notifyFeishu": "Feishu 알림",- "savingA11y": "자동화 저장 중",- "saveA11y": "자동화 저장",- "cancelA11y": "자동화 편집 취소"- },- "delete": {- "counting": "이 자동화가 생성한 세션을 집계하는 중…",- "confirmDeleteBoth": "작업과 세션 삭제",- "confirmArchive": "작업 삭제 후 세션 보관",- "confirmTaskOnly": "작업만 삭제",- "title": "{{name}} 삭제",- "copy": "자동화 작업을 삭제해도 이미 시작된 실행은 중단되지 않습니다. 생성된 세션은 아래 옵션에 따라 처리되며 데스크톱과 동일하게 동작합니다.",- "optionsA11y": "생성된 세션 처리 방식 선택",- "keepDesc": "이 자동화 작업만 삭제하고, 이전 세션은 원래 목록에 그대로 둡니다.",- "keepLabel": "생성된 세션 유지",- "archiveDesc": "작업을 삭제한 후 생성된 세션을 보관함으로 옮깁니다. 이후에도 검색할 수 있습니다.",- "archiveLabel": "생성된 세션 보관",- "deleteDesc": "작업을 삭제한 후 생성된 세션도 삭제됨으로 표시합니다. 이 작업은 휴대폰에서 되돌릴 수 없습니다.",- "deleteLabel": "생성된 세션 삭제",- "cancelA11y": "자동화 삭제 취소",- "confirmA11y": "자동화 삭제 확인"- },- "pause": {- "title": "{{name}} 일시 중지",- "detailFallback": "일시 중지하면 이 자동화의 트리거가 멈춥니다.",- "previewFallback": "실행 중인 run이 없습니다",- "confirmA11y": "자동화 일시 중지 확인",- "pausing": "일시 중지 중",- "confirm": "일시 중지 확인",- "cancelA11y": "자동화 일시 중지 취소"- },- "runDelete": {- "title": "이 실행 기록 삭제",- "copy": "이 자동화 실행 기록만 삭제합니다. 열었던 세션은 삭제되지 않으며 이후 자동 트리거에도 영향을 주지 않습니다.",- "confirmA11y": "실행 기록 삭제 확인",- "confirm": "기록 삭제",- "cancelA11y": "실행 기록 삭제 취소"- },- "template": {- "label": "템플릿",- "loadingA11y": "템플릿 불러오는 중",- "refreshA11y": "자동화 템플릿 새로 고침",- "loading": "불러오는 중",- "refresh": "새로 고침",- "cardA11y": "자동화 템플릿 {{name}}",- "manualConfig": "수동 설정",- "builtin": {- "nightly-test-heal": {- "name": "야간 자가 복구 테스트",- "description": "매일 밤 테스트를 실행하고 실패 항목을 격리 워크트리에서 최소 수정",- "prompt": "프로젝트의 테스트 스위트를 실행하고, 실패 항목이 있으면 격리된 worktree에서 최소한의 수정을 시도하세요.\n제약 사항:\n- 전체 테스트를 실행하기 전에 저장소 문서나 package 스크립트에서 표준 테스트 명령을 확인합니다\n- 명확한 실패 증거가 있는 문제만 수정하고, 영향 범위가 가장 작은 변경을 우선하며 관련 없는 리팩터링은 피합니다\n- 수정 후 관련 테스트를 다시 실행해 통과 여부를 확인하고 전체 diff를 검토합니다\n- 저장소의 작업 흐름에 따라 수정 사항을 전달합니다(예: 브랜치를 만들고 PR 열기). main 브랜치를 직접 변경하지 않습니다\n- 안전하게 수정할 수 없는 실패 항목은 원인, 의심되는 파일, 권장 조사 단계를 보고합니다"- },- "pr-gatekeeper": {- "name": "PR 게이트키퍼",- "description": "평일마다 오픈 PR의 새 변경을 사전 리뷰하고 심각도별로 위험 보고",- "prompt": "저장소에서 현재 열려 있는 PR을 확인하고 새 변경 사항을 사전 검토하세요.\n제약 사항:\n- 지난 24시간 동안 새 커밋이 추가된 열린 PR을 하나씩 확인합니다(월요일에는 주말 전체를 확인). PR 번호, 파일 경로, 구체적인 diff를 인용합니다\n- 정확성, 보안, 데이터 손실, 호환성 문제를 중점적으로 찾고 심각도별로 분류합니다\n- 증거로 뒷받침되는 문제만 보고하고 실패 시나리오를 설명합니다. 스타일 취향만으로 지적하지 않습니다\n- 사용자가 명시적으로 허용하지 않는 한 검토 결과만 출력하고 PR에 댓글을 달거나 코드를 변경하지 않습니다"- },- "domain-radar": {- "name": "관심 분야 레이더",- "description": "관심 분야의 최신 동향을 정기 수집해 관점 있는 요약 제공",- "prompt": "주제 \"{{topic}}\"에 관한 지난 24시간의 최신 동향을 수집하고(월요일에는 주말 전체를 확인) 관점이 담긴 요약을 작성하세요.\n제약 사항:\n- Web 검색을 사용하고 여러 출처를 교차 확인한 뒤 정보를 채택하며, 각 항목에 출처 링크를 표시합니다\n- 출시, 연구, 정책, 주요 논의처럼 실질적인 진전을 우선하고 홍보성 글과 중복 게시물은 제외합니다\n- 링크만 나열하지 말고 각 동향이 왜 중요한지 한 문장으로 판단을 덧붙입니다\n- 정보가 부족하거나 출처가 의심스러우면 솔직히 밝히고 지어내지 않습니다",- "params": {- "topic": {- "label": "관심 주제",- "placeholder": "예: AI 에이전트, 신에너지, 프런트엔드"- }- }- },- "competitor-watch": {- "name": "경쟁사 동향 추적",- "description": "경쟁사의 제품·시장 동향을 매주 정리하고 영향 분석",- "prompt": "다음 경쟁사의 지난 일주일간 동향을 추적하세요: {{competitors}}.\n제약 사항:\n- Web 검색으로 제품 업데이트, 출시, 가격 변경, 시장 움직임, 사용자 반응을 조사하고 출처를 표시합니다\n- 공식 정보와 제3자 전언을 구분하고 확인되지 않은 소문은 명확히 표시합니다\n- 중요한 동향마다 우리에게 어떤 의미가 있는지 분석하고 대응 방안을 제안합니다\n- 실질적인 동향이 없다면 내용을 부풀리지 말고 솔직히 밝힙니다",- "params": {- "competitors": {- "label": "경쟁사 목록",- "placeholder": "예: Notion, Linear, Figma"- }- }- },- "weekly-work-draft": {- "name": "주간 보고서 초안 도우미",- "description": "작업 디렉터리의 문서와 산출물로 주간 보고서 초안 생성",- "prompt": "작업 디렉터리에서 이번 주에 변경된 문서, 메모, 결과물을 바탕으로 주간 보고서 초안을 작성하세요.\n제약 사항:\n- 작업 디렉터리에 실제 변경 흔적이 있는 내용만 근거로 사용하고 해당 파일을 표시합니다\n- \"이번 주 완료 / 진행 중 / 다음 주 계획 / 협의 필요\" 구조로, 바로 제출할 수 있을 만큼 간결하게 작성합니다\n- 실질적인 진전과 반복 업무를 구분하고 가치 있는 결과물을 강조합니다\n- 판단할 자료가 부족한 부분에는 설명과 함께 자리 표시자를 남겨 사용자가 보완할 수 있게 합니다"- },- "knowledge-freshness": {- "name": "지식 베이스 신선도 점검",- "description": "매월 문서를 점검해 오래된 내용과 모순 찾기",- "prompt": "작업 디렉터리의 문서를 점검하고 업데이트가 필요한 내용을 찾으세요.\n제약 사항:\n- 오래된 정보(지난 날짜, 끊어진 링크, 폐기된 절차나 도구), 모순, 중복 내용을 확인합니다\n- 각 문제의 파일 경로와 구체적인 위치를 표시하고 판단 근거를 설명합니다\n- \"업데이트 권장 / 병합 권장 / 삭제 권장\"으로 분류하고 수정 체크리스트를 작성합니다\n- 점검 보고서만 출력하고 문서 자체는 수정하지 않습니다"- }- }- },- "scheduleRowA11y": "자동화 작업 {{title}}",- "detail": {- "promptScriptFallback": "스크립트 전용 작업. 설정은 데스크톱에서만 편집할 수 있습니다",- "promptEmpty": "저장된 작업 프롬프트가 없습니다",- "deleteA11y": "자동화 삭제",- "runNowA11y": "자동화 지금 실행",- "running": "실행 중",- "resumeA11y": "자동화 재개",- "pauseA11y": "자동화 일시 중지",- "resume": "재개",- "pause": "일시 중지",- "editA11y": "자동화 편집",- "edit": "편집"- },- "run": {- "openSessionA11y": "자동화 세션 열기",- "opening": "여는 중",- "session": "세션",- "restartA11y": "자동화 다시 실행",- "restarting": "다시 실행 중",- "restart": "다시 실행",- "markReadA11y": "실행 기록 읽음으로 표시",- "marking": "표시 중",- "markRead": "읽음",- "deleteA11y": "실행 기록 삭제"- },- "presentation": {- "validation": {- "templateParameter": "템플릿 매개변수를 입력하세요: {{label}}",- "name": "작업 이름을 입력하세요",- "prompt": "작업 프롬프트를 입력하세요",- "timezone": "시간대를 입력하세요",- "boundSession": "연결할 작업을 선택하세요",- "cron": "cron 표현식을 입력하세요",- "workingDir": "프로젝트 디렉터리를 입력하세요",- "effort": "추론 강도는 다음 중 하나여야 합니다: {{values}}",- "intervalPositiveInteger": "분 간격은 양의 정수여야 합니다",- "preRunHookTimeout": "검사 제한 시간은 양의 정수(밀리초)여야 합니다",- "intervalUnsupported": "분 간격은 1시간을 나눌 수 있는 값(1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30분) 또는 1~23시간의 정시 간격만 지원합니다"- },- "schedule": {- "paused": "일시 중지됨",- "manual": "수동 트리거",- "once": "일회성 작업",- "waitingFirstRun": "첫 실행 대기 중",- "every": "{{duration}}마다",- "recurring": "주기 작업",- "dialogueWorkspace": "대화 작업 공간",- "noDirectory": "디렉터리 미설정",- "lastRun": "지난 실행 {{relative}}",- "imminent": "곧 실행",- "nextRun": "{{duration}} 후",- "status": {- "active": "실행 중",- "paused": "일시 중지됨",- "expired": "완료됨"- },- "session": {- "persistent": "지속 작업",- "bound": "연결된 작업",- "fresh": "새 작업",- "persistentWithId": "지속 작업 {{id}}",- "persistentDetail": "첫 트리거 후 같은 작업을 계속 재사용합니다",- "boundWithId": "{{id}}에 연결"- }- },- "run": {- "session": "작업 {{id}}",- "delete": "삭제",- "markRead": "읽음",- "canRestart": "다시 실행 가능",- "noSession": "생성된 작업 없음",- "open": "열기",- "restart": "다시 실행",- "durationUnknown": "소요 시간 알 수 없음",- "runningFor": "{{duration}} 동안 실행 중",- "duration": "소요 시간 {{duration}}",- "unknownTime": "시간 알 수 없음",- "status": {- "running": "실행 중",- "success": "성공",- "failed": "실패",- "aborted": "중단됨",- "interrupted": "중단됨",- "skipped": "건너뜀"- }- },- "pause": {- "title": "{{name}} 일시 중지",- "detail": "현재 이 자동화에서 {{count}}개의 실행이 진행 중입니다. 일시 중지하면 이후 트리거를 즉시 막고 진행 중인 실행도 중지합니다.",- "preview": "진행 중인 실행: {{count}}개"- },- "delete": {- "noSessions": "이 자동화가 생성한 작업을 찾지 못했습니다",- "sessions": "이 자동화가 생성한 작업 {{count}}개를 찾았습니다",- "withInflight": "{{sessions}}. 실행 {{count}}개가 아직 진행 중입니다"- },- "duration": {- "seconds": "{{count}}초",- "minutesSeconds": "{{minutes}}분 {{seconds}}초",- "minutes": "{{count}}분",- "hours": "{{count}}시간",- "days": "{{count}}일"- },- "relative": {- "justNow": "방금",- "minutesAgo": "{{count}}분 전",- "hoursAgo": "{{count}}시간 전",- "daysAgo": "{{count}}일 전"- }- }- },"companions": {"messageSent": "백그라운드 작업에 메시지를 보냈습니다","sentTo": "{{name}}에게 메시지를 보냄",@@ -858,90 +574,9 @@"startChat": "대화 시작하기","preferenceSaveFailed": "보기 설정을 저장하지 못했습니다. 보기를 다시 전환하세요.","automation": {- "unsupported": "자동화를 관리하려면 컴퓨터의 Cindy를 업데이트한 후 다시 시도하세요.",- "changed": "이 자동화가 다른 곳에서 변경되었습니다. 편집 내용은 유지됩니다. 뒤로 돌아가 다시 열면 최신 버전을 불러올 수 있습니다.",- "unknown": "알 수 없는 상태","unsavedTitle": "변경 사항을 버릴까요?","unsavedBody": "변경 사항이 아직 저장되지 않았습니다.",- "continueEditing": "계속 편집",- "discard": "변경 사항 버리기",- "invalid": "이름, 실행 지침, 트리거 설정을 확인한 후 다시 저장하세요.",- "failed": "자동화 작업을 완료하지 못했습니다.",- "everyMinutes": "{{count}}분마다",- "everyMinutes_one": "{{count}}분마다",- "everyMinutes_other": "{{count}}분마다",- "paused": "일시 중지됨",- "new": "자동화 만들기",- "save": "자동화 저장",- "offline": "자동화를 관리하려면 컴퓨터에 다시 연결하세요.",- "retry": "다시 불러오기",- "inProgress": "진행 중",- "scheduled": "예약됨",- "empty": "아직 자동화가 없습니다. 새로 만들어 시작하세요.",- "name": "이름",- "enabled": "활성화",- "instructions": "실행 지침",- "triggers": "트리거",- "triggerType": "트리거 유형",- "cron": "일정",- "interval": "간격",- "event": "이벤트",- "minutes": "간격(분)",- "source": "이벤트 소스",- "filterField": "필터 필드",- "operator": "조건",- "equals": "같음",- "contains": "포함",- "not-equals": "같지 않음",- "filterValue": "필터 값",- "removeFilter": "필터 제거",- "addFilter": "필터 추가",- "removeTrigger": "트리거 제거",- "addTrigger": "트리거 추가",- "largeDefinition": "이 자동화는 너무 커서 여기서 편집할 수 없습니다. 컴퓨터에서 편집하세요.",- "run": "지금 실행",- "runTitle": "이 자동화를 지금 실행할까요?",- "cancel": "취소",- "history": "실행 기록",- "noRuns": "아직 실행 기록이 없습니다. 자동화를 실행해 보세요.",- "delete": "자동화 삭제",- "deleteTitle": "이 자동화를 삭제할까요?",- "deleteBody": "이 자동화는 더 이상 실행되지 않습니다. 이 작업은 되돌릴 수 없습니다.",- "queued": "시작 대기",- "running": "실행 중",- "success": "완료",- "failed": "실패",- "interrupted": "중단됨",- "cancelled": "취소됨",- "repeat": "반복",- "hourly": "매시간",- "daily": "매일",- "weekdays": "월요일부터 금요일",- "weekly": "매주",- "custom": "사용자 지정",- "weekday": "요일",- "day0": "일요일",- "day1": "월요일",- "day2": "화요일",- "day3": "수요일",- "day4": "목요일",- "day5": "금요일",- "day6": "토요일",- "time": "시간",- "hour": "시",- "minute": "분",- "cronExpression": "Cron 표현식",- "timezone": "시간대",- "monthly": "매월",- "monthDay": "매월 날짜",- "saveAndRun": "저장 후 실행",- "advanced": "고급 설정",- "quiet": "확인 결과 변화가 없으면 알리지 않기",- "quietHint": "변화나 문제만 보고합니다. 리마인더와 예약 메시지는 이 옵션을 끌 수 있습니다.",- "checkCommand": "사전 확인 명령",- "checkHint": "선택 사항입니다. 컴퓨터에서 먼저 확인합니다. 종료 코드 2는 이번 실행을 건너뛰고, 0은 계속합니다. 오류는 보고됩니다. 비우면 제거됩니다.",- "timeoutMs": "확인 제한 시간(ms, 비우면 제한 없음)",- "skipped": "확인 완료 · 모델 실행 건너뜀"+ "discard": "변경 사항 버리기"},"openNavigation": "탐색 메뉴 열기","openProfile": "{{name}} 프로필 보기",@@ -1022,7 +657,6 @@"skills": "스킬 및 연결","artifacts": "결과물","direct": "팀원 간 메시지",- "automation": "자동화","settings": "모델 및 권한","search": "메시지 검색","models": "모델 후보 목록",diff --git a/apps/mobile/src/i18n/locales/zh-CN/devices.json b/apps/mobile/src/i18n/locales/zh-CN/devices.jsonindex 9a039435c1..61904ccddc 100644--- a/apps/mobile/src/i18n/locales/zh-CN/devices.json+++ b/apps/mobile/src/i18n/locales/zh-CN/devices.json@@ -450,8 +450,6 @@"waitingA11y": "筛选待处理任务","automationA11y": "筛选自动化生成的任务"},- "plan": "计划",- "automationsButtonA11y": "打开远程自动化","search": {"openA11y": "搜索远程任务","closeA11y": "关闭搜索远程任务",@@ -529,288 +527,6 @@},"viewAllRuns": "查看全部 {{count}} 次运行"},- "automations": {- "heading": {- "delete": "删除自动化",- "pause": "暂停自动化",- "deleteRun": "删除运行记录"- },- "runNow": "立即运行",- "error": {- "projectMissingConfig": "项目自动化缺少 projectConfigId,请在桌面端删除",- "deletePartial": "自动化已删除,但 {{count}} 个生成任务未能更新状态。请在桌面端检查这些任务。"- },- "subtitle": "{{active}} 个运行中 · {{total}} 个自动化",- "metric": {- "running": "运行中",- "unreadResults": "未读结果",- "executing": "执行中"- },- "summary": {- "paused": "{{count}} 个自动化已暂停。选择后可以运行、暂停、编辑或打开最近任务。",- "default": "选择自动化后可以运行、暂停、编辑或打开最近任务。"- },- "empty": {- "copy": "可以直接从手机创建第一条自动化,或在桌面端创建后同步到这里。",- "title": "这台设备暂无自动化"- },- "createAutomation": "新建自动化",- "recentRuns": "最近执行",- "runs": {- "emptyCopy": "点击“{{runNow}}”后,新的执行会显示在这里。",- "emptyTitle": "还没有执行记录"- },- "form": {- "title": {- "create": "新建自动化",- "edit": "编辑自动化"- },- "sessionMode": {- "bound": "绑定已有任务后,目录、worktree、Agent 和 Fast 模式跟随该任务。",- "persistent": "首次触发会创建持续任务,后续触发继续接在同一任务里。",- "fresh": "每次触发都会创建新的任务。"- },- "field": {- "name": "名称",- "prompt": "提示词",- "trigger": "触发方式",- "runSession": "运行任务",- "boundSession": "绑定任务",- "intervalMinutes": "间隔分钟",- "workspace": "工作区",- "projectDir": "项目目录",- "model": "模型",- "effort": "推理强度",- "timezone": "时区"- },- "namePlaceholder": "例如:每日项目巡检",- "scriptHint": "这是一个仅运行脚本的自动化,脚本配置只能在桌面端编辑;此处可以改动名称、触发方式、通知等其它字段。",- "promptPlaceholder": "写清楚每次自动执行要让 {{appName}} 做什么",- "trigger": {- "recurring": "周期",- "manual": "手动"- },- "session": {- "fresh": "新任务",- "persistent": "持续",- "bound": "绑定"- },- "boundSessionA11y": "绑定任务 {{name}}",- "intervalPlaceholder": "留空则使用 cron",- "intervalHint": "分钟间隔请选择 1、2、3、4、5、6、10、12、15、20 或 30 分钟;整小时间隔请输入 60 的倍数,范围为 60–1380 分钟(1–23 小时)。",- "intervalPreservedHint": "当前任务的精确间隔为每 {{duration}};未编辑或清空前会保留。",- "workspace": {- "project": "项目",- "dialogue": "对话"- },- "useWorktree": "使用 worktree",- "modelPlaceholderBound": "跟随任务",- "modelPlaceholderPiDefault": "留空使用默认模型",- "fastMode": "Fast 模式",- "notifyDesktop": "桌面通知",- "notifyFeishu": "飞书通知",- "savingA11y": "正在保存自动化",- "saveA11y": "保存自动化",- "cancelA11y": "取消编辑自动化"- },- "delete": {- "counting": "正在统计由这条自动化生成的任务…",- "confirmDeleteBoth": "删除自动化和任务",- "confirmArchive": "删除自动化并归档任务",- "confirmTaskOnly": "只删除自动化",- "title": "删除 {{name}}",- "copy": "删除自动化不会中断已经开始的执行。生成过的任务按下面的选项处理,和桌面端保持一致。",- "optionsA11y": "选择生成任务处理方式",- "keepDesc": "只删除这条自动化,历史任务继续保留在原列表里。",- "keepLabel": "保留生成任务",- "archiveDesc": "删除自动化后,把由它生成的任务移到归档,后续仍可搜索。",- "archiveLabel": "归档生成任务",- "deleteDesc": "删除自动化后,把由它生成的任务也标记为删除。这个操作不可从手机端撤销。",- "deleteLabel": "删除生成任务",- "cancelA11y": "取消删除自动化",- "confirmA11y": "确认删除自动化"- },- "pause": {- "title": "暂停 {{name}}",- "detailFallback": "暂停会阻止这条自动化继续触发。",- "previewFallback": "没有正在执行的 run",- "confirmA11y": "确认暂停自动化",- "pausing": "暂停中",- "confirm": "确认暂停",- "cancelA11y": "取消暂停自动化"- },- "runDelete": {- "title": "删除这条执行记录",- "copy": "只会删除这条自动化执行记录,不会删除它打开过的任务,也不会影响后续自动触发。",- "confirmA11y": "确认删除执行记录",- "confirm": "删除记录",- "cancelA11y": "取消删除执行记录"- },- "template": {- "label": "模板",- "loadingA11y": "模板加载中",- "refreshA11y": "刷新自动化模板",- "loading": "加载中",- "refresh": "刷新",- "cardA11y": "自动化模板 {{name}}",- "manualConfig": "手动配置",- "builtin": {- "nightly-test-heal": {- "name": "夜间自愈测试",- "description": "每晚跑测试,失败项在隔离 worktree 尝试最小修复",- "prompt": "运行项目的测试套件,如果有失败项,在隔离 worktree 尝试给出最小修复。\n约束:\n- 先按仓库文档或 package 脚本确定标准测试命令,再完整运行\n- 只修复有明确失败证据的问题,采用影响面最小的改法,避免顺手重构\n- 修复后重跑相关测试确认通过,并复核完整 diff\n- 按仓库工作流交付修复(如创建分支并开 PR),不要直接改动主分支\n- 无法安全修复的失败项,输出失败原因、疑点文件和建议的排查步骤"- },- "pr-gatekeeper": {- "name": "PR 守门人",- "description": "工作日预审开放 PR 的新增改动,按严重程度报告风险",- "prompt": "检查仓库当前开放的 PR,对新增改动做一轮预审。\n约束:\n- 逐个查看过去 24 小时内有新提交的开放 PR(周一回看整个周末),引用 PR 编号、文件路径和具体 diff\n- 重点找正确性、安全、数据丢失和兼容性问题,按严重程度分级\n- 只报告有证据支撑的问题,说明失败场景,不要凭风格偏好挑刺\n- 除非用户明确授权,只输出审查结论,不要直接在 PR 上留言或改动代码"- },- "domain-radar": {- "name": "领域雷达",- "description": "定期搜集你关注领域的最新动态,输出有观点的摘要",- "prompt": "围绕主题「{{topic}}」搜集过去 24 小时的最新动态(周一回看整个周末),输出一份有观点的摘要。\n约束:\n- 用 Web 搜索获取信息,交叉核对多个来源后再采信,标注每条信息的来源链接\n- 优先收录有实质内容的进展(发布、研究、政策、重要讨论),过滤营销软文和重复转载\n- 对每条动态给出一句\"为什么值得关注\"的判断,而不是罗列链接\n- 信息不足或来源存疑时如实说明,不要臆造",- "params": {- "topic": {- "label": "关注主题",- "placeholder": "如:AI Agent、新能源、前端框架"- }- }- },- "competitor-watch": {- "name": "竞品动态追踪",- "description": "每周汇总竞品的产品与市场动态,分析对我们的影响",- "prompt": "追踪以下竞品最近一周的动态:{{competitors}}。\n约束:\n- 用 Web 搜索覆盖产品更新、版本发布、定价变化、市场动作和用户口碑,标注来源\n- 区分官方信息和第三方转述,未经证实的传闻要明确标注\n- 对每条重要动态给出\"对我们意味着什么\"的分析和建议\n- 没有实质动态时如实说明,不要凑数",- "params": {- "competitors": {- "label": "竞品名单",- "placeholder": "如:Notion、Linear、Figma"- }- }- },- "weekly-work-draft": {- "name": "周报草稿助手",- "description": "从工作目录的文档和产出物整理本周工作,生成周报草稿",- "prompt": "根据工作目录中本周的文档、笔记和产出物变化,整理一份周报草稿。\n约束:\n- 只使用工作目录内有实际修改痕迹的内容作为证据,注明对应文件\n- 按\"本周完成 / 进行中 / 下周计划 / 需要协调\"组织,语言简洁可直接提交\n- 区分实质进展和例行事务,突出有价值的产出\n- 材料不足以判断的部分留出占位并说明,方便用户补充"- },- "knowledge-freshness": {- "name": "知识库保鲜",- "description": "每月体检工作目录文档,找出过期与矛盾内容",- "prompt": "体检工作目录中的文档,找出需要更新的内容。\n约束:\n- 检查过期信息(旧日期、失效链接、已废弃的流程或工具)、前后矛盾和重复内容\n- 每个问题都注明文件路径和具体位置,说明判断依据\n- 按\"建议更新 / 建议合并 / 建议删除\"分类,给出修订建议清单\n- 只输出体检报告,不要直接修改文档"- }- }- },- "scheduleRowA11y": "自动化 {{title}}",- "detail": {- "promptScriptFallback": "仅运行脚本的自动化,配置只能在桌面端编辑",- "promptEmpty": "没有保存自动化提示词",- "deleteA11y": "删除自动化",- "runNowA11y": "立即执行自动化",- "running": "运行中",- "resumeA11y": "恢复自动化",- "pauseA11y": "暂停自动化",- "resume": "恢复",- "pause": "暂停",- "editA11y": "编辑自动化",- "edit": "编辑"- },- "run": {- "openSessionA11y": "打开自动化生成的任务",- "opening": "打开中",- "session": "任务",- "restartA11y": "重新执行自动化",- "restarting": "重跑中",- "restart": "重跑",- "markReadA11y": "标记执行记录已读",- "marking": "标记中",- "markRead": "已读",- "deleteA11y": "删除执行记录"- },- "presentation": {- "validation": {- "templateParameter": "请输入模板参数:{{label}}",- "name": "请输入任务名称",- "prompt": "请输入任务提示词",- "timezone": "请输入时区",- "boundSession": "请选择要绑定的任务",- "cron": "请输入 cron 表达式",- "workingDir": "请输入项目目录",- "effort": "推理强度只能是 {{values}}",- "intervalPositiveInteger": "间隔分钟必须是正整数",- "preRunHookTimeout": "检查超时必须是正整数毫秒",- "intervalUnsupported": "分钟间隔必须能整除 60:请选择 1、2、3、4、5、6、10、12、15、20 或 30 分钟,或 1–23 小时的整点间隔"- },- "schedule": {- "paused": "已暂停",- "manual": "手动触发",- "once": "单次任务",- "waitingFirstRun": "等待首次执行",- "every": "每 {{duration}}",- "recurring": "周期任务",- "dialogueWorkspace": "对话工作区",- "noDirectory": "未设置目录",- "lastRun": "上次 {{relative}}",- "imminent": "即将执行",- "nextRun": "{{duration}}后",- "status": {- "active": "运行中",- "paused": "已暂停",- "expired": "已完成"- },- "session": {- "persistent": "持续任务",- "bound": "绑定任务",- "fresh": "新任务",- "persistentWithId": "持续任务 {{id}}",- "persistentDetail": "首次触发后持续复用同一任务",- "boundWithId": "绑定到 {{id}}"- }- },- "run": {- "session": "任务 {{id}}",- "delete": "删除",- "markRead": "已读",- "canRestart": "可重新执行",- "noSession": "未创建任务",- "open": "打开",- "restart": "重跑",- "durationUnknown": "耗时未知",- "runningFor": "已运行 {{duration}}",- "duration": "耗时 {{duration}}",- "unknownTime": "未知时间",- "status": {- "running": "运行中",- "success": "成功",- "failed": "失败",- "aborted": "已中止",- "interrupted": "被中断",- "skipped": "已跳过"- }- },- "pause": {- "title": "暂停 {{name}}",- "detail": "这条自动化当前有 {{count}} 次执行正在进行。暂停会立即阻止后续触发,并停止这些正在进行的执行。",- "preview": "正在执行:{{count}} 次"- },- "delete": {- "noSessions": "没有找到由它生成的任务",- "sessions": "找到 {{count}} 个由它生成的任务",- "withInflight": "{{sessions}},还有 {{count}} 次执行正在进行"- },- "duration": {- "seconds": "{{count}} 秒",- "minutesSeconds": "{{minutes}} 分 {{seconds}} 秒",- "minutes": "{{count}} 分钟",- "hours": "{{count}} 小时",- "days": "{{count}} 天"- },- "relative": {- "justNow": "刚刚",- "minutesAgo": "{{count}} 分钟前",- "hoursAgo": "{{count}} 小时前",- "daysAgo": "{{count}} 天前"- }- }- },"companions": {"messageSent": "已向后台任务发送消息","sentTo": "已发消息给 {{name}}",@@ -858,90 +574,9 @@"startChat": "开始对话","preferenceSaveFailed": "未能保存视图偏好,请重新切换视图。","automation": {- "unsupported": "请更新电脑上的 Cindy 后重试,即可管理自动化。",- "changed": "此自动化已在别处更改。你的编辑已保留,返回并重新打开可读取最新版本。",- "unknown": "状态未知","unsavedTitle": "放弃更改?","unsavedBody": "你的更改尚未保存。",- "continueEditing": "继续编辑",- "discard": "放弃更改",- "invalid": "请检查名称、执行说明和触发设置后重新保存。",- "failed": "自动化操作没有完成。",- "everyMinutes": "每 {{count}} 分钟",- "everyMinutes_one": "每 {{count}} 分钟",- "everyMinutes_other": "每 {{count}} 分钟",- "paused": "已暂停",- "new": "新建自动化",- "save": "保存自动化",- "offline": "请重新连接电脑后管理自动化。",- "retry": "重新加载",- "inProgress": "正在进行",- "scheduled": "已安排",- "empty": "还没有自动化,可以新建一个。",- "name": "名称",- "enabled": "启用",- "instructions": "执行说明",- "triggers": "触发条件",- "triggerType": "触发类型",- "cron": "定时",- "interval": "间隔",- "event": "事件",- "minutes": "间隔(分钟)",- "source": "事件来源",- "filterField": "筛选字段",- "operator": "条件",- "equals": "等于",- "contains": "包含",- "not-equals": "不等于",- "filterValue": "筛选值",- "removeFilter": "移除筛选条件",- "addFilter": "添加筛选条件",- "removeTrigger": "移除触发条件",- "addTrigger": "添加触发条件",- "largeDefinition": "此自动化内容过多,无法在手机上编辑。请在电脑上编辑。",- "run": "立即运行",- "runTitle": "立即运行此自动化?",- "cancel": "取消",- "history": "运行记录",- "noRuns": "还没有运行记录,可以先运行一次。",- "delete": "删除自动化",- "deleteTitle": "删除此自动化?",- "deleteBody": "删除后将不再触发,此操作无法撤销。",- "queued": "等待开始",- "running": "运行中",- "success": "已完成",- "failed": "失败",- "interrupted": "已中断",- "cancelled": "已取消",- "repeat": "重复",- "hourly": "每小时",- "daily": "每天",- "weekdays": "周一至周五",- "weekly": "每周",- "custom": "自定义",- "weekday": "星期",- "day0": "星期日",- "day1": "星期一",- "day2": "星期二",- "day3": "星期三",- "day4": "星期四",- "day5": "星期五",- "day6": "星期六",- "time": "时间",- "hour": "时",- "minute": "分",- "cronExpression": "Cron 表达式",- "timezone": "时区",- "monthly": "每月",- "monthDay": "每月几号",- "saveAndRun": "保存并运行",- "advanced": "高级设置",- "quiet": "检查没事不说话",- "quietHint": "仅报告变化或问题。提醒和定时发送可关闭此项。",- "checkCommand": "前置检查命令",- "checkHint": "可选。在电脑上先检查:退出码 2 跳过本轮,0 继续执行,异常仍会报告。清空可移除。",- "timeoutMs": "检查超时(毫秒,留空不限时)",- "skipped": "已检查 · 未唤醒模型"+ "discard": "放弃更改"},"openNavigation": "打开导航","openProfile": "查看 {{name}} 的资料",@@ -1022,7 +657,6 @@"skills": "技能与连接","artifacts": "成果","direct": "伙伴往来",- "automation": "自动化","settings": "模型与权限","search": "搜索消息","models": "模型候选链",diff --git a/apps/mobile/src/i18n/locales/zh-TW/devices.json b/apps/mobile/src/i18n/locales/zh-TW/devices.jsonindex 3d24944224..dd9d29f093 100644--- a/apps/mobile/src/i18n/locales/zh-TW/devices.json+++ b/apps/mobile/src/i18n/locales/zh-TW/devices.json@@ -450,8 +450,6 @@"waitingA11y": "篩選待處理任務","automationA11y": "篩選自動化生成的任務"},- "plan": "計劃",- "automationsButtonA11y": "開啟遠端自動化","search": {"openA11y": "搜尋遠端任務","closeA11y": "關閉搜尋遠端任務",@@ -529,288 +527,6 @@},"viewAllRuns": "檢視全部 {{count}} 次執行"},- "automations": {- "heading": {- "delete": "刪除自動化",- "pause": "暫停自動化",- "deleteRun": "刪除執行記錄"- },- "runNow": "立即執行",- "error": {- "projectMissingConfig": "專案自動化缺少 projectConfigId,請在桌面端刪除",- "deletePartial": "自動化已刪除,但 {{count}} 個生成任務未能更新狀態。請在桌面端檢查這些任務。"- },- "subtitle": "{{active}} 個執行中 · {{total}} 個自動化",- "metric": {- "running": "執行中",- "unreadResults": "未讀結果",- "executing": "執行中"- },- "summary": {- "paused": "{{count}} 個自動化已暫停。選擇後可以執行、暫停、編輯或開啟最近任務。",- "default": "選擇自動化後可以執行、暫停、編輯或開啟最近任務。"- },- "empty": {- "copy": "可以直接從手機建立第一條自動化,或在桌面端建立後同步到這裡。",- "title": "這臺裝置暫無自動化"- },- "createAutomation": "新建自動化",- "recentRuns": "最近執行",- "runs": {- "emptyCopy": "點選「{{runNow}}」後,新的執行會顯示在這裡。",- "emptyTitle": "還沒有執行記錄"- },- "form": {- "title": {- "create": "新建自動化",- "edit": "編輯自動化"- },- "sessionMode": {- "bound": "繫結已有任務後,目錄、worktree、Agent 和 Fast 模式跟隨該任務。",- "persistent": "首次觸發會建立持續任務,後續觸發繼續接在同一任務裡。",- "fresh": "每次觸發都會建立新的任務。"- },- "field": {- "name": "名稱",- "prompt": "提示詞",- "trigger": "觸發方式",- "runSession": "執行任務",- "boundSession": "繫結任務",- "intervalMinutes": "間隔分鐘",- "workspace": "工作區",- "projectDir": "專案目錄",- "model": "模型",- "effort": "推理強度",- "timezone": "時區"- },- "namePlaceholder": "例如:每日專案巡檢",- "scriptHint": "這是一個僅執行指令碼的自動化,指令碼配置只能在桌面端編輯;此處可以改動名稱、觸發方式、通知等其它欄位。",- "promptPlaceholder": "寫清楚每次自動執行要讓 {{appName}} 做什麼",- "trigger": {- "recurring": "週期",- "manual": "手動"- },- "session": {- "fresh": "新任務",- "persistent": "持續",- "bound": "繫結"- },- "boundSessionA11y": "繫結任務 {{name}}",- "intervalPlaceholder": "留空則使用 cron",- "intervalHint": "分鐘間隔請選擇 1、2、3、4、5、6、10、12、15、20 或 30 分鐘;整小時間隔請輸入 60 的倍數,範圍為 60–1380 分鐘(1–23 小時)。",- "intervalPreservedHint": "目前任務的精確間隔為每 {{duration}};未編輯或清空前會保留。",- "workspace": {- "project": "專案",- "dialogue": "對話"- },- "useWorktree": "使用 worktree",- "modelPlaceholderBound": "跟隨任務",- "modelPlaceholderPiDefault": "留空使用預設模型",- "fastMode": "Fast 模式",- "notifyDesktop": "桌面通知",- "notifyFeishu": "飛書通知",- "savingA11y": "正在儲存自動化",- "saveA11y": "儲存自動化",- "cancelA11y": "取消編輯自動化"- },- "delete": {- "counting": "正在統計由這條自動化生成的任務…",- "confirmDeleteBoth": "刪除自動化和任務",- "confirmArchive": "刪除自動化並歸檔任務",- "confirmTaskOnly": "只刪除自動化",- "title": "刪除 {{name}}",- "copy": "刪除自動化不會中斷已經開始的執行。生成過的任務按下面的選項處理,和桌面端保持一致。",- "optionsA11y": "選擇生成任務處理方式",- "keepDesc": "只刪除這條自動化,歷史任務繼續保留在原列表裡。",- "keepLabel": "保留生成任務",- "archiveDesc": "刪除自動化後,把由它生成的任務移到歸檔,後續仍可搜尋。",- "archiveLabel": "歸檔生成任務",- "deleteDesc": "刪除自動化後,把由它生成的任務也標記為刪除。這個操作不可從手機端撤銷。",- "deleteLabel": "刪除生成任務",- "cancelA11y": "取消刪除自動化",- "confirmA11y": "確認刪除自動化"- },- "pause": {- "title": "暫停 {{name}}",- "detailFallback": "暫停會阻止這條自動化繼續觸發。",- "previewFallback": "沒有正在執行的 run",- "confirmA11y": "確認暫停自動化",- "pausing": "暫停中",- "confirm": "確認暫停",- "cancelA11y": "取消暫停自動化"- },- "runDelete": {- "title": "刪除這條執行記錄",- "copy": "只會刪除這條自動化執行記錄,不會刪除它開啟過的任務,也不會影響後續自動觸發。",- "confirmA11y": "確認刪除執行記錄",- "confirm": "刪除記錄",- "cancelA11y": "取消刪除執行記錄"- },- "template": {- "label": "模板",- "loadingA11y": "模板載入中",- "refreshA11y": "重新整理自動化模板",- "loading": "載入中",- "refresh": "重新整理",- "cardA11y": "自動化模板 {{name}}",- "manualConfig": "手動配置",- "builtin": {- "nightly-test-heal": {- "name": "夜間自愈測試",- "description": "每晚跑測試,失敗項在隔離 worktree 嘗試最小修復",- "prompt": "執行專案的測試套件,如果有失敗項,在隔離 worktree 嘗試給出最小修復。\n約束:\n- 先按倉庫文件或 package 指令碼確定標準測試命令,再完整執行\n- 只修復有明確失敗證據的問題,採用影響面最小的改法,避免順手重構\n- 修復後重跑相關測試確認通過,並複核完整 diff\n- 按倉庫工作流交付修復(如建立分支並開 PR),不要直接改動主分支\n- 無法安全修復的失敗項,輸出失敗原因、疑點檔案和建議的排查步驟"- },- "pr-gatekeeper": {- "name": "PR 守門人",- "description": "工作日預審開放 PR 的新增改動,按嚴重程度報告風險",- "prompt": "檢查倉庫當前開放的 PR,對新增改動做一輪預審。\n約束:\n- 逐個檢視過去 24 小時內有新提交的開放 PR(週一回看整個週末),引用 PR 編號、檔案路徑和具體 diff\n- 重點找正確性、安全、資料丟失和相容性問題,按嚴重程度分級\n- 只報告有證據支撐的問題,說明失敗場景,不要憑風格偏好挑刺\n- 除非使用者明確授權,只輸出審查結論,不要直接在 PR 上留言或改動程式碼"- },- "domain-radar": {- "name": "領域雷達",- "description": "定期蒐集你關注領域的最新動態,輸出有觀點的摘要",- "prompt": "圍繞主題「{{topic}}」蒐集過去 24 小時的最新動態(週一回看整個週末),輸出一份有觀點的摘要。\n約束:\n- 用 Web 搜尋獲取資訊,交叉核對多個來源後再採信,標註每條資訊的來源連結\n- 優先收錄有實質內容的進展(釋出、研究、政策、重要討論),過濾營銷軟文和重複轉載\n- 對每條動態給出一句\"為什麼值得關注\"的判斷,而不是羅列連結\n- 資訊不足或來源存疑時如實說明,不要臆造",- "params": {- "topic": {- "label": "關注主題",- "placeholder": "如:AI Agent、新能源、前端框架"- }- }- },- "competitor-watch": {- "name": "競品動態追蹤",- "description": "每週彙總競品的產品與市場動態,分析對我們的影響",- "prompt": "追蹤以下競品最近一週的動態:{{competitors}}。\n約束:\n- 用 Web 搜尋覆蓋產品更新、版本釋出、定價變化、市場動作和使用者口碑,標註來源\n- 區分官方資訊和第三方轉述,未經證實的傳聞要明確標註\n- 對每條重要動態給出\"對我們意味著什麼\"的分析和建議\n- 沒有實質動態時如實說明,不要湊數",- "params": {- "competitors": {- "label": "競品名單",- "placeholder": "如:Notion、Linear、Figma"- }- }- },- "weekly-work-draft": {- "name": "週報草稿助手",- "description": "從工作目錄的文件和產出物整理本週工作,生成週報草稿",- "prompt": "根據工作目錄中本週的文件、筆記和產出物變化,整理一份週報草稿。\n約束:\n- 只使用工作目錄內有實際修改痕跡的內容作為證據,註明對應檔案\n- 按\"本週完成 / 進行中 / 下週計劃 / 需要協調\"組織,語言簡潔可直接提交\n- 區分實質進展和例行事務,突出有價值的產出\n- 材料不足以判斷的部分留出佔位並說明,方便使用者補充"- },- "knowledge-freshness": {- "name": "知識庫保鮮",- "description": "每月體檢工作目錄文件,找出過期與矛盾內容",- "prompt": "體檢工作目錄中的文件,找出需要更新的內容。\n約束:\n- 檢查過期資訊(舊日期、失效連結、已廢棄的流程或工具)、前後矛盾和重複內容\n- 每個問題都註明檔案路徑和具體位置,說明判斷依據\n- 按\"建議更新 / 建議合併 / 建議刪除\"分類,給出修訂建議清單\n- 只輸出體檢報告,不要直接修改文件"- }- }- },- "scheduleRowA11y": "自動化 {{title}}",- "detail": {- "promptScriptFallback": "僅執行指令碼的自動化,配置只能在桌面端編輯",- "promptEmpty": "沒有儲存自動化提示詞",- "deleteA11y": "刪除自動化",- "runNowA11y": "立即執行自動化",- "running": "執行中",- "resumeA11y": "恢復自動化",- "pauseA11y": "暫停自動化",- "resume": "恢復",- "pause": "暫停",- "editA11y": "編輯自動化",- "edit": "編輯"- },- "run": {- "openSessionA11y": "開啟自動化生成的任務",- "opening": "開啟中",- "session": "任務",- "restartA11y": "重新執行自動化",- "restarting": "重跑中",- "restart": "重跑",- "markReadA11y": "標記執行記錄已讀",- "marking": "標記中",- "markRead": "已讀",- "deleteA11y": "刪除執行記錄"- },- "presentation": {- "validation": {- "templateParameter": "請輸入模板參數:{{label}}",- "name": "請輸入任務名稱",- "prompt": "請輸入任務提示詞",- "timezone": "請輸入時區",- "boundSession": "請選擇要繫結的任務",- "cron": "請輸入 cron 運算式",- "workingDir": "請輸入專案目錄",- "effort": "推理強度只能是 {{values}}",- "intervalPositiveInteger": "間隔分鐘必須是正整數",- "preRunHookTimeout": "檢查逾時必須是正整數毫秒",- "intervalUnsupported": "分鐘間隔必須可整除 60:請選擇 1、2、3、4、5、6、10、12、15、20 或 30 分鐘,或 1–23 小時的整點間隔"- },- "schedule": {- "paused": "已暫停",- "manual": "手動觸發",- "once": "單次任務",- "waitingFirstRun": "等待首次執行",- "every": "每 {{duration}}",- "recurring": "週期任務",- "dialogueWorkspace": "對話工作區",- "noDirectory": "未設定目錄",- "lastRun": "上次 {{relative}}",- "imminent": "即將執行",- "nextRun": "{{duration}}後",- "status": {- "active": "執行中",- "paused": "已暫停",- "expired": "已完成"- },- "session": {- "persistent": "持續任務",- "bound": "繫結任務",- "fresh": "新任務",- "persistentWithId": "持續任務 {{id}}",- "persistentDetail": "首次觸發後持續複用同一任務",- "boundWithId": "繫結到 {{id}}"- }- },- "run": {- "session": "任務 {{id}}",- "delete": "刪除",- "markRead": "已讀",- "canRestart": "可重新執行",- "noSession": "未建立任務",- "open": "開啟",- "restart": "重跑",- "durationUnknown": "耗時未知",- "runningFor": "已執行 {{duration}}",- "duration": "耗時 {{duration}}",- "unknownTime": "未知時間",- "status": {- "running": "執行中",- "success": "成功",- "failed": "失敗",- "aborted": "已中止",- "interrupted": "被中斷",- "skipped": "已略過"- }- },- "pause": {- "title": "暫停 {{name}}",- "detail": "這條自動化目前有 {{count}} 次執行正在進行。暫停會立即阻止後續觸發,並停止這些正在進行的執行。",- "preview": "正在執行:{{count}} 次"- },- "delete": {- "noSessions": "沒有找到由它生成的任務",- "sessions": "找到 {{count}} 個由它生成的任務",- "withInflight": "{{sessions}},還有 {{count}} 次執行正在進行"- },- "duration": {- "seconds": "{{count}} 秒",- "minutesSeconds": "{{minutes}} 分 {{seconds}} 秒",- "minutes": "{{count}} 分鐘",- "hours": "{{count}} 小時",- "days": "{{count}} 天"- },- "relative": {- "justNow": "剛剛",- "minutesAgo": "{{count}} 分鐘前",- "hoursAgo": "{{count}} 小時前",- "daysAgo": "{{count}} 天前"- }- }- },"companions": {"messageSent": "已向背景任務傳送訊息","sentTo": "已傳訊息給 {{name}}",@@ -858,90 +574,9 @@"startChat": "開始對話","preferenceSaveFailed": "未能儲存檢視偏好,請重新切換檢視。","automation": {- "unsupported": "請更新電腦上的 Cindy 後重試,即可管理自動化。",- "changed": "此自動化已在別處變更。你的編輯已保留,返回並重新開啟可讀取最新版本。",- "unknown": "狀態未知","unsavedTitle": "放棄變更?","unsavedBody": "你的變更尚未儲存。",- "continueEditing": "繼續編輯",- "discard": "放棄變更",- "invalid": "請檢查名稱、執行說明和觸發設定後重新儲存。",- "failed": "自動化操作沒有完成。",- "everyMinutes": "每 {{count}} 分鐘",- "everyMinutes_one": "每 {{count}} 分鐘",- "everyMinutes_other": "每 {{count}} 分鐘",- "paused": "已暫停",- "new": "新增自動化",- "save": "儲存自動化",- "offline": "請重新連接電腦後管理自動化。",- "retry": "重新載入",- "inProgress": "正在進行",- "scheduled": "已安排",- "empty": "還沒有自動化,可以新增一個。",- "name": "名稱",- "enabled": "啟用",- "instructions": "執行說明",- "triggers": "觸發條件",- "triggerType": "觸發類型",- "cron": "定時",- "interval": "間隔",- "event": "事件",- "minutes": "間隔(分鐘)",- "source": "事件來源",- "filterField": "篩選欄位",- "operator": "條件",- "equals": "等於",- "contains": "包含",- "not-equals": "不等於",- "filterValue": "篩選值",- "removeFilter": "移除篩選條件",- "addFilter": "新增篩選條件",- "removeTrigger": "移除觸發條件",- "addTrigger": "新增觸發條件",- "largeDefinition": "此自動化內容過多,無法在手機上編輯。請在電腦上編輯。",- "run": "立即執行",- "runTitle": "立即執行此自動化?",- "cancel": "取消",- "history": "執行記錄",- "noRuns": "還沒有執行記錄,可以先執行一次。",- "delete": "刪除自動化",- "deleteTitle": "刪除此自動化?",- "deleteBody": "刪除後將不再觸發,此操作無法復原。",- "queued": "等待開始",- "running": "執行中",- "success": "已完成",- "failed": "失敗",- "interrupted": "已中斷",- "cancelled": "已取消",- "repeat": "重複",- "hourly": "每小時",- "daily": "每天",- "weekdays": "週一至週五",- "weekly": "每週",- "custom": "自訂",- "weekday": "星期",- "day0": "星期日",- "day1": "星期一",- "day2": "星期二",- "day3": "星期三",- "day4": "星期四",- "day5": "星期五",- "day6": "星期六",- "time": "時間",- "hour": "時",- "minute": "分",- "cronExpression": "Cron 表達式",- "timezone": "時區",- "monthly": "每月",- "monthDay": "每月幾號",- "saveAndRun": "儲存並執行",- "advanced": "進階設定",- "quiet": "檢查沒事不說話",- "quietHint": "僅回報變化或問題。提醒和定時傳送可關閉此項。",- "checkCommand": "前置檢查命令",- "checkHint": "選填。在電腦上先檢查:結束代碼 2 跳過本次執行,0 繼續執行,異常仍會回報。清空可移除。",- "timeoutMs": "檢查逾時(毫秒,留空不限時)",- "skipped": "已檢查 · 未喚醒模型"+ "discard": "放棄變更"},"openNavigation": "開啟導覽","openProfile": "查看 {{name}} 的資料",@@ -1022,7 +657,6 @@"skills": "技能與連接","artifacts": "成果","direct": "夥伴往來",- "automation": "自動化","settings": "模型與權限","search": "搜尋訊息","models": "模型候選鏈",diff --git a/apps/mobile/src/scheduler/scheduleIntervalLabel.ts b/apps/mobile/src/scheduler/scheduleIntervalLabel.tsdeleted file mode 100644index 93772a26c0..0000000000--- a/apps/mobile/src/scheduler/scheduleIntervalLabel.ts+++ /dev/null@@ -1,18 +0,0 @@-/** Display the stored interval without rounding it to whole minutes. */-export function formatScheduleInterval(intervalMs: number, locale: string): string {- const parts: string[] = [];- let remaining = intervalMs;- for (const [unit, size] of [['minute', 60_000], ['second', 1_000], ['millisecond', 1]] as const) {- const count = unit === 'millisecond' ? remaining : Math.floor(remaining / size);- remaining %= size;- if (count > 0) {- parts.push(new Intl.NumberFormat(locale, {- style: 'unit',- unit,- unitDisplay: 'long',- maximumFractionDigits: 20,- }).format(count));- }- }- return parts.join(' ');-}diff --git a/apps/mobile/src/session/CompanionAutomationNativeView.ios.tsx b/apps/mobile/src/session/CompanionAutomationNativeView.ios.tsxdeleted file mode 100644index 54f8bea342..0000000000--- a/apps/mobile/src/session/CompanionAutomationNativeView.ios.tsx+++ /dev/null@@ -1,147 +0,0 @@-import { Fragment, useState } from 'react';-import { Button, DisclosureGroup, HStack, Image, Picker, ProgressView, Spacer, Text, TextField, Toggle, VStack, useNativeState } from '@expo/ui/swift-ui';-import { accessibilityLabel, buttonStyle, contentShape, disabled, font, foregroundStyle, frame, keyboardType, lineLimit, pickerStyle, shapes, tag, textInputAutocapitalization, textSelection } from '@expo/ui/swift-ui/modifiers';-import { useTranslation } from 'react-i18next';-import { randomUUID } from 'expo-crypto';-import { iconSize, spacing, useTheme } from '@/theme';-import { ComposerSheet } from './ComposerSheet';-import { ComposerNativeSection as Section } from './ComposerNativeSection';-import { getRoutineActionId, type RoutineTrigger } from './companionRoutines';-import { useRoutineCronFields } from './useRoutineCronFields';-import type { CompanionAutomationNativeViewProps } from './CompanionAutomationNativeView';--/** Native owns editing/composition. A new remote draft remounts fields via draftGeneration. */-function Field({ label, value, onChange, busy, multiline = false, numeric = false, clock = false, literal = false }: {- label: string; value: string; onChange(value: string): void; busy: boolean;- multiline?: boolean; numeric?: boolean; clock?: boolean; literal?: boolean;-}) {- const text = useNativeState(value);- return <TextField text={text} onTextChange={onChange} axis={multiline ? 'vertical' : 'horizontal'}- testID={`companion.automation.field.${label}`} modifiers={[- accessibilityLabel(label), disabled(busy), frame({ minHeight: 44, ...(clock ? { width: 64 } : {}) }),- ...(multiline ? [lineLimit({ min: 3, max: 8 })] : []),- ...(numeric ? [keyboardType('numeric')] : []),- ...(literal ? [textInputAutocapitalization('never')] : []),- ]} />;-}--function Action({ label, onPress, blocked = false, destructive = false, symbol, testID }: {- label: string; onPress(): void; blocked?: boolean; destructive?: boolean; symbol?: 'plus' | 'clock'; testID?: string;-}) {- const { colors } = useTheme();- return <Button onPress={onPress} testID={testID} modifiers={[buttonStyle('plain'), disabled(blocked), frame({ minHeight: 44 }),- ...(destructive ? [foregroundStyle(colors.destructive)] : [])]}>- <HStack spacing={spacing.md} modifiers={[frame({ maxWidth: Infinity, minHeight: 44 }), contentShape(shapes.rectangle())]}>- {symbol ? <Image systemName={symbol} size={iconSize.action} /> : null}<Text>{label}</Text><Spacer />- </HStack>- </Button>;-}--function Choice({ label, value, options, onChange, blocked }: {- label: string; value: string; options: { value: string; label: string }[]; onChange(value: string): void; blocked: boolean;-}) {- return <Picker label={label} selection={value} onSelectionChange={value => onChange(String(value))}- modifiers={[pickerStyle('menu'), disabled(blocked), frame({ minHeight: 44 })]}>- {options.map(option => <Text key={option.value} modifiers={[tag(option.value)]}>{option.label}</Text>)}- </Picker>;-}--function CronFields({ trigger, onChange, busy }: { trigger: Extract<RoutineTrigger, { kind: 'cron' }>; onChange(trigger: Extract<RoutineTrigger, { kind: 'cron' }>): void; busy: boolean }) {- const { t } = useTranslation();- const tr = (key: string) => t(`devices.companions.automation.${key}`);- const cron = useRoutineCronFields(trigger, onChange);- return <>- <Choice label={tr('repeat')} value={cron.preset} options={['hourly', 'daily', 'weekdays', 'weekly', 'monthly', 'custom'].map(value => ({ value, label: tr(value) }))} onChange={cron.changePreset} blocked={busy} />- {cron.preset === 'monthly' ? <Choice label={tr('monthDay')} value={cron.day} options={Array.from({ length: 31 }, (_, i) => ({ value: String(i + 1), label: String(i + 1) }))} onChange={cron.changeDay} blocked={busy} /> : null}- {cron.preset === 'weekly' ? <Choice label={tr('weekday')} value={cron.day} options={Array.from({ length: 7 }, (_, i) => ({ value: String(i), label: tr(`day${i}`) }))} onChange={cron.changeDay} blocked={busy} /> : null}- {cron.preset === 'custom' ? <FieldRow label={tr('cronExpression')} value={trigger.expression} onChange={expression => onChange({ ...trigger, expression })} busy={busy} literal /> :- <HStack spacing={spacing.sm}><Text>{tr('time')}</Text><Spacer />- {cron.preset !== 'hourly' ? <><Field label={tr('hour')} value={cron.hour} onChange={cron.changeHour} busy={busy} numeric clock /><Text>:</Text></> : null}- <Field label={tr('minute')} value={cron.minute} onChange={cron.changeMinute} busy={busy} numeric clock />- </HStack>}- <FieldRow label={tr('timezone')} value={trigger.timezone} onChange={timezone => onChange({ ...trigger, timezone })} busy={busy} literal />- </>;-}--function FieldRow(props: Parameters<typeof Field>[0]) {- const { colors } = useTheme();- return <VStack alignment="leading" spacing={spacing.sm}>- <Text modifiers={[font({ textStyle: 'caption' }), foregroundStyle(colors.textSecondary)]}>{props.label}</Text><Field {...props} />- </VStack>;-}--export function CompanionAutomationNativeView(p: CompanionAutomationNativeViewProps) {- const [advancedOpen, setAdvancedOpen] = useState(false);- const { t, i18n } = useTranslation();- const { colors } = useTheme();- const tr = (key: string) => t(`devices.companions.automation.${key}`);- const note = (text: string, error = false) => <Section><Text modifiers={[font({ textStyle: 'footnote' }), foregroundStyle(error ? colors.statusError : colors.textSecondary), textSelection(error)]}>{text}</Text></Section>;- const updateTrigger = (index: number, value: RoutineTrigger) => p.onChange(draft => draft && ({ ...draft, triggers: draft.triggers.map((item, i) => i === index ? value : item) }));- const triggerText = (trigger: Record<string, unknown>) => trigger.kind === 'interval'- ? t('devices.companions.automation.everyMinutes', { count: Number(trigger.intervalMs) / 60_000 })- : trigger.kind === 'cron' ? `${trigger.expression} · ${trigger.timezone}` : `${trigger.sourceId} · ${trigger.eventType}`;- const list = (active: boolean) => p.items.filter(item => Boolean(item.activity) === active).map(item =>- <Button key={item.id} onPress={() => p.onOpen(item.id)} testID={`companion.automation.${item.id}`} modifiers={[buttonStyle('plain')]}>- <HStack spacing={spacing.md} modifiers={[frame({ maxWidth: Infinity, minHeight: 44 }), contentShape(shapes.rectangle())]}>- <Image systemName="clock" size={iconSize.action} modifiers={[foregroundStyle(colors.textSecondary)]} />- <VStack alignment="leading" spacing={spacing.xs}><Text modifiers={[lineLimit(1)]}>{item.name}</Text>- <Text modifiers={[font({ textStyle: 'caption' }), foregroundStyle(colors.textSecondary), lineLimit(1)]}>{item.activity ? tr(item.activity) : !item.enabled ? tr('paused') : item.triggers.map(triggerText).join(' · ')}</Text>- </VStack><Spacer /><Image systemName="chevron.right" size={iconSize.xs} />- </HStack>- </Button>);- const { draft, detail } = p;- return <ComposerSheet visible={p.visible} onClose={p.onClose} onBack={p.selected ? p.onBack : undefined}- nativeContent preventDismiss={p.dirty || p.busy} testID="companion.automationSheet"- title={p.selected ? draft?.name || tr('new') : t('devices.companionProfile.automation')}>- {!p.online ? note(tr('offline')) : null}- {p.error ? <>{note(p.error, true)}<Section><Action label={tr('retry')} onPress={p.onRetry} blocked={p.busy || !p.online} /></Section></> : null}- {p.loading ? <Section><ProgressView /></Section> : null}- {!p.selected ? <>- {p.items.some(item => item.activity) ? <Section title={tr('inProgress')}>{list(true)}</Section> : null}- {p.items.some(item => !item.activity) ? <Section title={tr('scheduled')}>{list(false)}</Section> : null}- {p.online && !p.loading && !p.error && p.items.length === 0 ? note(tr('empty')) : null}- {getRoutineActionId(p.resource, 'routine-create') ? <Section><Action label={tr('new')} symbol="plus" onPress={() => p.onOpen('new')} testID="companion.newAutomation" /></Section> : null}- </> : detail ? <>- {draft && detail.editable ? <Fragment key={`${p.selected}:${p.draftGeneration}`}>- <Section title={tr('name')}><Field label={tr('name')} value={draft.name} onChange={name => p.onChange(d => d && ({ ...d, name }))} busy={p.busy} />- <Toggle label={tr('enabled')} isOn={draft.enabled} onIsOnChange={enabled => p.onChange(d => d && ({ ...d, enabled }))} modifiers={[disabled(p.busy)]} />- </Section>- <Section title={tr('instructions')}><Field label={tr('instructions')} value={draft.prompt} onChange={prompt => p.onChange(d => d && ({ ...d, prompt }))} busy={p.busy} multiline /></Section>- {p.detail?.supportsPreRunCheck ? <Section><DisclosureGroup label={tr('advanced')} isExpanded={advancedOpen} onIsExpandedChange={setAdvancedOpen}>- <Toggle label={tr('quiet')} isOn={draft.silentWhenIdle ?? false} onIsOnChange={silentWhenIdle => p.onChange(d => d && ({ ...d, silentWhenIdle }))} modifiers={[disabled(p.busy)]} />- <Text modifiers={[font({ textStyle: 'footnote' }), foregroundStyle(colors.textSecondary)]}>{tr('quietHint')}</Text>- <FieldRow label={tr('checkCommand')} value={draft.preRunHook?.command ?? ''} onChange={command => p.onChange(d => d && ({ ...d, preRunHook: command ? { ...d.preRunHook, command } : null }))} busy={p.busy} multiline literal />- <Text modifiers={[font({ textStyle: 'footnote' }), foregroundStyle(colors.textSecondary)]}>{tr('checkHint')}</Text>- {draft.preRunHook ? <FieldRow label={tr('timeoutMs')} value={draft.preRunHook.timeoutMs === undefined ? '' : String(draft.preRunHook.timeoutMs)} onChange={value => p.onChange(d => d && ({ ...d, preRunHook: { ...d.preRunHook!, timeoutMs: value ? Number(value) : undefined } }))} busy={p.busy} numeric /> : null}- </DisclosureGroup></Section> : null}- {draft.triggers.map((trigger, index) => <Section key={trigger.id} title={tr('triggers')}>- <Choice label={tr('triggerType')} value={trigger.kind} options={['cron', 'interval', 'event'].map(value => ({ value, label: tr(value) }))} blocked={p.busy || !p.online}- onChange={kind => updateTrigger(index, kind === 'interval' ? { id: trigger.id, kind, intervalMs: 3_600_000 } : kind === 'event' ? { id: trigger.id, kind, sourceId: '', eventType: '', filters: [] } : { id: trigger.id, kind: 'cron', expression: '0 9 * * *', timezone: Intl.DateTimeFormat().resolvedOptions().timeZone || 'UTC' })} />- {trigger.kind === 'cron' ? <CronFields trigger={trigger} onChange={value => updateTrigger(index, value)} busy={p.busy} /> : trigger.kind === 'interval' ?- <FieldRow label={tr('minutes')} value={String(trigger.intervalMs / 60_000)} onChange={value => updateTrigger(index, { ...trigger, intervalMs: Number(value) * 60_000 })} busy={p.busy} numeric /> : <>- <Choice label={tr('source')} value={trigger.sourceId} options={detail.sources.map(s => ({ value: s.id, label: s.name }))} blocked={p.busy || !p.online} onChange={sourceId => updateTrigger(index, { ...trigger, sourceId, eventType: '', filters: [] })} />- <Choice label={tr('event')} value={trigger.eventType} options={(detail.sources.find(s => s.id === trigger.sourceId)?.events ?? []).map(e => ({ value: e.type, label: e.name }))} blocked={p.busy || !p.online} onChange={eventType => updateTrigger(index, { ...trigger, eventType, filters: [] })} />- {trigger.filters.map((filter, fi) => <Fragment key={`${trigger.filters.length}:${fi}`}>- <FieldRow label={tr('filterField')} value={filter.field} onChange={field => updateTrigger(index, { ...trigger, filters: trigger.filters.map((f, i) => i === fi ? { ...f, field } : f) })} busy={p.busy} />- <Choice label={tr('operator')} value={filter.operator} options={['equals', 'contains', 'not-equals'].map(value => ({ value, label: tr(value) }))} blocked={p.busy || !p.online} onChange={operator => updateTrigger(index, { ...trigger, filters: trigger.filters.map((f, i) => i === fi ? { ...f, operator: operator as typeof f.operator } : f) })} />- <FieldRow label={tr('filterValue')} value={filter.value} onChange={value => updateTrigger(index, { ...trigger, filters: trigger.filters.map((f, i) => i === fi ? { ...f, value } : f) })} busy={p.busy} />- <Action label={tr('removeFilter')} onPress={() => updateTrigger(index, { ...trigger, filters: trigger.filters.filter((_, i) => i !== fi) })} blocked={p.busy} />- </Fragment>)}- {trigger.filters.length < 16 ? <Action label={tr('addFilter')} onPress={() => updateTrigger(index, { ...trigger, filters: [...trigger.filters, { field: '', operator: 'equals', value: '' }] })} blocked={p.busy} /> : null}- </>}- <Action label={tr('removeTrigger')} onPress={() => p.onChange(d => d && ({ ...d, triggers: d.triggers.filter((_, i) => i !== index) }))} blocked={p.busy || draft.triggers.length <= 1} />- </Section>)}- {draft.triggers.length < 32 ? <Section><Action label={tr('addTrigger')} onPress={() => p.onChange(d => d && ({ ...d, triggers: [...d.triggers, { id: randomUUID(), kind: 'interval', intervalMs: 3_600_000 }] }))} blocked={p.busy} /></Section> : null}- </Fragment> : note(tr('largeDefinition'))}- {detail.editable ? <Section><Action label={tr('save')} onPress={() => p.onAct(p.selected === 'new' ? 'routine-create' : 'routine-save')} blocked={p.busy || p.loading || !p.online || !p.dirty || !getRoutineActionId(p.resource, p.selected === 'new' ? 'routine-create' : 'routine-save')} testID="companion.automation.save" /></Section> : null}- {p.selected !== 'new' ? <>- {getRoutineActionId(p.resource, 'routine-run') ? <Section><Action label={tr(p.dirty ? 'saveAndRun' : 'run')} onPress={() => p.onAct('routine-run')} blocked={p.busy || p.loading || !p.online || detail.history.some(r => r.status === 'running' || r.status === 'queued')} /></Section> : null}- <Section title={tr('history')}>{detail.history.length ? detail.history.map(run => <VStack key={run.id} alignment="leading" spacing={spacing.sm}>- <Text>{tr(run.status)}</Text><Text modifiers={[font({ textStyle: 'caption' }), foregroundStyle(colors.textSecondary)]}>{new Date(run.createdAt).toLocaleString(i18n.language)}</Text>- {run.resultText ? <Text modifiers={[textSelection(true)]}>{run.resultText}</Text> : null}{run.error ? <Text modifiers={[foregroundStyle(colors.statusError), textSelection(true)]}>{run.error}</Text> : null}- </VStack>) : <Text modifiers={[foregroundStyle(colors.textSecondary)]}>{tr('noRuns')}</Text>}</Section>- {getRoutineActionId(p.resource, 'routine-delete') ? <Section><Action label={tr('delete')} onPress={p.onDelete} blocked={p.busy || p.loading || p.dirty || !p.online} destructive /></Section> : null}- </> : null}- </> : null}- </ComposerSheet>;-}diff --git a/apps/mobile/src/session/CompanionAutomationNativeView.tsx b/apps/mobile/src/session/CompanionAutomationNativeView.tsxdeleted file mode 100644index a36e2db5df..0000000000--- a/apps/mobile/src/session/CompanionAutomationNativeView.tsx+++ /dev/null@@ -1,16 +0,0 @@-import type { Dispatch, SetStateAction } from 'react';-import type { RemoteResource } from '@cindy/device-link';-import type { RoutineDefinition, RoutineDetail, RoutineSummary } from './companionRoutines';--export interface CompanionAutomationNativeViewProps {- visible: boolean; online: boolean; busy: boolean; loading: boolean; dirty: boolean;- error: string | null; selected: string | null; draftGeneration: number;- resource: RemoteResource | null; items: RoutineSummary[]; detail: RoutineDetail | null;- draft: RoutineDefinition | null;- onChange: Dispatch<SetStateAction<RoutineDefinition | null>>;- onClose(): void; onBack(): void; onOpen(id: string): void; onRetry(): void;- onAct(action: string): void; onDelete(): void;-}--// Keep SwiftUI out of non-iOS bundles. Drafts and remote actions stay in the shared sheet.-export function CompanionAutomationNativeView(_props: CompanionAutomationNativeViewProps) { return null; }diff --git a/apps/mobile/src/session/CompanionAutomationSheet.tsx b/apps/mobile/src/session/CompanionAutomationSheet.tsxdeleted file mode 100644index 1ae86e94ea..0000000000--- a/apps/mobile/src/session/CompanionAutomationSheet.tsx+++ /dev/null@@ -1,331 +0,0 @@-import { iconSize } from '@/theme';-import { useCallback, useEffect, useMemo, useRef, useState } from 'react';-import { ActivityIndicator, Alert, AppState, Platform, Pressable, StyleSheet, Switch, View } from 'react-native';-import { ChevronDown, ChevronRight, Clock3, Plus } from 'lucide-react-native';-import { useTranslation } from 'react-i18next';-import { randomUUID } from 'expo-crypto';-import type { RemoteResource } from '@cindy/device-link';-import { Text, TextInput } from '@/components/AppText';-import { useAuth } from '@/auth/AuthContext';-import { useDeviceLink } from '@/device-link/DeviceLinkContext';-import { startFocusedTopicSubscription } from '@/device-link/focusedTopicSubscription';-import { getRemoteResource, invokeRemoteResourceAction } from '@/device-link/remoteResources';-import { CompanionChoice } from './CompanionChoice';-import { useTheme, useThemedStyles, type ThemeColors } from '@/theme';-import { fontWeight, radius, spacing, typeScale, lineHeight } from '@/theme/tokens';-import { CompanionSheet } from './CompanionSheet';-import { CompanionAutomationNativeView } from './CompanionAutomationNativeView';-import { useRoutineCronFields } from './useRoutineCronFields';-import { emptyRoutineDefinition, getRoutineActionId, parseRoutineDefinition, parseRoutineDetail, parseRoutineSummaries, routineDraftValid, type RoutineDefinition, type RoutineDetail, type RoutineSummary, type RoutineTrigger } from './companionRoutines';--function automationFailure(error: unknown, tr: (key: string) => string): string {- const code = typeof (error as { code?: unknown } | null)?.code === 'string'- ? (error as { code: string }).code- : '';- const text = error instanceof Error ? error.message : String(error);- if (code === 'unsupported' || code === 'CHANNEL_NOT_ALLOWED' || text.includes('CHANNEL_NOT_ALLOWED')) return tr('unsupported');- if (code === 'DEVICE_OFFLINE' || code === 'NOT_CONNECTED' || text.includes('DEVICE_OFFLINE') || text.includes('NOT_CONNECTED')) return tr('offline');- // A host validation sentence is the actionable reason. Raw codes and JSON stay behind the localized summary.- if (text && !text.startsWith('[') && !text.startsWith('{') && !/^[A-Z0-9_]+$/.test(text)) return text;- return tr('failed');-}--function unsupportedAutomationError(): Error {- return Object.assign(new Error('unsupported'), { code: 'unsupported' });-}--export function CompanionAutomationSheet({ visible, onClose, collectionId, botId, deviceId, deviceName, online }: {- visible: boolean; onClose(): void; collectionId: string; botId: string; deviceId: string; deviceName: string; online: boolean;-}) {- const { t, i18n } = useTranslation();- const tr = (key: string) => t(`devices.companions.automation.${key}`);- const styles = useThemedStyles(makeStyles);- const { colors } = useTheme();- const { accountGeneration } = useAuth();- const { invoke, openLink, onRemoteResourceChanged, connectionEpoch, subscribe, unsubscribe } = useDeviceLink();- const [advancedOpen, setAdvancedOpen] = useState(false);- const [selected, setSelected] = useState<string | null>(null);- const [resource, setResource] = useState<RemoteResource | null>(null);- const [items, setItems] = useState<RoutineSummary[]>([]);- const [detail, setDetail] = useState<RoutineDetail | null>(null);- const [draft, setDraft] = useState<RoutineDefinition | null>(null);- const [initialDraft, setInitialDraft] = useState('');- const initialDraftRef = useRef(initialDraft); initialDraftRef.current = initialDraft;- const detailRef = useRef(detail); detailRef.current = detail;- const draftRef = useRef(draft); draftRef.current = draft;- const [draftGeneration, setDraftGeneration] = useState(0);- const [loading, setLoading] = useState(false);- const [busy, setBusy] = useState(false);- const [error, setError] = useState<string | null>(null);- const requestId = useRef(randomUUID());- const seq = useRef(0);- const inFlight = useRef(false);- const pendingDelete = useRef(false);- const operationGeneration = useRef(0);- const dirty = draft !== null && JSON.stringify(draft) !== initialDraft;- const dirtyRef = useRef(dirty); dirtyRef.current = dirty;- const identity = `${accountGeneration}:${deviceId}:${collectionId}:${botId}`;- const current = useRef({ identity, visible, selected, online }); current.current = { identity, visible, selected, online };- const valid = (scope: string, page: string | null) => current.current.visible && current.current.identity === scope && current.current.selected === page;- const open = useCallback((id: string | null) => {- pendingDelete.current = false;- setDraft(null); setInitialDraft(''); dirtyRef.current = false; setDetail(null); setResource(null); setError(null); setSelected(id);- if (id === 'new') requestId.current = randomUUID();- }, []);- const load = useCallback(async (actionError?: string) => {- if (!visible || !botId || !valid(identity, selected)) return;- // An action may settle after connectivity changed; preserve its reason even offline.- if (actionError) setError(actionError);- if (!current.current.online) { setLoading(false); return; }- const generation = ++seq.current;- const scope = identity;- setLoading(true); setError(actionError ?? null);- try {- await openLink(deviceId);- const result = await getRemoteResource(invoke, { deviceId, deviceName }, { collectionId, kind: 'routine', id: `bot:${botId}${selected ? `/${selected}` : ''}` }, i18n.language, ['routine-list', 'routine-detail']);- if (!valid(scope, selected) || generation !== seq.current) return;- const block = result.blocks?.find((item) => item.primitive === (selected ? 'routine-detail' : 'routine-list'));- if (!block) throw new Error(t('devices.companions.automation.unsupported'));- if (selected) {- const next = parseRoutineDetail(block.data);- const versionChanged = dirtyRef.current && detailRef.current && next.revision !== detailRef.current.revision;- if (versionChanged) {- // A lost save acknowledgement is settled only by identical authoritative content.- // Different remote edits must never grant stale drafts overwrite authority.- if (!next.input || JSON.stringify(next.input) !== JSON.stringify(parseRoutineDefinition(draftRef.current))) {- setResource(null);- const changed = t('devices.companions.automation.changed');- setError(actionError ? `${actionError}\n${changed}` : changed);- return;- }- setInitialDraft(JSON.stringify(draftRef.current)); dirtyRef.current = false;- }- setDetail(next);- if (!dirtyRef.current && !versionChanged) {- const value = next.input ?? (selected === 'new' ? emptyRoutineDefinition() : null);- const serialized = JSON.stringify(value);- if (serialized !== initialDraftRef.current) {- setDraft(value); setInitialDraft(serialized); setDraftGeneration((value) => value + 1);- }- }- } else setItems(parseRoutineSummaries(block.data));- pendingDelete.current = false;- setResource(result);- } catch (e) {- if (valid(scope, selected) && generation === seq.current) {- // A lost delete response may leave no detail to refresh. Only a confirmed- // missing resource settles that intent; transient failures remain retryable.- const missing = (e as { code?: unknown } | null)?.code === 'NOT_FOUND'- || e instanceof Error && e.message.startsWith('[NOT_FOUND]');- if (pendingDelete.current && !dirtyRef.current && missing) {- open(null);- return;- }- const unsupported = t('devices.companions.automation.unsupported');- const readError = e instanceof Error && e.message === unsupported ? unsupported : t('devices.resources.loadFailed');- setError(actionError ? `${actionError}\n${readError}` : readError);- }- }- finally { if (valid(scope, selected) && generation === seq.current) setLoading(false); }- }, [visible, online, botId, identity, invoke, openLink, deviceId, deviceName, collectionId, selected, i18n.language, t, open]);- useEffect(() => {- setSelected(null); setResource(null); setItems([]); setDetail(null); setDraft(null); setInitialDraft(''); setError(null);- requestId.current = randomUUID();- pendingDelete.current = false;- operationGeneration.current++; inFlight.current = false; setBusy(false);- return () => { seq.current++; };- }, [visible, identity]);- useEffect(() => { void load(); return () => { seq.current++; }; }, [load, connectionEpoch]);- useEffect(() => {- if (!visible) return;- const off = onRemoteResourceChanged((hostId, event) => {- if (hostId === deviceId && (event.collectionId === collectionId || event.collectionId === 'routines') && !dirtyRef.current && !inFlight.current) void load();- });- const foreground = AppState.addEventListener('change', (state) => { if (state === 'active' && !inFlight.current) void load(); });- const release = online ? startFocusedTopicSubscription({ deviceId, owner: `companion-routines:${botId}`, subscribe, unsubscribe, topic: 'sessions' }) : undefined;- return () => { off(); foreground.remove(); release?.(); };- }, [visible, online, onRemoteResourceChanged, collectionId, deviceId, botId, load, subscribe, unsubscribe]);- const leave = (action: () => void) => {- if (inFlight.current) return;- if (!dirty) { action(); return; }- Alert.alert(tr('unsavedTitle'), tr('unsavedBody'), [- { text: tr('continueEditing'), style: 'cancel' },- { text: tr('discard'), style: 'destructive', onPress: () => { if (valid(identity, selected)) action(); } },- ]);- };- const act = async (actionId: string) => {- const capabilityId = getRoutineActionId(resource, actionId);- if (!valid(identity, selected) || inFlight.current || loading || !online || !resource || !capabilityId) return;- if (actionId === 'routine-create' || actionId === 'routine-save' || actionId === 'routine-run' && dirty) {- if (!draft || !routineDraftValid(draft)) { setError(tr('invalid')); return; }- }- const scope = identity, page = selected;- const operation = ++operationGeneration.current;- inFlight.current = true; setBusy(true); setError(null);- try {- let runResource = resource;- let runRevision = detail?.revision ?? 0;- if (actionId === 'routine-run' && dirty) {- const saveId = getRoutineActionId(resource, 'routine-save');- if (!saveId) throw unsupportedAutomationError();- await invokeRemoteResourceAction(invoke, { deviceId, deviceName }, { collectionId, resourceRef: resource.ref, actionId: saveId,- input: { revision: runRevision, definition: draft } }, i18n.language);- if (!valid(scope, page)) return;- // A successful save stays successful even if the subsequent run/read fails.- setInitialDraft(JSON.stringify(draft)); dirtyRef.current = false;- runResource = await getRemoteResource(invoke, { deviceId, deviceName }, resource.ref, i18n.language, ['routine-list', 'routine-detail']);- if (!valid(scope, page)) return;- const block = runResource.blocks?.find(block => block.primitive === 'routine-detail');- const next = parseRoutineDetail(block?.data);- setResource(runResource); setDetail(next); runRevision = next.revision;- }- const nextCapability = getRoutineActionId(runResource, actionId);- if (!nextCapability) throw unsupportedAutomationError();- await invokeRemoteResourceAction(invoke, { deviceId, deviceName }, {- collectionId, resourceRef: runResource.ref, actionId: nextCapability,- input: { revision: runRevision, requestId: requestId.current,- ...((actionId === 'routine-create' || actionId === 'routine-save') ? { definition: draft } : {}) },- }, i18n.language);- if (!valid(scope, page)) return;- if (actionId === 'routine-run') { await load(); }- else open(null);- } catch (e) {- if (valid(scope, page)) {- // The host consumes opaque actions even when validation or the response fails.- // Reconcile by reading, never replay a write or renew a creation request ID.- setResource(null);- pendingDelete.current = actionId === 'routine-delete';- await load(automationFailure(e, tr));- }- }- finally { if (operationGeneration.current === operation) { inFlight.current = false; if (current.current.identity === scope) setBusy(false); } }- };- const button = (label: string, onPress: () => void, destructive = false, disabled = false, testID?: string) => (- <Pressable accessibilityRole="button" accessibilityState={{ disabled: disabled || busy }} disabled={disabled || busy} onPress={onPress} style={[styles.row, (disabled || busy) && styles.disabled]} testID={testID}>- <Text style={[styles.label, destructive && { color: colors.destructive }]}>{label}</Text>- </Pressable>- );- const triggerText = (trigger: Record<string, unknown>) => trigger.kind === 'interval'- ? t('devices.companions.automation.everyMinutes', { count: Number(trigger.intervalMs) / 60_000 })- : trigger.kind === 'cron' ? `${trigger.expression} · ${trigger.timezone}` : `${trigger.sourceId} · ${trigger.eventType}`;- const row = (item: RoutineSummary) => (- <Pressable key={item.id} accessibilityRole="button" onPress={() => open(item.id)} style={styles.row} testID={`companion.automation.${item.id}`}>- <Clock3 size={iconSize.lg} color={colors.textSecondary} />- <View style={styles.flex}><Text numberOfLines={1} style={styles.label}>{item.name}</Text>- <Text numberOfLines={1} style={styles.secondary}>{item.activity ? tr(item.activity) : !item.enabled ? tr('paused') : item.triggers.map(triggerText).join(' · ')}</Text></View>- <ChevronRight size={iconSize.sm} color={colors.textTertiary} />- </Pressable>- );- // Same input traits as the iOS fields: commands keep their literal case, numbers use the number pad.- const field = (label: string, value: string, onChangeText: (value: string) => void, { multiline = false, literal = false, numeric = false } = {}) => (- <View style={styles.field}><Text style={styles.secondary}>{label}</Text><TextInput accessibilityLabel={label} value={value} onChangeText={onChangeText} editable={!busy} multiline={multiline}- {...(literal ? { autoCapitalize: 'none' as const, autoCorrect: false } : {})} {...(numeric ? { keyboardType: 'number-pad' as const } : {})} style={[styles.input, multiline && styles.multiline]} /></View>- );- const updateTrigger = (index: number, value: RoutineTrigger) => setDraft((d) => d && ({ ...d, triggers: d.triggers.map((item, i) => i === index ? value : item) }));- const choose = (label: string, value: string, options: { value: string; label: string }[], onChange: (value: string) => void) =>- <View style={styles.choice}><CompanionChoice {...{ label, value, options, onChange }} disabled={busy || !online} /></View>;- const confirmDelete = () => Alert.alert(tr('deleteTitle'), tr('deleteBody'), [{ text: tr('cancel'), style: 'cancel' }, { text: tr('delete'), style: 'destructive', onPress: () => void act('routine-delete') }]);- if (Platform.OS === 'ios') return <CompanionAutomationNativeView- {...{ visible, online, busy, loading, dirty, error, selected, draftGeneration, resource, items, detail, draft }}- onChange={setDraft} onClose={() => leave(onClose)} onBack={() => leave(() => open(null))}- onOpen={open} onRetry={() => void load()} onAct={action => void act(action)} onDelete={confirmDelete} />;- return <CompanionSheet visible={visible} onClose={() => leave(onClose)} preventDismiss={dirty || busy}- title={selected ? draft?.name || tr('new') : t('devices.companionProfile.automation')}- onBack={selected ? () => leave(() => open(null)) : undefined} testID="companion.automationSheet">- {/* Offline is a state, not a failure: secondary text like iOS. */}- {!online ? <Text style={[styles.note, styles.field]}>{tr('offline')}</Text> : null}- {error ? <View style={styles.field}><Text selectable style={styles.error}>{error}</Text>{button(tr('retry'), () => void load(), false, !online)}</View> : null}- {loading ? <ActivityIndicator accessibilityLabel={t('devices.resources.loading')} color={colors.textSecondary} style={styles.field} /> : null}- {!selected ? <>- {items.some((r) => r.activity) ? <View style={styles.group}><Text style={styles.heading}>{tr('inProgress')}</Text>{items.filter((r) => r.activity).map(row)}</View> : null}- {items.some((r) => !r.activity) ? <View style={styles.group}><Text style={styles.heading}>{tr('scheduled')}</Text>{items.filter((r) => !r.activity).map(row)}</View> : null}- {online && !loading && !error && items.length === 0 ? <Text style={styles.empty}>{tr('empty')}</Text> : null}- {getRoutineActionId(resource, 'routine-create') ? <Pressable accessibilityRole="button" onPress={() => open('new')} style={styles.row} testID="companion.newAutomation"><Plus size={iconSize.lg} color={colors.textPrimary} /><Text style={styles.label}>{tr('new')}</Text></Pressable> : null}- </> : detail ? <>- {draft && detail.editable ? <>- {field(tr('name'), draft.name, (name) => setDraft({ ...draft, name }))}- <View style={styles.row}><Text style={[styles.label, styles.flex]}>{tr('enabled')}</Text><Switch accessibilityLabel={tr('enabled')} disabled={busy} value={draft.enabled} onValueChange={(enabled) => setDraft({ ...draft, enabled })} trackColor={{ true: colors.textSecondary }} /></View>- {field(tr('instructions'), draft.prompt, (prompt) => setDraft({ ...draft, prompt }), { multiline: true })}- {detail?.supportsPreRunCheck ? <Pressable accessibilityRole="button" accessibilityState={{ expanded: advancedOpen }} onPress={() => setAdvancedOpen(!advancedOpen)} style={styles.row} testID="companion.automation.advanced">- <Text style={[styles.label, styles.flex]}>{tr('advanced')}</Text>- {advancedOpen ? <ChevronDown size={iconSize.sm} color={colors.textTertiary} /> : <ChevronRight size={iconSize.sm} color={colors.textTertiary} />}- </Pressable> : null}- {detail?.supportsPreRunCheck && advancedOpen ? <View style={styles.group}>- <View style={styles.row}><Text style={[styles.label, styles.flex]}>{tr('quiet')}</Text><Switch accessibilityLabel={tr('quiet')} disabled={busy} value={draft.silentWhenIdle ?? false} onValueChange={(silentWhenIdle) => setDraft({ ...draft, silentWhenIdle })} trackColor={{ true: colors.textSecondary }} /></View>- <Text style={styles.secondary}>{tr('quietHint')}</Text>- {field(tr('checkCommand'), draft.preRunHook?.command ?? '', (command) => setDraft({ ...draft, preRunHook: command ? { ...draft.preRunHook, command } : null }), { multiline: true, literal: true })}- <Text style={styles.secondary}>{tr('checkHint')}</Text>- {draft.preRunHook ? field(tr('timeoutMs'), draft.preRunHook.timeoutMs === undefined ? '' : String(draft.preRunHook.timeoutMs), (value) => setDraft({ ...draft, preRunHook: { ...draft.preRunHook!, timeoutMs: value ? Number(value) : undefined } }), { numeric: true }) : null}- </View> : null}- {/* One titled group per trigger, as the iOS form sections. */}- {draft.triggers.map((trigger, index) => <View key={`${draftGeneration}:${trigger.id}`} style={styles.group}>- <Text style={styles.heading}>{tr('triggers')}</Text>- {choose(tr('triggerType'), trigger.kind, ['cron', 'interval', 'event'].map((value) => ({ value, label: tr(value) })), (kind) => updateTrigger(index, kind === 'interval' ? { id: trigger.id, kind, intervalMs: 3_600_000 } : kind === 'event' ? { id: trigger.id, kind, sourceId: '', eventType: '', filters: [] } : { id: trigger.id, kind: 'cron', expression: '0 9 * * *', timezone: Intl.DateTimeFormat().resolvedOptions().timeZone || 'UTC' }))}- {trigger.kind === 'cron' ? <RoutineCronFields trigger={trigger} onChange={(value) => updateTrigger(index, value)} disabled={busy} /> : trigger.kind === 'interval' ? <NumberField key={trigger.id} label={tr('minutes')} value={trigger.intervalMs / 60_000} onChange={(value) => updateTrigger(index, { ...trigger, intervalMs: value * 60_000 })} disabled={busy} /> : <>- {choose(tr('source'), trigger.sourceId, detail.sources.map((s) => ({ value: s.id, label: s.name })), (sourceId) => updateTrigger(index, { ...trigger, sourceId, eventType: '', filters: [] }))}- {choose(tr('event'), trigger.eventType, (detail.sources.find((s) => s.id === trigger.sourceId)?.events ?? []).map((e) => ({ value: e.type, label: e.name })), (eventType) => updateTrigger(index, { ...trigger, eventType, filters: [] }))}- {trigger.filters.map((filter, fi) => <View key={fi} style={styles.group}>- {field(tr('filterField'), filter.field, (value) => updateTrigger(index, { ...trigger, filters: trigger.filters.map((f, n) => n === fi ? { ...f, field: value } : f) }))}- {choose(tr('operator'), filter.operator, ['equals','contains','not-equals'].map((value) => ({ value, label: tr(value) })), (value) => updateTrigger(index, { ...trigger, filters: trigger.filters.map((f, n) => n === fi ? { ...f, operator: value as typeof f.operator } : f) }))}- {field(tr('filterValue'), filter.value, (value) => updateTrigger(index, { ...trigger, filters: trigger.filters.map((f, n) => n === fi ? { ...f, value } : f) }))}- {button(tr('removeFilter'), () => updateTrigger(index, { ...trigger, filters: trigger.filters.filter((_, n) => n !== fi) }))}- </View>)}- {trigger.filters.length < 16 ? button(tr('addFilter'), () => updateTrigger(index, { ...trigger, filters: [...trigger.filters, { field: '', operator: 'equals', value: '' }] })) : null}- </>}- {button(tr('removeTrigger'), () => setDraft({ ...draft, triggers: draft.triggers.filter((_, i) => i !== index) }), false, draft.triggers.length <= 1)}- </View>)}- {draft.triggers.length < 32 ? button(tr('addTrigger'), () => setDraft({ ...draft, triggers: [...draft.triggers, { id: randomUUID(), kind: 'interval', intervalMs: 3_600_000 }] })) : null}- </> : <Text style={styles.empty}>{tr('largeDefinition')}</Text>}- {/* Save sits in the form after the triggers, before run and history, like iOS. */}- {detail.editable ? button(tr('save'), () => void act(selected === 'new' ? 'routine-create' : 'routine-save'), false, !online || !dirty || loading || !getRoutineActionId(resource, selected === 'new' ? 'routine-create' : 'routine-save'), 'companion.automation.save') : null}- {selected !== 'new' ? <View style={styles.group}>- {getRoutineActionId(resource, 'routine-run') ? button(tr(dirty ? 'saveAndRun' : 'run'), () => void act('routine-run'), false, loading || !online || detail.history.some((r) => r.status === 'running' || r.status === 'queued')) : null}- <Text style={styles.heading}>{tr('history')}</Text>- {detail.history.length ? detail.history.map((run) => <View key={run.id} style={styles.field}><Text style={styles.label}>{tr(run.status)}</Text><Text style={styles.secondary}>{new Date(run.createdAt).toLocaleString(i18n.language)}</Text>{run.resultText ? <Text selectable style={styles.label}>{run.resultText}</Text> : null}{run.error ? <Text selectable style={styles.error}>{run.error}</Text> : null}</View>) : <Text style={styles.empty}>{tr('noRuns')}</Text>}- {getRoutineActionId(resource, 'routine-delete') ? button(tr('delete'), confirmDelete, true, loading || dirty || !online) : null}- </View> : null}- </> : null}- </CompanionSheet>;-}-function RoutineCronFields({ trigger, onChange, disabled }: {- trigger: Extract<RoutineTrigger, { kind: 'cron' }>; onChange(trigger: Extract<RoutineTrigger, { kind: 'cron' }>): void; disabled: boolean;-}) {- const { t } = useTranslation();- const tr = (key: string) => t(`devices.companions.automation.${key}`);- const styles = useThemedStyles(makeStyles);- const { colors } = useTheme();- const { preset, hour, minute, day, changePreset, changeHour, changeMinute, changeDay } = useRoutineCronFields(trigger, onChange);- const select = (label: string, value: string, options: { id: string; title: string }[], action: (id: string) => void) =>- <View style={styles.choice}><CompanionChoice label={label} value={value} options={options.map(option => ({ value: option.id, label: option.title }))} onChange={action} disabled={disabled} /></View>;- return <>- {select(tr('repeat'), preset, ['hourly','daily','weekdays','weekly','monthly','custom'].map((id) => ({ id, title: tr(id) })), changePreset)}- {preset === 'monthly' ? select(tr('monthDay'), day, Array.from({ length: 31 }, (_, i) => ({ id: String(i + 1), title: String(i + 1) })), changeDay) : null}- {preset === 'weekly' ? select(tr('weekday'), day, Array.from({ length: 7 }, (_, i) => ({ id: String(i), title: tr(`day${i}`) })), changeDay) : null}- {preset !== 'custom' ? <View style={styles.row}>- <Text style={[styles.label, styles.flex]}>{tr('time')}</Text>- {/* Number pad without a length cap, as iOS; out-of-range values are caught by draft validation. */}- {preset !== 'hourly' ? <><TextInput accessibilityLabel={tr('hour')} keyboardType="number-pad" value={hour} editable={!disabled} onChangeText={changeHour} style={[styles.input, styles.clockInput]} /><Text style={styles.label}>:</Text></> : null}- <TextInput accessibilityLabel={tr('minute')} keyboardType="number-pad" value={minute} editable={!disabled} onChangeText={changeMinute} style={[styles.input, styles.clockInput]} />- </View> : <View style={styles.field}><Text style={styles.secondary}>{tr('cronExpression')}</Text><TextInput accessibilityLabel={tr('cronExpression')} value={trigger.expression} editable={!disabled} onChangeText={(expression) => onChange({ ...trigger, expression })} autoCapitalize="none" autoCorrect={false} style={styles.input} /></View>}- <View style={styles.field}><Text style={styles.secondary}>{tr('timezone')}</Text><TextInput accessibilityLabel={tr('timezone')} value={trigger.timezone} editable={!disabled} onChangeText={(timezone) => onChange({ ...trigger, timezone })} autoCapitalize="none" autoCorrect={false} style={styles.input} /></View>- </>;-}-function NumberField({ label, value, onChange, disabled }: { label: string; value: number; onChange(value: number): void; disabled: boolean }) {- const [text, setText] = useState(String(value));- const styles = useThemedStyles(makeStyles);- return <View style={styles.field}><Text style={styles.secondary}>{label}</Text><TextInput accessibilityLabel={label} keyboardType="number-pad" editable={!disabled} value={text} onChangeText={(next) => { setText(next); onChange(Number(next)); }} style={styles.input} /></View>;-}-const makeStyles = (colors: ThemeColors) => StyleSheet.create({- flex: { flex: 1 }, row: { flexDirection: 'row', alignItems: 'center', gap: spacing.md, minHeight: 48, paddingHorizontal: spacing.md, paddingVertical: spacing.sm },- label: { fontSize: typeScale.body, lineHeight: lineHeight.body, color: colors.textPrimary }, secondary: { fontSize: typeScale.caption, lineHeight: lineHeight.caption, color: colors.textSecondary },- heading: { fontSize: typeScale.footnote, lineHeight: lineHeight.caption, fontWeight: fontWeight.semibold, color: colors.textTertiary, margin: spacing.md },- field: { gap: spacing.sm, marginHorizontal: spacing.md, marginVertical: spacing.sm },- // Picker rows share the field inset so labels line up with the inputs above and below.- choice: { marginHorizontal: spacing.md },- group: { marginVertical: spacing.sm, borderTopWidth: StyleSheet.hairlineWidth, borderColor: colors.border },- input: { minHeight: 44, padding: spacing.md, color: colors.textPrimary, backgroundColor: colors.surfaceElevated, borderWidth: StyleSheet.hairlineWidth, borderColor: colors.border, borderRadius: radius.pill, fontSize: typeScale.body },- clockInput: { width: 64, textAlign: 'center' },- multiline: { minHeight: 112, textAlignVertical: 'top', borderRadius: radius.control }, empty: { margin: spacing.lg, fontSize: typeScale.bodySmall, lineHeight: lineHeight.bodySmall, color: colors.textSecondary },- note: { color: colors.textSecondary, fontSize: typeScale.footnote, lineHeight: lineHeight.caption },- error: { color: colors.statusError, fontSize: typeScale.footnote, lineHeight: lineHeight.caption }, disabled: { opacity: 0.45 },-});diff --git a/apps/mobile/src/session/CompanionHeader.tsx b/apps/mobile/src/session/CompanionHeader.tsxindex 78df2d93b8..9670a5564a 100644--- a/apps/mobile/src/session/CompanionHeader.tsx+++ b/apps/mobile/src/session/CompanionHeader.tsx@@ -10,7 +10,6 @@ import { fontWeight, iconSize, iconStroke, lineHeight, spacing, typeScale, useThimport { HomeHeaderGlassButton } from './HomeHeaderGlassButton';import { TeammatePicker } from './TeammatePicker';import { CompanionCreateSheet, CompanionProfileSheet } from './CompanionProfileSheet';-import { CompanionAutomationSheet } from './CompanionAutomationSheet';import { useTeammateNavigation } from './useTeammateNavigation';const AVATAR_SIZE = 32;@@ -28,7 +27,6 @@ function CompanionHeaderContent({ resource, deviceId, deviceName, online, controconst navigation = useTeammateNavigation();const [picker, setPicker] = useState(false);const [profile, setProfile] = useState(false);- const [automation, setAutomation] = useState(false);const [creating, setCreating] = useState(false);const created = useRef<RemoteResourceRef | null>(null);const pending = useRef<(() => void) | null>(null);@@ -57,9 +55,7 @@ function CompanionHeaderContent({ resource, deviceId, deviceName, online, contro<CompanionProfileSheet visible={profile} onClose={() => setProfile(false)} onClosed={() => { const action = pending.current; pending.current = null; action?.(); }}resource={resource} collectionId={resource.ref.collectionId} deviceId={deviceId} deviceName={deviceName} online={online}onDeleted={() => void navigation.chooseMode('teammates')}- onOpenSearch={() => afterProfile(onSearch)} onOpenAutomation={() => afterProfile(() => setAutomation(true))} />- <CompanionAutomationSheet visible={automation} onClose={() => setAutomation(false)} collectionId="routines"- botId={resource.ref.id} deviceId={deviceId} deviceName={deviceName} online={online} />+ onOpenSearch={() => afterProfile(onSearch)} /></>;}const makeStyles = (colors: ThemeColors) => StyleSheet.create({diff --git a/apps/mobile/src/session/CompanionProfileNativeView.ios.tsx b/apps/mobile/src/session/CompanionProfileNativeView.ios.tsxindex d8e3e7c848..fa3bc14279 100644--- a/apps/mobile/src/session/CompanionProfileNativeView.ios.tsx+++ b/apps/mobile/src/session/CompanionProfileNativeView.ios.tsx@@ -56,7 +56,7 @@ export function CompanionProfileNativeView(p: CompanionProfileNativeViewProps) {<Text modifiers={[font({ textStyle: 'headline' }), lineLimit(2)]}>{p.name}</Text><Spacer /></HStack></Section><Section>{row('profile', 'person.crop.circle')}{row('memory', 'brain')}{row('models', 'slider.horizontal.3')}{row('skills', 'sparkles')}</Section>- <Section>{row('automation', 'clock', p.onAutomation)}{row('artifacts', 'doc.text')}{row('search', 'magnifyingglass', p.onSearch)}{row('permissions', 'hand.raised')}</Section>+ <Section>{row('artifacts', 'doc.text')}{row('search', 'magnifyingglass', p.onSearch)}{row('permissions', 'hand.raised')}</Section><Section>{p.data?.panels.filter(item => ['restart', 'resume', 'delete'].includes(item.id) && item.action).map(item => <Button key={item.id} onPress={() => p.onConfirm(item)} modifiers={[buttonStyle('plain'), listRowInsets({ top: 4, bottom: 4, leading: 16, trailing: 16 }), disabled(p.busy || !p.online), frame({ minHeight: 44 }), ...(item.id === 'delete' ? [foregroundStyle(colors.destructive)] : [])]}><HStack modifiers={[frame({ maxWidth: Infinity, minHeight: 44 }), contentShape(shapes.rectangle())]}><Text>{label(item.action!.label)}</Text><Spacer /></HStack></Button>)}</Section>{/* Same as Android: a host without the settings forms asks for a Cindy update on that computer. */}{p.online && p.data && !p.data.panels.some(item => item.id === 'profile') ? note(tr('hostUpgrade')) : null}diff --git a/apps/mobile/src/session/CompanionProfileNativeView.tsx b/apps/mobile/src/session/CompanionProfileNativeView.tsxindex 066fd6ee64..0f82bfcfb6 100644--- a/apps/mobile/src/session/CompanionProfileNativeView.tsx+++ b/apps/mobile/src/session/CompanionProfileNativeView.tsx@@ -13,7 +13,7 @@ export interface CompanionProfileNativeViewProps {onChange(values: ProfileValues): void; onSubmit(panel: ProfilePanel, confirmed?: boolean): void;onConfirm(panel: ProfilePanel | null): void; onRetry(): void; onDiscard(reload: boolean): void;onEditor(resourceId: string): void; onEditorPanel(panel: ProfilePanel): void;- onSearch(): void; onAutomation(): void;+ onSearch(): void;}// SwiftUI is isolated from Android's bundle. The shared component owns all draft/save logic.export function CompanionProfileNativeView(_props: CompanionProfileNativeViewProps) { return null; }diff --git a/apps/mobile/src/session/CompanionProfileSheet.tsx b/apps/mobile/src/session/CompanionProfileSheet.tsxindex 36c411d44b..05e2af8ef8 100644--- a/apps/mobile/src/session/CompanionProfileSheet.tsx+++ b/apps/mobile/src/session/CompanionProfileSheet.tsx@@ -3,7 +3,7 @@ import { useRouter } from 'expo-router';import { randomUUID } from 'expo-crypto';import { ActivityIndicator, Alert, Image, Platform, Pressable, StyleSheet, Switch, View } from 'react-native';import { useTranslation } from 'react-i18next';-import { Brain, Camera, Clock3, FileText, Hand, History, Info, Link2, Settings2, Sparkles } from 'lucide-react-native';+import { Brain, Camera, FileText, Hand, History, Info, Link2, Settings2, Sparkles } from 'lucide-react-native';import { resolveRemoteText, type RemoteResource, type RemoteResourceRef, type RemoteText } from '@cindy/device-link';import { useAuth } from '@/auth/AuthContext';import { Text, TextInput } from '@/components/AppText';@@ -43,7 +43,6 @@ export interface CompanionProfileSheetProps {online: boolean;onDeleted?: () => void;onOpenSearch: () => void;- onOpenAutomation: () => void;}/** Identity-keyed content prevents previous-account drafts and reads from surviving a switch. */export function CompanionProfileSheet(props: CompanionProfileSheetProps) {@@ -54,7 +53,7 @@ export function CompanionProfileSheet(props: CompanionProfileSheetProps) {/** One navigation host, with real host reads, draft guards and in-surface confirmations. */function CompanionProfileSheetContent(props: CompanionProfileSheetProps) {- const { visible, resource, collectionId, deviceId, deviceName, online, onClose, onOpenSearch, onOpenAutomation } = props;+ const { visible, resource, collectionId, deviceId, deviceName, online, onClose, onOpenSearch } = props;const { t, i18n } = useTranslation();const router = useRouter();const pendingTask = useRef<string | null>(null);@@ -335,7 +334,7 @@ function CompanionProfileSheetContent(props: CompanionProfileSheetProps) {onConfirm={confirm}onRetry={retry} onDiscard={discardDraft}onEditor={id => void openEditor(id)} onEditorPanel={selectEditorPanel}- onSearch={onOpenSearch} onAutomation={onOpenAutomation} /></>;+ onSearch={onOpenSearch} /></>;// Android mirrors the iOS page map, entry order and save rules; only the surface is platform-drawn.const save = (target: ProfilePanel, blocked: boolean) => <MainWindowActionButton action={{ label: t('devices.companionProfile.save'), busy,@@ -355,7 +354,7 @@ function CompanionProfileSheetContent(props: CompanionProfileSheetProps) {<Text accessibilityRole="header" numberOfLines={2} style={styles.name}>{name}</Text></View><View style={styles.group}>{row('profile', Info)}{row('memory', Brain)}{row('models', Sparkles)}{row('skills', Settings2)}</View>- <View style={styles.group}>{row('automation', Clock3, onOpenAutomation)}{row('artifacts', FileText)}{row('search', History, onOpenSearch)}{row('permissions', Hand)}</View>+ <View style={styles.group}>{row('artifacts', FileText)}{row('search', History, onOpenSearch)}{row('permissions', Hand)}</View>{/* Host order, like iOS: restart / resume / delete are whatever the computer offers now. */}{management.length ? <View style={styles.group}>{management.map(item => actionRow(item, () => confirm(item), item.id === 'delete'))}</View> : null}{online && data && !actionPanel('profile') ? note('hostUpgrade') : null}diff --git a/apps/mobile/src/session/companionRoutines.ts b/apps/mobile/src/session/companionRoutines.tsdeleted file mode 100644index eb3d17c01a..0000000000--- a/apps/mobile/src/session/companionRoutines.ts+++ /dev/null@@ -1,112 +0,0 @@-import type { RemoteResource } from '@cindy/device-link';--export function getRoutineActionId(resource: RemoteResource | null, operation: string): string | null {- const block = resource?.blocks?.find((item) => item.primitive === 'routine-list' || item.primitive === 'routine-detail');- const id = record(record(block?.data)?.operationActions)?.[operation];- return bounded(id, 512) && id.length > 0 && resource?.actions?.some((action) => action.id === id && !action.disabled) ? id : null;-}--export type RoutineTrigger =- | { id: string; kind: 'cron'; expression: string; timezone: string }- | { id: string; kind: 'interval'; intervalMs: number }- | { id: string; kind: 'event'; sourceId: string; eventType: string; filters: { field: string; operator: 'equals' | 'contains' | 'not-equals'; value: string }[] };-export interface RoutineDefinition { name: string; prompt: string; enabled: boolean; triggers: RoutineTrigger[]; silentWhenIdle?: boolean; preRunHook?: { command: string; timeoutMs?: number } | null }-export interface RoutineSummary { id: string; name: string; enabled: boolean; revision: number; activity?: 'queued' | 'running'; triggers: Array<Record<string, unknown>> }-export interface RoutineDetail {- supportsPreRunCheck?: boolean;- id: string | null; revision: number; editable: boolean; input: RoutineDefinition | null;- sources: { id: string; name: string; status: string; events: { type: string; name: string; fields: string[] }[] }[];- history: { id: string; status: string; createdAt: number; finishedAt?: number; resultText?: string; error?: string }[];-}-function record(raw: unknown): Record<string, unknown> | null { return raw && typeof raw === 'object' && !Array.isArray(raw) ? raw as Record<string, unknown> : null; }-function bounded(raw: unknown, max = 200): raw is string { return typeof raw === 'string' && raw.length <= max; }-export function parseRoutineDefinition(raw: unknown): RoutineDefinition | null {- const v = record(raw);- if (!v || !bounded(v.name) || !bounded(v.prompt, 45_000) || typeof v.enabled !== 'boolean' || !Array.isArray(v.triggers) || v.triggers.length > 32) return null;- const triggers: RoutineTrigger[] = [];- for (const rawTrigger of v.triggers) {- const r = record(rawTrigger);- if (!r || !bounded(r.id, 128)) return null;- if (r.kind === 'cron' && bounded(r.expression, 128) && bounded(r.timezone, 128)) triggers.push({ id: r.id, kind: 'cron', expression: r.expression, timezone: r.timezone });- else if (r.kind === 'interval' && Number.isSafeInteger(r.intervalMs) && Number(r.intervalMs) >= 60_000) triggers.push({ id: r.id, kind: 'interval', intervalMs: Number(r.intervalMs) });- else if (r.kind === 'event' && bounded(r.sourceId) && bounded(r.eventType) && Array.isArray(r.filters) && r.filters.length <= 16) {- const filters: Extract<RoutineTrigger, { kind: 'event' }>['filters'] = [];- for (const rawFilter of r.filters) {- const f = record(rawFilter);- if (!f || !bounded(f.field, 128) || !bounded(f.value, 2000) || !['equals', 'contains', 'not-equals'].includes(String(f.operator))) return null;- filters.push({ field: f.field, value: f.value, operator: f.operator as typeof filters[number]['operator'] });- }- triggers.push({ id: r.id, kind: 'event', sourceId: r.sourceId, eventType: r.eventType, filters });- } else return null;- }- if (v.silentWhenIdle !== undefined && typeof v.silentWhenIdle !== 'boolean') return null;- let preRunHook: RoutineDefinition['preRunHook'];- if (v.preRunHook === null) preRunHook = null;- else if (v.preRunHook !== undefined) {- const hook = record(v.preRunHook);- if (!hook || !bounded(hook.command, 32000) || !hook.command.trim()- || (hook.timeoutMs !== undefined && (!Number.isSafeInteger(hook.timeoutMs) || Number(hook.timeoutMs) <= 0))) return null;- preRunHook = { command: hook.command, ...(hook.timeoutMs === undefined ? {} : { timeoutMs: Number(hook.timeoutMs) }) };- }- return { name: v.name, prompt: v.prompt, enabled: v.enabled, triggers,- ...(v.silentWhenIdle === undefined ? {} : { silentWhenIdle: v.silentWhenIdle as boolean }),- ...(preRunHook === undefined ? {} : { preRunHook }) };-}-export function parseRoutineSummaries(raw: unknown): RoutineSummary[] {- const items = record(raw)?.items;- if (!Array.isArray(items)) throw new Error('Invalid automation list');- return items.slice(0, 100).map((raw) => {- const r = record(raw);- if (!r || !bounded(r.id, 128) || !bounded(r.name) || typeof r.enabled !== 'boolean' || !Number.isSafeInteger(r.revision) || !Array.isArray(r.triggers)) throw new Error('Invalid automation');- return { id: r.id, name: r.name, enabled: r.enabled, revision: Number(r.revision),- ...(r.activity === 'queued' || r.activity === 'running' ? { activity: r.activity } : {}),- triggers: r.triggers.slice(0, 32).map((value) => record(value) ?? {}) };- });-}-export function parseRoutineDetail(raw: unknown): RoutineDetail {- const r = record(raw);- if (!r || (r.id !== null && !bounded(r.id, 128)) || !Number.isSafeInteger(r.revision) || typeof r.editable !== 'boolean' || !Array.isArray(r.sources) || !Array.isArray(r.history)) throw new Error('Invalid automation detail');- const input = r.input === null ? null : parseRoutineDefinition(r.input);- if (r.input !== null && input === null) throw new Error('Unsupported automation definition');- return { supportsPreRunCheck: r.supportsPreRunCheck === true, id: r.id as string | null, revision: Number(r.revision), editable: r.editable,- // Older saved routines were quiet when this field was absent. Keep their- // visible choice while blank new forms continue to start with false.- input: input && r.id !== null && r.supportsPreRunCheck === true- ? { ...input, silentWhenIdle: input.silentWhenIdle ?? true } : input,- sources: r.sources.slice(0, 64).flatMap((raw) => {- const s = record(raw);- if (!s || !bounded(s.id) || !bounded(s.name) || !bounded(s.status) || !Array.isArray(s.events)) return [];- return [{ id: s.id, name: s.name, status: s.status, events: s.events.slice(0, 32).flatMap((raw) => {- const e = record(raw); return e && bounded(e.type) && bounded(e.name) && Array.isArray(e.fields)- ? [{ type: e.type, name: e.name, fields: e.fields.filter((f): f is string => bounded(f, 128)).slice(0, 64) }] : [];- }) }];- }),- history: r.history.slice(0, 20).flatMap((raw) => {- const h = record(raw);- if (!h || !bounded(h.id, 128) || !bounded(h.status) || typeof h.createdAt !== 'number' || !Number.isFinite(h.createdAt)) return [];- return [{ id: h.id, status: ['queued', 'running', 'success', 'failed', 'interrupted', 'cancelled', 'skipped'].includes(h.status) ? h.status : 'unknown', createdAt: h.createdAt,- ...(typeof h.finishedAt === 'number' ? { finishedAt: h.finishedAt } : {}),- ...(bounded(h.resultText, 2000) ? { resultText: h.resultText } : {}),- ...(bounded(h.error, 1000) ? { error: h.error } : {}) }];- }) };-}-export function emptyRoutineDefinition(): RoutineDefinition {- return { name: '', prompt: '', enabled: true, silentWhenIdle: false, triggers: [{ id: 'daily', kind: 'cron', expression: '0 9 * * *', timezone: Intl.DateTimeFormat().resolvedOptions().timeZone || 'UTC' }] };-}-export function routineDraftValid(draft: RoutineDefinition): boolean {- return Boolean(draft.name.trim() && draft.prompt.trim() && draft.triggers.length && parseRoutineDefinition(draft)- && draft.triggers.every((t) => t.kind !== 'cron' || routineCronFieldsValid(t))- && draft.triggers.every((t) => t.kind !== 'event' || (t.sourceId && t.eventType && t.filters.every((f) => f.field && f.value))));-}--/** Catch incomplete presets and literal field bounds; full cron semantics remain host-owned. */-function routineCronFieldsValid(trigger: Extract<RoutineTrigger, { kind: 'cron' }>): boolean {- const fields = trigger.expression.trim().split(/\s+/);- const ranges = [[0, 59], [0, 23], [1, 31], [1, 12], [0, 7]] as const;- return Boolean(trigger.timezone.trim()) && fields.length === ranges.length && fields.every((field, index) => {- if (!/^[+-]?\d+(?:\.\d+)?$/.test(field)) return true;- const value = Number(field);- const [min, max] = ranges[index]!;- return Number.isSafeInteger(value) && value >= min && value <= max;- });-}diff --git a/apps/mobile/src/session/useRoutineCronFields.ts b/apps/mobile/src/session/useRoutineCronFields.tsdeleted file mode 100644index 28443f77ab..0000000000--- a/apps/mobile/src/session/useRoutineCronFields.ts+++ /dev/null@@ -1,32 +0,0 @@-import { useState } from 'react';-import type { RoutineTrigger } from './companionRoutines';--type CronTrigger = Extract<RoutineTrigger, { kind: 'cron' }>;--/** Keep partial input (including an empty hour/minute) until the user finishes editing. */-export function useRoutineCronFields(trigger: CronTrigger, onChange: (trigger: CronTrigger) => void) {- const parts = trigger.expression.trim().split(/\s+/);- const simple = parts.length === 5 && /^\d+$/.test(parts[0]!) && parts[3] === '*';- const monthly = simple && /^\d+$/.test(parts[1]!) && /^\d+$/.test(parts[2]!) && parts[4] === '*';- const initial = monthly ? 'monthly' : parts[2] !== '*' ? 'custom' : simple && parts[1] === '*' && parts[4] === '*' ? 'hourly'- : simple && /^\d+$/.test(parts[1]!) && parts[4] === '*' ? 'daily'- : simple && /^\d+$/.test(parts[1]!) && parts[4] === '1-5' ? 'weekdays'- : simple && /^\d+$/.test(parts[1]!) && /^[0-6]$/.test(parts[4]!) ? 'weekly' : 'custom';- const [preset, setPreset] = useState(initial);- const [hour, setHour] = useState(simple && parts[1] !== '*' ? parts[1]! : '9');- const [minute, setMinute] = useState(simple ? parts[0]! : '0');- const [day, setDay] = useState(initial === 'monthly' ? parts[2]! : initial === 'weekly' ? parts[4]! : '1');- const update = (mode: string, h: string, m: string, d: string) => {- if (mode !== 'custom') onChange({ ...trigger, expression: `${m} ${mode === 'hourly' ? '*' : h} ${mode === 'monthly' ? d : '*'} * ${mode === 'weekdays' ? '1-5' : mode === 'weekly' ? d : '*'}` });- };- return {- preset, hour, minute, day,- changePreset(mode: string) {- const nextDay = mode === 'monthly' ? String(Math.max(1, Number(day))) : mode === 'weekly' ? String(Math.min(6, Number(day))) : day;- setDay(nextDay); setPreset(mode); update(mode, hour, minute, nextDay);- },- changeHour(value: string) { setHour(value); update(preset, value, minute, day); },- changeMinute(value: string) { setMinute(value); update(preset, hour, value, day); },- changeDay(value: string) { setDay(value); update(preset, hour, minute, value); },- };-}diff --git a/docs/design-rules/design-inventory.md b/docs/design-rules/design-inventory.mdindex 70b89de253..5b31f4a58f 100644--- a/docs/design-rules/design-inventory.md+++ b/docs/design-rules/design-inventory.md@@ -11,7 +11,7 @@计数快照日期:2026-09-27。生成命令:`pnpm design:inventory`。裸颜色匹配与 `scripts/hardcoded-color-audit.mjs` 共用 `scripts/shared/hardcoded-color-match.mjs`(HEX / RGB / HSL / OKLCH 等字面通道),两者在共享 matcher 内统一排除纯语义包装、注释及 PR 编号;数值颜色函数还需位于样式属性、CSS 声明/函数或任意值语境,普通文案字符串里的颜色函数文本不计入;字面 fallback 仍计入——语义 token 消费与注释引用不是迁移债务;裸圆角为粗粒度(`rounded*` class、`border-radius:` 与 React style 对象的 `borderRadius:`)。Token 计数为样式源里 `var(--token)` / `hsl(var(--token)` 的去重 ID 数;Mobile 的 ThemeColors / typeScale 等 RN 属性不计入此列,不能将 0 解释为未使用 Token。-登记 surface 数:51。平台包含 Desktop 与 Mobile;静态入口发现不表示已迁移或已实机验证。+登记 surface 数:50。平台包含 Desktop 与 Mobile;静态入口发现不表示已迁移或已实机验证。| ID | 平台 | 标题 | 生产入口 | 可达组件 | 样式来源 | Token 数 | 裸颜色 | 裸圆角 || --- | --- | --- | --- | --- | --- | ---: | ---: | ---: |@@ -53,9 +53,8 @@| `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.automations` | mobile | 自动化 | app/automations/[deviceId].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, [deviceId], _layout, gestureHandler, peerFileTransport, useLocale | apps/mobile/app/_layout.tsx, apps/mobile/app/automations/[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/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 | 76 || `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, CompanionAutomationNativeView, CompanionAutomationNativeView.ios, CompanionAutomationSheet, 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/CompanionAutomationNativeView.ios.tsx, apps/mobile/src/session/CompanionAutomationNativeView.tsx, apps/mobile/src/session/CompanionAutomationSheet.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 | 303 |+| `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 |@@ -124,7 +123,6 @@| apps/mobile/app/(auth)/login.tsx | LoginRoute | `mobile.auth` || apps/mobile/app/account-deletion.tsx | AccountDeletionScreen | `mobile.account-deletion` || apps/mobile/app/add-account.tsx | AddAccountScreen | `mobile.auth` |-| apps/mobile/app/automations/[deviceId].tsx | AutomationsScreen | `mobile.automations` || apps/mobile/app/companions/direct/[threadId].tsx | CompanionDirectMessages | `mobile.companions.direct` || apps/mobile/app/devices/[deviceId].tsx | DeviceDetailScreen | `mobile.devices` || apps/mobile/app/devices/desktop/[deviceId].tsx | RemoteDesktopRoute | `mobile.remote-desktop` |@@ -147,6 +145,7 @@| --- | --- || apps/mobile/app/+native-intent.ts | native intent routing; no screen || apps/mobile/app/_layout.tsx | layout; visible mounted feedback is a separate overlay surface |+| apps/mobile/app/automations/[deviceId].tsx | legacy automation link redirect; no screen || apps/mobile/app/listperf.tsx | __DEV__ list performance harness; not production UI || apps/mobile/app/splash-preview.tsx | MOBILE_VISUAL_MOCK_ENABLED preview; not production UI |@@ -211,7 +210,6 @@ Mobile 已由 DS-7 纳入同一台账(2026-09-10 静态入口发现),保| `desktop.window.voice-overlay` | Codex(DS-9 影响核对)/ kirozeng(验收协调) | legacy | — | DS-9 保留现有专属表面;未改全局 Button/主题源,按共享依赖核影响 | 本批未直接改该入口;无真实实例的独立/原生/账号/插件场景保留原合同,未作完整运行验收;kirozeng 安排所需环境,Codex 核对,2026-09-17 或 DS-10 开工前复查 || `mobile.account-deletion` | kirozeng 协调 / Codex 发现维护;页面 owner 待认领 | legacy | — | DS-7 已发现入口;Mobile 独立阶段接管,未迁移 | 2026-09-17 复查入口变化和页面 owner;动态内容、平台实际呈现留 Mobile 独立阶段验证 || `mobile.auth` | kirozeng 协调 / Codex 发现维护;页面 owner 待认领 | legacy | — | DS-7 已发现入口;Mobile 独立阶段接管,未迁移 | 2026-09-17 复查入口变化和页面 owner;动态内容、平台实际呈现留 Mobile 独立阶段验证 |-| `mobile.automations` | kirozeng 协调 / Codex 发现维护;页面 owner 待认领 | legacy | — | DS-7 已发现入口;Mobile 独立阶段接管,未迁移 | 2026-09-17 复查入口变化和页面 owner;动态内容、平台实际呈现留 Mobile 独立阶段验证 || `mobile.chat.new` | kirozeng 协调 / Codex 发现维护;页面 owner 待认领 | legacy | — | DS-7 已发现入口;Mobile 独立阶段接管,未迁移 | 2026-09-17 复查入口变化和页面 owner;动态内容、平台实际呈现留 Mobile 独立阶段验证 || `mobile.chat.session` | kirozeng 协调 / Codex 发现维护;页面 owner 待认领 | legacy | — | DS-7 已发现入口;Mobile 独立阶段接管,未迁移 | 2026-09-17 复查入口变化和页面 owner;动态内容、平台实际呈现留 Mobile 独立阶段验证 || `mobile.chat.sharing` | unassigned | legacy | — | DS-7 发现入口,Mobile 独立阶段接管;未迁移 | 保持现状;发现问题记下一动作,本张不修视觉 |diff --git a/docs/product-rules/bot-routines.md b/docs/product-rules/bot-routines.mdindex 0cc0ed7519..563beef578 100644--- a/docs/product-rules/bot-routines.md+++ b/docs/product-rules/bot-routines.md@@ -8,14 +8,14 @@桌面入口在伙伴任务头部,打开标准右侧栏。列表进入详情后可修改指令、启停、立即运行、增删触发条件、删除规则和查看历史。立即运行先保存当前编辑,再运行,避免执行屏幕上看不到的旧指令。定时菜单提供每小时、每天、工作日、每周、每月、间隔和高级 Cron,保留 IANA 时区。事件菜单来自实际插件声明,不显示未接入平台的假入口。-手机通过已有 Remote Resources 展示本机例行任务及动作,执行仍发生在被控电脑。无需新增 Mobile 原生依赖或改变 wire protocol。电脑离线时无法执行;没有宣称云端补投能力。+手机端不提供例行任务管理:移除「所有任务」下拉菜单的 `routines`、伙伴资料页的自动化入口和旧的独立自动化管理页,旧管理链接返回设备页。具体界面边界与[伙伴运行时合同](./cindy-bots-runtime.md)一致;下文例行任务管理及高级设置均适用于桌面端。移除手机入口不删除已有规则、任务数据或运行历史,不改变桌面执行服务、Remote Resources 协议或 Mobile 原生依赖。执行仍发生在电脑,没有宣称云端补投能力。## 分层与执行- `@cindy/maker-scheduler`:例行任务校验、匹配、去重、串行落盘和运行状态机。纯逻辑,不依赖 Electron。- Desktop routines service:按当前账号保存本地文件,解析伙伴当前的长期任务,调用现有调度执行器。- 插件:第三方身份认证、长连接、消息订阅或本地采集。向宿主报告事件,不指定伙伴、指令或执行权限。-- UI / MCP / 手机资源:共用管理服务,不能冒充事件来源。MCP 管理仅走宿主绑定调用者身份的伙伴必备工具;通用 scheduler MCP 不提供可任意指定 botId 的例行任务入口。+- 桌面 UI / MCP / Remote Resources:共用管理服务,不能冒充事件来源。宿主保留 Remote Resources,当前手机端过滤 `routines` 集合及动作。MCP 管理仅走宿主绑定调用者身份的伙伴必备工具;通用 scheduler MCP 不提供可任意指定 botId 的例行任务入口。所有执行复用伙伴 canonical task,继承模型、技能和实际权限,包括冷恢复时的权限。合成触发消息不作为用户聊天消息展示;有成果的输出由已有伙伴消息链呈现,空转复用静默策略。每条例行任务最多一个正在执行的运行;等待中的新事件合并为一批。不同规则共享伙伴时,由既有任务队列串行派发。@@ -106,6 +106,8 @@ const receipt = await cindy.routines.request({## 验证与边界+本节保留例行任务能力历次交付的验证记录,不代表当前手机端仍提供管理界面。移除手机入口的本次改动未做模拟器或真机验收。+有独立引擎测试覆盖事件匹配、OR 合并、去重、重启、账号/伙伴边界、延期重试和落盘失败;插件协议测试覆盖能力声明兼容与发布身份;真实临时目录验证文件持久化;UI 测试验证修改后立即运行使用新指令且保留全部触发条件。UI 使用既有语义主题 Token 和标准控件,两种主题均有实现。经用户明确授权,使用 dev2-routine-triggers 隔离档案启动 Desktop;Dark 头部入口与例行任务列表已实机检查,Light 与手机未实机目检。第三方线上事件投递不在已验证范围内。@@ -138,7 +140,7 @@ Pi 将 routine_list、routine_save、routine_sources、routine_history、routine明确判定为检查型的新建 agent 自动化由创建入口显式启用“检查没事不说话”;未分类的通用创建入口和仅执行脚本的任务保持原通知行为,避免吞掉提醒或定时发送。伙伴例行任务沿用原本的静默通知默认值,并把选择和可选 `preRunHook` 暴露到-同一份 routine 定义、桌面及手机高级设置。显式提醒/定时发送应设置+同一份 routine 定义与桌面高级设置。显式提醒/定时发送应设置`silentWhenIdle=false`。没有批量迁移旧规则:普通旧调度保留已存选择,旧伙伴未存该字段时沿用原静默通知默认值;旧客户端省略可选字段时不会清掉新配置。@@ -161,5 +163,5 @@ exit 0 将现有长度限制内的 stdout 作为不可信数据传给本轮模共享 teammate-guide 同时进入预加载指引和原生 Skill,指导先查已有规则、优先事件/确定性检查、读回配置、成功处理后才确认游标,保留显式提醒和用户选择。-手机连接旧版 Host 时按资源能力信号隐藏不支持的高级字段;连接新版 Host 后可编辑。+手机端无论连接新旧 Host,均不提供例行任务高级设置;Host 能力信号不会重新开放手机管理入口。本次不改变原生依赖、fingerprint、插件协议或 routine 所有权。diff --git a/docs/product-rules/cindy-bots-runtime.md b/docs/product-rules/cindy-bots-runtime.mdindex 7b2f94cd44..8057a1fea1 100644--- a/docs/product-rules/cindy-bots-runtime.md+++ b/docs/product-rules/cindy-bots-runtime.md@@ -73,6 +73,8 @@ Cindy Session,以父任务关系回到发起伙伴,但不冒充该伙伴或归档和故障信息可以在需要时呈现,但维护动作默认由系统完成。用户只管理伙伴,不管理容器。伙伴设置采用紧凑的分组列表,右侧抽屉最大宽度 448px,窄于该宽度的可视区域内占满可用宽度;此尺寸只用于伙伴设置,不改变全局设置。头像居中且可更换。伙伴聊天头部只保留姓名/头像与设置入口,不显示独立的例行任务图标;例行任务从伙伴设置内管理。资料、性格、记忆、模型、能力、自动化任务、历史检索和高级配置在同一抽屉内打开完整内页;返回与关闭前先保存资料,保存失败留在原页。自动化任务复用既有编辑与执行接口,未保存的任务草稿离开前允许继续编辑。模型复用统一选择器,保留来源、Harness、思考深度、Fast 与备用链,不另造默认模型规则。+手机端不提供例行任务管理:伙伴资料页不显示自动化任务入口,「所有任务」下拉菜单不展示 `routines`,旧的独立自动化管理页也已移除。上述例行任务编辑与草稿规则仅适用于桌面端;手机仍保留任务运行历史。实现见 Mobile `CompanionHeader.tsx`、`CompanionProfileSheet.tsx` 与 `remoteResources.ts`。+不提供新的「暂停伙伴」操作;已有暂停状态仍保留恢复入口。设置页与伙伴列表复用同一删除确认,保留任务历史和独立工作树;确认文案必须说明伙伴自身资料、记忆与工作区会被删除。「重启伙伴」直接显示在管理区,不隐藏在高级配置或历史折叠项内。该操作:停止当前主任务运行、取消旧自动续跑,保留同一条主时间线、已存消息、伙伴记忆与文件,以持久交接重建原生上下文。排队输入保留但暂停,diff --git a/scripts/shared/design-inventory.mjs b/scripts/shared/design-inventory.mjsindex 8729404971..0e0f1af37a 100644--- a/scripts/shared/design-inventory.mjs+++ b/scripts/shared/design-inventory.mjs@@ -1402,7 +1402,6 @@ export function mobileCatalogSurfaces() {['chat.sharing', '共享任务邀请与成员', ['shared-session.tsx']],['chat.new', '新建任务', ['sessions/new.tsx']],['files', '任务文件与预览', ['files/[sessionId].tsx', 'files/preview/[sessionId].tsx']],- ['automations', '自动化', ['automations/[deviceId].tsx']],['settings', '设置(含调试与日志上传可见入口)', ['settings.tsx']],['auth', '登录与添加账号', ['(auth)/login.tsx', 'add-account.tsx']],['account-deletion', '账号注销', ['account-deletion.tsx']],@@ -1428,6 +1427,7 @@ export function mobileRouteCoverage(repoRoot, catalog = mobileCatalogSurfaces())const excluded = new Map([['_layout.tsx', 'layout; visible mounted feedback is a separate overlay surface'],['+native-intent.ts', 'native intent routing; no screen'],+ ['automations/[deviceId].tsx', 'legacy automation link redirect; no screen'],['splash-preview.tsx', 'MOBILE_VISUAL_MOCK_ENABLED preview; not production UI'],['listperf.tsx', '__DEV__ list performance harness; not production UI'],]);