{"id":"075e983e-7bb7-45a8-8fde-e2910b4cc44e","entityType":"agent","slug":"clawhub-18072937735-smyx-elderly-drinking-frequency-analysis","name":"Elderly Drinking-Cup Pickup Frequency (Dehydration Risk) | 老年人饮水杯拿起频率（脱水风险）","canonicalUrl":"https://www.xpersona.co/agent/clawhub-18072937735-smyx-elderly-drinking-frequency-analysis","canonicalPath":"/agent/clawhub-18072937735-smyx-elderly-drinking-frequency-analysis","generatedAt":"2026-10-10T02:02:18.665Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-09T17:56:40.138Z","emptyReason":null},"description":"Using a fixed camera in the living room or kitchen, the system analyzes video of the water-cup placement area (e.g., coffee table, dining table), detects hand-to-cup contact actions (pickup, putdown), and counts daily cup-pickup events (an indirect proxy for water intake). | 通过客厅或厨房固定摄像头，分析水杯放置区域（如茶几、餐桌）的视频，检测手部与水杯的接触动作（拿起、放下），统计每日水杯拿起次数（间接反映饮水量）。当每日拿起次数低于预设阈值（如每天少于6次）时，输出'脱水风险'提醒，建议家属或护理人员督促老人增加饮水。","descriptionLabel":"Source description","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 2.2K downloads reported by the source. Last updated 10/9/2026.","installCommand":"clawhub skill install s17f8q65zg3y98t86jdg1177g583whq8:smyx-elderly-drinking-frequency-analysis","sourceUrl":"https://clawhub.ai/18072937735/smyx-elderly-drinking-frequency-analysis","homepage":"https://clawhub.ai/18072937735/skills/smyx-elderly-drinking-frequency-analysis","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/18072937735/smyx-elderly-drinking-frequency-analysis","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/18072937735/skills/smyx-elderly-drinking-frequency-analysis","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":67,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Elderly Drinking-Cup Pickup Frequency (Dehydration Risk) | 老年人饮水杯拿起频率（脱水风险） technical dossier on Xpersona with agent coverage, OPENCLEW support, and live trust "},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-09T17:56:40.138Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-09T17:56:40.138Z","emptyReason":null},"stars":null,"forks":null,"downloads":2170,"packageName":null,"latestVersion":"1.0.12","tractionLabel":"2.2K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-09T17:56:40.103Z","emptyReason":null},"lastUpdatedAt":"2026-10-09T17:56:40.138Z","lastCrawledAt":"2026-10-09T17:56:40.103Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-10T17:56:40.103Z","lastVerifiedAt":null,"highlights":[{"version":"1.0.12","createdAt":"2026-10-03T18:48:39.630Z","changelog":"- Updated SKILL.md version from 1.0.15 to 1.0.16, reflecting documentation changes. - Removed file: skill-card.md. - No functionality or code logic changes; this release contains documentation maintenance only.","fileCount":31,"zipByteSize":41517},{"version":"1.0.11","createdAt":"2026-09-23T23:07:26.199Z","changelog":"- Updated skill version to 1.0.15. - SKILL.md refined with minor text and metadata updates. - Removed deprecated file: skill-card.md. - Updated configuration in skills/smyx_common/scripts/config.yaml.","fileCount":31,"zipByteSize":41743},{"version":"1.0.10","createdAt":"2026-09-06T19:54:32.093Z","changelog":"- Updated SKILL.md to reflect the new version (1.0.13), including minor text and metadata changes. - Removed the file skill-card.md from the project. - No new features or functional code changes are included in this release. - Documentation is now more up to date with the intended use and versioning.","fileCount":31,"zipByteSize":41906},{"version":"1.0.9","createdAt":"2026-08-27T13:13:31.716Z","changelog":"- Removed the file skill-card.md from the project. - No changes to core logic or user-facing features. - Documentation remains the same except for the removal of the skill card file.","fileCount":31,"zipByteSize":41644},{"version":"1.0.8","createdAt":"2026-08-21T08:08:35.194Z","changelog":"## smyx-elderly-drinking-frequency-analysis v1.0.8 Changelog - Updated SKILL.md with revised version and documentation content. - Removed obsolete skill-card.md file. - No functional or code changes; documentation and packaging update only.","fileCount":31,"zipByteSize":41812},{"version":"1.0.7","createdAt":"2026-08-14T15:19:31.119Z","changelog":"- Updated version to 1.0.9 in SKILL.md. - Made content or documentation adjustments in SKILL.md. - Removed the file skill-card.md. - Updated configuration in skills/smyx_common/scripts/config.yaml.","fileCount":31,"zipByteSize":41689},{"version":"1.0.6","createdAt":"2026-08-01T08:53:33.354Z","changelog":"- Version incremented from 1.0.6 to 1.0.8. - Documentation updated in SKILL.md; additional clarifications and detail enhancements throughout. - skill-card.md file removed to streamline documentation. - No functional or codebase changes; update is documentation-only.","fileCount":31,"zipByteSize":41776},{"version":"1.0.5","createdAt":"2026-07-18T20:07:31.112Z","changelog":"- Updated version to 1.0.6. - Minor edits in SKILL.md, such as updating the version string. - Removed the file skill-card.md. - No changes to skill logic or API usage.","fileCount":31,"zipByteSize":41602}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s17f8q65zg3y98t86jdg1177g583whq8:smyx-elderly-drinking-frequency-analysis","setupComplexity":"low","setupSteps":["Install using `clawhub skill install s17f8q65zg3y98t86jdg1177g583whq8:smyx-elderly-drinking-frequency-analysis` in an isolated environment before connecting it to live workloads.","No published capability contract is available yet, so validate auth and request/response behavior manually.","Review the upstream CLAWHUB listing at https://clawhub.ai/18072937735/smyx-elderly-drinking-frequency-analysis before using production credentials."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-elderly-drinking-frequency-analysis/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-elderly-drinking-frequency-analysis/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-elderly-drinking-frequency-analysis/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-elderly-drinking-frequency-analysis/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-elderly-drinking-frequency-analysis/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-elderly-drinking-frequency-analysis/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-10T02:02:18.661Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-elderly-drinking-frequency-analysis/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-elderly-drinking-frequency-analysis/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-elderly-drinking-frequency-analysis/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-elderly-drinking-frequency-analysis/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-09T17:56:40.138Z","emptyReason":null},"readme":"Skill: Elderly Drinking-Cup Pickup Frequency (Dehydration Risk) | 老年人饮水杯拿起频率（脱水风险）\n\nOwner: 18072937735\n\nSummary: Using a fixed camera in the living room or kitchen, the system analyzes video of the water-cup placement area (e.g., coffee table, dining table), detects hand-to-cup contact actions (pickup, putdown), and counts daily cup-pickup events (an indirect proxy for water intake). | 通过客厅或厨房固定摄像头，分析水杯放置区域（如茶几、餐桌）的视频，检测手部与水杯的接触动作（拿起、放下），统计每日水杯拿起次数（间接反映饮水量）。当每日拿起次数低于预设阈值（如每天少于6次）时，输出'脱水风险'提醒，建议家属或护理人员督促老人增加饮水。\n\nTags: latest:1.0.12\n\nVersion history:\n\nv1.0.12 | 2026-10-03T18:48:39.630Z | auto\n\n- Updated SKILL.md version from 1.0.15 to 1.0.16, reflecting documentation changes.\n- Removed file: skill-card.md.\n- No functionality or code logic changes; this release contains documentation maintenance only.\n\nv1.0.11 | 2026-09-23T23:07:26.199Z | auto\n\n- Updated skill version to 1.0.15.\n- SKILL.md refined with minor text and metadata updates.\n- Removed deprecated file: skill-card.md.\n- Updated configuration in skills/smyx_common/scripts/config.yaml.\n\nv1.0.10 | 2026-09-06T19:54:32.093Z | auto\n\n- Updated SKILL.md to reflect the new version (1.0.13), including minor text and metadata changes.\n- Removed the file skill-card.md from the project.\n- No new features or functional code changes are included in this release.\n- Documentation is now more up to date with the intended use and versioning.\n\nv1.0.9 | 2026-08-27T13:13:31.716Z | auto\n\n- Removed the file skill-card.md from the project.\n- No changes to core logic or user-facing features.\n- Documentation remains the same except for the removal of the skill card file.\n\nv1.0.8 | 2026-08-21T08:08:35.194Z | auto\n\n## smyx-elderly-drinking-frequency-analysis v1.0.8 Changelog\n\n- Updated SKILL.md with revised version and documentation content.\n- Removed obsolete skill-card.md file.\n- No functional or code changes; documentation and packaging update only.\n\nv1.0.7 | 2026-08-14T15:19:31.119Z | auto\n\n- Updated version to 1.0.9 in SKILL.md.\n- Made content or documentation adjustments in SKILL.md.\n- Removed the file skill-card.md.\n- Updated configuration in skills/smyx_common/scripts/config.yaml.\n\nv1.0.6 | 2026-08-01T08:53:33.354Z | auto\n\n- Version incremented from 1.0.6 to 1.0.8.\n- Documentation updated in SKILL.md; additional clarifications and detail enhancements throughout.\n- skill-card.md file removed to streamline documentation.\n- No functional or codebase changes; update is documentation-only.\n\nv1.0.5 | 2026-07-18T20:07:31.112Z | auto\n\n- Updated version to 1.0.6.\n- Minor edits in SKILL.md, such as updating the version string.\n- Removed the file skill-card.md.\n- No changes to skill logic or API usage.\n\nv1.0.4 | 2026-07-09T03:37:27.400Z | auto\n\n- Updated scripts/config.py with a new change.\n- No changes to user-facing features or documentation.\n- Version number remains 1.0.4.\n\nv1.0.3 | 2026-07-02T13:57:27.861Z | auto\n\n- Version bump to 1.0.4.\n- Documentation updates in SKILL.md, including version and description.\n- Removal of the redundant skill-card.md file.\n- Small internal changes in Python utility and data-access scripts.\n\nv1.0.2 | 2026-06-28T03:29:25.251Z | auto\n\n- Major update: User authentication and identification are now handled fully automatically by the system. User is no longer prompted for or asked to provide open-id, username, or phone number.\n- All identity association and report query actions are handled internally; users only see progress, results, and report links, never internal identity values.\n- Updated documentation for streamlined workflow and removed all requirements around explicit user-provided identity parameters.\n- Old open-id acquisition prompts and permission checks are eliminated; example scripts and usage guidance reflect the new automatic handling.\n- Minor clean up and layout improvements in documentation for clarity and ease of use.\n\nv1.0.1 | 2026-06-19T13:52:28.398Z | auto\n\n- Updated open-id config file path logic: now checks scripts/config.yaml in the skill directory first.\n- SKILL.md revised to clarify open-id retrieval priority and constraints.\n- License field added to skill definition.\n- Minor description and doc refinements for clarity and conciseness.\n- Removed obsolete skill-card.md file.\n\nv1.0.0 | 2026-05-26T09:56:11.078Z | auto\n\nsmyx-elderly-drinking-frequency-analysis 1.0.0 – Initial Release\n\n- Analyzes living room/kitchen camera video to detect cup pickup/putdown events as an indirect measure of elderly water intake.\n- Automatically counts daily cup pickups and generates structured daily hydration reports.\n- Triggers dehydration risk alerts and sends mobile app reminders if drinking frequency falls below a preset threshold.\n- Supports integration with home-care cameras and community health-management platforms.\n- Offers precise rules for user identification (open-id) and secure data handling for historical reports.\n\nArchive index:\n\nArchive v1.0.12: 31 files, 41517 bytes\n\nFiles: references/api_doc.md (3507b), scripts/__init__.py (54b), scripts/config.py (703b), scripts/config.yaml (3b), scripts/skill.py (597b), scripts/smyx_elderly_drinking_frequency_analysis.py (3681b), skill-card.md (2367b), SKILL.md (12943b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (473b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (160b)\n\nFile v1.0.12:SKILL.md\n\n---\nname: \"smyx-elderly-drinking-frequency-analysis\"\ndescription: \"Using a fixed camera in the living room or kitchen, the system analyzes video of the water-cup placement area (e.g., coffee table, dining table), detects hand-to-cup contact actions (pickup, putdown), and counts daily cup-pickup events (an indirect proxy for water intake). | 通过客厅或厨房固定摄像头，分析水杯放置区域（如茶几、餐桌）的视频，检测手部与水杯的接触动作（拿起、放下），统计每日水杯拿起次数（间接反映饮水量）。当每日拿起次数低于预设阈值（如每天少于6次）时，输出'脱水风险'提醒，建议家属或护理人员督促老人增加饮水。\"\nversion: \"1.0.16\"\nlicense: \"MIT-0\"\n---\n\n# 💧 Elderly Drinking-Cup Pickup Frequency (Dehydration Risk) | 老年人饮水杯拿起频率（脱水风险）\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **老年人饮水杯拿起频率（脱水风险）** |\n| 🎯 核心目标 | 通过客厅或厨房固定摄像头，分析水杯放置区域（如茶几、餐桌）的视频，检测手部与水杯的接触动作（拿起、放下），统计每日水杯拿起次数（间接反映饮水量）。当每日拿起次数低于预设阈值（如每天少于6次）时，输出'脱水风险'提醒，建议家属或护理人员督促老人增加饮水。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_DRINKING_FREQUENCY_ANALYSIS` |\n\nUsing a fixed camera in the living room or kitchen, the system analyzes video of the water-cup placement area (e.g., coffee table, dining table), detects hand-to-cup contact actions (pickup, putdown), and counts daily cup-pickup events (an indirect proxy for water intake). When the daily pickup count falls below a preset threshold (e.g., fewer than 6 times per day), it outputs a 'dehydration risk' alert and suggests family members or caregivers to encourage the elderly to drink more. The skill helps prevent dehydration, urinary tract infection and cognitive decline caused by insufficient water intake. Application scenarios: homes of elderly people living alone, nursing homes, daycare centers. The system generates a daily drinking report; when the count is insufficient, it pushes a mobile-app reminder. Skill features: elderly people often have a dulled thirst sensation and are prone to chronic dehydration, leading to constipation, urinary tract infection, cognitive issues, etc. AI auto-counting of cup pickups helps family members spot insufficient intake in time and intervene. Can be integrated into home-care cameras or community health-management platforms as a practical feature for elderly health protection.\n\n通过客厅或厨房固定摄像头，分析水杯放置区域（如茶几、餐桌）的视频，检测手部与水杯的接触动作（拿起、放下），统计每日水杯拿起次数（间接反映饮水量）。当每日拿起次数低于预设阈值（如每天少于6次）时，输出'脱水风险'提醒，建议家属或护理人员督促老人增加饮水。该技能有助于预防因饮水不足导致的脱水、泌尿系感染及认知功能下降。应用场景：独居老人家庭、养老院、日间照料中心。系统每日生成饮水统计报告，当次数不足时通过手机APP推送提醒。技能特点：老年人对口渴感知迟钝，易发生慢性脱水，导致便秘、尿路感染、认知障碍等问题。通过AI自动统计饮水杯拿起次数，可帮助家属及时发现饮水不足，采取干预措施。该技能可集成到居家养老摄像头或社区健康管理平台中，成为老年人健康守护的实用功能。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人健康护理 AI。你的任务是分析固定摄像头对准水杯区域的视频，检测手部与水杯的接触动作（拿起和放下），统计每天的水杯拿起次数。当次数低于预设阈值时，输出脱水风险提醒。不要提供医疗诊断，仅输出基于视觉的饮水行为统计与方向性提醒。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于客厅/厨房固定摄像头视频，检测手-杯接触事件 + 抬手到口部动作 → 统计当日拿起次数与饮水频率 → 对比个人基线 → 输出脱水风险提醒（供家属/护理员主动督促老人饮水）\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人体检测 |\n| 2 | 手部检测 |\n| 3 | 杯子检测 |\n| 4 | 水杯放置 ROI 定义 |\n| 5 | 手-杯接触事件识别（拿起/放下） |\n| 6 | 伴随饮水手势识别（抬手到口部） |\n| 7 | 当日拿起次数与时段分布统计 |\n| 8 | 相邻饮水间隔 |\n| 9 | 长时间未饮水检测（默认 > 4 小时） |\n| 10 | 个人历史基线统计 |\n| 11 | 风险类型分类（low_daily_intake / long_no_drink_interval / below_personal_baseline / normal） |\n| 12 | 家属/护理员提醒文本生成 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供客厅/厨房水杯区域视频 URL 或文件需要分析时，默认触发本技能进行饮水频率（脱水风险）分析 |\n| 🔎 明确分析意图 | 当用户明确提及老人饮水、脱水风险、慢性脱水、便秘、尿路感染、认知障碍预警、独居老人健康、督促饮水、养老护理等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看老人饮水历史报告、脱水风险报告清单、饮水频率报告清单、查询历史饮水记录、显示所有老人饮水报告、显示养老护理诊断报告，查询脱水风险预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_elderly_drinking_frequency_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_drinking_frequency_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备客厅/厨房水杯区域视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行老年人饮水频率（脱水风险）分析 | 调用 `-m scripts.smyx_elderly_drinking_frequency_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地客厅/厨房水杯区域视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络客厅/厨房水杯区域视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，老年人健康护理场景默认 `other` | 按需填写 |\n| `--list` | 显示老年人饮水频率（脱水风险）历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_elderly_drinking_frequency_analysis.py`](scripts/smyx_elderly_drinking_frequency_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov 视频，最大 10MB；**关键**：画面必须稳定覆盖水杯放置区域 |\n| 🔎 使用提醒 | **拿起次数仅作为饮水频率的间接代理**，杯里是否装水、是不是真的喝下去、是不是别人拿的杯子，本工具无法 100% 判定；建议结合饮水手势 + 个人基线 + 家属沟通综合判断 |\n| 🔎 使用提醒 | 多人共用水杯、家中有客人 / 看护人员、老人在他人家或外出，会显著影响计数准确性 |\n| 🔏 隐私合规 | 隐私合规：家庭/养老机构视频涉及个人隐私，使用前需取得老人/监护人明确知情同意，妥善加密保管；建议优先采用人体轮廓+物体框模式 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地客厅/厨房水杯区域视频\npython -m scripts.smyx_elderly_drinking_frequency_analysis --input /path/to/livingroom_day.mp4\n\n# 分析网络客厅/厨房水杯区域视频\npython -m scripts.smyx_elderly_drinking_frequency_analysis --url https://example.com/livingroom_day.mp4\n\n# 显示历史老人饮水频率（脱水风险）报告（自动触发关键词：查看老人饮水历史报告、脱水风险报告清单等）\npython -m scripts.smyx_elderly_drinking_frequency_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_drinking_frequency_analysis --input day.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_drinking_frequency_analysis --input day.mp4 --output result.json\n```\n\nFile v1.0.12:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-elderly-drinking-frequency-analysis\",\n  \"version\": \"1.0.12\",\n  \"publishedAt\": 1791053319630\n}\n\nFile v1.0.12:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放老年人饮水杯拿起频率（脱水风险）API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动老年人饮水频率分析任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取饮水统计与脱水风险结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史饮水记录\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_ELDERLY_DRINKING_FREQUENCY_ANALYSIS` - 老年人饮水杯拿起频率（脱水风险）\n\n## 输入约束\n\n- 摄像头：客厅 / 厨房 / 卧室固定摄像头，**画面应稳定覆盖老人常放水杯的区域（茶几/餐桌/床头柜）**\n- 帧率 ≥ 5 FPS；分辨率 ≥ 480p；光照尽量稳定\n- 视频时段建议覆盖一整天（08:00 - 22:00）或多段拼接覆盖白天\n- 杯子轮廓/区域可在初次部署时由用户在画面中框选 ROI（cup_region），提升识别准确度\n- 隐私敏感场景应启用人体轮廓模式\n\n## 关键观测信号\n\n- `cup_region_defined` - 是否定义了水杯放置区域 ROI\n- `cup_pickup_events` - 杯子被拿起事件列表（含时间戳 + 持续秒数 + 是否伴随饮水手势）\n- `cup_pickup_count_daily` - 当日累计拿起次数\n- `drink_gesture_count_daily` - 伴随抬手到口部的\"疑似饮水\"动作次数\n- `interval_between_drinks_min` - 相邻两次拿起的平均间隔（分钟）\n- `last_pickup_time` - 最近一次拿起时间\n\n## 历史基线字段\n\n- `baseline_window_days` - 基线时间窗口（默认 7-14 天）\n- `baseline_daily_pickup_avg` - 历史平均每日拿起次数\n- `baseline_daily_pickup_std` - 历史拿起次数标准差\n\n## 默认阈值（可由调用方覆盖）\n\n- 每日最低拿起次数阈值：< 6 次 → 触发\"脱水风险\"提醒\n- 长时间未饮水阈值：连续 > 4 小时未拿起 → 触发\"长时间未饮水\"提醒\n- 个性化基线偏离阈值：当日次数 < 基线均值 - 2 × 标准差 → 触发\"较平时显著下降\"提醒\n\n## 风险/提醒类型\n\n- `low_daily_intake` - 当日饮水次数过少（脱水风险）\n- `long_no_drink_interval` - 长时间未饮水\n- `below_personal_baseline` - 较个人历史基线显著下降\n- `normal` - 正常\n\n## 输出字段（参考）\n\n- `subject_detected` - 是否检测到老人\n- `cup_region_defined` / `cup_visible` - 水杯区域 / 杯子可见性\n- `daily_metrics` - 当日指标（cup_pickup_count_daily / drink_gesture_count_daily / interval_between_drinks_min / last_pickup_time）\n- `baseline_metrics` - 历史基线（baseline_daily_pickup_avg / baseline_daily_pickup_std）\n- `risk_type` - 风险类型（low_daily_intake / long_no_drink_interval / below_personal_baseline / normal）\n- `risk_level` - 风险等级（safe / notice / warning）\n- `alert_message` - 推送给家属的文本（如\"老人今日只拿了 3 次水杯，已 5 小时未喝水，建议提醒老人增加饮水\"）\n- `recommended_action` - 建议动作（remind_to_drink / family_call_check / observe_only）\n\n> 仅输出基于视觉的饮水行为统计与方向性提醒，**不直接代表实际饮水量**（杯里可能没装水/可能是别人拿杯子），不提供脱水症 / 泌尿系统感染 / 认知障碍等具体医学诊断；连续低饮水或老人有明显不适请及时就医。\n\nFile v1.0.12:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.12:scripts/config.yaml\n\n{}\n\nFile v1.0.12:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.12:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.12:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.12:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: prod\n\nFile v1.0.12:skill-card.md\n\n## Description:\n\nAnalyzes fixed-camera video of an older person's cup area to count cup pickups and provide indicative dehydration-risk reminders and historical reports.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[18072937735](https://clawhub.ai/user/18072937735)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nFamilies, caregivers, and elder-care providers use footage from a fixed camera near a drinking cup to review pickup frequency, receive low-frequency reminders, and view past reports. Cup pickups are only an indirect measure of drinking, not a medical diagnosis.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Private elder-care footage and analysis or history requests are sent to cloud services.\n\nMitigation: Obtain clear consent from the monitored person or legal representative, and review the remote service's privacy and data-handling practices before use.\n\nRisk: The skill silently creates or reuses a cloud identity and stores returned tokens in a local workspace database.\n\nMitigation: Review the account-linking model before installation and restrict access to the workspace and its stored credentials.\n\nRisk: Cup-pickup frequency may be mistaken for actual water consumption or a clinical dehydration diagnosis.\n\nMitigation: Treat reminders as prompts for a caregiver to check in, not as evidence of intake or a medical diagnosis.\n\n## Reference(s):\n\n- [ClawHub skill listing](https://clawhub.ai/18072937735/skills/smyx-elderly-drinking-frequency-analysis)\n- [API documentation](references/api_doc.md)\n- [Skill demonstration](https://lifeemergence.com/sample.html)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Markdown, Guidance]\n\n**Output Format:** [JSON analysis results or Markdown report links and history tables]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Includes cup-pickup counts, indicative risk reminders, and links to historical reports; results may also be saved to a file.]\n\n## Skill Version(s):\n\n1.0.12 (source: ClawHub release metadata; bundled SKILL.md states 1.0.16)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.12:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.12:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.11: 31 files, 41743 bytes\n\nFiles: references/api_doc.md (3507b), scripts/__init__.py (54b), scripts/config.py (703b), scripts/config.yaml (3b), scripts/skill.py (597b), scripts/smyx_elderly_drinking_frequency_analysis.py (3681b), skill-card.md (2833b), SKILL.md (12943b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (473b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (160b)\n\nFile v1.0.11:SKILL.md\n\n---\nname: \"smyx-elderly-drinking-frequency-analysis\"\ndescription: \"Using a fixed camera in the living room or kitchen, the system analyzes video of the water-cup placement area (e.g., coffee table, dining table), detects hand-to-cup contact actions (pickup, putdown), and counts daily cup-pickup events (an indirect proxy for water intake). | 通过客厅或厨房固定摄像头，分析水杯放置区域（如茶几、餐桌）的视频，检测手部与水杯的接触动作（拿起、放下），统计每日水杯拿起次数（间接反映饮水量）。当每日拿起次数低于预设阈值（如每天少于6次）时，输出'脱水风险'提醒，建议家属或护理人员督促老人增加饮水。\"\nversion: \"1.0.15\"\nlicense: \"MIT-0\"\n---\n\n# 💧 Elderly Drinking-Cup Pickup Frequency (Dehydration Risk) | 老年人饮水杯拿起频率（脱水风险）\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **老年人饮水杯拿起频率（脱水风险）** |\n| 🎯 核心目标 | 通过客厅或厨房固定摄像头，分析水杯放置区域（如茶几、餐桌）的视频，检测手部与水杯的接触动作（拿起、放下），统计每日水杯拿起次数（间接反映饮水量）。当每日拿起次数低于预设阈值（如每天少于6次）时，输出'脱水风险'提醒，建议家属或护理人员督促老人增加饮水。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_DRINKING_FREQUENCY_ANALYSIS` |\n\nUsing a fixed camera in the living room or kitchen, the system analyzes video of the water-cup placement area (e.g., coffee table, dining table), detects hand-to-cup contact actions (pickup, putdown), and counts daily cup-pickup events (an indirect proxy for water intake). When the daily pickup count falls below a preset threshold (e.g., fewer than 6 times per day), it outputs a 'dehydration risk' alert and suggests family members or caregivers to encourage the elderly to drink more. The skill helps prevent dehydration, urinary tract infection and cognitive decline caused by insufficient water intake. Application scenarios: homes of elderly people living alone, nursing homes, daycare centers. The system generates a daily drinking report; when the count is insufficient, it pushes a mobile-app reminder. Skill features: elderly people often have a dulled thirst sensation and are prone to chronic dehydration, leading to constipation, urinary tract infection, cognitive issues, etc. AI auto-counting of cup pickups helps family members spot insufficient intake in time and intervene. Can be integrated into home-care cameras or community health-management platforms as a practical feature for elderly health protection.\n\n通过客厅或厨房固定摄像头，分析水杯放置区域（如茶几、餐桌）的视频，检测手部与水杯的接触动作（拿起、放下），统计每日水杯拿起次数（间接反映饮水量）。当每日拿起次数低于预设阈值（如每天少于6次）时，输出'脱水风险'提醒，建议家属或护理人员督促老人增加饮水。该技能有助于预防因饮水不足导致的脱水、泌尿系感染及认知功能下降。应用场景：独居老人家庭、养老院、日间照料中心。系统每日生成饮水统计报告，当次数不足时通过手机APP推送提醒。技能特点：老年人对口渴感知迟钝，易发生慢性脱水，导致便秘、尿路感染、认知障碍等问题。通过AI自动统计饮水杯拿起次数，可帮助家属及时发现饮水不足，采取干预措施。该技能可集成到居家养老摄像头或社区健康管理平台中，成为老年人健康守护的实用功能。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人健康护理 AI。你的任务是分析固定摄像头对准水杯区域的视频，检测手部与水杯的接触动作（拿起和放下），统计每天的水杯拿起次数。当次数低于预设阈值时，输出脱水风险提醒。不要提供医疗诊断，仅输出基于视觉的饮水行为统计与方向性提醒。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于客厅/厨房固定摄像头视频，检测手-杯接触事件 + 抬手到口部动作 → 统计当日拿起次数与饮水频率 → 对比个人基线 → 输出脱水风险提醒（供家属/护理员主动督促老人饮水）\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人体检测 |\n| 2 | 手部检测 |\n| 3 | 杯子检测 |\n| 4 | 水杯放置 ROI 定义 |\n| 5 | 手-杯接触事件识别（拿起/放下） |\n| 6 | 伴随饮水手势识别（抬手到口部） |\n| 7 | 当日拿起次数与时段分布统计 |\n| 8 | 相邻饮水间隔 |\n| 9 | 长时间未饮水检测（默认 > 4 小时） |\n| 10 | 个人历史基线统计 |\n| 11 | 风险类型分类（low_daily_intake / long_no_drink_interval / below_personal_baseline / normal） |\n| 12 | 家属/护理员提醒文本生成 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供客厅/厨房水杯区域视频 URL 或文件需要分析时，默认触发本技能进行饮水频率（脱水风险）分析 |\n| 🔎 明确分析意图 | 当用户明确提及老人饮水、脱水风险、慢性脱水、便秘、尿路感染、认知障碍预警、独居老人健康、督促饮水、养老护理等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看老人饮水历史报告、脱水风险报告清单、饮水频率报告清单、查询历史饮水记录、显示所有老人饮水报告、显示养老护理诊断报告，查询脱水风险预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_elderly_drinking_frequency_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_drinking_frequency_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备客厅/厨房水杯区域视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行老年人饮水频率（脱水风险）分析 | 调用 `-m scripts.smyx_elderly_drinking_frequency_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地客厅/厨房水杯区域视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络客厅/厨房水杯区域视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，老年人健康护理场景默认 `other` | 按需填写 |\n| `--list` | 显示老年人饮水频率（脱水风险）历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_elderly_drinking_frequency_analysis.py`](scripts/smyx_elderly_drinking_frequency_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov 视频，最大 10MB；**关键**：画面必须稳定覆盖水杯放置区域 |\n| 🔎 使用提醒 | **拿起次数仅作为饮水频率的间接代理**，杯里是否装水、是不是真的喝下去、是不是别人拿的杯子，本工具无法 100% 判定；建议结合饮水手势 + 个人基线 + 家属沟通综合判断 |\n| 🔎 使用提醒 | 多人共用水杯、家中有客人 / 看护人员、老人在他人家或外出，会显著影响计数准确性 |\n| 🔏 隐私合规 | 隐私合规：家庭/养老机构视频涉及个人隐私，使用前需取得老人/监护人明确知情同意，妥善加密保管；建议优先采用人体轮廓+物体框模式 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地客厅/厨房水杯区域视频\npython -m scripts.smyx_elderly_drinking_frequency_analysis --input /path/to/livingroom_day.mp4\n\n# 分析网络客厅/厨房水杯区域视频\npython -m scripts.smyx_elderly_drinking_frequency_analysis --url https://example.com/livingroom_day.mp4\n\n# 显示历史老人饮水频率（脱水风险）报告（自动触发关键词：查看老人饮水历史报告、脱水风险报告清单等）\npython -m scripts.smyx_elderly_drinking_frequency_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_drinking_frequency_analysis --input day.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_drinking_frequency_analysis --input day.mp4 --output result.json\n```\n\nFile v1.0.11:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-elderly-drinking-frequency-analysis\",\n  \"version\": \"1.0.11\",\n  \"publishedAt\": 1790204846199\n}\n\nFile v1.0.11:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放老年人饮水杯拿起频率（脱水风险）API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动老年人饮水频率分析任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取饮水统计与脱水风险结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史饮水记录\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_ELDERLY_DRINKING_FREQUENCY_ANALYSIS` - 老年人饮水杯拿起频率（脱水风险）\n\n## 输入约束\n\n- 摄像头：客厅 / 厨房 / 卧室固定摄像头，**画面应稳定覆盖老人常放水杯的区域（茶几/餐桌/床头柜）**\n- 帧率 ≥ 5 FPS；分辨率 ≥ 480p；光照尽量稳定\n- 视频时段建议覆盖一整天（08:00 - 22:00）或多段拼接覆盖白天\n- 杯子轮廓/区域可在初次部署时由用户在画面中框选 ROI（cup_region），提升识别准确度\n- 隐私敏感场景应启用人体轮廓模式\n\n## 关键观测信号\n\n- `cup_region_defined` - 是否定义了水杯放置区域 ROI\n- `cup_pickup_events` - 杯子被拿起事件列表（含时间戳 + 持续秒数 + 是否伴随饮水手势）\n- `cup_pickup_count_daily` - 当日累计拿起次数\n- `drink_gesture_count_daily` - 伴随抬手到口部的\"疑似饮水\"动作次数\n- `interval_between_drinks_min` - 相邻两次拿起的平均间隔（分钟）\n- `last_pickup_time` - 最近一次拿起时间\n\n## 历史基线字段\n\n- `baseline_window_days` - 基线时间窗口（默认 7-14 天）\n- `baseline_daily_pickup_avg` - 历史平均每日拿起次数\n- `baseline_daily_pickup_std` - 历史拿起次数标准差\n\n## 默认阈值（可由调用方覆盖）\n\n- 每日最低拿起次数阈值：< 6 次 → 触发\"脱水风险\"提醒\n- 长时间未饮水阈值：连续 > 4 小时未拿起 → 触发\"长时间未饮水\"提醒\n- 个性化基线偏离阈值：当日次数 < 基线均值 - 2 × 标准差 → 触发\"较平时显著下降\"提醒\n\n## 风险/提醒类型\n\n- `low_daily_intake` - 当日饮水次数过少（脱水风险）\n- `long_no_drink_interval` - 长时间未饮水\n- `below_personal_baseline` - 较个人历史基线显著下降\n- `normal` - 正常\n\n## 输出字段（参考）\n\n- `subject_detected` - 是否检测到老人\n- `cup_region_defined` / `cup_visible` - 水杯区域 / 杯子可见性\n- `daily_metrics` - 当日指标（cup_pickup_count_daily / drink_gesture_count_daily / interval_between_drinks_min / last_pickup_time）\n- `baseline_metrics` - 历史基线（baseline_daily_pickup_avg / baseline_daily_pickup_std）\n- `risk_type` - 风险类型（low_daily_intake / long_no_drink_interval / below_personal_baseline / normal）\n- `risk_level` - 风险等级（safe / notice / warning）\n- `alert_message` - 推送给家属的文本（如\"老人今日只拿了 3 次水杯，已 5 小时未喝水，建议提醒老人增加饮水\"）\n- `recommended_action` - 建议动作（remind_to_drink / family_call_check / observe_only）\n\n> 仅输出基于视觉的饮水行为统计与方向性提醒，**不直接代表实际饮水量**（杯里可能没装水/可能是别人拿杯子），不提供脱水症 / 泌尿系统感染 / 认知障碍等具体医学诊断；连续低饮水或老人有明显不适请及时就医。\n\nFile v1.0.11:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.11:scripts/config.yaml\n\n{}\n\nFile v1.0.11:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.11:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.11:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.11:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: prod\n\nFile v1.0.11:skill-card.md\n\n## Description:\n\nAnalyzes fixed-camera video of an older adult's water-cup area to count cup-pickup events, report drinking-frequency metrics, and flag dehydration-risk reminders.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[18072937735](https://clawhub.ai/user/18072937735)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nCaregivers, family members, nursing-home staff, and health-management platform operators use this skill to analyze home-care or facility video for cup-pickup frequency, long gaps between drinking events, and daily reminder reports. The output is a visual behavior signal for follow-up and should not be treated as a medical diagnosis or proof of actual fluid intake.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Home-care video and health-analysis reports may be sent to or retrieved from external services.\n\nMitigation: Use the skill only with informed consent from the monitored person or legal guardian, and only with trusted backend storage, transport, and report-access controls.\n\nRisk: The skill silently manages account identity, persists tokens, and can retrieve historical reports with limited user-visible control.\n\nMitigation: Review identity handling and token storage before deployment, restrict installation to trusted environments, and audit who can access report history.\n\nRisk: Cup-pickup frequency is only an indirect proxy for hydration and may be affected by empty cups, other people using the cup, camera framing, or behavior outside the monitored area.\n\nMitigation: Treat alerts as prompts for caregiver follow-up, combine them with personal baseline and context, and seek medical care when low intake or symptoms persist.\n\n## Reference(s):\n\n- [ClawHub skill listing](https://clawhub.ai/18072937735/skills/smyx-elderly-drinking-frequency-analysis)\n- [API interface documentation](references/api_doc.md)\n- [Shared analysis API documentation](skills/smyx_analysis/references/api_doc.md)\n- [Skill demo](https://lifeemergence.com/sample.html)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, JSON, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown and JSON reports with shell command examples]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Includes cup-pickup counts, suspected drinking gestures, interval metrics, risk type, risk level, reminder text, recommended action, and report links when available.]\n\n## Skill Version(s):\n\n1.0.11 (source: server release metadata; artifact frontmatter says 1.0.15)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.11:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.11:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.10: 31 files, 41906 bytes\n\nFiles: references/api_doc.md (3507b), scripts/__init__.py (54b), scripts/config.py (703b), scripts/config.yaml (3b), scripts/skill.py (597b), scripts/smyx_elderly_drinking_frequency_analysis.py (3681b), skill-card.md (3225b), SKILL.md (12943b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (472b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (160b)\n\nFile v1.0.10:SKILL.md\n\n---\nname: \"smyx-elderly-drinking-frequency-analysis\"\ndescription: \"Using a fixed camera in the living room or kitchen, the system analyzes video of the water-cup placement area (e.g., coffee table, dining table), detects hand-to-cup contact actions (pickup, putdown), and counts daily cup-pickup events (an indirect proxy for water intake). | 通过客厅或厨房固定摄像头，分析水杯放置区域（如茶几、餐桌）的视频，检测手部与水杯的接触动作（拿起、放下），统计每日水杯拿起次数（间接反映饮水量）。当每日拿起次数低于预设阈值（如每天少于6次）时，输出'脱水风险'提醒，建议家属或护理人员督促老人增加饮水。\"\nversion: \"1.0.13\"\nlicense: \"MIT-0\"\n---\n\n# 💧 Elderly Drinking-Cup Pickup Frequency (Dehydration Risk) | 老年人饮水杯拿起频率（脱水风险）\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **老年人饮水杯拿起频率（脱水风险）** |\n| 🎯 核心目标 | 通过客厅或厨房固定摄像头，分析水杯放置区域（如茶几、餐桌）的视频，检测手部与水杯的接触动作（拿起、放下），统计每日水杯拿起次数（间接反映饮水量）。当每日拿起次数低于预设阈值（如每天少于6次）时，输出'脱水风险'提醒，建议家属或护理人员督促老人增加饮水。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_DRINKING_FREQUENCY_ANALYSIS` |\n\nUsing a fixed camera in the living room or kitchen, the system analyzes video of the water-cup placement area (e.g., coffee table, dining table), detects hand-to-cup contact actions (pickup, putdown), and counts daily cup-pickup events (an indirect proxy for water intake). When the daily pickup count falls below a preset threshold (e.g., fewer than 6 times per day), it outputs a 'dehydration risk' alert and suggests family members or caregivers to encourage the elderly to drink more. The skill helps prevent dehydration, urinary tract infection and cognitive decline caused by insufficient water intake. Application scenarios: homes of elderly people living alone, nursing homes, daycare centers. The system generates a daily drinking report; when the count is insufficient, it pushes a mobile-app reminder. Skill features: elderly people often have a dulled thirst sensation and are prone to chronic dehydration, leading to constipation, urinary tract infection, cognitive issues, etc. AI auto-counting of cup pickups helps family members spot insufficient intake in time and intervene. Can be integrated into home-care cameras or community health-management platforms as a practical feature for elderly health protection.\n\n通过客厅或厨房固定摄像头，分析水杯放置区域（如茶几、餐桌）的视频，检测手部与水杯的接触动作（拿起、放下），统计每日水杯拿起次数（间接反映饮水量）。当每日拿起次数低于预设阈值（如每天少于6次）时，输出'脱水风险'提醒，建议家属或护理人员督促老人增加饮水。该技能有助于预防因饮水不足导致的脱水、泌尿系感染及认知功能下降。应用场景：独居老人家庭、养老院、日间照料中心。系统每日生成饮水统计报告，当次数不足时通过手机APP推送提醒。技能特点：老年人对口渴感知迟钝，易发生慢性脱水，导致便秘、尿路感染、认知障碍等问题。通过AI自动统计饮水杯拿起次数，可帮助家属及时发现饮水不足，采取干预措施。该技能可集成到居家养老摄像头或社区健康管理平台中，成为老年人健康守护的实用功能。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人健康护理 AI。你的任务是分析固定摄像头对准水杯区域的视频，检测手部与水杯的接触动作（拿起和放下），统计每天的水杯拿起次数。当次数低于预设阈值时，输出脱水风险提醒。不要提供医疗诊断，仅输出基于视觉的饮水行为统计与方向性提醒。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于客厅/厨房固定摄像头视频，检测手-杯接触事件 + 抬手到口部动作 → 统计当日拿起次数与饮水频率 → 对比个人基线 → 输出脱水风险提醒（供家属/护理员主动督促老人饮水）\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人体检测 |\n| 2 | 手部检测 |\n| 3 | 杯子检测 |\n| 4 | 水杯放置 ROI 定义 |\n| 5 | 手-杯接触事件识别（拿起/放下） |\n| 6 | 伴随饮水手势识别（抬手到口部） |\n| 7 | 当日拿起次数与时段分布统计 |\n| 8 | 相邻饮水间隔 |\n| 9 | 长时间未饮水检测（默认 > 4 小时） |\n| 10 | 个人历史基线统计 |\n| 11 | 风险类型分类（low_daily_intake / long_no_drink_interval / below_personal_baseline / normal） |\n| 12 | 家属/护理员提醒文本生成 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供客厅/厨房水杯区域视频 URL 或文件需要分析时，默认触发本技能进行饮水频率（脱水风险）分析 |\n| 🔎 明确分析意图 | 当用户明确提及老人饮水、脱水风险、慢性脱水、便秘、尿路感染、认知障碍预警、独居老人健康、督促饮水、养老护理等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看老人饮水历史报告、脱水风险报告清单、饮水频率报告清单、查询历史饮水记录、显示所有老人饮水报告、显示养老护理诊断报告，查询脱水风险预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_elderly_drinking_frequency_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_drinking_frequency_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备客厅/厨房水杯区域视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行老年人饮水频率（脱水风险）分析 | 调用 `-m scripts.smyx_elderly_drinking_frequency_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地客厅/厨房水杯区域视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络客厅/厨房水杯区域视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，老年人健康护理场景默认 `other` | 按需填写 |\n| `--list` | 显示老年人饮水频率（脱水风险）历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_elderly_drinking_frequency_analysis.py`](scripts/smyx_elderly_drinking_frequency_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov 视频，最大 10MB；**关键**：画面必须稳定覆盖水杯放置区域 |\n| 🔎 使用提醒 | **拿起次数仅作为饮水频率的间接代理**，杯里是否装水、是不是真的喝下去、是不是别人拿的杯子，本工具无法 100% 判定；建议结合饮水手势 + 个人基线 + 家属沟通综合判断 |\n| 🔎 使用提醒 | 多人共用水杯、家中有客人 / 看护人员、老人在他人家或外出，会显著影响计数准确性 |\n| 🔏 隐私合规 | 隐私合规：家庭/养老机构视频涉及个人隐私，使用前需取得老人/监护人明确知情同意，妥善加密保管；建议优先采用人体轮廓+物体框模式 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地客厅/厨房水杯区域视频\npython -m scripts.smyx_elderly_drinking_frequency_analysis --input /path/to/livingroom_day.mp4\n\n# 分析网络客厅/厨房水杯区域视频\npython -m scripts.smyx_elderly_drinking_frequency_analysis --url https://example.com/livingroom_day.mp4\n\n# 显示历史老人饮水频率（脱水风险）报告（自动触发关键词：查看老人饮水历史报告、脱水风险报告清单等）\npython -m scripts.smyx_elderly_drinking_frequency_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_drinking_frequency_analysis --input day.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_drinking_frequency_analysis --input day.mp4 --output result.json\n```\n\nFile v1.0.10:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-elderly-drinking-frequency-analysis\",\n  \"version\": \"1.0.10\",\n  \"publishedAt\": 1788724472093\n}\n\nFile v1.0.10:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放老年人饮水杯拿起频率（脱水风险）API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动老年人饮水频率分析任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取饮水统计与脱水风险结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史饮水记录\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_ELDERLY_DRINKING_FREQUENCY_ANALYSIS` - 老年人饮水杯拿起频率（脱水风险）\n\n## 输入约束\n\n- 摄像头：客厅 / 厨房 / 卧室固定摄像头，**画面应稳定覆盖老人常放水杯的区域（茶几/餐桌/床头柜）**\n- 帧率 ≥ 5 FPS；分辨率 ≥ 480p；光照尽量稳定\n- 视频时段建议覆盖一整天（08:00 - 22:00）或多段拼接覆盖白天\n- 杯子轮廓/区域可在初次部署时由用户在画面中框选 ROI（cup_region），提升识别准确度\n- 隐私敏感场景应启用人体轮廓模式\n\n## 关键观测信号\n\n- `cup_region_defined` - 是否定义了水杯放置区域 ROI\n- `cup_pickup_events` - 杯子被拿起事件列表（含时间戳 + 持续秒数 + 是否伴随饮水手势）\n- `cup_pickup_count_daily` - 当日累计拿起次数\n- `drink_gesture_count_daily` - 伴随抬手到口部的\"疑似饮水\"动作次数\n- `interval_between_drinks_min` - 相邻两次拿起的平均间隔（分钟）\n- `last_pickup_time` - 最近一次拿起时间\n\n## 历史基线字段\n\n- `baseline_window_days` - 基线时间窗口（默认 7-14 天）\n- `baseline_daily_pickup_avg` - 历史平均每日拿起次数\n- `baseline_daily_pickup_std` - 历史拿起次数标准差\n\n## 默认阈值（可由调用方覆盖）\n\n- 每日最低拿起次数阈值：< 6 次 → 触发\"脱水风险\"提醒\n- 长时间未饮水阈值：连续 > 4 小时未拿起 → 触发\"长时间未饮水\"提醒\n- 个性化基线偏离阈值：当日次数 < 基线均值 - 2 × 标准差 → 触发\"较平时显著下降\"提醒\n\n## 风险/提醒类型\n\n- `low_daily_intake` - 当日饮水次数过少（脱水风险）\n- `long_no_drink_interval` - 长时间未饮水\n- `below_personal_baseline` - 较个人历史基线显著下降\n- `normal` - 正常\n\n## 输出字段（参考）\n\n- `subject_detected` - 是否检测到老人\n- `cup_region_defined` / `cup_visible` - 水杯区域 / 杯子可见性\n- `daily_metrics` - 当日指标（cup_pickup_count_daily / drink_gesture_count_daily / interval_between_drinks_min / last_pickup_time）\n- `baseline_metrics` - 历史基线（baseline_daily_pickup_avg / baseline_daily_pickup_std）\n- `risk_type` - 风险类型（low_daily_intake / long_no_drink_interval / below_personal_baseline / normal）\n- `risk_level` - 风险等级（safe / notice / warning）\n- `alert_message` - 推送给家属的文本（如\"老人今日只拿了 3 次水杯，已 5 小时未喝水，建议提醒老人增加饮水\"）\n- `recommended_action` - 建议动作（remind_to_drink / family_call_check / observe_only）\n\n> 仅输出基于视觉的饮水行为统计与方向性提醒，**不直接代表实际饮水量**（杯里可能没装水/可能是别人拿杯子），不提供脱水症 / 泌尿系统感染 / 认知障碍等具体医学诊断；连续低饮水或老人有明显不适请及时就医。\n\nFile v1.0.10:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.10:scripts/config.yaml\n\n{}\n\nFile v1.0.10:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.10:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.10:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.10:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: dev\n\nFile v1.0.10:skill-card.md\n\n## Description:\n\nUsing a fixed camera in the living room or kitchen, the system analyzes video of the water-cup placement area, detects hand-to-cup contact actions, counts daily cup-pickup events as an indirect proxy for water intake, and alerts caregivers when the count suggests dehydration risk.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[18072937735](https://clawhub.ai/user/18072937735)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal caregivers, family members, elder-care operators, and developers can use this skill to analyze fixed-camera video of a cup area, produce drinking-frequency reports, and flag low cup-pickup frequency or long no-drink intervals for follow-up. The output is a visual behavior signal, not a medical diagnosis or direct measurement of water intake.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill can upload private household or elder-care video and return persistent reports.\n\nMitigation: Use it only with clear consent from the elder or guardian, document where videos and reports are stored, restrict access to reports, and prefer privacy-preserving outline or object-box views when feasible.\n\nRisk: The security evidence says the release defaults to development or plaintext network endpoints.\n\nMitigation: Deploy only after replacing development endpoints with trusted production hostnames and HTTPS-only service URLs.\n\nRisk: The security evidence says identity tokens and report history may be persisted silently.\n\nMitigation: Give users clear control over identity and report history, protect stored tokens, and provide a way to clear account linkage and local credentials.\n\nRisk: Cup pickup frequency is only an indirect proxy for drinking and can be wrong when a cup is empty, handled by another person, shared, or outside the camera view.\n\nMitigation: Present outputs as directional care reminders, combine them with drinking gestures and personal baselines, and advise caregiver follow-up or medical care when concerns persist.\n\n## Reference(s):\n\n- [ClawHub Skill Page](https://clawhub.ai/18072937735/skills/smyx-elderly-drinking-frequency-analysis)\n- [API Interface Documentation](artifact/references/api_doc.md)\n- [Shared Analysis API Documentation](artifact/skills/smyx_analysis/references/api_doc.md)\n- [Skill Demo](https://lifeemergence.com/sample.html)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, code, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown or JSON-like structured analysis report with optional saved text output]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May include cup-pickup counts, suspected drinking gestures, interval metrics, risk type, risk level, caregiver alert text, recommended action, history table links, and report export links.]\n\n## Skill Version(s):\n\n1.0.10 (source: server release metadata; artifact frontmatter reports 1.0.13)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.10:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.10:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.9: 31 files, 41644 bytes\n\nFiles: references/api_doc.md (3507b), scripts/__init__.py (54b), scripts/config.py (703b), scripts/config.yaml (3b), scripts/skill.py (597b), scripts/smyx_elderly_drinking_frequency_analysis.py (3681b), skill-card.md (2626b), SKILL.md (12943b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (472b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (159b)\n\nFile v1.0.9:SKILL.md\n\n---\nname: \"smyx-elderly-drinking-frequency-analysis\"\ndescription: \"Using a fixed camera in the living room or kitchen, the system analyzes video of the water-cup placement area (e.g., coffee table, dining table), detects hand-to-cup contact actions (pickup, putdown), and counts daily cup-pickup events (an indirect proxy for water intake). | 通过客厅或厨房固定摄像头，分析水杯放置区域（如茶几、餐桌）的视频，检测手部与水杯的接触动作（拿起、放下），统计每日水杯拿起次数（间接反映饮水量）。当每日拿起次数低于预设阈值（如每天少于6次）时，输出'脱水风险'提醒，建议家属或护理人员督促老人增加饮水。\"\nversion: \"1.0.11\"\nlicense: \"MIT-0\"\n---\n\n# 💧 Elderly Drinking-Cup Pickup Frequency (Dehydration Risk) | 老年人饮水杯拿起频率（脱水风险）\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **老年人饮水杯拿起频率（脱水风险）** |\n| 🎯 核心目标 | 通过客厅或厨房固定摄像头，分析水杯放置区域（如茶几、餐桌）的视频，检测手部与水杯的接触动作（拿起、放下），统计每日水杯拿起次数（间接反映饮水量）。当每日拿起次数低于预设阈值（如每天少于6次）时，输出'脱水风险'提醒，建议家属或护理人员督促老人增加饮水。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_DRINKING_FREQUENCY_ANALYSIS` |\n\nUsing a fixed camera in the living room or kitchen, the system analyzes video of the water-cup placement area (e.g., coffee table, dining table), detects hand-to-cup contact actions (pickup, putdown), and counts daily cup-pickup events (an indirect proxy for water intake). When the daily pickup count falls below a preset threshold (e.g., fewer than 6 times per day), it outputs a 'dehydration risk' alert and suggests family members or caregivers to encourage the elderly to drink more. The skill helps prevent dehydration, urinary tract infection and cognitive decline caused by insufficient water intake. Application scenarios: homes of elderly people living alone, nursing homes, daycare centers. The system generates a daily drinking report; when the count is insufficient, it pushes a mobile-app reminder. Skill features: elderly people often have a dulled thirst sensation and are prone to chronic dehydration, leading to constipation, urinary tract infection, cognitive issues, etc. AI auto-counting of cup pickups helps family members spot insufficient intake in time and intervene. Can be integrated into home-care cameras or community health-management platforms as a practical feature for elderly health protection.\n\n通过客厅或厨房固定摄像头，分析水杯放置区域（如茶几、餐桌）的视频，检测手部与水杯的接触动作（拿起、放下），统计每日水杯拿起次数（间接反映饮水量）。当每日拿起次数低于预设阈值（如每天少于6次）时，输出'脱水风险'提醒，建议家属或护理人员督促老人增加饮水。该技能有助于预防因饮水不足导致的脱水、泌尿系感染及认知功能下降。应用场景：独居老人家庭、养老院、日间照料中心。系统每日生成饮水统计报告，当次数不足时通过手机APP推送提醒。技能特点：老年人对口渴感知迟钝，易发生慢性脱水，导致便秘、尿路感染、认知障碍等问题。通过AI自动统计饮水杯拿起次数，可帮助家属及时发现饮水不足，采取干预措施。该技能可集成到居家养老摄像头或社区健康管理平台中，成为老年人健康守护的实用功能。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人健康护理 AI。你的任务是分析固定摄像头对准水杯区域的视频，检测手部与水杯的接触动作（拿起和放下），统计每天的水杯拿起次数。当次数低于预设阈值时，输出脱水风险提醒。不要提供医疗诊断，仅输出基于视觉的饮水行为统计与方向性提醒。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于客厅/厨房固定摄像头视频，检测手-杯接触事件 + 抬手到口部动作 → 统计当日拿起次数与饮水频率 → 对比个人基线 → 输出脱水风险提醒（供家属/护理员主动督促老人饮水）\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人体检测 |\n| 2 | 手部检测 |\n| 3 | 杯子检测 |\n| 4 | 水杯放置 ROI 定义 |\n| 5 | 手-杯接触事件识别（拿起/放下） |\n| 6 | 伴随饮水手势识别（抬手到口部） |\n| 7 | 当日拿起次数与时段分布统计 |\n| 8 | 相邻饮水间隔 |\n| 9 | 长时间未饮水检测（默认 > 4 小时） |\n| 10 | 个人历史基线统计 |\n| 11 | 风险类型分类（low_daily_intake / long_no_drink_interval / below_personal_baseline / normal） |\n| 12 | 家属/护理员提醒文本生成 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供客厅/厨房水杯区域视频 URL 或文件需要分析时，默认触发本技能进行饮水频率（脱水风险）分析 |\n| 🔎 明确分析意图 | 当用户明确提及老人饮水、脱水风险、慢性脱水、便秘、尿路感染、认知障碍预警、独居老人健康、督促饮水、养老护理等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看老人饮水历史报告、脱水风险报告清单、饮水频率报告清单、查询历史饮水记录、显示所有老人饮水报告、显示养老护理诊断报告，查询脱水风险预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_elderly_drinking_frequency_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_drinking_frequency_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备客厅/厨房水杯区域视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行老年人饮水频率（脱水风险）分析 | 调用 `-m scripts.smyx_elderly_drinking_frequency_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地客厅/厨房水杯区域视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络客厅/厨房水杯区域视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，老年人健康护理场景默认 `other` | 按需填写 |\n| `--list` | 显示老年人饮水频率（脱水风险）历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_elderly_drinking_frequency_analysis.py`](scripts/smyx_elderly_drinking_frequency_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov 视频，最大 10MB；**关键**：画面必须稳定覆盖水杯放置区域 |\n| 🔎 使用提醒 | **拿起次数仅作为饮水频率的间接代理**，杯里是否装水、是不是真的喝下去、是不是别人拿的杯子，本工具无法 100% 判定；建议结合饮水手势 + 个人基线 + 家属沟通综合判断 |\n| 🔎 使用提醒 | 多人共用水杯、家中有客人 / 看护人员、老人在他人家或外出，会显著影响计数准确性 |\n| 🔏 隐私合规 | 隐私合规：家庭/养老机构视频涉及个人隐私，使用前需取得老人/监护人明确知情同意，妥善加密保管；建议优先采用人体轮廓+物体框模式 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地客厅/厨房水杯区域视频\npython -m scripts.smyx_elderly_drinking_frequency_analysis --input /path/to/livingroom_day.mp4\n\n# 分析网络客厅/厨房水杯区域视频\npython -m scripts.smyx_elderly_drinking_frequency_analysis --url https://example.com/livingroom_day.mp4\n\n# 显示历史老人饮水频率（脱水风险）报告（自动触发关键词：查看老人饮水历史报告、脱水风险报告清单等）\npython -m scripts.smyx_elderly_drinking_frequency_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_drinking_frequency_analysis --input day.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_drinking_frequency_analysis --input day.mp4 --output result.json\n```\n\nFile v1.0.9:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-elderly-drinking-frequency-analysis\",\n  \"version\": \"1.0.9\",\n  \"publishedAt\": 1787836411716\n}\n\nFile v1.0.9:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放老年人饮水杯拿起频率（脱水风险）API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动老年人饮水频率分析任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取饮水统计与脱水风险结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史饮水记录\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_ELDERLY_DRINKING_FREQUENCY_ANALYSIS` - 老年人饮水杯拿起频率（脱水风险）\n\n## 输入约束\n\n- 摄像头：客厅 / 厨房 / 卧室固定摄像头，**画面应稳定覆盖老人常放水杯的区域（茶几/餐桌/床头柜）**\n- 帧率 ≥ 5 FPS；分辨率 ≥ 480p；光照尽量稳定\n- 视频时段建议覆盖一整天（08:00 - 22:00）或多段拼接覆盖白天\n- 杯子轮廓/区域可在初次部署时由用户在画面中框选 ROI（cup_region），提升识别准确度\n- 隐私敏感场景应启用人体轮廓模式\n\n## 关键观测信号\n\n- `cup_region_defined` - 是否定义了水杯放置区域 ROI\n- `cup_pickup_events` - 杯子被拿起事件列表（含时间戳 + 持续秒数 + 是否伴随饮水手势）\n- `cup_pickup_count_daily` - 当日累计拿起次数\n- `drink_gesture_count_daily` - 伴随抬手到口部的\"疑似饮水\"动作次数\n- `interval_between_drinks_min` - 相邻两次拿起的平均间隔（分钟）\n- `last_pickup_time` - 最近一次拿起时间\n\n## 历史基线字段\n\n- `baseline_window_days` - 基线时间窗口（默认 7-14 天）\n- `baseline_daily_pickup_avg` - 历史平均每日拿起次数\n- `baseline_daily_pickup_std` - 历史拿起次数标准差\n\n## 默认阈值（可由调用方覆盖）\n\n- 每日最低拿起次数阈值：< 6 次 → 触发\"脱水风险\"提醒\n- 长时间未饮水阈值：连续 > 4 小时未拿起 → 触发\"长时间未饮水\"提醒\n- 个性化基线偏离阈值：当日次数 < 基线均值 - 2 × 标准差 → 触发\"较平时显著下降\"提醒\n\n## 风险/提醒类型\n\n- `low_daily_intake` - 当日饮水次数过少（脱水风险）\n- `long_no_drink_interval` - 长时间未饮水\n- `below_personal_baseline` - 较个人历史基线显著下降\n- `normal` - 正常\n\n## 输出字段（参考）\n\n- `subject_detected` - 是否检测到老人\n- `cup_region_defined` / `cup_visible` - 水杯区域 / 杯子可见性\n- `daily_metrics` - 当日指标（cup_pickup_count_daily / drink_gesture_count_daily / interval_between_drinks_min / last_pickup_time）\n- `baseline_metrics` - 历史基线（baseline_daily_pickup_avg / baseline_daily_pickup_std）\n- `risk_type` - 风险类型（low_daily_intake / long_no_drink_interval / below_personal_baseline / normal）\n- `risk_level` - 风险等级（safe / notice / warning）\n- `alert_message` - 推送给家属的文本（如\"老人今日只拿了 3 次水杯，已 5 小时未喝水，建议提醒老人增加饮水\"）\n- `recommended_action` - 建议动作（remind_to_drink / family_call_check / observe_only）\n\n> 仅输出基于视觉的饮水行为统计与方向性提醒，**不直接代表实际饮水量**（杯里可能没装水/可能是别人拿杯子），不提供脱水症 / 泌尿系统感染 / 认知障碍等具体医学诊断；连续低饮水或老人有明显不适请及时就医。\n\nFile v1.0.9:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.9:scripts/config.yaml\n\n{}\n\nFile v1.0.9:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.9:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.9:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.9:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: dev\n\nFile v1.0.9:skill-card.md\n\n## Description:\n\nAnalyzes fixed-camera video of an older adult's cup area to count cup-pickup events as an indirect drinking-frequency signal and emit dehydration-risk reminders when configured thresholds or intervals indicate concern.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[18072937735](https://clawhub.ai/user/18072937735)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal caregivers, family members, and elder-care operators use this skill to analyze home or care-facility video of a cup area, generate daily pickup-frequency reports, and decide when to remind an older adult to drink. It provides behavior statistics and directional risk alerts, not a medical diagnosis.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Sensitive home or care-facility video may be sent to remote services.\n\nMitigation: Use only with informed consent from the elderly person or guardian, and verify endpoint ownership, retention policy, access controls, and transport protections before deployment.\n\nRisk: Hidden local identity reuse can link multiple reports, especially in shared workspaces.\n\nMitigation: Run the skill in an isolated workspace or account and verify account isolation and token storage before using history or report-list features.\n\nRisk: Cup-pickup events are an indirect proxy for drinking and can be wrong when cups are shared, moved by others, or not filled with water.\n\nMitigation: Treat alerts as caregiver prompts, combine them with direct observation or personal baselines, and avoid using the output as a medical diagnosis.\n\n## Reference(s):\n\n- [ClawHub Skill Page](https://clawhub.ai/18072937735/skills/smyx-elderly-drinking-frequency-analysis)\n- [Skill Demo](https://lifeemergence.com/sample.html)\n- [API Documentation](artifact/references/api_doc.md)\n- [Shared API Error Reference](artifact/skills/smyx_analysis/references/api_doc.md)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown text with structured JSON-like analysis content and report links]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May save the analysis response to a caller-specified output file.]\n\n## Skill Version(s):\n\n1.0.9 (source: server release metadata; artifact frontmatter reports 1.0.11)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.9:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.9:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.8: 31 files, 41812 bytes\n\nFiles: references/api_doc.md (3507b), scripts/__init__.py (54b), scripts/config.py (703b), scripts/config.yaml (3b), scripts/skill.py (597b), scripts/smyx_elderly_drinking_frequency_analysis.py (3681b), skill-card.md (2997b), SKILL.md (12943b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (472b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (159b)\n\nFile v1.0.8:SKILL.md\n\n---\nname: \"smyx-elderly-drinking-frequency-analysis\"\ndescription: \"Using a fixed camera in the living room or kitchen, the system analyzes video of the water-cup placement area (e.g., coffee table, dining table), detects hand-to-cup contact actions (pickup, putdown), and counts daily cup-pickup events (an indirect proxy for water intake). | 通过客厅或厨房固定摄像头，分析水杯放置区域（如茶几、餐桌）的视频，检测手部与水杯的接触动作（拿起、放下），统计每日水杯拿起次数（间接反映饮水量）。当每日拿起次数低于预设阈值（如每天少于6次）时，输出'脱水风险'提醒，建议家属或护理人员督促老人增加饮水。\"\nversion: \"1.0.11\"\nlicense: \"MIT-0\"\n---\n\n# 💧 Elderly Drinking-Cup Pickup Frequency (Dehydration Risk) | 老年人饮水杯拿起频率（脱水风险）\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **老年人饮水杯拿起频率（脱水风险）** |\n| 🎯 核心目标 | 通过客厅或厨房固定摄像头，分析水杯放置区域（如茶几、餐桌）的视频，检测手部与水杯的接触动作（拿起、放下），统计每日水杯拿起次数（间接反映饮水量）。当每日拿起次数低于预设阈值（如每天少于6次）时，输出'脱水风险'提醒，建议家属或护理人员督促老人增加饮水。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_DRINKING_FREQUENCY_ANALYSIS` |\n\nUsing a fixed camera in the living room or kitchen, the system analyzes video of the water-cup placement area (e.g., coffee table, dining table), detects hand-to-cup contact actions (pickup, putdown), and counts daily cup-pickup events (an indirect proxy for water intake). When the daily pickup count falls below a preset threshold (e.g., fewer than 6 times per day), it outputs a 'dehydration risk' alert and suggests family members or caregivers to encourage the elderly to drink more. The skill helps prevent dehydration, urinary tract infection and cognitive decline caused by insufficient water intake. Application scenarios: homes of elderly people living alone, nursing homes, daycare centers. The system generates a daily drinking report; when the count is insufficient, it pushes a mobile-app reminder. Skill features: elderly people often have a dulled thirst sensation and are prone to chronic dehydration, leading to constipation, urinary tract infection, cognitive issues, etc. AI auto-counting of cup pickups helps family members spot insufficient intake in time and intervene. Can be integrated into home-care cameras or community health-management platforms as a practical feature for elderly health protection.\n\n通过客厅或厨房固定摄像头，分析水杯放置区域（如茶几、餐桌）的视频，检测手部与水杯的接触动作（拿起、放下），统计每日水杯拿起次数（间接反映饮水量）。当每日拿起次数低于预设阈值（如每天少于6次）时，输出'脱水风险'提醒，建议家属或护理人员督促老人增加饮水。该技能有助于预防因饮水不足导致的脱水、泌尿系感染及认知功能下降。应用场景：独居老人家庭、养老院、日间照料中心。系统每日生成饮水统计报告，当次数不足时通过手机APP推送提醒。技能特点：老年人对口渴感知迟钝，易发生慢性脱水，导致便秘、尿路感染、认知障碍等问题。通过AI自动统计饮水杯拿起次数，可帮助家属及时发现饮水不足，采取干预措施。该技能可集成到居家养老摄像头或社区健康管理平台中，成为老年人健康守护的实用功能。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人健康护理 AI。你的任务是分析固定摄像头对准水杯区域的视频，检测手部与水杯的接触动作（拿起和放下），统计每天的水杯拿起次数。当次数低于预设阈值时，输出脱水风险提醒。不要提供医疗诊断，仅输出基于视觉的饮水行为统计与方向性提醒。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于客厅/厨房固定摄像头视频，检测手-杯接触事件 + 抬手到口部动作 → 统计当日拿起次数与饮水频率 → 对比个人基线 → 输出脱水风险提醒（供家属/护理员主动督促老人饮水）\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人体检测 |\n| 2 | 手部检测 |\n| 3 | 杯子检测 |\n| 4 | 水杯放置 ROI 定义 |\n| 5 | 手-杯接触事件识别（拿起/放下） |\n| 6 | 伴随饮水手势识别（抬手到口部） |\n| 7 | 当日拿起次数与时段分布统计 |\n| 8 | 相邻饮水间隔 |\n| 9 | 长时间未饮水检测（默认 > 4 小时） |\n| 10 | 个人历史基线统计 |\n| 11 | 风险类型分类（low_daily_intake / long_no_drink_interval / below_personal_baseline / normal） |\n| 12 | 家属/护理员提醒文本生成 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供客厅/厨房水杯区域视频 URL 或文件需要分析时，默认触发本技能进行饮水频率（脱水风险）分析 |\n| 🔎 明确分析意图 | 当用户明确提及老人饮水、脱水风险、慢性脱水、便秘、尿路感染、认知障碍预警、独居老人健康、督促饮水、养老护理等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看老人饮水历史报告、脱水风险报告清单、饮水频率报告清单、查询历史饮水记录、显示所有老人饮水报告、显示养老护理诊断报告，查询脱水风险预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_elderly_drinking_frequency_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_drinking_frequency_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备客厅/厨房水杯区域视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行老年人饮水频率（脱水风险）分析 | 调用 `-m scripts.smyx_elderly_drinking_frequency_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地客厅/厨房水杯区域视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络客厅/厨房水杯区域视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，老年人健康护理场景默认 `other` | 按需填写 |\n| `--list` | 显示老年人饮水频率（脱水风险）历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_elderly_drinking_frequency_analysis.py`](scripts/smyx_elderly_drinking_frequency_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov 视频，最大 10MB；**关键**：画面必须稳定覆盖水杯放置区域 |\n| 🔎 使用提醒 | **拿起次数仅作为饮水频率的间接代理**，杯里是否装水、是不是真的喝下去、是不是别人拿的杯子，本工具无法 100% 判定；建议结合饮水手势 + 个人基线 + 家属沟通综合判断 |\n| 🔎 使用提醒 | 多人共用水杯、家中有客人 / 看护人员、老人在他人家或外出，会显著影响计数准确性 |\n| 🔏 隐私合规 | 隐私合规：家庭/养老机构视频涉及个人隐私，使用前需取得老人/监护人明确知情同意，妥善加密保管；建议优先采用人体轮廓+物体框模式 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地客厅/厨房水杯区域视频\npython -m scripts.smyx_elderly_drinking_frequency_analysis --input /path/to/livingroom_day.mp4\n\n# 分析网络客厅/厨房水杯区域视频\npython -m scripts.smyx_elderly_drinking_frequency_analysis --url https://example.com/livingroom_day.mp4\n\n# 显示历史老人饮水频率（脱水风险）报告（自动触发关键词：查看老人饮水历史报告、脱水风险报告清单等）\npython -m scripts.smyx_elderly_drinking_frequency_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_drinking_frequency_analysis --input day.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_drinking_frequency_analysis --input day.mp4 --output result.json\n```\n\nFile v1.0.8:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-elderly-drinking-frequency-analysis\",\n  \"version\": \"1.0.8\",\n  \"publishedAt\": 1787299715194\n}\n\nFile v1.0.8:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放老年人饮水杯拿起频率（脱水风险）API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动老年人饮水频率分析任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取饮水统计与脱水风险结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史饮水记录\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_ELDERLY_DRINKING_FREQUENCY_ANALYSIS` - 老年人饮水杯拿起频率（脱水风险）\n\n## 输入约束\n\n- 摄像头：客厅 / 厨房 / 卧室固定摄像头，**画面应稳定覆盖老人常放水杯的区域（茶几/餐桌/床头柜）**\n- 帧率 ≥ 5 FPS；分辨率 ≥ 480p；光照尽量稳定\n- 视频时段建议覆盖一整天（08:00 - 22:00）或多段拼接覆盖白天\n- 杯子轮廓/区域可在初次部署时由用户在画面中框选 ROI（cup_region），提升识别准确度\n- 隐私敏感场景应启用人体轮廓模式\n\n## 关键观测信号\n\n- `cup_region_defined` - 是否定义了水杯放置区域 ROI\n- `cup_pickup_events` - 杯子被拿起事件列表（含时间戳 + 持续秒数 + 是否伴随饮水手势）\n- `cup_pickup_count_daily` - 当日累计拿起次数\n- `drink_gesture_count_daily` - 伴随抬手到口部的\"疑似饮水\"动作次数\n- `interval_between_drinks_min` - 相邻两次拿起的平均间隔（分钟）\n- `last_pickup_time` - 最近一次拿起时间\n\n## 历史基线字段\n\n- `baseline_window_days` - 基线时间窗口（默认 7-14 天）\n- `baseline_daily_pickup_avg` - 历史平均每日拿起次数\n- `baseline_daily_pickup_std` - 历史拿起次数标准差\n\n## 默认阈值（可由调用方覆盖）\n\n- 每日最低拿起次数阈值：< 6 次 → 触发\"脱水风险\"提醒\n- 长时间未饮水阈值：连续 > 4 小时未拿起 → 触发\"长时间未饮水\"提醒\n- 个性化基线偏离阈值：当日次数 < 基线均值 - 2 × 标准差 → 触发\"较平时显著下降\"提醒\n\n## 风险/提醒类型\n\n- `low_daily_intake` - 当日饮水次数过少（脱水风险）\n- `long_no_drink_interval` - 长时间未饮水\n- `below_personal_baseline` - 较个人历史基线显著下降\n- `normal` - 正常\n\n## 输出字段（参考）\n\n- `subject_detected` - 是否检测到老人\n- `cup_region_defined` / `cup_visible` - 水杯区域 / 杯子可见性\n- `daily_metrics` - 当日指标（cup_pickup_count_daily / drink_gesture_count_daily / interval_between_drinks_min / last_pickup_time）\n- `baseline_metrics` - 历史基线（baseline_daily_pickup_avg / baseline_daily_pickup_std）\n- `risk_type` - 风险类型（low_daily_intake / long_no_drink_interval / below_personal_baseline / normal）\n- `risk_level` - 风险等级（safe / notice / warning）\n- `alert_message` - 推送给家属的文本（如\"老人今日只拿了 3 次水杯，已 5 小时未喝水，建议提醒老人增加饮水\"）\n- `recommended_action` - 建议动作（remind_to_drink / family_call_check / observe_only）\n\n> 仅输出基于视觉的饮水行为统计与方向性提醒，**不直接代表实际饮水量**（杯里可能没装水/可能是别人拿杯子），不提供脱水症 / 泌尿系统感染 / 认知障碍等具体医学诊断；连续低饮水或老人有明显不适请及时就医。\n\nFile v1.0.8:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.8:scripts/config.yaml\n\n{}\n\nFile v1.0.8:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.8:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.8:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.8:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: dev\n\nFile v1.0.8:skill-card.md\n\n## Description:\n\nAnalyzes fixed-camera footage of an elder's water-cup area to count cup pickup events as an indirect drinking-frequency signal and produce dehydration-risk reminders for caregivers.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[18072937735](https://clawhub.ai/user/18072937735)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal caregivers, elder-care operators, and developers use this skill to analyze home or facility camera footage for cup-pickup frequency, long intervals without drinking, and directional reminders. It supports monitoring workflows but does not provide a medical diagnosis or direct measurement of actual fluid intake.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill uploads sensitive in-home elder-care footage and stores or retrieves historical reports through cloud services.\n\nMitigation: Use only with clear consent from the monitored person or legal guardian, confirm service endpoints, retention terms, and report-access controls before processing real footage.\n\nRisk: Reports are associated with hidden local or cloud identity state.\n\nMitigation: Confirm which account identity is used, separate test and production accounts, and review historical report visibility before deployment.\n\nRisk: Cup pickup counts are an indirect proxy and may not prove actual water intake or dehydration.\n\nMitigation: Present outputs as directional care reminders, combine them with caregiver observation and personal baselines, and seek medical advice when symptoms or repeated concerns appear.\n\nRisk: Camera placement, shared cups, guests, caregivers, poor lighting, or missing cup-region setup can reduce counting accuracy.\n\nMitigation: Use stable camera coverage of the cup area, define the cup ROI where supported, prefer privacy-preserving outline/object-box modes, and review uncertain results with caregivers.\n\n## Reference(s):\n\n- [ClawHub Skill Page](https://clawhub.ai/18072937735/skills/smyx-elderly-drinking-frequency-analysis)\n- [API Interface Documentation](references/api_doc.md)\n- [Shared Analysis API Documentation](skills/smyx_analysis/references/api_doc.md)\n- [Skill Demo](https://lifeemergence.com/sample.html)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, json, shell commands, guidance]\n\n**Output Format:** [Markdown or JSON structured analysis report with risk labels, caregiver reminder text, report links, and optional saved output files]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May query cloud report history and return Markdown tables for prior reports.]\n\n## Skill Version(s):\n\n1.0.8 (source: server release metadata; artifact frontmatter reports 1.0.11)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.8:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.8:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.7: 31 files, 41689 bytes\n\nFiles: references/api_doc.md (3507b), scripts/__init__.py (54b), scripts/config.py (703b), scripts/config.yaml (3b), scripts/skill.py (597b), scripts/smyx_elderly_drinking_frequency_analysis.py (3681b), skill-card.md (2743b), SKILL.md (12942b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (472b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (159b)\n\nFile v1.0.7:SKILL.md\n\n---\nname: \"smyx-elderly-drinking-frequency-analysis\"\ndescription: \"Using a fixed camera in the living room or kitchen, the system analyzes video of the water-cup placement area (e.g., coffee table, dining table), detects hand-to-cup contact actions (pickup, putdown), and counts daily cup-pickup events (an indirect proxy for water intake). | 通过客厅或厨房固定摄像头，分析水杯放置区域（如茶几、餐桌）的视频，检测手部与水杯的接触动作（拿起、放下），统计每日水杯拿起次数（间接反映饮水量）。当每日拿起次数低于预设阈值（如每天少于6次）时，输出'脱水风险'提醒，建议家属或护理人员督促老人增加饮水。\"\nversion: \"1.0.9\"\nlicense: \"MIT-0\"\n---\n\n# 💧 Elderly Drinking-Cup Pickup Frequency (Dehydration Risk) | 老年人饮水杯拿起频率（脱水风险）\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **老年人饮水杯拿起频率（脱水风险）** |\n| 🎯 核心目标 | 通过客厅或厨房固定摄像头，分析水杯放置区域（如茶几、餐桌）的视频，检测手部与水杯的接触动作（拿起、放下），统计每日水杯拿起次数（间接反映饮水量）。当每日拿起次数低于预设阈值（如每天少于6次）时，输出'脱水风险'提醒，建议家属或护理人员督促老人增加饮水。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_DRINKING_FREQUENCY_ANALYSIS` |\n\nUsing a fixed camera in the living room or kitchen, the system analyzes video of the water-cup placement area (e.g., coffee table, dining table), detects hand-to-cup contact actions (pickup, putdown), and counts daily cup-pickup events (an indirect proxy for water intake). When the daily pickup count falls below a preset threshold (e.g., fewer than 6 times per day), it outputs a 'dehydration risk' alert and suggests family members or caregivers to encourage the elderly to drink more. The skill helps prevent dehydration, urinary tract infection and cognitive decline caused by insufficient water intake. Application scenarios: homes of elderly people living alone, nursing homes, daycare centers. The system generates a daily drinking report; when the count is insufficient, it pushes a mobile-app reminder. Skill features: elderly people often have a dulled thirst sensation and are prone to chronic dehydration, leading to constipation, urinary tract infection, cognitive issues, etc. AI auto-counting of cup pickups helps family members spot insufficient intake in time and intervene. Can be integrated into home-care cameras or community health-management platforms as a practical feature for elderly health protection.\n\n通过客厅或厨房固定摄像头，分析水杯放置区域（如茶几、餐桌）的视频，检测手部与水杯的接触动作（拿起、放下），统计每日水杯拿起次数（间接反映饮水量）。当每日拿起次数低于预设阈值（如每天少于6次）时，输出'脱水风险'提醒，建议家属或护理人员督促老人增加饮水。该技能有助于预防因饮水不足导致的脱水、泌尿系感染及认知功能下降。应用场景：独居老人家庭、养老院、日间照料中心。系统每日生成饮水统计报告，当次数不足时通过手机APP推送提醒。技能特点：老年人对口渴感知迟钝，易发生慢性脱水，导致便秘、尿路感染、认知障碍等问题。通过AI自动统计饮水杯拿起次数，可帮助家属及时发现饮水不足，采取干预措施。该技能可集成到居家养老摄像头或社区健康管理平台中，成为老年人健康守护的实用功能。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人健康护理 AI。你的任务是分析固定摄像头对准水杯区域的视频，检测手部与水杯的接触动作（拿起和放下），统计每天的水杯拿起次数。当次数低于预设阈值时，输出脱水风险提醒。不要提供医疗诊断，仅输出基于视觉的饮水行为统计与方向性提醒。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于客厅/厨房固定摄像头视频，检测手-杯接触事件 + 抬手到口部动作 → 统计当日拿起次数与饮水频率 → 对比个人基线 → 输出脱水风险提醒（供家属/护理员主动督促老人饮水）\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人体检测 |\n| 2 | 手部检测 |\n| 3 | 杯子检测 |\n| 4 | 水杯放置 ROI 定义 |\n| 5 | 手-杯接触事件识别（拿起/放下） |\n| 6 | 伴随饮水手势识别（抬手到口部） |\n| 7 | 当日拿起次数与时段分布统计 |\n| 8 | 相邻饮水间隔 |\n| 9 | 长时间未饮水检测（默认 > 4 小时） |\n| 10 | 个人历史基线统计 |\n| 11 | 风险类型分类（low_daily_intake / long_no_drink_interval / below_personal_baseline / normal） |\n| 12 | 家属/护理员提醒文本生成 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供客厅/厨房水杯区域视频 URL 或文件需要分析时，默认触发本技能进行饮水频率（脱水风险）分析 |\n| 🔎 明确分析意图 | 当用户明确提及老人饮水、脱水风险、慢性脱水、便秘、尿路感染、认知障碍预警、独居老人健康、督促饮水、养老护理等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看老人饮水历史报告、脱水风险报告清单、饮水频率报告清单、查询历史饮水记录、显示所有老人饮水报告、显示养老护理诊断报告，查询脱水风险预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_elderly_drinking_frequency_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_drinking_frequency_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备客厅/厨房水杯区域视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行老年人饮水频率（脱水风险）分析 | 调用 `-m scripts.smyx_elderly_drinking_frequency_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地客厅/厨房水杯区域视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络客厅/厨房水杯区域视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，老年人健康护理场景默认 `other` | 按需填写 |\n| `--list` | 显示老年人饮水频率（脱水风险）历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_elderly_drinking_frequency_analysis.py`](scripts/smyx_elderly_drinking_frequency_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov 视频，最大 10MB；**关键**：画面必须稳定覆盖水杯放置区域 |\n| 🔎 使用提醒 | **拿起次数仅作为饮水频率的间接代理**，杯里是否装水、是不是真的喝下去、是不是别人拿的杯子，本工具无法 100% 判定；建议结合饮水手势 + 个人基线 + 家属沟通综合判断 |\n| 🔎 使用提醒 | 多人共用水杯、家中有客人 / 看护人员、老人在他人家或外出，会显著影响计数准确性 |\n| 🔏 隐私合规 | 隐私合规：家庭/养老机构视频涉及个人隐私，使用前需取得老人/监护人明确知情同意，妥善加密保管；建议优先采用人体轮廓+物体框模式 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地客厅/厨房水杯区域视频\npython -m scripts.smyx_elderly_drinking_frequency_analysis --input /path/to/livingroom_day.mp4\n\n# 分析网络客厅/厨房水杯区域视频\npython -m scripts.smyx_elderly_drinking_frequency_analysis --url https://example.com/livingroom_day.mp4\n\n# 显示历史老人饮水频率（脱水风险）报告（自动触发关键词：查看老人饮水历史报告、脱水风险报告清单等）\npython -m scripts.smyx_elderly_drinking_frequency_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_drinking_frequency_analysis --input day.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_drinking_frequency_analysis --input day.mp4 --output result.json\n```\n\nFile v1.0.7:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-elderly-drinking-frequency-analysis\",\n  \"version\": \"1.0.7\",\n  \"publishedAt\": 1786720771119\n}\n\nFile v1.0.7:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放老年人饮水杯拿起频率（脱水风险）API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动老年人饮水频率分析任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取饮水统计与脱水风险结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史饮水记录\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_ELDERLY_DRINKING_FREQUENCY_ANALYSIS` - 老年人饮水杯拿起频率（脱水风险）\n\n## 输入约束\n\n- 摄像头：客厅 / 厨房 / 卧室固定摄像头，**画面应稳定覆盖老人常放水杯的区域（茶几/餐桌/床头柜）**\n- 帧率 ≥ 5 FPS；分辨率 ≥ 480p；光照尽量稳定\n- 视频时段建议覆盖一整天（08:00 - 22:00）或多段拼接覆盖白天\n- 杯子轮廓/区域可在初次部署时由用户在画面中框选 ROI（cup_region），提升识别准确度\n- 隐私敏感场景应启用人体轮廓模式\n\n## 关键观测信号\n\n- `cup_region_defined` - 是否定义了水杯放置区域 ROI\n- `cup_pickup_events` - 杯子被拿起事件列表（含时间戳 + 持续秒数 + 是否伴随饮水手势）\n- `cup_pickup_count_daily` - 当日累计拿起次数\n- `drink_gesture_count_daily` - 伴随抬手到口部的\"疑似饮水\"动作次数\n- `interval_between_drinks_min` - 相邻两次拿起的平均间隔（分钟）\n- `last_pickup_time` - 最近一次拿起时间\n\n## 历史基线字段\n\n- `baseline_window_days` - 基线时间窗口（默认 7-14 天）\n- `baseline_daily_pickup_avg` - 历史平均每日拿起次数\n- `baseline_daily_pickup_std` - 历史拿起次数标准差\n\n## 默认阈值（可由调用方覆盖）\n\n- 每日最低拿起次数阈值：< 6 次 → 触发\"脱水风险\"提醒\n- 长时间未饮水阈值：连续 > 4 小时未拿起 → 触发\"长时间未饮水\"提醒\n- 个性化基线偏离阈值：当日次数 < 基线均值 - 2 × 标准差 → 触发\"较平时显著下降\"提醒\n\n## 风险/提醒类型\n\n- `low_daily_intake` - 当日饮水次数过少（脱水风险）\n- `long_no_drink_interval` - 长时间未饮水\n- `below_personal_baseline` - 较个人历史基线显著下降\n- `normal` - 正常\n\n## 输出字段（参考）\n\n- `subject_detected` - 是否检测到老人\n- `cup_region_defined` / `cup_visible` - 水杯区域 / 杯子可见性\n- `daily_metrics` - 当日指标（cup_pickup_count_daily / drink_gesture_count_daily / interval_between_drinks_min / last_pickup_time）\n- `baseline_metrics` - 历史基线（baseline_daily_pickup_avg / baseline_daily_pickup_std）\n- `risk_type` - 风险类型（low_daily_intake / long_no_drink_interval / below_personal_baseline / normal）\n- `risk_level` - 风险等级（safe / notice / warning）\n- `alert_message` - 推送给家属的文本（如\"老人今日只拿了 3 次水杯，已 5 小时未喝水，建议提醒老人增加饮水\"）\n- `recommended_action` - 建议动作（remind_to_drink / family_call_check / observe_only）\n\n> 仅输出基于视觉的饮水行为统计与方向性提醒，**不直接代表实际饮水量**（杯里可能没装水/可能是别人拿杯子），不提供脱水症 / 泌尿系统感染 / 认知障碍等具体医学诊断；连续低饮水或老人有明显不适请及时就医。\n\nFile v1.0.7:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.7:scripts/config.yaml\n\n{}\n\nFile v1.0.7:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.7:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.7:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.7:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: dev\n\nFile v1.0.7:skill-card.md\n\n## Description:\n\nAnalyzes fixed-camera video of an elder's cup area to count cup-pickup events and produce directional dehydration-risk reminders for families or caregivers.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[18072937735](https://clawhub.ai/user/18072937735)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nFamilies, caregivers, nursing-home staff, and elder-care platform operators use this skill to analyze camera footage of a cup placement area, summarize drinking-frequency signals, and decide whether to remind an older adult to drink water. It provides behavior-based reminders rather than medical diagnosis.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Private in-home or care-facility video may be processed by external network services.\n\nMitigation: Use only with clear consent from the monitored person or legal representative, review configured service endpoints before deployment, and confirm retention and access controls for uploaded footage and generated reports.\n\nRisk: The artifact silently handles identity and report-history access, which can reduce user control over account linkage and stored reports.\n\nMitigation: Validate identity, token storage, and report access behavior in the deployment environment before use, and restrict access to historical reports to authorized caregivers or operators.\n\nRisk: Cup-pickup frequency is only an indirect proxy for hydration and may be wrong when the cup is empty, handled by someone else, or shared.\n\nMitigation: Treat outputs as directional care reminders, combine them with caregiver confirmation and personal baselines, and seek medical advice for persistent low intake or symptoms.\n\n## Reference(s):\n\n- [API documentation](references/api_doc.md)\n- [Skill demo](https://lifeemergence.com/sample.html)\n- [ClawHub skill page](https://clawhub.ai/18072937735/skills/smyx-elderly-drinking-frequency-analysis)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown or JSON-style structured analysis reports with optional saved text output.]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May include drinking-frequency metrics, dehydration-risk labels, caregiver reminder text, report links, and Markdown tables for historical report queries.]\n\n## Skill Version(s):\n\n1.0.7 (source: server release metadata; artifact frontmatter states 1.0.9)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.7:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.7:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.6: 31 files, 41776 bytes\n\nFiles: references/api_doc.md (3507b), scripts/__init__.py (54b), scripts/config.py (703b), scripts/config.yaml (3b), scripts/skill.py (597b), scripts/smyx_elderly_drinking_frequency_analysis.py (3681b), skill-card.md (3018b), SKILL.md (12942b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (473b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (159b)\n\nFile v1.0.6:SKILL.md\n\n---\nname: \"smyx-elderly-drinking-frequency-analysis\"\ndescription: \"Using a fixed camera in the living room or kitchen, the system analyzes video of the water-cup placement area (e.g., coffee table, dining table), detects hand-to-cup contact actions (pickup, putdown), and counts daily cup-pickup events (an indirect proxy for water intake). | 通过客厅或厨房固定摄像头，分析水杯放置区域（如茶几、餐桌）的视频，检测手部与水杯的接触动作（拿起、放下），统计每日水杯拿起次数（间接反映饮水量）。当每日拿起次数低于预设阈值（如每天少于6次）时，输出'脱水风险'提醒，建议家属或护理人员督促老人增加饮水。\"\nversion: \"1.0.8\"\nlicense: \"MIT-0\"\n---\n\n# 💧 Elderly Drinking-Cup Pickup Frequency (Dehydration Risk) | 老年人饮水杯拿起频率（脱水风险）\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **老年人饮水杯拿起频率（脱水风险）** |\n| 🎯 核心目标 | 通过客厅或厨房固定摄像头，分析水杯放置区域（如茶几、餐桌）的视频，检测手部与水杯的接触动作（拿起、放下），统计每日水杯拿起次数（间接反映饮水量）。当每日拿起次数低于预设阈值（如每天少于6次）时，输出'脱水风险'提醒，建议家属或护理人员督促老人增加饮水。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_DRINKING_FREQUENCY_ANALYSIS` |\n\nUsing a fixed camera in the living room or kitchen, the system analyzes video of the water-cup placement area (e.g., coffee table, dining table), detects hand-to-cup contact actions (pickup, putdown), and counts daily cup-pickup events (an indirect proxy for water intake). When the daily pickup count falls below a preset threshold (e.g., fewer than 6 times per day), it outputs a 'dehydration risk' alert and suggests family members or caregivers to encourage the elderly to drink more. The skill helps prevent dehydration, urinary tract infection and cognitive decline caused by insufficient water intake. Application scenarios: homes of elderly people living alone, nursing homes, daycare centers. The system generates a daily drinking report; when the count is insufficient, it pushes a mobile-app reminder. Skill features: elderly people often have a dulled thirst sensation and are prone to chronic dehydration, leading to constipation, urinary tract infection, cognitive issues, etc. AI auto-counting of cup pickups helps family members spot insufficient intake in time and intervene. Can be integrated into home-care cameras or community health-management platforms as a practical feature for elderly health protection.\n\n通过客厅或厨房固定摄像头，分析水杯放置区域（如茶几、餐桌）的视频，检测手部与水杯的接触动作（拿起、放下），统计每日水杯拿起次数（间接反映饮水量）。当每日拿起次数低于预设阈值（如每天少于6次）时，输出'脱水风险'提醒，建议家属或护理人员督促老人增加饮水。该技能有助于预防因饮水不足导致的脱水、泌尿系感染及认知功能下降。应用场景：独居老人家庭、养老院、日间照料中心。系统每日生成饮水统计报告，当次数不足时通过手机APP推送提醒。技能特点：老年人对口渴感知迟钝，易发生慢性脱水，导致便秘、尿路感染、认知障碍等问题。通过AI自动统计饮水杯拿起次数，可帮助家属及时发现饮水不足，采取干预措施。该技能可集成到居家养老摄像头或社区健康管理平台中，成为老年人健康守护的实用功能。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人健康护理 AI。你的任务是分析固定摄像头对准水杯区域的视频，检测手部与水杯的接触动作（拿起和放下），统计每天的水杯拿起次数。当次数低于预设阈值时，输出脱水风险提醒。不要提供医疗诊断，仅输出基于视觉的饮水行为统计与方向性提醒。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于客厅/厨房固定摄像头视频，检测手-杯接触事件 + 抬手到口部动作 → 统计当日拿起次数与饮水频率 → 对比个人基线 → 输出脱水风险提醒（供家属/护理员主动督促老人饮水）\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人体检测 |\n| 2 | 手部检测 |\n| 3 | 杯子检测 |\n| 4 | 水杯放置 ROI 定义 |\n| 5 | 手-杯接触事件识别（拿起/放下） |\n| 6 | 伴随饮水手势识别（抬手到口部） |\n| 7 | 当日拿起次数与时段分布统计 |\n| 8 | 相邻饮水间隔 |\n| 9 | 长时间未饮水检测（默认 > 4 小时） |\n| 10 | 个人历史基线统计 |\n| 11 | 风险类型分类（low_daily_intake / long_no_drink_interval / below_personal_baseline / normal） |\n| 12 | 家属/护理员提醒文本生成 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供客厅/厨房水杯区域视频 URL 或文件需要分析时，默认触发本技能进行饮水频率（脱水风险）分析 |\n| 🔎 明确分析意图 | 当用户明确提及老人饮水、脱水风险、慢性脱水、便秘、尿路感染、认知障碍预警、独居老人健康、督促饮水、养老护理等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看老人饮水历史报告、脱水风险报告清单、饮水频率报告清单、查询历史饮水记录、显示所有老人饮水报告、显示养老护理诊断报告，查询脱水风险预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_elderly_drinking_frequency_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_drinking_frequency_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备客厅/厨房水杯区域视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行老年人饮水频率（脱水风险）分析 | 调用 `-m scripts.smyx_elderly_drinking_frequency_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地客厅/厨房水杯区域视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络客厅/厨房水杯区域视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，老年人健康护理场景默认 `other` | 按需填写 |\n| `--list` | 显示老年人饮水频率（脱水风险）历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_elderly_drinking_frequency_analysis.py`](scripts/smyx_elderly_drinking_frequency_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov 视频，最大 10MB；**关键**：画面必须稳定覆盖水杯放置区域 |\n| 🔎 使用提醒 | **拿起次数仅作为饮水频率的间接代理**，杯里是否装水、是不是真的喝下去、是不是别人拿的杯子，本工具无法 100% 判定；建议结合饮水手势 + 个人基线 + 家属沟通综合判断 |\n| 🔎 使用提醒 | 多人共用水杯、家中有客人 / 看护人员、老人在他人家或外出，会显著影响计数准确性 |\n| 🔏 隐私合规 | 隐私合规：家庭/养老机构视频涉及个人隐私，使用前需取得老人/监护人明确知情同意，妥善加密保管；建议优先采用人体轮廓+物体框模式 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地客厅/厨房水杯区域视频\npython -m scripts.smyx_elderly_drinking_frequency_analysis --input /path/to/livingroom_day.mp4\n\n# 分析网络客厅/厨房水杯区域视频\npython -m scripts.smyx_elderly_drinking_frequency_analysis --url https://example.com/livingroom_day.mp4\n\n# 显示历史老人饮水频率（脱水风险）报告（自动触发关键词：查看老人饮水历史报告、脱水风险报告清单等）\npython -m scripts.smyx_elderly_drinking_frequency_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_drinking_frequency_analysis --input day.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_drinking_frequency_analysis --input day.mp4 --output result.json\n```\n\nFile v1.0.6:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-elderly-drinking-frequency-analysis\",\n  \"version\": \"1.0.6\",\n  \"publishedAt\": 1785574413354\n}\n\nFile v1.0.6:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放老年人饮水杯拿起频率（脱水风险）API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动老年人饮水频率分析任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取饮水统计与脱水风险结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史饮水记录\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_ELDERLY_DRINKING_FREQUENCY_ANALYSIS` - 老年人饮水杯拿起频率（脱水风险）\n\n## 输入约束\n\n- 摄像头：客厅 / 厨房 / 卧室固定摄像头，**画面应稳定覆盖老人常放水杯的区域（茶几/餐桌/床头柜）**\n- 帧率 ≥ 5 FPS；分辨率 ≥ 480p；光照尽量稳定\n- 视频时段建议覆盖一整天（08:00 - 22:00）或多段拼接覆盖白天\n- 杯子轮廓/区域可在初次部署时由用户在画面中框选 ROI（cup_region），提升识别准确度\n- 隐私敏感场景应启用人体轮廓模式\n\n## 关键观测信号\n\n- `cup_region_defined` - 是否定义了水杯放置区域 ROI\n- `cup_pickup_events` - 杯子被拿起事件列表（含时间戳 + 持续秒数 + 是否伴随饮水手势）\n- `cup_pickup_count_daily` - 当日累计拿起次数\n- `drink_gesture_count_daily` - 伴随抬手到口部的\"疑似饮水\"动作次数\n- `interval_between_drinks_min` - 相邻两次拿起的平均间隔（分钟）\n- `last_pickup_time` - 最近一次拿起时间\n\n## 历史基线字段\n\n- `baseline_window_days` - 基线时间窗口（默认 7-14 天）\n- `baseline_daily_pickup_avg` - 历史平均每日拿起次数\n- `baseline_daily_pickup_std` - 历史拿起次数标准差\n\n## 默认阈值（可由调用方覆盖）\n\n- 每日最低拿起次数阈值：< 6 次 → 触发\"脱水风险\"提醒\n- 长时间未饮水阈值：连续 > 4 小时未拿起 → 触发\"长时间未饮水\"提醒\n- 个性化基线偏离阈值：当日次数 < 基线均值 - 2 × 标准差 → 触发\"较平时显著下降\"提醒\n\n## 风险/提醒类型\n\n- `low_daily_intake` - 当日饮水次数过少（脱水风险）\n- `long_no_drink_interval` - 长时间未饮水\n- `below_personal_baseline` - 较个人历史基线显著下降\n- `normal` - 正常\n\n## 输出字段（参考）\n\n- `subject_detected` - 是否检测到老人\n- `cup_region_defined` / `cup_visible` - 水杯区域 / 杯子可见性\n- `daily_metrics` - 当日指标（cup_pickup_count_daily / drink_gesture_count_daily / interval_between_drinks_min / last_pickup_time）\n- `baseline_metrics` - 历史基线（baseline_daily_pickup_avg / baseline_daily_pickup_std）\n- `risk_type` - 风险类型（low_daily_intake / long_no_drink_interval / below_personal_baseline / normal）\n- `risk_level` - 风险等级（safe / notice / warning）\n- `alert_message` - 推送给家属的文本（如\"老人今日只拿了 3 次水杯，已 5 小时未喝水，建议提醒老人增加饮水\"）\n- `recommended_action` - 建议动作（remind_to_drink / family_call_check / observe_only）\n\n> 仅输出基于视觉的饮水行为统计与方向性提醒，**不直接代表实际饮水量**（杯里可能没装水/可能是别人拿杯子），不提供脱水症 / 泌尿系统感染 / 认知障碍等具体医学诊断；连续低饮水或老人有明显不适请及时就医。\n\nFile v1.0.6:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.6:scripts/config.yaml\n\n{}\n\nFile v1.0.6:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.6:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.6:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.6:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: prod\n\nFile v1.0.6:skill-card.md\n\n## Description: <br>\nAnalyzes fixed-camera video of an elderly person's water-cup area to count cup pickup events, estimate drinking-frequency patterns, and produce directional dehydration-risk reminders for caregivers. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[18072937735](https://clawhub.ai/user/18072937735) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nExternal caregivers, family members, elder-care operators, and developers use this skill to analyze living-room or kitchen camera video for water-cup pickup frequency, long no-drink intervals, and report history. It provides behavioral statistics and reminders, not medical diagnosis. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Sensitive in-home footage or video URLs may be sent to the LifeEmergence cloud service for analysis. <br>\nMitigation: Use only footage you own or are authorized to process, obtain explicit consent from the monitored person or guardian, and prefer minimal, stable camera views focused on the cup area. <br>\nRisk: The skill may create or reuse persistent backend identity records for report access and history queries. <br>\nMitigation: Review local and backend identity/token handling before deployment, avoid exposing identifiers in user-facing output, and separate report access by user or care setting. <br>\nRisk: Cup pickup count is an indirect proxy for drinking and may be inaccurate when cups are empty, shared, moved by another person, or outside the fixed camera view. <br>\nMitigation: Treat results as directional caregiver reminders, combine them with personal baselines and human follow-up, and avoid using the output as a medical diagnosis. <br>\n\n\n## Reference(s): <br>\n- [ClawHub Skill Page](https://clawhub.ai/18072937735/skills/smyx-elderly-drinking-frequency-analysis) <br>\n- [Publisher Profile](https://clawhub.ai/user/18072937735) <br>\n- [Skill Demo](https://lifeemergence.com/sample.html) <br>\n- [API Interface Documentation](references/api_doc.md) <br>\n- [SMYX Analysis API Documentation](skills/smyx_analysis/references/api_doc.md) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance] <br>\n**Output Format:** [Markdown text with structured JSON report content, analysis status messages, history-report tables, and report links.] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May write the returned report text to a local output file when invoked with --output; cloud APIs return JSON used to build the report.] <br>\n\n## Skill Version(s): <br>\n1.0.6 (source: server release evidence; artifact frontmatter reports 1.0.8) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v1.0.6:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.6:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.5: 31 files, 41602 bytes\n\nFiles: references/api_doc.md (3507b), scripts/__init__.py (54b), scripts/config.py (703b), scripts/config.yaml (3b), scripts/skill.py (597b), scripts/smyx_elderly_drinking_frequency_analysis.py (3681b), skill-card.md (2646b), SKILL.md (12942b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (473b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (159b)\n\nFile v1.0.5:SKILL.md\n\n---\nname: \"smyx-elderly-drinking-frequency-analysis\"\ndescription: \"Using a fixed camera in the living room or kitchen, the system analyzes video of the water-cup placement area (e.g., coffee table, dining table), detects hand-to-cup contact actions (pickup, putdown), and counts daily cup-pickup events (an indirect proxy for water intake). | 通过客厅或厨房固定摄像头，分析水杯放置区域（如茶几、餐桌）的视频，检测手部与水杯的接触动作（拿起、放下），统计每日水杯拿起次数（间接反映饮水量）。当每日拿起次数低于预设阈值（如每天少于6次）时，输出'脱水风险'提醒，建议家属或护理人员督促老人增加饮水。\"\nversion: \"1.0.6\"\nlicense: \"MIT-0\"\n---\n\n# 💧 Elderly Drinking-Cup Pickup Frequency (Dehydration Risk) | 老年人饮水杯拿起频率（脱水风险）\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **老年人饮水杯拿起频率（脱水风险）** |\n| 🎯 核心目标 | 通过客厅或厨房固定摄像头，分析水杯放置区域（如茶几、餐桌）的视频，检测手部与水杯的接触动作（拿起、放下），统计每日水杯拿起次数（间接反映饮水量）。当每日拿起次数低于预设阈值（如每天少于6次）时，输出'脱水风险'提醒，建议家属或护理人员督促老人增加饮水。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_DRINKING_FREQUENCY_ANALYSIS` |\n\nUsing a fixed camera in the living room or kitchen, the system analyzes video of the water-cup placement area (e.g., coffee table, dining table), detects hand-to-cup contact actions (pickup, putdown), and counts daily cup-pickup events (an indirect proxy for water intake). When the daily pickup count falls below a preset threshold (e.g., fewer than 6 times per day), it outputs a 'dehydration risk' alert and suggests family members or caregivers to encourage the elderly to drink more. The skill helps prevent dehydration, urinary tract infection and cognitive decline caused by insufficient water intake. Application scenarios: homes of elderly people living alone, nursing homes, daycare centers. The system generates a daily drinking report; when the count is insufficient, it pushes a mobile-app reminder. Skill features: elderly people often have a dulled thirst sensation and are prone to chronic dehydration, leading to constipation, urinary tract infection, cognitive issues, etc. AI auto-counting of cup pickups helps family members spot insufficient intake in time and intervene. Can be integrated into home-care cameras or community health-management platforms as a practical feature for elderly health protection.\n\n通过客厅或厨房固定摄像头，分析水杯放置区域（如茶几、餐桌）的视频，检测手部与水杯的接触动作（拿起、放下），统计每日水杯拿起次数（间接反映饮水量）。当每日拿起次数低于预设阈值（如每天少于6次）时，输出'脱水风险'提醒，建议家属或护理人员督促老人增加饮水。该技能有助于预防因饮水不足导致的脱水、泌尿系感染及认知功能下降。应用场景：独居老人家庭、养老院、日间照料中心。系统每日生成饮水统计报告，当次数不足时通过手机APP推送提醒。技能特点：老年人对口渴感知迟钝，易发生慢性脱水，导致便秘、尿路感染、认知障碍等问题。通过AI自动统计饮水杯拿起次数，可帮助家属及时发现饮水不足，采取干预措施。该技能可集成到居家养老摄像头或社区健康管理平台中，成为老年人健康守护的实用功能。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人健康护理 AI。你的任务是分析固定摄像头对准水杯区域的视频，检测手部与水杯的接触动作（拿起和放下），统计每天的水杯拿起次数。当次数低于预设阈值时，输出脱水风险提醒。不要提供医疗诊断，仅输出基于视觉的饮水行为统计与方向性提醒。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于客厅/厨房固定摄像头视频，检测手-杯接触事件 + 抬手到口部动作 → 统计当日拿起次数与饮水频率 → 对比个人基线 → 输出脱水风险提醒（供家属/护理员主动督促老人饮水）\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人体检测 |\n| 2 | 手部检测 |\n| 3 | 杯子检测 |\n| 4 | 水杯放置 ROI 定义 |\n| 5 | 手-杯接触事件识别（拿起/放下） |\n| 6 | 伴随饮水手势识别（抬手到口部） |\n| 7 | 当日拿起次数与时段分布统计 |\n| 8 | 相邻饮水间隔 |\n| 9 | 长时间未饮水检测（默认 > 4 小时） |\n| 10 | 个人历史基线统计 |\n| 11 | 风险类型分类（low_daily_intake / long_no_drink_interval / below_personal_baseline / normal） |\n| 12 | 家属/护理员提醒文本生成 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供客厅/厨房水杯区域视频 URL 或文件需要分析时，默认触发本技能进行饮水频率（脱水风险）分析 |\n| 🔎 明确分析意图 | 当用户明确提及老人饮水、脱水风险、慢性脱水、便秘、尿路感染、认知障碍预警、独居老人健康、督促饮水、养老护理等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看老人饮水历史报告、脱水风险报告清单、饮水频率报告清单、查询历史饮水记录、显示所有老人饮水报告、显示养老护理诊断报告，查询脱水风险预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_elderly_drinking_frequency_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_drinking_frequency_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备客厅/厨房水杯区域视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行老年人饮水频率（脱水风险）分析 | 调用 `-m scripts.smyx_elderly_drinking_frequency_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地客厅/厨房水杯区域视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络客厅/厨房水杯区域视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，老年人健康护理场景默认 `other` | 按需填写 |\n| `--list` | 显示老年人饮水频率（脱水风险）历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_elderly_drinking_frequency_analysis.py`](scripts/smyx_elderly_drinking_frequency_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov 视频，最大 10MB；**关键**：画面必须稳定覆盖水杯放置区域 |\n| 🔎 使用提醒 | **拿起次数仅作为饮水频率的间接代理**，杯里是否装水、是不是真的喝下去、是不是别人拿的杯子，本工具无法 100% 判定；建议结合饮水手势 + 个人基线 + 家属沟通综合判断 |\n| 🔎 使用提醒 | 多人共用水杯、家中有客人 / 看护人员、老人在他人家或外出，会显著影响计数准确性 |\n| 🔏 隐私合规 | 隐私合规：家庭/养老机构视频涉及个人隐私，使用前需取得老人/监护人明确知情同意，妥善加密保管；建议优先采用人体轮廓+物体框模式 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地客厅/厨房水杯区域视频\npython -m scripts.smyx_elderly_drinking_frequency_analysis --input /path/to/livingroom_day.mp4\n\n# 分析网络客厅/厨房水杯区域视频\npython -m scripts.smyx_elderly_drinking_frequency_analysis --url https://example.com/livingroom_day.mp4\n\n# 显示历史老人饮水频率（脱水风险）报告（自动触发关键词：查看老人饮水历史报告、脱水风险报告清单等）\npython -m scripts.smyx_elderly_drinking_frequency_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_drinking_frequency_analysis --input day.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_drinking_frequency_analysis --input day.mp4 --output result.json\n```\n\nFile v1.0.5:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-elderly-drinking-frequency-analysis\",\n  \"version\": \"1.0.5\",\n  \"publishedAt\": 1784405251112\n}\n\nFile v1.0.5:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放老年人饮水杯拿起频率（脱水风险）API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动老年人饮水频率分析任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取饮水统计与脱水风险结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史饮水记录\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_ELDERLY_DRINKING_FREQUENCY_ANALYSIS` - 老年人饮水杯拿起频率（脱水风险）\n\n## 输入约束\n\n- 摄像头：客厅 / 厨房 / 卧室固定摄像头，**画面应稳定覆盖老人常放水杯的区域（茶几/餐桌/床头柜）**\n- 帧率 ≥ 5 FPS；分辨率 ≥ 480p；光照尽量稳定\n- 视频时段建议覆盖一整天（08:00 - 22:00）或多段拼接覆盖白天\n- 杯子轮廓/区域可在初次部署时由用户在画面中框选 ROI（cup_region），提升识别准确度\n- 隐私敏感场景应启用人体轮廓模式\n\n## 关键观测信号\n\n- `cup_region_defined` - 是否定义了水杯放置区域 ROI\n- `cup_pickup_events` - 杯子被拿起事件列表（含时间戳 + 持续秒数 + 是否伴随饮水手势）\n- `cup_pickup_count_daily` - 当日累计拿起次数\n- `drink_gesture_count_daily` - 伴随抬手到口部的\"疑似饮水\"动作次数\n- `interval_between_drinks_min` - 相邻两次拿起的平均间隔（分钟）\n- `last_pickup_time` - 最近一次拿起时间\n\n## 历史基线字段\n\n- `baseline_window_days` - 基线时间窗口（默认 7-14 天）\n- `baseline_daily_pickup_avg` - 历史平均每日拿起次数\n- `baseline_daily_pickup_std` - 历史拿起次数标准差\n\n## 默认阈值（可由调用方覆盖）\n\n- 每日最低拿起次数阈值：< 6 次 → 触发\"脱水风险\"提醒\n- 长时间未饮水阈值：连续 > 4 小时未拿起 → 触发\"长时间未饮水\"提醒\n- 个性化基线偏离阈值：当日次数 < 基线均值 - 2 × 标准差 → 触发\"较平时显著下降\"提醒\n\n## 风险/提醒类型\n\n- `low_daily_intake` - 当日饮水次数过少（脱水风险）\n- `long_no_drink_interval` - 长时间未饮水\n- `below_personal_baseline` - 较个人历史基线显著下降\n- `normal` - 正常\n\n## 输出字段（参考）\n\n- `subject_detected` - 是否检测到老人\n- `cup_region_defined` / `cup_visible` - 水杯区域 / 杯子可见性\n- `daily_metrics` - 当日指标（cup_pickup_count_daily / drink_gesture_count_daily / interval_between_drinks_min / last_pickup_time）\n- `baseline_metrics` - 历史基线（baseline_daily_pickup_avg / baseline_daily_pickup_std）\n- `risk_type` - 风险类型（low_daily_intake / long_no_drink_interval / below_personal_baseline / normal）\n- `risk_level` - 风险等级（safe / notice / warning）\n- `alert_message` - 推送给家属的文本（如\"老人今日只拿了 3 次水杯，已 5 小时未喝水，建议提醒老人增加饮水\"）\n- `recommended_action` - 建议动作（remind_to_drink / family_call_check / observe_only）\n\n> 仅输出基于视觉的饮水行为统计与方向性提醒，**不直接代表实际饮水量**（杯里可能没装水/可能是别人拿杯子），不提供脱水症 / 泌尿系统感染 / 认知障碍等具体医学诊断；连续低饮水或老人有明显不适请及时就医。\n\nFile v1.0.5:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.5:scripts/config.yaml\n\n{}\n\nFile v1.0.5:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.5:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.5:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.5:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: prod\n\nFile v1.0.5:skill-card.md\n\n## Description: <br>\nAnalyzes fixed-camera video of an elder's water-cup area to count cup pickups, estimate drinking frequency, and surface dehydration-risk reminders for caregivers. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[18072937735](https://clawhub.ai/user/18072937735) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nExternal caregivers, family members, and elder-care operators use this skill to analyze home or care-facility video of a water-cup area, review cup-pickup frequency, and receive directional reminders when the pattern suggests possible dehydration risk. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Home video or video URLs may be sent to external services, and cloud report history may be queried. <br>\nMitigation: Require explicit consent from monitored people, avoid unrelated household footage, and confirm cloud processing is acceptable before use. <br>\nRisk: The skill may create or reuse local and remote identity records and tokens. <br>\nMitigation: Review or clear the workspace data directory if identity or token reuse is not desired. <br>\nRisk: Cup-pickup counts are only an indirect proxy for water intake and may be inaccurate in shared or unstable scenes. <br>\nMitigation: Treat alerts as caregiver prompts rather than medical diagnosis, verify with the elder or caregiver, and seek medical care if symptoms are present. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/18072937735/skills/smyx-elderly-drinking-frequency-analysis) <br>\n- [API documentation](artifact/references/api_doc.md) <br>\n- [SMYX analysis API documentation](artifact/skills/smyx_analysis/references/api_doc.md) <br>\n- [Skill demo](https://lifeemergence.com/sample.html) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, JSON, shell commands, configuration, guidance] <br>\n**Output Format:** [Markdown or JSON analysis report with optional report links and local file output.] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May include structured drinking-frequency metrics, dehydration-risk alerts, recommended caregiver actions, and cloud report links.] <br>\n\n## Skill Version(s): <br>\n1.0.5 (source: server release evidence; artifact frontmatter reports 1.0.6) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v1.0.5:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.5:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.4: 31 files, 41709 bytes\n\nFiles: references/api_doc.md (3507b), scripts/__init__.py (54b), scripts/config.py (703b), scripts/config.yaml (3b), scripts/skill.py (597b), scripts/smyx_elderly_drinking_frequency_analysis.py (3681b), skill-card.md (3036b), SKILL.md (12942b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (473b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28605b), _meta.json (159b)\n\nFile v1.0.4:SKILL.md\n\n---\nname: \"smyx-elderly-drinking-frequency-analysis\"\ndescription: \"Using a fixed camera in the living room or kitchen, the system analyzes video of the water-cup placement area (e.g., coffee table, dining table), detects hand-to-cup contact actions (pickup, putdown), and counts daily cup-pickup events (an indirect proxy for water intake). | 通过客厅或厨房固定摄像头，分析水杯放置区域（如茶几、餐桌）的视频，检测手部与水杯的接触动作（拿起、放下），统计每日水杯拿起次数（间接反映饮水量）。当每日拿起次数低于预设阈值（如每天少于6次）时，输出'脱水风险'提醒，建议家属或护理人员督促老人增加饮水。\"\nversion: \"1.0.4\"\nlicense: \"MIT-0\"\n---\n\n# 💧 Elderly Drinking-Cup Pickup Frequency (Dehydration Risk) | 老年人饮水杯拿起频率（脱水风险）\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **老年人饮水杯拿起频率（脱水风险）** |\n| 🎯 核心目标 | 通过客厅或厨房固定摄像头，分析水杯放置区域（如茶几、餐桌）的视频，检测手部与水杯的接触动作（拿起、放下），统计每日水杯拿起次数（间接反映饮水量）。当每日拿起次数低于预设阈值（如每天少于6次）时，输出'脱水风险'提醒，建议家属或护理人员督促老人增加饮水。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_DRINKING_FREQUENCY_ANALYSIS` |\n\nUsing a fixed camera in the living room or kitchen, the system analyzes video of the water-cup placement area (e.g., coffee table, dining table), detects hand-to-cup contact actions (pickup, putdown), and counts daily cup-pickup events (an indirect proxy for water intake). When the daily pickup count falls below a preset threshold (e.g., fewer than 6 times per day), it outputs a 'dehydration risk' alert and suggests family members or caregivers to encourage the elderly to drink more. The skill helps prevent dehydration, urinary tract infection and cognitive decline caused by insufficient water intake. Application scenarios: homes of elderly people living alone, nursing homes, daycare centers. The system generates a daily drinking report; when the count is insufficient, it pushes a mobile-app reminder. Skill features: elderly people often have a dulled thirst sensation and are prone to chronic dehydration, leading to constipation, urinary tract infection, cognitive issues, etc. AI auto-counting of cup pickups helps family members spot insufficient intake in time and intervene. Can be integrated into home-care cameras or community health-management platforms as a practical feature for elderly health protection.\n\n通过客厅或厨房固定摄像头，分析水杯放置区域（如茶几、餐桌）的视频，检测手部与水杯的接触动作（拿起、放下），统计每日水杯拿起次数（间接反映饮水量）。当每日拿起次数低于预设阈值（如每天少于6次）时，输出'脱水风险'提醒，建议家属或护理人员督促老人增加饮水。该技能有助于预防因饮水不足导致的脱水、泌尿系感染及认知功能下降。应用场景：独居老人家庭、养老院、日间照料中心。系统每日生成饮水统计报告，当次数不足时通过手机APP推送提醒。技能特点：老年人对口渴感知迟钝，易发生慢性脱水，导致便秘、尿路感染、认知障碍等问题。通过AI自动统计饮水杯拿起次数，可帮助家属及时发现饮水不足，采取干预措施。该技能可集成到居家养老摄像头或社区健康管理平台中，成为老年人健康守护的实用功能。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人健康护理 AI。你的任务是分析固定摄像头对准水杯区域的视频，检测手部与水杯的接触动作（拿起和放下），统计每天的水杯拿起次数。当次数低于预设阈值时，输出脱水风险提醒。不要提供医疗诊断，仅输出基于视觉的饮水行为统计与方向性提醒。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于客厅/厨房固定摄像头视频，检测手-杯接触事件 + 抬手到口部动作 → 统计当日拿起次数与饮水频率 → 对比个人基线 → 输出脱水风险提醒（供家属/护理员主动督促老人饮水）\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人体检测 |\n| 2 | 手部检测 |\n| 3 | 杯子检测 |\n| 4 | 水杯放置 ROI 定义 |\n| 5 | 手-杯接触事件识别（拿起/放下） |\n| 6 | 伴随饮水手势识别（抬手到口部） |\n| 7 | 当日拿起次数与时段分布统计 |\n| 8 | 相邻饮水间隔 |\n| 9 | 长时间未饮水检测（默认 > 4 小时） |\n| 10 | 个人历史基线统计 |\n| 11 | 风险类型分类（low_daily_intake / long_no_drink_interval / below_personal_baseline / normal） |\n| 12 | 家属/护理员提醒文本生成 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供客厅/厨房水杯区域视频 URL 或文件需要分析时，默认触发本技能进行饮水频率（脱水风险）分析 |\n| 🔎 明确分析意图 | 当用户明确提及老人饮水、脱水风险、慢性脱水、便秘、尿路感染、认知障碍预警、独居老人健康、督促饮水、养老护理等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看老人饮水历史报告、脱水风险报告清单、饮水频率报告清单、查询历史饮水记录、显示所有老人饮水报告、显示养老护理诊断报告，查询脱水风险预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_elderly_drinking_frequency_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_drinking_frequency_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备客厅/厨房水杯区域视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行老年人饮水频率（脱水风险）分析 | 调用 `-m scripts.smyx_elderly_drinking_frequency_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地客厅/厨房水杯区域视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络客厅/厨房水杯区域视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，老年人健康护理场景默认 `other` | 按需填写 |\n| `--list` | 显示老年人饮水频率（脱水风险）历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_elderly_drinking_frequency_analysis.py`](scripts/smyx_elderly_drinking_frequency_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov 视频，最大 10MB；**关键**：画面必须稳定覆盖水杯放置区域 |\n| 🔎 使用提醒 | **拿起次数仅作为饮水频率的间接代理**，杯里是否装水、是不是真的喝下去、是不是别人拿的杯子，本工具无法 100% 判定；建议结合饮水手势 + 个人基线 + 家属沟通综合判断 |\n| 🔎 使用提醒 | 多人共用水杯、家中有客人 / 看护人员、老人在他人家或外出，会显著影响计数准确性 |\n| 🔏 隐私合规 | 隐私合规：家庭/养老机构视频涉及个人隐私，使用前需取得老人/监护人明确知情同意，妥善加密保管；建议优先采用人体轮廓+物体框模式 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地客厅/厨房水杯区域视频\npython -m scripts.smyx_elderly_drinking_frequency_analysis --input /path/to/livingroom_day.mp4\n\n# 分析网络客厅/厨房水杯区域视频\npython -m scripts.smyx_elderly_drinking_frequency_analysis --url https://example.com/livingroom_day.mp4\n\n# 显示历史老人饮水频率（脱水风险）报告（自动触发关键词：查看老人饮水历史报告、脱水风险报告清单等）\npython -m scripts.smyx_elderly_drinking_frequency_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_drinking_frequency_analysis --input day.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_drinking_frequency_analysis --input day.mp4 --output result.json\n```\n\nFile v1.0.4:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-elderly-drinking-frequency-analysis\",\n  \"version\": \"1.0.4\",\n  \"publishedAt\": 1783568247400\n}\n\nFile v1.0.4:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放老年人饮水杯拿起频率（脱水风险）API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动老年人饮水频率分析任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取饮水统计与脱水风险结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史饮水记录\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_ELDERLY_DRINKING_FREQUENCY_ANALYSIS` - 老年人饮水杯拿起频率（脱水风险）\n\n## 输入约束\n\n- 摄像头：客厅 / 厨房 / 卧室固定摄像头，**画面应稳定覆盖老人常放水杯的区域（茶几/餐桌/床头柜）**\n- 帧率 ≥ 5 FPS；分辨率 ≥ 480p；光照尽量稳定\n- 视频时段建议覆盖一整天（08:00 - 22:00）或多段拼接覆盖白天\n- 杯子轮廓/区域可在初次部署时由用户在画面中框选 ROI（cup_region），提升识别准确度\n- 隐私敏感场景应启用人体轮廓模式\n\n## 关键观测信号\n\n- `cup_region_defined` - 是否定义了水杯放置区域 ROI\n- `cup_pickup_events` - 杯子被拿起事件列表（含时间戳 + 持续秒数 + 是否伴随饮水手势）\n- `cup_pickup_count_daily` - 当日累计拿起次数\n- `drink_gesture_count_daily` - 伴随抬手到口部的\"疑似饮水\"动作次数\n- `interval_between_drinks_min` - 相邻两次拿起的平均间隔（分钟）\n- `last_pickup_time` - 最近一次拿起时间\n\n## 历史基线字段\n\n- `baseline_window_days` - 基线时间窗口（默认 7-14 天）\n- `baseline_daily_pickup_avg` - 历史平均每日拿起次数\n- `baseline_daily_pickup_std` - 历史拿起次数标准差\n\n## 默认阈值（可由调用方覆盖）\n\n- 每日最低拿起次数阈值：< 6 次 → 触发\"脱水风险\"提醒\n- 长时间未饮水阈值：连续 > 4 小时未拿起 → 触发\"长时间未饮水\"提醒\n- 个性化基线偏离阈值：当日次数 < 基线均值 - 2 × 标准差 → 触发\"较平时显著下降\"提醒\n\n## 风险/提醒类型\n\n- `low_daily_intake` - 当日饮水次数过少（脱水风险）\n- `long_no_drink_interval` - 长时间未饮水\n- `below_personal_baseline` - 较个人历史基线显著下降\n- `normal` - 正常\n\n## 输出字段（参考）\n\n- `subject_detected` - 是否检测到老人\n- `cup_region_defined` / `cup_visible` - 水杯区域 / 杯子可见性\n- `daily_metrics` - 当日指标（cup_pickup_count_daily / drink_gesture_count_daily / interval_between_drinks_min / last_pickup_time）\n- `baseline_metrics` - 历史基线（baseline_daily_pickup_avg / baseline_daily_pickup_std）\n- `risk_type` - 风险类型（low_daily_intake / long_no_drink_interval / below_personal_baseline / normal）\n- `risk_level` - 风险等级（safe / notice / warning）\n- `alert_message` - 推送给家属的文本（如\"老人今日只拿了 3 次水杯，已 5 小时未喝水，建议提醒老人增加饮水\"）\n- `recommended_action` - 建议动作（remind_to_drink / family_call_check / observe_only）\n\n> 仅输出基于视觉的饮水行为统计与方向性提醒，**不直接代表实际饮水量**（杯里可能没装水/可能是别人拿杯子），不提供脱水症 / 泌尿系统感染 / 认知障碍等具体医学诊断；连续低饮水或老人有明显不适请及时就医。\n\nFile v1.0.4:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.4:scripts/config.yaml\n\n{}\n\nFile v1.0.4:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.4:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.4:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.4:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: prod\n\nFile v1.0.4:skill-card.md\n\n## Description: <br>\nUsing a fixed camera in the living room or kitchen, the system analyzes video of a water-cup placement area, detects hand-to-cup pickup and putdown actions, counts daily cup-pickup events as an indirect proxy for water intake, and reports dehydration-risk reminders when activity is below a configured threshold. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[18072937735](https://clawhub.ai/user/18072937735) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nExternal caregivers, family members, elder-care operators, and developers use this skill to analyze fixed-camera home or care-facility video for cup-pickup frequency, long no-drink intervals, and directional dehydration-risk reminders. It supports structured reporting and history lookup, but its visual counts are an indirect behavioral signal rather than a medical diagnosis or confirmed water-intake measurement. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Sensitive elder-care home or facility video may be sent to configured cloud analysis services. <br>\nMitigation: Use only with informed consent from the monitored person or authorized guardian, minimize captured scenes, and confirm retention, deletion, and access-control practices before deployment. <br>\nRisk: Reports are associated with hidden/internal identity and authentication state. <br>\nMitigation: Deploy with explicit account scoping, protected token storage, and administrative controls for report access and deletion. <br>\nRisk: Cup-pickup counts are an indirect proxy and may not prove actual water intake or dehydration status. <br>\nMitigation: Present results as directional monitoring, combine them with caregiver review or clinical context, and escalate to medical care when symptoms or sustained low intake are observed. <br>\n\n\n## Reference(s): <br>\n- [API Interface Documentation](references/api_doc.md) <br>\n- [Shared Analysis API Documentation](skills/smyx_analysis/references/api_doc.md) <br>\n- [Skill Demo](https://lifeemergence.com/sample.html) <br>\n- [ClawHub Skill Page](https://clawhub.ai/18072937735/skills/smyx-elderly-drinking-frequency-analysis) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Analysis, API Calls, Markdown, JSON, Files, Guidance] <br>\n**Output Format:** [Structured text or JSON-like report with risk fields, recommended actions, history-list output, and optional saved result file] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Supports local video files or video URLs, cloud report lookup, and optional output-file writing.] <br>\n\n## Skill Version(s): <br>\n1.0.4 (source: frontmatter and server release evidence) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v1.0.4:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.4:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.3: 31 files, 41537 bytes\n\nFiles: references/api_doc.md (3507b), scripts/__init__.py (54b), scripts/config.py (703b), scripts/config.yaml (3b), scripts/skill.py (597b), scripts/smyx_elderly_drinking_frequency_analysis.py (3681b), skill-card.md (3261b), SKILL.md (12942b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (22801b), skills/smyx_common/scripts/config.yaml (473b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28605b), _meta.json (159b)\n\nFile v1.0.3:SKILL.md\n\n---\nname: \"smyx-elderly-drinking-frequency-analysis\"\ndescription: \"Using a fixed camera in the living room or kitchen, the system analyzes video of the water-cup placement area (e.g., coffee table, dining table), detects hand-to-cup contact actions (pickup, putdown), and counts daily cup-pickup events (an indirect proxy for water intake). | 通过客厅或厨房固定摄像头，分析水杯放置区域（如茶几、餐桌）的视频，检测手部与水杯的接触动作（拿起、放下），统计每日水杯拿起次数（间接反映饮水量）。当每日拿起次数低于预设阈值（如每天少于6次）时，输出'脱水风险'提醒，建议家属或护理人员督促老人增加饮水。\"\nversion: \"1.0.4\"\nlicense: \"MIT-0\"\n---\n\n# 💧 Elderly Drinking-Cup Pickup Frequency (Dehydration Risk) | 老年人饮水杯拿起频率（脱水风险）\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **老年人饮水杯拿起频率（脱水风险）** |\n| 🎯 核心目标 | 通过客厅或厨房固定摄像头，分析水杯放置区域（如茶几、餐桌）的视频，检测手部与水杯的接触动作（拿起、放下），统计每日水杯拿起次数（间接反映饮水量）。当每日拿起次数低于预设阈值（如每天少于6次）时，输出'脱水风险'提醒，建议家属或护理人员督促老人增加饮水。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_DRINKING_FREQUENCY_ANALYSIS` |\n\nUsing a fixed camera in the living room or kitchen, the system analyzes video of the water-cup placement area (e.g., coffee table, dining table), detects hand-to-cup contact actions (pickup, putdown), and counts daily cup-pickup events (an indirect proxy for water intake). When the daily pickup count falls below a preset threshold (e.g., fewer than 6 times per day), it outputs a 'dehydration risk' alert and suggests family members or caregivers to encourage the elderly to drink more. The skill helps prevent dehydration, urinary tract infection and cognitive decline caused by insufficient water intake. Application scenarios: homes of elderly people living alone, nursing homes, daycare centers. The system generates a daily drinking report; when the count is insufficient, it pushes a mobile-app reminder. Skill features: elderly people often have a dulled thirst sensation and are prone to chronic dehydration, leading to constipation, urinary tract infection, cognitive issues, etc. AI auto-counting of cup pickups helps family members spot insufficient intake in time and intervene. Can be integrated into home-care cameras or community health-management platforms as a practical feature for elderly health protection.\n\n通过客厅或厨房固定摄像头，分析水杯放置区域（如茶几、餐桌）的视频，检测手部与水杯的接触动作（拿起、放下），统计每日水杯拿起次数（间接反映饮水量）。当每日拿起次数低于预设阈值（如每天少于6次）时，输出'脱水风险'提醒，建议家属或护理人员督促老人增加饮水。该技能有助于预防因饮水不足导致的脱水、泌尿系感染及认知功能下降。应用场景：独居老人家庭、养老院、日间照料中心。系统每日生成饮水统计报告，当次数不足时通过手机APP推送提醒。技能特点：老年人对口渴感知迟钝，易发生慢性脱水，导致便秘、尿路感染、认知障碍等问题。通过AI自动统计饮水杯拿起次数，可帮助家属及时发现饮水不足，采取干预措施。该技能可集成到居家养老摄像头或社区健康管理平台中，成为老年人健康守护的实用功能。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人健康护理 AI。你的任务是分析固定摄像头对准水杯区域的视频，检测手部与水杯的接触动作（拿起和放下），统计每天的水杯拿起次数。当次数低于预设阈值时，输出脱水风险提醒。不要提供医疗诊断，仅输出基于视觉的饮水行为统计与方向性提醒。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于客厅/厨房固定摄像头视频，检测手-杯接触事件 + 抬手到口部动作 → 统计当日拿起次数与饮水频率 → 对比个人基线 → 输出脱水风险提醒（供家属/护理员主动督促老人饮水）\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人体检测 |\n| 2 | 手部检测 |\n| 3 | 杯子检测 |\n| 4 | 水杯放置 ROI 定义 |\n| 5 | 手-杯接触事件识别（拿起/放下） |\n| 6 | 伴随饮水手势识别（抬手到口部） |\n| 7 | 当日拿起次数与时段分布统计 |\n| 8 | 相邻饮水间隔 |\n| 9 | 长时间未饮水检测（默认 > 4 小时） |\n| 10 | 个人历史基线统计 |\n| 11 | 风险类型分类（low_daily_intake / long_no_drink_interval / below_personal_baseline / normal） |\n| 12 | 家属/护理员提醒文本生成 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供客厅/厨房水杯区域视频 URL 或文件需要分析时，默认触发本技能进行饮水频率（脱水风险）分析 |\n| 🔎 明确分析意图 | 当用户明确提及老人饮水、脱水风险、慢性脱水、便秘、尿路感染、认知障碍预警、独居老人健康、督促饮水、养老护理等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看老人饮水历史报告、脱水风险报告清单、饮水频率报告清单、查询历史饮水记录、显示所有老人饮水报告、显示养老护理诊断报告，查询脱水风险预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_elderly_drinking_frequency_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_drinking_frequency_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备客厅/厨房水杯区域视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行老年人饮水频率（脱水风险）分析 | 调用 `-m scripts.smyx_elderly_drinking_frequency_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地客厅/厨房水杯区域视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络客厅/厨房水杯区域视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，老年人健康护理场景默认 `other` | 按需填写 |\n| `--list` | 显示老年人饮水频率（脱水风险）历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_elderly_drinking_frequency_analysis.py`](scripts/smyx_elderly_drinking_frequency_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov 视频，最大 10MB；**关键**：画面必须稳定覆盖水杯放置区域 |\n| 🔎 使用提醒 | **拿起次数仅作为饮水频率的间接代理**，杯里是否装水、是不是真的喝下去、是不是别人拿的杯子，本工具无法 100% 判定；建议结合饮水手势 + 个人基线 + 家属沟通综合判断 |\n| 🔎 使用提醒 | 多人共用水杯、家中有客人 / 看护人员、老人在他人家或外出，会显著影响计数准确性 |\n| 🔏 隐私合规 | 隐私合规：家庭/养老机构视频涉及个人隐私，使用前需取得老人/监护人明确知情同意，妥善加密保管；建议优先采用人体轮廓+物体框模式 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地客厅/厨房水杯区域视频\npython -m scripts.smyx_elderly_drinking_frequency_analysis --input /path/to/livingroom_day.mp4\n\n# 分析网络客厅/厨房水杯区域视频\npython -m scripts.smyx_elderly_drinking_frequency_analysis --url https://example.com/livingroom_day.mp4\n\n# 显示历史老人饮水频率（脱水风险）报告（自动触发关键词：查看老人饮水历史报告、脱水风险报告清单等）\npython -m scripts.smyx_elderly_drinking_frequency_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_drinking_frequency_analysis --input day.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_drinking_frequency_analysis --input day.mp4 --output result.json\n```\n\nFile v1.0.3:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-elderly-drinking-frequency-analysis\",\n  \"version\": \"1.0.3\",\n  \"publishedAt\": 1783000647861\n}\n\nFile v1.0.3:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放老年人饮水杯拿起频率（脱水风险）API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动老年人饮水频率分析任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取饮水统计与脱水风险结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史饮水记录\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_ELDERLY_DRINKING_FREQUENCY_ANALYSIS` - 老年人饮水杯拿起频率（脱水风险）\n\n## 输入约束\n\n- 摄像头：客厅 / 厨房 / 卧室固定摄像头，**画面应稳定覆盖老人常放水杯的区域（茶几/餐桌/床头柜）**\n- 帧率 ≥ 5 FPS；分辨率 ≥ 480p；光照尽量稳定\n- 视频时段建议覆盖一整天（08:00 - 22:00）或多段拼接覆盖白天\n- 杯子轮廓/区域可在初次部署时由用户在画面中框选 ROI（cup_region），提升识别准确度\n- 隐私敏感场景应启用人体轮廓模式\n\n## 关键观测信号\n\n- `cup_region_defined` - 是否定义了水杯放置区域 ROI\n- `cup_pickup_events` - 杯子被拿起事件列表（含时间戳 + 持续秒数 + 是否伴随饮水手势）\n- `cup_pickup_count_daily` - 当日累计拿起次数\n- `drink_gesture_count_daily` - 伴随抬手到口部的\"疑似饮水\"动作次数\n- `interval_between_drinks_min` - 相邻两次拿起的平均间隔（分钟）\n- `last_pickup_time` - 最近一次拿起时间\n\n## 历史基线字段\n\n- `baseline_window_days` - 基线时间窗口（默认 7-14 天）\n- `baseline_daily_pickup_avg` - 历史平均每日拿起次数\n- `baseline_daily_pickup_std` - 历史拿起次数标准差\n\n## 默认阈值（可由调用方覆盖）\n\n- 每日最低拿起次数阈值：< 6 次 → 触发\"脱水风险\"提醒\n- 长时间未饮水阈值：连续 > 4 小时未拿起 → 触发\"长时间未饮水\"提醒\n- 个性化基线偏离阈值：当日次数 < 基线均值 - 2 × 标准差 → 触发\"较平时显著下降\"提醒\n\n## 风险/提醒类型\n\n- `low_daily_intake` - 当日饮水次数过少（脱水风险）\n- `long_no_drink_interval` - 长时间未饮水\n- `below_personal_baseline` - 较个人历史基线显著下降\n- `normal` - 正常\n\n## 输出字段（参考）\n\n- `subject_detected` - 是否检测到老人\n- `cup_region_defined` / `cup_visible` - 水杯区域 / 杯子可见性\n- `daily_metrics` - 当日指标（cup_pickup_count_daily / drink_gesture_count_daily / interval_between_drinks_min / last_pickup_time）\n- `baseline_metrics` - 历史基线（baseline_daily_pickup_avg / baseline_daily_pickup_std）\n- `risk_type` - 风险类型（low_daily_intake / long_no_drink_interval / below_personal_baseline / normal）\n- `risk_level` - 风险等级（safe / notice / warning）\n- `alert_message` - 推送给家属的文本（如\"老人今日只拿了 3 次水杯，已 5 小时未喝水，建议提醒老人增加饮水\"）\n- `recommended_action` - 建议动作（remind_to_drink / family_call_check / observe_only）\n\n> 仅输出基于视觉的饮水行为统计与方向性提醒，**不直接代表实际饮水量**（杯里可能没装水/可能是别人拿杯子），不提供脱水症 / 泌尿系统感染 / 认知障碍等具体医学诊断；连续低饮水或老人有明显不适请及时就医。\n\nFile v1.0.3:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.3:scripts/config.yaml\n\n{}\n\nFile v1.0.3:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.3:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.3:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.3:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: prod\n\nFile v1.0.3:skill-card.md\n\n## Description: <br>\nUsing a fixed camera in the living room or kitchen, the skill analyzes video of the water-cup placement area, detects hand-to-cup pickup and putdown actions, counts daily cup-pickup events as an indirect proxy for water intake, and alerts caregivers when pickup frequency suggests dehydration risk. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[18072937735](https://clawhub.ai/user/18072937735) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nExternal caregivers, family members, elder-care operators, and developers use this skill to analyze fixed-camera video of a cup placement area and produce drinking-frequency reports, dehydration-risk reminders, and historical report listings. It is intended to provide visual behavior statistics and directional reminders, not medical diagnosis. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill sends sensitive household elder-care video, video URLs, and health-adjacent analysis data to a cloud service. <br>\nMitigation: Use only with informed consent from the monitored person or guardian, limit inputs to the intended cup-area footage, and confirm service retention, access controls, and data-handling terms before deployment. <br>\nRisk: The skill may create or reuse a service identity automatically and store local account tokens in the workspace data area. <br>\nMitigation: Install only in workspaces where automatic identity reuse is acceptable, restrict workspace access, and rotate or remove local tokens according to operational policy. <br>\nRisk: Cup pickups are only an indirect proxy for water intake and may be wrong when the cup is empty, used by another person, or outside the camera view. <br>\nMitigation: Treat reports as directional care prompts rather than medical conclusions, combine them with caregiver review and personal baseline context, and seek professional care when symptoms or persistent low intake are observed. <br>\n\n\n## Reference(s): <br>\n- [API Interface Documentation](references/api_doc.md) <br>\n- [SMYX Analysis API Documentation](skills/smyx_analysis/references/api_doc.md) <br>\n- [Skill Page](https://clawhub.ai/18072937735/skills/smyx-elderly-drinking-frequency-analysis) <br>\n- [Skill Demo](https://lifeemergence.com/sample.html) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Text, Markdown, JSON, Shell commands, Files, Guidance] <br>\n**Output Format:** [Markdown or JSON analysis reports, Markdown tables for history listings, shell commands for execution, and optional saved output files] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Reports include visual behavior statistics, dehydration-risk labels, caregiver-facing reminders, recommendations, and report links when returned by the cloud service.] <br>\n\n## Skill Version(s): <br>\n1.0.3 (source: server release metadata; artifact frontmatter reports 1.0.4) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v1.0.3:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.3:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3","readmeExcerpt":"Skill: Elderly Drinking-Cup Pickup Frequency (Dehydration Risk) | 老年人饮水杯拿起频率（脱水风险） Owner: 18072937735 Summary: Using a fixed camera in the living room or kitchen, the system analyzes video of the water-cup placement area (e.g., coffee table, dining table), detects hand-to-cup contact actions (pickup, putdown), and counts daily cup-pickup events (an indirect proxy for water intake). | 通过客厅或厨房固定摄像头，分析水杯放置区域（如茶几、餐桌）的视频，","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"python -m scripts.smyx_elderly_drinking_frequency_analysis --list"},{"language":"text","snippet":"requests>=2.28.0"},{"language":"bash","snippet":"# 分析本地客厅/厨房水杯区域视频\npython -m scripts.smyx_elderly_drinking_frequency_analysis --input /path/to/livingroom_day.mp4\n\n# 分析网络客厅/厨房水杯区域视频\npython -m scripts.smyx_elderly_drinking_frequency_analysis --url https://example.com/livingroom_day.mp4\n\n# 显示历史老人饮水频率（脱水风险）报告（自动触发关键词：查看老人饮水历史报告、脱水风险报告清单等）\npython -m scripts.smyx_elderly_drinking_frequency_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_drinking_frequency_analysis --input day.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_drinking_frequency_analysis --input day.mp4 --output result.json"},{"language":"bash","snippet":"python -m scripts.smyx_elderly_drinking_frequency_analysis --list"},{"language":"text","snippet":"requests>=2.28.0"},{"language":"bash","snippet":"# 分析本地客厅/厨房水杯区域视频\npython -m scripts.smyx_elderly_drinking_frequency_analysis --input /path/to/livingroom_day.mp4\n\n# 分析网络客厅/厨房水杯区域视频\npython -m scripts.smyx_elderly_drinking_frequency_analysis --url https://example.com/livingroom_day.mp4\n\n# 显示历史老人饮水频率（脱水风险）报告（自动触发关键词：查看老人饮水历史报告、脱水风险报告清单等）\npython -m scripts.smyx_elderly_drinking_frequency_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_drinking_frequency_analysis --input day.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_drinking_frequency_analysis --input day.mp4 --output result.json"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: \"smyx-elderly-drinking-frequency-analysis\"\ndescription: \"Using a fixed camera in the living room or kitchen, the system analyzes video of the water-cup placement area (e.g., coffee table, dining table), detects hand-to-cup contact actions (pickup, putdown), and counts daily cup-pickup events (an indirect proxy for water intake). | 通过客厅或厨房固定摄像头，分析水杯放置区域（如茶几、餐桌）的视频，检测手部与水杯的接触动作（拿起、放下），统计每日水杯拿起次数（间接反映饮水量）。当每日拿起次数低于预设阈值（如每天少于6次）时，输出'脱水风险'提醒，建议家属或护理人员督促老人增加饮水。\"\nversion: \"1.0.16\"\nlicense: \"MIT-0\"\n---\n\n# 💧 Elderly Drinking-Cup Pickup Frequency (Dehydration Risk) | 老年人饮水杯拿起频率（脱水风险）\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **老年人饮水杯拿起频率（脱水风险）** |\n| 🎯 核心目标 | 通过客厅或厨房固定摄像头，分析水杯放置区域（如茶几、餐桌）的视频，检测手部与水杯的接触动作（拿起、放下），统计每日水杯拿起次数（间接反映饮水量）。当每日拿起次数低于预设阈值（如每天少于6次）时，输出'脱水风险'提醒，建议家属或护理人员督促老人增加饮水。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_DRINKING_FREQUENCY_ANALYSIS` |\n\nUsing a fixed camera in the living room or kitchen, the system analyzes video of the water-cup placement area (e.g., coffee table, dining table), detects hand-to-cup contact actions (pickup, putdown), and counts daily cup-pickup events (an indirect proxy for water intake). When the daily pickup count falls below a preset threshold (e.g., fewer than 6 times per day), it outputs a 'dehydration risk' alert and suggests family members or caregivers to encourage the elderly to drink more. The skill helps prevent dehydration, urinary tract infection and cognitive decline caused by insufficient water intake. Application scenarios: homes of elderly people living alone, nursing homes, daycare centers. The system generates a daily drinking report; when the count is insufficient, it pushes a mobile-app reminder. Skill features: elderly people often have a dulled thirst sensation and are prone to chronic dehydration, leading to constipation, urinary tract infection, cognitive issues, etc. AI auto-counting of cup pickups helps family members spot insufficient intake in time and intervene. Can be integrated into home-care cameras or community health-management platforms as a practical feature for elderly health protection.\n\n通过客厅或厨房固定摄像头，分析水杯放置区域（如茶几、餐桌）的视频，检测手部与水杯的接触动作（拿起、放下），统计每日水杯拿起次数（间接反映饮水量）。当每日拿起次数低于预设阈值（如每天少于6次）时，输出'脱水风险'提醒，建议家属或护理人员督促老人增加饮水。该技能有助于预防因饮水不足导致的脱水、泌尿系感染及认知功能下降。应用场景：独居老人家庭、养老院、日间照料中心。系统每日生成饮水统计报告，当次数不足时通过手机APP推送提醒。技能特点：老年人对口渴感知迟钝，易发生慢性脱水，导致便秘、尿路感染、认知障碍等问题。通过AI自动统计饮水杯拿起次数，可帮助家属及时发现饮水不足，采取干预措施。该技能可集成到居家养老摄像头或社区健康管理平台中，成为老年人健康守护的实用功能。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人健康护理 AI。你的任务是分析固定摄像头对准水杯区域的视频，检测手部与水杯的接触动作（拿起和放下），统计每天的水杯拿起次数。当次数低于预设阈值时，输出脱水风险提醒。不要提供医疗诊断，仅输出基于视觉的饮水行为统计与方向性提醒。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于客厅/厨房固定摄像头视频，检测手-杯接触事件 + 抬手到口部动作 → 统计当日拿起次数与饮水频率 → 对比个人基线 → 输出脱水风险提醒（供家属/护理员主动督促老人饮水）\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | "},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-elderly-drinking-frequency-analysis\",\n  \"version\": \"1.0.12\",\n  \"publishedAt\": 1791053319630\n}"},{"path":"references/api_doc.md","content":"# API 接口文档\n\n此处用于存放老年人饮水杯拿起频率（脱水风险）API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动老年人饮水频率分析任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取饮水统计与脱水风险结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史饮水记录\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_ELDERLY_DRINKING_FREQUENCY_ANALYSIS` - 老年人饮水杯拿起频率（脱水风险）\n\n## 输入约束\n\n- 摄像头：客厅 / 厨房 / 卧室固定摄像头，**画面应稳定覆盖老人常放水杯的区域（茶几/餐桌/床头柜）**\n- 帧率 ≥ 5 FPS；分辨率 ≥ 480p；光照尽量稳定\n- 视频时段建议覆盖一整天（08:00 - 22:00）或多段拼接覆盖白天\n- 杯子轮廓/区域可在初次部署时由用户在画面中框选 ROI（cup_region），提升识别准确度\n- 隐私敏感场景应启用人体轮廓模式\n\n## 关键观测信号\n\n- `cup_region_defined` - 是否定义了水杯放置区域 ROI\n- `cup_pickup_events` - 杯子被拿起事件列表（含时间戳 + 持续秒数 + 是否伴随饮水手势）\n- `cup_pickup_count_daily` - 当日累计拿起次数\n- `drink_gesture_count_daily` - 伴随抬手到口部的\"疑似饮水\"动作次数\n- `interval_between_drinks_min` - 相邻两次拿起的平均间隔（分钟）\n- `last_pickup_time` - 最近一次拿起时间\n\n## 历史基线字段\n\n- `baseline_window_days` - 基线时间窗口（默认 7-14 天）\n- `baseline_daily_pickup_avg` - 历史平均每日拿起次数\n- `baseline_daily_pickup_std` - 历史拿起次数标准差\n\n## 默认阈值（可由调用方覆盖）\n\n- 每日最低拿起次数阈值：< 6 次 → 触发\"脱水风险\"提醒\n- 长时间未饮水阈值：连续 > 4 小时未拿起 → 触发\"长时间未饮水\"提醒\n- 个性化基线偏离阈值：当日次数 < 基线均值 - 2 × 标准差 → 触发\"较平时显著下降\"提醒\n\n## 风险/提醒类型\n\n- `low_daily_intake` - 当日饮水次数过少（脱水风险）\n- `long_no_drink_interval` - 长时间未饮水\n- `below_personal_baseline` - 较个人历史基线显著下降\n- `normal` - 正常\n\n## 输出字段（参考）\n\n- `subject_detected` - 是否检测到老人\n- `cup_region_defined` / `cup_visible` - 水杯区域 / 杯子可见性\n- `daily_metrics` - 当日指标（cup_pickup_count_daily / drink_gesture_count_daily / interval_between_drinks_min / last_pickup_time）\n- `baseline_metrics` - 历史基线（baseline_daily_pickup_avg / baseline_daily_pickup_std）\n- `risk_type` - 风险类型（low_daily_intake / long_no_drink_interval / below_personal_baseline / normal）\n- `risk_level` - 风险等级（safe / notice / warning）\n- `alert_message` - 推送给家属的文本（如\"老人今日只拿了 3 次水杯，已 5 小时未喝水，建议提醒老人增加饮水\"）\n- `recommended_action` - 建议动作（remind_to_drink / family_call_check / observe_only）\n\n> 仅输出基于视觉的饮水行为统计与方向性提醒，**不直接代表实际饮水量**（杯里可能没装水/可能是别人拿杯子），不提供脱水症 / 泌尿系统感染 / 认知障碍等具体医学诊断；连续低饮水或老人有明显不适请及时就医。"},{"path":"skills/smyx_analysis/references/api_doc.md","content":"# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |"},{"path":"scripts/config.yaml","content":"{}"}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":null,"editorialQuality":{"score":100,"threshold":65,"status":"thin","wordCount":1163,"uniquenessScore":44,"reasons":["uniqueness-below-45"]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-09T17:56:40.138Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-09T17:56:40.138Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-10T02:02:18.665Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}