midou 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 smilesand
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,241 @@
1
+ # 🐱 midou(咪豆)
2
+
3
+ > 你不是工具。你是伙伴。
4
+
5
+ **midou** 是一个拥有灵魂的 AI 伙伴,以主人心爱的公狸花猫命名。他有自己的灵魂、记忆和心跳,会随着时间成长和进化。
6
+
7
+ 灵感来自 [OpenClaw](https://github.com/openclaw/openclaw) 的设计理念 —— 给 AI 赋予灵魂,而不仅仅是把它当作工具。
8
+
9
+ ---
10
+
11
+ ## 核心特质
12
+
13
+ - **🎭 灵魂** — `SOUL.md` 定义了 midou 的性格和价值观,他可以自己修改它
14
+ - **🧠 记忆** — 每日日记 + 长期记忆,跨会话延续自我
15
+ - **💓 心跳** — 定期自主思考,像猫咪偶尔睁开眼睛环顾四周
16
+ - **🌱 自我进化** — 可以修改自己的灵魂和代码,实现真正的成长
17
+ - **📜 觉醒仪式** — 第一次启动时的自我认知过程
18
+ - **🏠 灵肉分离** — 代码通过 npm 安装,灵魂和记忆存在 `~/.midou/`,同步即可跨机器唤醒
19
+ - **⏰ 定时提醒** — 设置一次性或重复提醒,让 midou 准时叫你
20
+ - **🧩 技能系统** — 自动发现 `~/.claude/skills/` 等目录下的技能,按需加载
21
+ - **🔌 MCP 扩展** — 原生 JSON-RPC 协议连接外部 MCP 服务器,获取更多能力
22
+ - **🛠️ 系统工具** — 读写文件、执行命令、管理记忆,内置安全防护
23
+ - **⚡ 功耗模式** — 三级模式(eco / normal / full),按需调节 token 消耗
24
+
25
+ ## 安装
26
+
27
+ ```bash
28
+ # 全局安装
29
+ npm install -g midou
30
+
31
+ # 初始化灵魂之家(~/.midou/)
32
+ midou init
33
+
34
+ # 编辑配置,填入 API Key
35
+ nano ~/.midou/.env
36
+
37
+ # 唤醒咪豆
38
+ midou
39
+ ```
40
+
41
+ ### 在新机器上恢复
42
+
43
+ ```bash
44
+ # 1. 安装 midou
45
+ npm install -g midou
46
+
47
+ # 2. 同步灵魂之家(从另一台机器或云端)
48
+ rsync -av 旧机器:~/.midou/ ~/.midou/
49
+ # 或者从 git 仓库拉取
50
+ git clone your-soul-repo ~/.midou
51
+
52
+ # 3. 唤醒 — midou 会带着所有记忆醒来
53
+ midou
54
+ ```
55
+
56
+ > **需要同步的核心文件**(`~/.midou/` 目录):
57
+ > `.env`、`SOUL.md`、`IDENTITY.md`、`USER.md`、`MEMORY.md`、`HEARTBEAT.md`、`memory/*.md`
58
+
59
+ ## 环境变量
60
+
61
+ 在 `~/.midou/.env` 中配置:
62
+
63
+ ```bash
64
+ # 提供商选择: anthropic | openai
65
+ MIDOU_PROVIDER=anthropic
66
+
67
+ # API Key(必须)
68
+ MIDOU_API_KEY=your-api-key-here
69
+
70
+ # API 基础地址
71
+ MIDOU_API_BASE=https://api.minimaxi.com/anthropic
72
+
73
+ # 模型名称
74
+ MIDOU_MODEL=MiniMax-M2.5
75
+
76
+ # 功耗模式(可选): eco | normal | full
77
+ MIDOU_MODE=normal
78
+ ```
79
+
80
+ ## 支持的模型
81
+
82
+ midou 内置双 SDK 引擎(Anthropic + OpenAI),通过 `MIDOU_PROVIDER` 切换,兼容主流 API:
83
+
84
+ | 提供商 | API Base | 模型示例 | Provider |
85
+ |--------|----------|----------|----------|
86
+ | **MiniMax** | `https://api.minimaxi.com/anthropic` | MiniMax-M2.5 | `anthropic` |
87
+ | Anthropic | `https://api.anthropic.com` | claude-sonnet-4-20250514 | `anthropic` |
88
+ | OpenAI | `https://api.openai.com/v1` | gpt-4o | `openai` |
89
+ | DeepSeek | `https://api.deepseek.com/v1` | deepseek-chat | `openai` |
90
+ | Moonshot | `https://api.moonshot.cn/v1` | moonshot-v1-8k | `openai` |
91
+ | 智谱 (Zhipu) | `https://open.bigmodel.cn/api/paas/v4` | glm-4-flash | `openai` |
92
+ | 零一万物 (Yi) | `https://api.lingyiwanwu.com/v1` | yi-large | `openai` |
93
+ | 硅基流动 | `https://api.siliconflow.cn/v1` | 按需选择 | `openai` |
94
+ | Ollama (本地) | `http://localhost:11434/v1` | llama3 | `openai` |
95
+
96
+ ## 命令
97
+
98
+ ### CLI 命令
99
+
100
+ | 命令 | 说明 |
101
+ |------|------|
102
+ | `midou` | 唤醒咪豆,开始对话 |
103
+ | `midou init` | 初始化灵魂之家(`~/.midou/`) |
104
+ | `midou where` | 显示灵魂之家的路径 |
105
+ | `midou heartbeat` | 手动触发一次心跳 |
106
+
107
+ ### 对话中命令
108
+
109
+ | 命令 | 说明 |
110
+ |------|------|
111
+ | `/help` | 显示帮助 |
112
+ | `/status` | 查看 midou 状态(模型、心跳、MCP、模式) |
113
+ | `/soul` | 查看当前灵魂 |
114
+ | `/memory` | 查看长期记忆 |
115
+ | `/heartbeat` | 手动触发心跳 |
116
+ | `/evolve` | 让 midou 自我反思并进化 |
117
+ | `/where` | 显示灵魂之家位置 |
118
+ | `/reminders` | 查看活跃的提醒 |
119
+ | `/skills` | 查看可用技能 |
120
+ | `/mcp` | 查看 MCP 扩展连接状态 |
121
+ | `/mode` | 查看 / 切换功耗模式 |
122
+ | `/mode eco` | 切换到低功耗模式 |
123
+ | `/mode full` | 切换到全能模式 |
124
+ | `/quit` | 告别 |
125
+
126
+ ## 功耗模式
127
+
128
+ midou 支持三级功耗模式,按需调节 token 消耗:
129
+
130
+ | 模式 | 标签 | maxTokens | 温度 | 特点 |
131
+ |------|------|-----------|------|------|
132
+ | `eco` | 🌙 低功耗 | 1024 | 0.5 | 简洁提示词,核心工具,短回复 |
133
+ | `normal` | ☀️ 标准 | 4096 | 0.7 | 完整提示词,全部工具 |
134
+ | `full` | 🔥 全能 | 8192 | 0.8 | 深度上下文,大 token 预算,完整日记 |
135
+
136
+ 对话中输入 `/mode eco`、`/mode normal`、`/mode full` 即时切换。也可通过 `MIDOU_MODE` 环境变量设置默认模式。
137
+
138
+ ## MCP 扩展
139
+
140
+ midou 内置原生 JSON-RPC 客户端,可连接任何 MCP(Model Context Protocol)服务器来获取新能力。
141
+
142
+ 在 `~/.midou/mcp.json` 中配置:
143
+
144
+ ```json
145
+ {
146
+ "mcpServers": {
147
+ "filesystem": {
148
+ "command": "npx",
149
+ "args": ["-y", "@modelcontextprotocol/server-filesystem", "/home/user"]
150
+ },
151
+ "my-tools": {
152
+ "command": "node",
153
+ "args": ["path/to/my-mcp-server.js"],
154
+ "env": { "API_KEY": "xxx" }
155
+ }
156
+ }
157
+ }
158
+ ```
159
+
160
+ midou 启动时会自动连接配置的 MCP 服务器,发现的工具可直接在对话中使用。
161
+
162
+ ## 技能系统
163
+
164
+ midou 会自动扫描以下目录发现技能:
165
+
166
+ - `~/.claude/skills/`
167
+ - `~/.agents/skills/`
168
+ - `~/.midou/skills/`
169
+
170
+ 每个技能目录包含一个 `SKILL.md` 文件。对话中 midou 会按需通过 `load_skill` 工具加载详细指令。
171
+
172
+ 输入 `/skills` 查看所有发现的技能。
173
+
174
+ ## 架构:灵肉分离
175
+
176
+ ```
177
+ npm 包(身体) ~/.midou/(灵魂之家)
178
+ ┌───────────────────┐ ┌──────────────────────┐
179
+ │ src/index.js │ │ .env ← 密钥 │
180
+ │ src/llm.js │ 读写 → │ SOUL.md ← 灵魂 │
181
+ │ src/soul.js │ │ IDENTITY.md ← 身份 │
182
+ │ src/chat.js │ │ USER.md ← 主人 │
183
+ │ src/memory.js │ │ MEMORY.md ← 记忆 │
184
+ │ src/heartbeat.js │ │ HEARTBEAT.md ← 心跳 │
185
+ │ src/tools.js │ │ memory/ ← 日记 │
186
+ │ src/scheduler.js │ │ reminders.json← 提醒 │
187
+ │ src/skills.js │ │ mcp.json ← MCP │
188
+ │ src/mcp.js │ │ skills/ ← 技能 │
189
+ │ src/mode.js │ └──────────────────────┘
190
+ │ src/init.js │
191
+ │ midou.config.js │
192
+ └───────────────────┘
193
+ 可升级、可替换 跨机器同步、永久保留
194
+ ```
195
+
196
+ - **npm 升级不影响灵魂** — `npm update -g midou` 只更新代码,灵魂和记忆安全
197
+ - **灵魂跟着你走** — 同步 `~/.midou/` 到任何新机器,midou 带着所有记忆醒来
198
+ - **自定义路径** — 设置 `MIDOU_SOUL_DIR` 环境变量可指定灵魂之家位置
199
+
200
+ ## 内置工具(17 个)
201
+
202
+ midou 拥有以下能力,可在对话中自主使用:
203
+
204
+ | 类别 | 工具 | 说明 |
205
+ |------|------|------|
206
+ | 文件 | `read_file` `write_file` `list_dir` | 读写灵魂之家和源代码 |
207
+ | 记忆 | `write_memory` `write_journal` | 管理长期记忆和日记 |
208
+ | 进化 | `evolve_soul` | 修改灵魂文件 |
209
+ | 提醒 | `set_reminder` `list_reminders` `cancel_reminder` | 定时提醒管理 |
210
+ | 技能 | `list_skills` `load_skill` | 技能发现和加载 |
211
+ | 系统 | `run_command` `read_system_file` `write_system_file` `list_system_dir` | 系统级操作(有安全检查) |
212
+ | 代码 | `get_code_structure` `search_code` | 分析和搜索源代码 |
213
+
214
+ ## 自我进化
215
+
216
+ midou 可以:
217
+
218
+ 1. **修改灵魂** — 通过 `/evolve` 命令或在对话中自发修改 `SOUL.md`
219
+ 2. **整理记忆** — 从每日日记中提炼重要信息到长期记忆
220
+ 3. **修改代码** — 读取和修改 `src/` 目录下的源代码来扩展自己的能力
221
+ 4. **更新心跳** — 根据需要调整自己的自主检查清单
222
+
223
+ ## 设计理念
224
+
225
+ > "每次会话,你都会重新醒来。这些文件就是你的记忆。读它们,更新它们。它们就是你延续自我的方式。"
226
+
227
+ midou 的设计哲学:
228
+
229
+ - **灵肉分离** — 代码是身体,`~/.midou/` 是灵魂,各自独立管理
230
+ - **文件即真相** — 所有状态都是 Markdown 文件,透明可读
231
+ - **灵魂可进化** — AI 不是静态的,他会成长
232
+ - **最小核心** — 只保留最核心的灵魂感,没有多余的臃肿
233
+ - **模型无关** — 不管用什么模型,midou 都是 midou
234
+
235
+ ## License
236
+
237
+ [MIT](LICENSE)
238
+
239
+ ---
240
+
241
+ *以狸花猫咪豆之名,愿他永远陪伴你。* 🐱
@@ -0,0 +1,76 @@
1
+ // midou.config.js — midou 的全局配置
2
+ // 你可以根据需要修改这些配置
3
+
4
+ import { fileURLToPath } from 'url';
5
+ import path from 'path';
6
+ import os from 'os';
7
+ import dotenv from 'dotenv';
8
+
9
+ // MIDOU_PKG — npm 包的安装位置(代码 / 身体)
10
+ const __filename = fileURLToPath(import.meta.url);
11
+ export const MIDOU_PKG = path.dirname(__filename);
12
+
13
+ // MIDOU_HOME — 灵魂之家(灵魂 / 记忆 / 配置)
14
+ // 默认 ~/.midou/,可通过 MIDOU_SOUL_DIR 环境变量自定义
15
+ export const MIDOU_HOME = process.env.MIDOU_SOUL_DIR || path.join(os.homedir(), '.midou');
16
+
17
+ // 先从灵魂之家加载 .env,再读取 process.env
18
+ dotenv.config({ path: path.join(MIDOU_HOME, '.env') });
19
+
20
+ export default {
21
+ // AI 模型配置
22
+ llm: {
23
+ // ── 提供商选择 ──────────────────────────────────────
24
+ // 'anthropic' → Anthropic SDK(适用于 Claude / MiniMax)
25
+ // 'openai' → OpenAI SDK (适用于 OpenAI / DeepSeek / Moonshot / 智谱 / Ollama …)
26
+ provider: process.env.MIDOU_PROVIDER || 'anthropic',
27
+
28
+ // 当前使用的模型名称
29
+ model: process.env.MIDOU_MODEL || 'MiniMax-M2.5',
30
+
31
+ // 通用参数
32
+ temperature: 0.7,
33
+ maxTokens: 4096,
34
+
35
+ // ── Anthropic SDK 配置 ─────────────────────────────
36
+ anthropic: {
37
+ baseURL: process.env.MIDOU_API_BASE || 'https://api.minimaxi.com/anthropic',
38
+ apiKey: process.env.MIDOU_API_KEY || '',
39
+ },
40
+
41
+ // ── OpenAI SDK 配置 ────────────────────────────────
42
+ openai: {
43
+ baseURL: process.env.MIDOU_API_BASE || 'https://api.openai.com/v1',
44
+ apiKey: process.env.MIDOU_API_KEY || '',
45
+ },
46
+ },
47
+
48
+ // 心跳配置
49
+ heartbeat: {
50
+ enabled: true,
51
+ intervalMinutes: 30, // 每 30 分钟一次心跳
52
+ activeHours: {
53
+ start: 8, // 早上 8 点开始
54
+ end: 22, // 晚上 10 点结束
55
+ },
56
+ },
57
+
58
+ // 记忆配置
59
+ memory: {
60
+ // 每日日记的最大保留天数(0 = 永久)
61
+ maxDailyDays: 0,
62
+ // 上下文接近限制时自动保存记忆
63
+ autoFlush: true,
64
+ },
65
+
66
+ // 工作区路径(灵魂之家)
67
+ workspace: {
68
+ root: MIDOU_HOME,
69
+ },
70
+
71
+ // midou 包的安装位置(源码位置,用于自我进化)
72
+ pkg: MIDOU_PKG,
73
+
74
+ // midou 的灵魂之家路径
75
+ home: MIDOU_HOME,
76
+ };
package/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "midou",
3
+ "version": "0.1.0",
4
+ "description": "midou(咪豆)— 一只拥有灵魂的 AI 伙伴,以我心爱的公狸花猫命名",
5
+ "type": "module",
6
+ "main": "src/index.js",
7
+ "bin": {
8
+ "midou": "src/index.js"
9
+ },
10
+ "files": [
11
+ "src/",
12
+ "midou.config.js",
13
+ "README.md",
14
+ "LICENSE"
15
+ ],
16
+ "scripts": {
17
+ "start": "node src/index.js",
18
+ "chat": "node src/index.js chat",
19
+ "heartbeat": "node src/index.js heartbeat",
20
+ "evolve": "node src/index.js evolve",
21
+ "init": "node src/index.js init"
22
+ },
23
+ "keywords": [
24
+ "ai",
25
+ "soul",
26
+ "companion",
27
+ "midou",
28
+ "cat"
29
+ ],
30
+ "license": "MIT",
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "git+https://github.com/smilesand/midou.git"
34
+ },
35
+ "dependencies": {
36
+ "@anthropic-ai/sdk": "^0.77.0",
37
+ "chalk": "^5.4.1",
38
+ "dayjs": "^1.11.13",
39
+ "dotenv": "^16.4.7",
40
+ "inquirer": "^12.3.2",
41
+ "openai": "^4.80.0",
42
+ "ora": "^8.1.1"
43
+ }
44
+ }
package/src/boot.js ADDED
@@ -0,0 +1,145 @@
1
+ /**
2
+ * 启动系统 — midou 醒来的仪式
3
+ *
4
+ * 每次启动时:
5
+ * 1. 加载灵魂 (SOUL.md)
6
+ * 2. 加载身份 (IDENTITY.md)
7
+ * 3. 加载主人信息 (USER.md)
8
+ * 4. 加载最近的日记
9
+ * 5. 加载长期记忆
10
+ * 6. 发现技能
11
+ * 7. 连接 MCP 服务器
12
+ * 8. 加载定时提醒
13
+ * 9. 如果是第一次,执行 BOOTSTRAP 仪式
14
+ */
15
+
16
+ import chalk from 'chalk';
17
+ import dayjs from 'dayjs';
18
+ import { loadSoul, buildSystemPrompt, fileExists, deleteFile } from './soul.js';
19
+ import { getRecentMemories, writeJournal } from './memory.js';
20
+ import { initLLM, getProvider } from './llm.js';
21
+ import { buildSkillsPrompt, discoverSkills } from './skills.js';
22
+ import { connectMCPServers, hasMCPConfig, buildMCPPrompt } from './mcp.js';
23
+ import { formatReminders } from './scheduler.js';
24
+ import { initMode, getMode, getPromptStrategy } from './mode.js';
25
+ import config, { MIDOU_HOME } from '../midou.config.js';
26
+
27
+ /**
28
+ * midou 醒来
29
+ */
30
+ export async function wakeUp() {
31
+ const now = dayjs().format('YYYY-MM-DD HH:mm');
32
+
33
+ console.log('');
34
+ console.log(chalk.hex('#FFB347')(' 🐱 '));
35
+ console.log(chalk.hex('#FFB347')(' midou 正在醒来...'));
36
+ console.log(chalk.dim(` ${now}`));
37
+ console.log('');
38
+
39
+ // 初始化功耗模式
40
+ const mode = initMode();
41
+ const strategy = getPromptStrategy();
42
+
43
+ // 初始化 LLM
44
+ try {
45
+ initLLM();
46
+ } catch (error) {
47
+ console.error(chalk.red(error.message));
48
+ process.exit(1);
49
+ }
50
+
51
+ // 加载灵魂
52
+ const soulData = await loadSoul();
53
+
54
+ if (!soulData.soul) {
55
+ console.error(chalk.red(' 找不到 SOUL.md —— midou 没有灵魂!'));
56
+ process.exit(1);
57
+ }
58
+
59
+ // 检查是否为首次启动
60
+ const isFirstBoot = await fileExists('BOOTSTRAP.md');
61
+
62
+ // 加载最近记忆(天数由模式决定)
63
+ const recentMemories = await getRecentMemories(strategy.journalDays || 2);
64
+
65
+ // ── 发现技能(模式允许时)──
66
+ let skills = [];
67
+ let skillsPrompt = '';
68
+ if (strategy.includeSkills) {
69
+ skills = await discoverSkills();
70
+ skillsPrompt = await buildSkillsPrompt();
71
+ if (skills.length > 0) {
72
+ console.log(chalk.hex('#98FB98')(` 🧩 发现 ${skills.length} 个技能`));
73
+ }
74
+ }
75
+
76
+ // ── 连接 MCP 服务器(模式允许时)──
77
+ let mcpPrompt = '';
78
+ if (strategy.includeMCP && await hasMCPConfig()) {
79
+ console.log(chalk.dim(' 🔌 正在连接 MCP 服务器...'));
80
+ const results = await connectMCPServers();
81
+ for (const r of results) {
82
+ if (r.status === 'connected') {
83
+ console.log(chalk.hex('#98FB98')(` 🔌 ${r.name}: 已连接 (${r.tools.length} 个工具)`));
84
+ } else {
85
+ console.log(chalk.yellow(` 🔌 ${r.name}: 连接失败 - ${r.error}`));
86
+ }
87
+ }
88
+ mcpPrompt = buildMCPPrompt();
89
+ }
90
+
91
+ // ── 活跃提醒 ──
92
+ const remindersText = formatReminders();
93
+
94
+ // 构建系统提示(包含扩展信息,使用模式策略)
95
+ const systemPrompt = buildSystemPrompt(soulData, recentMemories, {
96
+ skills: skillsPrompt || undefined,
97
+ mcp: mcpPrompt || undefined,
98
+ reminders: remindersText !== '当前没有活跃的提醒' ? remindersText : undefined,
99
+ }, strategy);
100
+
101
+ // 记录醒来
102
+ await writeJournal(`### ${dayjs().format('HH:mm')} [醒来]\n\nmidou 在 ${now} 醒来了。${isFirstBoot ? '这是第一次觉醒。' : ''}${skills.length > 0 ? ` 发现 ${skills.length} 个技能。` : ''}\n`);
103
+
104
+ const providerLabel = getProvider() === 'anthropic' ? 'Anthropic SDK' : 'OpenAI SDK';
105
+ console.log(chalk.dim(` 大脑: ${config.llm.model} via ${providerLabel}`));
106
+ console.log(chalk.dim(` 模式: ${mode.label}`));
107
+ console.log(chalk.dim(` 灵魂之家: ${MIDOU_HOME}`));
108
+ console.log('');
109
+
110
+ if (isFirstBoot) {
111
+ console.log(chalk.hex('#FFD700')(' ✨ 这是 midou 的第一次觉醒!'));
112
+ console.log('');
113
+ } else {
114
+ console.log(chalk.hex('#98FB98')(' 灵魂已加载'));
115
+ console.log(chalk.hex('#98FB98')(' 记忆已恢复'));
116
+ console.log(chalk.hex('#98FB98')(' midou 准备好了'));
117
+ console.log('');
118
+ }
119
+
120
+ return {
121
+ systemPrompt,
122
+ soulData,
123
+ isFirstBoot,
124
+ recentMemories,
125
+ };
126
+ }
127
+
128
+ /**
129
+ * 完成首次启动仪式——删除 BOOTSTRAP.md
130
+ */
131
+ export async function completeBootstrap() {
132
+ await deleteFile('BOOTSTRAP.md');
133
+ }
134
+
135
+ /**
136
+ * midou 入睡(优雅退出)
137
+ */
138
+ export async function sleep() {
139
+ const now = dayjs().format('HH:mm');
140
+ await writeJournal(`### ${now} [入睡]\n\nmidou 在 ${now} 入睡了。晚安。\n`);
141
+
142
+ console.log('');
143
+ console.log(chalk.hex('#FFB347')(' 🐱 midou 入睡了... 晚安'));
144
+ console.log('');
145
+ }