fix(schedule): route daily set-remind phrases through ITL with recurrence
Memind CI / Test, build, and release guards (push) Failing after 3m4s
Memind CI / Test, build, and release guards (push) Failing after 3m4s
Support colloquial forms like「设置每天18:00提醒打卡」, persist daily metadata on commit, and schedule the next reminder after each delivery. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+10
-1
@@ -85,7 +85,13 @@ function countTimeExpressions(text) {
|
||||
}
|
||||
|
||||
function wantsSimpleTimedReminder(compact, text) {
|
||||
if (!/(?:提醒我|设置(?:一个|个)?提醒|设(?:一个|个)?提醒|到点提醒|提醒一下|闹钟|叫我)/u.test(compact)) return false;
|
||||
const hasReminderCue =
|
||||
/(?:提醒我|到点提醒|提醒一下|闹钟|叫我)/u.test(compact)
|
||||
|| /(?:设置|设).{0,40}提醒/u.test(compact);
|
||||
if (!hasReminderCue) return false;
|
||||
if (/(?:生成|制作|创建|做|执行|推送|发送|整理).{0,12}(?:页面|日报|报告|摘要)/u.test(compact)) {
|
||||
return false;
|
||||
}
|
||||
if (countTimeExpressions(text) !== 1) return false;
|
||||
if (/[0-9零一二两三四五六七八九十]{1,3}(?:点|:|:).{1,24}[0-9零一二两三四五六七八九十]{1,3}(?:点|:|:)/u.test(compact)) {
|
||||
return false;
|
||||
@@ -110,7 +116,9 @@ function cleanupTimedReminderTitleFragment(text) {
|
||||
.replace(/^(?:帮我|请|麻烦)?(?:设置|设|创建|添加)(?:一个|个)?提醒[,,、::\s]*/u, '')
|
||||
.replace(/^(?:帮我|请)?(?:设置|设)(?:一个|个)?(?:待办|代办|带办|代拜)[,,、::\s]*/u, '');
|
||||
title = title
|
||||
.replace(/^(?:帮我|请|麻烦)?(?:设置|设)(?:一个|个)?(?:每天|每日|天天)?/u, '')
|
||||
.replace(/(?:今天|今日|今晚|明天|后天|明早|今早)/gu, ' ')
|
||||
.replace(/(?:每天|每日|天天)/gu, ' ')
|
||||
.replace(/(?:早上|上午|清晨|中午|下午|傍晚|晚上|凌晨)/gu, ' ')
|
||||
.replace(
|
||||
/[0-9零一二两三四五六七八九十]{1,3}(?:点|:|:)(?:半|[0-9]{1,2}(?:\s*分(?!开)|(?![0-9]))?)?/gu,
|
||||
@@ -211,6 +219,7 @@ function parseSimpleTimedReminder(text, { timezone = 'Asia/Shanghai', now = Date
|
||||
}),
|
||||
hour: time.hour,
|
||||
minute: time.minute,
|
||||
recurrence: /(?:每天|每日|天天)/u.test(compact) ? 'daily' : 'once',
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user