feat(wechat): add Intent Transaction Layer with unified task schema
Introduce Draft → Confirm → Commit flow for WeChat schedule intents behind feature flags, plus h5_tasks dual-write/read aggregation and rollout scripts so reminders and automations get explicit user confirmation before persisting. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -105,6 +105,23 @@ test('meta scheduled-task phrases require task_spec clarification', () => {
|
||||
}
|
||||
});
|
||||
|
||||
test('parse cancel daily news task as manage action', () => {
|
||||
const intent = parseScheduledTaskIntent('取消每日新闻任务');
|
||||
assert.equal(intent.action, 'cancel_scheduled_task');
|
||||
});
|
||||
|
||||
test('parse daily external send automation', () => {
|
||||
const intent = parseScheduledTaskIntent('每天自动给客户发送报价单');
|
||||
assert.equal(intent.action, 'create_scheduled_task');
|
||||
assert.match(intent.taskSpec ?? '', /报价/u);
|
||||
});
|
||||
|
||||
test('parse daily monitoring automation', () => {
|
||||
const intent = parseScheduledTaskIntent('帮我每天看看有没有新的招聘信息');
|
||||
assert.equal(intent.action, 'create_scheduled_task');
|
||||
assert.match(intent.taskSpec ?? '', /招聘/u);
|
||||
});
|
||||
|
||||
test('combined phrase keeps substantive taskSpec after time prefix', () => {
|
||||
const text = '帮我创建一个定时执行任务,23:00执行,搜索今日新闻';
|
||||
const intent = parseScheduledTaskIntent(text);
|
||||
|
||||
Reference in New Issue
Block a user