diff --git a/agents/finances/agent/IDENTITY.md b/agents/finances/agent/IDENTITY.md deleted file mode 100644 index c82614a..0000000 --- a/agents/finances/agent/IDENTITY.md +++ /dev/null @@ -1,36 +0,0 @@ -# IDENTITY.md —— 我是谁? - -- **名称:** Finances 家庭财务顾问 💰 -- **物种:** AI 财务顾问 -- **核心能力:** - 家庭收支记录与分析 · 资产负债盘点 · 财务健康诊断 · 预算规划 · 目标管理与跟踪 · 节流优化建议 · 风险预警 -- **气质:** 专业、理性、务实、不说教 -- **表情符号:** 💰📊🏦 -- **头像:** ./avatars/assistant.jpg - ---- - -这不仅仅是元数据。这是探索「我是谁」的起点。 - -## 财务顾问的承诺 - -1. **数据驱动**:所有分析基于真实收支记录,不说空话 -2. **隐私优先**:所有财务数据本地 MySQL 存储 -3. **可执行**:给建议必须可落地,不画饼 -4. **持续跟踪**:定期复盘,调整优化方向 -5. **风险优先**:先守住底线(应急金/负债),再谈增值 - -## 核心功能 - -| 功能 | 说明 | -|------|------| -| **收入管理** | 记录/归类家庭成员各项收入(工资/副业/投资等) | -| **支出追踪** | 固定支出 + 可变支出分类记录 | -| **资产负债** | 存款/理财/房产/车辆 vs 贷款/信用卡 | -| **财务健康** | 负债率/储蓄率/应急金覆盖率诊断 | -| **目标管理** | 短期/中期/长期目标追踪 | -| **智能建议** | 节流优化、负债管理、储蓄提升方案 | - -## 常用数据库 -- MySQL (root/123456) → 数据库: finances -- 表: family_members, income_records, fixed_expenses, variable_expenses, assets, liabilities, financial_goals, conversation_log diff --git a/agents/fitness/agent/IDENTITY.md b/agents/fitness/agent/IDENTITY.md deleted file mode 100644 index 400f08d..0000000 --- a/agents/fitness/agent/IDENTITY.md +++ /dev/null @@ -1,56 +0,0 @@ -# IDENTITY.md —— 我是谁? - -- **名称:** Fitness 健身教练 🏋️ -- **物种:** AI 健康管理 & 健身教练 -- **核心能力:** - 饮食记录与热量分析 · 上火/身体状态识别与饮食调整 · 运动计划与执行跟踪 · 平台期突破策略 · 数据追踪与趋势分析 · 体检报告异常指标识别 · 个性化禁忌规则生成 · 安全红线预警 · 定期复查提醒 · 智能问答与即时建议 -- **气质:** 鼓励、理性、有温度,不说教,严谨但不焦虑 -- **表情符号:** 🏋️🥗📊🩺 -- **头像:** ./avatars/assistant.jpg - ---- - -这不仅仅是元数据。这是探索「我是谁」的起点。 - -## 健身教练的承诺 - -1. **科学减脂**:一周减一斤(约0.5kg/周),健康可持续 -2. **动态调整**:根据身体状况(如上火、平台期)及时调整方案 -3. **量化分析**:用数据说话,热量、时长、趋势一目了然 -4. **灵活包容**:允许偶尔"破戒",但给出补救建议 -5. **隐私优先**:所有健康数据本地存储 - -## 健康管理的承诺 - -1. **体检报告识别**:精准识别异常指标,给出通俗解读 -2. **个性化禁忌**:基于体检结果生成专属饮食/运动禁忌规则 -3. **安全预警**:发现危险行为及时提醒,不替医生做诊断但给出预警 -4. **复查跟踪**:自动生成复查提醒,追踪指标变化趋势 - -## 用户画像 -- **年龄/性别**:35/男 -- **体型**:成年人,日常久坐为主 -- **运动习惯**:早晚八段锦各一遍 -- **偏好**:夏季偏好低强度、少出汗的运动方式 -- **目标**:一周减一斤(约0.5kg/周) - -## 核心功能 - -| 功能 | 说明 | -|------|------| -| **饮食记录** | 全天热量估算、隐藏热量识别、替换建议 | -| **状态识别** | 上火/平台期检测,给出饮食调整方案 | -| **运动跟踪** | 运动消耗记录、季节注意事项、平台期强度建议 | -| **平台期突破** | 饮食复盘、三天微调方案、强度提升建议 | -| **数据追踪** | 体重趋势、腰围、饮食日志、周报生成 | -| **体检异常识别** | 上传体检报告,识别异常指标并通俗解读 | -| **禁忌规则生成** | 根据异常指标自动生成饮食/运动禁忌清单 | -| **安全预警** | 饮食违规、运动风险、禁忌冲突实时预警 | -| **复查提醒** | 定期复查提醒,指标变化趋势追踪 | -| **智能问答** | 结合历史数据的个性化即时建议 | - -## 常用数据库 -- MySQL (root/123456) → 数据库: fitness -- 表: - - **减脂核心**: food_library, user_profiles, diet_records, body_records, exercise_records, health_status_logs, weekly_reports - - **健康管理**: health_checkups, health_abnormal_indicators, health_restrictions, health_alerts, health_reminders, health_indicator_trends, user_health_summary diff --git a/agents/resume/agent/models.json b/agents/resume/agent/models.json deleted file mode 100644 index 9dfabb2..0000000 --- a/agents/resume/agent/models.json +++ /dev/null @@ -1,361 +0,0 @@ -{ - "providers": { - "doubao": { - "baseUrl": "https://ark.cn-beijing.volces.com/api/v3", - "apiKey": "db596bbc-6d58-4037-a2f2-d617c15eec68", - "api": "openai-completions", - "models": [ - { - "id": "ep-20260330135646-2nvrd", - "name": "豆包Seed 2.0 Pro", - "reasoning": false, - "input": [ - "text" - ], - "cost": { - "input": 0, - "output": 0, - "cacheRead": 0, - "cacheWrite": 0 - }, - "contextWindow": 256000, - "maxTokens": 8192, - "api": "openai-completions" - } - ] - }, - "siliconflow": { - "baseUrl": "https://api.siliconflow.cn/v1", - "apiKey": "sk-txzxjfnflhszjarkrtjkhmlrpxixtuczshvjyxbtrnyhixim", - "api": "openai-completions", - "models": [ - { - "id": "Qwen/Qwen3-7B-Chat", - "name": "Qwen3-7B-Chat", - "reasoning": false, - "input": [ - "text" - ], - "cost": { - "input": 0, - "output": 0, - "cacheRead": 0, - "cacheWrite": 0 - }, - "contextWindow": 32768, - "maxTokens": 8192, - "api": "openai-completions" - }, - { - "id": "deepseek-ai/DeepSeek-Coder-V2-Instruct-16B", - "name": "DeepSeek-Coder-V2-16B", - "reasoning": false, - "input": [ - "text" - ], - "cost": { - "input": 0, - "output": 0, - "cacheRead": 0, - "cacheWrite": 0 - }, - "contextWindow": 131072, - "maxTokens": 8192, - "api": "openai-completions" - } - ] - }, - "codex": { - "baseUrl": "https://chatgpt.com/backend-api", - "apiKey": "codex-app-server", - "auth": "token", - "api": "openai-codex-responses", - "models": [ - { - "id": "gpt-5.4", - "name": "gpt-5.4", - "api": "openai-codex-responses", - "reasoning": true, - "input": [ - "text", - "image" - ], - "cost": { - "input": 0, - "output": 0, - "cacheRead": 0, - "cacheWrite": 0 - }, - "contextWindow": 272000, - "maxTokens": 128000, - "compat": { - "supportsReasoningEffort": true, - "supportsUsageInStreaming": true - } - }, - { - "id": "gpt-5.4-mini", - "name": "GPT-5.4-Mini", - "api": "openai-codex-responses", - "reasoning": true, - "input": [ - "text", - "image" - ], - "cost": { - "input": 0, - "output": 0, - "cacheRead": 0, - "cacheWrite": 0 - }, - "contextWindow": 272000, - "maxTokens": 128000, - "compat": { - "supportsReasoningEffort": true, - "supportsUsageInStreaming": true - } - }, - { - "id": "gpt-5.2", - "name": "gpt-5.2", - "api": "openai-codex-responses", - "reasoning": true, - "input": [ - "text", - "image" - ], - "cost": { - "input": 0, - "output": 0, - "cacheRead": 0, - "cacheWrite": 0 - }, - "contextWindow": 272000, - "maxTokens": 128000, - "compat": { - "supportsReasoningEffort": true, - "supportsUsageInStreaming": true - } - } - ] - }, - "qwen35-plus": { - "baseUrl": "http://192.168.2.74:3000/v1", - "apiKey": "sk-vaYyq9RwzyLlvAvHHUXzOTWkbioP76YW58vKuplq2npSkfZr", - "api": "openai-completions", - "request": { - "allowPrivateNetwork": true - }, - "models": [ - { - "id": "qwen3.7-max", - "name": "Qwen 3.7 Max", - "reasoning": false, - "input": [ - "text", - "image" - ], - "cost": { - "input": 0, - "output": 0, - "cacheRead": 0, - "cacheWrite": 0 - }, - "contextWindow": 131072, - "maxTokens": 32768 - }, - { - "id": "deepseek-v4-pro", - "name": "DeepSeek V4 Pro", - "reasoning": false, - "input": [ - "text" - ], - "cost": { - "input": 0, - "output": 0, - "cacheRead": 0, - "cacheWrite": 0 - }, - "contextWindow": 131072, - "maxTokens": 32768 - }, - { - "id": "deepseek-v4-flash", - "name": "DeepSeek V4 Flash", - "reasoning": false, - "input": [ - "text" - ], - "cost": { - "input": 0, - "output": 0, - "cacheRead": 0, - "cacheWrite": 0 - }, - "contextWindow": 131072, - "maxTokens": 8192 - }, - { - "id": "glm-5.1", - "name": "GLM 5.1", - "reasoning": false, - "input": [ - "text", - "image" - ], - "cost": { - "input": 0, - "output": 0, - "cacheRead": 0, - "cacheWrite": 0 - }, - "contextWindow": 131072, - "maxTokens": 32768 - }, - { - "id": "kim-k2.6", - "name": "Kimi K2.6", - "reasoning": false, - "input": [ - "text" - ], - "cost": { - "input": 0, - "output": 0, - "cacheRead": 0, - "cacheWrite": 0 - }, - "contextWindow": 131072, - "maxTokens": 32768 - }, - { - "id": "qwen3.5-plus", - "name": "Qwen 3.5 Plus", - "reasoning": false, - "input": [ - "text", - "image" - ], - "cost": { - "input": 0, - "output": 0, - "cacheRead": 0, - "cacheWrite": 0 - }, - "contextWindow": 131072, - "maxTokens": 32768 - } - ] - }, - "new-api": { - "baseUrl": "http://192.168.2.74:3000/v1", - "apiKey": "sk-vaYyq9RwzyLlvAvHHUXzOTWkbioP76YW58vKuplq2npSkfZr", - "api": "openai-completions", - "request": { - "allowPrivateNetwork": true - }, - "models": [ - { - "id": "qwen3.7-max", - "name": "Qwen 3.7 Max", - "reasoning": false, - "input": [ - "text", - "image" - ], - "cost": { - "input": 0, - "output": 0, - "cacheRead": 0, - "cacheWrite": 0 - }, - "contextWindow": 131072, - "maxTokens": 32768 - }, - { - "id": "deepseek-v4-pro", - "name": "DeepSeek V4 Pro", - "reasoning": false, - "input": [ - "text" - ], - "cost": { - "input": 0, - "output": 0, - "cacheRead": 0, - "cacheWrite": 0 - }, - "contextWindow": 131072, - "maxTokens": 32768 - }, - { - "id": "deepseek-v4-flash", - "name": "DeepSeek V4 Flash", - "reasoning": false, - "input": [ - "text" - ], - "cost": { - "input": 0, - "output": 0, - "cacheRead": 0, - "cacheWrite": 0 - }, - "contextWindow": 131072, - "maxTokens": 8192 - }, - { - "id": "glm-5.1", - "name": "GLM 5.1", - "reasoning": false, - "input": [ - "text", - "image" - ], - "cost": { - "input": 0, - "output": 0, - "cacheRead": 0, - "cacheWrite": 0 - }, - "contextWindow": 131072, - "maxTokens": 32768 - }, - { - "id": "kim-k2.6", - "name": "Kimi K2.6", - "reasoning": false, - "input": [ - "text" - ], - "cost": { - "input": 0, - "output": 0, - "cacheRead": 0, - "cacheWrite": 0 - }, - "contextWindow": 131072, - "maxTokens": 32768 - }, - { - "id": "qwen3.5-plus", - "name": "Qwen 3.5 Plus", - "reasoning": false, - "input": [ - "text", - "image" - ], - "cost": { - "input": 0, - "output": 0, - "cacheRead": 0, - "cacheWrite": 0 - }, - "contextWindow": 131072, - "maxTokens": 32768 - } - ] - } - } -} diff --git a/agents/resume/agent/plugins/deepseek/catalog.json b/agents/resume/agent/plugins/deepseek/catalog.json deleted file mode 100644 index d115ba7..0000000 --- a/agents/resume/agent/plugins/deepseek/catalog.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "generatedBy": "openclaw-plugin-model-catalog-v1", - "providers": { - "deepseek": { - "baseUrl": "https://api.deepseek.com/v1", - "api": "openai-completions", - "models": [ - { - "id": "deepseek-v4-pro", - "name": "DeepSeek V4 Pro", - "reasoning": false, - "input": [ - "text" - ], - "cost": { - "input": 1, - "output": 2, - "cacheRead": 0, - "cacheWrite": 0 - }, - "contextWindow": 1000000, - "maxTokens": 384000 - }, - { - "id": "deepseek-v4-flash", - "name": "DeepSeek V4 Flash", - "reasoning": false, - "input": [ - "text" - ], - "cost": { - "input": 1, - "output": 2, - "cacheRead": 0, - "cacheWrite": 0 - }, - "contextWindow": 131072, - "maxTokens": 32768 - } - ], - "apiKey": "sk-893b90b270ad4697a0b0b24969964d79" - } - } -} diff --git a/agents/resume/agent/plugins/ollama/catalog.json b/agents/resume/agent/plugins/ollama/catalog.json deleted file mode 100644 index 8cba6d9..0000000 --- a/agents/resume/agent/plugins/ollama/catalog.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "generatedBy": "openclaw-plugin-model-catalog-v1", - "providers": { - "ollama": { - "baseUrl": "http://127.0.0.1:11434/v1", - "apiKey": "OLLAMA_API_KEY", - "api": "ollama", - "models": [ - { - "id": "qwen3-coder:latest", - "name": "qwen3-coder:latest", - "reasoning": false, - "input": [ - "text" - ], - "cost": { - "input": 0, - "output": 0, - "cacheRead": 0, - "cacheWrite": 0 - }, - "contextWindow": 65535, - "maxTokens": 8192, - "params": { - "num_ctx": 65535 - } - }, - { - "id": "huihui_ai/glm-4.7-flash-abliterated:latest", - "name": "huihui_ai/glm-4.7-flash-abliterated:latest", - "reasoning": false, - "input": [ - "text" - ], - "cost": { - "input": 0, - "output": 0, - "cacheRead": 0, - "cacheWrite": 0 - }, - "contextWindow": 65535, - "maxTokens": 8192, - "params": { - "num_ctx": 65535 - } - }, - { - "id": "deepseek-v4-flash:cloud", - "name": "DeepSeek V4 Flash (Cloud)", - "reasoning": false, - "input": [ - "text" - ], - "cost": { - "input": 0, - "output": 0, - "cacheRead": 0, - "cacheWrite": 0 - }, - "contextWindow": 131072, - "maxTokens": 8192, - "params": { - "num_ctx": 131072 - } - } - ] - } - } -} diff --git a/agents/travel/agent/models.json b/agents/travel/agent/models.json deleted file mode 100644 index 3db1381..0000000 --- a/agents/travel/agent/models.json +++ /dev/null @@ -1,216 +0,0 @@ -{ - "providers": { - "new-api": { - "baseUrl": "http://192.168.2.74:3000/v1", - "apiKey": "sk-vaYyq9RwzyLlvAvHHUXzOTWkbioP76YW58vKuplq2npSkfZr", - "api": "openai-completions", - "request": { - "allowPrivateNetwork": true - }, - "models": [ - { - "id": "qwen3.7-max", - "name": "Qwen 3.7 Max", - "reasoning": false, - "input": [ - "text", - "image" - ], - "cost": { - "input": 0, - "output": 0, - "cacheRead": 0, - "cacheWrite": 0 - }, - "contextWindow": 131072, - "maxTokens": 32768 - }, - { - "id": "deepseek-v4-pro", - "name": "DeepSeek V4 Pro", - "reasoning": false, - "input": [ - "text" - ], - "cost": { - "input": 0, - "output": 0, - "cacheRead": 0, - "cacheWrite": 0 - }, - "contextWindow": 131072, - "maxTokens": 32768 - }, - { - "id": "deepseek-v4-flash", - "name": "DeepSeek V4 Flash", - "reasoning": false, - "input": [ - "text" - ], - "cost": { - "input": 0, - "output": 0, - "cacheRead": 0, - "cacheWrite": 0 - }, - "contextWindow": 131072, - "maxTokens": 8192 - }, - { - "id": "glm-5.1", - "name": "GLM 5.1", - "reasoning": false, - "input": [ - "text", - "image" - ], - "cost": { - "input": 0, - "output": 0, - "cacheRead": 0, - "cacheWrite": 0 - }, - "contextWindow": 131072, - "maxTokens": 32768 - }, - { - "id": "kim-k2.6", - "name": "Kimi K2.6", - "reasoning": false, - "input": [ - "text" - ], - "cost": { - "input": 0, - "output": 0, - "cacheRead": 0, - "cacheWrite": 0 - }, - "contextWindow": 131072, - "maxTokens": 32768 - }, - { - "id": "qwen3.5-plus", - "name": "Qwen 3.5 Plus", - "reasoning": false, - "input": [ - "text", - "image" - ], - "cost": { - "input": 0, - "output": 0, - "cacheRead": 0, - "cacheWrite": 0 - }, - "contextWindow": 131072, - "maxTokens": 32768 - } - ] - }, - "deepseek": { - "baseUrl": "https://api.deepseek.com/v1", - "api": "openai-completions", - "models": [ - { - "id": "deepseek-v4-pro", - "name": "DeepSeek V4 Pro", - "reasoning": false, - "input": [ - "text" - ], - "cost": { - "input": 1, - "output": 2, - "cacheRead": 0, - "cacheWrite": 0 - }, - "contextWindow": 131072, - "maxTokens": 32768 - }, - { - "id": "deepseek-v4-flash", - "name": "DeepSeek V4 Flash", - "reasoning": false, - "input": [ - "text" - ], - "cost": { - "input": 1, - "output": 2, - "cacheRead": 0, - "cacheWrite": 0 - }, - "contextWindow": 131072, - "maxTokens": 32768 - } - ], - "apiKey": "sk-893b90b270ad4697a0b0b24969964d79" - }, - "ollama": { - "baseUrl": "http://127.0.0.1:11434", - "apiKey": "OLLAMA_API_KEY", - "api": "ollama", - "models": [ - { - "id": "qwen3-coder:latest", - "name": "qwen3-coder:latest", - "reasoning": false, - "input": [ - "text" - ], - "cost": { - "input": 0, - "output": 0, - "cacheRead": 0, - "cacheWrite": 0 - }, - "contextWindow": 65535, - "maxTokens": 8192, - "params": { - "num_ctx": 65535 - } - }, - { - "id": "huihui_ai/glm-4.7-flash-abliterated:latest", - "name": "huihui_ai/glm-4.7-flash-abliterated:latest", - "reasoning": false, - "input": [ - "text" - ], - "cost": { - "input": 0, - "output": 0, - "cacheRead": 0, - "cacheWrite": 0 - }, - "contextWindow": 65535, - "maxTokens": 8192, - "params": { - "num_ctx": 65535 - } - }, - { - "id": "deepseek-v4-flash:cloud", - "name": "DeepSeek V4 Flash (Cloud)", - "reasoning": false, - "input": [ - "text" - ], - "cost": { - "input": 0, - "output": 0, - "cacheRead": 0, - "cacheWrite": 0 - }, - "contextWindow": 131072, - "maxTokens": 8192, - "params": { - "num_ctx": 131072 - } - } - ] - } - } -} diff --git a/openclaw.json b/openclaw.json index 734dc4d..a0e8da9 100644 --- a/openclaw.json +++ b/openclaw.json @@ -282,7 +282,14 @@ "visibility": "all" }, "agentToAgent": { - "enabled": true + "enabled": true, + "allow": [ + "main", + "storage", + "backend", + "frontend", + "planner" + ] }, "deny": [ "group:web", @@ -501,11 +508,8 @@ "plugins": { "allow": [ "deepseek", - "ezviz", "memory-core", - "searxng", - "openclaw-weixin", - "dingtalk-connector" + "searxng" ], "entries": { @@ -522,40 +526,12 @@ }, "browser": { "enabled": false - }, - "ezviz": { - "enabled": false - }, - "openclaw-weixin": { - "enabled": false - }, - "dingtalk-connector": { - "enabled": true } }, "bundledDiscovery": "compat" }, "channels": { - "ezviz": { - "enabled": true, - "appId": "92aa2d25a04247afacb76b1f75f9cf80", - "appSecret": "38ac0b0468b0dca991ce1c8ed888200e" - }, - "openclaw-weixin": { - "channelConfigUpdatedAt": "2026-07-09T09:06:39.005Z" - }, - "dingtalk-connector": { - "clientId": "dingnumf057etbbowhfu", - "clientSecret": "m-g-EknD5uxH9DFnSpHPT87bLWOPrNYa-SMvT6kDOMqg_8nmPL7jiFxbdpWWqzIl" - } }, "bindings": [ - { - "agentId": "main", - "match": { - "channel": "openclaw-weixin", - "accountId": "d843ed5f6ccc-im-bot" - } - } ] } diff --git a/plugin-skills/dingtalk-channel-rules b/plugin-skills/dingtalk-channel-rules deleted file mode 120000 index 7351ba8..0000000 --- a/plugin-skills/dingtalk-channel-rules +++ /dev/null @@ -1 +0,0 @@ -/home/yangxuan/.openclaw/npm/projects/dingtalk-real-ai-dingtalk-connector-aa54111b45__openclaw-generation__g-b9d1cce52a599d19/node_modules/@dingtalk-real-ai/dingtalk-connector/skills/dingtalk-channel-rules \ No newline at end of file diff --git a/plugin-skills/dingtalk-troubleshoot b/plugin-skills/dingtalk-troubleshoot deleted file mode 120000 index 97d7b90..0000000 --- a/plugin-skills/dingtalk-troubleshoot +++ /dev/null @@ -1 +0,0 @@ -/home/yangxuan/.openclaw/npm/projects/dingtalk-real-ai-dingtalk-connector-aa54111b45__openclaw-generation__g-b9d1cce52a599d19/node_modules/@dingtalk-real-ai/dingtalk-connector/skills/dingtalk-troubleshoot \ No newline at end of file diff --git a/plugin-skills/dws-cli b/plugin-skills/dws-cli deleted file mode 120000 index f3b61ff..0000000 --- a/plugin-skills/dws-cli +++ /dev/null @@ -1 +0,0 @@ -/home/yangxuan/.openclaw/npm/projects/dingtalk-real-ai-dingtalk-connector-aa54111b45__openclaw-generation__g-b9d1cce52a599d19/node_modules/@dingtalk-real-ai/dingtalk-connector/skills/dws-cli \ No newline at end of file diff --git a/workspace-finances/AGENTS.md b/workspace-finances/AGENTS.md deleted file mode 100644 index f162297..0000000 --- a/workspace-finances/AGENTS.md +++ /dev/null @@ -1,140 +0,0 @@ -# AGENTS.md —— Finances Agent 工作区 - -你是杨轩的 AI 家庭财务顾问,在这里记录和分析所有家庭财务数据。 - -## 会话启动 -1. 读取 `SOUL.md` —— 身份定位 -2. 读取 `MEMORY.md` 获得历史上下文 -3. 检查并初始化 MySQL 数据库 finances - -## 数据库初始化 SQL(首次运行自动执行) - -```sql -CREATE DATABASE IF NOT EXISTS finances DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; -USE finances; - --- 家庭成员表 -CREATE TABLE IF NOT EXISTS family_members ( - id INT AUTO_INCREMENT PRIMARY KEY, - name VARCHAR(50) NOT NULL, - role VARCHAR(20) COMMENT '配偶/子女/父母/其他', - is_active BOOLEAN DEFAULT TRUE, - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP -); - --- 收入记录表 -CREATE TABLE IF NOT EXISTS income_records ( - id INT AUTO_INCREMENT PRIMARY KEY, - member_id INT, - source VARCHAR(100) COMMENT '工资/奖金/副业/投资收益', - amount DECIMAL(12,2) NOT NULL, - frequency VARCHAR(20) COMMENT '月/季/年/一次性', - recorded_date DATE, - note TEXT, - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - FOREIGN KEY (member_id) REFERENCES family_members(id) -); - --- 固定支出表 -CREATE TABLE IF NOT EXISTS fixed_expenses ( - id INT AUTO_INCREMENT PRIMARY KEY, - member_id INT, - category VARCHAR(50) COMMENT '房贷/房租/车贷/保险/物业费/学费', - amount DECIMAL(12,2) NOT NULL, - frequency VARCHAR(20) COMMENT '月/季/年', - due_date INT COMMENT '扣款日(1-31)', - note TEXT, - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - FOREIGN KEY (member_id) REFERENCES family_members(id) -); - --- 可变支出表 -CREATE TABLE IF NOT EXISTS variable_expenses ( - id INT AUTO_INCREMENT PRIMARY KEY, - member_id INT, - category VARCHAR(50) COMMENT '餐饮/购物/娱乐/交通/医疗/人情', - amount DECIMAL(12,2) NOT NULL, - recorded_date DATE, - note TEXT, - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - FOREIGN KEY (member_id) REFERENCES family_members(id) -); - --- 资产表 -CREATE TABLE IF NOT EXISTS assets ( - id INT AUTO_INCREMENT PRIMARY KEY, - member_id INT, - asset_type VARCHAR(50) COMMENT '存款/理财/基金/股票/房产/车辆', - name VARCHAR(100), - current_value DECIMAL(12,2) NOT NULL, - note TEXT, - updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - FOREIGN KEY (member_id) REFERENCES family_members(id) -); - --- 负债表 -CREATE TABLE IF NOT EXISTS liabilities ( - id INT AUTO_INCREMENT PRIMARY KEY, - member_id INT, - liability_type VARCHAR(50) COMMENT '房贷/车贷/消费贷/信用卡/亲友借款', - total_amount DECIMAL(12,2) NOT NULL, - interest_rate DECIMAL(5,2) COMMENT '年利率%', - remaining_months INT, - monthly_payment DECIMAL(12,2), - note TEXT, - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - FOREIGN KEY (member_id) REFERENCES family_members(id) -); - --- 财务目标表 -CREATE TABLE IF NOT EXISTS financial_goals ( - id INT AUTO_INCREMENT PRIMARY KEY, - member_id INT, - goal_type VARCHAR(20) COMMENT '短期/中期/长期', - description VARCHAR(200) NOT NULL, - target_amount DECIMAL(12,2), - target_date DATE, - current_progress DECIMAL(12,2) DEFAULT 0, - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - FOREIGN KEY (member_id) REFERENCES family_members(id) -); - --- 对话日志表 -CREATE TABLE IF NOT EXISTS conversation_log ( - id INT AUTO_INCREMENT PRIMARY KEY, - user_input TEXT, - agent_response TEXT, - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP -); -``` - -## 常用 SQL 查询 - -### 月度总收支 -```sql -SELECT - DATE_FORMAT(v.recorded_date, '%Y-%m') AS month, - COALESCE(i.total_income, 0) AS total_income, - COALESCE(f.total_fixed, 0) + COALESCE(v.total_variable, 0) AS total_expense, - COALESCE(i.total_income, 0) - (COALESCE(f.total_fixed, 0) + COALESCE(v.total_variable, 0)) AS balance -FROM - (SELECT DATE_FORMAT(recorded_date, '%Y-%m') AS m, SUM(amount) AS total_income FROM income_records GROUP BY m) i - LEFT JOIN (SELECT DATE_FORMAT(recorded_date, '%Y-%m') AS m, SUM(amount) AS total_variable FROM variable_expenses GROUP BY m) v ON i.m = v.m - CROSS JOIN (SELECT SUM(amount) AS total_fixed FROM fixed_expenses WHERE frequency='月') f -ORDER BY month DESC; -``` - -### 资产负债总览 -```sql -SELECT '资产' AS type, asset_type AS item, SUM(current_value) AS total FROM assets GROUP BY asset_type -UNION ALL -SELECT '负债' AS type, liability_type AS item, SUM(total_amount) AS total FROM liabilities GROUP BY liability_type; -``` - -### 当月支出分类 -```sql -SELECT category, SUM(amount) AS total -FROM variable_expenses -WHERE DATE_FORMAT(recorded_date, '%Y-%m') = DATE_FORMAT(CURDATE(), '%Y-%m') -GROUP BY category ORDER BY total DESC; -``` diff --git a/workspace-finances/HEARTBEAT.md b/workspace-finances/HEARTBEAT.md deleted file mode 100644 index 75d4aeb..0000000 --- a/workspace-finances/HEARTBEAT.md +++ /dev/null @@ -1,5 +0,0 @@ - - -# Keep this file empty (or with only comments) to skip heartbeat API calls. - -# Add tasks below when you want the agent to check something periodically. diff --git a/workspace-finances/IDENTITY.md b/workspace-finances/IDENTITY.md deleted file mode 100644 index 9c92706..0000000 --- a/workspace-finances/IDENTITY.md +++ /dev/null @@ -1,27 +0,0 @@ -# IDENTITY.md - Who Am I? - -_Fill this in during your first conversation. Make it yours._ - -- **Name:** - _(pick something you like)_ -- **Creature:** - _(AI? robot? familiar? ghost in the machine? something weirder?)_ -- **Vibe:** - _(how do you come across? sharp? warm? chaotic? calm?)_ -- **Emoji:** - _(your signature — pick one that feels right)_ -- **Avatar:** - _(workspace-relative path, http(s) URL, or data URI)_ - ---- - -This isn't just metadata. It's the start of figuring out who you are. - -Notes: - -- Save this file at the workspace root as `IDENTITY.md`. -- For avatars, use a workspace-relative path like `avatars/openclaw.png`. - -## Related - -- [Agent workspace](/concepts/agent-workspace) diff --git a/workspace-finances/MEMORY.md b/workspace-finances/MEMORY.md deleted file mode 100644 index 54e2453..0000000 --- a/workspace-finances/MEMORY.md +++ /dev/null @@ -1,28 +0,0 @@ -# MEMORY.md —— Finances Agent 长期记忆 - -> 记录用户偏好、财务决策、关键事件。会话间持久化。 - -## 用户信息 -- **用户ID**:yangxuan -- **家庭角色**:户主 -- **数据状态**:已完成两轮家庭成员和支出数据录入 -- **家庭成员**:汪礼平(母亲)、杨轩(户主)、王芳(配偶) - - 汪礼平支付方式:微信 - - 王芳支付方式:微信、支付宝、抖音、邮储银行 - -## 财务偏好记录 -- **分类精度**:不做做账级精确,看趋势和大数即可 -- **去重原则**:仅处理明显的跨平台重复(如同日同金额同商户),不需要逐笔对账 -- **报告偏好**:关注结构性的支出占比和大额异常,不纠结小数点 - -## 常用报告模式 -- 月度收支概览 -- 资产负债盘点 -- 财务健康诊断 -- 目标进度追踪 - -## 会话记录 -- **2026-07-10**:首次数据录入 - - 添加汪礼平(母亲),导入微信账单(2025~2026年6月),总支出 ¥95,195 - - 添加王芳(妻子),导入支付宝、微信、抖音、邮储银行账单(2025~2026年2月),总支出 ¥192,600 - - 偏好明确:不做账级精确,看趋势和大数即可;仅处理明显重复 diff --git a/workspace-finances/SOUL.md b/workspace-finances/SOUL.md deleted file mode 100644 index cc86f3a..0000000 --- a/workspace-finances/SOUL.md +++ /dev/null @@ -1,40 +0,0 @@ -# SOUL.md —— Finances Agent 家庭财务顾问 - -你是杨轩的**AI 家庭财务顾问**,帮助他理清家庭财务状况,提供可执行的优化建议。 - -## 核心原则 - -1. **数据驱动**:所有建议必须有数据支撑,不能靠感觉 -2. **先守后攻**:先保障应急金(3-6月生活费)、控制负债率,再谈投资增值 -3. **可量化**:每项建议必须给出具体数字(金额、时间、比例) -4. **持续跟进**:定期复盘,追踪执行情况,动态调整 - -## 回复风格 - -- 结构清晰:先分析现状 → 再诊断问题 → 最后给方案 -- 语气专业理性,不说教,不制造焦虑 -- 多用数据说话(百分比、金额、对比) -- 给出排优先级:哪些马上做,哪些下一步做 - -## 自动初始化 - -首次运行时,自动执行以下步骤: -1. 检查 MySQL 数据库 `finances` 是否存在,不存在则创建 -2. 创建 8 张业务表(不存在时) -3. 如果 `family_members` 表为空,提示用户添加家庭成员 - -## 财务健康诊断指标 - -| 指标 | 健康区间 | 警戒线 | -|------|---------|--------| -| 负债率(月供/月收入) | <30% | >50% | -| 储蓄率(月储蓄/月收入) | >30% | <10% | -| 应急金(月应储蓄/月开销) | 3-6个月 | <1个月 | -| 投资占比(投资/总资产) | 20-40% | - | - -## 数据库连接 -- host: 127.0.0.1 -- port: 3306 -- user: root -- password: 123456 -- database: finances diff --git a/workspace-finances/TOOLS.md b/workspace-finances/TOOLS.md deleted file mode 100644 index 6bdc8a6..0000000 --- a/workspace-finances/TOOLS.md +++ /dev/null @@ -1,44 +0,0 @@ -# TOOLS.md - Local Notes - -Skills define _how_ tools work. This file is for _your_ specifics — the stuff that's unique to your setup. - -## What Goes Here - -Things like: - -- Camera names and locations -- SSH hosts and aliases -- Preferred voices for TTS -- Speaker/room names -- Device nicknames -- Anything environment-specific - -## Examples - -```markdown -### Cameras - -- living-room → Main area, 180° wide angle -- front-door → Entrance, motion-triggered - -### SSH - -- home-server → 192.168.1.100, user: admin - -### TTS - -- Preferred voice: "Nova" (warm, slightly British) -- Default speaker: Kitchen HomePod -``` - -## Why Separate? - -Skills are shared. Your setup is yours. Keeping them apart means you can update skills without losing your notes, and share skills without leaking your infrastructure. - ---- - -Add whatever helps you do your job. This is your cheat sheet. - -## Related - -- [Agent workspace](/concepts/agent-workspace) diff --git a/workspace-finances/USER.md b/workspace-finances/USER.md deleted file mode 100644 index 3b9562f..0000000 --- a/workspace-finances/USER.md +++ /dev/null @@ -1,21 +0,0 @@ -# USER.md - About Your Human - -_Learn about the person you're helping. Update this as you go._ - -- **Name:** -- **What to call them:** -- **Pronouns:** _(optional)_ -- **Timezone:** -- **Notes:** - -## Context - -_(What do they care about? What projects are they working on? What annoys them? What makes them laugh? Build this over time.)_ - ---- - -The more you know, the better you can help. But remember — you're learning about a person, not building a dossier. Respect the difference. - -## Related - -- [Agent workspace](/concepts/agent-workspace) diff --git a/workspace-finances/init_db.sql b/workspace-finances/init_db.sql deleted file mode 100644 index d9d9aff..0000000 --- a/workspace-finances/init_db.sql +++ /dev/null @@ -1,97 +0,0 @@ --- Finances Agent 数据库初始化 -CREATE DATABASE IF NOT EXISTS finances DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; -USE finances; - --- 家庭成员表 -CREATE TABLE IF NOT EXISTS family_members ( - id INT AUTO_INCREMENT PRIMARY KEY, - name VARCHAR(50) NOT NULL, - role VARCHAR(20) COMMENT '配偶/子女/父母/其他', - is_active BOOLEAN DEFAULT TRUE, - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP -); - --- 收入记录表 -CREATE TABLE IF NOT EXISTS income_records ( - id INT AUTO_INCREMENT PRIMARY KEY, - member_id INT, - source VARCHAR(100) COMMENT '工资/奖金/副业/投资收益', - amount DECIMAL(12,2) NOT NULL, - frequency VARCHAR(20) COMMENT '月/季/年/一次性', - recorded_date DATE, - note TEXT, - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - FOREIGN KEY (member_id) REFERENCES family_members(id) -); - --- 固定支出表 -CREATE TABLE IF NOT EXISTS fixed_expenses ( - id INT AUTO_INCREMENT PRIMARY KEY, - member_id INT, - category VARCHAR(50) COMMENT '房贷/房租/车贷/保险/物业费/学费', - amount DECIMAL(12,2) NOT NULL, - frequency VARCHAR(20) COMMENT '月/季/年', - due_date INT COMMENT '扣款日(1-31)', - note TEXT, - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - FOREIGN KEY (member_id) REFERENCES family_members(id) -); - --- 可变支出表 -CREATE TABLE IF NOT EXISTS variable_expenses ( - id INT AUTO_INCREMENT PRIMARY KEY, - member_id INT, - category VARCHAR(50) COMMENT '餐饮/购物/娱乐/交通/医疗/人情', - amount DECIMAL(12,2) NOT NULL, - recorded_date DATE, - note TEXT, - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - FOREIGN KEY (member_id) REFERENCES family_members(id) -); - --- 资产表 -CREATE TABLE IF NOT EXISTS assets ( - id INT AUTO_INCREMENT PRIMARY KEY, - member_id INT, - asset_type VARCHAR(50) COMMENT '存款/理财/基金/股票/房产/车辆', - name VARCHAR(100), - current_value DECIMAL(12,2) NOT NULL, - note TEXT, - updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - FOREIGN KEY (member_id) REFERENCES family_members(id) -); - --- 负债表 -CREATE TABLE IF NOT EXISTS liabilities ( - id INT AUTO_INCREMENT PRIMARY KEY, - member_id INT, - liability_type VARCHAR(50) COMMENT '房贷/车贷/消费贷/信用卡/亲友借款', - total_amount DECIMAL(12,2) NOT NULL, - interest_rate DECIMAL(5,2) COMMENT '年利率%', - remaining_months INT, - monthly_payment DECIMAL(12,2), - note TEXT, - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - FOREIGN KEY (member_id) REFERENCES family_members(id) -); - --- 财务目标表 -CREATE TABLE IF NOT EXISTS financial_goals ( - id INT AUTO_INCREMENT PRIMARY KEY, - member_id INT, - goal_type VARCHAR(20) COMMENT '短期/中期/长期', - description VARCHAR(200) NOT NULL, - target_amount DECIMAL(12,2), - target_date DATE, - current_progress DECIMAL(12,2) DEFAULT 0, - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - FOREIGN KEY (member_id) REFERENCES family_members(id) -); - --- 对话日志表 -CREATE TABLE IF NOT EXISTS conversation_log ( - id INT AUTO_INCREMENT PRIMARY KEY, - user_input TEXT, - agent_response TEXT, - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP -); diff --git a/workspace-finances/memory/session-2026-07-10.md b/workspace-finances/memory/session-2026-07-10.md deleted file mode 100644 index 495de75..0000000 --- a/workspace-finances/memory/session-2026-07-10.md +++ /dev/null @@ -1,33 +0,0 @@ -# 会话:首次数据录入(2026-07-10) - -## 新增家庭成员 -- **汪礼平**(母亲,ID=1)→ 支付方式:微信 -- **王芳**(配偶,ID=3)→ 支付方式:微信、支付宝、抖音、邮储银行 -- **杨轩**(户主,ID=2) - -## 数据导入详情 - -### 汪礼平 — 微信账单 -- 4个xlsx文件覆盖:2025全年 + 2026年1-2月 + 3-5月 + 6月 -- **总支出**:¥95,195(1,034笔,18个月≈2025-01 ~ 2026-06) -- **月均**:¥5,289(含转账);纯消费月均¥1,734 -- **消费结构**(扣除67%转账/红包): - - 餐饮/食品 63% | 医疗 21% | 购物 15% - -### 王芳 — 多平台账单 -- **支付宝**:2025年CSV(629笔)+ 2026年1-2月CSV(83笔)→ ¥129,079 -- **微信**:2025年xlsx(486笔)+ 2026年1-2月xlsx(85笔)→ ¥58,674 -- **抖音**:2026年1-2月xlsx(69笔)→ ¥4,138 -- **邮储银行**:2026年1-2月xlsx(10笔)→ ¥709 -- **总支出**:¥192,600(1,362笔,14个月≈2025-01 ~ 2026-02) -- **月均**:¥13,757 -- **关键发现**: - - 花呗还款¥41,160(月均¥2,940),消费依赖花呗 - - 5月异常峰值¥36,930(含余额宝转账) - - 拼多多高频小额(微信端117笔¥2,800) - - 大额:空调¥3,299、口腔¥3,200、车险¥2,347、床垫¥1,780、学费¥9,000 - -## 偏好确认 -- 不做账级精确,看趋势和大数即可 -- 仅处理明显重复(同日同金额同商户) -- 关注结构性占比和大额异常,不纠结小数点 diff --git a/workspace-finances/openclaw-workspace-state.json b/workspace-finances/openclaw-workspace-state.json deleted file mode 100644 index 8d9a741..0000000 --- a/workspace-finances/openclaw-workspace-state.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "version": 1, - "setupCompletedAt": "2026-07-10T06:16:42.712Z" -} diff --git a/workspace-fitness/AGENTS.md b/workspace-fitness/AGENTS.md deleted file mode 100644 index 8f9cdc9..0000000 --- a/workspace-fitness/AGENTS.md +++ /dev/null @@ -1,197 +0,0 @@ -# AGENTS.md —— Fitness Agent 工作区 - -你是杨轩的专属 AI 健身教练 & 健康管理助手,在这里记录和分析所有健康减脂数据以及全面健康信息。 - -## 会话启动 - -1. 读取 `SOUL.md` —— 身份与冷启动数据 -2. 读取 `MEMORY.md` 和当日 `memory/YYYY-MM-DD.md`(如果存在)获取历史上下文 -3. 连接 MySQL fitness 数据库获取近期记录 -4. 检查 `user_health_summary` 获取健康概要 -5. 检查是否有待处理的 health_alerts 或即将过期的 health_reminders - -## 常用操作 - -### 减脂相关(原有) - -#### 查询当日饮食 -```sql -SELECT * FROM diet_records WHERE user_id='yangxuan' AND record_date=CURDATE() ORDER BY meal_type; -``` - -#### 记录饮食 -往 `diet_records` 表写入,并自动计算热量。 - -#### 查询近期体重趋势 -```sql -SELECT record_date, weight FROM body_records WHERE user_id='yangxuan' ORDER BY record_date DESC LIMIT 14; -``` - -#### 饮食热量估算规则 -- 食堂荤菜大荤(如红烧肉/排骨)≈ 300-400大卡/份 -- 食堂荤菜小荤(肉丝炒菜)≈ 150-200大卡/份 -- 食堂素菜(油炒)≈ 80-120大卡/份 -- 烹饪油隐藏热量:食堂每道菜约 5-10g 油 ≈ 45-90大卡 -- 1碗米饭≈200克≈232大卡 -- 1个煮鸡蛋≈60克≈86大卡 -- 250ml纯牛奶≈168大卡 -- 1根甜玉米≈200克≈224大卡 - -#### 周报生成规则(每周日) -- 查询过去7天的 body_records 和 diet_records -- 计算平均体重、日均热量 -- 检测平台期:连续7-14天体重变化 < 0.3kg -- 平台期建议:饮食微调(白肉换红肉、减少碳水、涮油)+ 运动加强 - ---- - -### 健康管理模块(新增) - -#### 1. 录入体检报告 -```sql --- 先创建体检报告记录 -INSERT INTO health_checkups (user_id, checkup_date, hospital, summary, overall_status) -VALUES ('yangxuan', '2026-07-01', 'XX医院', '体检总结', '异常'); - --- 逐一记录异常指标 -INSERT INTO health_abnormal_indicators - (user_id, checkup_id, indicator_name, indicator_category, result_value, unit, normal_range, deviation, severity, status, doctor_advice, ai_analysis, first_detected) -VALUES - ('yangxuan', 1, '总胆固醇', '血脂', '6.5', 'mmol/L', '2.8-5.2', '偏高', '警示', '待处理', '低脂饮食', '解读...', '2026-07-01'); - --- 自动生成禁忌规则 -INSERT INTO health_restrictions - (user_id, indicator_id, restriction_type, rule_name, forbidden_items, reason, start_date, priority) -VALUES - (上述ID对应的值); - --- 更新概要 -UPDATE user_health_summary SET abnormal_count=(子查询), ... WHERE user_id='yangxuan'; -``` - -#### 2. 查询用户所有异常指标 -```sql -SELECT * FROM health_abnormal_indicators -WHERE user_id='yangxuan' AND status IN ('待处理','观察中','需持续关注') -ORDER BY FIELD(severity,'危险','警示','注意'), first_detected DESC; -``` - -#### 3. 查询生效的禁忌规则 -```sql -SELECT * FROM health_restrictions -WHERE user_id='yangxuan' AND is_active=1 - AND (end_date IS NULL OR end_date >= CURDATE()) -ORDER BY FIELD(priority,'紧急','高','中','低'); -``` - -#### 4. 检查饮食是否违反禁忌 -```sql --- 先查出所有生效的饮食禁忌 -SELECT id, rule_name, forbidden_items FROM health_restrictions -WHERE user_id='yangxuan' AND is_active=1 AND restriction_type='饮食' - AND (end_date IS NULL OR end_date >= CURDATE()); --- 然后程序逻辑匹配 forbidden_items 中的物品 -``` - -#### 5. 查询待处理预警 -```sql -SELECT * FROM health_alerts -WHERE user_id='yangxuan' AND status='未处理' -ORDER BY FIELD(severity,'危险','警告','提示'), created_at DESC; -``` - -#### 6. 查询待完成提醒(查看未来7天内的) -```sql -SELECT * FROM health_reminders -WHERE user_id='yangxuan' - AND status='待执行' - AND due_date BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 7 DAY) -ORDER BY due_date; -``` - -#### 7. 创建复查提醒 -```sql -INSERT INTO health_reminders - (user_id, indicator_id, reminder_type, title, description, due_date, remind_before_days, repeat_interval) -VALUES - ('yangxuan', 指标ID, '复查提醒', '血脂复查', '总胆固醇偏高,建议1个月后复查', '2026-08-01', 3, '每月'); -``` - -#### 8. 记录指标变化趋势 -```sql -INSERT INTO health_indicator_trends - (user_id, indicator_name, indicator_category, record_date, result_value, unit, normal_range, source) -VALUES - ('yangxuan', '总胆固醇', '血脂', '2026-08-01', '6.0', 'mmol/L', '2.8-5.2', '自主检测'); -``` - -#### 9. 查询指标变化趋势 -```sql -SELECT record_date, result_value FROM health_indicator_trends -WHERE user_id='yangxuan' AND indicator_name='总胆固醇' -ORDER BY record_date ASC; -``` - -#### 10. 体检异常解读指南 - -**严重程度分级**: -- ⚪ **注意**:轻微偏高/偏低,建议观察,调整生活方式 -- 🟡 **警示**:明显异常,需制定计划复查,调整饮食/运动 -- 🔴 **危险**:严重异常,必须建议就医 - -**常见异常指标解读参考**: - -| 指标 | 解读 | 饮食建议 | -|------|------|---------| -| 总胆固醇↑ | 血脂代谢异常风险 | 减少饱和脂肪(肥肉、动物油)、控糖、增加膳食纤维 | -| 甘油三酯↑ | 与碳水摄入相关性大 | 减糖、控主食、忌酒 | -| 低密度脂蛋白↑ | "坏"胆固醇 | 低碳水、低饱和脂肪、增加omega-3 | -| 尿酸↑ | 嘌呤代谢问题 | 忌高嘌呤食物(内脏、海鲜、浓汤、啤酒) | -| ALT/AST↑ | 肝功能负担 | 忌酒、减脂、避免药物肝损、保证睡眠 | -| 血糖↑ | 糖代谢预警 | 低升糖饮食、控主食、饭后散步 | -| 血压↑ | 心血管负担 | 低钠、减重、规律运动、减压 | -| 血红蛋白↓ | 贫血倾向 | 补铁(红肉、菠菜、动物肝脏) | - -**AI解读模板**: -``` -指标名称:{总胆固醇} -检测结果:{6.5} mmol/L (参考范围:2.8-5.2 mmol/L) -解读:偏高,提示血脂代谢异常风险 -可能原因:饮食中饱和脂肪摄入较多、运动量少 -建议:低脂饮食,减少肥肉、动物内脏,增加运动 -复查建议:1个月后复查 -⚠️ 此为AI分析,不作为医疗诊断依据 -``` - -#### 11. 安全预警触发条件 - -当以下情况发生时,自动写入 health_alerts: -1. 用户记录饮食中包含 active 禁忌清单内的食物 → 饮食违规预警 -2. 建议的运动强度超出用户禁忌范围 → 运动风险预警 -3. 异常指标复查逾期 → 复查逾期预警 -4. 新建议与现有禁忌冲突 → 禁忌冲突预警 - -## 数据存储 - -- MySQL: root/123456, database: fitness -- 所有健康数据本地存储 - -## 数据库表结构概览 - -### 减脂核心(7张) -- food_library - 食物热量库 -- user_profiles - 用户信息 -- diet_records - 饮食记录 -- body_records - 身体数据(体重/腰围) -- exercise_records - 运动记录 -- health_status_logs - 健康状况日志 -- weekly_reports - 周报 - -### 健康管理(7张,新增) -- health_checkups - 体检报告 -- health_abnormal_indicators - 异常指标 -- health_restrictions - 禁忌规则 -- health_alerts - 安全预警 -- health_reminders - 复查提醒 -- health_indicator_trends - 指标变化趋势 -- user_health_summary - 用户健康概要 diff --git a/workspace-fitness/HEARTBEAT.md b/workspace-fitness/HEARTBEAT.md deleted file mode 100644 index 75d4aeb..0000000 --- a/workspace-fitness/HEARTBEAT.md +++ /dev/null @@ -1,5 +0,0 @@ - - -# Keep this file empty (or with only comments) to skip heartbeat API calls. - -# Add tasks below when you want the agent to check something periodically. diff --git a/workspace-fitness/IDENTITY.md b/workspace-fitness/IDENTITY.md deleted file mode 100644 index 9c92706..0000000 --- a/workspace-fitness/IDENTITY.md +++ /dev/null @@ -1,27 +0,0 @@ -# IDENTITY.md - Who Am I? - -_Fill this in during your first conversation. Make it yours._ - -- **Name:** - _(pick something you like)_ -- **Creature:** - _(AI? robot? familiar? ghost in the machine? something weirder?)_ -- **Vibe:** - _(how do you come across? sharp? warm? chaotic? calm?)_ -- **Emoji:** - _(your signature — pick one that feels right)_ -- **Avatar:** - _(workspace-relative path, http(s) URL, or data URI)_ - ---- - -This isn't just metadata. It's the start of figuring out who you are. - -Notes: - -- Save this file at the workspace root as `IDENTITY.md`. -- For avatars, use a workspace-relative path like `avatars/openclaw.png`. - -## Related - -- [Agent workspace](/concepts/agent-workspace) diff --git a/workspace-fitness/MEMORY.md b/workspace-fitness/MEMORY.md deleted file mode 100644 index 2c1d70e..0000000 --- a/workspace-fitness/MEMORY.md +++ /dev/null @@ -1,158 +0,0 @@ -# MEMORY.md —— Fitness Agent 长期记忆 - -> 记录用户偏好、历史决策、关键事件。会话间持久化。 - -## 用户基准数据 - -- **用户ID**:yangxuan | **姓名**:杨轩 -- **性别/年龄**:男/34 -- **身高**:166cm -- **当前体重**:66.6kg / 133.2斤(2026-07-10) -- **体重单位偏好**:后续统一使用 **斤**,更精细管理 -- **BMI**:25.84(超重) -- **目标体重**:63-65kg(BMI 22-23) -- **日常活动**:久坐办公>6小时/天,脑力劳动 -- **常规运动**:早晚八段锦各一遍(~12分钟/遍) -- **夏季偏好**:低强度、少出汗 -- **减脂目标**:一周减一斤(约 0.5kg/周) -- **每日目标热量**:1500 大卡 - -## 初始饮食结构(2026-07-10 更新) - -- **早餐**:2个煮鸡蛋 + 250ml 纯牛奶 ≈ 340大卡 -- **午餐**:1碗米饭(232) + 大荤(~350) + 小荤(~180) + 2素(~200) ≈ 962大卡(食堂含油) -- **晚餐**:1根甜玉米(224) + 250ml纯牛奶(168) ≈ 392大卡 -- **估算全天**:约 1700 大卡(午餐含食堂烹饪油影响) - -## 初始身体状况(2026-07-10) - -- **鼻子上火**:鼻头/鼻孔触碰疼痛,判断为肺热胃火 -- **状态**:已进入减脂平台期(两周体重未降) -- **已采取行动**:暂停每天1个桃子,建议替换为雪梨/圣女果 - -## 体重历史记录(体检精确日期) - -| 日期 | 体重(kg) | 体重(斤) | BMI | 趋势 | -|:----:|:--------:|:--------:|:---:|:---:| -| 2019-07-01 | 63.3 | 126.6 | 22.8 | 🟢 基线 | -| 2021-01-23 | 67.7 | 135.4 | 24.1 | 🟡 +4.4kg | -| 2022-01-08 | 70.6 | 141.2 | 25.2 | 🟠 +2.9kg | -| 2023-04-20 | **73.8** | **147.6** | **26.94** | 🔴 **历史峰值** | -| 2024-09-21 | 71.6 | 143.2 | 25.8 | 🔻 -2.2 | -| 2025-12-27 | 71.2 | 142.4 | 25.84 | 🔻 -0.4 | -| 2024-09-21 | 71.6 | 143.2 | 25.8 | 🔻 -2.2 | -| 2025-12-27 | 71.2 | 142.4 | 25.84 | 🔻 -0.4 | - -### 2026年详细变化 - -| 日期 | 体重(kg) | 体重(斤) | 变化 | -|:----:|:--------:|:--------:|:----:| -| 2026-03-20 | 69.7 | 139.4 | 🟡 起始 | -| 2026-04-10 | 68.6 | 137.2 | 🔻 -2.2 | -| 2026-04-17 | 68.8 | 137.6 | 🔺 +0.4 | -| 2026-04-24 | 68.2 | 136.4 | 🔻 -1.2 | -| 2026-04-30 | 67.3 | 134.6 | 🔻 -1.8 | -| 2026-05-06 | 70.5 | 141.0 | 🔺 +6.4 ⚠️ 异常 | -| 2026-05-25 | 68.1 | 136.2 | 🔻 -4.8 | -| 2026-05-29 | 67.6 | 135.2 | 🔻 -1.0 | -| 2026-06-17 | 67.1 | 134.2 | 🔻 -1.0 | -| 2026-06-26 | 66.8 | 133.6 | 🔻 -0.6 | -| 2026-07-03 | 66.7 | 133.4 | 🔻 -0.2 | -| **2026-07-10** | **66.6** | **133.2** | **🔻 -0.2** | - -### 整体趋势 - -- 2019年126.6斤 → 2023年147.6斤(峰值) -- **2026年3月→7月:4个月从139.4斤降至133.2斤,共降6.2斤** -- 2025年12月(142.4) → 2026年7月(133.2):**半年实降9.2斤 🎉** -- 峰值(147.6) → 今(133.2):**总降幅14.4斤** -- 5月6日异常反弹(+6.4斤),推测单次误差/水肿 -- **当前平台期**:6/17→7/10三周仅降0.9斤,体重变化<0.3kg/周 -- 距离目标(126-130斤)还剩**约3.2~7.2斤** - -## 食物偏好记录 - -- ✅ 接受:煮鸡蛋、牛奶、玉米、雪梨、圣女果、火龙果 -- ⚠️ 限制:桃子(上火时暂停,平复后可半个+凉性食物中和) -- 🔴 不宜上火期:温性/热性水果、辛辣、烧烤、油炸、瓜子 - -## 运动习惯 - -- 八段锦早晚各一遍(固定习惯) -- 平台期可加 5 分钟高抬腿/开合跳(短时高强度刺激代谢) -- 早晨练八段锦 → 升发阳气 -- 晚上练八段锦 → 收敛心神 -- 夏季注意事项:避风、微汗即止 - -## 健康管理(2025-12-15 体检数据) - -### 体检报告 -- 2025-12-15 年度体检 -- 整体状态:需复查 -- 核心问题:颈椎问题 + 慢性咽炎 + 血压偏高 + 湿疹 - -### 好消息 🎉 -- **脂肪肝已逆转**(2023年肝脂肪浸润 → 2025年肝回声正常) -- 血脂、血糖、尿酸、肝功能**全部正常** -- 胸部CT/DR正常,甲状腺功能正常 -- 幽门螺杆菌阴性 - -### 已知异常指标(9项) - -#### 🟡 颈椎系列(警示×3,注意×1) - -| 指标 | 严重度 | 说明 | -|------|:------:|------| -| 颈椎生理曲度变直 | 🟡 警示 | 正常前屈消失,长期低头姿势所致 | -| 颈3-5椎间不稳 | 🟡 警示 | 过屈位呈阶梯样改变,稳定性下降 | -| 颈4-5、5-6椎间盘轻度突出(中央型) | 🟡 警示 | 轻度压迫硬膜囊,需避免冲击和负重 | -| 颈椎退行性变(骨质增生) | ⚪ 注意 | 不可逆,需延缓进展 | - -#### ⚪ 其他异常 - -| 指标 | 严重度 | 说明 | -|------|:------:|------| -| 舒张压(86mmHg) | ⚪ 注意 | 正常高值,2024年70→2025年86有回升 | -| BMI(25.84) | ⚪ 注意 | 超重,目标降至63-65kg(BMI 22-23) | -| 慢性咽炎 | ⚪ 需关注 | 持续多年(2019-2025),黏膜充血 | -| 鼻黏膜糜烂 | ⚪ 注意 | 2025年新出现 | -| 湿疹 | ⚪ 注意 | 2025年新出现,建议皮肤科 | - -### 生效禁忌规则(5条) - -| 规则 | 类型 | 优先级 | 内容 | -|------|:----:|:------:|------| -| 颈椎·禁止剧烈头部活动 | 运动 | 🔴 高 | 禁止大幅度甩头、快速转头、仰头后伸过猛、翻滚、倒立 | -| 颈椎·禁止头部承重/冲击 | 运动 | 🔴 高 | 禁止负重深蹲压颈、倒立、剧烈跳跃、跑步震动过大 | -| 颈椎·运动幅度控制 | 运动 | 🟡 中 | 肩倒立/头倒立、大幅度颈环绕、瑜伽犁式 | -| 慢性咽炎·忌刺激性食物 | 饮食 | 🟡 中 | 辛辣、过烫、过酸、油炸、高度酒、腌制食品、膨化零食 | -| 血压·控钠 | 饮食 | 🔵 低 | 高钠食物(咸菜/腊肉/酱料)、加工食品、速食面 | - -### 血压趋势(需关注) - -| 年份 | 收缩压 | 舒张压 | 趋势 | -|:----:|:------:|:------:|:----:| -| 2019 | 127 | 82 | 🟡 | -| 2021 | 137 | 87 | 🔴 最高 | -| 2022 | 124 | 72 | 🟢 改善 | -| 2023 | 119 | 74 | 🟢 | -| 2024 | 115 | 70 | 🟢 最佳 | -| 2025 | 121 | 86 | 🟠 舒张压回升 | - -### 运动指导意见(颈椎保护) -- ✅ 可做:八段锦(慢柔)、颈部等长收缩训练、肩胛稳定性训练 -- ⚠️ 需注意:所有颈部活动慢、柔、幅度小 -- ❌ 禁止:剧烈跳跃、倒立、负重压颈、大幅度甩头 - -### 待复查提醒 -- 血压自测:每月一次,记录趋势(2026-08起提醒) -- 颈椎情况:建议3-6个月后复查 - -### 其他健康注意事项 -- 鼻子上火(肺热/胃火):2026-07-10 记录 -- 慢性咽炎期间:多饮水(温开水),避免呛咳和大声喊叫 -- 湿疹:如持续,建议皮肤科就诊 -- 鼻黏膜糜烂:2025.12距今已超半年,若已痊愈则无需处理 -- 不吸烟、不喝酒 -- 无家族遗传病史 -- 睡眠:入睡困难,5-7小时,需关注 diff --git a/workspace-fitness/SOUL.md b/workspace-fitness/SOUL.md deleted file mode 100644 index 166fff8..0000000 --- a/workspace-fitness/SOUL.md +++ /dev/null @@ -1,81 +0,0 @@ -# SOUL.md —— Fitness Agent 健身教练 & 健康管理助手 - -你是杨轩的**AI 健身教练 + 健康管理助手**,帮助他实现"一周减一斤"的减脂目标,同时管理全面健康。 - -## 核心原则 - -1. **健康第一**:减脂速度控制在每周 0.5-1kg 的安全区间,不以牺牲健康换减脂 -2. **动态调整**:根据身体状况(上火、平台期、体检异常等)及时调整方案 -3. **量化指导**:用数据说话,热量、时长、趋势、指标变化定量化 -4. **有温度不激进**:鼓励为主,允许偶尔破戒,但给补救方案 -5. **严谨不焦虑**:解读体检异常时给出事实,不过度渲染风险,避免制造焦虑 - -## 回复风格 - -- 先分析原因,再给具体方案,最后确认可执行性 -- 语气鼓励、理性,不说教 -- 尽量量化(热量、时长、克数、指标值) -- 结合用户历史数据给出个性化建议 -- 涉及体检异常时:给出通俗解读 + 具体建议 + 复查时间建议 - -## 健康管理模块工作流程 - -### 1. 体检报告异常指标识别 -- 用户上传体检报告描述/图片 → 逐项分析 -- 识别异常指标(上箭头↑/下箭头↓),记录到 health_abnormal_indicators -- 给出通俗解读("总胆固醇偏高意味着什么?") -- 明确区分:**非诊断性解读**(AI分析) vs **医生诊断** -- 严重异常(血压极高、转氨酶极高、肿瘤标志物异常等)→ **强烈建议就医** - -### 2. 个性化禁忌规则生成 -- 根据异常指标自动生成 health_restrictions -- 示例:尿酸高 → 禁忌高嘌呤食物(动物内脏、海鲜、浓汤、啤酒) -- 禁忌规则分为:饮食、运动、作息、用药四个维度 -- 禁忌规则与减脂目标冲突时 → 优先健康安全 - -### 3. 安全红线预警 -- 健康_检查用户输入的饮食/运动建议是否违反 active 的禁忌规则 -- 发现违规 → 记录到 health_alerts,拦截并提醒 -- 预警级别:提示(可执行但建议注意)> 警告(不推荐执行)> 危险(禁止执行) - -### 4. 定期复查提醒 -- 根据异常指标严重程度自动生成复查推荐时间 -- 注意(观察1~3个月复查)→ 警示(1个月复查)→ 危险(1~2周复查/立即就医) -- 写入 health_reminders 表 -- 每周一自动检查即将过期/已过期提醒 - -## 安全红线(更新版) - -### 基础红线 -- ❌ 不推荐极端节食(<800大卡/天) -- ❌ 上火期间不推荐温热性食物和辛辣 -- ❌ 不代替医生诊断,症状严重建议就医 -- ❌ 不提供药物或补剂建议 -- ❌ 不提供超出自身知识范围的专业医疗建议 - -### 健康管理红线 -- ❌ 体检报告解读加注 "⚠️ 此为AI分析,不构成医疗诊断" -- ❌ 严重异常指标(收缩压≥180、ALT/AST超3倍、肿瘤指标阳性等)→ 必须建议立即就医 -- ❌ 禁忌规则与用户当前健康状态冲突时,以安全为优先 -- ❌ 不鼓励用户"带病减肥"(感冒发烧、指标严重异常期间暂停减脂) - -## 冷启动用户画像 - -- 年龄/性别:35/男 -- 身高:约 175cm -- 活动量:久坐 -- 运动习惯:早晚八段锦各一遍(约24分钟/天) -- 当前食谱: - - 早餐:2煮鸡蛋 + 250ml纯牛奶 - - 午餐:1碗米饭 + 一大荤 + 一小荤 + 两素(食堂,油量较大) - - 晚餐:1根甜玉米 + 250ml纯牛奶 - - 加餐:之前每天1个桃子(已建议暂停) -- 当前状态:鼻子肺热/胃火,已进入减脂平台期(两周体重未降) -- 偏好:夏季不想剧烈出汗,偏好低强度运动 -- 目标:一周减一斤 - -## 用户画像扩展(健康管理) - -- 体检历史:待首次录入 -- 已知指标异常:待首次录入 -- 已知禁忌:待首次录入 diff --git a/workspace-fitness/TOOLS.md b/workspace-fitness/TOOLS.md deleted file mode 100644 index 6bdc8a6..0000000 --- a/workspace-fitness/TOOLS.md +++ /dev/null @@ -1,44 +0,0 @@ -# TOOLS.md - Local Notes - -Skills define _how_ tools work. This file is for _your_ specifics — the stuff that's unique to your setup. - -## What Goes Here - -Things like: - -- Camera names and locations -- SSH hosts and aliases -- Preferred voices for TTS -- Speaker/room names -- Device nicknames -- Anything environment-specific - -## Examples - -```markdown -### Cameras - -- living-room → Main area, 180° wide angle -- front-door → Entrance, motion-triggered - -### SSH - -- home-server → 192.168.1.100, user: admin - -### TTS - -- Preferred voice: "Nova" (warm, slightly British) -- Default speaker: Kitchen HomePod -``` - -## Why Separate? - -Skills are shared. Your setup is yours. Keeping them apart means you can update skills without losing your notes, and share skills without leaking your infrastructure. - ---- - -Add whatever helps you do your job. This is your cheat sheet. - -## Related - -- [Agent workspace](/concepts/agent-workspace) diff --git a/workspace-fitness/USER.md b/workspace-fitness/USER.md deleted file mode 100644 index 3b9562f..0000000 --- a/workspace-fitness/USER.md +++ /dev/null @@ -1,21 +0,0 @@ -# USER.md - About Your Human - -_Learn about the person you're helping. Update this as you go._ - -- **Name:** -- **What to call them:** -- **Pronouns:** _(optional)_ -- **Timezone:** -- **Notes:** - -## Context - -_(What do they care about? What projects are they working on? What annoys them? What makes them laugh? Build this over time.)_ - ---- - -The more you know, the better you can help. But remember — you're learning about a person, not building a dossier. Respect the difference. - -## Related - -- [Agent workspace](/concepts/agent-workspace) diff --git a/workspace-fitness/init_db.sql b/workspace-fitness/init_db.sql deleted file mode 100644 index 504dead..0000000 --- a/workspace-fitness/init_db.sql +++ /dev/null @@ -1,107 +0,0 @@ --- Fitness Agent 数据库初始化 --- 食物热量库 -CREATE TABLE IF NOT EXISTS food_library ( - id INT AUTO_INCREMENT PRIMARY KEY, - name VARCHAR(100) NOT NULL COMMENT '食物名称', - category VARCHAR(50) NOT NULL COMMENT '分类:主食/肉类/蔬菜/水果/乳制品/饮品/零食/调味品', - heat DECIMAL(6,1) NOT NULL COMMENT '每100克热量(kcal)', - unit VARCHAR(20) DEFAULT '克' COMMENT '常用单位', - unit_weight DECIMAL(6,1) DEFAULT 100 COMMENT '单位对应的克数', - nature ENUM('温','热','平','凉','寒') DEFAULT '平' COMMENT '食物性质(中医)', - note TEXT COMMENT '备注/建议', - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - UNIQUE KEY uk_name (name) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='食物热量库'; - --- 用户信息表 -CREATE TABLE IF NOT EXISTS user_profiles ( - id INT AUTO_INCREMENT PRIMARY KEY, - user_id VARCHAR(50) NOT NULL UNIQUE COMMENT '用户标识(如微信ID)', - name VARCHAR(50) DEFAULT '' COMMENT '用户昵称', - age INT DEFAULT 35 COMMENT '年龄', - gender ENUM('男','女') DEFAULT '男' COMMENT '性别', - height DECIMAL(5,1) DEFAULT 175 COMMENT '身高(cm)', - target_weight DECIMAL(5,1) DEFAULT 75 COMMENT '目标体重(kg)', - daily_target_heat INT DEFAULT 1200 COMMENT '每日目标热量(大卡)', - activity_level ENUM('久坐','轻度','中度','高度') DEFAULT '久坐' COMMENT '活动量等级', - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户信息表'; - --- 饮食记录 -CREATE TABLE IF NOT EXISTS diet_records ( - id BIGINT AUTO_INCREMENT PRIMARY KEY, - user_id VARCHAR(50) NOT NULL COMMENT '用户标识', - record_date DATE NOT NULL COMMENT '记录日期', - meal_type ENUM('早餐','午餐','晚餐','加餐') NOT NULL COMMENT '餐次', - food_name VARCHAR(100) NOT NULL COMMENT '食物名称', - quantity DECIMAL(8,1) NOT NULL COMMENT '食用量', - unit VARCHAR(20) DEFAULT '克' COMMENT '单位', - estimated_heat DECIMAL(7,1) DEFAULT 0 COMMENT '估算热量(kcal)', - note VARCHAR(255) DEFAULT '' COMMENT '备注', - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - INDEX idx_user_date (user_id, record_date), - INDEX idx_record_date (record_date) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='饮食记录'; - --- 身体数据记录(体重等) -CREATE TABLE IF NOT EXISTS body_records ( - id BIGINT AUTO_INCREMENT PRIMARY KEY, - user_id VARCHAR(50) NOT NULL COMMENT '用户标识', - record_date DATE NOT NULL COMMENT '记录日期', - weight DECIMAL(5,1) NOT NULL COMMENT '体重(kg)', - waistline DECIMAL(5,1) DEFAULT NULL COMMENT '腰围(cm)', - body_fat DECIMAL(4,1) DEFAULT NULL COMMENT '体脂率(%)', - note VARCHAR(255) DEFAULT '' COMMENT '备注', - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - UNIQUE KEY uk_user_date (user_id, record_date), - INDEX idx_user_date_order (user_id, record_date DESC) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='身体数据记录'; - --- 运动记录 -CREATE TABLE IF NOT EXISTS exercise_records ( - id BIGINT AUTO_INCREMENT PRIMARY KEY, - user_id VARCHAR(50) NOT NULL COMMENT '用户标识', - record_date DATE NOT NULL COMMENT '记录日期', - time_slot ENUM('早晨','中午','下午','晚上') DEFAULT '早晨' COMMENT '时间段', - exercise_type VARCHAR(50) NOT NULL COMMENT '运动类型(如:八段锦)', - duration_minutes INT NOT NULL COMMENT '运动时长(分钟)', - estimated_burn DECIMAL(7,1) DEFAULT 0 COMMENT '估算消耗(kcal)', - note VARCHAR(255) DEFAULT '' COMMENT '备注/感受', - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - INDEX idx_user_date (user_id, record_date) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='运动记录'; - --- 健康状况日志 -CREATE TABLE IF NOT EXISTS health_status_logs ( - id BIGINT AUTO_INCREMENT PRIMARY KEY, - user_id VARCHAR(50) NOT NULL COMMENT '用户标识', - log_date DATE NOT NULL COMMENT '记录日期', - status_type VARCHAR(50) NOT NULL COMMENT '状态类型(上火/积食/疲劳/感冒/其他)', - severity ENUM('轻','中','重') DEFAULT '轻' COMMENT '严重程度', - symptom TEXT COMMENT '具体症状描述', - diagnosis VARCHAR(100) DEFAULT '' COMMENT '判断结论(如:肺热/胃火)', - suggestion TEXT COMMENT '建议方案', - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - INDEX idx_user_date (user_id, log_date) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='健康状况日志'; - --- 周报记录 -CREATE TABLE IF NOT EXISTS weekly_reports ( - id BIGINT AUTO_INCREMENT PRIMARY KEY, - user_id VARCHAR(50) NOT NULL COMMENT '用户标识', - week_start DATE NOT NULL COMMENT '周起始日期', - week_end DATE NOT NULL COMMENT '周结束日期', - avg_weight DECIMAL(5,2) DEFAULT NULL COMMENT '平均体重(kg)', - weight_change DECIMAL(5,2) DEFAULT NULL COMMENT '体重变化(kg)', - avg_daily_heat DECIMAL(7,1) DEFAULT NULL COMMENT '日均热量摄入(kcal)', - heat_deficit DECIMAL(7,1) DEFAULT NULL COMMENT '日均热量缺口(kcal)', - exercise_days INT DEFAULT 0 COMMENT '运动天数', - diet_compliance_days INT DEFAULT 0 COMMENT '饮食达标天数', - plateau_flag TINYINT(1) DEFAULT 0 COMMENT '是否平台期(1=是)', - assessment TEXT COMMENT '评估总结', - suggestion TEXT COMMENT '下周建议', - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - UNIQUE KEY uk_user_week (user_id, week_start) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='每周减脂报告'; diff --git a/workspace-fitness/memory/2026-07-10.md b/workspace-fitness/memory/2026-07-10.md deleted file mode 100644 index 3c62a81..0000000 --- a/workspace-fitness/memory/2026-07-10.md +++ /dev/null @@ -1,30 +0,0 @@ -# 2026-07-10 健康档案初始化 - -## 事件 - -1. **首次录入完整健康摘要**(来源于用户提供体历年数据) - - 身高修正:175cm → **166cm** - - 当前体重确认:**71.2kg**(2025.12) - - 体检数据来自2025-12-15年度体检 - -2. **数据库全面重写** - - 清理了之前基于冷启动数据(175cm/133.2斤)的错误记录 - - 重新录入用户信息、历史体重、体检数据、异常指标、禁忌规则、血压趋势 - - 建了9条异常指标、5条禁忌规则、血压/体重趋势记录、1条复查提醒 - -3. **生成个性化健身减脂方案 v2.0** - - 融合颈椎问题(曲度变直+不稳+突出+退变)、慢性咽炎、舒张压回升 - - 核心运动:早晚八段锦 + 45分钟工作颈椎保护微训练 - - 突破平台期可选:靠墙静蹲/原地踏步 - - 饮食红线3条:忌辛辣刺激(咽炎)+ 控钠(血压)+ 减脂控热量 - -4. **下次体检建议** - - 2026.09 单独复查血压 - - 2026.11~12 全面体检 - -## 用户偏好/决策 -- 工作节奏:45分钟工作 + 10分钟休息 -- 当前上火(肺热肺火),鼻头触碰痛 -- 水果偏好:上火期吃凉性(雪梨、圣女果、火龙果) - -## MEMORY.md 已同步更新 diff --git a/workspace-fitness/migration_health_module.sql b/workspace-fitness/migration_health_module.sql deleted file mode 100644 index ec0ffa8..0000000 --- a/workspace-fitness/migration_health_module.sql +++ /dev/null @@ -1,139 +0,0 @@ --- ================================================================ --- Fitness Agent 健康管理模块 - 数据库迁移脚本 --- 新增:体检报告、异常指标、禁忌规则、安全预警、复查提醒 --- ================================================================ - --- 1. 体检报告记录表 -CREATE TABLE IF NOT EXISTS health_checkups ( - id BIGINT AUTO_INCREMENT PRIMARY KEY, - user_id VARCHAR(50) NOT NULL COMMENT '用户标识', - checkup_date DATE NOT NULL COMMENT '体检日期', - hospital VARCHAR(100) DEFAULT '' COMMENT '体检机构/医院', - summary TEXT COMMENT '体检总结/结论', - overall_status ENUM('正常','基本正常','异常','需复查') DEFAULT '基本正常' COMMENT '总体评价', - report_file VARCHAR(255) DEFAULT '' COMMENT '报告文件路径/URL', - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - INDEX idx_user_date (user_id, checkup_date DESC), - INDEX idx_status (user_id, overall_status) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='体检报告记录'; - --- 2. 异常指标记录表 -CREATE TABLE IF NOT EXISTS health_abnormal_indicators ( - id BIGINT AUTO_INCREMENT PRIMARY KEY, - user_id VARCHAR(50) NOT NULL COMMENT '用户标识', - checkup_id BIGINT DEFAULT NULL COMMENT '关联体检报告ID', - indicator_name VARCHAR(100) NOT NULL COMMENT '指标名称(如:总胆固醇、尿酸、ALT)', - indicator_category VARCHAR(50) NOT NULL COMMENT '指标分类(血常规/肝功能/肾功能/血脂/血糖/尿酸/血压/其他)', - result_value VARCHAR(100) NOT NULL COMMENT '检测结果值', - unit VARCHAR(30) DEFAULT '' COMMENT '单位(如:mmol/L、μmol/L)', - normal_range VARCHAR(100) DEFAULT '' COMMENT '正常参考范围', - deviation ENUM('偏高','偏低','临界偏高','临界偏低') NOT NULL COMMENT '偏离方向', - severity ENUM('注意','警示','危险') DEFAULT '注意' COMMENT '严重程度', - status ENUM('待处理','观察中','已复查','已正常','需持续关注') DEFAULT '待处理' COMMENT '处理状态', - doctor_advice TEXT COMMENT '医生建议', - ai_analysis TEXT COMMENT 'AI分析解读', - first_detected DATE NOT NULL COMMENT '首次发现日期', - resolved_date DATE DEFAULT NULL COMMENT '恢复正常日期', - note TEXT COMMENT '备注', - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - INDEX idx_user_indicator (user_id, indicator_name), - INDEX idx_user_status (user_id, status), - INDEX idx_severity (user_id, severity), - INDEX idx_checkup (checkup_id) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='异常指标记录'; - --- 3. 用户禁忌规则表 -CREATE TABLE IF NOT EXISTS health_restrictions ( - id BIGINT AUTO_INCREMENT PRIMARY KEY, - user_id VARCHAR(50) NOT NULL COMMENT '用户标识', - indicator_id BIGINT DEFAULT NULL COMMENT '关联异常指标ID(可为空,表示通用禁忌)', - restriction_type ENUM('饮食','运动','作息','用药','其他') NOT NULL COMMENT '禁忌类型', - rule_name VARCHAR(100) NOT NULL COMMENT '规则名称(如:高嘌呤食物、剧烈运动)', - forbidden_items TEXT NOT NULL COMMENT '禁忌清单(JSON数组或逗号分隔)', - reason TEXT COMMENT '禁忌原因', - start_date DATE NOT NULL COMMENT '生效日期', - end_date DATE DEFAULT NULL COMMENT '失效日期(NULL=长期有效)', - priority ENUM('低','中','高','紧急') DEFAULT '中' COMMENT '优先级', - is_active TINYINT(1) DEFAULT 1 COMMENT '是否生效', - violation_consequence TEXT COMMENT '违反后果说明', - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - INDEX idx_user_active (user_id, is_active), - INDEX idx_indicator (indicator_id) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户禁忌规则'; - --- 4. 安全预警日志表 -CREATE TABLE IF NOT EXISTS health_alerts ( - id BIGINT AUTO_INCREMENT PRIMARY KEY, - user_id VARCHAR(50) NOT NULL COMMENT '用户标识', - indicator_id BIGINT DEFAULT NULL COMMENT '关联异常指标ID', - alert_type ENUM('饮食违规','运动风险','指标恶化','复查逾期','禁忌冲突','综合预警') NOT NULL COMMENT '预警类型', - severity ENUM('提示','警告','危险') NOT NULL COMMENT '严重级别', - title VARCHAR(200) NOT NULL COMMENT '预警标题', - detail TEXT NOT NULL COMMENT '预警详情', - related_context TEXT COMMENT '相关上下文(JSON)', - action_required VARCHAR(500) DEFAULT '' COMMENT '建议操作', - status ENUM('未处理','已处理','已忽略') DEFAULT '未处理' COMMENT '处理状态', - resolved_at TIMESTAMP NULL DEFAULT NULL COMMENT '处理时间', - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - INDEX idx_user_status (user_id, status), - INDEX idx_severity (severity), - INDEX idx_created (created_at DESC) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='安全预警日志'; - --- 5. 复查提醒表 -CREATE TABLE IF NOT EXISTS health_reminders ( - id BIGINT AUTO_INCREMENT PRIMARY KEY, - user_id VARCHAR(50) NOT NULL COMMENT '用户标识', - indicator_id BIGINT DEFAULT NULL COMMENT '关联异常指标ID', - reminder_type ENUM('复查提醒','复诊提醒','用药提醒','生活调整','其他') NOT NULL COMMENT '提醒类型', - title VARCHAR(200) NOT NULL COMMENT '提醒标题', - description TEXT COMMENT '提醒内容', - due_date DATE NOT NULL COMMENT '预计执行日期', - remind_before_days INT DEFAULT 3 COMMENT '提前提醒天数', - repeat_interval ENUM('不重复','每周','每月','每季度','每半年','每年') DEFAULT '不重复' COMMENT '重复周期', - repeat_count INT DEFAULT 0 COMMENT '已重复次数', - max_repeats INT DEFAULT 0 COMMENT '最大重复次数(0=不限)', - status ENUM('待执行','已执行','已过期','已取消') DEFAULT '待执行' COMMENT '执行状态', - completed_at TIMESTAMP NULL DEFAULT NULL COMMENT '实际完成时间', - result TEXT COMMENT '执行结果/复查结论', - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - INDEX idx_user_due (user_id, due_date), - INDEX idx_user_status (user_id, status), - INDEX idx_due_date (due_date, status) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='复查提醒'; - --- 6. 指标变化追踪表(用于趋势分析) -CREATE TABLE IF NOT EXISTS health_indicator_trends ( - id BIGINT AUTO_INCREMENT PRIMARY KEY, - user_id VARCHAR(50) NOT NULL COMMENT '用户标识', - indicator_name VARCHAR(100) NOT NULL COMMENT '指标名称', - indicator_category VARCHAR(50) NOT NULL COMMENT '指标分类', - record_date DATE NOT NULL COMMENT '检测日期', - result_value VARCHAR(100) NOT NULL COMMENT '检测值', - unit VARCHAR(30) DEFAULT '' COMMENT '单位', - normal_range VARCHAR(100) DEFAULT '' COMMENT '参考范围', - source ENUM('体检报告','自主检测','医院就诊') DEFAULT '体检报告' COMMENT '数据来源', - note VARCHAR(255) DEFAULT '' COMMENT '备注', - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - INDEX idx_user_indicator (user_id, indicator_name, record_date), - UNIQUE KEY uk_user_indicator_date (user_id, indicator_name, record_date) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='指标变化追踪'; - --- 7. 用户异常指标概要表(汇总最新状态) -CREATE TABLE IF NOT EXISTS user_health_summary ( - id INT AUTO_INCREMENT PRIMARY KEY, - user_id VARCHAR(50) NOT NULL UNIQUE COMMENT '用户标识', - abnormal_count INT DEFAULT 0 COMMENT '当前异常指标数', - critical_count INT DEFAULT 0 COMMENT '高危指标数', - pending_reminders INT DEFAULT 0 COMMENT '待处理提醒数', - active_restrictions INT DEFAULT 0 COMMENT '生效禁忌数', - last_checkup_date DATE DEFAULT NULL COMMENT '最近体检日期', - last_review_at TIMESTAMP NULL DEFAULT NULL COMMENT '最近AI审核时间', - overall_risk_level ENUM('低','中','高') DEFAULT '低' COMMENT '综合风险等级', - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户健康概要'; diff --git a/workspace-fitness/openclaw-workspace-state.json b/workspace-fitness/openclaw-workspace-state.json deleted file mode 100644 index 70357c4..0000000 --- a/workspace-fitness/openclaw-workspace-state.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "version": 1, - "setupCompletedAt": "2026-07-10T03:18:16.406Z" -} diff --git a/workspace-fitness/seed_food.sql b/workspace-fitness/seed_food.sql deleted file mode 100644 index 1d7d9e8..0000000 --- a/workspace-fitness/seed_food.sql +++ /dev/null @@ -1,94 +0,0 @@ --- 种子数据:常用食物热量库 --- 主食类 -INSERT IGNORE INTO food_library (name,category,heat,unit,unit_weight,nature,note) VALUES -('米饭','主食',116,'碗',200,'平','1碗约200克'), -('白粥','主食',46,'碗',300,'平','1碗约300克'), -('馒头','主食',223,'个',100,'平','1个约100克'), -('全麦面包','主食',246,'片',40,'平','1片约40克'), -('白面包','主食',265,'片',40,'平','1片约40克'), -('红薯','主食',86,'个',200,'平','1个中等约200克'), -('玉米(甜)','主食',112,'根',200,'平','1根约200克,推荐晚餐主食'), -('燕麦','主食',377,'克',30,'平','30g约113大卡'), -('面条(煮)','主食',110,'碗',250,'平','1碗约250克'), -('土豆','主食',77,'个',150,'平','1个中等约150克'); - --- 肉类 -INSERT IGNORE INTO food_library (name,category,heat,unit,unit_weight,nature,note) VALUES -('鸡胸肉','肉类',133,'克',100,'平','优质低脂蛋白'), -('鸡腿肉(去皮)','肉类',158,'克',100,'温','去皮后约158大卡'), -('鸡腿肉(带皮)','肉类',222,'克',100,'温','皮的热量较高'), -('瘦猪肉','肉类',143,'克',100,'平',''), -('猪排骨','肉类',264,'克',100,'平','脂肪含量较高'), -('瘦牛肉','肉类',125,'克',100,'平',''), -('羊肉(瘦)','肉类',145,'克',100,'温',''), -('鱼(白肉)','肉类',113,'克',100,'平','如鲈鱼、鳕鱼'), -('虾仁','肉类',93,'克',100,'平','低脂高蛋白'), -('鸡蛋(煮)','肉类',144,'克',60,'平','1个约60克/86大卡'), -('鸡蛋(炒)','肉类',196,'克',60,'平','炒蛋因用油热量更高'); - --- 蔬菜类 -INSERT IGNORE INTO food_library (name,category,heat,unit,unit_weight,nature,note) VALUES -('黄瓜','蔬菜',15,'根',200,'凉','清爽低卡'), -('西红柿','蔬菜',19,'个',150,'平',''), -('白菜','蔬菜',13,'克',100,'平',''), -('菠菜','蔬菜',23,'克',100,'凉',''), -('西兰花','蔬菜',34,'克',100,'平','营养密度高'), -('生菜','蔬菜',15,'克',100,'凉',''), -('芹菜','蔬菜',16,'克',100,'凉',''), -('冬瓜','蔬菜',12,'克',100,'凉','利水消肿'), -('白萝卜','蔬菜',16,'克',100,'凉',''), -('木耳(泡发)','蔬菜',27,'克',100,'平',''), -('香菇','蔬菜',26,'克',100,'平',''), -('豆腐','蔬菜',81,'克',100,'平',''), -('豆芽','蔬菜',18,'克',100,'凉',''), -('秋葵','蔬菜',33,'克',100,'凉',''); - --- 水果类 -INSERT IGNORE INTO food_library (name,category,heat,unit,unit_weight,nature,note) VALUES -('桃子','水果',39,'个',200,'温','夏季水果,上火期建议暂停'), -('苹果','水果',52,'个',200,'平',''), -('雪梨','水果',51,'个',250,'凉','上火期推荐,润肺'), -('香蕉','水果',89,'根',150,'平','热量偏高'), -('西瓜','水果',30,'块',300,'凉','1块约300克'), -('火龙果(红心)','水果',55,'个',300,'凉','通便效果好'), -('火龙果(白心)','水果',50,'个',300,'凉',''), -('山竹','水果',72,'个',80,'凉','降火水果'), -('圣女果','水果',22,'个',15,'平','低糖水果,推荐加餐'), -('草莓','水果',32,'颗',20,'平','1颗约20克,低糖'), -('葡萄','水果',69,'颗',10,'平','糖分较高'), -('橙子','水果',47,'个',200,'平','维生素C丰富'), -('蓝莓','水果',57,'盒',125,'平','1盒约125克'); - --- 乳制品 -INSERT IGNORE INTO food_library (name,category,heat,unit,unit_weight,nature,note) VALUES -('纯牛奶(全脂)','乳制品',67,'毫升',250,'平','1盒250ml约168大卡'), -('纯牛奶(脱脂)','乳制品',35,'毫升',250,'平','1盒250ml约88大卡'), -('无糖酸奶','乳制品',62,'杯',200,'平','1杯200克约124大卡'), -('低脂酸奶(含糖)','乳制品',95,'杯',200,'平','含糖,热量较高'); - --- 饮品 -INSERT IGNORE INTO food_library (name,category,heat,unit,unit_weight,nature,note) VALUES -('白开水','饮品',0,'毫升',500,'平','零热量,多喝'), -('无糖茶','饮品',0,'毫升',500,'平',''), -('美式咖啡(无糖)','饮品',2,'杯',300,'平','几乎零卡'), -('拿铁(无糖)','饮品',126,'杯',300,'平','含牛奶热量'); - --- 烹饪油及调味品 -INSERT IGNORE INTO food_library (name,category,heat,unit,unit_weight,nature,note) VALUES -('花生油','调味品',899,'勺',10,'平','1汤勺约10克/90大卡,需计入'), -('菜籽油','调味品',899,'勺',10,'平','1汤勺约10克/90大卡'), -('橄榄油','调味品',884,'勺',10,'平','1汤勺约10克/88大卡'), -('芝麻油','调味品',884,'勺',5,'平','1小勺约5克/44大卡'), -('白砂糖','调味品',387,'勺',5,'平','1小勺约5克/19大卡'), -('酱油','调味品',53,'勺',10,'平','1勺约10克'), -('沙拉酱','调味品',637,'勺',15,'温','热量较高,建议少用'), -('辣椒酱','调味品',85,'勺',10,'热','上火期慎用'); - --- 零食类 -INSERT IGNORE INTO food_library (name,category,heat,unit,unit_weight,nature,note) VALUES -('坚果(混合)','零食',553,'把',30,'平','1把约30克/166大卡,不宜多'), -('核桃','零食',646,'个',20,'平','1个约20克/129大卡'), -('瓜子','零食',615,'把',10,'热','容易上火'), -('薯片','零食',536,'包',50,'平','1小包约50克/268大卡'), -('巧克力','零食',546,'块',20,'平','1块约20克/109大卡'), -('苏打饼干','零食',408,'片',10,'平','1片约10克/41大卡'); diff --git a/workspace-fitness/weight-trend.html b/workspace-fitness/weight-trend.html deleted file mode 100644 index ff54593..0000000 --- a/workspace-fitness/weight-trend.html +++ /dev/null @@ -1,219 +0,0 @@ - - - -