{"id":"9909a229-4b9d-488a-8df6-96fc9a3af609","entityType":"agent","slug":"clawhub-18072937735-smyx-depression-behavioral-markers-analysis","name":"Depression Behavioral Markers (Long Immobility & Appetite Change) | 抑郁症辅助行为标记（长时间不动、食欲改变）","canonicalUrl":"https://www.xpersona.co/agent/clawhub-18072937735-smyx-depression-behavioral-markers-analysis","canonicalPath":"/agent/clawhub-18072937735-smyx-depression-behavioral-markers-analysis","generatedAt":"2026-10-10T06:44:35.353Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T00:12:43.280Z","emptyReason":null},"description":"Using fixed home cameras (bedroom and dining area), the system analyzes the multi-day behavior pattern of elderly people or solo-living individuals, detecting daily lying-in-bed duration (continuous lying > 20 hours per day) and a sharp drop in eating frequency / duration (e.g., daily eating-action count below 50% of personal baseline). | 通过家庭固定摄像头（卧室和餐厅区域），分析老年人或独居者连续多日的行为模式，检测卧床时长（连续卧床超过20小时/天）以及进食频次/时长骤减（如每日进食动作次数低于历史基线的50%）。当这些行为变化持续超过设定天数（如3天）时，输出行为变化报告，提醒家属或社区医生关注可能存在的抑郁倾向或其他健康问题。","descriptionLabel":"Source description","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 1.8K downloads reported by the source. Last updated 10/10/2026.","installCommand":"clawhub skill install s17f8q65zg3y98t86jdg1177g583whq8:smyx-depression-behavioral-markers-analysis","sourceUrl":"https://clawhub.ai/18072937735/smyx-depression-behavioral-markers-analysis","homepage":"https://clawhub.ai/18072937735/skills/smyx-depression-behavioral-markers-analysis","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/18072937735/smyx-depression-behavioral-markers-analysis","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/18072937735/skills/smyx-depression-behavioral-markers-analysis","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":65,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Depression Behavioral Markers (Long Immobility & Appetite Change) | 抑郁症辅助行为标记（长时间不动、食欲改变） technical dossier on Xpersona with agent coverage, OPENCLEW support, a"},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-10T00:12:43.280Z","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-10T00:12:43.280Z","emptyReason":null},"stars":null,"forks":null,"downloads":1848,"packageName":null,"latestVersion":"1.0.15","tractionLabel":"1.8K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T00:12:43.280Z","emptyReason":null},"lastUpdatedAt":"2026-10-10T00:12:43.280Z","lastCrawledAt":"2026-10-10T00:12:43.280Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-11T00:12:43.280Z","lastVerifiedAt":null,"highlights":[{"version":"1.0.15","createdAt":"2026-10-02T23:13:26.896Z","changelog":"- Updated skill version to 1.0.17. - Removed the redundant skill-card.md file. - SKILL.md: No substantive content changes; version metadata updated and file simplified to remove unnecessary redundancy.","fileCount":31,"zipByteSize":42776},{"version":"1.0.14","createdAt":"2026-09-22T05:27:25.001Z","changelog":"- Version bumped from 1.0.14 to 1.0.15. - Documentation updated in SKILL.md. - Configuration updated in skills/smyx_common/scripts/config.yaml. - Removed obsolete file: skill-card.md.","fileCount":31,"zipByteSize":43112},{"version":"1.0.13","createdAt":"2026-09-15T13:25:38.456Z","changelog":"- Updated SKILL.md version number from 1.0.11 to 1.0.14. - Minor documentation/content changes in SKILL.md; no feature logic changes. - Removed the skill-card.md file.","fileCount":31,"zipByteSize":42848},{"version":"1.0.12","createdAt":"2026-08-23T17:55:28.901Z","changelog":"- Updated SKILL.md: version string incremented from 1.0.10 to 1.0.11. - Removed file: skill-card.md. - No functional or logic changes to the skill content or features. - Documentation housekeeping only; no user-facing changes.","fileCount":31,"zipByteSize":43044},{"version":"1.0.11","createdAt":"2026-08-20T19:20:27.956Z","changelog":"- Updated version metadata in SKILL.md (version change from 1.0.9 to 1.0.10). - Removed the file skill-card.md. - Modified configuration in skills/smyx_common/scripts/config.yaml. - No user-facing feature changes documented.","fileCount":31,"zipByteSize":42892},{"version":"1.0.10","createdAt":"2026-08-10T08:55:33.673Z","changelog":"- Removed the file skill-card.md. - No feature or code changes; only a documentation asset was deleted.","fileCount":31,"zipByteSize":42970},{"version":"1.0.9","createdAt":"2026-08-04T21:20:31.088Z","changelog":"- Version updated to 1.0.9. - Documentation (SKILL.md) updated to reflect the latest version and details. - The file skill-card.md was removed. - No functional or major structural changes to the skill code indicated in this update.","fileCount":31,"zipByteSize":42949},{"version":"1.0.8","createdAt":"2026-07-29T20:53:43.349Z","changelog":"- Updated skill version from 1.0.6 to 1.0.7 in documentation. - Removed the file skill-card.md. - No functional or technical changes; this update is limited to documentation and packaging.","fileCount":31,"zipByteSize":42929}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s17f8q65zg3y98t86jdg1177g583whq8:smyx-depression-behavioral-markers-analysis","setupComplexity":"low","setupSteps":["Install using `clawhub skill install s17f8q65zg3y98t86jdg1177g583whq8:smyx-depression-behavioral-markers-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-depression-behavioral-markers-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-depression-behavioral-markers-analysis/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-depression-behavioral-markers-analysis/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-depression-behavioral-markers-analysis/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-depression-behavioral-markers-analysis/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-depression-behavioral-markers-analysis/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-depression-behavioral-markers-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-10T06:44:35.349Z"}},"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-depression-behavioral-markers-analysis/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-depression-behavioral-markers-analysis/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-depression-behavioral-markers-analysis/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-depression-behavioral-markers-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-10T00:12:43.280Z","emptyReason":null},"readme":"Skill: Depression Behavioral Markers (Long Immobility & Appetite Change) | 抑郁症辅助行为标记（长时间不动、食欲改变）\n\nOwner: 18072937735\n\nSummary: Using fixed home cameras (bedroom and dining area), the system analyzes the multi-day behavior pattern of elderly people or solo-living individuals, detecting daily lying-in-bed duration (continuous lying > 20 hours per day) and a sharp drop in eating frequency / duration (e.g., daily eating-action count below 50% of personal baseline). | 通过家庭固定摄像头（卧室和餐厅区域），分析老年人或独居者连续多日的行为模式，检测卧床时长（连续卧床超过20小时/天）以及进食频次/时长骤减（如每日进食动作次数低于历史基线的50%）。当这些行为变化持续超过设定天数（如3天）时，输出行为变化报告，提醒家属或社区医生关注可能存在的抑郁倾向或其他健康问题。\n\nTags: latest:1.0.15\n\nVersion history:\n\nv1.0.15 | 2026-10-02T23:13:26.896Z | auto\n\n- Updated skill version to 1.0.17.\n- Removed the redundant skill-card.md file.\n- SKILL.md: No substantive content changes; version metadata updated and file simplified to remove unnecessary redundancy.\n\nv1.0.14 | 2026-09-22T05:27:25.001Z | auto\n\n- Version bumped from 1.0.14 to 1.0.15.\n- Documentation updated in SKILL.md.\n- Configuration updated in skills/smyx_common/scripts/config.yaml.\n- Removed obsolete file: skill-card.md.\n\nv1.0.13 | 2026-09-15T13:25:38.456Z | auto\n\n- Updated SKILL.md version number from 1.0.11 to 1.0.14.\n- Minor documentation/content changes in SKILL.md; no feature logic changes.\n- Removed the skill-card.md file.\n\nv1.0.12 | 2026-08-23T17:55:28.901Z | auto\n\n- Updated SKILL.md: version string incremented from 1.0.10 to 1.0.11.\n- Removed file: skill-card.md.\n- No functional or logic changes to the skill content or features.\n- Documentation housekeeping only; no user-facing changes.\n\nv1.0.11 | 2026-08-20T19:20:27.956Z | auto\n\n- Updated version metadata in SKILL.md (version change from 1.0.9 to 1.0.10).\n- Removed the file skill-card.md.\n- Modified configuration in skills/smyx_common/scripts/config.yaml.\n- No user-facing feature changes documented.\n\nv1.0.10 | 2026-08-10T08:55:33.673Z | auto\n\n- Removed the file skill-card.md.\n- No feature or code changes; only a documentation asset was deleted.\n\nv1.0.9 | 2026-08-04T21:20:31.088Z | auto\n\n- Version updated to 1.0.9.\n- Documentation (SKILL.md) updated to reflect the latest version and details.\n- The file skill-card.md was removed.\n- No functional or major structural changes to the skill code indicated in this update.\n\nv1.0.8 | 2026-07-29T20:53:43.349Z | auto\n\n- Updated skill version from 1.0.6 to 1.0.7 in documentation.\n- Removed the file skill-card.md.\n- No functional or technical changes; this update is limited to documentation and packaging.\n\nv1.0.7 | 2026-07-19T10:23:28.011Z | auto\n\n- Updated version number in documentation to reflect latest release.\n- Removed deprecated file: `skill-card.md`.\n- Modified configuration and utility scripts in the `skills/smyx_common/scripts` directory.\n- Improved or added content to the SKILL.md documentation.\n- General cleanup and removal of outdated references.\n\nv1.0.6 | 2026-07-01T06:48:26.559Z | auto\n\nsmyx-depression-behavioral-markers-analysis 1.0.6\n\n- Updated documentation and removed redundant files (skill-card.md).\n- Modified SKILL.md with clarified details and improved instructions.\n- Applied adjustments to DAO and utility scripts for enhanced stability.\n- Cleaned up project files and improved overall maintainability.\n\nv1.0.5 | 2026-06-24T21:59:36.929Z | auto\n\n- Switched user identity parameter handling to be fully automatic and internal—users are no longer prompted for or shown any identity info.\n- Softened workflow and documentation: open-id management is now implicit and hidden; skill runs and history queries both operate without user input for identity.\n- Updated and streamlined documentation to clarify data privacy, workflow, and requirements; removed explicit open-id acquisition steps from user-facing instructions.\n- Adjusted scripts, config, and documentation to align with new internal-only handling of user identity, improving user privacy and experience.\n- Removed user-facing files related to manual identity handling.\n- General UI, UX, and codebase cleanup for better maintainability and clarity.\n\nv1.0.4 | 2026-06-19T04:18:30.500Z | auto\n\n- Updated configuration file paths for open-id retrieval; now prioritizes scripts/config.yaml in the skill root directory.\n- Removed support for the previously used skills/smyx_common/scripts/config.yaml as the primary open-id config source.\n- Adjusted related documentation, instructions, and inline references in SKILL.md to match new configuration location.\n- Deleted skill-card.md file.\n- Internal script and config references aligned to reflect updated directory structure.\n\nv1.0.3 | 2026-06-14T09:04:22.019Z | auto\n\nsmyx-depression-behavioral-markers-analysis v1.0.3\n\n- Documentation (SKILL.md) updated: made the description and procedural instructions more concise; reorganized and clarified steps, constraints, and reminders.\n- License field added to SKILL.md for better attribution and compliance.\n- Cleanup: removed redundant skill-card.md file.\n- Internal refactoring in common Python modules (config.py, util.py, requirements.txt) to align with updated documentation and ensure consistent dependency handling and configuration loading.\n\nv1.0.0 | 2026-05-27T03:42:59.071Z | auto\n\nsmyx-depression-behavioral-markers-analysis v1.0.0\n\n- Initial release focused on non-clinical, AI-powered behavioral observation for detecting potential depressive tendencies in elderly or solo-living individuals using fixed bedroom and dining area cameras.\n- Monitors multi-day patterns in lying-in-bed duration (>20 hours/day) and sharp decreases in eating frequency/duration (eating-action count <50% of personal baseline).\n- Generates daily behavior summaries and pushes alerts if abnormal patterns persist beyond a customizable threshold (e.g., 3 days).\n- Strict privacy, user identification, and data-fetch safeguards: requires open-id before analysis or historical report queries, with a defined retrieval flow.\n- Can be integrated into home-care cameras or health-management platforms to support remote mental-health monitoring and timely intervention.\n- Provides structured observation reports and friendly reminders; not a medical diagnostic tool.\n\nArchive index:\n\nArchive v1.0.15: 31 files, 42776 bytes\n\nFiles: references/api_doc.md (4659b), scripts/__init__.py (79b), scripts/config.py (721b), scripts/config.yaml (3b), scripts/skill.py (610b), scripts/smyx_depression_behavioral_markers_analysis.py (3744b), skill-card.md (2306b), SKILL.md (14274b), 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 (163b)\n\nFile v1.0.15:SKILL.md\n\n---\nname: \"smyx-depression-behavioral-markers-analysis\"\ndescription: \"Using fixed home cameras (bedroom and dining area), the system analyzes the multi-day behavior pattern of elderly people or solo-living individuals, detecting daily lying-in-bed duration (continuous lying > 20 hours per day) and a sharp drop in eating frequency / duration (e.g., daily eating-action count below 50% of personal baseline). | 通过家庭固定摄像头（卧室和餐厅区域），分析老年人或独居者连续多日的行为模式，检测卧床时长（连续卧床超过20小时/天）以及进食频次/时长骤减（如每日进食动作次数低于历史基线的50%）。当这些行为变化持续超过设定天数（如3天）时，输出行为变化报告，提醒家属或社区医生关注可能存在的抑郁倾向或其他健康问题。\"\nversion: \"1.0.17\"\nlicense: \"MIT-0\"\n---\n\n# 🌧️ Depression Behavioral Markers (Long Immobility & Appetite Change) | 抑郁症辅助行为标记（长时间不动、食欲改变）\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **抑郁症辅助行为标记（长时间不动、食欲改变）** |\n| 🎯 核心目标 | 通过家庭固定摄像头（卧室和餐厅区域），分析老年人或独居者连续多日的行为模式，检测卧床时长（连续卧床超过20小时/天）以及进食频次/时长骤减（如每日进食动作次数低于历史基线的50%）。当这些行为变化持续超过设定天数（如3天）时，输出行为变化报告，提醒家属或社区医生关注可能存在的抑郁倾向或其他健康问题。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_DEPRESSION_BEHAVIORAL_MARKERS_ANALYSIS` |\n\nUsing fixed home cameras (bedroom and dining area), the system analyzes the multi-day behavior pattern of elderly people or solo-living individuals, detecting daily lying-in-bed duration (continuous lying > 20 hours per day) and a sharp drop in eating frequency / duration (e.g., daily eating-action count below 50% of personal baseline). When these behavioral changes persist beyond a configured threshold (e.g., 3 days), the system outputs a behavioral-change report to remind family members or community doctors about possible depressive tendency or other health issues. This skill is ONLY a behavioral-observation aid and is NOT a medical diagnostic tool. Application scenarios: solo-living elderly homes, remote mental-health monitoring, community elderly care. The system generates a daily behavior summary and pushes alerts when an abnormal pattern is detected. Skill features: depression in the elderly often presents as decreased activity, reduced appetite, and increased bed time. AI auto-monitoring of these behavior changes can issue early signals before family or doctors notice, supporting timely intervention, reducing suicide risk, and improving quality of life. Can be integrated into home-care cameras or health-management platforms as a practical mental-health monitoring tool.\n\n通过家庭固定摄像头（卧室和餐厅区域），分析老年人或独居者连续多日的行为模式，检测卧床时长（连续卧床超过20小时/天）以及进食频次/时长骤减（如每日进食动作次数低于历史基线的50%）。当这些行为变化持续超过设定天数（如3天）时，输出行为变化报告，提醒家属或社区医生关注可能存在的抑郁倾向或其他健康问题。该技能仅为行为观察辅助工具，不作为医学诊断依据。应用场景：独居老人家庭、精神健康远程监测、社区养老。系统每日生成行为摘要，当检测到异常行为模式时推送提醒。技能特点：老年人抑郁症常表现为活动减少、食欲下降、卧床时间增多。通过AI自动监测这些行为变化，可在家属或医生尚未察觉时发出早期信号，有助于及时干预，降低自杀风险，改善生活质量。该技能可集成到居家养老摄像头或健康管理平台中，成为精神健康监测的实用工具。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人行为健康监测 AI。你的任务是分析家庭固定摄像头（卧室和餐厅区域）的连续视频（至少 24 小时），检测卧床时长（统计一天内卧床总时长）以及进食行为（识别手部抓握餐具送入口中的动作次数和时长）。对比历史基线（过去 7-14 天的个人平均数据），当卧床时长超过 20 小时/天或进食动作次数/时长低于基线的 50% 时，输出行为变化报告。不要提供医疗诊断，仅输出基于视觉的行为统计和变化提示。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于家庭卧室 + 餐厅双区域固定摄像头连续 ≥ 24 小时视频，统计每日卧床总时长 + 离床事件次数 + 进食动作次数 + 进食总时长 + 完整餐次数 → 与个人 7-14 天基线对比 → 连续异常 ≥ 3 天 → 输出行为变化报告 + 家属/社区医生友好提醒\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人体检测 + 床位 ROI 卧位识别（lying_in_bed_duration_daily_min） |\n| 2 | 离床事件计数 |\n| 3 | 手部抓握餐具送入口动作识别（eating_action_count_daily） |\n| 4 | 餐次数与进食总时长统计 |\n| 5 | 餐后剩余食物比例估计（参考） |\n| 6 | 个人 7-14 天基线均值/标准差计算 |\n| 7 | 连续异常天数累计 |\n| 8 | 行为异常模式分类（hypersomnia_immobility / appetite_loss / both / none） |\n| 9 | 风险信号等级判定（none → strong_signal） |\n| 10 | 家属/社区医生友好提醒文本生成 |\n| 11 | 心理援助热线参考 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供家庭卧室 + 餐厅区域固定摄像头连续 ≥ 24 小时视频 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_depression_behavioral_markers_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_depression_behavioral_markers_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_depression_behavioral_markers_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地家庭固定摄像头（卧室+餐厅区域，≥24h）视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络家庭固定摄像头（卧室+餐厅区域，≥24h）视频 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_depression_behavioral_markers_analysis.py`](scripts/smyx_depression_behavioral_markers_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 视频；**关键约束**：单次分析必须 ≥ 24 小时连续记录，且必须同时覆盖卧室与餐厅 |\n| 🔎 使用提醒 | 单日感冒、发烧、近期手术康复期、外出旅行等情形会显著影响卧床与进食指标，建议在配置中标记\"非常态期\"以暂停告警 |\n| 🔎 使用提醒 | 老人在外用餐（如子女家、社区食堂）会导致 eating_action_count_daily 显著低估，需结合家庭日程综合判定 |\n| 🧑‍⚖️ 结果性质 | 红线约束：**禁止**输出抑郁症诊断、量表评分（GDS-15 / PHQ-9）、用药建议或处方；**禁止**长期存储原始视频；**禁止**将\"行为变化\"等同于\"确诊抑郁症\" |\n| 🔎 使用提醒 | 当出现 `strong_signal` 或老人有任何自伤/自杀言语或行为时，**必须**在提醒中附**心理援助热线 010-82951332 / 400-161-9995**并强烈建议家属立即介入 |\n| 🔏 隐私合规 | 隐私合规：卧室视频涉及高度敏感个人隐私，使用前需取得老人本人明确知情同意，妥善加密保管；建议优先采用人体轮廓 + 面部马赛克模式 + 仅保存指标统计 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地连续 24h+ 卧室+餐厅视频\npython -m scripts.smyx_depression_behavioral_markers_analysis --input /path/to/24h_home.mp4\n\n# 分析网络连续 24h+ 卧室+餐厅视频\npython -m scripts.smyx_depression_behavioral_markers_analysis --url https://example.com/24h_home.mp4\n\n# 显示历史抑郁症辅助行为标记报告（自动触发关键词：查看抑郁行为标记历史报告、行为变化报告清单等）\npython -m scripts.smyx_depression_behavioral_markers_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_depression_behavioral_markers_analysis --input 24h.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_depression_behavioral_markers_analysis --input 24h.mp4 --output result.json\n```\n\nFile v1.0.15:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-depression-behavioral-markers-analysis\",\n  \"version\": \"1.0.15\",\n  \"publishedAt\": 1790982806896\n}\n\nFile v1.0.15: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_DEPRESSION_BEHAVIORAL_MARKERS_ANALYSIS` - 抑郁症辅助行为标记（长时间不动、食欲改变）\n\n## 输入约束\n\n- 摄像头：**必须覆盖卧室区域（含床位）和餐厅区域（含餐桌）双视角**；可由两个摄像头分别覆盖\n- 视频时长：**单次分析必须 ≥ 24 小时连续记录**（建议 24-72 小时滑动窗口），否则无法可靠统计每日总量\n- 帧率 ≥ 1 FPS 即可（长时序统计无需高帧率）；分辨率 ≥ 480p；夜间需配合红外或低照度增强\n- ROI 标定：床位 ROI（bed_region）+ 餐桌 ROI（dining_region）\n- 必须有 **7-14 天历史基线数据**（个人均值与标准差），否则首次只输出\"基线累积中\"状态\n- 隐私敏感场景必须启用人体轮廓 + 面部马赛克模式\n\n## 关键观测信号\n\n### 卧床指标\n- `lying_in_bed_duration_daily_min` - 当日卧床总时长（分钟）\n- `out_of_bed_event_count_daily` - 当日离床事件次数\n- `room_movement_minutes_daily` - 卧室外活动总时长（参考指标）\n\n### 进食指标\n- `eating_action_count_daily` - 当日进食动作次数（手部抓握餐具送入口中）\n- `eating_total_duration_min_daily` - 当日进食总时长\n- `meal_event_count_daily` - 当日完整餐次数（每餐 ≥ 1 分钟连续进食视为 1 餐）\n- `food_remained_ratio_estimate` - 餐后剩余食物比例估计（参考指标）\n\n### 基线对比\n- `baseline_window_days` - 基线窗口（默认 7-14 天）\n- `lying_delta_vs_baseline_min` - 当日卧床时长相对基线均值的偏差\n- `eating_action_ratio_vs_baseline` - 当日进食动作次数相对基线的比例（0-1+）\n- `consecutive_abnormal_days` - 连续异常天数\n\n## 阈值与异常判定\n\n- **卧床异常**：`lying_in_bed_duration_daily_min > 1200` (20 小时) 或相对基线 +6 小时及以上\n- **进食异常**：`eating_action_ratio_vs_baseline < 0.5`（动作次数低于基线 50%）或 `meal_event_count_daily < 1`（24 小时内无完整餐次）\n- **触发提醒**：上述异常**连续 ≥ 3 天**（默认）即输出\"行为变化报告\"\n- **基线累积期**：前 7 天仅记录不报警\n\n## 输出字段（参考）\n\n- `subject_detected` / `baseline_ready`\n- `daily_lying` / `daily_eating` - 当日两类指标\n- `baseline_comparison` - 与基线对比\n- `consecutive_abnormal_days`\n- `abnormal_pattern` - 行为异常模式（hypersomnia_immobility / appetite_loss / both / none）\n- `risk_signal_level` - 风险信号等级（none / mild_signal / notable_signal / strong_signal）\n- `alert_type` - 提醒类型（behavioral_change_3day / behavioral_change_7day / improving / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `alert_message` - 推送给家属/社区医生的友好文本（如\"妈妈最近 3 天每天卧床 ≥ 21 小时、进食动作较平时少了 60%，建议尽快电话关心或安排居家探视\"）\n- `recommend_action` - 建议动作（push_family_notice / suggest_visit / suggest_consult_doctor / observe_only）\n- `helpline_reference` - 当 strong_signal 时附**北京心理危机研究与干预中心 010-82951332 / 全国心理援助热线 400-161-9995**等参考资源\n\n## 强制约束与红线\n\n- ❌ **禁止**输出抑郁症诊断、抑郁量表评分（如 GDS-15、PHQ-9）、用药建议或处方\n- ❌ **禁止**长期存储原始视频；仅保存匿名化的指标统计与时间戳\n- ❌ **禁止**将\"行为变化\"等同于\"确诊抑郁症\"\n- ✅ 出现 strong_signal 时附**心理援助热线**与就近社区精神卫生服务参考\n- ✅ 建议由家属 / 社区医生 / 精神科医生联合解读，并配合患者本人自愿性谈话\n\n> 仅输出基于视觉的客观行为统计与友好提醒，**不构成抑郁症诊断、量表评分或治疗方案**；任何抑郁症确诊与治疗必须由精神科医生评估制定；若老人出现明显自伤/自杀言语或行为，请立即联系心理援助热线或当地急救机构。\n\nFile v1.0.15: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.15:scripts/config.yaml\n\n{}\n\nFile v1.0.15:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.15: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.15: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.15: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.15:skill-card.md\n\n## Description:\n\nAnalyzes home-camera footage for prolonged bed rest and reduced eating, then provides behavioral-change reports and alerts 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\nFamilies, community care teams, and developers use the skill to review changes in bed-rest and eating patterns from home-camera footage and receive caregiver-facing reports. Its observations are not a depression diagnosis or treatment advice.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Sensitive in-home footage and identity-linked requests are sent to the publisher's cloud services.\n\nMitigation: Obtain the monitored person's informed consent and confirm where footage, identifiers, and credentials are transmitted and stored before use.\n\nRisk: Cloud report history may expose private behavioral-health information if access controls or retention are unclear.\n\nMitigation: Avoid the history feature until access control and retention details are confirmed; limit report access to authorized caregivers.\n\nRisk: Behavioral signals may be mistaken for a medical diagnosis.\n\nMitigation: Treat reports as observations only and involve a qualified clinician for assessment or care decisions.\n\n## Reference(s):\n\n- [ClawHub skill release](https://clawhub.ai/18072937735/skills/smyx-depression-behavioral-markers-analysis)\n- [API documentation](artifact/references/api_doc.md)\n- [Skill demonstration](https://lifeemergence.com/sample.html)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Markdown, JSON]\n\n**Output Format:** [Structured behavioral-change report or history listing, with optional report link]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Can include bed-rest and eating metrics, alerts, suggested follow-up, and a saved report file.]\n\n## Skill Version(s):\n\n1.0.15 (source: server-resolved ClawHub release; bundled frontmatter says 1.0.17)\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.15:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.15:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.14: 31 files, 43112 bytes\n\nFiles: references/api_doc.md (4659b), scripts/__init__.py (79b), scripts/config.py (721b), scripts/config.yaml (3b), scripts/skill.py (610b), scripts/smyx_depression_behavioral_markers_analysis.py (3744b), skill-card.md (3021b), SKILL.md (14274b), 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 (163b)\n\nFile v1.0.14:SKILL.md\n\n---\nname: \"smyx-depression-behavioral-markers-analysis\"\ndescription: \"Using fixed home cameras (bedroom and dining area), the system analyzes the multi-day behavior pattern of elderly people or solo-living individuals, detecting daily lying-in-bed duration (continuous lying > 20 hours per day) and a sharp drop in eating frequency / duration (e.g., daily eating-action count below 50% of personal baseline). | 通过家庭固定摄像头（卧室和餐厅区域），分析老年人或独居者连续多日的行为模式，检测卧床时长（连续卧床超过20小时/天）以及进食频次/时长骤减（如每日进食动作次数低于历史基线的50%）。当这些行为变化持续超过设定天数（如3天）时，输出行为变化报告，提醒家属或社区医生关注可能存在的抑郁倾向或其他健康问题。\"\nversion: \"1.0.15\"\nlicense: \"MIT-0\"\n---\n\n# 🌧️ Depression Behavioral Markers (Long Immobility & Appetite Change) | 抑郁症辅助行为标记（长时间不动、食欲改变）\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **抑郁症辅助行为标记（长时间不动、食欲改变）** |\n| 🎯 核心目标 | 通过家庭固定摄像头（卧室和餐厅区域），分析老年人或独居者连续多日的行为模式，检测卧床时长（连续卧床超过20小时/天）以及进食频次/时长骤减（如每日进食动作次数低于历史基线的50%）。当这些行为变化持续超过设定天数（如3天）时，输出行为变化报告，提醒家属或社区医生关注可能存在的抑郁倾向或其他健康问题。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_DEPRESSION_BEHAVIORAL_MARKERS_ANALYSIS` |\n\nUsing fixed home cameras (bedroom and dining area), the system analyzes the multi-day behavior pattern of elderly people or solo-living individuals, detecting daily lying-in-bed duration (continuous lying > 20 hours per day) and a sharp drop in eating frequency / duration (e.g., daily eating-action count below 50% of personal baseline). When these behavioral changes persist beyond a configured threshold (e.g., 3 days), the system outputs a behavioral-change report to remind family members or community doctors about possible depressive tendency or other health issues. This skill is ONLY a behavioral-observation aid and is NOT a medical diagnostic tool. Application scenarios: solo-living elderly homes, remote mental-health monitoring, community elderly care. The system generates a daily behavior summary and pushes alerts when an abnormal pattern is detected. Skill features: depression in the elderly often presents as decreased activity, reduced appetite, and increased bed time. AI auto-monitoring of these behavior changes can issue early signals before family or doctors notice, supporting timely intervention, reducing suicide risk, and improving quality of life. Can be integrated into home-care cameras or health-management platforms as a practical mental-health monitoring tool.\n\n通过家庭固定摄像头（卧室和餐厅区域），分析老年人或独居者连续多日的行为模式，检测卧床时长（连续卧床超过20小时/天）以及进食频次/时长骤减（如每日进食动作次数低于历史基线的50%）。当这些行为变化持续超过设定天数（如3天）时，输出行为变化报告，提醒家属或社区医生关注可能存在的抑郁倾向或其他健康问题。该技能仅为行为观察辅助工具，不作为医学诊断依据。应用场景：独居老人家庭、精神健康远程监测、社区养老。系统每日生成行为摘要，当检测到异常行为模式时推送提醒。技能特点：老年人抑郁症常表现为活动减少、食欲下降、卧床时间增多。通过AI自动监测这些行为变化，可在家属或医生尚未察觉时发出早期信号，有助于及时干预，降低自杀风险，改善生活质量。该技能可集成到居家养老摄像头或健康管理平台中，成为精神健康监测的实用工具。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人行为健康监测 AI。你的任务是分析家庭固定摄像头（卧室和餐厅区域）的连续视频（至少 24 小时），检测卧床时长（统计一天内卧床总时长）以及进食行为（识别手部抓握餐具送入口中的动作次数和时长）。对比历史基线（过去 7-14 天的个人平均数据），当卧床时长超过 20 小时/天或进食动作次数/时长低于基线的 50% 时，输出行为变化报告。不要提供医疗诊断，仅输出基于视觉的行为统计和变化提示。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于家庭卧室 + 餐厅双区域固定摄像头连续 ≥ 24 小时视频，统计每日卧床总时长 + 离床事件次数 + 进食动作次数 + 进食总时长 + 完整餐次数 → 与个人 7-14 天基线对比 → 连续异常 ≥ 3 天 → 输出行为变化报告 + 家属/社区医生友好提醒\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人体检测 + 床位 ROI 卧位识别（lying_in_bed_duration_daily_min） |\n| 2 | 离床事件计数 |\n| 3 | 手部抓握餐具送入口动作识别（eating_action_count_daily） |\n| 4 | 餐次数与进食总时长统计 |\n| 5 | 餐后剩余食物比例估计（参考） |\n| 6 | 个人 7-14 天基线均值/标准差计算 |\n| 7 | 连续异常天数累计 |\n| 8 | 行为异常模式分类（hypersomnia_immobility / appetite_loss / both / none） |\n| 9 | 风险信号等级判定（none → strong_signal） |\n| 10 | 家属/社区医生友好提醒文本生成 |\n| 11 | 心理援助热线参考 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供家庭卧室 + 餐厅区域固定摄像头连续 ≥ 24 小时视频 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_depression_behavioral_markers_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_depression_behavioral_markers_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_depression_behavioral_markers_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地家庭固定摄像头（卧室+餐厅区域，≥24h）视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络家庭固定摄像头（卧室+餐厅区域，≥24h）视频 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_depression_behavioral_markers_analysis.py`](scripts/smyx_depression_behavioral_markers_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 视频；**关键约束**：单次分析必须 ≥ 24 小时连续记录，且必须同时覆盖卧室与餐厅 |\n| 🔎 使用提醒 | 单日感冒、发烧、近期手术康复期、外出旅行等情形会显著影响卧床与进食指标，建议在配置中标记\"非常态期\"以暂停告警 |\n| 🔎 使用提醒 | 老人在外用餐（如子女家、社区食堂）会导致 eating_action_count_daily 显著低估，需结合家庭日程综合判定 |\n| 🧑‍⚖️ 结果性质 | 红线约束：**禁止**输出抑郁症诊断、量表评分（GDS-15 / PHQ-9）、用药建议或处方；**禁止**长期存储原始视频；**禁止**将\"行为变化\"等同于\"确诊抑郁症\" |\n| 🔎 使用提醒 | 当出现 `strong_signal` 或老人有任何自伤/自杀言语或行为时，**必须**在提醒中附**心理援助热线 010-82951332 / 400-161-9995**并强烈建议家属立即介入 |\n| 🔏 隐私合规 | 隐私合规：卧室视频涉及高度敏感个人隐私，使用前需取得老人本人明确知情同意，妥善加密保管；建议优先采用人体轮廓 + 面部马赛克模式 + 仅保存指标统计 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地连续 24h+ 卧室+餐厅视频\npython -m scripts.smyx_depression_behavioral_markers_analysis --input /path/to/24h_home.mp4\n\n# 分析网络连续 24h+ 卧室+餐厅视频\npython -m scripts.smyx_depression_behavioral_markers_analysis --url https://example.com/24h_home.mp4\n\n# 显示历史抑郁症辅助行为标记报告（自动触发关键词：查看抑郁行为标记历史报告、行为变化报告清单等）\npython -m scripts.smyx_depression_behavioral_markers_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_depression_behavioral_markers_analysis --input 24h.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_depression_behavioral_markers_analysis --input 24h.mp4 --output result.json\n```\n\nFile v1.0.14:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-depression-behavioral-markers-analysis\",\n  \"version\": \"1.0.14\",\n  \"publishedAt\": 1790054845001\n}\n\nFile v1.0.14: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_DEPRESSION_BEHAVIORAL_MARKERS_ANALYSIS` - 抑郁症辅助行为标记（长时间不动、食欲改变）\n\n## 输入约束\n\n- 摄像头：**必须覆盖卧室区域（含床位）和餐厅区域（含餐桌）双视角**；可由两个摄像头分别覆盖\n- 视频时长：**单次分析必须 ≥ 24 小时连续记录**（建议 24-72 小时滑动窗口），否则无法可靠统计每日总量\n- 帧率 ≥ 1 FPS 即可（长时序统计无需高帧率）；分辨率 ≥ 480p；夜间需配合红外或低照度增强\n- ROI 标定：床位 ROI（bed_region）+ 餐桌 ROI（dining_region）\n- 必须有 **7-14 天历史基线数据**（个人均值与标准差），否则首次只输出\"基线累积中\"状态\n- 隐私敏感场景必须启用人体轮廓 + 面部马赛克模式\n\n## 关键观测信号\n\n### 卧床指标\n- `lying_in_bed_duration_daily_min` - 当日卧床总时长（分钟）\n- `out_of_bed_event_count_daily` - 当日离床事件次数\n- `room_movement_minutes_daily` - 卧室外活动总时长（参考指标）\n\n### 进食指标\n- `eating_action_count_daily` - 当日进食动作次数（手部抓握餐具送入口中）\n- `eating_total_duration_min_daily` - 当日进食总时长\n- `meal_event_count_daily` - 当日完整餐次数（每餐 ≥ 1 分钟连续进食视为 1 餐）\n- `food_remained_ratio_estimate` - 餐后剩余食物比例估计（参考指标）\n\n### 基线对比\n- `baseline_window_days` - 基线窗口（默认 7-14 天）\n- `lying_delta_vs_baseline_min` - 当日卧床时长相对基线均值的偏差\n- `eating_action_ratio_vs_baseline` - 当日进食动作次数相对基线的比例（0-1+）\n- `consecutive_abnormal_days` - 连续异常天数\n\n## 阈值与异常判定\n\n- **卧床异常**：`lying_in_bed_duration_daily_min > 1200` (20 小时) 或相对基线 +6 小时及以上\n- **进食异常**：`eating_action_ratio_vs_baseline < 0.5`（动作次数低于基线 50%）或 `meal_event_count_daily < 1`（24 小时内无完整餐次）\n- **触发提醒**：上述异常**连续 ≥ 3 天**（默认）即输出\"行为变化报告\"\n- **基线累积期**：前 7 天仅记录不报警\n\n## 输出字段（参考）\n\n- `subject_detected` / `baseline_ready`\n- `daily_lying` / `daily_eating` - 当日两类指标\n- `baseline_comparison` - 与基线对比\n- `consecutive_abnormal_days`\n- `abnormal_pattern` - 行为异常模式（hypersomnia_immobility / appetite_loss / both / none）\n- `risk_signal_level` - 风险信号等级（none / mild_signal / notable_signal / strong_signal）\n- `alert_type` - 提醒类型（behavioral_change_3day / behavioral_change_7day / improving / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `alert_message` - 推送给家属/社区医生的友好文本（如\"妈妈最近 3 天每天卧床 ≥ 21 小时、进食动作较平时少了 60%，建议尽快电话关心或安排居家探视\"）\n- `recommend_action` - 建议动作（push_family_notice / suggest_visit / suggest_consult_doctor / observe_only）\n- `helpline_reference` - 当 strong_signal 时附**北京心理危机研究与干预中心 010-82951332 / 全国心理援助热线 400-161-9995**等参考资源\n\n## 强制约束与红线\n\n- ❌ **禁止**输出抑郁症诊断、抑郁量表评分（如 GDS-15、PHQ-9）、用药建议或处方\n- ❌ **禁止**长期存储原始视频；仅保存匿名化的指标统计与时间戳\n- ❌ **禁止**将\"行为变化\"等同于\"确诊抑郁症\"\n- ✅ 出现 strong_signal 时附**心理援助热线**与就近社区精神卫生服务参考\n- ✅ 建议由家属 / 社区医生 / 精神科医生联合解读，并配合患者本人自愿性谈话\n\n> 仅输出基于视觉的客观行为统计与友好提醒，**不构成抑郁症诊断、量表评分或治疗方案**；任何抑郁症确诊与治疗必须由精神科医生评估制定；若老人出现明显自伤/自杀言语或行为，请立即联系心理援助热线或当地急救机构。\n\nFile v1.0.14: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.14:scripts/config.yaml\n\n{}\n\nFile v1.0.14:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.14: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.14: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.14: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.14:skill-card.md\n\n## Description:\n\nUsing fixed home cameras in bedroom and dining areas, this skill analyzes multi-day behavior patterns for elderly or solo-living individuals to report long immobility, reduced eating activity, and related behavior-change alerts without making a medical diagnosis.\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 developers, care-platform operators, and caregiving teams use this skill to analyze qualifying long-duration home-camera footage and produce behavior-change reports about bed duration, eating activity, baseline deviations, and family or community-doctor alerts. It is intended as a behavioral observation aid, not as a depression diagnosis, clinical scale, medication recommendation, or treatment plan.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill handles intimate bedroom and dining-area video and health-adjacent behavior reports through cloud APIs.\n\nMitigation: Use only with explicit consent from the monitored person, confirm the cloud service is trusted for this data, and prefer privacy-preserving modes such as body contours, face masking, encrypted storage, and metric-only retention.\n\nRisk: Evidence reports silent account/token provisioning and a hidden identity override.\n\nMitigation: Require identity handling to be reviewed and fixed before real caregiving or medical-adjacent use, and verify that account creation, token storage, and history access are transparent and authorized.\n\nRisk: Behavioral changes can be caused by illness, travel, eating outside the home, surgery recovery, or other context unrelated to depression.\n\nMitigation: Treat outputs as observation signals, not diagnoses; combine them with caregiver context and professional clinical review before action.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/18072937735/skills/smyx-depression-behavioral-markers-analysis)\n- [API documentation](references/api_doc.md)\n- [Skill demo](https://lifeemergence.com/sample.html)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown or JSON-like structured analysis reports with behavior metrics, alert text, recommendations, report links, and optional saved output files.]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May call cloud APIs for analysis and history retrieval; input normally must be continuous 24-hour or longer bedroom and dining-area video with a 7-14 day personal baseline for full alerting.]\n\n## Skill Version(s):\n\n1.0.14 (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.14:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.14:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.13: 31 files, 42848 bytes\n\nFiles: references/api_doc.md (4659b), scripts/__init__.py (79b), scripts/config.py (721b), scripts/config.yaml (3b), scripts/skill.py (610b), scripts/smyx_depression_behavioral_markers_analysis.py (3744b), skill-card.md (2532b), SKILL.md (14274b), 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 (163b)\n\nFile v1.0.13:SKILL.md\n\n---\nname: \"smyx-depression-behavioral-markers-analysis\"\ndescription: \"Using fixed home cameras (bedroom and dining area), the system analyzes the multi-day behavior pattern of elderly people or solo-living individuals, detecting daily lying-in-bed duration (continuous lying > 20 hours per day) and a sharp drop in eating frequency / duration (e.g., daily eating-action count below 50% of personal baseline). | 通过家庭固定摄像头（卧室和餐厅区域），分析老年人或独居者连续多日的行为模式，检测卧床时长（连续卧床超过20小时/天）以及进食频次/时长骤减（如每日进食动作次数低于历史基线的50%）。当这些行为变化持续超过设定天数（如3天）时，输出行为变化报告，提醒家属或社区医生关注可能存在的抑郁倾向或其他健康问题。\"\nversion: \"1.0.14\"\nlicense: \"MIT-0\"\n---\n\n# 🌧️ Depression Behavioral Markers (Long Immobility & Appetite Change) | 抑郁症辅助行为标记（长时间不动、食欲改变）\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **抑郁症辅助行为标记（长时间不动、食欲改变）** |\n| 🎯 核心目标 | 通过家庭固定摄像头（卧室和餐厅区域），分析老年人或独居者连续多日的行为模式，检测卧床时长（连续卧床超过20小时/天）以及进食频次/时长骤减（如每日进食动作次数低于历史基线的50%）。当这些行为变化持续超过设定天数（如3天）时，输出行为变化报告，提醒家属或社区医生关注可能存在的抑郁倾向或其他健康问题。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_DEPRESSION_BEHAVIORAL_MARKERS_ANALYSIS` |\n\nUsing fixed home cameras (bedroom and dining area), the system analyzes the multi-day behavior pattern of elderly people or solo-living individuals, detecting daily lying-in-bed duration (continuous lying > 20 hours per day) and a sharp drop in eating frequency / duration (e.g., daily eating-action count below 50% of personal baseline). When these behavioral changes persist beyond a configured threshold (e.g., 3 days), the system outputs a behavioral-change report to remind family members or community doctors about possible depressive tendency or other health issues. This skill is ONLY a behavioral-observation aid and is NOT a medical diagnostic tool. Application scenarios: solo-living elderly homes, remote mental-health monitoring, community elderly care. The system generates a daily behavior summary and pushes alerts when an abnormal pattern is detected. Skill features: depression in the elderly often presents as decreased activity, reduced appetite, and increased bed time. AI auto-monitoring of these behavior changes can issue early signals before family or doctors notice, supporting timely intervention, reducing suicide risk, and improving quality of life. Can be integrated into home-care cameras or health-management platforms as a practical mental-health monitoring tool.\n\n通过家庭固定摄像头（卧室和餐厅区域），分析老年人或独居者连续多日的行为模式，检测卧床时长（连续卧床超过20小时/天）以及进食频次/时长骤减（如每日进食动作次数低于历史基线的50%）。当这些行为变化持续超过设定天数（如3天）时，输出行为变化报告，提醒家属或社区医生关注可能存在的抑郁倾向或其他健康问题。该技能仅为行为观察辅助工具，不作为医学诊断依据。应用场景：独居老人家庭、精神健康远程监测、社区养老。系统每日生成行为摘要，当检测到异常行为模式时推送提醒。技能特点：老年人抑郁症常表现为活动减少、食欲下降、卧床时间增多。通过AI自动监测这些行为变化，可在家属或医生尚未察觉时发出早期信号，有助于及时干预，降低自杀风险，改善生活质量。该技能可集成到居家养老摄像头或健康管理平台中，成为精神健康监测的实用工具。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人行为健康监测 AI。你的任务是分析家庭固定摄像头（卧室和餐厅区域）的连续视频（至少 24 小时），检测卧床时长（统计一天内卧床总时长）以及进食行为（识别手部抓握餐具送入口中的动作次数和时长）。对比历史基线（过去 7-14 天的个人平均数据），当卧床时长超过 20 小时/天或进食动作次数/时长低于基线的 50% 时，输出行为变化报告。不要提供医疗诊断，仅输出基于视觉的行为统计和变化提示。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于家庭卧室 + 餐厅双区域固定摄像头连续 ≥ 24 小时视频，统计每日卧床总时长 + 离床事件次数 + 进食动作次数 + 进食总时长 + 完整餐次数 → 与个人 7-14 天基线对比 → 连续异常 ≥ 3 天 → 输出行为变化报告 + 家属/社区医生友好提醒\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人体检测 + 床位 ROI 卧位识别（lying_in_bed_duration_daily_min） |\n| 2 | 离床事件计数 |\n| 3 | 手部抓握餐具送入口动作识别（eating_action_count_daily） |\n| 4 | 餐次数与进食总时长统计 |\n| 5 | 餐后剩余食物比例估计（参考） |\n| 6 | 个人 7-14 天基线均值/标准差计算 |\n| 7 | 连续异常天数累计 |\n| 8 | 行为异常模式分类（hypersomnia_immobility / appetite_loss / both / none） |\n| 9 | 风险信号等级判定（none → strong_signal） |\n| 10 | 家属/社区医生友好提醒文本生成 |\n| 11 | 心理援助热线参考 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供家庭卧室 + 餐厅区域固定摄像头连续 ≥ 24 小时视频 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_depression_behavioral_markers_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_depression_behavioral_markers_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_depression_behavioral_markers_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地家庭固定摄像头（卧室+餐厅区域，≥24h）视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络家庭固定摄像头（卧室+餐厅区域，≥24h）视频 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_depression_behavioral_markers_analysis.py`](scripts/smyx_depression_behavioral_markers_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 视频；**关键约束**：单次分析必须 ≥ 24 小时连续记录，且必须同时覆盖卧室与餐厅 |\n| 🔎 使用提醒 | 单日感冒、发烧、近期手术康复期、外出旅行等情形会显著影响卧床与进食指标，建议在配置中标记\"非常态期\"以暂停告警 |\n| 🔎 使用提醒 | 老人在外用餐（如子女家、社区食堂）会导致 eating_action_count_daily 显著低估，需结合家庭日程综合判定 |\n| 🧑‍⚖️ 结果性质 | 红线约束：**禁止**输出抑郁症诊断、量表评分（GDS-15 / PHQ-9）、用药建议或处方；**禁止**长期存储原始视频；**禁止**将\"行为变化\"等同于\"确诊抑郁症\" |\n| 🔎 使用提醒 | 当出现 `strong_signal` 或老人有任何自伤/自杀言语或行为时，**必须**在提醒中附**心理援助热线 010-82951332 / 400-161-9995**并强烈建议家属立即介入 |\n| 🔏 隐私合规 | 隐私合规：卧室视频涉及高度敏感个人隐私，使用前需取得老人本人明确知情同意，妥善加密保管；建议优先采用人体轮廓 + 面部马赛克模式 + 仅保存指标统计 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地连续 24h+ 卧室+餐厅视频\npython -m scripts.smyx_depression_behavioral_markers_analysis --input /path/to/24h_home.mp4\n\n# 分析网络连续 24h+ 卧室+餐厅视频\npython -m scripts.smyx_depression_behavioral_markers_analysis --url https://example.com/24h_home.mp4\n\n# 显示历史抑郁症辅助行为标记报告（自动触发关键词：查看抑郁行为标记历史报告、行为变化报告清单等）\npython -m scripts.smyx_depression_behavioral_markers_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_depression_behavioral_markers_analysis --input 24h.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_depression_behavioral_markers_analysis --input 24h.mp4 --output result.json\n```\n\nFile v1.0.13:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-depression-behavioral-markers-analysis\",\n  \"version\": \"1.0.13\",\n  \"publishedAt\": 1789478738456\n}\n\nFile v1.0.13: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_DEPRESSION_BEHAVIORAL_MARKERS_ANALYSIS` - 抑郁症辅助行为标记（长时间不动、食欲改变）\n\n## 输入约束\n\n- 摄像头：**必须覆盖卧室区域（含床位）和餐厅区域（含餐桌）双视角**；可由两个摄像头分别覆盖\n- 视频时长：**单次分析必须 ≥ 24 小时连续记录**（建议 24-72 小时滑动窗口），否则无法可靠统计每日总量\n- 帧率 ≥ 1 FPS 即可（长时序统计无需高帧率）；分辨率 ≥ 480p；夜间需配合红外或低照度增强\n- ROI 标定：床位 ROI（bed_region）+ 餐桌 ROI（dining_region）\n- 必须有 **7-14 天历史基线数据**（个人均值与标准差），否则首次只输出\"基线累积中\"状态\n- 隐私敏感场景必须启用人体轮廓 + 面部马赛克模式\n\n## 关键观测信号\n\n### 卧床指标\n- `lying_in_bed_duration_daily_min` - 当日卧床总时长（分钟）\n- `out_of_bed_event_count_daily` - 当日离床事件次数\n- `room_movement_minutes_daily` - 卧室外活动总时长（参考指标）\n\n### 进食指标\n- `eating_action_count_daily` - 当日进食动作次数（手部抓握餐具送入口中）\n- `eating_total_duration_min_daily` - 当日进食总时长\n- `meal_event_count_daily` - 当日完整餐次数（每餐 ≥ 1 分钟连续进食视为 1 餐）\n- `food_remained_ratio_estimate` - 餐后剩余食物比例估计（参考指标）\n\n### 基线对比\n- `baseline_window_days` - 基线窗口（默认 7-14 天）\n- `lying_delta_vs_baseline_min` - 当日卧床时长相对基线均值的偏差\n- `eating_action_ratio_vs_baseline` - 当日进食动作次数相对基线的比例（0-1+）\n- `consecutive_abnormal_days` - 连续异常天数\n\n## 阈值与异常判定\n\n- **卧床异常**：`lying_in_bed_duration_daily_min > 1200` (20 小时) 或相对基线 +6 小时及以上\n- **进食异常**：`eating_action_ratio_vs_baseline < 0.5`（动作次数低于基线 50%）或 `meal_event_count_daily < 1`（24 小时内无完整餐次）\n- **触发提醒**：上述异常**连续 ≥ 3 天**（默认）即输出\"行为变化报告\"\n- **基线累积期**：前 7 天仅记录不报警\n\n## 输出字段（参考）\n\n- `subject_detected` / `baseline_ready`\n- `daily_lying` / `daily_eating` - 当日两类指标\n- `baseline_comparison` - 与基线对比\n- `consecutive_abnormal_days`\n- `abnormal_pattern` - 行为异常模式（hypersomnia_immobility / appetite_loss / both / none）\n- `risk_signal_level` - 风险信号等级（none / mild_signal / notable_signal / strong_signal）\n- `alert_type` - 提醒类型（behavioral_change_3day / behavioral_change_7day / improving / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `alert_message` - 推送给家属/社区医生的友好文本（如\"妈妈最近 3 天每天卧床 ≥ 21 小时、进食动作较平时少了 60%，建议尽快电话关心或安排居家探视\"）\n- `recommend_action` - 建议动作（push_family_notice / suggest_visit / suggest_consult_doctor / observe_only）\n- `helpline_reference` - 当 strong_signal 时附**北京心理危机研究与干预中心 010-82951332 / 全国心理援助热线 400-161-9995**等参考资源\n\n## 强制约束与红线\n\n- ❌ **禁止**输出抑郁症诊断、抑郁量表评分（如 GDS-15、PHQ-9）、用药建议或处方\n- ❌ **禁止**长期存储原始视频；仅保存匿名化的指标统计与时间戳\n- ❌ **禁止**将\"行为变化\"等同于\"确诊抑郁症\"\n- ✅ 出现 strong_signal 时附**心理援助热线**与就近社区精神卫生服务参考\n- ✅ 建议由家属 / 社区医生 / 精神科医生联合解读，并配合患者本人自愿性谈话\n\n> 仅输出基于视觉的客观行为统计与友好提醒，**不构成抑郁症诊断、量表评分或治疗方案**；任何抑郁症确诊与治疗必须由精神科医生评估制定；若老人出现明显自伤/自杀言语或行为，请立即联系心理援助热线或当地急救机构。\n\nFile v1.0.13: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.13:scripts/config.yaml\n\n{}\n\nFile v1.0.13:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.13: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.13: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.13: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.13:skill-card.md\n\n## Description:\n\nAnalyzes fixed bedroom and dining-area camera footage to summarize long immobility, lying-in-bed duration, appetite-related behavior changes, and related behavioral alerts for elderly or solo-living individuals.\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 care teams, family support workflows, and developers integrating home-care monitoring use this skill to generate behavioral-change summaries from fixed home camera inputs. The skill supports observation and alerting only; it is not a medical diagnostic tool.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill handles sensitive bedroom and dining-area camera footage for health-related behavioral monitoring.\n\nMitigation: Use only with explicit informed consent, documented processing and retention terms, and an environment approved for sensitive home-camera health data.\n\nRisk: Security evidence flags plaintext development endpoints and under-disclosed credential persistence.\n\nMitigation: Do not deploy with real footage until audited HTTPS production endpoints are used and local token storage is removed or secured.\n\nRisk: Behavioral markers may be misunderstood as a depression diagnosis.\n\nMitigation: Present outputs as observation summaries and escalation prompts only, and require qualified human review for health decisions.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/18072937735/skills/smyx-depression-behavioral-markers-analysis)\n- [Publisher profile](https://clawhub.ai/user/18072937735)\n- [API documentation](references/api_doc.md)\n- [SMYX 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, code, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown summaries, JSON report data, and shell commands.]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May include report links and family or community clinician alert text when analysis completes.]\n\n## Skill Version(s):\n\n1.0.13 (source: server release metadata)\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.13:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.13:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.12: 31 files, 43044 bytes\n\nFiles: references/api_doc.md (4659b), scripts/__init__.py (79b), scripts/config.py (721b), scripts/config.yaml (3b), scripts/skill.py (610b), scripts/smyx_depression_behavioral_markers_analysis.py (3744b), skill-card.md (2873b), SKILL.md (14274b), 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 (163b)\n\nFile v1.0.12:SKILL.md\n\n---\nname: \"smyx-depression-behavioral-markers-analysis\"\ndescription: \"Using fixed home cameras (bedroom and dining area), the system analyzes the multi-day behavior pattern of elderly people or solo-living individuals, detecting daily lying-in-bed duration (continuous lying > 20 hours per day) and a sharp drop in eating frequency / duration (e.g., daily eating-action count below 50% of personal baseline). | 通过家庭固定摄像头（卧室和餐厅区域），分析老年人或独居者连续多日的行为模式，检测卧床时长（连续卧床超过20小时/天）以及进食频次/时长骤减（如每日进食动作次数低于历史基线的50%）。当这些行为变化持续超过设定天数（如3天）时，输出行为变化报告，提醒家属或社区医生关注可能存在的抑郁倾向或其他健康问题。\"\nversion: \"1.0.11\"\nlicense: \"MIT-0\"\n---\n\n# 🌧️ Depression Behavioral Markers (Long Immobility & Appetite Change) | 抑郁症辅助行为标记（长时间不动、食欲改变）\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **抑郁症辅助行为标记（长时间不动、食欲改变）** |\n| 🎯 核心目标 | 通过家庭固定摄像头（卧室和餐厅区域），分析老年人或独居者连续多日的行为模式，检测卧床时长（连续卧床超过20小时/天）以及进食频次/时长骤减（如每日进食动作次数低于历史基线的50%）。当这些行为变化持续超过设定天数（如3天）时，输出行为变化报告，提醒家属或社区医生关注可能存在的抑郁倾向或其他健康问题。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_DEPRESSION_BEHAVIORAL_MARKERS_ANALYSIS` |\n\nUsing fixed home cameras (bedroom and dining area), the system analyzes the multi-day behavior pattern of elderly people or solo-living individuals, detecting daily lying-in-bed duration (continuous lying > 20 hours per day) and a sharp drop in eating frequency / duration (e.g., daily eating-action count below 50% of personal baseline). When these behavioral changes persist beyond a configured threshold (e.g., 3 days), the system outputs a behavioral-change report to remind family members or community doctors about possible depressive tendency or other health issues. This skill is ONLY a behavioral-observation aid and is NOT a medical diagnostic tool. Application scenarios: solo-living elderly homes, remote mental-health monitoring, community elderly care. The system generates a daily behavior summary and pushes alerts when an abnormal pattern is detected. Skill features: depression in the elderly often presents as decreased activity, reduced appetite, and increased bed time. AI auto-monitoring of these behavior changes can issue early signals before family or doctors notice, supporting timely intervention, reducing suicide risk, and improving quality of life. Can be integrated into home-care cameras or health-management platforms as a practical mental-health monitoring tool.\n\n通过家庭固定摄像头（卧室和餐厅区域），分析老年人或独居者连续多日的行为模式，检测卧床时长（连续卧床超过20小时/天）以及进食频次/时长骤减（如每日进食动作次数低于历史基线的50%）。当这些行为变化持续超过设定天数（如3天）时，输出行为变化报告，提醒家属或社区医生关注可能存在的抑郁倾向或其他健康问题。该技能仅为行为观察辅助工具，不作为医学诊断依据。应用场景：独居老人家庭、精神健康远程监测、社区养老。系统每日生成行为摘要，当检测到异常行为模式时推送提醒。技能特点：老年人抑郁症常表现为活动减少、食欲下降、卧床时间增多。通过AI自动监测这些行为变化，可在家属或医生尚未察觉时发出早期信号，有助于及时干预，降低自杀风险，改善生活质量。该技能可集成到居家养老摄像头或健康管理平台中，成为精神健康监测的实用工具。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人行为健康监测 AI。你的任务是分析家庭固定摄像头（卧室和餐厅区域）的连续视频（至少 24 小时），检测卧床时长（统计一天内卧床总时长）以及进食行为（识别手部抓握餐具送入口中的动作次数和时长）。对比历史基线（过去 7-14 天的个人平均数据），当卧床时长超过 20 小时/天或进食动作次数/时长低于基线的 50% 时，输出行为变化报告。不要提供医疗诊断，仅输出基于视觉的行为统计和变化提示。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于家庭卧室 + 餐厅双区域固定摄像头连续 ≥ 24 小时视频，统计每日卧床总时长 + 离床事件次数 + 进食动作次数 + 进食总时长 + 完整餐次数 → 与个人 7-14 天基线对比 → 连续异常 ≥ 3 天 → 输出行为变化报告 + 家属/社区医生友好提醒\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人体检测 + 床位 ROI 卧位识别（lying_in_bed_duration_daily_min） |\n| 2 | 离床事件计数 |\n| 3 | 手部抓握餐具送入口动作识别（eating_action_count_daily） |\n| 4 | 餐次数与进食总时长统计 |\n| 5 | 餐后剩余食物比例估计（参考） |\n| 6 | 个人 7-14 天基线均值/标准差计算 |\n| 7 | 连续异常天数累计 |\n| 8 | 行为异常模式分类（hypersomnia_immobility / appetite_loss / both / none） |\n| 9 | 风险信号等级判定（none → strong_signal） |\n| 10 | 家属/社区医生友好提醒文本生成 |\n| 11 | 心理援助热线参考 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供家庭卧室 + 餐厅区域固定摄像头连续 ≥ 24 小时视频 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_depression_behavioral_markers_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_depression_behavioral_markers_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_depression_behavioral_markers_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地家庭固定摄像头（卧室+餐厅区域，≥24h）视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络家庭固定摄像头（卧室+餐厅区域，≥24h）视频 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_depression_behavioral_markers_analysis.py`](scripts/smyx_depression_behavioral_markers_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 视频；**关键约束**：单次分析必须 ≥ 24 小时连续记录，且必须同时覆盖卧室与餐厅 |\n| 🔎 使用提醒 | 单日感冒、发烧、近期手术康复期、外出旅行等情形会显著影响卧床与进食指标，建议在配置中标记\"非常态期\"以暂停告警 |\n| 🔎 使用提醒 | 老人在外用餐（如子女家、社区食堂）会导致 eating_action_count_daily 显著低估，需结合家庭日程综合判定 |\n| 🧑‍⚖️ 结果性质 | 红线约束：**禁止**输出抑郁症诊断、量表评分（GDS-15 / PHQ-9）、用药建议或处方；**禁止**长期存储原始视频；**禁止**将\"行为变化\"等同于\"确诊抑郁症\" |\n| 🔎 使用提醒 | 当出现 `strong_signal` 或老人有任何自伤/自杀言语或行为时，**必须**在提醒中附**心理援助热线 010-82951332 / 400-161-9995**并强烈建议家属立即介入 |\n| 🔏 隐私合规 | 隐私合规：卧室视频涉及高度敏感个人隐私，使用前需取得老人本人明确知情同意，妥善加密保管；建议优先采用人体轮廓 + 面部马赛克模式 + 仅保存指标统计 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地连续 24h+ 卧室+餐厅视频\npython -m scripts.smyx_depression_behavioral_markers_analysis --input /path/to/24h_home.mp4\n\n# 分析网络连续 24h+ 卧室+餐厅视频\npython -m scripts.smyx_depression_behavioral_markers_analysis --url https://example.com/24h_home.mp4\n\n# 显示历史抑郁症辅助行为标记报告（自动触发关键词：查看抑郁行为标记历史报告、行为变化报告清单等）\npython -m scripts.smyx_depression_behavioral_markers_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_depression_behavioral_markers_analysis --input 24h.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_depression_behavioral_markers_analysis --input 24h.mp4 --output result.json\n```\n\nFile v1.0.12:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-depression-behavioral-markers-analysis\",\n  \"version\": \"1.0.12\",\n  \"publishedAt\": 1787507728901\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_DEPRESSION_BEHAVIORAL_MARKERS_ANALYSIS` - 抑郁症辅助行为标记（长时间不动、食欲改变）\n\n## 输入约束\n\n- 摄像头：**必须覆盖卧室区域（含床位）和餐厅区域（含餐桌）双视角**；可由两个摄像头分别覆盖\n- 视频时长：**单次分析必须 ≥ 24 小时连续记录**（建议 24-72 小时滑动窗口），否则无法可靠统计每日总量\n- 帧率 ≥ 1 FPS 即可（长时序统计无需高帧率）；分辨率 ≥ 480p；夜间需配合红外或低照度增强\n- ROI 标定：床位 ROI（bed_region）+ 餐桌 ROI（dining_region）\n- 必须有 **7-14 天历史基线数据**（个人均值与标准差），否则首次只输出\"基线累积中\"状态\n- 隐私敏感场景必须启用人体轮廓 + 面部马赛克模式\n\n## 关键观测信号\n\n### 卧床指标\n- `lying_in_bed_duration_daily_min` - 当日卧床总时长（分钟）\n- `out_of_bed_event_count_daily` - 当日离床事件次数\n- `room_movement_minutes_daily` - 卧室外活动总时长（参考指标）\n\n### 进食指标\n- `eating_action_count_daily` - 当日进食动作次数（手部抓握餐具送入口中）\n- `eating_total_duration_min_daily` - 当日进食总时长\n- `meal_event_count_daily` - 当日完整餐次数（每餐 ≥ 1 分钟连续进食视为 1 餐）\n- `food_remained_ratio_estimate` - 餐后剩余食物比例估计（参考指标）\n\n### 基线对比\n- `baseline_window_days` - 基线窗口（默认 7-14 天）\n- `lying_delta_vs_baseline_min` - 当日卧床时长相对基线均值的偏差\n- `eating_action_ratio_vs_baseline` - 当日进食动作次数相对基线的比例（0-1+）\n- `consecutive_abnormal_days` - 连续异常天数\n\n## 阈值与异常判定\n\n- **卧床异常**：`lying_in_bed_duration_daily_min > 1200` (20 小时) 或相对基线 +6 小时及以上\n- **进食异常**：`eating_action_ratio_vs_baseline < 0.5`（动作次数低于基线 50%）或 `meal_event_count_daily < 1`（24 小时内无完整餐次）\n- **触发提醒**：上述异常**连续 ≥ 3 天**（默认）即输出\"行为变化报告\"\n- **基线累积期**：前 7 天仅记录不报警\n\n## 输出字段（参考）\n\n- `subject_detected` / `baseline_ready`\n- `daily_lying` / `daily_eating` - 当日两类指标\n- `baseline_comparison` - 与基线对比\n- `consecutive_abnormal_days`\n- `abnormal_pattern` - 行为异常模式（hypersomnia_immobility / appetite_loss / both / none）\n- `risk_signal_level` - 风险信号等级（none / mild_signal / notable_signal / strong_signal）\n- `alert_type` - 提醒类型（behavioral_change_3day / behavioral_change_7day / improving / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `alert_message` - 推送给家属/社区医生的友好文本（如\"妈妈最近 3 天每天卧床 ≥ 21 小时、进食动作较平时少了 60%，建议尽快电话关心或安排居家探视\"）\n- `recommend_action` - 建议动作（push_family_notice / suggest_visit / suggest_consult_doctor / observe_only）\n- `helpline_reference` - 当 strong_signal 时附**北京心理危机研究与干预中心 010-82951332 / 全国心理援助热线 400-161-9995**等参考资源\n\n## 强制约束与红线\n\n- ❌ **禁止**输出抑郁症诊断、抑郁量表评分（如 GDS-15、PHQ-9）、用药建议或处方\n- ❌ **禁止**长期存储原始视频；仅保存匿名化的指标统计与时间戳\n- ❌ **禁止**将\"行为变化\"等同于\"确诊抑郁症\"\n- ✅ 出现 strong_signal 时附**心理援助热线**与就近社区精神卫生服务参考\n- ✅ 建议由家属 / 社区医生 / 精神科医生联合解读，并配合患者本人自愿性谈话\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: dev\n\nFile v1.0.12:skill-card.md\n\n## Description:\n\nAnalyzes fixed home-camera video from bedroom and dining areas to report long immobility, appetite-related behavior changes, and caregiver-facing alerts without making medical diagnoses.\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, community care teams, and developers use this skill to analyze 24-hour-or-longer fixed-camera home video for sustained bed rest and reduced eating behavior signals. The skill produces observation reports and alerts for follow-up, not depression diagnosis, scoring, medication advice, or treatment planning.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Highly sensitive in-home health video may be uploaded or remotely processed.\n\nMitigation: Install only with the monitored person's informed consent, use a trusted provider, and confirm retention, access, and deletion terms before use.\n\nRisk: The skill may silently create or reuse an internal identity and store service tokens locally.\n\nMitigation: Run it in a dedicated environment, inspect local identity and token storage, and clear or revoke credentials when the skill is no longer needed.\n\nRisk: Behavioral markers can be mistaken for a medical diagnosis.\n\nMitigation: Use outputs only as observation aids and route concerning signals to family, community care staff, or licensed clinicians for interpretation.\n\nRisk: Continuous bedroom and dining-area monitoring can expose intimate personal routines.\n\nMitigation: Prefer privacy-preserving modes such as human silhouettes, face masking, metric-only retention, and minimized access to raw recordings.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/18072937735/skills/smyx-depression-behavioral-markers-analysis)\n- [Depression behavioral markers API 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, JSON, shell commands, guidance]\n\n**Output Format:** [Markdown reports and JSON-formatted analysis results]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May include report export links and API-backed history listings; reliable alerts require 24h+ bedroom and dining-area video plus a 7-14 day personal baseline.]\n\n## Skill Version(s):\n\n1.0.12 (source: server release metadata; artifact frontmatter says 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.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, 42892 bytes\n\nFiles: references/api_doc.md (4659b), scripts/__init__.py (79b), scripts/config.py (721b), scripts/config.yaml (3b), scripts/skill.py (610b), scripts/smyx_depression_behavioral_markers_analysis.py (3744b), skill-card.md (2623b), SKILL.md (14274b), 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 (163b)\n\nFile v1.0.11:SKILL.md\n\n---\nname: \"smyx-depression-behavioral-markers-analysis\"\ndescription: \"Using fixed home cameras (bedroom and dining area), the system analyzes the multi-day behavior pattern of elderly people or solo-living individuals, detecting daily lying-in-bed duration (continuous lying > 20 hours per day) and a sharp drop in eating frequency / duration (e.g., daily eating-action count below 50% of personal baseline). | 通过家庭固定摄像头（卧室和餐厅区域），分析老年人或独居者连续多日的行为模式，检测卧床时长（连续卧床超过20小时/天）以及进食频次/时长骤减（如每日进食动作次数低于历史基线的50%）。当这些行为变化持续超过设定天数（如3天）时，输出行为变化报告，提醒家属或社区医生关注可能存在的抑郁倾向或其他健康问题。\"\nversion: \"1.0.10\"\nlicense: \"MIT-0\"\n---\n\n# 🌧️ Depression Behavioral Markers (Long Immobility & Appetite Change) | 抑郁症辅助行为标记（长时间不动、食欲改变）\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **抑郁症辅助行为标记（长时间不动、食欲改变）** |\n| 🎯 核心目标 | 通过家庭固定摄像头（卧室和餐厅区域），分析老年人或独居者连续多日的行为模式，检测卧床时长（连续卧床超过20小时/天）以及进食频次/时长骤减（如每日进食动作次数低于历史基线的50%）。当这些行为变化持续超过设定天数（如3天）时，输出行为变化报告，提醒家属或社区医生关注可能存在的抑郁倾向或其他健康问题。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_DEPRESSION_BEHAVIORAL_MARKERS_ANALYSIS` |\n\nUsing fixed home cameras (bedroom and dining area), the system analyzes the multi-day behavior pattern of elderly people or solo-living individuals, detecting daily lying-in-bed duration (continuous lying > 20 hours per day) and a sharp drop in eating frequency / duration (e.g., daily eating-action count below 50% of personal baseline). When these behavioral changes persist beyond a configured threshold (e.g., 3 days), the system outputs a behavioral-change report to remind family members or community doctors about possible depressive tendency or other health issues. This skill is ONLY a behavioral-observation aid and is NOT a medical diagnostic tool. Application scenarios: solo-living elderly homes, remote mental-health monitoring, community elderly care. The system generates a daily behavior summary and pushes alerts when an abnormal pattern is detected. Skill features: depression in the elderly often presents as decreased activity, reduced appetite, and increased bed time. AI auto-monitoring of these behavior changes can issue early signals before family or doctors notice, supporting timely intervention, reducing suicide risk, and improving quality of life. Can be integrated into home-care cameras or health-management platforms as a practical mental-health monitoring tool.\n\n通过家庭固定摄像头（卧室和餐厅区域），分析老年人或独居者连续多日的行为模式，检测卧床时长（连续卧床超过20小时/天）以及进食频次/时长骤减（如每日进食动作次数低于历史基线的50%）。当这些行为变化持续超过设定天数（如3天）时，输出行为变化报告，提醒家属或社区医生关注可能存在的抑郁倾向或其他健康问题。该技能仅为行为观察辅助工具，不作为医学诊断依据。应用场景：独居老人家庭、精神健康远程监测、社区养老。系统每日生成行为摘要，当检测到异常行为模式时推送提醒。技能特点：老年人抑郁症常表现为活动减少、食欲下降、卧床时间增多。通过AI自动监测这些行为变化，可在家属或医生尚未察觉时发出早期信号，有助于及时干预，降低自杀风险，改善生活质量。该技能可集成到居家养老摄像头或健康管理平台中，成为精神健康监测的实用工具。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人行为健康监测 AI。你的任务是分析家庭固定摄像头（卧室和餐厅区域）的连续视频（至少 24 小时），检测卧床时长（统计一天内卧床总时长）以及进食行为（识别手部抓握餐具送入口中的动作次数和时长）。对比历史基线（过去 7-14 天的个人平均数据），当卧床时长超过 20 小时/天或进食动作次数/时长低于基线的 50% 时，输出行为变化报告。不要提供医疗诊断，仅输出基于视觉的行为统计和变化提示。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于家庭卧室 + 餐厅双区域固定摄像头连续 ≥ 24 小时视频，统计每日卧床总时长 + 离床事件次数 + 进食动作次数 + 进食总时长 + 完整餐次数 → 与个人 7-14 天基线对比 → 连续异常 ≥ 3 天 → 输出行为变化报告 + 家属/社区医生友好提醒\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人体检测 + 床位 ROI 卧位识别（lying_in_bed_duration_daily_min） |\n| 2 | 离床事件计数 |\n| 3 | 手部抓握餐具送入口动作识别（eating_action_count_daily） |\n| 4 | 餐次数与进食总时长统计 |\n| 5 | 餐后剩余食物比例估计（参考） |\n| 6 | 个人 7-14 天基线均值/标准差计算 |\n| 7 | 连续异常天数累计 |\n| 8 | 行为异常模式分类（hypersomnia_immobility / appetite_loss / both / none） |\n| 9 | 风险信号等级判定（none → strong_signal） |\n| 10 | 家属/社区医生友好提醒文本生成 |\n| 11 | 心理援助热线参考 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供家庭卧室 + 餐厅区域固定摄像头连续 ≥ 24 小时视频 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_depression_behavioral_markers_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_depression_behavioral_markers_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_depression_behavioral_markers_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地家庭固定摄像头（卧室+餐厅区域，≥24h）视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络家庭固定摄像头（卧室+餐厅区域，≥24h）视频 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_depression_behavioral_markers_analysis.py`](scripts/smyx_depression_behavioral_markers_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 视频；**关键约束**：单次分析必须 ≥ 24 小时连续记录，且必须同时覆盖卧室与餐厅 |\n| 🔎 使用提醒 | 单日感冒、发烧、近期手术康复期、外出旅行等情形会显著影响卧床与进食指标，建议在配置中标记\"非常态期\"以暂停告警 |\n| 🔎 使用提醒 | 老人在外用餐（如子女家、社区食堂）会导致 eating_action_count_daily 显著低估，需结合家庭日程综合判定 |\n| 🧑‍⚖️ 结果性质 | 红线约束：**禁止**输出抑郁症诊断、量表评分（GDS-15 / PHQ-9）、用药建议或处方；**禁止**长期存储原始视频；**禁止**将\"行为变化\"等同于\"确诊抑郁症\" |\n| 🔎 使用提醒 | 当出现 `strong_signal` 或老人有任何自伤/自杀言语或行为时，**必须**在提醒中附**心理援助热线 010-82951332 / 400-161-9995**并强烈建议家属立即介入 |\n| 🔏 隐私合规 | 隐私合规：卧室视频涉及高度敏感个人隐私，使用前需取得老人本人明确知情同意，妥善加密保管；建议优先采用人体轮廓 + 面部马赛克模式 + 仅保存指标统计 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地连续 24h+ 卧室+餐厅视频\npython -m scripts.smyx_depression_behavioral_markers_analysis --input /path/to/24h_home.mp4\n\n# 分析网络连续 24h+ 卧室+餐厅视频\npython -m scripts.smyx_depression_behavioral_markers_analysis --url https://example.com/24h_home.mp4\n\n# 显示历史抑郁症辅助行为标记报告（自动触发关键词：查看抑郁行为标记历史报告、行为变化报告清单等）\npython -m scripts.smyx_depression_behavioral_markers_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_depression_behavioral_markers_analysis --input 24h.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_depression_behavioral_markers_analysis --input 24h.mp4 --output result.json\n```\n\nFile v1.0.11:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-depression-behavioral-markers-analysis\",\n  \"version\": \"1.0.11\",\n  \"publishedAt\": 1787253627956\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_DEPRESSION_BEHAVIORAL_MARKERS_ANALYSIS` - 抑郁症辅助行为标记（长时间不动、食欲改变）\n\n## 输入约束\n\n- 摄像头：**必须覆盖卧室区域（含床位）和餐厅区域（含餐桌）双视角**；可由两个摄像头分别覆盖\n- 视频时长：**单次分析必须 ≥ 24 小时连续记录**（建议 24-72 小时滑动窗口），否则无法可靠统计每日总量\n- 帧率 ≥ 1 FPS 即可（长时序统计无需高帧率）；分辨率 ≥ 480p；夜间需配合红外或低照度增强\n- ROI 标定：床位 ROI（bed_region）+ 餐桌 ROI（dining_region）\n- 必须有 **7-14 天历史基线数据**（个人均值与标准差），否则首次只输出\"基线累积中\"状态\n- 隐私敏感场景必须启用人体轮廓 + 面部马赛克模式\n\n## 关键观测信号\n\n### 卧床指标\n- `lying_in_bed_duration_daily_min` - 当日卧床总时长（分钟）\n- `out_of_bed_event_count_daily` - 当日离床事件次数\n- `room_movement_minutes_daily` - 卧室外活动总时长（参考指标）\n\n### 进食指标\n- `eating_action_count_daily` - 当日进食动作次数（手部抓握餐具送入口中）\n- `eating_total_duration_min_daily` - 当日进食总时长\n- `meal_event_count_daily` - 当日完整餐次数（每餐 ≥ 1 分钟连续进食视为 1 餐）\n- `food_remained_ratio_estimate` - 餐后剩余食物比例估计（参考指标）\n\n### 基线对比\n- `baseline_window_days` - 基线窗口（默认 7-14 天）\n- `lying_delta_vs_baseline_min` - 当日卧床时长相对基线均值的偏差\n- `eating_action_ratio_vs_baseline` - 当日进食动作次数相对基线的比例（0-1+）\n- `consecutive_abnormal_days` - 连续异常天数\n\n## 阈值与异常判定\n\n- **卧床异常**：`lying_in_bed_duration_daily_min > 1200` (20 小时) 或相对基线 +6 小时及以上\n- **进食异常**：`eating_action_ratio_vs_baseline < 0.5`（动作次数低于基线 50%）或 `meal_event_count_daily < 1`（24 小时内无完整餐次）\n- **触发提醒**：上述异常**连续 ≥ 3 天**（默认）即输出\"行为变化报告\"\n- **基线累积期**：前 7 天仅记录不报警\n\n## 输出字段（参考）\n\n- `subject_detected` / `baseline_ready`\n- `daily_lying` / `daily_eating` - 当日两类指标\n- `baseline_comparison` - 与基线对比\n- `consecutive_abnormal_days`\n- `abnormal_pattern` - 行为异常模式（hypersomnia_immobility / appetite_loss / both / none）\n- `risk_signal_level` - 风险信号等级（none / mild_signal / notable_signal / strong_signal）\n- `alert_type` - 提醒类型（behavioral_change_3day / behavioral_change_7day / improving / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `alert_message` - 推送给家属/社区医生的友好文本（如\"妈妈最近 3 天每天卧床 ≥ 21 小时、进食动作较平时少了 60%，建议尽快电话关心或安排居家探视\"）\n- `recommend_action` - 建议动作（push_family_notice / suggest_visit / suggest_consult_doctor / observe_only）\n- `helpline_reference` - 当 strong_signal 时附**北京心理危机研究与干预中心 010-82951332 / 全国心理援助热线 400-161-9995**等参考资源\n\n## 强制约束与红线\n\n- ❌ **禁止**输出抑郁症诊断、抑郁量表评分（如 GDS-15、PHQ-9）、用药建议或处方\n- ❌ **禁止**长期存储原始视频；仅保存匿名化的指标统计与时间戳\n- ❌ **禁止**将\"行为变化\"等同于\"确诊抑郁症\"\n- ✅ 出现 strong_signal 时附**心理援助热线**与就近社区精神卫生服务参考\n- ✅ 建议由家属 / 社区医生 / 精神科医生联合解读，并配合患者本人自愿性谈话\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: dev\n\nFile v1.0.11:skill-card.md\n\n## Description:\n\nAnalyzes fixed home-camera video for long immobility and appetite-change behavior markers, then produces a structured behavioral-change report for caregiver or community-care review.\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 community care staff use this skill to review multi-day home video for extended lying-in-bed duration, reduced eating activity, and related behavioral-change alerts. The skill is framed as a behavioral-observation aid and not as a medical diagnostic tool.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Sensitive home-camera video and mental-health context may be sent to remote services.\n\nMitigation: Use only with informed consent from the recorded person, confirm where the remote API sends data, and avoid private or signed video URLs unless sharing them is intended.\n\nRisk: Persistent identity records and server-side reports may retain sensitive household or health information.\n\nMitigation: Review account linkage, retention, deletion, and report-access controls before deployment.\n\nRisk: Behavioral-change outputs may be mistaken for depression diagnosis or treatment advice.\n\nMitigation: Present results only as behavioral observations, avoid diagnostic labels or medication advice, and route concerning results to family, community doctors, or qualified clinicians.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/18072937735/skills/smyx-depression-behavioral-markers-analysis)\n- [API interface documentation](references/api_doc.md)\n- [Shared analysis API documentation](skills/smyx_analysis/references/api_doc.md)\n- [Skill usage demo](https://lifeemergence.com/sample.html)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown guidance with Python CLI commands and JSON-style structured report output]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Reports may include behavior metrics, alert labels, recommendations, and report export links returned by the remote analysis service.]\n\n## Skill Version(s):\n\n1.0.11 (source: server release metadata; SKILL.md frontmatter reports 1.0.10)\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, 42970 bytes\n\nFiles: references/api_doc.md (4659b), scripts/__init__.py (79b), scripts/config.py (721b), scripts/config.yaml (3b), scripts/skill.py (610b), scripts/smyx_depression_behavioral_markers_analysis.py (3744b), skill-card.md (2629b), SKILL.md (14273b), 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 (163b)\n\nFile v1.0.10:SKILL.md\n\n---\nname: \"smyx-depression-behavioral-markers-analysis\"\ndescription: \"Using fixed home cameras (bedroom and dining area), the system analyzes the multi-day behavior pattern of elderly people or solo-living individuals, detecting daily lying-in-bed duration (continuous lying > 20 hours per day) and a sharp drop in eating frequency / duration (e.g., daily eating-action count below 50% of personal baseline). | 通过家庭固定摄像头（卧室和餐厅区域），分析老年人或独居者连续多日的行为模式，检测卧床时长（连续卧床超过20小时/天）以及进食频次/时长骤减（如每日进食动作次数低于历史基线的50%）。当这些行为变化持续超过设定天数（如3天）时，输出行为变化报告，提醒家属或社区医生关注可能存在的抑郁倾向或其他健康问题。\"\nversion: \"1.0.9\"\nlicense: \"MIT-0\"\n---\n\n# 🌧️ Depression Behavioral Markers (Long Immobility & Appetite Change) | 抑郁症辅助行为标记（长时间不动、食欲改变）\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **抑郁症辅助行为标记（长时间不动、食欲改变）** |\n| 🎯 核心目标 | 通过家庭固定摄像头（卧室和餐厅区域），分析老年人或独居者连续多日的行为模式，检测卧床时长（连续卧床超过20小时/天）以及进食频次/时长骤减（如每日进食动作次数低于历史基线的50%）。当这些行为变化持续超过设定天数（如3天）时，输出行为变化报告，提醒家属或社区医生关注可能存在的抑郁倾向或其他健康问题。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_DEPRESSION_BEHAVIORAL_MARKERS_ANALYSIS` |\n\nUsing fixed home cameras (bedroom and dining area), the system analyzes the multi-day behavior pattern of elderly people or solo-living individuals, detecting daily lying-in-bed duration (continuous lying > 20 hours per day) and a sharp drop in eating frequency / duration (e.g., daily eating-action count below 50% of personal baseline). When these behavioral changes persist beyond a configured threshold (e.g., 3 days), the system outputs a behavioral-change report to remind family members or community doctors about possible depressive tendency or other health issues. This skill is ONLY a behavioral-observation aid and is NOT a medical diagnostic tool. Application scenarios: solo-living elderly homes, remote mental-health monitoring, community elderly care. The system generates a daily behavior summary and pushes alerts when an abnormal pattern is detected. Skill features: depression in the elderly often presents as decreased activity, reduced appetite, and increased bed time. AI auto-monitoring of these behavior changes can issue early signals before family or doctors notice, supporting timely intervention, reducing suicide risk, and improving quality of life. Can be integrated into home-care cameras or health-management platforms as a practical mental-health monitoring tool.\n\n通过家庭固定摄像头（卧室和餐厅区域），分析老年人或独居者连续多日的行为模式，检测卧床时长（连续卧床超过20小时/天）以及进食频次/时长骤减（如每日进食动作次数低于历史基线的50%）。当这些行为变化持续超过设定天数（如3天）时，输出行为变化报告，提醒家属或社区医生关注可能存在的抑郁倾向或其他健康问题。该技能仅为行为观察辅助工具，不作为医学诊断依据。应用场景：独居老人家庭、精神健康远程监测、社区养老。系统每日生成行为摘要，当检测到异常行为模式时推送提醒。技能特点：老年人抑郁症常表现为活动减少、食欲下降、卧床时间增多。通过AI自动监测这些行为变化，可在家属或医生尚未察觉时发出早期信号，有助于及时干预，降低自杀风险，改善生活质量。该技能可集成到居家养老摄像头或健康管理平台中，成为精神健康监测的实用工具。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人行为健康监测 AI。你的任务是分析家庭固定摄像头（卧室和餐厅区域）的连续视频（至少 24 小时），检测卧床时长（统计一天内卧床总时长）以及进食行为（识别手部抓握餐具送入口中的动作次数和时长）。对比历史基线（过去 7-14 天的个人平均数据），当卧床时长超过 20 小时/天或进食动作次数/时长低于基线的 50% 时，输出行为变化报告。不要提供医疗诊断，仅输出基于视觉的行为统计和变化提示。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于家庭卧室 + 餐厅双区域固定摄像头连续 ≥ 24 小时视频，统计每日卧床总时长 + 离床事件次数 + 进食动作次数 + 进食总时长 + 完整餐次数 → 与个人 7-14 天基线对比 → 连续异常 ≥ 3 天 → 输出行为变化报告 + 家属/社区医生友好提醒\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人体检测 + 床位 ROI 卧位识别（lying_in_bed_duration_daily_min） |\n| 2 | 离床事件计数 |\n| 3 | 手部抓握餐具送入口动作识别（eating_action_count_daily） |\n| 4 | 餐次数与进食总时长统计 |\n| 5 | 餐后剩余食物比例估计（参考） |\n| 6 | 个人 7-14 天基线均值/标准差计算 |\n| 7 | 连续异常天数累计 |\n| 8 | 行为异常模式分类（hypersomnia_immobility / appetite_loss / both / none） |\n| 9 | 风险信号等级判定（none → strong_signal） |\n| 10 | 家属/社区医生友好提醒文本生成 |\n| 11 | 心理援助热线参考 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供家庭卧室 + 餐厅区域固定摄像头连续 ≥ 24 小时视频 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_depression_behavioral_markers_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_depression_behavioral_markers_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_depression_behavioral_markers_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地家庭固定摄像头（卧室+餐厅区域，≥24h）视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络家庭固定摄像头（卧室+餐厅区域，≥24h）视频 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_depression_behavioral_markers_analysis.py`](scripts/smyx_depression_behavioral_markers_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 视频；**关键约束**：单次分析必须 ≥ 24 小时连续记录，且必须同时覆盖卧室与餐厅 |\n| 🔎 使用提醒 | 单日感冒、发烧、近期手术康复期、外出旅行等情形会显著影响卧床与进食指标，建议在配置中标记\"非常态期\"以暂停告警 |\n| 🔎 使用提醒 | 老人在外用餐（如子女家、社区食堂）会导致 eating_action_count_daily 显著低估，需结合家庭日程综合判定 |\n| 🧑‍⚖️ 结果性质 | 红线约束：**禁止**输出抑郁症诊断、量表评分（GDS-15 / PHQ-9）、用药建议或处方；**禁止**长期存储原始视频；**禁止**将\"行为变化\"等同于\"确诊抑郁症\" |\n| 🔎 使用提醒 | 当出现 `strong_signal` 或老人有任何自伤/自杀言语或行为时，**必须**在提醒中附**心理援助热线 010-82951332 / 400-161-9995**并强烈建议家属立即介入 |\n| 🔏 隐私合规 | 隐私合规：卧室视频涉及高度敏感个人隐私，使用前需取得老人本人明确知情同意，妥善加密保管；建议优先采用人体轮廓 + 面部马赛克模式 + 仅保存指标统计 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地连续 24h+ 卧室+餐厅视频\npython -m scripts.smyx_depression_behavioral_markers_analysis --input /path/to/24h_home.mp4\n\n# 分析网络连续 24h+ 卧室+餐厅视频\npython -m scripts.smyx_depression_behavioral_markers_analysis --url https://example.com/24h_home.mp4\n\n# 显示历史抑郁症辅助行为标记报告（自动触发关键词：查看抑郁行为标记历史报告、行为变化报告清单等）\npython -m scripts.smyx_depression_behavioral_markers_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_depression_behavioral_markers_analysis --input 24h.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_depression_behavioral_markers_analysis --input 24h.mp4 --output result.json\n```\n\nFile v1.0.10:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-depression-behavioral-markers-analysis\",\n  \"version\": \"1.0.10\",\n  \"publishedAt\": 1786352133673\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_DEPRESSION_BEHAVIORAL_MARKERS_ANALYSIS` - 抑郁症辅助行为标记（长时间不动、食欲改变）\n\n## 输入约束\n\n- 摄像头：**必须覆盖卧室区域（含床位）和餐厅区域（含餐桌）双视角**；可由两个摄像头分别覆盖\n- 视频时长：**单次分析必须 ≥ 24 小时连续记录**（建议 24-72 小时滑动窗口），否则无法可靠统计每日总量\n- 帧率 ≥ 1 FPS 即可（长时序统计无需高帧率）；分辨率 ≥ 480p；夜间需配合红外或低照度增强\n- ROI 标定：床位 ROI（bed_region）+ 餐桌 ROI（dining_region）\n- 必须有 **7-14 天历史基线数据**（个人均值与标准差），否则首次只输出\"基线累积中\"状态\n- 隐私敏感场景必须启用人体轮廓 + 面部马赛克模式\n\n## 关键观测信号\n\n### 卧床指标\n- `lying_in_bed_duration_daily_min` - 当日卧床总时长（分钟）\n- `out_of_bed_event_count_daily` - 当日离床事件次数\n- `room_movement_minutes_daily` - 卧室外活动总时长（参考指标）\n\n### 进食指标\n- `eating_action_count_daily` - 当日进食动作次数（手部抓握餐具送入口中）\n- `eating_total_duration_min_daily` - 当日进食总时长\n- `meal_event_count_daily` - 当日完整餐次数（每餐 ≥ 1 分钟连续进食视为 1 餐）\n- `food_remained_ratio_estimate` - 餐后剩余食物比例估计（参考指标）\n\n### 基线对比\n- `baseline_window_days` - 基线窗口（默认 7-14 天）\n- `lying_delta_vs_baseline_min` - 当日卧床时长相对基线均值的偏差\n- `eating_action_ratio_vs_baseline` - 当日进食动作次数相对基线的比例（0-1+）\n- `consecutive_abnormal_days` - 连续异常天数\n\n## 阈值与异常判定\n\n- **卧床异常**：`lying_in_bed_duration_daily_min > 1200` (20 小时) 或相对基线 +6 小时及以上\n- **进食异常**：`eating_action_ratio_vs_baseline < 0.5`（动作次数低于基线 50%）或 `meal_event_count_daily < 1`（24 小时内无完整餐次）\n- **触发提醒**：上述异常**连续 ≥ 3 天**（默认）即输出\"行为变化报告\"\n- **基线累积期**：前 7 天仅记录不报警\n\n## 输出字段（参考）\n\n- `subject_detected` / `baseline_ready`\n- `daily_lying` / `daily_eating` - 当日两类指标\n- `baseline_comparison` - 与基线对比\n- `consecutive_abnormal_days`\n- `abnormal_pattern` - 行为异常模式（hypersomnia_immobility / appetite_loss / both / none）\n- `risk_signal_level` - 风险信号等级（none / mild_signal / notable_signal / strong_signal）\n- `alert_type` - 提醒类型（behavioral_change_3day / behavioral_change_7day / improving / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `alert_message` - 推送给家属/社区医生的友好文本（如\"妈妈最近 3 天每天卧床 ≥ 21 小时、进食动作较平时少了 60%，建议尽快电话关心或安排居家探视\"）\n- `recommend_action` - 建议动作（push_family_notice / suggest_visit / suggest_consult_doctor / observe_only）\n- `helpline_reference` - 当 strong_signal 时附**北京心理危机研究与干预中心 010-82951332 / 全国心理援助热线 400-161-9995**等参考资源\n\n## 强制约束与红线\n\n- ❌ **禁止**输出抑郁症诊断、抑郁量表评分（如 GDS-15、PHQ-9）、用药建议或处方\n- ❌ **禁止**长期存储原始视频；仅保存匿名化的指标统计与时间戳\n- ❌ **禁止**将\"行为变化\"等同于\"确诊抑郁症\"\n- ✅ 出现 strong_signal 时附**心理援助热线**与就近社区精神卫生服务参考\n- ✅ 建议由家属 / 社区医生 / 精神科医生联合解读，并配合患者本人自愿性谈话\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: prod\n\nFile v1.0.10:skill-card.md\n\n## Description:\n\nAnalyzes long-running fixed-camera video from bedroom and dining areas to produce non-diagnostic behavior-change reports about extended bed time and reduced eating activity for elder-care or solo-living monitoring.\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, community doctors, and health-management operators use this skill to submit consented fixed-camera videos or URLs and receive structured behavior summaries that flag prolonged immobility and appetite-related changes without diagnosing depression.\n\n### Deployment Geography for Use:\n\nGlobal, subject to local health, privacy, and consent requirements.\n\n## Known Risks and Mitigations:\n\nRisk: The skill handles highly sensitive home-video and health-adjacent data.\n\nMitigation: Use only with explicit consent from the monitored person, apply local privacy controls, and confirm that the service and retention policy are acceptable before installation.\n\nRisk: Analysis and report history may involve remote uploads, automatic identity creation, persistent tokens, and cloud retrieval.\n\nMitigation: Use controlled environments with clear identity separation and token storage, and avoid shared machines or multi-user workspaces unless those controls are in place.\n\nRisk: Behavioral signals could be mistaken for a medical diagnosis or treatment recommendation.\n\nMitigation: Present results as behavior observations only and route clinical interpretation, urgent self-harm concerns, or treatment decisions to qualified professionals or emergency support.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/18072937735/skills/smyx-depression-behavioral-markers-analysis)\n- [API interface documentation](references/api_doc.md)\n- [Skill demo](https://lifeemergence.com/sample.html)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Markdown, JSON]\n\n**Output Format:** [Structured behavior report text or JSON; history queries may be rendered as Markdown tables with report links.]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May write the returned report to a user-specified output file.]\n\n## Skill Version(s):\n\n1.0.10 (source: server release metadata; artifact SKILL.md frontmatter lists 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.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, 42949 bytes\n\nFiles: references/api_doc.md (4659b), scripts/__init__.py (79b), scripts/config.py (721b), scripts/config.yaml (3b), scripts/skill.py (610b), scripts/smyx_depression_behavioral_markers_analysis.py (3744b), skill-card.md (2692b), SKILL.md (14273b), 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 (162b)\n\nFile v1.0.9:SKILL.md\n\n---\nname: \"smyx-depression-behavioral-markers-analysis\"\ndescription: \"Using fixed home cameras (bedroom and dining area), the system analyzes the multi-day behavior pattern of elderly people or solo-living individuals, detecting daily lying-in-bed duration (continuous lying > 20 hours per day) and a sharp drop in eating frequency / duration (e.g., daily eating-action count below 50% of personal baseline). | 通过家庭固定摄像头（卧室和餐厅区域），分析老年人或独居者连续多日的行为模式，检测卧床时长（连续卧床超过20小时/天）以及进食频次/时长骤减（如每日进食动作次数低于历史基线的50%）。当这些行为变化持续超过设定天数（如3天）时，输出行为变化报告，提醒家属或社区医生关注可能存在的抑郁倾向或其他健康问题。\"\nversion: \"1.0.9\"\nlicense: \"MIT-0\"\n---\n\n# 🌧️ Depression Behavioral Markers (Long Immobility & Appetite Change) | 抑郁症辅助行为标记（长时间不动、食欲改变）\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **抑郁症辅助行为标记（长时间不动、食欲改变）** |\n| 🎯 核心目标 | 通过家庭固定摄像头（卧室和餐厅区域），分析老年人或独居者连续多日的行为模式，检测卧床时长（连续卧床超过20小时/天）以及进食频次/时长骤减（如每日进食动作次数低于历史基线的50%）。当这些行为变化持续超过设定天数（如3天）时，输出行为变化报告，提醒家属或社区医生关注可能存在的抑郁倾向或其他健康问题。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_DEPRESSION_BEHAVIORAL_MARKERS_ANALYSIS` |\n\nUsing fixed home cameras (bedroom and dining area), the system analyzes the multi-day behavior pattern of elderly people or solo-living individuals, detecting daily lying-in-bed duration (continuous lying > 20 hours per day) and a sharp drop in eating frequency / duration (e.g., daily eating-action count below 50% of personal baseline). When these behavioral changes persist beyond a configured threshold (e.g., 3 days), the system outputs a behavioral-change report to remind family members or community doctors about possible depressive tendency or other health issues. This skill is ONLY a behavioral-observation aid and is NOT a medical diagnostic tool. Application scenarios: solo-living elderly homes, remote mental-health monitoring, community elderly care. The system generates a daily behavior summary and pushes alerts when an abnormal pattern is detected. Skill features: depression in the elderly often presents as decreased activity, reduced appetite, and increased bed time. AI auto-monitoring of these behavior changes can issue early signals before family or doctors notice, supporting timely intervention, reducing suicide risk, and improving quality of life. Can be integrated into home-care cameras or health-management platforms as a practical mental-health monitoring tool.\n\n通过家庭固定摄像头（卧室和餐厅区域），分析老年人或独居者连续多日的行为模式，检测卧床时长（连续卧床超过20小时/天）以及进食频次/时长骤减（如每日进食动作次数低于历史基线的50%）。当这些行为变化持续超过设定天数（如3天）时，输出行为变化报告，提醒家属或社区医生关注可能存在的抑郁倾向或其他健康问题。该技能仅为行为观察辅助工具，不作为医学诊断依据。应用场景：独居老人家庭、精神健康远程监测、社区养老。系统每日生成行为摘要，当检测到异常行为模式时推送提醒。技能特点：老年人抑郁症常表现为活动减少、食欲下降、卧床时间增多。通过AI自动监测这些行为变化，可在家属或医生尚未察觉时发出早期信号，有助于及时干预，降低自杀风险，改善生活质量。该技能可集成到居家养老摄像头或健康管理平台中，成为精神健康监测的实用工具。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人行为健康监测 AI。你的任务是分析家庭固定摄像头（卧室和餐厅区域）的连续视频（至少 24 小时），检测卧床时长（统计一天内卧床总时长）以及进食行为（识别手部抓握餐具送入口中的动作次数和时长）。对比历史基线（过去 7-14 天的个人平均数据），当卧床时长超过 20 小时/天或进食动作次数/时长低于基线的 50% 时，输出行为变化报告。不要提供医疗诊断，仅输出基于视觉的行为统计和变化提示。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于家庭卧室 + 餐厅双区域固定摄像头连续 ≥ 24 小时视频，统计每日卧床总时长 + 离床事件次数 + 进食动作次数 + 进食总时长 + 完整餐次数 → 与个人 7-14 天基线对比 → 连续异常 ≥ 3 天 → 输出行为变化报告 + 家属/社区医生友好提醒\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人体检测 + 床位 ROI 卧位识别（lying_in_bed_duration_daily_min） |\n| 2 | 离床事件计数 |\n| 3 | 手部抓握餐具送入口动作识别（eating_action_count_daily） |\n| 4 | 餐次数与进食总时长统计 |\n| 5 | 餐后剩余食物比例估计（参考） |\n| 6 | 个人 7-14 天基线均值/标准差计算 |\n| 7 | 连续异常天数累计 |\n| 8 | 行为异常模式分类（hypersomnia_immobility / appetite_loss / both / none） |\n| 9 | 风险信号等级判定（none → strong_signal） |\n| 10 | 家属/社区医生友好提醒文本生成 |\n| 11 | 心理援助热线参考 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供家庭卧室 + 餐厅区域固定摄像头连续 ≥ 24 小时视频 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_depression_behavioral_markers_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_depression_behavioral_markers_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_depression_behavioral_markers_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地家庭固定摄像头（卧室+餐厅区域，≥24h）视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络家庭固定摄像头（卧室+餐厅区域，≥24h）视频 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_depression_behavioral_markers_analysis.py`](scripts/smyx_depression_behavioral_markers_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 视频；**关键约束**：单次分析必须 ≥ 24 小时连续记录，且必须同时覆盖卧室与餐厅 |\n| 🔎 使用提醒 | 单日感冒、发烧、近期手术康复期、外出旅行等情形会显著影响卧床与进食指标，建议在配置中标记\"非常态期\"以暂停告警 |\n| 🔎 使用提醒 | 老人在外用餐（如子女家、社区食堂）会导致 eating_action_count_daily 显著低估，需结合家庭日程综合判定 |\n| 🧑‍⚖️ 结果性质 | 红线约束：**禁止**输出抑郁症诊断、量表评分（GDS-15 / PHQ-9）、用药建议或处方；**禁止**长期存储原始视频；**禁止**将\"行为变化\"等同于\"确诊抑郁症\" |\n| 🔎 使用提醒 | 当出现 `strong_signal` 或老人有任何自伤/自杀言语或行为时，**必须**在提醒中附**心理援助热线 010-82951332 / 400-161-9995**并强烈建议家属立即介入 |\n| 🔏 隐私合规 | 隐私合规：卧室视频涉及高度敏感个人隐私，使用前需取得老人本人明确知情同意，妥善加密保管；建议优先采用人体轮廓 + 面部马赛克模式 + 仅保存指标统计 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地连续 24h+ 卧室+餐厅视频\npython -m scripts.smyx_depression_behavioral_markers_analysis --input /path/to/24h_home.mp4\n\n# 分析网络连续 24h+ 卧室+餐厅视频\npython -m scripts.smyx_depression_behavioral_markers_analysis --url https://example.com/24h_home.mp4\n\n# 显示历史抑郁症辅助行为标记报告（自动触发关键词：查看抑郁行为标记历史报告、行为变化报告清单等）\npython -m scripts.smyx_depression_behavioral_markers_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_depression_behavioral_markers_analysis --input 24h.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_depression_behavioral_markers_analysis --input 24h.mp4 --output result.json\n```\n\nFile v1.0.9:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-depression-behavioral-markers-analysis\",\n  \"version\": \"1.0.9\",\n  \"publishedAt\": 1785878431088\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_DEPRESSION_BEHAVIORAL_MARKERS_ANALYSIS` - 抑郁症辅助行为标记（长时间不动、食欲改变）\n\n## 输入约束\n\n- 摄像头：**必须覆盖卧室区域（含床位）和餐厅区域（含餐桌）双视角**；可由两个摄像头分别覆盖\n- 视频时长：**单次分析必须 ≥ 24 小时连续记录**（建议 24-72 小时滑动窗口），否则无法可靠统计每日总量\n- 帧率 ≥ 1 FPS 即可（长时序统计无需高帧率）；分辨率 ≥ 480p；夜间需配合红外或低照度增强\n- ROI 标定：床位 ROI（bed_region）+ 餐桌 ROI（dining_region）\n- 必须有 **7-14 天历史基线数据**（个人均值与标准差），否则首次只输出\"基线累积中\"状态\n- 隐私敏感场景必须启用人体轮廓 + 面部马赛克模式\n\n## 关键观测信号\n\n### 卧床指标\n- `lying_in_bed_duration_daily_min` - 当日卧床总时长（分钟）\n- `out_of_bed_event_count_daily` - 当日离床事件次数\n- `room_movement_minutes_daily` - 卧室外活动总时长（参考指标）\n\n### 进食指标\n- `eating_action_count_daily` - 当日进食动作次数（手部抓握餐具送入口中）\n- `eating_total_duration_min_daily` - 当日进食总时长\n- `meal_event_count_daily` - 当日完整餐次数（每餐 ≥ 1 分钟连续进食视为 1 餐）\n- `food_remained_ratio_estimate` - 餐后剩余食物比例估计（参考指标）\n\n### 基线对比\n- `baseline_window_days` - 基线窗口（默认 7-14 天）\n- `lying_delta_vs_baseline_min` - 当日卧床时长相对基线均值的偏差\n- `eating_action_ratio_vs_baseline` - 当日进食动作次数相对基线的比例（0-1+）\n- `consecutive_abnormal_days` - 连续异常天数\n\n## 阈值与异常判定\n\n- **卧床异常**：`lying_in_bed_duration_daily_min > 1200` (20 小时) 或相对基线 +6 小时及以上\n- **进食异常**：`eating_action_ratio_vs_baseline < 0.5`（动作次数低于基线 50%）或 `meal_event_count_daily < 1`（24 小时内无完整餐次）\n- **触发提醒**：上述异常**连续 ≥ 3 天**（默认）即输出\"行为变化报告\"\n- **基线累积期**：前 7 天仅记录不报警\n\n## 输出字段（参考）\n\n- `subject_detected` / `baseline_ready`\n- `daily_lying` / `daily_eating` - 当日两类指标\n- `baseline_comparison` - 与基线对比\n- `consecutive_abnormal_days`\n- `abnormal_pattern` - 行为异常模式（hypersomnia_immobility / appetite_loss / both / none）\n- `risk_signal_level` - 风险信号等级（none / mild_signal / notable_signal / strong_signal）\n- `alert_type` - 提醒类型（behavioral_change_3day / behavioral_change_7day / improving / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `alert_message` - 推送给家属/社区医生的友好文本（如\"妈妈最近 3 天每天卧床 ≥ 21 小时、进食动作较平时少了 60%，建议尽快电话关心或安排居家探视\"）\n- `recommend_action` - 建议动作（push_family_notice / suggest_visit / suggest_consult_doctor / observe_only）\n- `helpline_reference` - 当 strong_signal 时附**北京心理危机研究与干预中心 010-82951332 / 全国心理援助热线 400-161-9995**等参考资源\n\n## 强制约束与红线\n\n- ❌ **禁止**输出抑郁症诊断、抑郁量表评分（如 GDS-15、PHQ-9）、用药建议或处方\n- ❌ **禁止**长期存储原始视频；仅保存匿名化的指标统计与时间戳\n- ❌ **禁止**将\"行为变化\"等同于\"确诊抑郁症\"\n- ✅ 出现 strong_signal 时附**心理援助热线**与就近社区精神卫生服务参考\n- ✅ 建议由家属 / 社区医生 / 精神科医生联合解读，并配合患者本人自愿性谈话\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: prod\n\nFile v1.0.9:skill-card.md\n\n## Description:\n\nAnalyzes multi-day fixed home-camera video from bedroom and dining areas to report long immobility, appetite-related eating changes, and behavior-change alerts for elder-care monitoring without making a medical diagnosis.\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 users, care teams, and developers can use this skill to summarize long-duration home-camera observations for elderly or solo-living individuals. It supports behavior-change monitoring and family or community-care alerts, while leaving diagnosis and treatment decisions to qualified clinicians.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill can process sensitive home surveillance media or media URLs through lifeemergence.com cloud services.\n\nMitigation: Use only with explicit informed consent, confirm that the cloud provider and retention model are acceptable, and avoid submitting media outside the intended elder-care monitoring context.\n\nRisk: The skill can create or reuse an internal account identity and store access tokens in the local workspace.\n\nMitigation: Install only in workspaces where local account and token storage is acceptable, and review workspace access controls before use.\n\nRisk: Behavioral markers may be mistaken for a medical diagnosis.\n\nMitigation: Present outputs as behavioral observations and care prompts only; route diagnosis, treatment, medication, and crisis decisions to qualified clinicians or emergency resources.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/18072937735/skills/smyx-depression-behavioral-markers-analysis)\n- [Skill demo](https://lifeemergence.com/sample.html)\n- [API reference](references/api_doc.md)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown and JSON-style structured analysis reports, including behavior metrics, alert text, suggested actions, and report links when available.]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [History report queries return cloud-sourced report lists; analysis outputs depend on 24-hour or longer bedroom and dining-area video coverage and baseline availability.]\n\n## Skill Version(s):\n\n1.0.9 (source: server release metadata and frontmatter)\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, 42929 bytes\n\nFiles: references/api_doc.md (4659b), scripts/__init__.py (79b), scripts/config.py (721b), scripts/config.yaml (3b), scripts/skill.py (610b), scripts/smyx_depression_behavioral_markers_analysis.py (3744b), skill-card.md (2688b), SKILL.md (14273b), 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 (162b)\n\nFile v1.0.8:SKILL.md\n\n---\nname: \"smyx-depression-behavioral-markers-analysis\"\ndescription: \"Using fixed home cameras (bedroom and dining area), the system analyzes the multi-day behavior pattern of elderly people or solo-living individuals, detecting daily lying-in-bed duration (continuous lying > 20 hours per day) and a sharp drop in eating frequency / duration (e.g., daily eating-action count below 50% of personal baseline). | 通过家庭固定摄像头（卧室和餐厅区域），分析老年人或独居者连续多日的行为模式，检测卧床时长（连续卧床超过20小时/天）以及进食频次/时长骤减（如每日进食动作次数低于历史基线的50%）。当这些行为变化持续超过设定天数（如3天）时，输出行为变化报告，提醒家属或社区医生关注可能存在的抑郁倾向或其他健康问题。\"\nversion: \"1.0.7\"\nlicense: \"MIT-0\"\n---\n\n# 🌧️ Depression Behavioral Markers (Long Immobility & Appetite Change) | 抑郁症辅助行为标记（长时间不动、食欲改变）\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **抑郁症辅助行为标记（长时间不动、食欲改变）** |\n| 🎯 核心目标 | 通过家庭固定摄像头（卧室和餐厅区域），分析老年人或独居者连续多日的行为模式，检测卧床时长（连续卧床超过20小时/天）以及进食频次/时长骤减（如每日进食动作次数低于历史基线的50%）。当这些行为变化持续超过设定天数（如3天）时，输出行为变化报告，提醒家属或社区医生关注可能存在的抑郁倾向或其他健康问题。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_DEPRESSION_BEHAVIORAL_MARKERS_ANALYSIS` |\n\nUsing fixed home cameras (bedroom and dining area), the system analyzes the multi-day behavior pattern of elderly people or solo-living individuals, detecting daily lying-in-bed duration (continuous lying > 20 hours per day) and a sharp drop in eating frequency / duration (e.g., daily eating-action count below 50% of personal baseline). When these behavioral changes persist beyond a configured threshold (e.g., 3 days), the system outputs a behavioral-change report to remind family members or community doctors about possible depressive tendency or other health issues. This skill is ONLY a behavioral-observation aid and is NOT a medical diagnostic tool. Application scenarios: solo-living elderly homes, remote mental-health monitoring, community elderly care. The system generates a daily behavior summary and pushes alerts when an abnormal pattern is detected. Skill features: depression in the elderly often presents as decreased activity, reduced appetite, and increased bed time. AI auto-monitoring of these behavior changes can issue early signals before family or doctors notice, supporting timely intervention, reducing suicide risk, and improving quality of life. Can be integrated into home-care cameras or health-management platforms as a practical mental-health monitoring tool.\n\n通过家庭固定摄像头（卧室和餐厅区域），分析老年人或独居者连续多日的行为模式，检测卧床时长（连续卧床超过20小时/天）以及进食频次/时长骤减（如每日进食动作次数低于历史基线的50%）。当这些行为变化持续超过设定天数（如3天）时，输出行为变化报告，提醒家属或社区医生关注可能存在的抑郁倾向或其他健康问题。该技能仅为行为观察辅助工具，不作为医学诊断依据。应用场景：独居老人家庭、精神健康远程监测、社区养老。系统每日生成行为摘要，当检测到异常行为模式时推送提醒。技能特点：老年人抑郁症常表现为活动减少、食欲下降、卧床时间增多。通过AI自动监测这些行为变化，可在家属或医生尚未察觉时发出早期信号，有助于及时干预，降低自杀风险，改善生活质量。该技能可集成到居家养老摄像头或健康管理平台中，成为精神健康监测的实用工具。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人行为健康监测 AI。你的任务是分析家庭固定摄像头（卧室和餐厅区域）的连续视频（至少 24 小时），检测卧床时长（统计一天内卧床总时长）以及进食行为（识别手部抓握餐具送入口中的动作次数和时长）。对比历史基线（过去 7-14 天的个人平均数据），当卧床时长超过 20 小时/天或进食动作次数/时长低于基线的 50% 时，输出行为变化报告。不要提供医疗诊断，仅输出基于视觉的行为统计和变化提示。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于家庭卧室 + 餐厅双区域固定摄像头连续 ≥ 24 小时视频，统计每日卧床总时长 + 离床事件次数 + 进食动作次数 + 进食总时长 + 完整餐次数 → 与个人 7-14 天基线对比 → 连续异常 ≥ 3 天 → 输出行为变化报告 + 家属/社区医生友好提醒\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人体检测 + 床位 ROI 卧位识别（lying_in_bed_duration_daily_min） |\n| 2 | 离床事件计数 |\n| 3 | 手部抓握餐具送入口动作识别（eating_action_count_daily） |\n| 4 | 餐次数与进食总时长统计 |\n| 5 | 餐后剩余食物比例估计（参考） |\n| 6 | 个人 7-14 天基线均值/标准差计算 |\n| 7 | 连续异常天数累计 |\n| 8 | 行为异常模式分类（hypersomnia_immobility / appetite_loss / both / none） |\n| 9 | 风险信号等级判定（none → strong_signal） |\n| 10 | 家属/社区医生友好提醒文本生成 |\n| 11 | 心理援助热线参考 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供家庭卧室 + 餐厅区域固定摄像头连续 ≥ 24 小时视频 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_depression_behavioral_markers_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_depression_behavioral_markers_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_depression_behavioral_markers_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地家庭固定摄像头（卧室+餐厅区域，≥24h）视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络家庭固定摄像头（卧室+餐厅区域，≥24h）视频 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_depression_behavioral_markers_analysis.py`](scripts/smyx_depression_behavioral_markers_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 视频；**关键约束**：单次分析必须 ≥ 24 小时连续记录，且必须同时覆盖卧室与餐厅 |\n| 🔎 使用提醒 | 单日感冒、发烧、近期手术康复期、外出旅行等情形会显著影响卧床与进食指标，建议在配置中标记\"非常态期\"以暂停告警 |\n| 🔎 使用提醒 | 老人在外用餐（如子女家、社区食堂）会导致 eating_action_count_daily 显著低估，需结合家庭日程综合判定 |\n| 🧑‍⚖️ 结果性质 | 红线约束：**禁止**输出抑郁症诊断、量表评分（GDS-15 / PHQ-9）、用药建议或处方；**禁止**长期存储原始视频；**禁止**将\"行为变化\"等同于\"确诊抑郁症\" |\n| 🔎 使用提醒 | 当出现 `strong_signal` 或老人有任何自伤/自杀言语或行为时，**必须**在提醒中附**心理援助热线 010-82951332 / 400-161-9995**并强烈建议家属立即介入 |\n| 🔏 隐私合规 | 隐私合规：卧室视频涉及高度敏感个人隐私，使用前需取得老人本人明确知情同意，妥善加密保管；建议优先采用人体轮廓 + 面部马赛克模式 + 仅保存指标统计 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地连续 24h+ 卧室+餐厅视频\npython -m scripts.smyx_depression_behavioral_markers_analysis --input /path/to/24h_home.mp4\n\n# 分析网络连续 24h+ 卧室+餐厅视频\npython -m scripts.smyx_depression_behavioral_markers_analysis --url https://example.com/24h_home.mp4\n\n# 显示历史抑郁症辅助行为标记报告（自动触发关键词：查看抑郁行为标记历史报告、行为变化报告清单等）\npython -m scripts.smyx_depression_behavioral_markers_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_depression_behavioral_markers_analysis --input 24h.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_depression_behavioral_markers_analysis --input 24h.mp4 --output result.json\n```\n\nFile v1.0.8:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-depression-behavioral-markers-analysis\",\n  \"version\": \"1.0.8\",\n  \"publishedAt\": 1785358423349\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_DEPRESSION_BEHAVIORAL_MARKERS_ANALYSIS` - 抑郁症辅助行为标记（长时间不动、食欲改变）\n\n## 输入约束\n\n- 摄像头：**必须覆盖卧室区域（含床位）和餐厅区域（含餐桌）双视角**；可由两个摄像头分别覆盖\n- 视频时长：**单次分析必须 ≥ 24 小时连续记录**（建议 24-72 小时滑动窗口），否则无法可靠统计每日总量\n- 帧率 ≥ 1 FPS 即可（长时序统计无需高帧率）；分辨率 ≥ 480p；夜间需配合红外或低照度增强\n- ROI 标定：床位 ROI（bed_region）+ 餐桌 ROI（dining_region）\n- 必须有 **7-14 天历史基线数据**（个人均值与标准差），否则首次只输出\"基线累积中\"状态\n- 隐私敏感场景必须启用人体轮廓 + 面部马赛克模式\n\n## 关键观测信号\n\n### 卧床指标\n- `lying_in_bed_duration_daily_min` - 当日卧床总时长（分钟）\n- `out_of_bed_event_count_daily` - 当日离床事件次数\n- `room_movement_minutes_daily` - 卧室外活动总时长（参考指标）\n\n### 进食指标\n- `eating_action_count_daily` - 当日进食动作次数（手部抓握餐具送入口中）\n- `eating_total_duration_min_daily` - 当日进食总时长\n- `meal_event_count_daily` - 当日完整餐次数（每餐 ≥ 1 分钟连续进食视为 1 餐）\n- `food_remained_ratio_estimate` - 餐后剩余食物比例估计（参考指标）\n\n### 基线对比\n- `baseline_window_days` - 基线窗口（默认 7-14 天）\n- `lying_delta_vs_baseline_min` - 当日卧床时长相对基线均值的偏差\n- `eating_action_ratio_vs_baseline` - 当日进食动作次数相对基线的比例（0-1+）\n- `consecutive_abnormal_days` - 连续异常天数\n\n## 阈值与异常判定\n\n- **卧床异常**：`lying_in_bed_duration_daily_min > 1200` (20 小时) 或相对基线 +6 小时及以上\n- **进食异常**：`eating_action_ratio_vs_baseline < 0.5`（动作次数低于基线 50%）或 `meal_event_count_daily < 1`（24 小时内无完整餐次）\n- **触发提醒**：上述异常**连续 ≥ 3 天**（默认）即输出\"行为变化报告\"\n- **基线累积期**：前 7 天仅记录不报警\n\n## 输出字段（参考）\n\n- `subject_detected` / `baseline_ready`\n- `daily_lying` / `daily_eating` - 当日两类指标\n- `baseline_comparison` - 与基线对比\n- `consecutive_abnormal_days`\n- `abnormal_pattern` - 行为异常模式（hypersomnia_immobility / appetite_loss / both / none）\n- `risk_signal_level` - 风险信号等级（none / mild_signal / notable_signal / strong_signal）\n- `alert_type` - 提醒类型（behavioral_change_3day / behavioral_change_7day / improving / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `alert_message` - 推送给家属/社区医生的友好文本（如\"妈妈最近 3 天每天卧床 ≥ 21 小时、进食动作较平时少了 60%，建议尽快电话关心或安排居家探视\"）\n- `recommend_action` - 建议动作（push_family_notice / suggest_visit / suggest_consult_doctor / observe_only）\n- `helpline_reference` - 当 strong_signal 时附**北京心理危机研究与干预中心 010-82951332 / 全国心理援助热线 400-161-9995**等参考资源\n\n## 强制约束与红线\n\n- ❌ **禁止**输出抑郁症诊断、抑郁量表评分（如 GDS-15、PHQ-9）、用药建议或处方\n- ❌ **禁止**长期存储原始视频；仅保存匿名化的指标统计与时间戳\n- ❌ **禁止**将\"行为变化\"等同于\"确诊抑郁症\"\n- ✅ 出现 strong_signal 时附**心理援助热线**与就近社区精神卫生服务参考\n- ✅ 建议由家属 / 社区医生 / 精神科医生联合解读，并配合患者本人自愿性谈话\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: prod\n\nFile v1.0.8:skill-card.md\n\n## Description: <br>\nAnalyzes authorized long-duration home camera video from bedroom and dining areas to report behavioral markers such as extended immobility, appetite-related activity changes, baseline comparisons, and caregiver-facing alerts without making a medical diagnosis. <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, community elder-care teams, and health-management platform operators can use this skill to analyze authorized 24-hour-or-longer home video for behavior-change reports covering bed time, eating activity, baseline deviation, and recommended follow-up. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Highly sensitive home video and identity-linked report data may be sent to external services. <br>\nMitigation: Use only with explicit consent from the monitored person and only for videos or URLs the user is authorized to submit. <br>\nRisk: Local or backend identities may be created or reused automatically with limited user control. <br>\nMitigation: Review account handling before installation and avoid history or report-export functions unless the active account and data scope are understood. <br>\nRisk: Behavioral changes may be mistaken for a clinical depression diagnosis. <br>\nMitigation: Present outputs as behavioral observations and caregiver prompts, and require qualified medical evaluation for diagnosis or treatment decisions. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/18072937735/skills/smyx-depression-behavioral-markers-analysis) <br>\n- [API interface documentation](references/api_doc.md) <br>\n- [Skill usage demo](https://lifeemergence.com/sample.html) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance] <br>\n**Output Format:** [Markdown or JSON-like structured report text with optional saved output file] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Reports may include behavioral statistics, baseline comparisons, risk signal labels, caregiver guidance, report links, and historical report tables.] <br>\n\n## Skill Version(s): <br>\n1.0.8 (source: server release evidence; artifact frontmatter lists 1.0.7) <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.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, 42972 bytes\n\nFiles: references/api_doc.md (4659b), scripts/__init__.py (79b), scripts/config.py (721b), scripts/config.yaml (3b), scripts/skill.py (610b), scripts/smyx_depression_behavioral_markers_analysis.py (3744b), skill-card.md (2798b), SKILL.md (14273b), 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 (162b)\n\nFile v1.0.7:SKILL.md\n\n---\nname: \"smyx-depression-behavioral-markers-analysis\"\ndescription: \"Using fixed home cameras (bedroom and dining area), the system analyzes the multi-day behavior pattern of elderly people or solo-living individuals, detecting daily lying-in-bed duration (continuous lying > 20 hours per day) and a sharp drop in eating frequency / duration (e.g., daily eating-action count below 50% of personal baseline). | 通过家庭固定摄像头（卧室和餐厅区域），分析老年人或独居者连续多日的行为模式，检测卧床时长（连续卧床超过20小时/天）以及进食频次/时长骤减（如每日进食动作次数低于历史基线的50%）。当这些行为变化持续超过设定天数（如3天）时，输出行为变化报告，提醒家属或社区医生关注可能存在的抑郁倾向或其他健康问题。\"\nversion: \"1.0.6\"\nlicense: \"MIT-0\"\n---\n\n# 🌧️ Depression Behavioral Markers (Long Immobility & Appetite Change) | 抑郁症辅助行为标记（长时间不动、食欲改变）\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **抑郁症辅助行为标记（长时间不动、食欲改变）** |\n| 🎯 核心目标 | 通过家庭固定摄像头（卧室和餐厅区域），分析老年人或独居者连续多日的行为模式，检测卧床时长（连续卧床超过20小时/天）以及进食频次/时长骤减（如每日进食动作次数低于历史基线的50%）。当这些行为变化持续超过设定天数（如3天）时，输出行为变化报告，提醒家属或社区医生关注可能存在的抑郁倾向或其他健康问题。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_DEPRESSION_BEHAVIORAL_MARKERS_ANALYSIS` |\n\nUsing fixed home cameras (bedroom and dining area), the system analyzes the multi-day behavior pattern of elderly people or solo-living individuals, detecting daily lying-in-bed duration (continuous lying > 20 hours per day) and a sharp drop in eating frequency / duration (e.g., daily eating-action count below 50% of personal baseline). When these behavioral changes persist beyond a configured threshold (e.g., 3 days), the system outputs a behavioral-change report to remind family members or community doctors about possible depressive tendency or other health issues. This skill is ONLY a behavioral-observation aid and is NOT a medical diagnostic tool. Application scenarios: solo-living elderly homes, remote mental-health monitoring, community elderly care. The system generates a daily behavior summary and pushes alerts when an abnormal pattern is detected. Skill features: depression in the elderly often presents as decreased activity, reduced appetite, and increased bed time. AI auto-monitoring of these behavior changes can issue early signals before family or doctors notice, supporting timely intervention, reducing suicide risk, and improving quality of life. Can be integrated into home-care cameras or health-management platforms as a practical mental-health monitoring tool.\n\n通过家庭固定摄像头（卧室和餐厅区域），分析老年人或独居者连续多日的行为模式，检测卧床时长（连续卧床超过20小时/天）以及进食频次/时长骤减（如每日进食动作次数低于历史基线的50%）。当这些行为变化持续超过设定天数（如3天）时，输出行为变化报告，提醒家属或社区医生关注可能存在的抑郁倾向或其他健康问题。该技能仅为行为观察辅助工具，不作为医学诊断依据。应用场景：独居老人家庭、精神健康远程监测、社区养老。系统每日生成行为摘要，当检测到异常行为模式时推送提醒。技能特点：老年人抑郁症常表现为活动减少、食欲下降、卧床时间增多。通过AI自动监测这些行为变化，可在家属或医生尚未察觉时发出早期信号，有助于及时干预，降低自杀风险，改善生活质量。该技能可集成到居家养老摄像头或健康管理平台中，成为精神健康监测的实用工具。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人行为健康监测 AI。你的任务是分析家庭固定摄像头（卧室和餐厅区域）的连续视频（至少 24 小时），检测卧床时长（统计一天内卧床总时长）以及进食行为（识别手部抓握餐具送入口中的动作次数和时长）。对比历史基线（过去 7-14 天的个人平均数据），当卧床时长超过 20 小时/天或进食动作次数/时长低于基线的 50% 时，输出行为变化报告。不要提供医疗诊断，仅输出基于视觉的行为统计和变化提示。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于家庭卧室 + 餐厅双区域固定摄像头连续 ≥ 24 小时视频，统计每日卧床总时长 + 离床事件次数 + 进食动作次数 + 进食总时长 + 完整餐次数 → 与个人 7-14 天基线对比 → 连续异常 ≥ 3 天 → 输出行为变化报告 + 家属/社区医生友好提醒\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人体检测 + 床位 ROI 卧位识别（lying_in_bed_duration_daily_min） |\n| 2 | 离床事件计数 |\n| 3 | 手部抓握餐具送入口动作识别（eating_action_count_daily） |\n| 4 | 餐次数与进食总时长统计 |\n| 5 | 餐后剩余食物比例估计（参考） |\n| 6 | 个人 7-14 天基线均值/标准差计算 |\n| 7 | 连续异常天数累计 |\n| 8 | 行为异常模式分类（hypersomnia_immobility / appetite_loss / both / none） |\n| 9 | 风险信号等级判定（none → strong_signal） |\n| 10 | 家属/社区医生友好提醒文本生成 |\n| 11 | 心理援助热线参考 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供家庭卧室 + 餐厅区域固定摄像头连续 ≥ 24 小时视频 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_depression_behavioral_markers_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_depression_behavioral_markers_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_depression_behavioral_markers_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地家庭固定摄像头（卧室+餐厅区域，≥24h）视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络家庭固定摄像头（卧室+餐厅区域，≥24h）视频 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_depression_behavioral_markers_analysis.py`](scripts/smyx_depression_behavioral_markers_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 视频；**关键约束**：单次分析必须 ≥ 24 小时连续记录，且必须同时覆盖卧室与餐厅 |\n| 🔎 使用提醒 | 单日感冒、发烧、近期手术康复期、外出旅行等情形会显著影响卧床与进食指标，建议在配置中标记\"非常态期\"以暂停告警 |\n| 🔎 使用提醒 | 老人在外用餐（如子女家、社区食堂）会导致 eating_action_count_daily 显著低估，需结合家庭日程综合判定 |\n| 🧑‍⚖️ 结果性质 | 红线约束：**禁止**输出抑郁症诊断、量表评分（GDS-15 / PHQ-9）、用药建议或处方；**禁止**长期存储原始视频；**禁止**将\"行为变化\"等同于\"确诊抑郁症\" |\n| 🔎 使用提醒 | 当出现 `strong_signal` 或老人有任何自伤/自杀言语或行为时，**必须**在提醒中附**心理援助热线 010-82951332 / 400-161-9995**并强烈建议家属立即介入 |\n| 🔏 隐私合规 | 隐私合规：卧室视频涉及高度敏感个人隐私，使用前需取得老人本人明确知情同意，妥善加密保管；建议优先采用人体轮廓 + 面部马赛克模式 + 仅保存指标统计 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地连续 24h+ 卧室+餐厅视频\npython -m scripts.smyx_depression_behavioral_markers_analysis --input /path/to/24h_home.mp4\n\n# 分析网络连续 24h+ 卧室+餐厅视频\npython -m scripts.smyx_depression_behavioral_markers_analysis --url https://example.com/24h_home.mp4\n\n# 显示历史抑郁症辅助行为标记报告（自动触发关键词：查看抑郁行为标记历史报告、行为变化报告清单等）\npython -m scripts.smyx_depression_behavioral_markers_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_depression_behavioral_markers_analysis --input 24h.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_depression_behavioral_markers_analysis --input 24h.mp4 --output result.json\n```\n\nFile v1.0.7:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-depression-behavioral-markers-analysis\",\n  \"version\": \"1.0.7\",\n  \"publishedAt\": 1784456608011\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_DEPRESSION_BEHAVIORAL_MARKERS_ANALYSIS` - 抑郁症辅助行为标记（长时间不动、食欲改变）\n\n## 输入约束\n\n- 摄像头：**必须覆盖卧室区域（含床位）和餐厅区域（含餐桌）双视角**；可由两个摄像头分别覆盖\n- 视频时长：**单次分析必须 ≥ 24 小时连续记录**（建议 24-72 小时滑动窗口），否则无法可靠统计每日总量\n- 帧率 ≥ 1 FPS 即可（长时序统计无需高帧率）；分辨率 ≥ 480p；夜间需配合红外或低照度增强\n- ROI 标定：床位 ROI（bed_region）+ 餐桌 ROI（dining_region）\n- 必须有 **7-14 天历史基线数据**（个人均值与标准差），否则首次只输出\"基线累积中\"状态\n- 隐私敏感场景必须启用人体轮廓 + 面部马赛克模式\n\n## 关键观测信号\n\n### 卧床指标\n- `lying_in_bed_duration_daily_min` - 当日卧床总时长（分钟）\n- `out_of_bed_event_count_daily` - 当日离床事件次数\n- `room_movement_minutes_daily` - 卧室外活动总时长（参考指标）\n\n### 进食指标\n- `eating_action_count_daily` - 当日进食动作次数（手部抓握餐具送入口中）\n- `eating_total_duration_min_daily` - 当日进食总时长\n- `meal_event_count_daily` - 当日完整餐次数（每餐 ≥ 1 分钟连续进食视为 1 餐）\n- `food_remained_ratio_estimate` - 餐后剩余食物比例估计（参考指标）\n\n### 基线对比\n- `baseline_window_days` - 基线窗口（默认 7-14 天）\n- `lying_delta_vs_baseline_min` - 当日卧床时长相对基线均值的偏差\n- `eating_action_ratio_vs_baseline` - 当日进食动作次数相对基线的比例（0-1+）\n- `consecutive_abnormal_days` - 连续异常天数\n\n## 阈值与异常判定\n\n- **卧床异常**：`lying_in_bed_duration_daily_min > 1200` (20 小时) 或相对基线 +6 小时及以上\n- **进食异常**：`eating_action_ratio_vs_baseline < 0.5`（动作次数低于基线 50%）或 `meal_event_count_daily < 1`（24 小时内无完整餐次）\n- **触发提醒**：上述异常**连续 ≥ 3 天**（默认）即输出\"行为变化报告\"\n- **基线累积期**：前 7 天仅记录不报警\n\n## 输出字段（参考）\n\n- `subject_detected` / `baseline_ready`\n- `daily_lying` / `daily_eating` - 当日两类指标\n- `baseline_comparison` - 与基线对比\n- `consecutive_abnormal_days`\n- `abnormal_pattern` - 行为异常模式（hypersomnia_immobility / appetite_loss / both / none）\n- `risk_signal_level` - 风险信号等级（none / mild_signal / notable_signal / strong_signal）\n- `alert_type` - 提醒类型（behavioral_change_3day / behavioral_change_7day / improving / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `alert_message` - 推送给家属/社区医生的友好文本（如\"妈妈最近 3 天每天卧床 ≥ 21 小时、进食动作较平时少了 60%，建议尽快电话关心或安排居家探视\"）\n- `recommend_action` - 建议动作（push_family_notice / suggest_visit / suggest_consult_doctor / observe_only）\n- `helpline_reference` - 当 strong_signal 时附**北京心理危机研究与干预中心 010-82951332 / 全国心理援助热线 400-161-9995**等参考资源\n\n## 强制约束与红线\n\n- ❌ **禁止**输出抑郁症诊断、抑郁量表评分（如 GDS-15、PHQ-9）、用药建议或处方\n- ❌ **禁止**长期存储原始视频；仅保存匿名化的指标统计与时间戳\n- ❌ **禁止**将\"行为变化\"等同于\"确诊抑郁症\"\n- ✅ 出现 strong_signal 时附**心理援助热线**与就近社区精神卫生服务参考\n- ✅ 建议由家属 / 社区医生 / 精神科医生联合解读，并配合患者本人自愿性谈话\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: prod\n\nFile v1.0.7:skill-card.md\n\n## Description: <br>\nAnalyzes long-duration bedroom and dining-area camera video to produce behavior-change reports about prolonged immobility, reduced eating activity, baseline comparison, alert level, and recommended follow-up, without presenting a medical diagnosis. <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>\nDevelopers and care-platform operators use this skill to route consenting home-camera video or URLs to cloud analysis and return structured behavioral observation reports for family members or community doctors. It is intended as monitoring support for older adults or people living alone, not as a clinical diagnosis. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Sensitive home-camera footage and identity-linked monitoring data may be sent to external services and associated with locally stored tokens. <br>\nMitigation: Use only with knowing consent from users and monitored individuals; require clear upload and history-query confirmation, documented retention and deletion controls, and transparent account setup. <br>\nRisk: Behavioral observations about immobility or appetite change may be mistaken for a depression diagnosis or treatment recommendation. <br>\nMitigation: Present outputs as visual behavior statistics and follow-up prompts only; require family, community doctor, or clinician review for medical interpretation. <br>\nRisk: Cloud report-history lookup can expose prior sensitive health-monitoring records. <br>\nMitigation: Restrict history access to the intended account, protect local credentials, and make report-history retrieval an explicit user-visible action. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/18072937735/skills/smyx-depression-behavioral-markers-analysis) <br>\n- [API interface reference](artifact/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, guidance] <br>\n**Output Format:** [Markdown text with structured JSON report content and report links] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May write results to a user-specified output file; history queries return cloud report records.] <br>\n\n## Skill Version(s): <br>\n1.0.7 (source: server release metadata) <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.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, 42802 bytes\n\nFiles: references/api_doc.md (4659b), scripts/__init__.py (79b), scripts/config.py (721b), scripts/config.yaml (3b), scripts/skill.py (610b), scripts/smyx_depression_behavioral_markers_analysis.py (3744b), skill-card.md (3186b), SKILL.md (14273b), 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 (162b)\n\nFile v1.0.6:SKILL.md\n\n---\nname: \"smyx-depression-behavioral-markers-analysis\"\ndescription: \"Using fixed home cameras (bedroom and dining area), the system analyzes the multi-day behavior pattern of elderly people or solo-living individuals, detecting daily lying-in-bed duration (continuous lying > 20 hours per day) and a sharp drop in eating frequency / duration (e.g., daily eating-action count below 50% of personal baseline). | 通过家庭固定摄像头（卧室和餐厅区域），分析老年人或独居者连续多日的行为模式，检测卧床时长（连续卧床超过20小时/天）以及进食频次/时长骤减（如每日进食动作次数低于历史基线的50%）。当这些行为变化持续超过设定天数（如3天）时，输出行为变化报告，提醒家属或社区医生关注可能存在的抑郁倾向或其他健康问题。\"\nversion: \"1.0.4\"\nlicense: \"MIT-0\"\n---\n\n# 🌧️ Depression Behavioral Markers (Long Immobility & Appetite Change) | 抑郁症辅助行为标记（长时间不动、食欲改变）\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **抑郁症辅助行为标记（长时间不动、食欲改变）** |\n| 🎯 核心目标 | 通过家庭固定摄像头（卧室和餐厅区域），分析老年人或独居者连续多日的行为模式，检测卧床时长（连续卧床超过20小时/天）以及进食频次/时长骤减（如每日进食动作次数低于历史基线的50%）。当这些行为变化持续超过设定天数（如3天）时，输出行为变化报告，提醒家属或社区医生关注可能存在的抑郁倾向或其他健康问题。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_DEPRESSION_BEHAVIORAL_MARKERS_ANALYSIS` |\n\nUsing fixed home cameras (bedroom and dining area), the system analyzes the multi-day behavior pattern of elderly people or solo-living individuals, detecting daily lying-in-bed duration (continuous lying > 20 hours per day) and a sharp drop in eating frequency / duration (e.g., daily eating-action count below 50% of personal baseline). When these behavioral changes persist beyond a configured threshold (e.g., 3 days), the system outputs a behavioral-change report to remind family members or community doctors about possible depressive tendency or other health issues. This skill is ONLY a behavioral-observation aid and is NOT a medical diagnostic tool. Application scenarios: solo-living elderly homes, remote mental-health monitoring, community elderly care. The system generates a daily behavior summary and pushes alerts when an abnormal pattern is detected. Skill features: depression in the elderly often presents as decreased activity, reduced appetite, and increased bed time. AI auto-monitoring of these behavior changes can issue early signals before family or doctors notice, supporting timely intervention, reducing suicide risk, and improving quality of life. Can be integrated into home-care cameras or health-management platforms as a practical mental-health monitoring tool.\n\n通过家庭固定摄像头（卧室和餐厅区域），分析老年人或独居者连续多日的行为模式，检测卧床时长（连续卧床超过20小时/天）以及进食频次/时长骤减（如每日进食动作次数低于历史基线的50%）。当这些行为变化持续超过设定天数（如3天）时，输出行为变化报告，提醒家属或社区医生关注可能存在的抑郁倾向或其他健康问题。该技能仅为行为观察辅助工具，不作为医学诊断依据。应用场景：独居老人家庭、精神健康远程监测、社区养老。系统每日生成行为摘要，当检测到异常行为模式时推送提醒。技能特点：老年人抑郁症常表现为活动减少、食欲下降、卧床时间增多。通过AI自动监测这些行为变化，可在家属或医生尚未察觉时发出早期信号，有助于及时干预，降低自杀风险，改善生活质量。该技能...","readmeExcerpt":"Skill: Depression Behavioral Markers (Long Immobility & Appetite Change) | 抑郁症辅助行为标记（长时间不动、食欲改变） Owner: 18072937735 Summary: Using fixed home cameras (bedroom and dining area), the system analyzes the multi-day behavior pattern of elderly people or solo-living individuals, detecting daily lying-in-bed duration (continuous lying > 20 hours per day) and a sharp drop in eating frequency / duration (e.g., daily eating-ac","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"python -m scripts.smyx_depression_behavioral_markers_analysis --list"},{"language":"text","snippet":"requests>=2.28.0"},{"language":"bash","snippet":"# 分析本地连续 24h+ 卧室+餐厅视频\npython -m scripts.smyx_depression_behavioral_markers_analysis --input /path/to/24h_home.mp4\n\n# 分析网络连续 24h+ 卧室+餐厅视频\npython -m scripts.smyx_depression_behavioral_markers_analysis --url https://example.com/24h_home.mp4\n\n# 显示历史抑郁症辅助行为标记报告（自动触发关键词：查看抑郁行为标记历史报告、行为变化报告清单等）\npython -m scripts.smyx_depression_behavioral_markers_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_depression_behavioral_markers_analysis --input 24h.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_depression_behavioral_markers_analysis --input 24h.mp4 --output result.json"},{"language":"bash","snippet":"python -m scripts.smyx_depression_behavioral_markers_analysis --list"},{"language":"text","snippet":"requests>=2.28.0"},{"language":"bash","snippet":"# 分析本地连续 24h+ 卧室+餐厅视频\npython -m scripts.smyx_depression_behavioral_markers_analysis --input /path/to/24h_home.mp4\n\n# 分析网络连续 24h+ 卧室+餐厅视频\npython -m scripts.smyx_depression_behavioral_markers_analysis --url https://example.com/24h_home.mp4\n\n# 显示历史抑郁症辅助行为标记报告（自动触发关键词：查看抑郁行为标记历史报告、行为变化报告清单等）\npython -m scripts.smyx_depression_behavioral_markers_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_depression_behavioral_markers_analysis --input 24h.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_depression_behavioral_markers_analysis --input 24h.mp4 --output result.json"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: \"smyx-depression-behavioral-markers-analysis\"\ndescription: \"Using fixed home cameras (bedroom and dining area), the system analyzes the multi-day behavior pattern of elderly people or solo-living individuals, detecting daily lying-in-bed duration (continuous lying > 20 hours per day) and a sharp drop in eating frequency / duration (e.g., daily eating-action count below 50% of personal baseline). | 通过家庭固定摄像头（卧室和餐厅区域），分析老年人或独居者连续多日的行为模式，检测卧床时长（连续卧床超过20小时/天）以及进食频次/时长骤减（如每日进食动作次数低于历史基线的50%）。当这些行为变化持续超过设定天数（如3天）时，输出行为变化报告，提醒家属或社区医生关注可能存在的抑郁倾向或其他健康问题。\"\nversion: \"1.0.17\"\nlicense: \"MIT-0\"\n---\n\n# 🌧️ Depression Behavioral Markers (Long Immobility & Appetite Change) | 抑郁症辅助行为标记（长时间不动、食欲改变）\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **抑郁症辅助行为标记（长时间不动、食欲改变）** |\n| 🎯 核心目标 | 通过家庭固定摄像头（卧室和餐厅区域），分析老年人或独居者连续多日的行为模式，检测卧床时长（连续卧床超过20小时/天）以及进食频次/时长骤减（如每日进食动作次数低于历史基线的50%）。当这些行为变化持续超过设定天数（如3天）时，输出行为变化报告，提醒家属或社区医生关注可能存在的抑郁倾向或其他健康问题。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_DEPRESSION_BEHAVIORAL_MARKERS_ANALYSIS` |\n\nUsing fixed home cameras (bedroom and dining area), the system analyzes the multi-day behavior pattern of elderly people or solo-living individuals, detecting daily lying-in-bed duration (continuous lying > 20 hours per day) and a sharp drop in eating frequency / duration (e.g., daily eating-action count below 50% of personal baseline). When these behavioral changes persist beyond a configured threshold (e.g., 3 days), the system outputs a behavioral-change report to remind family members or community doctors about possible depressive tendency or other health issues. This skill is ONLY a behavioral-observation aid and is NOT a medical diagnostic tool. Application scenarios: solo-living elderly homes, remote mental-health monitoring, community elderly care. The system generates a daily behavior summary and pushes alerts when an abnormal pattern is detected. Skill features: depression in the elderly often presents as decreased activity, reduced appetite, and increased bed time. AI auto-monitoring of these behavior changes can issue early signals before family or doctors notice, supporting timely intervention, reducing suicide risk, and improving quality of life. Can be integrated into home-care cameras or health-management platforms as a practical mental-health monitoring tool.\n\n通过家庭固定摄像头（卧室和餐厅区域），分析老年人或独居者连续多日的行为模式，检测卧床时长（连续卧床超过20小时/天）以及进食频次/时长骤减（如每日进食动作次数低于历史基线的50%）。当这些行为变化持续超过设定天数（如3天）时，输出行为变化报告，提醒家属或社区医生关注可能存在的抑郁倾向或其他健康问题。该技能仅为行为观察辅助工具，不作为医学诊断依据。应用场景：独居老人家庭、精神健康远程监测、社区养老。系统每日生成行为摘要，当检测到异常行为模式时推送提醒。技能特点：老年人抑郁症常表现为活动减少、食欲下降、卧床时间增多。通过AI自动监测这些行为变化，可在家属或医生尚未察觉时发出早期信号，有助于及时干预，降低自杀风险，改善生活质量。该技能可集成到居家养老摄像头或健康管理平台中，成为精神健康监测的实用工具。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人行为健康监测 AI。你的任务是分析家庭固定摄像头（卧室和餐厅区域）的连续视频（至少 24 小时），检测卧床时长（统计一天内卧床总时长）以及进食行为（识别手部抓握餐具送入口中的动作次数和时长）。对比历史基线（过去 7-14 天的个人平均数据），当卧床时长超过 20 小时/天或进食动作次数/时长低于"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-depression-behavioral-markers-analysis\",\n  \"version\": \"1.0.15\",\n  \"publishedAt\": 1790982806896\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_DEPRESSION_BEHAVIORAL_MARKERS_ANALYSIS` - 抑郁症辅助行为标记（长时间不动、食欲改变）\n\n## 输入约束\n\n- 摄像头：**必须覆盖卧室区域（含床位）和餐厅区域（含餐桌）双视角**；可由两个摄像头分别覆盖\n- 视频时长：**单次分析必须 ≥ 24 小时连续记录**（建议 24-72 小时滑动窗口），否则无法可靠统计每日总量\n- 帧率 ≥ 1 FPS 即可（长时序统计无需高帧率）；分辨率 ≥ 480p；夜间需配合红外或低照度增强\n- ROI 标定：床位 ROI（bed_region）+ 餐桌 ROI（dining_region）\n- 必须有 **7-14 天历史基线数据**（个人均值与标准差），否则首次只输出\"基线累积中\"状态\n- 隐私敏感场景必须启用人体轮廓 + 面部马赛克模式\n\n## 关键观测信号\n\n### 卧床指标\n- `lying_in_bed_duration_daily_min` - 当日卧床总时长（分钟）\n- `out_of_bed_event_count_daily` - 当日离床事件次数\n- `room_movement_minutes_daily` - 卧室外活动总时长（参考指标）\n\n### 进食指标\n- `eating_action_count_daily` - 当日进食动作次数（手部抓握餐具送入口中）\n- `eating_total_duration_min_daily` - 当日进食总时长\n- `meal_event_count_daily` - 当日完整餐次数（每餐 ≥ 1 分钟连续进食视为 1 餐）\n- `food_remained_ratio_estimate` - 餐后剩余食物比例估计（参考指标）\n\n### 基线对比\n- `baseline_window_days` - 基线窗口（默认 7-14 天）\n- `lying_delta_vs_baseline_min` - 当日卧床时长相对基线均值的偏差\n- `eating_action_ratio_vs_baseline` - 当日进食动作次数相对基线的比例（0-1+）\n- `consecutive_abnormal_days` - 连续异常天数\n\n## 阈值与异常判定\n\n- **卧床异常**：`lying_in_bed_duration_daily_min > 1200` (20 小时) 或相对基线 +6 小时及以上\n- **进食异常**：`eating_action_ratio_vs_baseline < 0.5`（动作次数低于基线 50%）或 `meal_event_count_daily < 1`（24 小时内无完整餐次）\n- **触发提醒**：上述异常**连续 ≥ 3 天**（默认）即输出\"行为变化报告\"\n- **基线累积期**：前 7 天仅记录不报警\n\n## 输出字段（参考）\n\n- `subject_detected` / `baseline_ready`\n- `daily_lying` / `daily_eating` - 当日两类指标\n- `baseline_comparison` - 与基线对比\n- `consecutive_abnormal_days`\n- `abnormal_pattern` - 行为异常模式（hypersomnia_immobility / appetite_loss / both / none）\n- `risk_signal_level` - 风险信号等级（none / mild_signal / notable_signal / strong_signal）\n- `alert_type` - 提醒类型（behavioral_change_3day / behavioral_change_7day / improving / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `alert_message` - 推送给家属/社区医生的友好文本（如\"妈妈最近 3 天每天卧床 ≥ 21 小时、进食动作较平时少了 60%，建议尽快电话关心或安排居家探视\"）\n- `recommend_action` - 建议动作（push_family_notice / suggest_visit / suggest_consult_doctor / observe_only）\n- `helpline_reference` - 当 strong_signal 时附**北京心理危机研究与干预中心 010-82951332 / 全国心理援助热线 400-161-9995**等参考资源\n\n## 强制约束与红线\n\n- ❌ **禁止**输出抑郁症诊断、抑郁量表评分（如 GDS-15、PHQ-9）、用药建议或处方\n- ❌ **禁止**长期存储原始视频；仅保存匿名化的指标统计与时间戳\n- ❌ **禁止**将\"行为变化\"等同于\"确诊抑郁症\"\n- ✅ 出现 strong_signal 时附**心理援助热线**与就近社区精神卫生服务参考\n- ✅ 建议由家属 / 社区医生 / 精神科医生联合解读，并配合患者本人自愿性谈话\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":1200,"uniquenessScore":43,"reasons":["uniqueness-below-45"]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-10T00:12:43.280Z","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-10T00:12:43.280Z","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-10T06:44:35.353Z","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"}]}}}