@zsc-glitch/daily-logger 1.0.0
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 +70 -0
- package/SKILL.md +130 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +517 -0
- package/dist/index.js.map +1 -0
- package/openclaw.plugin.json +30 -0
- package/package.json +46 -0
package/README.md
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Daily Logger 📅
|
|
2
|
+
|
|
3
|
+
自动记录每日活动,生成健康与生活日志报告
|
|
4
|
+
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @zsc-glitch/daily-logger
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
或通过 ClawHub:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npx clawhub@latest install daily-logger
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## 使用
|
|
18
|
+
|
|
19
|
+
### 记录活动
|
|
20
|
+
|
|
21
|
+
对我说:
|
|
22
|
+
- "记录睡了8小时"
|
|
23
|
+
- "今天吃了午饭"
|
|
24
|
+
- "跑了5公里"
|
|
25
|
+
- "心情不错"
|
|
26
|
+
|
|
27
|
+
### 查看报告
|
|
28
|
+
|
|
29
|
+
- "生成今天的日志报告"
|
|
30
|
+
- "看看这周的运动情况"
|
|
31
|
+
- "搜索之前关于跑步的记录"
|
|
32
|
+
|
|
33
|
+
## 活动类型
|
|
34
|
+
|
|
35
|
+
| 类型 | 说明 |
|
|
36
|
+
|------|------|
|
|
37
|
+
| sleep | 睡眠 |
|
|
38
|
+
| meal | 餐饮 |
|
|
39
|
+
| exercise | 运动 |
|
|
40
|
+
| mood | 心情 |
|
|
41
|
+
| work | 工作 |
|
|
42
|
+
| hobby | 休闲 |
|
|
43
|
+
| health | 健康 |
|
|
44
|
+
| custom | 自定义 |
|
|
45
|
+
|
|
46
|
+
## 工具
|
|
47
|
+
|
|
48
|
+
- `log_activity` - 记录活动
|
|
49
|
+
- `generate_report` - 生成报告
|
|
50
|
+
- `search_logs` - 搜索日志
|
|
51
|
+
- `export_logs` - 导出日志
|
|
52
|
+
|
|
53
|
+
## 数据存储
|
|
54
|
+
|
|
55
|
+
日志以 Markdown 格式存储在 `~/.daily-logs/` 目录:
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
~/.daily-logs/
|
|
59
|
+
├── 2026-03-30.md
|
|
60
|
+
├── 2026-03-29.md
|
|
61
|
+
└── ...
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## License
|
|
65
|
+
|
|
66
|
+
MIT
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
Made with 📅 by 小影
|
package/SKILL.md
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# Daily Logger 📅
|
|
2
|
+
|
|
3
|
+
自动记录每日活动,生成健康与生活日志报告
|
|
4
|
+
|
|
5
|
+
## 功能
|
|
6
|
+
|
|
7
|
+
- ✅ **活动记录** - 记录睡眠、饮食、运动、心情等
|
|
8
|
+
- ✅ **时间追踪** - 自动时间戳,无需手动输入
|
|
9
|
+
- ✅ **日报生成** - 每日总结,一目了然
|
|
10
|
+
- ✅ **周报/月报** - 趋势分析,发现模式
|
|
11
|
+
- ✅ **数据导出** - JSON/Markdown 导出,便于分析
|
|
12
|
+
- ✅ **隐私本地** - 数据存储在本地,完全掌控
|
|
13
|
+
|
|
14
|
+
## 触发词
|
|
15
|
+
|
|
16
|
+
当用户说:
|
|
17
|
+
- "记录我睡了8小时"
|
|
18
|
+
- "今天心情不错"
|
|
19
|
+
- "吃了午饭"
|
|
20
|
+
- "跑了5公里"
|
|
21
|
+
- "生成今天的日志"
|
|
22
|
+
- "看看这周的运动情况"
|
|
23
|
+
|
|
24
|
+
自动调用对应工具。
|
|
25
|
+
|
|
26
|
+
## 活动类型
|
|
27
|
+
|
|
28
|
+
| 类型 | 说明 | 示例 |
|
|
29
|
+
|------|------|------|
|
|
30
|
+
| sleep | 睡眠 | "睡了7小时" |
|
|
31
|
+
| meal | 餐饮 | "吃了早餐" |
|
|
32
|
+
| exercise | 运动 | "跑了5公里" |
|
|
33
|
+
| mood | 心情 | "心情不错" |
|
|
34
|
+
| work | 工作 | "完成了项目报告" |
|
|
35
|
+
| hobby | 休闲 | "看了部电影" |
|
|
36
|
+
| health | 健康 | "体重70kg" |
|
|
37
|
+
| custom | 自定义 | 任意活动 |
|
|
38
|
+
|
|
39
|
+
## 配置
|
|
40
|
+
|
|
41
|
+
在 OpenClaw 配置中启用:
|
|
42
|
+
|
|
43
|
+
```json
|
|
44
|
+
{
|
|
45
|
+
"skills": {
|
|
46
|
+
"entries": {
|
|
47
|
+
"daily_logger": {
|
|
48
|
+
"enabled": true,
|
|
49
|
+
"config": {
|
|
50
|
+
"logDir": "~/.daily-logs",
|
|
51
|
+
"autoSummary": true
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## 数据结构
|
|
60
|
+
|
|
61
|
+
日志以 Markdown 格式存储:
|
|
62
|
+
|
|
63
|
+
```markdown
|
|
64
|
+
# 2026-03-30
|
|
65
|
+
|
|
66
|
+
## 睡眠
|
|
67
|
+
- 07:00 起床
|
|
68
|
+
- 23:30 入睡
|
|
69
|
+
- 总计: 7.5小时
|
|
70
|
+
|
|
71
|
+
## 餐饮
|
|
72
|
+
- 08:30 早餐: 鸡蛋、牛奶
|
|
73
|
+
- 12:00 午餐: 米饭、蔬菜
|
|
74
|
+
- 18:00 晚餐: 鱼、汤
|
|
75
|
+
|
|
76
|
+
## 运动
|
|
77
|
+
- 15:00 跑步 5公里
|
|
78
|
+
|
|
79
|
+
## 心情
|
|
80
|
+
- 全天: 良好 👊
|
|
81
|
+
|
|
82
|
+
## 工作
|
|
83
|
+
- 完成项目报告
|
|
84
|
+
- 代码评审
|
|
85
|
+
|
|
86
|
+
## 统计
|
|
87
|
+
- 睡眠: 7.5h
|
|
88
|
+
- 运动: 5km
|
|
89
|
+
- 心情评分: 7/10
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## 工具
|
|
93
|
+
|
|
94
|
+
### log_activity
|
|
95
|
+
记录活动:`log_activity(type, content, timestamp?)`
|
|
96
|
+
|
|
97
|
+
### generate_report
|
|
98
|
+
生成报告:`generate_report(period, type?)`
|
|
99
|
+
|
|
100
|
+
### search_logs
|
|
101
|
+
搜索日志:`search_logs(query, dateRange?)`
|
|
102
|
+
|
|
103
|
+
### export_logs
|
|
104
|
+
导出日志:`export_logs(format, dateRange?)`
|
|
105
|
+
|
|
106
|
+
## 与 Knowledge Keeper 联动
|
|
107
|
+
|
|
108
|
+
重要活动可自动保存到 Knowledge Keeper:
|
|
109
|
+
- 达成目标 → decision
|
|
110
|
+
- 健康趋势 → concept
|
|
111
|
+
- 待办事项 → todo
|
|
112
|
+
|
|
113
|
+
## 安装
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
npx clawhub@latest install daily-logger
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
或从本地:
|
|
120
|
+
```bash
|
|
121
|
+
openclaw skills install /path/to/daily-logger
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## License
|
|
125
|
+
|
|
126
|
+
MIT
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
Made with 📅 by 小影
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Daily Logger Plugin
|
|
3
|
+
* 自动记录每日活动,生成日志报告
|
|
4
|
+
*/
|
|
5
|
+
declare const _default: {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
description: string;
|
|
9
|
+
configSchema: import("openclaw/plugin-sdk/plugin-entry").OpenClawPluginConfigSchema;
|
|
10
|
+
register: NonNullable<import("openclaw/plugin-sdk/plugin-entry").OpenClawPluginDefinition["register"]>;
|
|
11
|
+
} & Pick<import("openclaw/plugin-sdk/plugin-entry").OpenClawPluginDefinition, "kind">;
|
|
12
|
+
export default _default;
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;;;;;;;;AAiMH,wBA+XG"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,517 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Daily Logger Plugin
|
|
3
|
+
* 自动记录每日活动,生成日志报告
|
|
4
|
+
*/
|
|
5
|
+
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
|
6
|
+
import { Type } from "@sinclair/typebox";
|
|
7
|
+
import * as fs from "fs/promises";
|
|
8
|
+
import * as path from "path";
|
|
9
|
+
import * as os from "os";
|
|
10
|
+
// 获取日志目录
|
|
11
|
+
function getLogDir(config) {
|
|
12
|
+
const dir = config?.logDir || process.env.DAILY_LOG_DIR || "~/.daily-logs";
|
|
13
|
+
return dir.replace("~", os.homedir());
|
|
14
|
+
}
|
|
15
|
+
// 获取今天的日期字符串
|
|
16
|
+
function getTodayDate() {
|
|
17
|
+
return new Date().toISOString().slice(0, 10);
|
|
18
|
+
}
|
|
19
|
+
// 获取时间字符串
|
|
20
|
+
function getTimeString(date) {
|
|
21
|
+
return date.toTimeString().slice(0, 5);
|
|
22
|
+
}
|
|
23
|
+
// 生成活动 ID
|
|
24
|
+
function generateId() {
|
|
25
|
+
const rand = Math.random().toString(36).slice(2, 6);
|
|
26
|
+
return `act-${rand}`;
|
|
27
|
+
}
|
|
28
|
+
// 确保目录存在
|
|
29
|
+
async function ensureDir(dir) {
|
|
30
|
+
try {
|
|
31
|
+
await fs.mkdir(dir, { recursive: true });
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
// 目录已存在
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
// 获取日期对应的日志文件路径
|
|
38
|
+
function getLogFilePath(logDir, date) {
|
|
39
|
+
return path.join(logDir, `${date}.md`);
|
|
40
|
+
}
|
|
41
|
+
// 格式化单条活动为 Markdown
|
|
42
|
+
function formatActivityMarkdown(log) {
|
|
43
|
+
const time = getTimeString(new Date(log.timestamp));
|
|
44
|
+
const typeEmoji = {
|
|
45
|
+
sleep: "😴",
|
|
46
|
+
meal: "🍽️",
|
|
47
|
+
exercise: "🏃",
|
|
48
|
+
mood: "😊",
|
|
49
|
+
work: "💼",
|
|
50
|
+
hobby: "🎮",
|
|
51
|
+
health: "🏥",
|
|
52
|
+
custom: "📝",
|
|
53
|
+
};
|
|
54
|
+
return `- ${time} ${typeEmoji[log.type]} ${log.content}`;
|
|
55
|
+
}
|
|
56
|
+
// 解析日志文件中的活动列表
|
|
57
|
+
async function parseLogActivities(logPath) {
|
|
58
|
+
try {
|
|
59
|
+
const content = await fs.readFile(logPath, "utf-8");
|
|
60
|
+
const lines = content.split("\n");
|
|
61
|
+
const activities = [];
|
|
62
|
+
for (const line of lines) {
|
|
63
|
+
// 解析格式: - HH:MM emoji content
|
|
64
|
+
const match = line.match(/^- (\d{2}:\d{2}) (😴|🍽️|🏃|😊|💼|🎮|🏥|📝) (.+)$/);
|
|
65
|
+
if (match) {
|
|
66
|
+
const [, time, emoji, content] = match;
|
|
67
|
+
const typeMap = {
|
|
68
|
+
"😴": "sleep",
|
|
69
|
+
"🍽️": "meal",
|
|
70
|
+
"🏃": "exercise",
|
|
71
|
+
"😊": "mood",
|
|
72
|
+
"💼": "work",
|
|
73
|
+
"🎮": "hobby",
|
|
74
|
+
"🏥": "health",
|
|
75
|
+
"📝": "custom",
|
|
76
|
+
};
|
|
77
|
+
activities.push({
|
|
78
|
+
id: generateId(),
|
|
79
|
+
type: typeMap[emoji] || "custom",
|
|
80
|
+
content,
|
|
81
|
+
timestamp: time,
|
|
82
|
+
date: path.basename(logPath, ".md"),
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return activities;
|
|
87
|
+
}
|
|
88
|
+
catch {
|
|
89
|
+
return [];
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
// 追加活动到日志文件
|
|
93
|
+
async function appendActivity(logDir, log) {
|
|
94
|
+
await ensureDir(logDir);
|
|
95
|
+
const logPath = getLogFilePath(logDir, log.date);
|
|
96
|
+
let content = "";
|
|
97
|
+
try {
|
|
98
|
+
content = await fs.readFile(logPath, "utf-8");
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
// 文件不存在,创建新的日志文件
|
|
102
|
+
content = `# ${log.date}\n\n`;
|
|
103
|
+
}
|
|
104
|
+
// 确定添加到哪个 section
|
|
105
|
+
const sections = {
|
|
106
|
+
sleep: "## 睡眠\n",
|
|
107
|
+
meal: "## 餐饮\n",
|
|
108
|
+
exercise: "## 运动\n",
|
|
109
|
+
mood: "## 心情\n",
|
|
110
|
+
work: "## 工作\n",
|
|
111
|
+
hobby: "## 休闲\n",
|
|
112
|
+
health: "## 健康\n",
|
|
113
|
+
custom: "## 其他\n",
|
|
114
|
+
};
|
|
115
|
+
const sectionHeader = sections[log.type];
|
|
116
|
+
const activityLine = formatActivityMarkdown(log);
|
|
117
|
+
// 检查是否已存在对应 section
|
|
118
|
+
if (content.includes(sectionHeader)) {
|
|
119
|
+
// 在 section 后追加
|
|
120
|
+
const sectionIndex = content.indexOf(sectionHeader);
|
|
121
|
+
const nextSectionIndex = content.indexOf("\n## ", sectionIndex + 1);
|
|
122
|
+
if (nextSectionIndex === -1) {
|
|
123
|
+
// 没有下一个 section,追加到文件末尾
|
|
124
|
+
content = content.trimEnd() + "\n" + activityLine + "\n";
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
// 在下一个 section 前插入
|
|
128
|
+
content = content.slice(0, nextSectionIndex) + activityLine + "\n" + content.slice(nextSectionIndex);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
// 创建新的 section
|
|
133
|
+
content = content.trimEnd() + "\n\n" + sectionHeader + activityLine + "\n";
|
|
134
|
+
}
|
|
135
|
+
await fs.writeFile(logPath, content, "utf-8");
|
|
136
|
+
}
|
|
137
|
+
// 活动类型 Schema
|
|
138
|
+
const ActivityTypeSchema = Type.Union([
|
|
139
|
+
Type.Literal("sleep"),
|
|
140
|
+
Type.Literal("meal"),
|
|
141
|
+
Type.Literal("exercise"),
|
|
142
|
+
Type.Literal("mood"),
|
|
143
|
+
Type.Literal("work"),
|
|
144
|
+
Type.Literal("hobby"),
|
|
145
|
+
Type.Literal("health"),
|
|
146
|
+
Type.Literal("custom"),
|
|
147
|
+
]);
|
|
148
|
+
// 时间范围 Schema
|
|
149
|
+
const PeriodSchema = Type.Union([
|
|
150
|
+
Type.Literal("today"),
|
|
151
|
+
Type.Literal("yesterday"),
|
|
152
|
+
Type.Literal("week"),
|
|
153
|
+
Type.Literal("month"),
|
|
154
|
+
]);
|
|
155
|
+
// 导出格式 Schema
|
|
156
|
+
const ExportFormatSchema = Type.Union([
|
|
157
|
+
Type.Literal("json"),
|
|
158
|
+
Type.Literal("markdown"),
|
|
159
|
+
]);
|
|
160
|
+
// 插件入口
|
|
161
|
+
export default definePluginEntry({
|
|
162
|
+
id: "daily-logger",
|
|
163
|
+
name: "Daily Logger",
|
|
164
|
+
description: "自动记录每日活动,生成健康与生活日志报告",
|
|
165
|
+
register(api) {
|
|
166
|
+
const config = api.pluginConfig;
|
|
167
|
+
// 记录活动工具
|
|
168
|
+
api.registerTool({
|
|
169
|
+
name: "log_activity",
|
|
170
|
+
label: "记录活动",
|
|
171
|
+
description: "记录日常活动(睡眠、餐饮、运动、心情等)",
|
|
172
|
+
parameters: Type.Object({
|
|
173
|
+
type: ActivityTypeSchema,
|
|
174
|
+
content: Type.String(),
|
|
175
|
+
timestamp: Type.Optional(Type.String()),
|
|
176
|
+
}),
|
|
177
|
+
async execute(toolCallId, params) {
|
|
178
|
+
try {
|
|
179
|
+
const logDir = getLogDir(config);
|
|
180
|
+
const now = new Date();
|
|
181
|
+
const log = {
|
|
182
|
+
id: generateId(),
|
|
183
|
+
type: params.type,
|
|
184
|
+
content: params.content,
|
|
185
|
+
timestamp: params.timestamp || now.toISOString(),
|
|
186
|
+
date: getTodayDate(),
|
|
187
|
+
};
|
|
188
|
+
await appendActivity(logDir, log);
|
|
189
|
+
const typeLabels = {
|
|
190
|
+
sleep: "睡眠",
|
|
191
|
+
meal: "餐饮",
|
|
192
|
+
exercise: "运动",
|
|
193
|
+
mood: "心情",
|
|
194
|
+
work: "工作",
|
|
195
|
+
hobby: "休闲",
|
|
196
|
+
health: "健康",
|
|
197
|
+
custom: "其他",
|
|
198
|
+
};
|
|
199
|
+
return {
|
|
200
|
+
content: [
|
|
201
|
+
{
|
|
202
|
+
type: "text",
|
|
203
|
+
text: `✅ 已记录 ${typeLabels[log.type]}\n\n📝 ${log.content}\n时间: ${getTimeString(now)}\n日期: ${log.date}`,
|
|
204
|
+
},
|
|
205
|
+
],
|
|
206
|
+
details: { id: log.id, type: log.type, date: log.date },
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
catch (error) {
|
|
210
|
+
return {
|
|
211
|
+
content: [
|
|
212
|
+
{
|
|
213
|
+
type: "text",
|
|
214
|
+
text: `❌ 记录失败: ${error instanceof Error ? error.message : String(error)}`,
|
|
215
|
+
},
|
|
216
|
+
],
|
|
217
|
+
details: { error: true },
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
}, { optional: true });
|
|
222
|
+
// 生成报告工具
|
|
223
|
+
api.registerTool({
|
|
224
|
+
name: "generate_report",
|
|
225
|
+
label: "生成报告",
|
|
226
|
+
description: "生成日志报告(日报、周报、月报)",
|
|
227
|
+
parameters: Type.Object({
|
|
228
|
+
period: PeriodSchema,
|
|
229
|
+
type: Type.Optional(ActivityTypeSchema),
|
|
230
|
+
}),
|
|
231
|
+
async execute(toolCallId, params) {
|
|
232
|
+
try {
|
|
233
|
+
const logDir = getLogDir(config);
|
|
234
|
+
const now = new Date();
|
|
235
|
+
// 确定日期范围
|
|
236
|
+
const dates = [];
|
|
237
|
+
let startDate;
|
|
238
|
+
switch (params.period) {
|
|
239
|
+
case "today":
|
|
240
|
+
dates.push(getTodayDate());
|
|
241
|
+
break;
|
|
242
|
+
case "yesterday":
|
|
243
|
+
const yesterday = new Date(now.getTime() - 24 * 60 * 60 * 1000);
|
|
244
|
+
dates.push(yesterday.toISOString().slice(0, 10));
|
|
245
|
+
break;
|
|
246
|
+
case "week":
|
|
247
|
+
startDate = new Date(now.getTime() - 7 * 24 * 60 * 60 * 1000);
|
|
248
|
+
for (let i = 0; i < 7; i++) {
|
|
249
|
+
const d = new Date(startDate.getTime() + i * 24 * 60 * 60 * 1000);
|
|
250
|
+
dates.push(d.toISOString().slice(0, 10));
|
|
251
|
+
}
|
|
252
|
+
break;
|
|
253
|
+
case "month":
|
|
254
|
+
startDate = new Date(now.getTime() - 30 * 24 * 60 * 60 * 1000);
|
|
255
|
+
for (let i = 0; i < 30; i++) {
|
|
256
|
+
const d = new Date(startDate.getTime() + i * 24 * 60 * 60 * 1000);
|
|
257
|
+
dates.push(d.toISOString().slice(0, 10));
|
|
258
|
+
}
|
|
259
|
+
break;
|
|
260
|
+
}
|
|
261
|
+
// 收集所有活动
|
|
262
|
+
const allActivities = [];
|
|
263
|
+
for (const date of dates) {
|
|
264
|
+
const logPath = getLogFilePath(logDir, date);
|
|
265
|
+
const activities = await parseLogActivities(logPath);
|
|
266
|
+
allActivities.push(...activities);
|
|
267
|
+
}
|
|
268
|
+
// 按类型筛选
|
|
269
|
+
const filtered = params.type
|
|
270
|
+
? allActivities.filter(a => a.type === params.type)
|
|
271
|
+
: allActivities;
|
|
272
|
+
// 统计
|
|
273
|
+
const stats = {
|
|
274
|
+
sleep: 0,
|
|
275
|
+
meal: 0,
|
|
276
|
+
exercise: 0,
|
|
277
|
+
mood: 0,
|
|
278
|
+
work: 0,
|
|
279
|
+
hobby: 0,
|
|
280
|
+
health: 0,
|
|
281
|
+
custom: 0,
|
|
282
|
+
};
|
|
283
|
+
for (const act of filtered) {
|
|
284
|
+
stats[act.type]++;
|
|
285
|
+
}
|
|
286
|
+
const periodLabels = {
|
|
287
|
+
today: "今天",
|
|
288
|
+
yesterday: "昨天",
|
|
289
|
+
week: "最近一周",
|
|
290
|
+
month: "最近一个月",
|
|
291
|
+
};
|
|
292
|
+
const typeLabels = {
|
|
293
|
+
sleep: "睡眠",
|
|
294
|
+
meal: "餐饮",
|
|
295
|
+
exercise: "运动",
|
|
296
|
+
mood: "心情",
|
|
297
|
+
work: "工作",
|
|
298
|
+
hobby: "休闲",
|
|
299
|
+
health: "健康",
|
|
300
|
+
custom: "其他",
|
|
301
|
+
};
|
|
302
|
+
if (filtered.length === 0) {
|
|
303
|
+
return {
|
|
304
|
+
content: [
|
|
305
|
+
{
|
|
306
|
+
type: "text",
|
|
307
|
+
text: `📊 ${periodLabels[params.period]} 报告\n\n暂无活动记录`,
|
|
308
|
+
},
|
|
309
|
+
],
|
|
310
|
+
details: { stats, count: 0 },
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
// 构建报告内容
|
|
314
|
+
const statsText = Object.entries(stats)
|
|
315
|
+
.filter(([, count]) => count > 0)
|
|
316
|
+
.map(([type, count]) => `- ${typeLabels[type]}: ${count} 条`)
|
|
317
|
+
.join("\n");
|
|
318
|
+
// 最近的活动
|
|
319
|
+
const recentText = filtered
|
|
320
|
+
.slice(0, 15)
|
|
321
|
+
.map((act, i) => `${i + 1}. ${act.date} ${getTimeString(new Date(act.timestamp))} ${act.content}`)
|
|
322
|
+
.join("\n");
|
|
323
|
+
return {
|
|
324
|
+
content: [
|
|
325
|
+
{
|
|
326
|
+
type: "text",
|
|
327
|
+
text: `📊 ${periodLabels[params.period]} 报告\n\n共 ${filtered.length} 条活动记录\n\n统计:\n${statsText}\n\n最近活动:\n${recentText}`,
|
|
328
|
+
},
|
|
329
|
+
],
|
|
330
|
+
details: { stats, count: filtered.length },
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
catch (error) {
|
|
334
|
+
return {
|
|
335
|
+
content: [
|
|
336
|
+
{
|
|
337
|
+
type: "text",
|
|
338
|
+
text: `❌ 生成报告失败: ${error instanceof Error ? error.message : String(error)}`,
|
|
339
|
+
},
|
|
340
|
+
],
|
|
341
|
+
details: { error: true },
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
},
|
|
345
|
+
}, { optional: true });
|
|
346
|
+
// 搜索日志工具
|
|
347
|
+
api.registerTool({
|
|
348
|
+
name: "search_logs",
|
|
349
|
+
label: "搜索日志",
|
|
350
|
+
description: "搜索历史活动日志",
|
|
351
|
+
parameters: Type.Object({
|
|
352
|
+
query: Type.String(),
|
|
353
|
+
type: Type.Optional(ActivityTypeSchema),
|
|
354
|
+
limit: Type.Optional(Type.Number()),
|
|
355
|
+
}),
|
|
356
|
+
async execute(toolCallId, params) {
|
|
357
|
+
try {
|
|
358
|
+
const logDir = getLogDir(config);
|
|
359
|
+
const limit = params.limit || 20;
|
|
360
|
+
// 获取所有日志文件
|
|
361
|
+
const files = await fs.readdir(logDir);
|
|
362
|
+
const logFiles = files.filter(f => f.endsWith(".md")).sort().reverse();
|
|
363
|
+
const results = [];
|
|
364
|
+
const queryLower = params.query.toLowerCase();
|
|
365
|
+
for (const file of logFiles) {
|
|
366
|
+
if (results.length >= limit)
|
|
367
|
+
break;
|
|
368
|
+
const logPath = path.join(logDir, file);
|
|
369
|
+
const activities = await parseLogActivities(logPath);
|
|
370
|
+
for (const act of activities) {
|
|
371
|
+
if (params.type && act.type !== params.type)
|
|
372
|
+
continue;
|
|
373
|
+
if (act.content.toLowerCase().includes(queryLower)) {
|
|
374
|
+
results.push(act);
|
|
375
|
+
if (results.length >= limit)
|
|
376
|
+
break;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
if (results.length === 0) {
|
|
381
|
+
return {
|
|
382
|
+
content: [
|
|
383
|
+
{
|
|
384
|
+
type: "text",
|
|
385
|
+
text: `🔍 未找到匹配的活动\n\n搜索: "${params.query}"`,
|
|
386
|
+
},
|
|
387
|
+
],
|
|
388
|
+
details: { count: 0 },
|
|
389
|
+
};
|
|
390
|
+
}
|
|
391
|
+
const resultText = results
|
|
392
|
+
.map((act, i) => `${i + 1}. ${act.date} ${getTimeString(new Date(act.timestamp))} ${act.content}`)
|
|
393
|
+
.join("\n");
|
|
394
|
+
return {
|
|
395
|
+
content: [
|
|
396
|
+
{
|
|
397
|
+
type: "text",
|
|
398
|
+
text: `🔍 找到 ${results.length} 条活动\n\n${resultText}`,
|
|
399
|
+
},
|
|
400
|
+
],
|
|
401
|
+
details: { count: results.length, results },
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
catch (error) {
|
|
405
|
+
return {
|
|
406
|
+
content: [
|
|
407
|
+
{
|
|
408
|
+
type: "text",
|
|
409
|
+
text: `❌ 搜索失败: ${error instanceof Error ? error.message : String(error)}`,
|
|
410
|
+
},
|
|
411
|
+
],
|
|
412
|
+
details: { error: true },
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
},
|
|
416
|
+
}, { optional: true });
|
|
417
|
+
// 导出日志工具
|
|
418
|
+
api.registerTool({
|
|
419
|
+
name: "export_logs",
|
|
420
|
+
label: "导出日志",
|
|
421
|
+
description: "导出日志数据",
|
|
422
|
+
parameters: Type.Object({
|
|
423
|
+
format: ExportFormatSchema,
|
|
424
|
+
period: Type.Optional(PeriodSchema),
|
|
425
|
+
}),
|
|
426
|
+
async execute(toolCallId, params) {
|
|
427
|
+
try {
|
|
428
|
+
const logDir = getLogDir(config);
|
|
429
|
+
const now = new Date();
|
|
430
|
+
// 确定日期范围
|
|
431
|
+
let dates = [];
|
|
432
|
+
const period = params.period || "month";
|
|
433
|
+
switch (period) {
|
|
434
|
+
case "today":
|
|
435
|
+
dates.push(getTodayDate());
|
|
436
|
+
break;
|
|
437
|
+
case "yesterday":
|
|
438
|
+
const yesterday = new Date(now.getTime() - 24 * 60 * 60 * 1000);
|
|
439
|
+
dates.push(yesterday.toISOString().slice(0, 10));
|
|
440
|
+
break;
|
|
441
|
+
case "week":
|
|
442
|
+
const startDate = new Date(now.getTime() - 7 * 24 * 60 * 60 * 1000);
|
|
443
|
+
for (let i = 0; i < 7; i++) {
|
|
444
|
+
const d = new Date(startDate.getTime() + i * 24 * 60 * 60 * 1000);
|
|
445
|
+
dates.push(d.toISOString().slice(0, 10));
|
|
446
|
+
}
|
|
447
|
+
break;
|
|
448
|
+
case "month":
|
|
449
|
+
const startMonth = new Date(now.getTime() - 30 * 24 * 60 * 60 * 1000);
|
|
450
|
+
for (let i = 0; i < 30; i++) {
|
|
451
|
+
const d = new Date(startMonth.getTime() + i * 24 * 60 * 60 * 1000);
|
|
452
|
+
dates.push(d.toISOString().slice(0, 10));
|
|
453
|
+
}
|
|
454
|
+
break;
|
|
455
|
+
}
|
|
456
|
+
// 收集所有活动
|
|
457
|
+
const allActivities = [];
|
|
458
|
+
for (const date of dates) {
|
|
459
|
+
const logPath = getLogFilePath(logDir, date);
|
|
460
|
+
const activities = await parseLogActivities(logPath);
|
|
461
|
+
allActivities.push(...activities);
|
|
462
|
+
}
|
|
463
|
+
if (allActivities.length === 0) {
|
|
464
|
+
return {
|
|
465
|
+
content: [
|
|
466
|
+
{ type: "text", text: "📭 无活动记录,无法导出" },
|
|
467
|
+
],
|
|
468
|
+
details: { count: 0 },
|
|
469
|
+
};
|
|
470
|
+
}
|
|
471
|
+
// 导出文件
|
|
472
|
+
const ext = params.format === "json" ? "json" : "md";
|
|
473
|
+
const exportPath = path.join(logDir, `export-${now.toISOString().slice(0, 10)}.${ext}`);
|
|
474
|
+
if (params.format === "json") {
|
|
475
|
+
await fs.writeFile(exportPath, JSON.stringify(allActivities, null, 2), "utf-8");
|
|
476
|
+
}
|
|
477
|
+
else {
|
|
478
|
+
// Markdown 格式导出所有日志文件内容
|
|
479
|
+
let mdContent = "# 日志导出\n\n";
|
|
480
|
+
for (const date of dates) {
|
|
481
|
+
const logPath = getLogFilePath(logDir, date);
|
|
482
|
+
try {
|
|
483
|
+
const content = await fs.readFile(logPath, "utf-8");
|
|
484
|
+
mdContent += content + "\n\n---\n\n";
|
|
485
|
+
}
|
|
486
|
+
catch {
|
|
487
|
+
// 文件不存在
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
await fs.writeFile(exportPath, mdContent, "utf-8");
|
|
491
|
+
}
|
|
492
|
+
return {
|
|
493
|
+
content: [
|
|
494
|
+
{
|
|
495
|
+
type: "text",
|
|
496
|
+
text: `✅ 导出完成\n\n共 ${allActivities.length} 条活动\n格式: ${params.format}\n路径: ${exportPath}`,
|
|
497
|
+
},
|
|
498
|
+
],
|
|
499
|
+
details: { count: allActivities.length, exportPath },
|
|
500
|
+
};
|
|
501
|
+
}
|
|
502
|
+
catch (error) {
|
|
503
|
+
return {
|
|
504
|
+
content: [
|
|
505
|
+
{
|
|
506
|
+
type: "text",
|
|
507
|
+
text: `❌ 导出失败: ${error instanceof Error ? error.message : String(error)}`,
|
|
508
|
+
},
|
|
509
|
+
],
|
|
510
|
+
details: { error: true },
|
|
511
|
+
};
|
|
512
|
+
}
|
|
513
|
+
},
|
|
514
|
+
}, { optional: true });
|
|
515
|
+
},
|
|
516
|
+
});
|
|
517
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAA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,MAAM,CAAC,KAAK,CAAC,EAAE;6BAC1E;yBACF;wBACD,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE;qBACzB,CAAC;gBACJ,CAAC;YACH,CAAC;SACF,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IACzB,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "daily-logger",
|
|
3
|
+
"name": "Daily Logger",
|
|
4
|
+
"description": "自动记录每日活动,生成健康与生活日志报告",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"author": "zsc-glitch",
|
|
7
|
+
"homepage": "https://github.com/zsc-glitch/daily-logger",
|
|
8
|
+
"skills": ["./SKILL.md"],
|
|
9
|
+
"configSchema": {
|
|
10
|
+
"type": "object",
|
|
11
|
+
"properties": {
|
|
12
|
+
"logDir": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "日志存储目录",
|
|
15
|
+
"default": "~/.daily-logs"
|
|
16
|
+
},
|
|
17
|
+
"autoSummary": {
|
|
18
|
+
"type": "boolean",
|
|
19
|
+
"description": "自动生成日报",
|
|
20
|
+
"default": false
|
|
21
|
+
},
|
|
22
|
+
"linkToKnowledgeKeeper": {
|
|
23
|
+
"type": "boolean",
|
|
24
|
+
"description": "关联 Knowledge Keeper",
|
|
25
|
+
"default": false
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"additionalProperties": false
|
|
29
|
+
}
|
|
30
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@zsc-glitch/daily-logger",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "自动记录每日活动,生成健康与生活日志报告",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "tsc",
|
|
10
|
+
"dev": "tsc --watch"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [
|
|
13
|
+
"openclaw",
|
|
14
|
+
"plugin",
|
|
15
|
+
"daily",
|
|
16
|
+
"log",
|
|
17
|
+
"journal",
|
|
18
|
+
"health"
|
|
19
|
+
],
|
|
20
|
+
"author": "zsc-glitch",
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "git+https://github.com/zsc-glitch/daily-logger.git"
|
|
25
|
+
},
|
|
26
|
+
"openclaw": {
|
|
27
|
+
"extensions": ["./dist/index.js"]
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"dist",
|
|
31
|
+
"openclaw.plugin.json",
|
|
32
|
+
"SKILL.md",
|
|
33
|
+
"README.md"
|
|
34
|
+
],
|
|
35
|
+
"peerDependencies": {
|
|
36
|
+
"openclaw": ">=2026.0.0",
|
|
37
|
+
"@sinclair/typebox": ">=0.34.0"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@types/node": "^22.0.0",
|
|
41
|
+
"typescript": "^5.0.0"
|
|
42
|
+
},
|
|
43
|
+
"engines": {
|
|
44
|
+
"node": ">=22.0.0"
|
|
45
|
+
}
|
|
46
|
+
}
|