foliko 1.0.13 → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/plugins/scheduler-plugin.js +20 -3
package/package.json
CHANGED
|
@@ -277,7 +277,9 @@ class SchedulerPlugin extends Plugin {
|
|
|
277
277
|
nextRun: t.nextRun || t.runAt,
|
|
278
278
|
runCount: t.runCount,
|
|
279
279
|
lastRun: t.lastRun,
|
|
280
|
-
cronExpression: t.cronExpression
|
|
280
|
+
cronExpression: t.cronExpression,
|
|
281
|
+
llm: t.llm,
|
|
282
|
+
sessionId: t.sessionId
|
|
281
283
|
}))
|
|
282
284
|
|
|
283
285
|
return {
|
|
@@ -412,11 +414,26 @@ class SchedulerPlugin extends Plugin {
|
|
|
412
414
|
|
|
413
415
|
this._taskStats.completed++
|
|
414
416
|
|
|
417
|
+
// 获取 LLM 返回的消息
|
|
418
|
+
let responseText = ''
|
|
415
419
|
if (result && result.message) {
|
|
416
|
-
|
|
420
|
+
responseText = result.message
|
|
417
421
|
} else if (result && result.text) {
|
|
418
|
-
|
|
422
|
+
responseText = result.text
|
|
419
423
|
}
|
|
424
|
+
|
|
425
|
+
if (responseText) {
|
|
426
|
+
console.log(`\n🔔 [定时提醒] ${responseText}\n`)
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
// 发送事件,让其他插件(如 telegram)发送提醒
|
|
430
|
+
this._framework.emit('scheduler:reminder', {
|
|
431
|
+
taskId: task.id,
|
|
432
|
+
taskName: task.name,
|
|
433
|
+
message: responseText || task.message,
|
|
434
|
+
sessionId: task.sessionId,
|
|
435
|
+
llm: true
|
|
436
|
+
})
|
|
420
437
|
} else {
|
|
421
438
|
// 直接显示模式:只显示提醒,不发 LLM
|
|
422
439
|
console.log(`\n🔔 [定时提醒] ${task.message}\n`)
|