Skip to content

armgit / cindy

Public Imported from GitHub
0

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

fix(bots): clarify routine controls and localized schedules

Chris49dc19d064d2
diff --git a/apps/desktop/scripts/fixtures/bot-routines/routines-fixture.tsx b/apps/desktop/scripts/fixtures/bot-routines/routines-fixture.tsx
new file mode 100644
index 0000000000..d7de393aed
--- /dev/null
+++ b/apps/desktop/scripts/fixtures/bot-routines/routines-fixture.tsx
@@ -0,0 +1,43 @@
+import { mountPage, subscription, forbid } from '../../ui-page/harness';
+import { BotRoutines } from '../../../src/renderer/features/bots/BotRoutines';
+import { BotAutonomySettings } from '../../../src/renderer/features/bots/BotAutonomySettings';
+import type { Routine } from '@cindy/maker-scheduler';
+
+const base = { botId: 'fixture', prompt: 'Fixture only', revision: 1, createdAt: 1, updatedAt: 1 };
+const cron = (expression: string) => [{ id: 'time', kind: 'cron' as const, expression, timezone: 'Asia/Shanghai' }];
+let records: Routine[] = [];
+mountPage({
+ host: (ctx) => {
+ records = [
+ { ...base, id: 'builtin', name: 'follow-up', builtin: 'follow-up', enabled: true, triggers: [] },
+ { ...base, id: 'paused', name: 'Review inbox', enabled: false, triggers: cron('5 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23 * * *') },
+ { ...base, id: 'timer', name: 'Daily project summary', enabled: true, triggers: cron('37 0,6,12,18,23 * * *') },
+ { ...base, id: 'event', name: 'Review pull requests and report changes', enabled: true, activity: 'queued', triggers: [
+ ...cron('*/20 9-17 * * 1-5'),
+ { id: 'event', kind: 'event', sourceId: 'plugin:git', eventType: 'pr.changed', filters: [] },
+ ] },
+ { ...base, id: 'running', name: 'Weekly digest', enabled: true, activity: 'running', triggers: cron('0 9 * * 1') },
+ ];
+ let fail = ctx.case === 'save-error';
+ return {
+ routines: {
+ list: async () => records,
+ sources: async () => [{ id: 'plugin:git', name: 'GitHub', status: 'listening', events: [{ type: 'pr.changed', name: 'Pull request updated', fields: [] }] }],
+ history: async () => [{ id: 'failed', routineId: 'timer', status: 'failed', createdAt: 1792800000000, events: [], error: 'Service unavailable' }],
+ onChanged: subscription('routines'),
+ nightlyLearning: { get: async () => null },
+ save: async (_bot: string, input: Routine, id: string) => {
+ if (fail) { fail = false; throw new Error('Fixture write failed'); }
+ records = records.map((item) => item.id === id ? { ...item, ...input } : item);
+ return records.find((item) => item.id === id);
+ },
+ runNow: forbid('routines.runNow'), remove: forbid('routines.remove'),
+ },
+ localDb: { bots: { autonomy: { getSettings: async () => ({ schedulerBotId: null, isCustomized: false, defaults: { schedulerBotId: null } }) } } },
+ maker: { onBotAutonomyChanged: subscription('autonomy') },
+ };
+ },
+ render: () => <div className="mx-auto w-full max-w-xl p-4"><BotRoutines botId="fixture" embedded
+ header={<BotAutonomySettings botId="fixture" botName="Cindy" allowSchedulerFollow={false} onAllowSchedulerFollowChange={() => {}} />}
+ /></div>,
+});
diff --git a/apps/desktop/scripts/fixtures/bot-routines/ui-page.mjs b/apps/desktop/scripts/fixtures/bot-routines/ui-page.mjs
new file mode 100644
index 0000000000..460268f4c7
--- /dev/null
+++ b/apps/desktop/scripts/fixtures/bot-routines/ui-page.mjs
@@ -0,0 +1,34 @@
+import assert from 'node:assert/strict';
+export default {
+ name: 'bot-routines', entry: './routines-fixture.tsx',
+ viewport: { width: 440, height: 900 },
+ real: 'BotRoutines list/editor, BotAutonomySettings, cronToHuman and standard switches',
+ notCovered: 'Host persistence, real scheduler execution, plugin events and native Mobile (no routine management entry)',
+ stubs: { 'src/renderer/features/bots/botStore': { partial: 'export const useBotProfiles=()=>[];' } },
+ cases: {
+ default: { about: 'Paused, enabled, queued, running; exact hourly and selected-hour schedules; independent follow-up scope' },
+ 'save-error': { about: 'Failed pause keeps the enabled switch; retry saves without running' },
+ history: { about: 'Failure result is readable before expanding run details' },
+ },
+ async ready(page) { await page.getByRole('button', { name: /Daily project summary/ }).waitFor(); },
+ async check(page, ui) {
+ const toggle = page.getByRole('switch', { name: 'Daily project summary', exact: true });
+ if (ui.case === 'history') {
+ await page.getByRole('button', { name: 'Daily project summary', exact: true }).click();
+ await page.getByText(await ui.t('routines.status.failed'), { exact: true }).waitFor();
+ await ui.capture('failed-run');
+ return;
+ }
+ await toggle.click();
+ if (ui.case === 'save-error') {
+ await page.getByRole('alert').waitFor();
+ assert.equal(await toggle.getAttribute('aria-checked'), 'true');
+ await ui.capture('save-failed');
+ await toggle.click();
+ }
+ await page.getByRole('switch', { name: 'Daily project summary', exact: true }).and(page.locator('[aria-checked="false"]')).waitFor();
+ assert.equal(await page.getByLabel(await ui.t('routines.instructions')).count(), 0);
+ await page.locator('details > summary').first().click();
+ await ui.capture('paused-expanded');
+ },
+};
diff --git a/apps/desktop/src/renderer/features/bots/BotAutonomySettings.tsx b/apps/desktop/src/renderer/features/bots/BotAutonomySettings.tsx
index a11d5ca5c3..62d9f4f930 100644
--- a/apps/desktop/src/renderer/features/bots/BotAutonomySettings.tsx
+++ b/apps/desktop/src/renderer/features/bots/BotAutonomySettings.tsx
@@ -94,7 +94,7 @@ export function BotAutonomySettings({
<div className="min-w-0 flex-1">
<p className={TITLE_CLASS}>{t('bots.autonomy.title')}</p>
<p className={HINT_CLASS} role="status">{status}</p>
- <p className={HINT_CLASS}>{t('bots.autonomy.consent')}</p>
+ <p className={HINT_CLASS}>{t('bots.autonomy.routineScopeHint')}</p>
{settings.isCustomized ? (
<Button
variant="secondary"
diff --git a/apps/desktop/src/renderer/features/bots/BotRoutines.tsx b/apps/desktop/src/renderer/features/bots/BotRoutines.tsx
index 01c9b6d1b2..289d608d2f 100644
--- a/apps/desktop/src/renderer/features/bots/BotRoutines.tsx
+++ b/apps/desktop/src/renderer/features/bots/BotRoutines.tsx
@@ -1,5 +1,5 @@
import { useCallback, useEffect, useRef, useState, type ReactNode } from 'react';
-import { Clock3, Check, ChevronRight, CircleAlert, Moon, Pause, Plus } from 'lucide-react';
+import { Clock3, Check, ChevronRight, CircleAlert, Pause, Plus } from 'lucide-react';
import { useTranslation } from 'react-i18next';
import { cronToHuman } from '@/features/scheduler/lib/cronToHuman';
import { configToCron, cronToConfig } from '@/features/scheduler/lib/cronCodexPreset';
@@ -214,10 +214,10 @@ export function BotRoutines({
if (trigger.kind === 'interval')
return t('routines.everyMinutes', { count: trigger.intervalMs / 60_000 });
if (trigger.kind === 'cron')
- return `${trigger.expression === '0 * * * *' ? t('routines.hourly') : cronToHuman(trigger.expression, t, i18n.language)} · ${trigger.timezone}`;
+ return `${cronToHuman(trigger.expression, t, i18n.language)} · ${trigger.timezone}`;
const source = sources.find((item) => item.id === trigger.sourceId);
const event = source?.events.find((item) => item.type === trigger.eventType);
- return `${source?.name ?? trigger.sourceId} · ${event?.name ?? trigger.eventType}`;
+ return t('routines.onEvent', { source: source?.name ?? trigger.sourceId, event: event?.name ?? trigger.eventType });
};
const running = history.some((run) => run.status === 'running' || run.status === 'queued');
if (nightlyOpen && !draft) {
@@ -308,29 +308,34 @@ export function BotRoutines({
}
/>
) : (
- <button
- key={routine.id}
- type="button"
- className="flex min-h-12 w-full items-start gap-3 rounded-lg px-3 py-3 text-left hover:bg-[var(--surface-hover)]"
- onClick={() => {
- setSelected(routine.id);
- setDraft(structuredClone(routine));
- }}
- >
- {routine.activity ? (
- <Spinner size={16} className="mt-1 shrink-0" />
- ) : routine.enabled ? (
- <Clock3 size={16} className="mt-1 shrink-0" />
- ) : (
- <Pause size={16} className="mt-1 shrink-0" />
- )}
- <span className="min-w-0">
- <span className="block truncate">{routine.name}</span>
- <span className="block truncate text-12 text-[var(--text-secondary)]">
- {routine.triggers.map(triggerSummary).join(' · ')}
- </span>
- </span>
- </button>
+ <div key={routine.id} className="border-b border-[var(--border-default)] py-4 last:border-b-0">
+ <div className="flex items-start gap-3">
+ <button
+ type="button"
+ className="min-h-6 min-w-0 flex-1 rounded-lg text-left outline-none hover:text-[var(--text-secondary)] focus-visible:ring-2 focus-visible:ring-[var(--focus-ring)]"
+ onClick={() => {
+ setSelected(routine.id);
+ setDraft(structuredClone(routine));
+ }}
+ >
+ <span className="flex items-start gap-2 text-13 font-medium leading-5">
+ <span className="min-w-0 break-words">{routine.name}</span>
+ <ChevronRight size={14} className="mt-1 shrink-0" aria-hidden="true" />
+ </span>
+ </button>
+ <Switch
+ aria-label={routine.name}
+ className="mt-0.5 shrink-0"
+ checked={routine.enabled}
+ disabled={busy}
+ onCheckedChange={(enabled) => void act(() =>
+ window.electronAPI.routines.save(botId, routineInput({ ...routine, enabled }), routine.id),
+ )}
+ />
+ </div>
+ <RoutineState routine={routine} />
+ <RoutineSchedule summaries={routine.triggers.map(triggerSummary)} />
+ </div>
))}
</div>
) : null}
@@ -573,7 +578,7 @@ export function BotRoutines({
<time dateTime={new Date(run.createdAt).toISOString()}>
{new Date(run.createdAt).toLocaleString(i18n.language)}
</time>
- <span aria-label={t(`routines.status.${run.status}`)}>
+ <span className={`inline-flex shrink-0 items-center gap-2 ${run.status === 'failed' || run.status === 'interrupted' ? 'text-[var(--text-danger)]' : 'text-[var(--text-secondary)]'}`}>
{run.status === 'running' || run.status === 'queued' ? (
<Spinner size={15} />
) : run.status === 'success' || run.status === 'skipped' ? (
@@ -583,11 +588,9 @@ export function BotRoutines({
) : (
<Pause size={15} />
)}
+ {t(`routines.status.${run.status}`)}
</span>
</summary>
- <p className="mt-2 text-[var(--text-secondary)]">
- {t(`routines.status.${run.status}`)}
- </p>
{run.resultText && (
<p className="whitespace-pre-wrap break-words text-[var(--text-secondary)]">
{run.resultText}
@@ -972,22 +975,13 @@ function BuiltinRoutineRow({
const copy = BUILTIN_COPY[routine.builtin ?? 'follow-up'];
const name = t(`${copy}.name`);
return (
- <div className="flex min-h-12 w-full items-start gap-3 rounded-lg px-3 py-3">
- {routine.activity ? (
- <Spinner size={16} className="mt-1 shrink-0" />
- ) : routine.enabled ? (
- routine.builtin === 'nightly-learning'
- ? <Moon size={16} className="mt-1 shrink-0" />
- : <Clock3 size={16} className="mt-1 shrink-0" />
- ) : (
- <Pause size={16} className="mt-1 shrink-0" />
- )}
- <span className="min-w-0 flex-1">
- <span className="block truncate">{name}</span>
- {/* 触发条件由宿主维护、条数多且来源重复,这里只写一句白话,不逐条列出。 */}
- <span className="block text-12 text-[var(--text-secondary)]">{hint ?? t(`${copy}.hint`)}</span>
+ <div className="flex w-full items-start gap-3 border-b border-[var(--border-default)] py-4 last:border-b-0">
+ <div className="min-w-0 flex-1">
+ <p className="break-words text-13 font-medium leading-5">{name}</p>
+ <RoutineState routine={routine} />
+ <p className="mt-1 text-12 leading-5 text-[var(--text-secondary)]">{hint ?? t(`${copy}.hint`)}</p>
{extra}
- </span>
+ </div>
<Switch
aria-label={name}
className="mt-0.5 shrink-0"
@@ -998,3 +992,30 @@ function BuiltinRoutineRow({
</div>
);
}
+
+/** Enabling a rule and a run being active are separate facts. */
+function RoutineState({ routine }: { routine: Routine }) {
+ const { t } = useTranslation();
+ return (
+ <p className="mt-1 flex flex-wrap items-center gap-x-2 text-12 leading-5 text-[var(--text-secondary)]">
+ <span>{t(routine.enabled ? 'routines.enabled' : 'routines.paused')}</span>
+ {routine.activity ? <span className="inline-flex items-center gap-1.5"><Spinner size={12} />{t(`routines.status.${routine.activity}`)}</span> : null}
+ </p>
+ );
+}
+
+function RoutineSchedule({ summaries }: { summaries: string[] }) {
+ const { t } = useTranslation();
+ if (!summaries.length) return <p className="mt-1 text-12 leading-5 text-[var(--text-secondary)]">{t('routines.noTriggers')}</p>;
+ if (summaries.length === 1 && summaries[0].length <= 90) {
+ return <p className="mt-1 break-words text-12 leading-5 text-[var(--text-secondary)]">{summaries[0]}</p>;
+ }
+ return (
+ <details className="mt-1 text-12 leading-5 text-[var(--text-secondary)]">
+ <summary className="min-h-6 cursor-pointer rounded-lg outline-none focus-visible:ring-2 focus-visible:ring-[var(--focus-ring)]">{t('routines.triggerDetails', { count: summaries.length })}</summary>
+ <ul className="mt-1 space-y-1">
+ {summaries.map((text, index) => <li key={index} className="break-words">{text}</li>)}
+ </ul>
+ </details>
+ );
+}
diff --git a/apps/desktop/src/renderer/features/bots/__tests__/botRoutines.test.tsx b/apps/desktop/src/renderer/features/bots/__tests__/botRoutines.test.tsx
index ecd0045068..790fd3787b 100644
--- a/apps/desktop/src/renderer/features/bots/__tests__/botRoutines.test.tsx
+++ b/apps/desktop/src/renderer/features/bots/__tests__/botRoutines.test.tsx
@@ -280,3 +280,23 @@ it('shows the host-owned follow-up as a pause-only built-in row that never opens
expect(api.remove).not.toHaveBeenCalled();
expect(screen.getByText('Daily report')).toBeTruthy();
});
+
+// Production list switches: previously only built-ins could pause without opening
+// the editor. Unit tier; the existing save test only covered the editor.
+it('pauses from the list, preserves configuration, and keeps the switch on after a failed save', async () => {
+ const api = setup();
+ render(<BotRoutines botId="bot" />);
+ const toggle = await screen.findByRole('switch', { name: 'Daily report' });
+ api.save.mockRejectedValueOnce(new Error('disk full'));
+ fireEvent.click(toggle);
+ await screen.findByRole('alert');
+ expect(toggle.getAttribute('aria-checked')).toBe('true');
+ fireEvent.click(toggle);
+ await waitFor(() => expect(toggle.getAttribute('aria-checked')).toBe('false'));
+ expect(screen.getByText('routines.paused')).toBeTruthy();
+ expect(screen.queryByLabelText('routines.instructions')).toBeNull();
+ expect(api.save).toHaveBeenLastCalledWith('bot', {
+ name: existing.name, prompt: existing.prompt, enabled: false, triggers: existing.triggers,
+ }, existing.id);
+ expect(api.runNow).not.toHaveBeenCalled();
+});
diff --git a/apps/desktop/src/renderer/features/scheduler/lib/__tests__/cronToHuman.test.ts b/apps/desktop/src/renderer/features/scheduler/lib/__tests__/cronToHuman.test.ts
index 05e9cd843a..2f166f4fb9 100644
--- a/apps/desktop/src/renderer/features/scheduler/lib/__tests__/cronToHuman.test.ts
+++ b/apps/desktop/src/renderer/features/scheduler/lib/__tests__/cronToHuman.test.ts
@@ -2,15 +2,11 @@ import { describe, expect, it } from 'vitest';
import { cronToHuman } from '../cronToHuman';
-const zh = (key: string, options: Record<string, unknown> = {}): string => {
- const messages: Record<string, string> = {
- 'scheduler.builtinTemplates.schedule.daily': `每天 ${options.time}`,
- 'scheduler.builtinTemplates.schedule.weekdays': `工作日 ${options.time}`,
- 'scheduler.builtinTemplates.schedule.weekly': `${options.weekday} ${options.time}`,
- 'scheduler.builtinTemplates.schedule.monthly': `每月 ${options.day} 日 ${options.time}`,
- };
- return messages[key] ?? key;
-};
+import i18next from 'i18next';
+import zhCN from '@/i18n/locales/zh-CN/common.json';
+const i18n = i18next.createInstance();
+void i18n.init({ lng: 'zh-CN', resources: { 'zh-CN': { translation: zhCN } }, initAsync: false });
+const zh = (key: string, options?: Record<string, unknown>) => String(i18n.t(key, options));
describe('cronToHuman', () => {
it('localizes the built-in template schedule shapes', () => {
@@ -20,7 +16,17 @@ describe('cronToHuman', () => {
expect(cronToHuman('0 10 1 * *', zh, 'zh-CN')).toBe('每月 1 日 10:00');
});
- it('keeps unsupported custom cron output readable', () => {
- expect(cronToHuman('0 9 * 1 *', zh, 'zh-CN')).toBe('At 09:00 in Jan');
+ it('localizes month-restricted schedules', () => {
+ expect(cronToHuman('0 9 * 1 *', zh, 'zh-CN')).toBe('1月 · 09:00');
+ });
+ // Regression: hourly lists fell back to English and elided the actual hours.
+ // Production formatter; prior tests only covered daily templates. Unit tier.
+ it.each([
+ ['5 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23 * * *', '每小时第 05 分'],
+ ['19 0,6,12,23 * * *', '00:19, 06:19, 12:19, 23:19'],
+ ['*/20 9-17 * * 1-5', '周一, 周二, 周三, 周四, 周五 · 9–17 时的第 0, 20, 40 分'],
+ ['0 9 1 * 1', '每月 1 日或每周 周一 · 09:00'],
+ ])('retains every time and the engine day-OR semantics: %s', (cron, expected) => {
+ expect(cronToHuman(cron, zh, 'zh-CN')).toBe(expected);
});
});
diff --git a/apps/desktop/src/renderer/features/scheduler/lib/cronToHuman.ts b/apps/desktop/src/renderer/features/scheduler/lib/cronToHuman.ts
index fc560c3462..567453336d 100644
--- a/apps/desktop/src/renderer/features/scheduler/lib/cronToHuman.ts
+++ b/apps/desktop/src/renderer/features/scheduler/lib/cronToHuman.ts
@@ -1,36 +1,62 @@
-/** Localized schedule labels for the template gallery. */
-
-import { cronToHuman as cronToHumanEN } from '@cindy/maker-scheduler/cron';
-import { cronToConfig } from './cronCodexPreset';
+/** Localized, lossless schedule labels. Parsing uses the same rules as execution. */
+import { parseCron } from '@cindy/maker-scheduler/cron';
type Translate = (key: string, options?: Record<string, unknown>) => string;
export function cronToHuman(expr: string, t: Translate, locale: string): string {
- const config = cronToConfig(expr);
- const time = `${pad(config.hour)}:${pad(config.minute)}`;
+ let cron: ReturnType<typeof parseCron>;
+ try {
+ cron = parseCron(expr);
+ } catch {
+ return expr;
+ }
+ const label = (key: string, values?: Record<string, unknown>) =>
+ t(`scheduler.builtinTemplates.schedule.${key}`, values);
+ const { minute, hour, dayOfMonth, month, dayOfWeek } = cron;
+ let time: string;
+ if (hour.length === 24) {
+ time = minute.length === 60
+ ? label('everyMinute')
+ : label('hourlyAt', { minutes: minute.map(pad).join(', ') });
+ } else if (minute.length === 1) {
+ time = label('atTimes', { times: hour.map((h) => `${pad(h)}:${pad(minute[0])}`).join(', ') });
+ } else {
+ time = label('atHoursMinutes', { hours: numbers(hour), minutes: numbers(minute) });
+ }
+ const weekday = dayOfWeek.map((day) => formatWeekday(day, locale)).join(', ');
+ const dates = label('monthDays', { days: numbers(dayOfMonth) });
+ const days = cron.domRestricted && cron.dowRestricted
+ ? label('daysOrWeekdays', { days: dates, weekdays: weekday })
+ : cron.domRestricted ? dates : cron.dowRestricted ? weekday : '';
+ // Keep familiar compact labels for common templates.
+ if (hour.length === 1 && minute.length === 1 && month.length === 12) {
+ const clock = `${pad(hour[0])}:${pad(minute[0])}`;
+ if (!cron.domRestricted && !cron.dowRestricted) return label('daily', { time: clock });
+ if (!cron.domRestricted && dayOfWeek.join(',') === '1,2,3,4,5') return label('weekdays', { time: clock });
+ if (!cron.domRestricted && dayOfWeek.length === 1) return label('weekly', { time: clock, weekday });
+ if (!cron.dowRestricted && dayOfMonth.length === 1) return label('monthly', { time: clock, day: dayOfMonth[0] });
+ }
+ const months = month.length === 12 ? '' : label('inMonths', {
+ months: month.map((m) => new Intl.DateTimeFormat(locale, { month: 'short', timeZone: 'UTC' })
+ .format(new Date(Date.UTC(2024, m - 1, 1)))).join(', '),
+ });
+ return [months, days, time].filter(Boolean).join(' · ');
+}
- switch (config.mode) {
- case 'daily':
- return t('scheduler.builtinTemplates.schedule.daily', { time });
- case 'weekdays':
- return t('scheduler.builtinTemplates.schedule.weekdays', { time });
- case 'weekly':
- return t('scheduler.builtinTemplates.schedule.weekly', {
- time,
- weekday: formatWeekday(config.weekday, locale),
- });
- case 'monthly':
- return t('scheduler.builtinTemplates.schedule.monthly', { time, day: config.monthDay });
- default:
- return cronToHumanEN(expr);
+/** Compress only consecutive values, never elide a scheduled hour or minute. */
+function numbers(values: readonly number[]): string {
+ const ranges: string[] = [];
+ for (let i = 0; i < values.length; i++) {
+ const start = values[i];
+ while (i + 1 < values.length && values[i + 1] === values[i] + 1) i++;
+ ranges.push(start === values[i] ? String(start) : `${start}–${values[i]}`);
}
+ return ranges.join(', ');
}
function formatWeekday(weekday: number, locale: string): string {
- const sunday = new Date(Date.UTC(2024, 0, 7 + weekday));
- return new Intl.DateTimeFormat(locale, { weekday: 'short', timeZone: 'UTC' }).format(sunday);
+ return new Intl.DateTimeFormat(locale, { weekday: 'short', timeZone: 'UTC' })
+ .format(new Date(Date.UTC(2024, 0, 7 + weekday)));
}
-function pad(value: number): string {
- return String(value).padStart(2, '0');
-}
+function pad(value: number): string { return String(value).padStart(2, '0'); }
diff --git a/apps/desktop/src/renderer/i18n/locales/en/common.json b/apps/desktop/src/renderer/i18n/locales/en/common.json
index 1bc434871e..eb03ab5c97 100644
--- a/apps/desktop/src/renderer/i18n/locales/en/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/en/common.json
@@ -9137,6 +9137,7 @@
"descriptionOn": "{{name}} checks summaries when sessions change and keeps you informed.",
"movedFrom": "Moved here from {{name}}",
"heldBy": "{{name}} handles this now. Switch it on to move it here.",
+ "routineScopeHint": "Include sessions you create yourself. The built-in follow-up below responds to changes in assigned sessions.",
"heldByNobody": "Not enabled",
"restoreDefault": "Restore Default ({{name}})",
"saveFailed": "Couldn't save. Try again.",
@@ -14049,6 +14050,13 @@
},
"builtinTemplates": {
"schedule": {
+ "everyMinute": "Every minute",
+ "hourlyAt": "Hourly at minute {{minutes}}",
+ "atTimes": "At {{times}}",
+ "atHoursMinutes": "Hours {{hours}}, minutes {{minutes}}",
+ "monthDays": "Days {{days}} of the month",
+ "daysOrWeekdays": "{{days}} or {{weekdays}}",
+ "inMonths": "In {{months}}",
"daily": "Daily at {{time}}",
"weekdays": "Weekdays at {{time}}",
"weekly": "{{weekday}} at {{time}}",
@@ -16121,6 +16129,9 @@
"compression": "For condensing lengthy content."
},
"routines": {
+ "onEvent": "Event: {{source}} · {{event}}",
+ "triggerDetails": "View triggers ({{count}}; any can start a run)",
+ "noTriggers": "No triggers set",
"unsavedTitle": "Unsaved Changes",
"unsavedDescription": "Leaving will discard these changes to the routine.",
"discard": "Discard Changes",
@@ -16192,8 +16203,8 @@
"timeoutMs": "Check timeout (ms, blank for no limit)",
"advancedSettings": "Advanced settings",
"builtinFollowUp": {
- "name": "Follow-up (built-in)",
- "hint": "Wakes it when a session is stuck, waiting for you, errors out, hits the usage limit, or finishes. Built in, so it can only be paused or resumed."
+ "name": "Follow assigned sessions (built-in)",
+ "hint": "Follow assigned sessions when they stall, need you, fail, reach a usage limit or finish."
},
"builtinTodoCheck": {
"name": "Daily todo check (built-in)",
diff --git a/apps/desktop/src/renderer/i18n/locales/ja/common.json b/apps/desktop/src/renderer/i18n/locales/ja/common.json
index 48222ea6ca..a53ff7f519 100644
--- a/apps/desktop/src/renderer/i18n/locales/ja/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/ja/common.json
@@ -9103,6 +9103,7 @@
"descriptionOn": "{{name}}がセッションの変化に応じて要約を確認し、お知らせします。",
"movedFrom": "{{name}}からここに移しました",
"heldBy": "現在は{{name}}が担当しています。オンにするとここに移ります。",
+ "routineScopeHint": "あなたが作成したセッションも担当します。下の標準フォローが、担当セッションの変化に対応します。",
"heldByNobody": "未設定",
"restoreDefault": "デフォルトに戻す({{name}})",
"saveFailed": "保存できませんでした。もう一度お試しください",
@@ -14001,6 +14002,13 @@
},
"builtinTemplates": {
"schedule": {
+ "everyMinute": "毎分",
+ "hourlyAt": "毎時 {{minutes}} 分",
+ "atTimes": "{{times}}",
+ "atHoursMinutes": "{{hours}} 時の {{minutes}} 分",
+ "monthDays": "毎月 {{days}} 日",
+ "daysOrWeekdays": "{{days}} または毎週 {{weekdays}}",
+ "inMonths": "{{months}}",
"daily": "毎日 {{time}}",
"weekdays": "平日 {{time}}",
"weekly": "{{weekday}} {{time}}",
@@ -16071,6 +16079,9 @@
"compression": "長い内容を短くまとめるために。"
},
"routines": {
+ "onEvent": "イベント:{{source}} · {{event}}",
+ "triggerDetails": "実行条件を表示({{count}} 件・いずれかで実行)",
+ "noTriggers": "実行条件は未設定",
"unsavedTitle": "未保存の変更があります",
"unsavedDescription": "戻ると、このルーチンへの変更が破棄されます。",
"discard": "変更を破棄",
@@ -16142,8 +16153,8 @@
"timeoutMs": "確認のタイムアウト(ミリ秒、空欄は無制限)",
"advancedSettings": "詳細設定",
"builtinFollowUp": {
- "name": "フォロー(組み込み)",
- "hint": "セッションが止まったとき、返信待ちになったとき、エラーになったとき、使用量の上限に達したとき、完了したときに起こします。組み込みのため、一時停止と再開のみできます。"
+ "name": "担当セッションのフォロー(標準)",
+ "hint": "担当セッションの停滞、返答待ち、エラー、利用上限、完了を受けてフォローします。"
},
"builtinTodoCheck": {
"name": "毎日の Todo 確認(組み込み)",
diff --git a/apps/desktop/src/renderer/i18n/locales/ko/common.json b/apps/desktop/src/renderer/i18n/locales/ko/common.json
index 72ef531752..b926f5632e 100644
--- a/apps/desktop/src/renderer/i18n/locales/ko/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/ko/common.json
@@ -9103,6 +9103,7 @@
"descriptionOn": "{{name}} 님이 세션에 변화가 생기면 요약을 확인하고 알려드립니다.",
"movedFrom": "{{name}}에서 여기로 옮겼습니다",
"heldBy": "지금은 {{name}}이(가) 맡고 있습니다. 켜면 여기로 옮겨집니다.",
+ "routineScopeHint": "직접 만든 세션도 맡깁니다. 아래 기본 후속 확인이 담당 세션의 변화에 대응합니다.",
"heldByNobody": "꺼짐",
"restoreDefault": "기본값으로 복원({{name}})",
"saveFailed": "저장하지 못했습니다. 다시 시도하세요",
@@ -14001,6 +14002,13 @@
},
"builtinTemplates": {
"schedule": {
+ "everyMinute": "매분",
+ "hourlyAt": "매시 {{minutes}}분",
+ "atTimes": "{{times}}",
+ "atHoursMinutes": "{{hours}}시 {{minutes}}분",
+ "monthDays": "매월 {{days}}일",
+ "daysOrWeekdays": "{{days}} 또는 매주 {{weekdays}}",
+ "inMonths": "{{months}}",
"daily": "매일 {{time}}",
"weekdays": "평일 {{time}}",
"weekly": "{{weekday}} {{time}}",
@@ -16071,6 +16079,9 @@
"compression": "긴 내용을 간결하게 줄입니다."
},
"routines": {
+ "onEvent": "이벤트: {{source}} · {{event}}",
+ "triggerDetails": "실행 조건 보기 ({{count}}개 중 하나 충족 시 실행)",
+ "noTriggers": "설정된 실행 조건 없음",
"unsavedTitle": "저장하지 않은 변경 사항",
"unsavedDescription": "돌아가면 이 루틴의 변경 사항이 삭제됩니다.",
"discard": "변경 사항 버리기",
@@ -16142,8 +16153,8 @@
"timeoutMs": "확인 제한 시간(ms, 비우면 제한 없음)",
"advancedSettings": "고급 설정",
"builtinFollowUp": {
- "name": "후속 관리(기본 제공)",
- "hint": "세션이 멈추거나, 응답을 기다리거나, 오류가 나거나, 사용량 한도에 도달하거나, 끝나면 깨웁니다. 기본 제공 루틴이라 일시 중지와 재개만 할 수 있습니다."
+ "name": "담당 세션 후속 확인 (기본)",
+ "hint": "담당 세션이 멈추거나 응답을 기다릴 때, 오류·사용량 한도·완료 시 후속 확인합니다."
},
"builtinTodoCheck": {
"name": "매일 할 일 확인(기본 제공)",
diff --git a/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json b/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json
index 793d1ea4ca..215d56cdcb 100644
--- a/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json
@@ -9103,6 +9103,7 @@
"descriptionOn": "{{name}}会在任务有变化时查看摘要并提醒你。",
"movedFrom": "已从{{name}}移到这里",
"heldBy": "现在由{{name}}负责,打开就移到这里。",
+ "routineScopeHint": "把你自己创建的任务也交给我跟进;下方内置跟进负责响应这些任务的变化。",
"heldByNobody": "尚未开启",
"restoreDefault": "恢复默认({{name}})",
"saveFailed": "没能保存,请重试",
@@ -14001,6 +14002,13 @@
},
"builtinTemplates": {
"schedule": {
+ "everyMinute": "每分钟",
+ "hourlyAt": "每小时第 {{minutes}} 分",
+ "atTimes": "{{times}}",
+ "atHoursMinutes": "{{hours}} 时的第 {{minutes}} 分",
+ "monthDays": "每月 {{days}} 日",
+ "daysOrWeekdays": "{{days}}或每周 {{weekdays}}",
+ "inMonths": "{{months}}",
"daily": "每天 {{time}}",
"weekdays": "工作日 {{time}}",
"weekly": "{{weekday}} {{time}}",
@@ -16071,6 +16079,9 @@
"compression": "用于精简冗长内容。"
},
"routines": {
+ "onEvent": "事件:{{source}} · {{event}}",
+ "triggerDetails": "查看触发条件({{count}} 项,满足任一项即运行)",
+ "noTriggers": "尚未设置触发条件",
"unsavedTitle": "尚有未保存的修改",
"unsavedDescription": "离开后会丢弃这次对例行任务的修改。",
"discard": "放弃修改",
@@ -16142,8 +16153,8 @@
"timeoutMs": "检查超时(毫秒,留空不限时)",
"advancedSettings": "高级设置",
"builtinFollowUp": {
- "name": "跟进(内置)",
- "hint": "任务卡住、等你、出错、撞上用量上限或做完时叫醒它;内置,只能暂停或恢复。"
+ "name": "跟进已接手的任务(内置)",
+ "hint": "任务卡住、等你、出错、达到用量上限或完成时跟进。只处理已交给我的任务。"
},
"builtinTodoCheck": {
"name": "每天查待办(内置)",
diff --git a/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json b/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json
index 5ca5557bd5..0e823f9a27 100644
--- a/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json
@@ -9103,6 +9103,7 @@
"descriptionOn": "{{name}}會在任務有變化時查看摘要並提醒你。",
"movedFrom": "已從{{name}}移到這裡",
"heldBy": "現在由{{name}}負責,打開就移到這裡。",
+ "routineScopeHint": "把你自己建立的任務也交給我跟進;下方內建跟進負責回應這些任務的變化。",
"heldByNobody": "尚未開啟",
"restoreDefault": "恢復預設({{name}})",
"saveFailed": "沒能儲存,請重試",
@@ -14001,6 +14002,13 @@
},
"builtinTemplates": {
"schedule": {
+ "everyMinute": "每分鐘",
+ "hourlyAt": "每小時第 {{minutes}} 分",
+ "atTimes": "{{times}}",
+ "atHoursMinutes": "{{hours}} 時的第 {{minutes}} 分",
+ "monthDays": "每月 {{days}} 日",
+ "daysOrWeekdays": "{{days}}或每週 {{weekdays}}",
+ "inMonths": "{{months}}",
"daily": "每天 {{time}}",
"weekdays": "工作日 {{time}}",
"weekly": "{{weekday}} {{time}}",
@@ -16071,6 +16079,9 @@
"compression": "用於精簡冗長內容。"
},
"routines": {
+ "onEvent": "事件:{{source}} · {{event}}",
+ "triggerDetails": "查看觸發條件({{count}} 項,符合任一項即執行)",
+ "noTriggers": "尚未設定觸發條件",
"unsavedTitle": "尚有未儲存的修改",
"unsavedDescription": "離開後會捨棄這次對例行任務的修改。",
"discard": "放棄修改",
@@ -16142,8 +16153,8 @@
"timeoutMs": "檢查逾時(毫秒,留空不限時)",
"advancedSettings": "進階設定",
"builtinFollowUp": {
- "name": "跟進(內建)",
- "hint": "任務卡住、等你、出錯、撞上用量上限或做完時叫醒它;內建,只能暫停或恢復。"
+ "name": "跟進已接手的任務(內建)",
+ "hint": "任務卡住、等你、出錯、達到用量上限或完成時跟進。只處理已交給我的任務。"
},
"builtinTodoCheck": {
"name": "每天查待辦(內建)",
diff --git a/docs/product-rules/bot-routines.md b/docs/product-rules/bot-routines.md
index 275587a297..eba58adac4 100644
--- a/docs/product-rules/bot-routines.md
+++ b/docs/product-rules/bot-routines.md
@@ -6,7 +6,11 @@
一条例行任务属于一个伙伴,包含名称、常驻指令、启用状态和多个触发条件。条件之间是 OR:同一事件命中多个条件只入队一次。时间条件与事件条件可以共存,适合「PR 更新时检查,每小时兜底」。条件编辑不授予模型额外权限。
-桌面入口在伙伴任务头部,打开标准右侧栏。列表进入详情后可修改指令、启停、立即运行、增删触发条件、删除规则和查看历史。立即运行先保存当前编辑,再运行,避免执行屏幕上看不到的旧指令。定时菜单提供每小时、每天、工作日、每周、每月、间隔和高级 Cron,保留 IANA 时区。事件菜单来自实际插件声明,不显示未接入平台的假入口。
+桌面入口在伙伴设置「例行任务」及伙伴任务的标准右侧栏。列表里的普通规则和内置规则都用右侧开关直接启停,文字明确显示启用/暂停,排队/运行中单独显示,不以时钟或暂停图标代替状态。点普通规则名称进入详情,仍可修改指令、立即运行、增删触发条件、删除规则和查看历史;历史的失败/中断结果在展开前可读。立即运行先保存当前编辑,再运行,避免执行屏幕上看不到的旧指令。
+
+时间描述跟随界面语言,复用调度器的 Cron 解析规则,保留全部小时、分钟、日期与 IANA 时区;复杂条件可展开,多个条件明确为满足任一项即运行。不依据前端时钟推测下次执行,也不把配置更新时间当作最近结果。定时菜单提供每小时、每天、工作日、每周、每月、间隔和高级 Cron。事件菜单来自实际插件声明,不显示未接入平台的假入口。
+
+顶部「跟进我的任务」控制是否把主人创建的本机任务也交给当前伙伴;下方「跟进已接手的任务(内置)」响应已归属它的任务事件。两项独立,不合并开关;开启顶部设置仍保留读取范围与模型用量的确认。列表启停不修改指令、频率、通知或静默配置。
手机端不提供例行任务管理(唯一例外是伙伴近况里「每天帮我查一次」开关,见下文「内置查待办例行任务」):移除「所有任务」下拉菜单的 `routines`、伙伴资料页的自动化入口和旧的独立自动化管理页,旧管理链接返回设备页。具体界面边界与[伙伴运行时合同](./cindy-bots-runtime.md)一致;下文例行任务管理及高级设置均适用于桌面端。移除手机入口不删除已有规则、任务数据或运行历史,不改变桌面执行服务、Remote Resources 协议或 Mobile 原生依赖。执行仍发生在电脑,没有宣称云端补投能力。