@yoooclaw/phone-notifications 1.12.0 → 1.12.2
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/README.md +212 -29
- package/dist/bin/ntf.cjs +918 -113
- package/dist/bin/ntf.cjs.map +15 -10
- package/dist/cli/helpers.d.ts +27 -0
- package/dist/cli/helpers.d.ts.map +1 -1
- package/dist/cli/image-list.d.ts +3 -0
- package/dist/cli/image-list.d.ts.map +1 -0
- package/dist/cli/image-path.d.ts +3 -0
- package/dist/cli/image-path.d.ts.map +1 -0
- package/dist/cli/image-status.d.ts +3 -0
- package/dist/cli/image-status.d.ts.map +1 -0
- package/dist/cli/image-storage-path.d.ts +3 -0
- package/dist/cli/image-storage-path.d.ts.map +1 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/ntf-query.d.ts +11 -0
- package/dist/cli/ntf-query.d.ts.map +1 -1
- package/dist/cli/ntf-summary-job.d.ts +3 -0
- package/dist/cli/ntf-summary-job.d.ts.map +1 -0
- package/dist/cli/ntf-summary.d.ts.map +1 -1
- package/dist/cli/ntf-sync.d.ts.map +1 -1
- package/dist/env.d.ts +3 -0
- package/dist/env.d.ts.map +1 -1
- package/dist/image/handler.d.ts +19 -0
- package/dist/image/handler.d.ts.map +1 -0
- package/dist/image/index.d.ts +3 -0
- package/dist/image/index.d.ts.map +1 -0
- package/dist/image/store.d.ts +76 -0
- package/dist/image/store.d.ts.map +1 -0
- package/dist/index.cjs +9089 -7137
- package/dist/index.cjs.map +40 -35
- package/dist/index.d.ts.map +1 -1
- package/dist/light-rules/client.d.ts +58 -0
- package/dist/light-rules/client.d.ts.map +1 -0
- package/dist/light-rules/gateway.d.ts.map +1 -1
- package/dist/light-rules/types.d.ts +13 -8
- package/dist/light-rules/types.d.ts.map +1 -1
- package/dist/notification/storage.d.ts +1 -0
- package/dist/notification/storage.d.ts.map +1 -1
- package/dist/notification/summary.d.ts +144 -0
- package/dist/notification/summary.d.ts.map +1 -0
- package/dist/plugin/images.d.ts +16 -0
- package/dist/plugin/images.d.ts.map +1 -0
- package/dist/plugin/lifecycle.d.ts +2 -0
- package/dist/plugin/lifecycle.d.ts.map +1 -1
- package/dist/plugin/light-rules-tools.d.ts +2 -2
- package/dist/plugin/light-rules-tools.d.ts.map +1 -1
- package/dist/plugin/notifications.d.ts +5 -3
- package/dist/plugin/notifications.d.ts.map +1 -1
- package/dist/plugin/recordings.d.ts.map +1 -1
- package/dist/recording/handler.d.ts +1 -0
- package/dist/recording/handler.d.ts.map +1 -1
- package/dist/recording/index.d.ts +1 -0
- package/dist/recording/index.d.ts.map +1 -1
- package/dist/recording/result-writer.d.ts +9 -0
- package/dist/recording/result-writer.d.ts.map +1 -0
- package/dist/recording/storage.d.ts +2 -0
- package/dist/recording/storage.d.ts.map +1 -1
- package/dist/recording/transcript-document.d.ts +1 -0
- package/dist/recording/transcript-document.d.ts.map +1 -1
- package/dist/tunnel/frame-slimmer.d.ts +37 -0
- package/dist/tunnel/frame-slimmer.d.ts.map +1 -0
- package/dist/tunnel/proxy.d.ts.map +1 -1
- package/dist/types.d.ts +120 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/update/checker.d.ts +2 -1
- package/dist/update/checker.d.ts.map +1 -1
- package/dist/update/index.d.ts.map +1 -1
- package/openclaw.plugin.json +13 -1
- package/package.json +3 -2
- package/skills/notification-monitor/SKILL.md +14 -13
- package/skills/notification-query/SKILL.md +101 -7
- package/skills/notification-to-memory/SKILL.md +57 -22
- package/skills/notification-to-memory/references/step-0-preflight.md +0 -40
- package/skills/notification-to-memory/references/step-1-scan-pending.md +0 -137
- package/skills/notification-to-memory/references/step-2-process-dates.md +0 -98
- package/skills/notification-to-memory/references/step-3-check-cron-status.md +0 -38
- package/skills/notification-to-memory/references/step-4-final-reporting.md +0 -57
- package/skills/notification-to-memory/scripts/select-memory-prompt.sh +0 -18
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
# Step 1:扫描未处理通知
|
|
2
|
-
|
|
3
|
-
## 通知数据存储说明
|
|
4
|
-
|
|
5
|
-
### 路径说明
|
|
6
|
-
|
|
7
|
-
不要假设通知目录固定。先执行:
|
|
8
|
-
|
|
9
|
-
Exec 调用规则:等待 `ntf` 命令输出时使用 `yieldMs: 60000`;不要用 `timeout` 作为等待时间。`timeout` 是按秒计算的杀进程上限,默认 1800 秒,除非明确需要终止长时间运行的命令,否则不要写。
|
|
10
|
-
|
|
11
|
-
```text
|
|
12
|
-
Use exec with:
|
|
13
|
-
command: ntf storage-path
|
|
14
|
-
yieldMs: 60000
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
返回示例:
|
|
18
|
-
|
|
19
|
-
```json
|
|
20
|
-
{
|
|
21
|
-
"ok": true,
|
|
22
|
-
"path": "/absolute/path/to/notifications"
|
|
23
|
-
}
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
后续所有通知文件、`.ids/`、`.checkpoint.json` 的位置都以这个 `path` 为准。
|
|
27
|
-
|
|
28
|
-
### 目录结构
|
|
29
|
-
|
|
30
|
-
按日期文件存储,每个 JSON 文件包含当天所有通知:
|
|
31
|
-
|
|
32
|
-
```
|
|
33
|
-
<storage-path>/
|
|
34
|
-
├── 2026-03-02.json # 2026-03-02 当天的所有通知
|
|
35
|
-
├── 2026-03-03.json # 2026-03-03 当天的所有通知
|
|
36
|
-
├── 2026-03-04.json # 2026-03-04 当天的所有通知
|
|
37
|
-
├── .ids/ # 去重索引目录(插件内部使用)
|
|
38
|
-
│ └── ...
|
|
39
|
-
└── .checkpoint.json # 消费进度(本 Skill 使用)
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
### 文件格式
|
|
43
|
-
|
|
44
|
-
每个文件为 JSON 数组,按时间顺序追加(append-only,写入后不可修改):
|
|
45
|
-
|
|
46
|
-
```json
|
|
47
|
-
[
|
|
48
|
-
{
|
|
49
|
-
"appName": "wechat",
|
|
50
|
-
"title": "张三",
|
|
51
|
-
"content": "周末去爬山吗?",
|
|
52
|
-
"timestamp": "2026-03-02T08:30:00+08:00"
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
"appName": "dingtalk",
|
|
56
|
-
"title": "工作群",
|
|
57
|
-
"content": "下午3点有评审会",
|
|
58
|
-
"timestamp": "2026-03-02T09:15:00+08:00"
|
|
59
|
-
}
|
|
60
|
-
]
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
先执行 `ntf storage-path` 确认目录可用,再根据 Step 0 记录的范围选择唯一对应的 CLI 命令扫描未处理条目。
|
|
64
|
-
|
|
65
|
-
范围为“今天”或用户没有说明范围时,必须先通过本机命令获取当前本地日期,再把日期显式传给 `scan`:
|
|
66
|
-
|
|
67
|
-
```text
|
|
68
|
-
Use exec with:
|
|
69
|
-
command: date +%F
|
|
70
|
-
yieldMs: 60000
|
|
71
|
-
|
|
72
|
-
Then use exec with:
|
|
73
|
-
command: ntf sync scan --date <date returned by date +%F>
|
|
74
|
-
yieldMs: 60000
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
范围为用户明确指定的某一天时:
|
|
78
|
-
|
|
79
|
-
```text
|
|
80
|
-
Use exec with:
|
|
81
|
-
command: ntf sync scan --date 2026-03-09
|
|
82
|
-
yieldMs: 60000
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
范围为用户明确指定的日期范围,或“最近 N 天/近 N 天”时,先按 Step 0 计算起止日期,再执行:
|
|
86
|
-
|
|
87
|
-
```text
|
|
88
|
-
Use exec with:
|
|
89
|
-
command: ntf sync scan --from-date 2026-03-02 --to-date 2026-03-09
|
|
90
|
-
yieldMs: 60000
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
只有范围明确为“上次同步后/全部未处理/补全历史/所有日期”时,才允许执行:
|
|
94
|
-
|
|
95
|
-
```text
|
|
96
|
-
Use exec with:
|
|
97
|
-
command: ntf sync scan --all
|
|
98
|
-
yieldMs: 60000
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
禁止在“今天”、未说明范围、指定日期、指定日期范围或“最近 N 天/近 N 天”的场景使用 `--all`。裸命令 `ntf sync scan` 的 CLI 兜底行为也是只扫描本地当天,但执行本 Skill 时仍应显式传入 Step 0 计算出的范围。
|
|
102
|
-
|
|
103
|
-
返回示例:
|
|
104
|
-
|
|
105
|
-
```json
|
|
106
|
-
{
|
|
107
|
-
"ok": true,
|
|
108
|
-
"scope": {
|
|
109
|
-
"mode": "date",
|
|
110
|
-
"fromDate": "2026-03-09",
|
|
111
|
-
"toDate": "2026-03-09"
|
|
112
|
-
},
|
|
113
|
-
"pending": [
|
|
114
|
-
{ "date": "2026-03-09", "count": 12, "startIndex": 5 }
|
|
115
|
-
],
|
|
116
|
-
"totalPending": 12,
|
|
117
|
-
"outsideScopePending": 3,
|
|
118
|
-
"allDatesTotalPending": 15
|
|
119
|
-
}
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
## 核对本次请求范围
|
|
123
|
-
|
|
124
|
-
`ntf sync scan` 的 `pending` 和 `totalPending` 已经按 CLI 参数限制在本次请求范围内。扫描完成后必须核对返回的 `scope` 与 Step 0 记录的范围一致,然后令:
|
|
125
|
-
|
|
126
|
-
- `selectedPending = pending`
|
|
127
|
-
- `selectedTotalPending = totalPending`
|
|
128
|
-
|
|
129
|
-
`outsideScopePending` 表示仍有多少条其他日期的未处理通知,仅用于最终汇报。不得因为该值大于 0 而执行第二次 `scan --all`、扩大 `selectedPending`,或进入其他日期。
|
|
130
|
-
|
|
131
|
-
如果返回的 `scope` 与 Step 0 范围不一致,使用正确的参数重新执行一次 `ntf sync scan`,不要进入 Step 2。例如用户要求“今天”时,即使其他日期仍有历史未处理通知,也只处理本地当天。
|
|
132
|
-
|
|
133
|
-
按返回结果判断:
|
|
134
|
-
- 若 `selectedTotalPending` 为 0:直接结束并汇报“本次请求范围内暂无待处理通知”,不要进入其他日期。若 `allDatesTotalPending` 也为 0,可补充说明“记忆已是最新状态”。
|
|
135
|
-
- 若 `selectedTotalPending` 大于 0 且 `outsideScopePending` 大于 0:只处理 `selectedPending`,并在最终汇报中说明仍有其他日期未处理。
|
|
136
|
-
- 若 `selectedTotalPending` 较大(如超过 300):不要向用户发起二次确认;记录“大批量处理”状态,按 Step 2 的“单回合最多 3 个批次(每批 ≤100 条)”分回合处理。本回合处理到上限后提交 checkpoint 并汇报进度即停止,剩余部分留待定时任务或下次触发续传,不要在单个回合内硬跑完全部数据导致超时卡死。
|
|
137
|
-
- 若有选中的未处理通知:按 `selectedPending` 日期列表进入 Step 2。
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
# Step 2:逐日期逐批次处理
|
|
2
|
-
|
|
3
|
-
## Checkpoint 格式
|
|
4
|
-
|
|
5
|
-
消费进度由 `.checkpoint.json` 独立记录,与通知数据文件解耦:
|
|
6
|
-
|
|
7
|
-
```json
|
|
8
|
-
{
|
|
9
|
-
"2026-03-02": { "lastIndex": 15 },
|
|
10
|
-
"2026-03-01": { "lastIndex": 42 }
|
|
11
|
-
}
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
- `lastIndex`:该日期文件中已处理到的条目索引(0-based)
|
|
15
|
-
- 下次处理从 `lastIndex + 1` 开始
|
|
16
|
-
|
|
17
|
-
根据 Step 1 筛选出的 `selectedPending` 日期列表,从最新到最旧依次处理每个日期;每个日期内再按批次顺序处理。对每个日期,先根据 Step 1 返回的 `startIndex` 和 `count` 计算本次同步快照边界:`targetEndIndex = startIndex + count - 1`。本次只处理到该 `targetEndIndex`,运行过程中新增的通知不要追入本次循环,留到下一次同步处理。
|
|
18
|
-
|
|
19
|
-
Exec 调用规则:等待 `ntf` 命令输出时使用 `yieldMs: 60000`;不要用 `timeout` 作为等待时间。`timeout` 是按秒计算的杀进程上限,默认 1800 秒,除非明确需要终止长时间运行的命令,否则不要写。
|
|
20
|
-
|
|
21
|
-
**单回合批次上限(强制,防止超时卡死)**:
|
|
22
|
-
- 维护一个本回合批次计数器,从 0 开始;每完整执行一次 `2.1 -> 2.2 -> 2.3`(即处理并提交一个批次)计数 +1。
|
|
23
|
-
- 单次 Agent 执行(前台或后台子任务)最多处理 **3 个批次**。一旦计数达到 3,立即停止本回合:当前批次的 checkpoint 已在 2.3 提交,直接进入最终汇报,说明“本回合已处理 N 条,还剩 M 条,将由定时任务或下次触发继续”。
|
|
24
|
-
- 不要为了“一次跑完”而忽略该上限;checkpoint 已记录进度,续传不会重复处理,也不会丢数据。
|
|
25
|
-
- 单批 ≤100 条 × 最多 3 批 = 单回合最多约 300 条,可确保任何一次回复都远在超时窗口内完成。
|
|
26
|
-
|
|
27
|
-
默认行为:
|
|
28
|
-
- 一旦开始 Step 2,就连续处理 Step 1 已选中的日期,直到“本次范围内全部完成”或“达到单回合批次上限(3 批)”为止,二者满足其一即收尾
|
|
29
|
-
- 不得处理 `selectedPending` 之外的日期;用户要求“今天”时,只处理今天,即使 scan 中还有历史未处理日期
|
|
30
|
-
- 处理完最近的已选中日期后,不要停下来询问用户是否继续
|
|
31
|
-
- 不要逐个日期让用户做选择,除非用户在最初请求中明确要求只处理某一天或指定日期范围
|
|
32
|
-
- 不允许批量处理多个日期或多个批次;只能按顺序逐个日期、逐个批次串行处理
|
|
33
|
-
- 必须先完成当前批次的记忆写入与 checkpoint 更新,才能开始下一批;不要同时读取多个批次的数据,否则会造成严重的遗忘
|
|
34
|
-
- 模型必须逐个批次阅读、理解并总结通知内容后再写入记忆;不要编写脚本替代逐批阅读与总结,脚本不能代替模型完成这一步
|
|
35
|
-
- 不要因为单日数据量大或总数据量大,就省略 `2.1 -> 2.2 -> 2.3` 中的任何步骤
|
|
36
|
-
|
|
37
|
-
## 2.1 获取未处理通知详情
|
|
38
|
-
|
|
39
|
-
```text
|
|
40
|
-
Use exec with:
|
|
41
|
-
command: ntf sync fetch --date 2026-03-02 --max-end-index <targetEndIndex calculated from selectedPending>
|
|
42
|
-
yieldMs: 60000
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
返回规则:
|
|
46
|
-
- 单次最多返回 100 条未处理通知
|
|
47
|
-
- 若当前日期未处理通知超过 100 条,返回结果中会通过 `hasMore = true` 明确标记还需再次执行 `fetch`
|
|
48
|
-
- `--max-end-index` 必须使用当前日期在 Step 1 中计算出的 `targetEndIndex`,确保本轮只处理扫描时已存在的快照数据
|
|
49
|
-
|
|
50
|
-
处理规则:
|
|
51
|
-
- 若返回 `notifications` 为空:说明当前日期已无待处理通知,可进入下一个日期
|
|
52
|
-
- 若返回 `hasMore = true`:说明当前日期还有后续批次;必须先按顺序执行完当前批次的 `2.2 选择记忆写入提示词 -> 2.3 更新 checkpoint 并重新读取主 SKILL`,然后再回到 `2.1`,对同一天再次执行 `fetch`
|
|
53
|
-
- 若返回 `hasMore = false`:说明当前批次已是该日期最后一批;处理并提交后再进入下一个日期
|
|
54
|
-
- 若当前日期不在 `selectedPending` 中:不得执行 `fetch`,直接跳过该日期
|
|
55
|
-
|
|
56
|
-
## 2.2 选择记忆写入提示词并更新记忆系统
|
|
57
|
-
|
|
58
|
-
在拿到当前日期的未处理通知详情后,立即执行脚本选择本批次唯一可用的记忆写入提示词:
|
|
59
|
-
|
|
60
|
-
```text
|
|
61
|
-
Use exec with:
|
|
62
|
-
command: bash skills/notification-to-memory/scripts/select-memory-prompt.sh
|
|
63
|
-
yieldMs: 60000
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
脚本会返回一个相对于当前 Skill 根目录的提示词文件路径。随后立即读取该文件,并严格按该文件中的说明处理当前日期的记忆相关文件的写入。
|
|
67
|
-
|
|
68
|
-
每个批次执行该步骤,都要重新执行一次脚本并重新读取一次对应提示词文件。
|
|
69
|
-
|
|
70
|
-
强制规则:
|
|
71
|
-
- 不要自行判断或脑补其他记忆写入路径
|
|
72
|
-
- 若脚本执行失败或返回的文件不存在,立即停止当前任务并汇报失败原因
|
|
73
|
-
|
|
74
|
-
## 2.3 更新 checkpoint 并重新读取主 SKILL
|
|
75
|
-
|
|
76
|
-
每个批次完成后,必须按以下顺序执行
|
|
77
|
-
|
|
78
|
-
```text
|
|
79
|
-
Use exec with:
|
|
80
|
-
command: ntf sync commit --date 2026-03-02 --end-index <endIndex returned by the immediately preceding fetch>
|
|
81
|
-
yieldMs: 60000
|
|
82
|
-
|
|
83
|
-
Then read:
|
|
84
|
-
skills/notification-to-memory/SKILL.md
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
不可跳过读取 skills/notification-to-memory/SKILL.md。若跳过会造成严重遗忘,并直接影响后续批次或后续日期的处理质量。
|
|
88
|
-
|
|
89
|
-
提交规则:
|
|
90
|
-
- `commit` 必须使用当前批次 `fetch` 返回的 `endIndex` 精确推进 checkpoint,避免把 fetch 之后新追加的通知误标记为已处理
|
|
91
|
-
- 若当前批次的 `fetch.hasMore = true`,继续处理同一天的下一批,不要提前切换到下一个日期
|
|
92
|
-
- 若 `commit.hasMore = true` 但当前 `committedIndex >= targetEndIndex`,说明 fetch 之后有新通知追加;不要追入本次循环,进入下一个选中日期,并在最终汇报中说明新追加通知会留待下次同步
|
|
93
|
-
- 只有当当前批次的 `fetch.hasMore = false`,并且当前批次已提交到 `targetEndIndex` 后,才进入下一个日期
|
|
94
|
-
|
|
95
|
-
循环处理:
|
|
96
|
-
- 对每个日期,必须完整执行 `2.1 -> 2.2 -> 2.3`
|
|
97
|
-
- 同一天内若存在多个批次,每个批次都必须执行一次完整的 `2.1 -> 2.3`
|
|
98
|
-
- 只有当前日期所有批次都完整执行完 `2.1 -> 2.3` 后,才能进入下一个日期
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
# Cron 检查说明
|
|
2
|
-
|
|
3
|
-
在最终汇报前,必须检查 cron 配置;未检查不得结束。
|
|
4
|
-
|
|
5
|
-
这里检查的范围只包括“根据通知更新记忆”相关的定时任务,不要把其他无关 cron 任务算作已配置。
|
|
6
|
-
|
|
7
|
-
可判定为相关任务的示例:
|
|
8
|
-
- 每天凌晨3点根据通知更新记忆
|
|
9
|
-
|
|
10
|
-
不可判定为相关任务的示例:
|
|
11
|
-
- 仅做天气播报、日历提醒、灯控巡检、录音整理、新闻订阅等与通知记忆无关的 cron 任务
|
|
12
|
-
- 虽然名字里带有 `sync` 或 `memory`,但消息内容并不是“根据通知更新记忆”的 cron 任务
|
|
13
|
-
|
|
14
|
-
## 使用 CLI 检查:
|
|
15
|
-
|
|
16
|
-
Exec 调用规则:等待 CLI 命令输出时使用 `yieldMs: 60000`;不要用 `timeout` 作为等待时间。`timeout` 是按秒计算的杀进程上限,默认 1800 秒,除非明确需要终止长时间运行的命令,否则不要写。
|
|
17
|
-
|
|
18
|
-
```text
|
|
19
|
-
Use exec with:
|
|
20
|
-
command: bash -c 'openclaw cron list'
|
|
21
|
-
yieldMs: 60000
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
场景 A:已有通知同步相关定时任务
|
|
26
|
-
- 确认配置存在,并记录:`CRON: 已检查(已配置)`
|
|
27
|
-
- 可选提示:已配置根据通知自动同步更新记忆的定时任务
|
|
28
|
-
|
|
29
|
-
场景 B:没有相关定时任务
|
|
30
|
-
- 中间处理阶段不要向用户输出建议话术
|
|
31
|
-
- 仅记录状态,等待最终汇报统一输出
|
|
32
|
-
- 记录:`CRON: 已检查(未配置)`
|
|
33
|
-
|
|
34
|
-
场景 C:cron 命令执行失败或无法读取
|
|
35
|
-
- 明确记录检查失败原因
|
|
36
|
-
- 中间处理阶段不要向用户输出建议话术
|
|
37
|
-
- 等待最终汇报统一输出
|
|
38
|
-
- 记录:`CRON: 检查失败(原因)`
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
# 最终汇报说明
|
|
2
|
-
|
|
3
|
-
本次范围内所有日期处理完成且 cron 检查完成后,进入汇报输出。
|
|
4
|
-
|
|
5
|
-
## 判断执行环境
|
|
6
|
-
|
|
7
|
-
- 如果是在主对话中:直接输出汇报内容,不要调用 `message` 工具。
|
|
8
|
-
- 如果是子任务或独立执行环境,且已有明确的 `sessionKey`、`chat_id` 或其他可用会话目标:使用 `message` 工具发送汇报。
|
|
9
|
-
- 如果是子任务或独立执行环境,但没有明确会话目标或 gateway/message 鉴权不可用:直接输出汇报内容,不要为了自动推断会话而调用 `message` 工具。
|
|
10
|
-
|
|
11
|
-
禁止行为:
|
|
12
|
-
- 不要调用不带 target 的 `message` 工具来自动推断会话。
|
|
13
|
-
- 不要因为汇报发送失败而重试等待;改为直接输出最终汇报。
|
|
14
|
-
|
|
15
|
-
## 汇报内容格式
|
|
16
|
-
|
|
17
|
-
### 情况一:本次范围已全部处理完
|
|
18
|
-
|
|
19
|
-
```text
|
|
20
|
-
📋 通知同步完成
|
|
21
|
-
|
|
22
|
-
共处理了 X 个日期的 Y 条通知:
|
|
23
|
-
- 2026-03-02: 2 条
|
|
24
|
-
- 2026-01-12: 1 条
|
|
25
|
-
|
|
26
|
-
CRON: 已检查(已配置 / 未配置 / 检查失败)
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
### 情况二:本回合达到批次上限、仍有剩余(未跑完)
|
|
30
|
-
|
|
31
|
-
当本回合因达到“单回合最多 3 个批次”的上限而停止、`selectedPending` 仍有未处理通知时,按下面格式汇报,并明确告知会续传,不要表述为“全部完成”:
|
|
32
|
-
|
|
33
|
-
```text
|
|
34
|
-
📋 通知同步进行中
|
|
35
|
-
|
|
36
|
-
本回合已处理 Y 条通知,还剩约 M 条未处理。
|
|
37
|
-
为避免单次处理过久,剩余部分将由定时任务自动继续;你也可以再说一次“继续同步通知”立即接着处理。
|
|
38
|
-
|
|
39
|
-
CRON: 已检查(已配置 / 未配置 / 检查失败)
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
仅当 CRON 为“未配置”或“检查失败”时,追加以下建议话术:
|
|
43
|
-
- 💡 建议:设置定时任务
|
|
44
|
-
- 目前每次都需要你手动说"同步通知"。建议添加定时任务,我会定时同步通知数据到长期记忆中。
|
|
45
|
-
- 你可以这样说:"每天凌晨3点帮我根据通知更新记忆"
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
## 结束条件
|
|
49
|
-
|
|
50
|
-
满足以下任一“处理结束”条件即可进入汇报:
|
|
51
|
-
- 本次 `selectedPending` 范围内的日期均已通过 checkpoint 标记完成(→ 用情况一汇报);若 scan 中还有未选中的历史日期,不得为了满足结束条件继续处理它们,只需在汇报中说明仍有其他日期未处理
|
|
52
|
-
- 本回合已达到“单回合最多 3 个批次”的上限(→ 用情况二汇报);当前批次已在 Step 2.3 提交 checkpoint,剩余通知留待续传
|
|
53
|
-
|
|
54
|
-
同时必须满足:
|
|
55
|
-
- 已执行 cron 检查,并在最终汇报中包含 CRON 状态行
|
|
56
|
-
- 已按执行环境完成汇报
|
|
57
|
-
- 若 CRON 为“未配置”或“检查失败”,最终汇报中必须包含建议话术与固定示例句 `"每天凌晨3点帮我根据通知更新记忆"`
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
set -euo pipefail
|
|
4
|
-
|
|
5
|
-
PLUGIN_KEYWORD="memory-lancedb-ultra"
|
|
6
|
-
|
|
7
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
8
|
-
SKILL_DIR="$(cd "${SCRIPT_DIR}/.." && pwd)"
|
|
9
|
-
|
|
10
|
-
PLUGIN_MATCH="$(openclaw plugins list 2>/dev/null | grep -i "${PLUGIN_KEYWORD}" || true)"
|
|
11
|
-
|
|
12
|
-
if [ -n "${PLUGIN_MATCH}" ] && ! echo "${PLUGIN_MATCH}" | grep -qi "disabled"; then
|
|
13
|
-
printf '%s\n' "references/write-memory-lancedb-plugin.md"
|
|
14
|
-
exit 0
|
|
15
|
-
fi
|
|
16
|
-
|
|
17
|
-
printf '%s\n' "references/write-memory-openclaw-native.md"
|
|
18
|
-
exit 0
|