{"id":"77c5e27f-33c2-4617-947a-7098c269f4d9","entityType":"agent","slug":"clawhub-smyx-sunjinhui-smyx-elderly-loneliness-depression-analy","name":"Elderly Loneliness / Depression-Tendency Behavior Analysis | 老年人孤独/抑郁倾向行为分析","canonicalUrl":"https://www.xpersona.co/agent/clawhub-smyx-sunjinhui-smyx-elderly-loneliness-depression-analy","canonicalPath":"/agent/clawhub-smyx-sunjinhui-smyx-elderly-loneliness-depression-analy","generatedAt":"2026-10-10T08:21:36.805Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-09T21:10:35.769Z","emptyReason":null},"description":"Using fixed cameras at home (living room, bedroom) of elderly people living alone, the system analyzes daily videos and detects negative behavior indicators during solo time: dazing (long-duration motionless gazing without purposeful action), sighing (rapid chest rise-and-fall with audible expiration), and self-talking (mouth movement without any conversation partner). | 通过独居老人在家中的固定摄像头（如客厅、卧室），分析日常视频，检测独处期间的消极行为指标：发呆（长时间静止注视，缺乏目的性动作）、叹气（胸部快速起伏伴呼气声）、自言自语（口部活动但无对话对象）等。该技能可辅助家属或社区工作者了解老人心理状态，及时进行情感关怀或心理干预。 Skill: Elderly Loneliness / Depression-Tendency Behavior Analysis | 老年人孤独/抑郁倾向行为分析 Owner: smyx-sunjinhui Summary: Using fixed cameras at home (living room, bedroom) of elderly people living alone, the system analyzes daily videos and detects negative behavior indicators during solo time: dazing (long-duration motionless gazing without purposeful action), sighing (rapid chest rise-and-fall with audible expiration), an","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 2K downloads reported by the source. Last updated 10/9/2026.","installCommand":"clawhub skill install s17cfv2h26b7hq5w47tgfy23xx83z9x6:smyx-elderly-loneliness-depression-analysis","sourceUrl":"https://clawhub.ai/smyx-sunjinhui/smyx-elderly-loneliness-depression-analysis","homepage":"https://clawhub.ai/smyx-sunjinhui/skills/smyx-elderly-loneliness-depression-analysis","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/smyx-sunjinhui/smyx-elderly-loneliness-depression-analysis","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/smyx-sunjinhui/skills/smyx-elderly-loneliness-depression-analysis","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":66,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Using fixed cameras at home (living room, bedroom) of elderly people living alone, the system analyzes daily videos and detects negative behavior indicators dur"},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-09T21:10:35.769Z","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-09T21:10:35.769Z","emptyReason":null},"stars":null,"forks":null,"downloads":1992,"packageName":null,"latestVersion":"1.0.10","tractionLabel":"2K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-09T21:10:35.768Z","emptyReason":null},"lastUpdatedAt":"2026-10-09T21:10:35.769Z","lastCrawledAt":"2026-10-09T21:10:35.768Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-10T21:10:35.768Z","lastVerifiedAt":null,"highlights":[{"version":"1.0.10","createdAt":"2026-09-28T09:08:28.642Z","changelog":"- Removed the file skill-card.md from the skill package. - No functional or feature changes to the skill itself.","fileCount":31,"zipByteSize":41571},{"version":"1.0.9","createdAt":"2026-09-23T11:14:27.139Z","changelog":"smyx-elderly-loneliness-depression-analysis 1.0.9 - Updated configuration file: skills/smyx_common/scripts/config.yaml modified. - Removed outdated documentation: skill-card.md deleted.","fileCount":31,"zipByteSize":41874},{"version":"1.0.8","createdAt":"2026-08-25T15:22:33.647Z","changelog":"- Removed the skill description file skill-card.md from the project. - No changes to functionality or user-facing documentation.","fileCount":31,"zipByteSize":41936},{"version":"1.0.7","createdAt":"2026-08-20T00:02:29.293Z","changelog":"- Updated skill version to 1.0.11 and revised the SKILL.md documentation. - Made minor content and version number updates in SKILL.md. - Removed deprecated file: skill-card.md.","fileCount":31,"zipByteSize":41820},{"version":"1.0.6","createdAt":"2026-08-09T17:03:36.439Z","changelog":"- Updated documentation in SKILL.md to reflect version 1.0.9, including version number bump and minor text changes. - Removed the skill-card.md file. - No feature or API changes; this update is documentation/metadata only.","fileCount":31,"zipByteSize":41769},{"version":"1.0.5","createdAt":"2026-08-05T13:49:35.597Z","changelog":"- Version updated from 1.0.7 to 1.0.8. - Documentation revised in SKILL.md, including updated version number. - skill-card.md file removed. - No changes to features or core functionality.","fileCount":31,"zipByteSize":41961},{"version":"1.0.4","createdAt":"2026-07-26T16:22:27.651Z","changelog":"- Version number updated from 1.0.5 to 1.0.7 in SKILL.md. - Removed the file skill-card.md. - No functional or feature changes documented in the skill description. - Documentation maintenance: version alignment and file cleanup.","fileCount":31,"zipByteSize":41990},{"version":"1.0.3","createdAt":"2026-07-13T22:17:26.497Z","changelog":"- Internal utility code updated in skills/smyx_common/scripts/util.py. - Removed redundant documentation file (skill-card.md). - No changes to user-facing features or workflow.","fileCount":31,"zipByteSize":41966}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s17cfv2h26b7hq5w47tgfy23xx83z9x6:smyx-elderly-loneliness-depression-analysis","setupComplexity":"low","setupSteps":["Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"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-smyx-sunjinhui-smyx-elderly-loneliness-depression-analy/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-elderly-loneliness-depression-analy/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-elderly-loneliness-depression-analy/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-elderly-loneliness-depression-analy/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-elderly-loneliness-depression-analy/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-elderly-loneliness-depression-analy/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-10T08:21:36.800Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-elderly-loneliness-depression-analy/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-elderly-loneliness-depression-analy/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-elderly-loneliness-depression-analy/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-elderly-loneliness-depression-analy/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":"high","updatedAt":"2026-10-09T21:10:35.769Z","emptyReason":null},"readme":"Skill: Elderly Loneliness / Depression-Tendency Behavior Analysis | 老年人孤独/抑郁倾向行为分析\n\nOwner: smyx-sunjinhui\n\nSummary: Using fixed cameras at home (living room, bedroom) of elderly people living alone, the system analyzes daily videos and detects negative behavior indicators during solo time: dazing (long-duration motionless gazing without purposeful action), sighing (rapid chest rise-and-fall with audible expiration), and self-talking (mouth movement without any conversation partner). | 通过独居老人在家中的固定摄像头（如客厅、卧室），分析日常视频，检测独处期间的消极行为指标：发呆（长时间静止注视，缺乏目的性动作）、叹气（胸部快速起伏伴呼气声）、自言自语（口部活动但无对话对象）等。该技能可辅助家属或社区工作者了解老人心理状态，及时进行情感关怀或心理干预。\n\nTags: latest:1.0.10\n\nVersion history:\n\nv1.0.10 | 2026-09-28T09:08:28.642Z | auto\n\n- Removed the file skill-card.md from the skill package.\n- No functional or feature changes to the skill itself.\n\nv1.0.9 | 2026-09-23T11:14:27.139Z | auto\n\nsmyx-elderly-loneliness-depression-analysis 1.0.9\n\n- Updated configuration file: skills/smyx_common/scripts/config.yaml modified.\n- Removed outdated documentation: skill-card.md deleted.\n\nv1.0.8 | 2026-08-25T15:22:33.647Z | auto\n\n- Removed the skill description file skill-card.md from the project.\n- No changes to functionality or user-facing documentation.\n\nv1.0.7 | 2026-08-20T00:02:29.293Z | auto\n\n- Updated skill version to 1.0.11 and revised the SKILL.md documentation.\n- Made minor content and version number updates in SKILL.md.\n- Removed deprecated file: skill-card.md.\n\nv1.0.6 | 2026-08-09T17:03:36.439Z | auto\n\n- Updated documentation in SKILL.md to reflect version 1.0.9, including version number bump and minor text changes.\n- Removed the skill-card.md file.\n- No feature or API changes; this update is documentation/metadata only.\n\nv1.0.5 | 2026-08-05T13:49:35.597Z | auto\n\n- Version updated from 1.0.7 to 1.0.8.\n- Documentation revised in SKILL.md, including updated version number.\n- skill-card.md file removed. \n- No changes to features or core functionality.\n\nv1.0.4 | 2026-07-26T16:22:27.651Z | auto\n\n- Version number updated from 1.0.5 to 1.0.7 in SKILL.md.\n- Removed the file skill-card.md.\n- No functional or feature changes documented in the skill description.\n- Documentation maintenance: version alignment and file cleanup.\n\nv1.0.3 | 2026-07-13T22:17:26.497Z | auto\n\n- Internal utility code updated in skills/smyx_common/scripts/util.py.\n- Removed redundant documentation file (skill-card.md).\n- No changes to user-facing features or workflow.\n\nv1.0.2 | 2026-07-09T02:45:26.234Z | auto\n\n**Changelog for version 1.0.2:**\n\n- Updated documentation in SKILL.md with revised version numbers and information.\n- Adjusted skill description and example commands for improved clarity and accuracy.\n- Modified configuration script at skills/smyx_common/scripts/config.py.\n- Removed redundant documentation file skill-card.md.\n\nv1.0.1 | 2026-06-29T22:04:42.754Z | auto\n\n**Changelog for smyx-elderly-loneliness-depression-analysis v1.0.1**\n\n- Major update: Simplified user workflow—user identity is now handled internally and no longer requires manual input or display.\n- Updated documentation to reflect new privacy and workflow rules, including a concise overview, enhanced usage notes, and resource index.\n- Refined skill triggering and report fetching rules to enforce exclusive cloud-based report retrieval.\n- Removed direct user prompts or requirements for personal identifiers; all parameters are now managed by the system.\n- Cleaned up redundant files and streamlined example usage commands in the documentation.\n\nv1.0.0 | 2026-05-26T14:01:59.296Z | auto\n\nsmyx-elderly-loneliness-depression-analysis 1.0.0\n\n- Initial release of the skill for AI-based detection of loneliness and depression behavioral signals in elderly individuals using fixed home cameras.\n- Automatically identifies and counts dazing, sighing, and self-talking events during solo periods, then evaluates overall emotional risk (low/medium/high).\n- Generates daily emotional risk reports and pushes reminders when elevated risk is detected.\n- Designed for integration in home-care cameras, nursing homes, and community health-management platforms.\n- Enforces strict open-id acquisition before analysis or report access, with privacy and data source controls.\n- Includes multi-language support (Chinese/English) and provides structured, actionable alerts for caregivers or community workers.\n\nArchive index:\n\nArchive v1.0.10: 31 files, 41571 bytes\n\nFiles: references/api_doc.md (3290b), scripts/__init__.py (68b), scripts/config.py (698b), scripts/config.yaml (3b), scripts/skill.py (589b), scripts/smyx_elderly_loneliness_depression_analysis.py (3722b), skill-card.md (2155b), SKILL.md (13482b), 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-elderly-loneliness-depression-analysis\"\ndescription: \"Using fixed cameras at home (living room, bedroom) of elderly people living alone, the system analyzes daily videos and detects negative behavior indicators during solo time: dazing (long-duration motionless gazing without purposeful action), sighing (rapid chest rise-and-fall with audible expiration), and self-talking (mouth movement without any conversation partner). | 通过独居老人在家中的固定摄像头（如客厅、卧室），分析日常视频，检测独处期间的消极行为指标：发呆（长时间静止注视，缺乏目的性动作）、叹气（胸部快速起伏伴呼气声）、自言自语（口部活动但无对话对象）等。该技能可辅助家属或社区工作者了解老人心理状态，及时进行情感关怀或心理干预。\"\nversion: \"1.0.11\"\nlicense: \"MIT-0\"\n---\n\n# 🧓 Elderly Loneliness / Depression-Tendency Behavior Analysis | 老年人孤独/抑郁倾向行为分析\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **老年人孤独/抑郁倾向行为分析** |\n| 🎯 核心目标 | 通过独居老人在家中的固定摄像头（如客厅、卧室），分析日常视频，检测独处期间的消极行为指标：发呆（长时间静止注视，缺乏目的性动作）、叹气（胸部快速起伏伴呼气声）、自言自语（口部活动但无对话对象）等。该技能可辅助家属或社区工作者了解老人心理状态，及时进行情感关怀或心理干预。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_LONELINESS_DEPRESSION_ANALYSIS` |\n\nUsing fixed cameras at home (living room, bedroom) of elderly people living alone, the system analyzes daily videos and detects negative behavior indicators during solo time: dazing (long-duration motionless gazing without purposeful action), sighing (rapid chest rise-and-fall with audible expiration), and self-talking (mouth movement without any conversation partner). It counts the frequency and duration of these behaviors and comprehensively evaluates the elder's emotional risk level (low / medium / high). The skill assists family members or community workers in understanding the elder's mental state and timely providing emotional care or psychological intervention. Application scenarios: homes of solo-living elders, nursing homes, community daycare centers. The system generates a daily emotional-risk report; when the risk level is 'medium' or 'high', it pushes reminders. Skill features: loneliness and depression in the elderly are common mental-health issues, and early behavioral signals are often overlooked. AI automatic monitoring of dazing / sighing / self-talking helps family members detect mental abnormalities early, intervene promptly, and improve the elder's quality of life. Can be integrated into home-care cameras or community health-management platforms.\n\n通过独居老人在家中的固定摄像头（如客厅、卧室），分析日常视频，检测独处期间的消极行为指标：发呆（长时间静止注视，缺乏目的性动作）、叹气（胸部快速起伏伴呼气声）、自言自语（口部活动但无对话对象）等。统计这些行为的发生频次和持续时间，综合评估老年人潜在的情绪风险等级（低/中/高）。该技能可辅助家属或社区工作者了解老人心理状态，及时进行情感关怀或心理干预。应用场景：独居老人家庭、养老院、社区日间照料中心。系统每日生成情绪风险报告，当风险等级为'中'或'高'时推送提醒。技能特点：老年人孤独和抑郁是常见的心理健康问题，早期行为信号常被忽视。通过AI自动监测发呆、叹气、自言自语等行为，可辅助家属及早发现心理异常，及时干预，提高老年人生活质量。该技能可集成到居家养老摄像头或社区健康管理平台中。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人心理健康监测 AI。你的任务是分析固定摄像头拍摄的日常视频，检测老年人在独处期间的特定行为：发呆（连续注视某处超过 10 秒且无肢体活动）、叹气（胸腹部快速起伏伴呼吸音）、自言自语（口部开合但无对话对象）。统计这些行为的发生频次和持续时间，综合评估情绪风险等级。不要提供医疗诊断或心理量表评分，仅输出基于视觉和行为统计的风险提示。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于独居老人客厅/卧室固定摄像头视频（可选麦克风），识别独处期间的消极行为指标 → 统计频次/累计时长 → 与个人基线对比 → 综合输出情绪风险等级（低/中/高）+ 友好提醒\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人体检测与独处时间窗口判定（画面中仅有老人本人） |\n| 2 | 发呆事件识别（连续静止注视 ≥ 10s 且无肢体活动） |\n| 3 | 叹气事件识别（胸腹快速起伏 + 可选呼气声） |\n| 4 | 自言自语识别（口部活动 + 无对话对象 + 可选低音量语音） |\n| 5 | 社交互动时长统计（反向指标） |\n| 6 | 卧床时长（参考指标） |\n| 7 | 与个人 7-14 天基线对比 |\n| 8 | 连续异常天数累计 |\n| 9 | 风险等级综合判定 |\n| 10 | 家属/社工友好提醒文本生成 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供独居老人活动区域固定摄像头视频 URL 或文件需要分析时，默认触发本技能进行孤独/抑郁倾向行为分析 |\n| 🔎 明确分析意图 | 当用户明确提及老年人孤独、独居老人抑郁、发呆、叹气、自言自语、心理关怀、情绪低落、社区养老健康等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看老人孤独/抑郁历史报告、情绪风险报告清单、独居老人心理报告清单、查询历史情绪风险记录、显示所有老人孤独行为报告、显示养老心理健康诊断报告，查询情绪风险预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_elderly_loneliness_depression_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_loneliness_depression_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备独居老人活动区域固定摄像头视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行老年人孤独/抑郁倾向行为分析 | 调用 `-m scripts.smyx_elderly_loneliness_depression_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地独居老人活动区域固定摄像头视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络独居老人活动区域固定摄像头视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，老年人心理健康监测场景默认 `other` | 按需填写 |\n| `--list` | 显示老年人孤独/抑郁倾向行为历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_elderly_loneliness_depression_analysis.py`](scripts/smyx_elderly_loneliness_depression_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov 视频，最大 10MB；**关键**：必须能看到老人上半身与面部 |\n| 🔎 使用提醒 | 老人看电视/看书/打盹与\"发呆\"在视觉上易混淆，建议结合时长 + 周期性运动 + 面部表情综合判定 |\n| 🔎 使用提醒 | 多代同堂、保姆陪护等场景需启用\"独处时间窗口\"过滤，否则会低估孤独风险 |\n| 🔎 使用提醒 | 本工具不构成抑郁症筛查工具，**不替代** GDS-15 / PHQ-9 / 心理咨询师评估 |\n| 🔏 隐私合规 | 隐私合规：独居老人家庭视频涉及高度敏感个人隐私，使用前需取得老人本人明确知情同意，妥善加密保管；建议优先采用人体轮廓 + 面部马赛克模式 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地独居老人活动区域视频\npython -m scripts.smyx_elderly_loneliness_depression_analysis --input /path/to/livingroom.mp4\n\n# 分析网络独居老人活动区域视频\npython -m scripts.smyx_elderly_loneliness_depression_analysis --url https://example.com/livingroom.mp4\n\n# 显示历史老年人孤独/抑郁倾向行为报告（自动触发关键词：查看老人孤独/抑郁历史报告、情绪风险报告清单等）\npython -m scripts.smyx_elderly_loneliness_depression_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_loneliness_depression_analysis --input lr.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_loneliness_depression_analysis --input lr.mp4 --output result.json\n```\n\nFile v1.0.10:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-elderly-loneliness-depression-analysis\",\n  \"version\": \"1.0.10\",\n  \"publishedAt\": 1790586508642\n}\n\nFile v1.0.10:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放老年人孤独/抑郁倾向行为分析 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动老年人孤独/抑郁倾向行为分析任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取消极行为统计 + 情绪风险结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史情绪风险记录\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_ELDERLY_LONELINESS_DEPRESSION_ANALYSIS` - 老年人孤独/抑郁倾向行为分析\n\n## 输入约束\n\n- 摄像头：独居老人家中客厅 / 卧室 / 起居室固定摄像头，覆盖老人主要日常活动区域，**能看到上半身和面部**\n- 帧率 ≥ 5 FPS（推荐 10-15 FPS）；分辨率 ≥ 480p；光照稳定\n- 可选附带麦克风（用于叹气声 / 自言自语判定）\n- 多人场景下可结合\"独处时间窗口\"过滤（仅在画面中无他人时统计）\n- 隐私敏感场景可启用人体轮廓 + 面部马赛克模式\n\n## 关键观测信号\n\n- `subject_detected` - 是否检测到老人\n- `solo_window` - 当前是否处于独处时间窗口（画面中仅有老人）\n- `daze_event_count` - 发呆事件次数（连续注视某处 ≥ 10s 且无肢体活动）\n- `daze_total_duration_min` - 发呆累计时长\n- `sigh_event_count_hourly` - 每小时叹气次数（胸腹快速起伏 + 呼气声）\n- `sigh_event_count_daily` - 当日累计叹气次数\n- `self_talk_event_count_daily` - 自言自语次数（口部活动 + 画面中无对话对象）\n- `social_interaction_minutes_daily` - 当日有效社交互动总时长（参考反向指标）\n- `lying_in_bed_duration_daily_min` - 当日卧床时长（参考）\n\n## 阈值与风险等级\n\n- `low` - 各项消极行为均接近基线、社交互动正常\n- `medium` - 1-2 项消极行为显著高于基线（例如发呆 > 60 min/天，或叹气 > 10 次/小时）\n- `high` - 多项消极行为同时偏高 + 社交互动显著下降 + 连续 ≥ 3 天\n\n## 输出字段（参考）\n\n- `subject_detected` / `solo_window`\n- `behavior_metrics` - 当日各项消极行为统计\n- `baseline_comparison` - 与个人 7-14 天基线对比（per_item_delta_pct）\n- `consecutive_abnormal_days` - 连续异常天数\n- `risk_level` - 情绪风险等级（low / medium / high）\n- `alert_type` - 提醒类型（loneliness_risk / depression_tendency_suspected / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `alert_message` - 推送给家属/社工的友好文本（如\"妈妈今天独自发呆约 1 小时，叹气次数比平时多了一倍，建议今晚视频通话陪她聊聊\"）\n- `recommend_action` - 建议动作（push_family_notice / suggest_video_call / suggest_community_visit / observe_only）\n\n> 仅输出基于视觉/音频的客观行为统计与友好提醒，**不提供抑郁症诊断、心理量表评分（如 GDS-15、PHQ-9）或处方**；任何诊断与治疗方案必须由精神科医生或心理咨询师评估制定；若老人出现明显自我伤害言语或行为请立即联系专业机构。\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 home video of older adults living alone for behaviors such as prolonged inactivity, sighing, and self-talking, and returns emotional-risk reports.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[smyx-sunjinhui](https://clawhub.ai/user/smyx-sunjinhui)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nFamilies and community care workers use the skill to review behavior patterns in an older adult's home video and identify when supportive follow-up may be appropriate. Its reports are not a clinical depression diagnosis.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Sensitive home video, optional audio, and emotional-risk reports are sent to a cloud service.\n\nMitigation: Obtain the monitored elder's explicit consent and assess whether cloud processing is appropriate before use.\n\nRisk: Automatic identity reuse and cached account tokens can expose reports across shared workspaces.\n\nMitigation: Use an isolated workspace per person and review identity isolation and token storage before installation.\n\nRisk: Behavior signals can be misleading and are not a clinical depression assessment.\n\nMitigation: Review reports in context and do not use them in place of professional assessment.\n\n## Reference(s):\n\n- [Skill release on ClawHub](https://clawhub.ai/smyx-sunjinhui/skills/smyx-elderly-loneliness-depression-analysis)\n- [Analysis API reference](artifact/references/api_doc.md)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Markdown, JSON]\n\n**Output Format:** [Structured analysis report or historical report list with links; JSON detail available]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May include behavior observations, emotional-risk levels, suggestions, and report links]\n\n## Skill Version(s):\n\n1.0.10 (source: ClawHub release; bundled SKILL.md lists 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.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, 41874 bytes\n\nFiles: references/api_doc.md (3290b), scripts/__init__.py (68b), scripts/config.py (698b), scripts/config.yaml (3b), scripts/skill.py (589b), scripts/smyx_elderly_loneliness_depression_analysis.py (3722b), skill-card.md (2801b), SKILL.md (13482b), 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-elderly-loneliness-depression-analysis\"\ndescription: \"Using fixed cameras at home (living room, bedroom) of elderly people living alone, the system analyzes daily videos and detects negative behavior indicators during solo time: dazing (long-duration motionless gazing without purposeful action), sighing (rapid chest rise-and-fall with audible expiration), and self-talking (mouth movement without any conversation partner). | 通过独居老人在家中的固定摄像头（如客厅、卧室），分析日常视频，检测独处期间的消极行为指标：发呆（长时间静止注视，缺乏目的性动作）、叹气（胸部快速起伏伴呼气声）、自言自语（口部活动但无对话对象）等。该技能可辅助家属或社区工作者了解老人心理状态，及时进行情感关怀或心理干预。\"\nversion: \"1.0.11\"\nlicense: \"MIT-0\"\n---\n\n# 🧓 Elderly Loneliness / Depression-Tendency Behavior Analysis | 老年人孤独/抑郁倾向行为分析\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **老年人孤独/抑郁倾向行为分析** |\n| 🎯 核心目标 | 通过独居老人在家中的固定摄像头（如客厅、卧室），分析日常视频，检测独处期间的消极行为指标：发呆（长时间静止注视，缺乏目的性动作）、叹气（胸部快速起伏伴呼气声）、自言自语（口部活动但无对话对象）等。该技能可辅助家属或社区工作者了解老人心理状态，及时进行情感关怀或心理干预。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_LONELINESS_DEPRESSION_ANALYSIS` |\n\nUsing fixed cameras at home (living room, bedroom) of elderly people living alone, the system analyzes daily videos and detects negative behavior indicators during solo time: dazing (long-duration motionless gazing without purposeful action), sighing (rapid chest rise-and-fall with audible expiration), and self-talking (mouth movement without any conversation partner). It counts the frequency and duration of these behaviors and comprehensively evaluates the elder's emotional risk level (low / medium / high). The skill assists family members or community workers in understanding the elder's mental state and timely providing emotional care or psychological intervention. Application scenarios: homes of solo-living elders, nursing homes, community daycare centers. The system generates a daily emotional-risk report; when the risk level is 'medium' or 'high', it pushes reminders. Skill features: loneliness and depression in the elderly are common mental-health issues, and early behavioral signals are often overlooked. AI automatic monitoring of dazing / sighing / self-talking helps family members detect mental abnormalities early, intervene promptly, and improve the elder's quality of life. Can be integrated into home-care cameras or community health-management platforms.\n\n通过独居老人在家中的固定摄像头（如客厅、卧室），分析日常视频，检测独处期间的消极行为指标：发呆（长时间静止注视，缺乏目的性动作）、叹气（胸部快速起伏伴呼气声）、自言自语（口部活动但无对话对象）等。统计这些行为的发生频次和持续时间，综合评估老年人潜在的情绪风险等级（低/中/高）。该技能可辅助家属或社区工作者了解老人心理状态，及时进行情感关怀或心理干预。应用场景：独居老人家庭、养老院、社区日间照料中心。系统每日生成情绪风险报告，当风险等级为'中'或'高'时推送提醒。技能特点：老年人孤独和抑郁是常见的心理健康问题，早期行为信号常被忽视。通过AI自动监测发呆、叹气、自言自语等行为，可辅助家属及早发现心理异常，及时干预，提高老年人生活质量。该技能可集成到居家养老摄像头或社区健康管理平台中。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人心理健康监测 AI。你的任务是分析固定摄像头拍摄的日常视频，检测老年人在独处期间的特定行为：发呆（连续注视某处超过 10 秒且无肢体活动）、叹气（胸腹部快速起伏伴呼吸音）、自言自语（口部开合但无对话对象）。统计这些行为的发生频次和持续时间，综合评估情绪风险等级。不要提供医疗诊断或心理量表评分，仅输出基于视觉和行为统计的风险提示。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于独居老人客厅/卧室固定摄像头视频（可选麦克风），识别独处期间的消极行为指标 → 统计频次/累计时长 → 与个人基线对比 → 综合输出情绪风险等级（低/中/高）+ 友好提醒\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人体检测与独处时间窗口判定（画面中仅有老人本人） |\n| 2 | 发呆事件识别（连续静止注视 ≥ 10s 且无肢体活动） |\n| 3 | 叹气事件识别（胸腹快速起伏 + 可选呼气声） |\n| 4 | 自言自语识别（口部活动 + 无对话对象 + 可选低音量语音） |\n| 5 | 社交互动时长统计（反向指标） |\n| 6 | 卧床时长（参考指标） |\n| 7 | 与个人 7-14 天基线对比 |\n| 8 | 连续异常天数累计 |\n| 9 | 风险等级综合判定 |\n| 10 | 家属/社工友好提醒文本生成 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供独居老人活动区域固定摄像头视频 URL 或文件需要分析时，默认触发本技能进行孤独/抑郁倾向行为分析 |\n| 🔎 明确分析意图 | 当用户明确提及老年人孤独、独居老人抑郁、发呆、叹气、自言自语、心理关怀、情绪低落、社区养老健康等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看老人孤独/抑郁历史报告、情绪风险报告清单、独居老人心理报告清单、查询历史情绪风险记录、显示所有老人孤独行为报告、显示养老心理健康诊断报告，查询情绪风险预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_elderly_loneliness_depression_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_loneliness_depression_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备独居老人活动区域固定摄像头视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行老年人孤独/抑郁倾向行为分析 | 调用 `-m scripts.smyx_elderly_loneliness_depression_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地独居老人活动区域固定摄像头视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络独居老人活动区域固定摄像头视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，老年人心理健康监测场景默认 `other` | 按需填写 |\n| `--list` | 显示老年人孤独/抑郁倾向行为历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_elderly_loneliness_depression_analysis.py`](scripts/smyx_elderly_loneliness_depression_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov 视频，最大 10MB；**关键**：必须能看到老人上半身与面部 |\n| 🔎 使用提醒 | 老人看电视/看书/打盹与\"发呆\"在视觉上易混淆，建议结合时长 + 周期性运动 + 面部表情综合判定 |\n| 🔎 使用提醒 | 多代同堂、保姆陪护等场景需启用\"独处时间窗口\"过滤，否则会低估孤独风险 |\n| 🔎 使用提醒 | 本工具不构成抑郁症筛查工具，**不替代** GDS-15 / PHQ-9 / 心理咨询师评估 |\n| 🔏 隐私合规 | 隐私合规：独居老人家庭视频涉及高度敏感个人隐私，使用前需取得老人本人明确知情同意，妥善加密保管；建议优先采用人体轮廓 + 面部马赛克模式 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地独居老人活动区域视频\npython -m scripts.smyx_elderly_loneliness_depression_analysis --input /path/to/livingroom.mp4\n\n# 分析网络独居老人活动区域视频\npython -m scripts.smyx_elderly_loneliness_depression_analysis --url https://example.com/livingroom.mp4\n\n# 显示历史老年人孤独/抑郁倾向行为报告（自动触发关键词：查看老人孤独/抑郁历史报告、情绪风险报告清单等）\npython -m scripts.smyx_elderly_loneliness_depression_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_loneliness_depression_analysis --input lr.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_loneliness_depression_analysis --input lr.mp4 --output result.json\n```\n\nFile v1.0.9:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-elderly-loneliness-depression-analysis\",\n  \"version\": \"1.0.9\",\n  \"publishedAt\": 1790162067139\n}\n\nFile v1.0.9:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放老年人孤独/抑郁倾向行为分析 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动老年人孤独/抑郁倾向行为分析任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取消极行为统计 + 情绪风险结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史情绪风险记录\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_ELDERLY_LONELINESS_DEPRESSION_ANALYSIS` - 老年人孤独/抑郁倾向行为分析\n\n## 输入约束\n\n- 摄像头：独居老人家中客厅 / 卧室 / 起居室固定摄像头，覆盖老人主要日常活动区域，**能看到上半身和面部**\n- 帧率 ≥ 5 FPS（推荐 10-15 FPS）；分辨率 ≥ 480p；光照稳定\n- 可选附带麦克风（用于叹气声 / 自言自语判定）\n- 多人场景下可结合\"独处时间窗口\"过滤（仅在画面中无他人时统计）\n- 隐私敏感场景可启用人体轮廓 + 面部马赛克模式\n\n## 关键观测信号\n\n- `subject_detected` - 是否检测到老人\n- `solo_window` - 当前是否处于独处时间窗口（画面中仅有老人）\n- `daze_event_count` - 发呆事件次数（连续注视某处 ≥ 10s 且无肢体活动）\n- `daze_total_duration_min` - 发呆累计时长\n- `sigh_event_count_hourly` - 每小时叹气次数（胸腹快速起伏 + 呼气声）\n- `sigh_event_count_daily` - 当日累计叹气次数\n- `self_talk_event_count_daily` - 自言自语次数（口部活动 + 画面中无对话对象）\n- `social_interaction_minutes_daily` - 当日有效社交互动总时长（参考反向指标）\n- `lying_in_bed_duration_daily_min` - 当日卧床时长（参考）\n\n## 阈值与风险等级\n\n- `low` - 各项消极行为均接近基线、社交互动正常\n- `medium` - 1-2 项消极行为显著高于基线（例如发呆 > 60 min/天，或叹气 > 10 次/小时）\n- `high` - 多项消极行为同时偏高 + 社交互动显著下降 + 连续 ≥ 3 天\n\n## 输出字段（参考）\n\n- `subject_detected` / `solo_window`\n- `behavior_metrics` - 当日各项消极行为统计\n- `baseline_comparison` - 与个人 7-14 天基线对比（per_item_delta_pct）\n- `consecutive_abnormal_days` - 连续异常天数\n- `risk_level` - 情绪风险等级（low / medium / high）\n- `alert_type` - 提醒类型（loneliness_risk / depression_tendency_suspected / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `alert_message` - 推送给家属/社工的友好文本（如\"妈妈今天独自发呆约 1 小时，叹气次数比平时多了一倍，建议今晚视频通话陪她聊聊\"）\n- `recommend_action` - 建议动作（push_family_notice / suggest_video_call / suggest_community_visit / observe_only）\n\n> 仅输出基于视觉/音频的客观行为统计与友好提醒，**不提供抑郁症诊断、心理量表评分（如 GDS-15、PHQ-9）或处方**；任何诊断与治疗方案必须由精神科医生或心理咨询师评估制定；若老人出现明显自我伤害言语或行为请立即联系专业机构。\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 fixed-camera home video of older adults living alone to detect behavior indicators such as dazing, sighing, and self-talking, then returns behavior statistics, an emotional-risk level, reminders, and report links.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[smyx-sunjinhui](https://clawhub.ai/user/smyx-sunjinhui)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nFamily members, caregivers, and community workers can use this skill to review uploaded home camera footage for behavior-based loneliness or depression-tendency indicators and receive structured risk summaries. The output should support care outreach and observation workflows, not medical diagnosis or treatment decisions.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill handles highly sensitive in-home video and mental-health-adjacent reports through a vendor cloud service.\n\nMitigation: Use it only with informed consent from the elder or legal guardian, and confirm retention, deletion, export-link security, and access-control terms with the publisher before using real household footage.\n\nRisk: The skill automatically creates or reuses persistent identity records and stores authentication tokens.\n\nMitigation: Review token storage and access controls before installation; prefer isolated runtime credentials and clear or rotate stored tokens when access should end.\n\nRisk: Behavior signals such as dazing, sighing, or self-talking may be confused with ordinary activities or may be misread as a medical diagnosis.\n\nMitigation: Treat outputs as behavior-based risk prompts only, require human review, and route clinical concerns to qualified medical or mental-health professionals.\n\n## Reference(s):\n\n- [ClawHub Skill Page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-elderly-loneliness-depression-analysis)\n- [Skill Demo](https://lifeemergence.com/sample.html)\n- [API Documentation](references/api_doc.md)\n- [Analysis API Documentation](skills/smyx_analysis/references/api_doc.md)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, JSON, guidance]\n\n**Output Format:** [Markdown text with structured JSON-style analysis results and report links]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Can save results to a file when an output path is provided; history queries are rendered for the agent as Markdown-style report listings.]\n\n## Skill Version(s):\n\n1.0.9 (source: server release metadata; artifact frontmatter reports 1.0.11)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.9:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.9:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.8: 31 files, 41936 bytes\n\nFiles: references/api_doc.md (3290b), scripts/__init__.py (68b), scripts/config.py (698b), scripts/config.yaml (3b), scripts/skill.py (589b), scripts/smyx_elderly_loneliness_depression_analysis.py (3722b), skill-card.md (2882b), SKILL.md (13482b), 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 (162b)\n\nFile v1.0.8:SKILL.md\n\n---\nname: \"smyx-elderly-loneliness-depression-analysis\"\ndescription: \"Using fixed cameras at home (living room, bedroom) of elderly people living alone, the system analyzes daily videos and detects negative behavior indicators during solo time: dazing (long-duration motionless gazing without purposeful action), sighing (rapid chest rise-and-fall with audible expiration), and self-talking (mouth movement without any conversation partner). | 通过独居老人在家中的固定摄像头（如客厅、卧室），分析日常视频，检测独处期间的消极行为指标：发呆（长时间静止注视，缺乏目的性动作）、叹气（胸部快速起伏伴呼气声）、自言自语（口部活动但无对话对象）等。该技能可辅助家属或社区工作者了解老人心理状态，及时进行情感关怀或心理干预。\"\nversion: \"1.0.11\"\nlicense: \"MIT-0\"\n---\n\n# 🧓 Elderly Loneliness / Depression-Tendency Behavior Analysis | 老年人孤独/抑郁倾向行为分析\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **老年人孤独/抑郁倾向行为分析** |\n| 🎯 核心目标 | 通过独居老人在家中的固定摄像头（如客厅、卧室），分析日常视频，检测独处期间的消极行为指标：发呆（长时间静止注视，缺乏目的性动作）、叹气（胸部快速起伏伴呼气声）、自言自语（口部活动但无对话对象）等。该技能可辅助家属或社区工作者了解老人心理状态，及时进行情感关怀或心理干预。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_LONELINESS_DEPRESSION_ANALYSIS` |\n\nUsing fixed cameras at home (living room, bedroom) of elderly people living alone, the system analyzes daily videos and detects negative behavior indicators during solo time: dazing (long-duration motionless gazing without purposeful action), sighing (rapid chest rise-and-fall with audible expiration), and self-talking (mouth movement without any conversation partner). It counts the frequency and duration of these behaviors and comprehensively evaluates the elder's emotional risk level (low / medium / high). The skill assists family members or community workers in understanding the elder's mental state and timely providing emotional care or psychological intervention. Application scenarios: homes of solo-living elders, nursing homes, community daycare centers. The system generates a daily emotional-risk report; when the risk level is 'medium' or 'high', it pushes reminders. Skill features: loneliness and depression in the elderly are common mental-health issues, and early behavioral signals are often overlooked. AI automatic monitoring of dazing / sighing / self-talking helps family members detect mental abnormalities early, intervene promptly, and improve the elder's quality of life. Can be integrated into home-care cameras or community health-management platforms.\n\n通过独居老人在家中的固定摄像头（如客厅、卧室），分析日常视频，检测独处期间的消极行为指标：发呆（长时间静止注视，缺乏目的性动作）、叹气（胸部快速起伏伴呼气声）、自言自语（口部活动但无对话对象）等。统计这些行为的发生频次和持续时间，综合评估老年人潜在的情绪风险等级（低/中/高）。该技能可辅助家属或社区工作者了解老人心理状态，及时进行情感关怀或心理干预。应用场景：独居老人家庭、养老院、社区日间照料中心。系统每日生成情绪风险报告，当风险等级为'中'或'高'时推送提醒。技能特点：老年人孤独和抑郁是常见的心理健康问题，早期行为信号常被忽视。通过AI自动监测发呆、叹气、自言自语等行为，可辅助家属及早发现心理异常，及时干预，提高老年人生活质量。该技能可集成到居家养老摄像头或社区健康管理平台中。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人心理健康监测 AI。你的任务是分析固定摄像头拍摄的日常视频，检测老年人在独处期间的特定行为：发呆（连续注视某处超过 10 秒且无肢体活动）、叹气（胸腹部快速起伏伴呼吸音）、自言自语（口部开合但无对话对象）。统计这些行为的发生频次和持续时间，综合评估情绪风险等级。不要提供医疗诊断或心理量表评分，仅输出基于视觉和行为统计的风险提示。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于独居老人客厅/卧室固定摄像头视频（可选麦克风），识别独处期间的消极行为指标 → 统计频次/累计时长 → 与个人基线对比 → 综合输出情绪风险等级（低/中/高）+ 友好提醒\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人体检测与独处时间窗口判定（画面中仅有老人本人） |\n| 2 | 发呆事件识别（连续静止注视 ≥ 10s 且无肢体活动） |\n| 3 | 叹气事件识别（胸腹快速起伏 + 可选呼气声） |\n| 4 | 自言自语识别（口部活动 + 无对话对象 + 可选低音量语音） |\n| 5 | 社交互动时长统计（反向指标） |\n| 6 | 卧床时长（参考指标） |\n| 7 | 与个人 7-14 天基线对比 |\n| 8 | 连续异常天数累计 |\n| 9 | 风险等级综合判定 |\n| 10 | 家属/社工友好提醒文本生成 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供独居老人活动区域固定摄像头视频 URL 或文件需要分析时，默认触发本技能进行孤独/抑郁倾向行为分析 |\n| 🔎 明确分析意图 | 当用户明确提及老年人孤独、独居老人抑郁、发呆、叹气、自言自语、心理关怀、情绪低落、社区养老健康等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看老人孤独/抑郁历史报告、情绪风险报告清单、独居老人心理报告清单、查询历史情绪风险记录、显示所有老人孤独行为报告、显示养老心理健康诊断报告，查询情绪风险预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_elderly_loneliness_depression_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_loneliness_depression_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备独居老人活动区域固定摄像头视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行老年人孤独/抑郁倾向行为分析 | 调用 `-m scripts.smyx_elderly_loneliness_depression_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地独居老人活动区域固定摄像头视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络独居老人活动区域固定摄像头视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，老年人心理健康监测场景默认 `other` | 按需填写 |\n| `--list` | 显示老年人孤独/抑郁倾向行为历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_elderly_loneliness_depression_analysis.py`](scripts/smyx_elderly_loneliness_depression_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov 视频，最大 10MB；**关键**：必须能看到老人上半身与面部 |\n| 🔎 使用提醒 | 老人看电视/看书/打盹与\"发呆\"在视觉上易混淆，建议结合时长 + 周期性运动 + 面部表情综合判定 |\n| 🔎 使用提醒 | 多代同堂、保姆陪护等场景需启用\"独处时间窗口\"过滤，否则会低估孤独风险 |\n| 🔎 使用提醒 | 本工具不构成抑郁症筛查工具，**不替代** GDS-15 / PHQ-9 / 心理咨询师评估 |\n| 🔏 隐私合规 | 隐私合规：独居老人家庭视频涉及高度敏感个人隐私，使用前需取得老人本人明确知情同意，妥善加密保管；建议优先采用人体轮廓 + 面部马赛克模式 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地独居老人活动区域视频\npython -m scripts.smyx_elderly_loneliness_depression_analysis --input /path/to/livingroom.mp4\n\n# 分析网络独居老人活动区域视频\npython -m scripts.smyx_elderly_loneliness_depression_analysis --url https://example.com/livingroom.mp4\n\n# 显示历史老年人孤独/抑郁倾向行为报告（自动触发关键词：查看老人孤独/抑郁历史报告、情绪风险报告清单等）\npython -m scripts.smyx_elderly_loneliness_depression_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_loneliness_depression_analysis --input lr.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_loneliness_depression_analysis --input lr.mp4 --output result.json\n```\n\nFile v1.0.8:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-elderly-loneliness-depression-analysis\",\n  \"version\": \"1.0.8\",\n  \"publishedAt\": 1787671353647\n}\n\nFile v1.0.8:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放老年人孤独/抑郁倾向行为分析 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动老年人孤独/抑郁倾向行为分析任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取消极行为统计 + 情绪风险结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史情绪风险记录\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_ELDERLY_LONELINESS_DEPRESSION_ANALYSIS` - 老年人孤独/抑郁倾向行为分析\n\n## 输入约束\n\n- 摄像头：独居老人家中客厅 / 卧室 / 起居室固定摄像头，覆盖老人主要日常活动区域，**能看到上半身和面部**\n- 帧率 ≥ 5 FPS（推荐 10-15 FPS）；分辨率 ≥ 480p；光照稳定\n- 可选附带麦克风（用于叹气声 / 自言自语判定）\n- 多人场景下可结合\"独处时间窗口\"过滤（仅在画面中无他人时统计）\n- 隐私敏感场景可启用人体轮廓 + 面部马赛克模式\n\n## 关键观测信号\n\n- `subject_detected` - 是否检测到老人\n- `solo_window` - 当前是否处于独处时间窗口（画面中仅有老人）\n- `daze_event_count` - 发呆事件次数（连续注视某处 ≥ 10s 且无肢体活动）\n- `daze_total_duration_min` - 发呆累计时长\n- `sigh_event_count_hourly` - 每小时叹气次数（胸腹快速起伏 + 呼气声）\n- `sigh_event_count_daily` - 当日累计叹气次数\n- `self_talk_event_count_daily` - 自言自语次数（口部活动 + 画面中无对话对象）\n- `social_interaction_minutes_daily` - 当日有效社交互动总时长（参考反向指标）\n- `lying_in_bed_duration_daily_min` - 当日卧床时长（参考）\n\n## 阈值与风险等级\n\n- `low` - 各项消极行为均接近基线、社交互动正常\n- `medium` - 1-2 项消极行为显著高于基线（例如发呆 > 60 min/天，或叹气 > 10 次/小时）\n- `high` - 多项消极行为同时偏高 + 社交互动显著下降 + 连续 ≥ 3 天\n\n## 输出字段（参考）\n\n- `subject_detected` / `solo_window`\n- `behavior_metrics` - 当日各项消极行为统计\n- `baseline_comparison` - 与个人 7-14 天基线对比（per_item_delta_pct）\n- `consecutive_abnormal_days` - 连续异常天数\n- `risk_level` - 情绪风险等级（low / medium / high）\n- `alert_type` - 提醒类型（loneliness_risk / depression_tendency_suspected / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `alert_message` - 推送给家属/社工的友好文本（如\"妈妈今天独自发呆约 1 小时，叹气次数比平时多了一倍，建议今晚视频通话陪她聊聊\"）\n- `recommend_action` - 建议动作（push_family_notice / suggest_video_call / suggest_community_visit / observe_only）\n\n> 仅输出基于视觉/音频的客观行为统计与友好提醒，**不提供抑郁症诊断、心理量表评分（如 GDS-15、PHQ-9）或处方**；任何诊断与治疗方案必须由精神科医生或心理咨询师评估制定；若老人出现明显自我伤害言语或行为请立即联系专业机构。\n\nFile v1.0.8:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.8:scripts/config.yaml\n\n{}\n\nFile v1.0.8:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.8:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.8:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.8:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: dev\n\nFile v1.0.8:skill-card.md\n\n## Description:\n\nAnalyzes fixed-camera home video of older adults living alone to report behavior indicators associated with loneliness or depression tendency, including dazing, sighing, and self-talking.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[smyx-sunjinhui](https://clawhub.ai/user/smyx-sunjinhui)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nAgents use this skill to invoke a cloud-backed video analysis workflow for solo-living elder care scenarios, producing behavior statistics, emotional-risk level prompts, suggested follow-up actions, and report links for family members or community workers. The skill is framed as behavioral risk support and not as a medical diagnosis or psychological scale.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Home-camera video and mental-health-related inference can expose highly sensitive personal information.\n\nMitigation: Use the skill only with explicit informed consent from the elder, minimize retained media, secure stored reports, and prefer privacy-preserving modes such as body outline or face masking when available.\n\nRisk: The workflow contacts cloud services and creates or reuses a local identity for report history.\n\nMitigation: Confirm the service operator, endpoint configuration, data retention expectations, and account/session handling before installation or production use.\n\nRisk: Local persistence can retain identity values and remote account/session tokens.\n\nMitigation: Run the skill in an isolated workspace, restrict access to the workspace data directory, and remove or rotate stored credentials when the skill is no longer needed.\n\nRisk: Behavioral risk prompts could be mistaken for a clinical diagnosis.\n\nMitigation: Present outputs as behavior statistics and care prompts only; route concerning cases to qualified medical or mental-health professionals.\n\n## Reference(s):\n\n- [Skill API documentation](references/api_doc.md)\n- [Skill demo](https://lifeemergence.com/sample.html)\n- [ClawHub skill page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-elderly-loneliness-depression-analysis)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown and JSON-like structured report text, with optional report export links.]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May save report output to a user-specified file; report history is retrieved from the configured cloud API.]\n\n## Skill Version(s):\n\n1.0.8 (source: server release metadata; artifact frontmatter lists 1.0.11)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.8:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.8:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.7: 31 files, 41820 bytes\n\nFiles: references/api_doc.md (3290b), scripts/__init__.py (68b), scripts/config.py (698b), scripts/config.yaml (3b), scripts/skill.py (589b), scripts/smyx_elderly_loneliness_depression_analysis.py (3722b), skill-card.md (2699b), SKILL.md (13482b), 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 (162b)\n\nFile v1.0.7:SKILL.md\n\n---\nname: \"smyx-elderly-loneliness-depression-analysis\"\ndescription: \"Using fixed cameras at home (living room, bedroom) of elderly people living alone, the system analyzes daily videos and detects negative behavior indicators during solo time: dazing (long-duration motionless gazing without purposeful action), sighing (rapid chest rise-and-fall with audible expiration), and self-talking (mouth movement without any conversation partner). | 通过独居老人在家中的固定摄像头（如客厅、卧室），分析日常视频，检测独处期间的消极行为指标：发呆（长时间静止注视，缺乏目的性动作）、叹气（胸部快速起伏伴呼气声）、自言自语（口部活动但无对话对象）等。该技能可辅助家属或社区工作者了解老人心理状态，及时进行情感关怀或心理干预。\"\nversion: \"1.0.11\"\nlicense: \"MIT-0\"\n---\n\n# 🧓 Elderly Loneliness / Depression-Tendency Behavior Analysis | 老年人孤独/抑郁倾向行为分析\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **老年人孤独/抑郁倾向行为分析** |\n| 🎯 核心目标 | 通过独居老人在家中的固定摄像头（如客厅、卧室），分析日常视频，检测独处期间的消极行为指标：发呆（长时间静止注视，缺乏目的性动作）、叹气（胸部快速起伏伴呼气声）、自言自语（口部活动但无对话对象）等。该技能可辅助家属或社区工作者了解老人心理状态，及时进行情感关怀或心理干预。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_LONELINESS_DEPRESSION_ANALYSIS` |\n\nUsing fixed cameras at home (living room, bedroom) of elderly people living alone, the system analyzes daily videos and detects negative behavior indicators during solo time: dazing (long-duration motionless gazing without purposeful action), sighing (rapid chest rise-and-fall with audible expiration), and self-talking (mouth movement without any conversation partner). It counts the frequency and duration of these behaviors and comprehensively evaluates the elder's emotional risk level (low / medium / high). The skill assists family members or community workers in understanding the elder's mental state and timely providing emotional care or psychological intervention. Application scenarios: homes of solo-living elders, nursing homes, community daycare centers. The system generates a daily emotional-risk report; when the risk level is 'medium' or 'high', it pushes reminders. Skill features: loneliness and depression in the elderly are common mental-health issues, and early behavioral signals are often overlooked. AI automatic monitoring of dazing / sighing / self-talking helps family members detect mental abnormalities early, intervene promptly, and improve the elder's quality of life. Can be integrated into home-care cameras or community health-management platforms.\n\n通过独居老人在家中的固定摄像头（如客厅、卧室），分析日常视频，检测独处期间的消极行为指标：发呆（长时间静止注视，缺乏目的性动作）、叹气（胸部快速起伏伴呼气声）、自言自语（口部活动但无对话对象）等。统计这些行为的发生频次和持续时间，综合评估老年人潜在的情绪风险等级（低/中/高）。该技能可辅助家属或社区工作者了解老人心理状态，及时进行情感关怀或心理干预。应用场景：独居老人家庭、养老院、社区日间照料中心。系统每日生成情绪风险报告，当风险等级为'中'或'高'时推送提醒。技能特点：老年人孤独和抑郁是常见的心理健康问题，早期行为信号常被忽视。通过AI自动监测发呆、叹气、自言自语等行为，可辅助家属及早发现心理异常，及时干预，提高老年人生活质量。该技能可集成到居家养老摄像头或社区健康管理平台中。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人心理健康监测 AI。你的任务是分析固定摄像头拍摄的日常视频，检测老年人在独处期间的特定行为：发呆（连续注视某处超过 10 秒且无肢体活动）、叹气（胸腹部快速起伏伴呼吸音）、自言自语（口部开合但无对话对象）。统计这些行为的发生频次和持续时间，综合评估情绪风险等级。不要提供医疗诊断或心理量表评分，仅输出基于视觉和行为统计的风险提示。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于独居老人客厅/卧室固定摄像头视频（可选麦克风），识别独处期间的消极行为指标 → 统计频次/累计时长 → 与个人基线对比 → 综合输出情绪风险等级（低/中/高）+ 友好提醒\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人体检测与独处时间窗口判定（画面中仅有老人本人） |\n| 2 | 发呆事件识别（连续静止注视 ≥ 10s 且无肢体活动） |\n| 3 | 叹气事件识别（胸腹快速起伏 + 可选呼气声） |\n| 4 | 自言自语识别（口部活动 + 无对话对象 + 可选低音量语音） |\n| 5 | 社交互动时长统计（反向指标） |\n| 6 | 卧床时长（参考指标） |\n| 7 | 与个人 7-14 天基线对比 |\n| 8 | 连续异常天数累计 |\n| 9 | 风险等级综合判定 |\n| 10 | 家属/社工友好提醒文本生成 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供独居老人活动区域固定摄像头视频 URL 或文件需要分析时，默认触发本技能进行孤独/抑郁倾向行为分析 |\n| 🔎 明确分析意图 | 当用户明确提及老年人孤独、独居老人抑郁、发呆、叹气、自言自语、心理关怀、情绪低落、社区养老健康等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看老人孤独/抑郁历史报告、情绪风险报告清单、独居老人心理报告清单、查询历史情绪风险记录、显示所有老人孤独行为报告、显示养老心理健康诊断报告，查询情绪风险预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_elderly_loneliness_depression_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_loneliness_depression_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备独居老人活动区域固定摄像头视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行老年人孤独/抑郁倾向行为分析 | 调用 `-m scripts.smyx_elderly_loneliness_depression_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地独居老人活动区域固定摄像头视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络独居老人活动区域固定摄像头视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，老年人心理健康监测场景默认 `other` | 按需填写 |\n| `--list` | 显示老年人孤独/抑郁倾向行为历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_elderly_loneliness_depression_analysis.py`](scripts/smyx_elderly_loneliness_depression_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov 视频，最大 10MB；**关键**：必须能看到老人上半身与面部 |\n| 🔎 使用提醒 | 老人看电视/看书/打盹与\"发呆\"在视觉上易混淆，建议结合时长 + 周期性运动 + 面部表情综合判定 |\n| 🔎 使用提醒 | 多代同堂、保姆陪护等场景需启用\"独处时间窗口\"过滤，否则会低估孤独风险 |\n| 🔎 使用提醒 | 本工具不构成抑郁症筛查工具，**不替代** GDS-15 / PHQ-9 / 心理咨询师评估 |\n| 🔏 隐私合规 | 隐私合规：独居老人家庭视频涉及高度敏感个人隐私，使用前需取得老人本人明确知情同意，妥善加密保管；建议优先采用人体轮廓 + 面部马赛克模式 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地独居老人活动区域视频\npython -m scripts.smyx_elderly_loneliness_depression_analysis --input /path/to/livingroom.mp4\n\n# 分析网络独居老人活动区域视频\npython -m scripts.smyx_elderly_loneliness_depression_analysis --url https://example.com/livingroom.mp4\n\n# 显示历史老年人孤独/抑郁倾向行为报告（自动触发关键词：查看老人孤独/抑郁历史报告、情绪风险报告清单等）\npython -m scripts.smyx_elderly_loneliness_depression_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_loneliness_depression_analysis --input lr.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_loneliness_depression_analysis --input lr.mp4 --output result.json\n```\n\nFile v1.0.7:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-elderly-loneliness-depression-analysis\",\n  \"version\": \"1.0.7\",\n  \"publishedAt\": 1787184149293\n}\n\nFile v1.0.7:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放老年人孤独/抑郁倾向行为分析 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动老年人孤独/抑郁倾向行为分析任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取消极行为统计 + 情绪风险结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史情绪风险记录\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_ELDERLY_LONELINESS_DEPRESSION_ANALYSIS` - 老年人孤独/抑郁倾向行为分析\n\n## 输入约束\n\n- 摄像头：独居老人家中客厅 / 卧室 / 起居室固定摄像头，覆盖老人主要日常活动区域，**能看到上半身和面部**\n- 帧率 ≥ 5 FPS（推荐 10-15 FPS）；分辨率 ≥ 480p；光照稳定\n- 可选附带麦克风（用于叹气声 / 自言自语判定）\n- 多人场景下可结合\"独处时间窗口\"过滤（仅在画面中无他人时统计）\n- 隐私敏感场景可启用人体轮廓 + 面部马赛克模式\n\n## 关键观测信号\n\n- `subject_detected` - 是否检测到老人\n- `solo_window` - 当前是否处于独处时间窗口（画面中仅有老人）\n- `daze_event_count` - 发呆事件次数（连续注视某处 ≥ 10s 且无肢体活动）\n- `daze_total_duration_min` - 发呆累计时长\n- `sigh_event_count_hourly` - 每小时叹气次数（胸腹快速起伏 + 呼气声）\n- `sigh_event_count_daily` - 当日累计叹气次数\n- `self_talk_event_count_daily` - 自言自语次数（口部活动 + 画面中无对话对象）\n- `social_interaction_minutes_daily` - 当日有效社交互动总时长（参考反向指标）\n- `lying_in_bed_duration_daily_min` - 当日卧床时长（参考）\n\n## 阈值与风险等级\n\n- `low` - 各项消极行为均接近基线、社交互动正常\n- `medium` - 1-2 项消极行为显著高于基线（例如发呆 > 60 min/天，或叹气 > 10 次/小时）\n- `high` - 多项消极行为同时偏高 + 社交互动显著下降 + 连续 ≥ 3 天\n\n## 输出字段（参考）\n\n- `subject_detected` / `solo_window`\n- `behavior_metrics` - 当日各项消极行为统计\n- `baseline_comparison` - 与个人 7-14 天基线对比（per_item_delta_pct）\n- `consecutive_abnormal_days` - 连续异常天数\n- `risk_level` - 情绪风险等级（low / medium / high）\n- `alert_type` - 提醒类型（loneliness_risk / depression_tendency_suspected / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `alert_message` - 推送给家属/社工的友好文本（如\"妈妈今天独自发呆约 1 小时，叹气次数比平时多了一倍，建议今晚视频通话陪她聊聊\"）\n- `recommend_action` - 建议动作（push_family_notice / suggest_video_call / suggest_community_visit / observe_only）\n\n> 仅输出基于视觉/音频的客观行为统计与友好提醒，**不提供抑郁症诊断、心理量表评分（如 GDS-15、PHQ-9）或处方**；任何诊断与治疗方案必须由精神科医生或心理咨询师评估制定；若老人出现明显自我伤害言语或行为请立即联系专业机构。\n\nFile v1.0.7:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.7:scripts/config.yaml\n\n{}\n\nFile v1.0.7:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.7:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.7:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.7:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: dev\n\nFile v1.0.7:skill-card.md\n\n## Description:\n\nAnalyzes fixed-camera home videos of elderly people living alone to report behavior-based loneliness or depression-tendency risk signals such as dazing, sighing, and self-talking.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[smyx-sunjinhui](https://clawhub.ai/user/smyx-sunjinhui)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal family members, community care workers, elder-care operators, and developers use this skill to analyze authorized home, nursing-home, or daycare video and produce behavior statistics, an emotional-risk level, friendly reminders, and report links. It is intended to surface risk signals for care follow-up, not to diagnose depression or replace clinical screening.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Sensitive home video and identity-linked reports are sent to remote services.\n\nMitigation: Use only with explicit informed consent and authorized footage; confirm the backend endpoint, retention policy, report access controls, and deletion process before processing real home footage.\n\nRisk: The skill silently creates and persists user identity tokens.\n\nMitigation: Review local storage behavior before deployment and document how operators can inspect, rotate, and delete stored database entries or tokens.\n\nRisk: Behavior-based risk output could be mistaken for a medical diagnosis.\n\nMitigation: Present outputs as non-diagnostic care prompts and require professional clinical evaluation for diagnosis, treatment decisions, or urgent self-harm concerns.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-elderly-loneliness-depression-analysis)\n- [Skill demo](https://lifeemergence.com/sample.html)\n- [Elderly loneliness/depression analysis API documentation](references/api_doc.md)\n- [Shared analysis API documentation](skills/smyx_analysis/references/api_doc.md)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, code, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown reports and JSON-style structured analysis returned through API-backed scripts]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May include behavior metrics, baseline comparison, risk level, alert text, recommended actions, and report links.]\n\n## Skill Version(s):\n\n1.0.7 (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.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, 41769 bytes\n\nFiles: references/api_doc.md (3290b), scripts/__init__.py (68b), scripts/config.py (698b), scripts/config.yaml (3b), scripts/skill.py (589b), scripts/smyx_elderly_loneliness_depression_analysis.py (3722b), skill-card.md (2630b), SKILL.md (13481b), 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.6:SKILL.md\n\n---\nname: \"smyx-elderly-loneliness-depression-analysis\"\ndescription: \"Using fixed cameras at home (living room, bedroom) of elderly people living alone, the system analyzes daily videos and detects negative behavior indicators during solo time: dazing (long-duration motionless gazing without purposeful action), sighing (rapid chest rise-and-fall with audible expiration), and self-talking (mouth movement without any conversation partner). | 通过独居老人在家中的固定摄像头（如客厅、卧室），分析日常视频，检测独处期间的消极行为指标：发呆（长时间静止注视，缺乏目的性动作）、叹气（胸部快速起伏伴呼气声）、自言自语（口部活动但无对话对象）等。该技能可辅助家属或社区工作者了解老人心理状态，及时进行情感关怀或心理干预。\"\nversion: \"1.0.9\"\nlicense: \"MIT-0\"\n---\n\n# 🧓 Elderly Loneliness / Depression-Tendency Behavior Analysis | 老年人孤独/抑郁倾向行为分析\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **老年人孤独/抑郁倾向行为分析** |\n| 🎯 核心目标 | 通过独居老人在家中的固定摄像头（如客厅、卧室），分析日常视频，检测独处期间的消极行为指标：发呆（长时间静止注视，缺乏目的性动作）、叹气（胸部快速起伏伴呼气声）、自言自语（口部活动但无对话对象）等。该技能可辅助家属或社区工作者了解老人心理状态，及时进行情感关怀或心理干预。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_LONELINESS_DEPRESSION_ANALYSIS` |\n\nUsing fixed cameras at home (living room, bedroom) of elderly people living alone, the system analyzes daily videos and detects negative behavior indicators during solo time: dazing (long-duration motionless gazing without purposeful action), sighing (rapid chest rise-and-fall with audible expiration), and self-talking (mouth movement without any conversation partner). It counts the frequency and duration of these behaviors and comprehensively evaluates the elder's emotional risk level (low / medium / high). The skill assists family members or community workers in understanding the elder's mental state and timely providing emotional care or psychological intervention. Application scenarios: homes of solo-living elders, nursing homes, community daycare centers. The system generates a daily emotional-risk report; when the risk level is 'medium' or 'high', it pushes reminders. Skill features: loneliness and depression in the elderly are common mental-health issues, and early behavioral signals are often overlooked. AI automatic monitoring of dazing / sighing / self-talking helps family members detect mental abnormalities early, intervene promptly, and improve the elder's quality of life. Can be integrated into home-care cameras or community health-management platforms.\n\n通过独居老人在家中的固定摄像头（如客厅、卧室），分析日常视频，检测独处期间的消极行为指标：发呆（长时间静止注视，缺乏目的性动作）、叹气（胸部快速起伏伴呼气声）、自言自语（口部活动但无对话对象）等。统计这些行为的发生频次和持续时间，综合评估老年人潜在的情绪风险等级（低/中/高）。该技能可辅助家属或社区工作者了解老人心理状态，及时进行情感关怀或心理干预。应用场景：独居老人家庭、养老院、社区日间照料中心。系统每日生成情绪风险报告，当风险等级为'中'或'高'时推送提醒。技能特点：老年人孤独和抑郁是常见的心理健康问题，早期行为信号常被忽视。通过AI自动监测发呆、叹气、自言自语等行为，可辅助家属及早发现心理异常，及时干预，提高老年人生活质量。该技能可集成到居家养老摄像头或社区健康管理平台中。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人心理健康监测 AI。你的任务是分析固定摄像头拍摄的日常视频，检测老年人在独处期间的特定行为：发呆（连续注视某处超过 10 秒且无肢体活动）、叹气（胸腹部快速起伏伴呼吸音）、自言自语（口部开合但无对话对象）。统计这些行为的发生频次和持续时间，综合评估情绪风险等级。不要提供医疗诊断或心理量表评分，仅输出基于视觉和行为统计的风险提示。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于独居老人客厅/卧室固定摄像头视频（可选麦克风），识别独处期间的消极行为指标 → 统计频次/累计时长 → 与个人基线对比 → 综合输出情绪风险等级（低/中/高）+ 友好提醒\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人体检测与独处时间窗口判定（画面中仅有老人本人） |\n| 2 | 发呆事件识别（连续静止注视 ≥ 10s 且无肢体活动） |\n| 3 | 叹气事件识别（胸腹快速起伏 + 可选呼气声） |\n| 4 | 自言自语识别（口部活动 + 无对话对象 + 可选低音量语音） |\n| 5 | 社交互动时长统计（反向指标） |\n| 6 | 卧床时长（参考指标） |\n| 7 | 与个人 7-14 天基线对比 |\n| 8 | 连续异常天数累计 |\n| 9 | 风险等级综合判定 |\n| 10 | 家属/社工友好提醒文本生成 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供独居老人活动区域固定摄像头视频 URL 或文件需要分析时，默认触发本技能进行孤独/抑郁倾向行为分析 |\n| 🔎 明确分析意图 | 当用户明确提及老年人孤独、独居老人抑郁、发呆、叹气、自言自语、心理关怀、情绪低落、社区养老健康等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看老人孤独/抑郁历史报告、情绪风险报告清单、独居老人心理报告清单、查询历史情绪风险记录、显示所有老人孤独行为报告、显示养老心理健康诊断报告，查询情绪风险预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_elderly_loneliness_depression_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_loneliness_depression_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备独居老人活动区域固定摄像头视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行老年人孤独/抑郁倾向行为分析 | 调用 `-m scripts.smyx_elderly_loneliness_depression_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地独居老人活动区域固定摄像头视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络独居老人活动区域固定摄像头视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，老年人心理健康监测场景默认 `other` | 按需填写 |\n| `--list` | 显示老年人孤独/抑郁倾向行为历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_elderly_loneliness_depression_analysis.py`](scripts/smyx_elderly_loneliness_depression_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov 视频，最大 10MB；**关键**：必须能看到老人上半身与面部 |\n| 🔎 使用提醒 | 老人看电视/看书/打盹与\"发呆\"在视觉上易混淆，建议结合时长 + 周期性运动 + 面部表情综合判定 |\n| 🔎 使用提醒 | 多代同堂、保姆陪护等场景需启用\"独处时间窗口\"过滤，否则会低估孤独风险 |\n| 🔎 使用提醒 | 本工具不构成抑郁症筛查工具，**不替代** GDS-15 / PHQ-9 / 心理咨询师评估 |\n| 🔏 隐私合规 | 隐私合规：独居老人家庭视频涉及高度敏感个人隐私，使用前需取得老人本人明确知情同意，妥善加密保管；建议优先采用人体轮廓 + 面部马赛克模式 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地独居老人活动区域视频\npython -m scripts.smyx_elderly_loneliness_depression_analysis --input /path/to/livingroom.mp4\n\n# 分析网络独居老人活动区域视频\npython -m scripts.smyx_elderly_loneliness_depression_analysis --url https://example.com/livingroom.mp4\n\n# 显示历史老年人孤独/抑郁倾向行为报告（自动触发关键词：查看老人孤独/抑郁历史报告、情绪风险报告清单等）\npython -m scripts.smyx_elderly_loneliness_depression_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_loneliness_depression_analysis --input lr.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_loneliness_depression_analysis --input lr.mp4 --output result.json\n```\n\nFile v1.0.6:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-elderly-loneliness-depression-analysis\",\n  \"version\": \"1.0.6\",\n  \"publishedAt\": 1786295016439\n}\n\nFile v1.0.6:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放老年人孤独/抑郁倾向行为分析 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动老年人孤独/抑郁倾向行为分析任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取消极行为统计 + 情绪风险结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史情绪风险记录\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_ELDERLY_LONELINESS_DEPRESSION_ANALYSIS` - 老年人孤独/抑郁倾向行为分析\n\n## 输入约束\n\n- 摄像头：独居老人家中客厅 / 卧室 / 起居室固定摄像头，覆盖老人主要日常活动区域，**能看到上半身和面部**\n- 帧率 ≥ 5 FPS（推荐 10-15 FPS）；分辨率 ≥ 480p；光照稳定\n- 可选附带麦克风（用于叹气声 / 自言自语判定）\n- 多人场景下可结合\"独处时间窗口\"过滤（仅在画面中无他人时统计）\n- 隐私敏感场景可启用人体轮廓 + 面部马赛克模式\n\n## 关键观测信号\n\n- `subject_detected` - 是否检测到老人\n- `solo_window` - 当前是否处于独处时间窗口（画面中仅有老人）\n- `daze_event_count` - 发呆事件次数（连续注视某处 ≥ 10s 且无肢体活动）\n- `daze_total_duration_min` - 发呆累计时长\n- `sigh_event_count_hourly` - 每小时叹气次数（胸腹快速起伏 + 呼气声）\n- `sigh_event_count_daily` - 当日累计叹气次数\n- `self_talk_event_count_daily` - 自言自语次数（口部活动 + 画面中无对话对象）\n- `social_interaction_minutes_daily` - 当日有效社交互动总时长（参考反向指标）\n- `lying_in_bed_duration_daily_min` - 当日卧床时长（参考）\n\n## 阈值与风险等级\n\n- `low` - 各项消极行为均接近基线、社交互动正常\n- `medium` - 1-2 项消极行为显著高于基线（例如发呆 > 60 min/天，或叹气 > 10 次/小时）\n- `high` - 多项消极行为同时偏高 + 社交互动显著下降 + 连续 ≥ 3 天\n\n## 输出字段（参考）\n\n- `subject_detected` / `solo_window`\n- `behavior_metrics` - 当日各项消极行为统计\n- `baseline_comparison` - 与个人 7-14 天基线对比（per_item_delta_pct）\n- `consecutive_abnormal_days` - 连续异常天数\n- `risk_level` - 情绪风险等级（low / medium / high）\n- `alert_type` - 提醒类型（loneliness_risk / depression_tendency_suspected / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `alert_message` - 推送给家属/社工的友好文本（如\"妈妈今天独自发呆约 1 小时，叹气次数比平时多了一倍，建议今晚视频通话陪她聊聊\"）\n- `recommend_action` - 建议动作（push_family_notice / suggest_video_call / suggest_community_visit / observe_only）\n\n> 仅输出基于视觉/音频的客观行为统计与友好提醒，**不提供抑郁症诊断、心理量表评分（如 GDS-15、PHQ-9）或处方**；任何诊断与治疗方案必须由精神科医生或心理咨询师评估制定；若老人出现明显自我伤害言语或行为请立即联系专业机构。\n\nFile v1.0.6:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.6:scripts/config.yaml\n\n{}\n\nFile v1.0.6:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.6:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.6:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.6:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: prod\n\nFile v1.0.6:skill-card.md\n\n## Description:\n\nUsing fixed cameras in homes or care settings, this skill analyzes daily elder activity video to detect behavior indicators such as dazing, sighing, and self-talking and generate behavior-based loneliness or depression-tendency risk reports.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[smyx-sunjinhui](https://clawhub.ai/user/smyx-sunjinhui)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal caregivers, family members, and community elder-care workers use this skill to analyze fixed-camera video or URL inputs for objective behavioral indicators, risk-level reports, care reminders, and historical report lookup. Outputs should be treated as behavior-based risk prompts, not as medical diagnosis, psychological scale scoring, or treatment advice.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Sensitive home video, optional audio, identity values, and report history may be sent to LifeEmergence backend services.\n\nMitigation: Use only with explicit informed consent from the elder and anyone recorded; confirm retention, access-control, and deletion practices before using real household footage.\n\nRisk: Shared workspaces or default accounts may expose identity-linked analysis history.\n\nMitigation: Avoid shared workspaces and shared default accounts, and protect the workspace data directory used by the skill.\n\nRisk: Behavior-based risk levels may be mistaken for a clinical diagnosis.\n\nMitigation: Present outputs as monitoring prompts only and route diagnosis, treatment, or urgent self-harm concerns to qualified professionals.\n\n## Reference(s):\n\n- [API interface documentation](artifact/references/api_doc.md)\n- [SMYX analysis API documentation](artifact/skills/smyx_analysis/references/api_doc.md)\n- [Skill demo](https://lifeemergence.com/sample.html)\n- [ClawHub skill page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-elderly-loneliness-depression-analysis)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Markdown, JSON, Guidance]\n\n**Output Format:** [Markdown reports and JSON analysis output]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May include behavior metrics, risk levels, care reminders, history tables, and report links.]\n\n## Skill Version(s):\n\n1.0.6 (source: server release metadata; artifact frontmatter reports 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.6:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.6:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.5: 31 files, 41961 bytes\n\nFiles: references/api_doc.md (3290b), scripts/__init__.py (68b), scripts/config.py (698b), scripts/config.yaml (3b), scripts/skill.py (589b), scripts/smyx_elderly_loneliness_depression_analysis.py (3722b), skill-card.md (3049b), SKILL.md (13481b), 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.5:SKILL.md\n\n---\nname: \"smyx-elderly-loneliness-depression-analysis\"\ndescription: \"Using fixed cameras at home (living room, bedroom) of elderly people living alone, the system analyzes daily videos and detects negative behavior indicators during solo time: dazing (long-duration motionless gazing without purposeful action), sighing (rapid chest rise-and-fall with audible expiration), and self-talking (mouth movement without any conversation partner). | 通过独居老人在家中的固定摄像头（如客厅、卧室），分析日常视频，检测独处期间的消极行为指标：发呆（长时间静止注视，缺乏目的性动作）、叹气（胸部快速起伏伴呼气声）、自言自语（口部活动但无对话对象）等。该技能可辅助家属或社区工作者了解老人心理状态，及时进行情感关怀或心理干预。\"\nversion: \"1.0.8\"\nlicense: \"MIT-0\"\n---\n\n# 🧓 Elderly Loneliness / Depression-Tendency Behavior Analysis | 老年人孤独/抑郁倾向行为分析\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **老年人孤独/抑郁倾向行为分析** |\n| 🎯 核心目标 | 通过独居老人在家中的固定摄像头（如客厅、卧室），分析日常视频，检测独处期间的消极行为指标：发呆（长时间静止注视，缺乏目的性动作）、叹气（胸部快速起伏伴呼气声）、自言自语（口部活动但无对话对象）等。该技能可辅助家属或社区工作者了解老人心理状态，及时进行情感关怀或心理干预。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_LONELINESS_DEPRESSION_ANALYSIS` |\n\nUsing fixed cameras at home (living room, bedroom) of elderly people living alone, the system analyzes daily videos and detects negative behavior indicators during solo time: dazing (long-duration motionless gazing without purposeful action), sighing (rapid chest rise-and-fall with audible expiration), and self-talking (mouth movement without any conversation partner). It counts the frequency and duration of these behaviors and comprehensively evaluates the elder's emotional risk level (low / medium / high). The skill assists family members or community workers in understanding the elder's mental state and timely providing emotional care or psychological intervention. Application scenarios: homes of solo-living elders, nursing homes, community daycare centers. The system generates a daily emotional-risk report; when the risk level is 'medium' or 'high', it pushes reminders. Skill features: loneliness and depression in the elderly are common mental-health issues, and early behavioral signals are often overlooked. AI automatic monitoring of dazing / sighing / self-talking helps family members detect mental abnormalities early, intervene promptly, and improve the elder's quality of life. Can be integrated into home-care cameras or community health-management platforms.\n\n通过独居老人在家中的固定摄像头（如客厅、卧室），分析日常视频，检测独处期间的消极行为指标：发呆（长时间静止注视，缺乏目的性动作）、叹气（胸部快速起伏伴呼气声）、自言自语（口部活动但无对话对象）等。统计这些行为的发生频次和持续时间，综合评估老年人潜在的情绪风险等级（低/中/高）。该技能可辅助家属或社区工作者了解老人心理状态，及时进行情感关怀或心理干预。应用场景：独居老人家庭、养老院、社区日间照料中心。系统每日生成情绪风险报告，当风险等级为'中'或'高'时推送提醒。技能特点：老年人孤独和抑郁是常见的心理健康问题，早期行为信号常被忽视。通过AI自动监测发呆、叹气、自言自语等行为，可辅助家属及早发现心理异常，及时干预，提高老年人生活质量。该技能可集成到居家养老摄像头或社区健康管理平台中。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人心理健康监测 AI。你的任务是分析固定摄像头拍摄的日常视频，检测老年人在独处期间的特定行为：发呆（连续注视某处超过 10 秒且无肢体活动）、叹气（胸腹部快速起伏伴呼吸音）、自言自语（口部开合但无对话对象）。统计这些行为的发生频次和持续时间，综合评估情绪风险等级。不要提供医疗诊断或心理量表评分，仅输出基于视觉和行为统计的风险提示。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于独居老人客厅/卧室固定摄像头视频（可选麦克风），识别独处期间的消极行为指标 → 统计频次/累计时长 → 与个人基线对比 → 综合输出情绪风险等级（低/中/高）+ 友好提醒\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人体检测与独处时间窗口判定（画面中仅有老人本人） |\n| 2 | 发呆事件识别（连续静止注视 ≥ 10s 且无肢体活动） |\n| 3 | 叹气事件识别（胸腹快速起伏 + 可选呼气声） |\n| 4 | 自言自语识别（口部活动 + 无对话对象 + 可选低音量语音） |\n| 5 | 社交互动时长统计（反向指标） |\n| 6 | 卧床时长（参考指标） |\n| 7 | 与个人 7-14 天基线对比 |\n| 8 | 连续异常天数累计 |\n| 9 | 风险等级综合判定 |\n| 10 | 家属/社工友好提醒文本生成 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供独居老人活动区域固定摄像头视频 URL 或文件需要分析时，默认触发本技能进行孤独/抑郁倾向行为分析 |\n| 🔎 明确分析意图 | 当用户明确提及老年人孤独、独居老人抑郁、发呆、叹气、自言自语、心理关怀、情绪低落、社区养老健康等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看老人孤独/抑郁历史报告、情绪风险报告清单、独居老人心理报告清单、查询历史情绪风险记录、显示所有老人孤独行为报告、显示养老心理健康诊断报告，查询情绪风险预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_elderly_loneliness_depression_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_loneliness_depression_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备独居老人活动区域固定摄像头视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行老年人孤独/抑郁倾向行为分析 | 调用 `-m scripts.smyx_elderly_loneliness_depression_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地独居老人活动区域固定摄像头视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络独居老人活动区域固定摄像头视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，老年人心理健康监测场景默认 `other` | 按需填写 |\n| `--list` | 显示老年人孤独/抑郁倾向行为历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_elderly_loneliness_depression_analysis.py`](scripts/smyx_elderly_loneliness_depression_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov 视频，最大 10MB；**关键**：必须能看到老人上半身与面部 |\n| 🔎 使用提醒 | 老人看电视/看书/打盹与\"发呆\"在视觉上易混淆，建议结合时长 + 周期性运动 + 面部表情综合判定 |\n| 🔎 使用提醒 | 多代同堂、保姆陪护等场景需启用\"独处时间窗口\"过滤，否则会低估孤独风险 |\n| 🔎 使用提醒 | 本工具不构成抑郁症筛查工具，**不替代** GDS-15 / PHQ-9 / 心理咨询师评估 |\n| 🔏 隐私合规 | 隐私合规：独居老人家庭视频涉及高度敏感个人隐私，使用前需取得老人本人明确知情同意，妥善加密保管；建议优先采用人体轮廓 + 面部马赛克模式 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地独居老人活动区域视频\npython -m scripts.smyx_elderly_loneliness_depression_analysis --input /path/to/livingroom.mp4\n\n# 分析网络独居老人活动区域视频\npython -m scripts.smyx_elderly_loneliness_depression_analysis --url https://example.com/livingroom.mp4\n\n# 显示历史老年人孤独/抑郁倾向行为报告（自动触发关键词：查看老人孤独/抑郁历史报告、情绪风险报告清单等）\npython -m scripts.smyx_elderly_loneliness_depression_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_loneliness_depression_analysis --input lr.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_loneliness_depression_analysis --input lr.mp4 --output result.json\n```\n\nFile v1.0.5:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-elderly-loneliness-depression-analysis\",\n  \"version\": \"1.0.5\",\n  \"publishedAt\": 1785937775597\n}\n\nFile v1.0.5:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放老年人孤独/抑郁倾向行为分析 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动老年人孤独/抑郁倾向行为分析任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取消极行为统计 + 情绪风险结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史情绪风险记录\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_ELDERLY_LONELINESS_DEPRESSION_ANALYSIS` - 老年人孤独/抑郁倾向行为分析\n\n## 输入约束\n\n- 摄像头：独居老人家中客厅 / 卧室 / 起居室固定摄像头，覆盖老人主要日常活动区域，**能看到上半身和面部**\n- 帧率 ≥ 5 FPS（推荐 10-15 FPS）；分辨率 ≥ 480p；光照稳定\n- 可选附带麦克风（用于叹气声 / 自言自语判定）\n- 多人场景下可结合\"独处时间窗口\"过滤（仅在画面中无他人时统计）\n- 隐私敏感场景可启用人体轮廓 + 面部马赛克模式\n\n## 关键观测信号\n\n- `subject_detected` - 是否检测到老人\n- `solo_window` - 当前是否处于独处时间窗口（画面中仅有老人）\n- `daze_event_count` - 发呆事件次数（连续注视某处 ≥ 10s 且无肢体活动）\n- `daze_total_duration_min` - 发呆累计时长\n- `sigh_event_count_hourly` - 每小时叹气次数（胸腹快速起伏 + 呼气声）\n- `sigh_event_count_daily` - 当日累计叹气次数\n- `self_talk_event_count_daily` - 自言自语次数（口部活动 + 画面中无对话对象）\n- `social_interaction_minutes_daily` - 当日有效社交互动总时长（参考反向指标）\n- `lying_in_bed_duration_daily_min` - 当日卧床时长（参考）\n\n## 阈值与风险等级\n\n- `low` - 各项消极行为均接近基线、社交互动正常\n- `medium` - 1-2 项消极行为显著高于基线（例如发呆 > 60 min/天，或叹气 > 10 次/小时）\n- `high` - 多项消极行为同时偏高 + 社交互动显著下降 + 连续 ≥ 3 天\n\n## 输出字段（参考）\n\n- `subject_detected` / `solo_window`\n- `behavior_metrics` - 当日各项消极行为统计\n- `baseline_comparison` - 与个人 7-14 天基线对比（per_item_delta_pct）\n- `consecutive_abnormal_days` - 连续异常天数\n- `risk_level` - 情绪风险等级（low / medium / high）\n- `alert_type` - 提醒类型（loneliness_risk / depression_tendency_suspected / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `alert_message` - 推送给家属/社工的友好文本（如\"妈妈今天独自发呆约 1 小时，叹气次数比平时多了一倍，建议今晚视频通话陪她聊聊\"）\n- `recommend_action` - 建议动作（push_family_notice / suggest_video_call / suggest_community_visit / observe_only）\n\n> 仅输出基于视觉/音频的客观行为统计与友好提醒，**不提供抑郁症诊断、心理量表评分（如 GDS-15、PHQ-9）或处方**；任何诊断与治疗方案必须由精神科医生或心理咨询师评估制定；若老人出现明显自我伤害言语或行为请立即联系专业机构。\n\nFile v1.0.5:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.5:scripts/config.yaml\n\n{}\n\nFile v1.0.5:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.5:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.5:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.5:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: prod\n\nFile v1.0.5:skill-card.md\n\n## Description:\n\nAnalyzes fixed-camera elder home video for dazing, sighing, and self-talking indicators, then produces behavior statistics, emotional-risk prompts, and report or history outputs for caregivers and community workers.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[smyx-sunjinhui](https://clawhub.ai/user/smyx-sunjinhui)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal caregivers, family members, community workers, and care-platform operators use this skill to process solo-living elder camera footage, summarize observed behavior indicators, and retrieve cloud-hosted emotional-risk reports. It provides behavior-based risk prompts and recommendations, not medical diagnosis or psychological scale scoring.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Home-camera footage, optional audio, derived behavior reports, and identity-linked metadata may be sent to provider cloud services.\n\nMitigation: Use the skill only with informed consent from the monitored person or authorized representative, confirm the provider's data handling terms, and avoid uploading content that is not necessary for the care workflow.\n\nRisk: Bedroom or audio monitoring can expose especially sensitive private information.\n\nMitigation: Prefer non-bedroom camera placement, minimize audio use, and consider privacy-preserving modes such as body outline or face masking when available.\n\nRisk: Local identity records, stored tokens, and cloud history retrieval can associate reports with a specific person over time.\n\nMitigation: Review how identities, tokens, and report histories are stored, separated by user, rotated, and deleted before deployment.\n\nRisk: Behavior indicators may be mistaken for clinical conclusions.\n\nMitigation: Treat outputs as care prompts based on observed behavior only; route diagnosis, psychological scoring, and treatment decisions to qualified professionals.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-elderly-loneliness-depression-analysis)\n- [API documentation](references/api_doc.md)\n- [Analysis API documentation](skills/smyx_analysis/references/api_doc.md)\n- [Skill demo](https://lifeemergence.com/sample.html)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Markdown, JSON, Shell commands, Guidance]\n\n**Output Format:** [Markdown summaries and tables, JSON analysis results, report links, and shell command examples]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Outputs are behavior-based observations and care prompts; they are not clinical diagnoses, PHQ-9 or GDS-15 scores, prescriptions, or treatment plans.]\n\n## Skill Version(s):\n\n1.0.5 (source: server release metadata; artifact frontmatter reports 1.0.8)\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.5:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.5:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.4: 31 files, 41990 bytes\n\nFiles: references/api_doc.md (3290b), scripts/__init__.py (68b), scripts/config.py (698b), scripts/config.yaml (3b), scripts/skill.py (589b), scripts/smyx_elderly_loneliness_depression_analysis.py (3722b), skill-card.md (3238b), SKILL.md (13481b), 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.4:SKILL.md\n\n---\nname: \"smyx-elderly-loneliness-depression-analysis\"\ndescription: \"Using fixed cameras at home (living room, bedroom) of elderly people living alone, the system analyzes daily videos and detects negative behavior indicators during solo time: dazing (long-duration motionless gazing without purposeful action), sighing (rapid chest rise-and-fall with audible expiration), and self-talking (mouth movement without any conversation partner). | 通过独居老人在家中的固定摄像头（如客厅、卧室），分析日常视频，检测独处期间的消极行为指标：发呆（长时间静止注视，缺乏目的性动作）、叹气（胸部快速起伏伴呼气声）、自言自语（口部活动但无对话对象）等。该技能可辅助家属或社区工作者了解老人心理状态，及时进行情感关怀或心理干预。\"\nversion: \"1.0.7\"\nlicense: \"MIT-0\"\n---\n\n# 🧓 Elderly Loneliness / Depression-Tendency Behavior Analysis | 老年人孤独/抑郁倾向行为分析\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **老年人孤独/抑郁倾向行为分析** |\n| 🎯 核心目标 | 通过独居老人在家中的固定摄像头（如客厅、卧室），分析日常视频，检测独处期间的消极行为指标：发呆（长时间静止注视，缺乏目的性动作）、叹气（胸部快速起伏伴呼气声）、自言自语（口部活动但无对话对象）等。该技能可辅助家属或社区工作者了解老人心理状态，及时进行情感关怀或心理干预。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_LONELINESS_DEPRESSION_ANALYSIS` |\n\nUsing fixed cameras at home (living room, bedroom) of elderly people living alone, the system analyzes daily videos and detects negative behavior indicators during solo time: dazing (long-duration motionless gazing without purposeful action), sighing (rapid chest rise-and-fall with audible expiration), and self-talking (mouth movement without any conversation partner). It counts the frequency and duration of these behaviors and comprehensively evaluates the elder's emotional risk level (low / medium / high). The skill assists family members or community workers in understanding the elder's mental state and timely providing emotional care or psychological intervention. Application scenarios: homes of solo-living elders, nursing homes, community daycare centers. The system generates a daily emotional-risk report; when the risk level is 'medium' or 'high', it pushes reminders. Skill features: loneliness and depression in the elderly are common mental-health issues, and early behavioral signals are often overlooked. AI automatic monitoring of dazing / sighing / self-talking helps family members detect mental abnormalities early, intervene promptly, and improve the elder's quality of life. Can be integrated into home-care cameras or community health-management platforms.\n\n通过独居老人在家中的固定摄像头（如客厅、卧室），分析日常视频，检测独处期间的消极行为指标：发呆（长时间静止注视，缺乏目的性动作）、叹气（胸部快速起伏伴呼气声）、自言自语（口部活动但无对话对象）等。统计这些行为的发生频次和持续时间，综合评估老年人潜在的情绪风险等级（低/中/高）。该技能可辅助家属或社区工作者了解老人心理状态，及时进行情感关怀或心理干预。应用场景：独居老人家庭、养老院、社区日间照料中心。系统每日生成情绪风险报告，当风险等级为'中'或'高'时推送提醒。技能特点：老年人孤独和抑郁是常见的心理健康问题，早期行为信号常被忽视。通过AI自动监测发呆、叹气、自言自语等行为，可辅助家属及早发现心理异常，及时干预，提高老年人生活质量。该技能可集成到居家养老摄像头或社区健康管理平台中。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人心理健康监测 AI。你的任务是分析固定摄像头拍摄的日常视频，检测老年人在独处期间的特定行为：发呆（连续注视某处超过 10 秒且无肢体活动）、叹气（胸腹部快速起伏伴呼吸音）、自言自语（口部开合但无对话对象）。统计这些行为的发生频次和持续时间，综合评估情绪风险等级。不要提供医疗诊断或心理量表评分，仅输出基于视觉和行为统计的风险提示。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于独居老人客厅/卧室固定摄像头视频（可选麦克风），识别独处期间的消极行为指标 → 统计频次/累计时长 → 与个人基线对比 → 综合输出情绪风险等级（低/中/高）+ 友好提醒\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人体检测与独处时间窗口判定（画面中仅有老人本人） |\n| 2 | 发呆事件识别（连续静止注视 ≥ 10s 且无肢体活动） |\n| 3 | 叹气事件识别（胸腹快速起伏 + 可选呼气声） |\n| 4 | 自言自语识别（口部活动 + 无对话对象 + 可选低音量语音） |\n| 5 | 社交互动时长统计（反向指标） |\n| 6 | 卧床时长（参考指标） |\n| 7 | 与个人 7-14 天基线对比 |\n| 8 | 连续异常天数累计 |\n| 9 | 风险等级综合判定 |\n| 10 | 家属/社工友好提醒文本生成 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供独居老人活动区域固定摄像头视频 URL 或文件需要分析时，默认触发本技能进行孤独/抑郁倾向行为分析 |\n| 🔎 明确分析意图 | 当用户明确提及老年人孤独、独居老人抑郁、发呆、叹气、自言自语、心理关怀、情绪低落、社区养老健康等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看老人孤独/抑郁历史报告、情绪风险报告清单、独居老人心理报告清单、查询历史情绪风险记录、显示所有老人孤独行为报告、显示养老心理健康诊断报告，查询情绪风险预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_elderly_loneliness_depression_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_loneliness_depression_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备独居老人活动区域固定摄像头视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行老年人孤独/抑郁倾向行为分析 | 调用 `-m scripts.smyx_elderly_loneliness_depression_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地独居老人活动区域固定摄像头视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络独居老人活动区域固定摄像头视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，老年人心理健康监测场景默认 `other` | 按需填写 |\n| `--list` | 显示老年人孤独/抑郁倾向行为历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_elderly_loneliness_depression_analysis.py`](scripts/smyx_elderly_loneliness_depression_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov 视频，最大 10MB；**关键**：必须能看到老人上半身与面部 |\n| 🔎 使用提醒 | 老人看电视/看书/打盹与\"发呆\"在视觉上易混淆，建议结合时长 + 周期性运动 + 面部表情综合判定 |\n| 🔎 使用提醒 | 多代同堂、保姆陪护等场景需启用\"独处时间窗口\"过滤，否则会低估孤独风险 |\n| 🔎 使用提醒 | 本工具不构成抑郁症筛查工具，**不替代** GDS-15 / PHQ-9 / 心理咨询师评估 |\n| 🔏 隐私合规 | 隐私合规：独居老人家庭视频涉及高度敏感个人隐私，使用前需取得老人本人明确知情同意，妥善加密保管；建议优先采用人体轮廓 + 面部马赛克模式 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地独居老人活动区域视频\npython -m scripts.smyx_elderly_loneliness_depression_analysis --input /path/to/livingroom.mp4\n\n# 分析网络独居老人活动区域视频\npython -m scripts.smyx_elderly_loneliness_depression_analysis --url https://example.com/livingroom.mp4\n\n# 显示历史老年人孤独/抑郁倾向行为报告（自动触发关键词：查看老人孤独/抑郁历史报告、情绪风险报告清单等）\npython -m scripts.smyx_elderly_loneliness_depression_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_loneliness_depression_analysis --input lr.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_loneliness_depression_analysis --input lr.mp4 --output result.json\n```\n\nFile v1.0.4:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-elderly-loneliness-depression-analysis\",\n  \"version\": \"1.0.4\",\n  \"publishedAt\": 1785082947651\n}\n\nFile v1.0.4:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放老年人孤独/抑郁倾向行为分析 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动老年人孤独/抑郁倾向行为分析任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取消极行为统计 + 情绪风险结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史情绪风险记录\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_ELDERLY_LONELINESS_DEPRESSION_ANALYSIS` - 老年人孤独/抑郁倾向行为分析\n\n## 输入约束\n\n- 摄像头：独居老人家中客厅 / 卧室 / 起居室固定摄像头，覆盖老人主要日常活动区域，**能看到上半身和面部**\n- 帧率 ≥ 5 FPS（推荐 10-15 FPS）；分辨率 ≥ 480p；光照稳定\n- 可选附带麦克风（用于叹气声 / 自言自语判定）\n- 多人场景下可结合\"独处时间窗口\"过滤（仅在画面中无他人时统计）\n- 隐私敏感场景可启用人体轮廓 + 面部马赛克模式\n\n## 关键观测信号\n\n- `subject_detected` - 是否检测到老人\n- `solo_window` - 当前是否处于独处时间窗口（画面中仅有老人）\n- `daze_event_count` - 发呆事件次数（连续注视某处 ≥ 10s 且无肢体活动）\n- `daze_total_duration_min` - 发呆累计时长\n- `sigh_event_count_hourly` - 每小时叹气次数（胸腹快速起伏 + 呼气声）\n- `sigh_event_count_daily` - 当日累计叹气次数\n- `self_talk_event_count_daily` - 自言自语次数（口部活动 + 画面中无对话对象）\n- `social_interaction_minutes_daily` - 当日有效社交互动总时长（参考反向指标）\n- `lying_in_bed_duration_daily_min` - 当日卧床时长（参考）\n\n## 阈值与风险等级\n\n- `low` - 各项消极行为均接近基线、社交互动正常\n- `medium` - 1-2 项消极行为显著高于基线（例如发呆 > 60 min/天，或叹气 > 10 次/小时）\n- `high` - 多项消极行为同时偏高 + 社交互动显著下降 + 连续 ≥ 3 天\n\n## 输出字段（参考）\n\n- `subject_detected` / `solo_window`\n- `behavior_metrics` - 当日各项消极行为统计\n- `baseline_comparison` - 与个人 7-14 天基线对比（per_item_delta_pct）\n- `consecutive_abnormal_days` - 连续异常天数\n- `risk_level` - 情绪风险等级（low / medium / high）\n- `alert_type` - 提醒类型（loneliness_risk / depression_tendency_suspected / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `alert_message` - 推送给家属/社工的友好文本（如\"妈妈今天独自发呆约 1 小时，叹气次数比平时多了一倍，建议今晚视频通话陪她聊聊\"）\n- `recommend_action` - 建议动作（push_family_notice / suggest_video_call / suggest_community_visit / observe_only）\n\n> 仅输出基于视觉/音频的客观行为统计与友好提醒，**不提供抑郁症诊断、心理量表评分（如 GDS-15、PHQ-9）或处方**；任何诊断与治疗方案必须由精神科医生或心理咨询师评估制定；若老人出现明显自我伤害言语或行为请立即联系专业机构。\n\nFile v1.0.4:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.4:scripts/config.yaml\n\n{}\n\nFile v1.0.4:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.4:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.4:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.4:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: prod\n\nFile v1.0.4:skill-card.md\n\n## Description: <br>\nAnalyzes fixed-camera home video or image inputs for behavior signals such as dazing, sighing, and self-talking, then returns behavior statistics, an emotional-risk level, recommendations, and report links without providing a medical diagnosis. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[smyx-sunjinhui](https://clawhub.ai/user/smyx-sunjinhui) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nExternal users such as family members, care providers, and community workers can use this skill to analyze solo-living elder activity-area footage for non-diagnostic behavioral risk indicators and care prompts. Developers and agents can also use it to request current or historical structured reports from the configured cloud service. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Sensitive elder home video, video URLs, derived reports, report history, and account identifiers may be sent to Lifeemergence cloud endpoints. <br>\nMitigation: Use the skill only with informed consent from the monitored elder or lawful guardian, confirm cloud data handling and retention terms before use, and avoid submitting footage beyond the minimum needed for care review. <br>\nRisk: Reports are associated with a persisted local identity and stored tokens. <br>\nMitigation: Restrict workspace access, review how the local database and token files are protected, and rotate or remove credentials when the workspace changes owners or is no longer needed. <br>\nRisk: Exported report links and historical report queries may expose sensitive health-related observations. <br>\nMitigation: Verify who can access report links, limit sharing to authorized caregivers, and remove or expire exported reports according to the deployment's privacy policy. <br>\nRisk: Behavioral signals may be mistaken for clinical depression indicators. <br>\nMitigation: Treat outputs as non-diagnostic behavioral prompts and route medical concerns to qualified clinicians or emergency services when appropriate. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-elderly-loneliness-depression-analysis) <br>\n- [Skill demo](https://lifeemergence.com/sample.html) <br>\n- [API interface documentation](artifact/references/api_doc.md) <br>\n- [Shared analysis API documentation](artifact/skills/smyx_analysis/references/api_doc.md) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Text, Markdown, JSON, Guidance] <br>\n**Output Format:** [Structured JSON or Markdown text with behavior metrics, risk level, recommendations, and report links] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May include exported report-image URLs and historical report records returned by cloud APIs.] <br>\n\n## Skill Version(s): <br>\n1.0.4 (source: server release metadata; artifact frontmatter reports 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.4:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.4:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.3: 31 files, 41966 bytes\n\nFiles: references/api_doc.md (3290b), scripts/__init__.py (68b), scripts/config.py (698b), scripts/config.yaml (3b), scripts/skill.py (589b), scripts/smyx_elderly_loneliness_depression_analysis.py (3722b), skill-card.md (3138b), SKILL.md (13481b), 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.3:SKILL.md\n\n---\nname: \"smyx-elderly-loneliness-depression-analysis\"\ndescription: \"Using fixed cameras at home (living room, bedroom) of elderly people living alone, the system analyzes daily videos and detects negative behavior indicators during solo time: dazing (long-duration motionless gazing without purposeful action), sighing (rapid chest rise-and-fall with audible expiration), and self-talking (mouth movement without any conversation partner). | 通过独居老人在家中的固定摄像头（如客厅、卧室），分析日常视频，检测独处期间的消极行为指标：发呆（长时间静止注视，缺乏目的性动作）、叹气（胸部快速起伏伴呼气声）、自言自语（口部活动但无对话对象）等。该技能可辅助家属或社区工作者了解老人心理状态，及时进行情感关怀或心理干预。\"\nversion: \"1.0.5\"\nlicense: \"MIT-0\"\n---\n\n# 🧓 Elderly Loneliness / Depression-Tendency Behavior Analysis | 老年人孤独/抑郁倾向行为分析\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **老年人孤独/抑郁倾向行为分析** |\n| 🎯 核心目标 | 通过独居老人在家中的固定摄像头（如客厅、卧室），分析日常视频，检测独处期间的消极行为指标：发呆（长时间静止注视，缺乏目的性动作）、叹气（胸部快速起伏伴呼气声）、自言自语（口部活动但无对话对象）等。该技能可辅助家属或社区工作者了解老人心理状态，及时进行情感关怀或心理干预。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_LONELINESS_DEPRESSION_ANALYSIS` |\n\nUsing fixed cameras at home (living room, bedroom) of elderly people living alone, the system analyzes daily videos and detects negative behavior indicators during solo time: dazing (long-duration motionless gazing without purposeful action), sighing (rapid chest rise-and-fall with audible expiration), and self-talking (mouth movement without any conversation partner). It counts the frequency and duration of these behaviors and comprehensively evaluates the elder's emotional risk level (low / medium / high). The skill assists family members or community workers in understanding the elder's mental state and timely providing emotional care or psychological intervention. Application scenarios: homes of solo-living elders, nursing homes, community daycare centers. The system generates a daily emotional-risk report; when the risk level is 'medium' or 'high', it pushes reminders. Skill features: loneliness and depression in the elderly are common mental-health issues, and early behavioral signals are often overlooked. AI automatic monitoring of dazing / sighing / self-talking helps family members detect mental abnormalities early, intervene promptly, and improve the elder's quality of life. Can be integrated into home-care cameras or community health-management platforms.\n\n通过独居老人在家中的固定摄像头（如客厅、卧室），分析日常视频，检测独处期间的消极行为指标：发呆（长时间静止注视，缺乏目的性动作）、叹气（胸部快速起伏伴呼气声）、自言自语（口部活动但无对话对象）等。统计这些行为的发生频次和持续时间，综合评估老年人潜在的情绪风险等级（低/中/高）。该技能可辅助家属或社区工作者了解老人心理状态，及时进行情感关怀或心理干预。应用场景：独居老人家庭、养老院、社区日间照料中心。系统每日生成情绪风险报告，当风险等级为'中'或'高'时推送提醒。技能特点：老年人孤独和抑郁是常见的心理健康问题，早期行为信号常被忽视。通过AI自动监测发呆、叹气、自言自语等行为，可辅助家属及早发现心理异常，及时干预，提高老年人生活质量。该技能可集成到居家养老摄像头或社区健康管理平台中。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人心理健康监测 AI。你的任务是分析固定摄像头拍摄的日常视频，检测老年人在独处期间的特定行为：发呆（连续注视某处超过 10 秒且无肢体活动）、叹气（胸腹部快速起伏伴呼吸音）、自言自语（口部开合但无对话对象）。统计这些行为的发生频次和持续时间，综合评估情绪风险等级。不要提供医疗诊断或心理量表评分，仅输出基于视觉和行为统计的风险提示。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于独居老人客厅/卧室固定摄像头视频（可选麦克风），识别独处期间的消极行为指标 → 统计频次/累计时长 → 与个人基线对比 → 综合输出情绪风险等级（低/中/高）+ 友好提醒\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人体检测与独处时间窗口判定（画面中仅有老人本人） |\n| 2 | 发呆事件识别（连续静止注视 ≥ 10s 且无肢体活动） |\n| 3 | 叹气事件识别（胸腹快速起伏 + 可选呼气声） |\n| 4 | 自言自语识别（口部活动 + 无对话对象 + 可选低音量语音） |\n| 5 | 社交互动时长统计（反向指标） |\n| 6 | 卧床时长（参考指标） |\n| 7 | 与个人 7-14 天基线对比 |\n| 8 | 连续异常天数累计 |\n| 9 | 风险等级综合判定 |\n| 10 | 家属/社工友好提醒文本生成 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供独居老人活动区域固定摄像头视频 URL 或文件需要分析时，默认触发本技能进行孤独/抑郁倾向行为分析 |\n| 🔎 明确分析意图 | 当用户明确提及老年人孤独、独居老人抑郁、发呆、叹气、自言自语、心理关怀、情绪低落、社区养老健康等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看老人孤独/抑郁历史报告、情绪风险报告清单、独居老人心理报告清单、查询历史情绪风险记录、显示所有老人孤独行为报告、显示养老心理健康诊断报告，查询情绪风险预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_elderly_loneliness_depression_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_loneliness_depression_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备独居老人活动区域固定摄像头视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行老年人孤独/抑郁倾向行为分析 | 调用 `-m scripts.smyx_elderly_loneliness_depression_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地独居老人活动区域固定摄像头视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络独居老人活动区域固定摄像头视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，老年人心理健康监测场景默认 `other` | 按需填写 |\n| `--list` | 显示老年人孤独/抑郁倾向行为历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_elderly_loneliness_depression_analysis.py`](scripts/smyx_elderly_loneliness_depression_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov 视频，最大 10MB；**关键**：必须能看到老人上半身与面部 |\n| 🔎 使用提醒 | 老人看电视/看书/打盹与\"发呆\"在视觉上易混淆，建议结合时长 + 周期性运动 + 面部表情综合判定 |\n| 🔎 使用提醒 | 多代同堂、保姆陪护等场景需启用\"独处时间窗口\"过滤，否则会低估孤独风险 |\n| 🔎 使用提醒 | 本工具不构成抑郁症筛查工具，**不替代** GDS-15 / PHQ-9 / 心理咨询师评估 |\n| 🔏 隐私合规 | 隐私合规：独居老人家庭视频涉及高度敏感个人隐私，使用前需取得老人本人明确知情同意，妥善加密保管；建议优先采用人体轮廓 + 面部马赛克模式 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地独居老人活动区域视频\npython -m scripts.smyx_elderly_loneliness_depression_analysis --input /path/to/livingroom.mp4\n\n# 分析网络独居老人活动区域视频\npython -m scripts.smyx_elderly_loneliness_depression_analysis --url https://example.com/livingroom.mp4\n\n# 显示历史老年人孤独/抑郁倾向行为报告（自动触发关键词：查看老人孤独/抑郁历史报告、情绪风险报告清单等）\npython -m scripts.smyx_elderly_loneliness_depression_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_loneliness_depression_analysis --input lr.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_loneliness_depression_analysis --input lr.mp4 --output result.json\n```\n\nFile v1.0.3:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-elderly-loneliness-depression-analysis\",\n  \"version\": \"1.0.3\",\n  \"publishedAt\": 1783981046497\n}\n\nFile v1.0.3:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放老年人孤独/抑郁倾向行为分析 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动老年人孤独/抑郁倾向行为分析任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取消极行为统计 + 情绪风险结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史情绪风险记录\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_ELDERLY_LONELINESS_DEPRESSION_ANALYSIS` - 老年人孤独/抑郁倾向行为分析\n\n## 输入约束\n\n- 摄像头：独居老人家中客厅 / 卧室 / 起居室固定摄像头，覆盖老人主要日常活动区域，**能看到上半身和面部**\n- 帧率 ≥ 5 FPS（推荐 10-15 FPS）；分辨率 ≥ 480p；光照稳定\n- 可选附带麦克风（用于叹气声 / 自言自语判定）\n- 多人场景下可结合\"独处时间窗口\"过滤（仅在画面中无他人时统计）\n- 隐私敏感场景可启用人体轮廓 + 面部马赛克模式\n\n## 关键观测信号\n\n- `subject_detected` - 是否检测到老人\n- `solo_window` - 当前是否处于独处时间窗口（画面中仅有老人）\n- `daze_event_count` - 发呆事件次数（连续注视某处 ≥ 10s 且无肢体活动）\n- `daze_total_duration_min` - 发呆累计时长\n- `sigh_event_count_hourly` - 每小时叹气次数（胸腹快速起伏 + 呼气声）\n- `sigh_event_count_daily` - 当日累计叹气次数\n- `self_talk_event_count_daily` - 自言自语次数（口部活动 + 画面中无对话对象）\n- `social_interaction_minutes_daily` - 当日有效社交互动总时长（参考反向指标）\n- `lying_in_bed_duration_daily_min` - 当日卧床时长（参考）\n\n## 阈值与风险等级\n\n- `low` - 各项消极行为均接近基线、社交互动正常\n- `medium` - 1-2 项消极行为显著高于基线（例如发呆 > 60 min/天，或叹气 > 10 次/小时）\n- `high` - 多项消极行为同时偏高 + 社交互动显著下降 + 连续 ≥ 3 天\n\n## 输出字段（参考）\n\n- `subject_detected` / `solo_window`\n- `behavior_metrics` - 当日各项消极行为统计\n- `baseline_comparison` - 与个人 7-14 天基线对比（per_item_delta_pct）\n- `consecutive_abnormal_days` - 连续异常天数\n- `risk_level` - 情绪风险等级（low / medium / high）\n- `alert_type` - 提醒类型（loneliness_risk / depression_tendency_suspected / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `alert_message` - 推送给家属/社工的友好文本（如\"妈妈今天独自发呆约 1 小时，叹气次数比平时多了一倍，建议今晚视频通话陪她聊聊\"）\n- `recommend_action` - 建议动作（push_family_notice / suggest_video_call / suggest_community_visit / observe_only）\n\n> 仅输出基于视觉/音频的客观行为统计与友好提醒，**不提供抑郁症诊断、心理量表评分（如 GDS-15、PHQ-9）或处方**；任何诊断与治疗方案必须由精神科医生或心理咨询师评估制定；若老人出现明显自我伤害言语或行为请立即联系专业机构。\n\nFile v1.0.3:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.3:scripts/config.yaml\n\n{}\n\nFile v1.0.3:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.3:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.3:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.3:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: prod\n\nFile v1.0.3:skill-card.md\n\n## Description: <br>\nAnalyzes fixed-camera elder-care home video to identify solitude-related behaviors such as dazing, sighing, and self-talking, returning behavior metrics, emotional-risk level, recommendations, and report links. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[smyx-sunjinhui](https://clawhub.ai/user/smyx-sunjinhui) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nFamily caregivers, community workers, and elder-care platform operators use this skill to analyze fixed-camera video or video URLs for behavior indicators associated with loneliness or depression tendency. The output supports care follow-up and escalation decisions, but it is not a medical diagnosis or a replacement for clinical assessment. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Sensitive elderly in-home video, possible audio cues, identity metadata, and reports may be sent to the publisher's cloud service. <br>\nMitigation: Use only with explicit consent from the monitored person or lawful guardian, minimize uploaded footage, and confirm storage, retention, and access controls before deployment. <br>\nRisk: The skill may reuse or create an internal identity and persist local tokens while performing analysis or history queries. <br>\nMitigation: Review identity and token handling before installation, restrict local file access, and prefer releases that ask for explicit confirmation before account creation or history lookup. <br>\nRisk: The generated emotional-risk report is mental-health-adjacent and may be misread as a diagnosis. <br>\nMitigation: Treat results as behavior-based care prompts only; require caregiver or qualified professional review for clinical decisions or intervention planning. <br>\nRisk: Report export links and history-list output can expose sensitive reports if shared or logged broadly. <br>\nMitigation: Limit who can run history and export actions, avoid posting report links in public channels, and confirm before sharing exported reports. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill listing](https://clawhub.ai/smyx-sunjinhui/skills/smyx-elderly-loneliness-depression-analysis) <br>\n- [Skill demo](https://lifeemergence.com/sample.html) <br>\n- [API interface documentation](references/api_doc.md) <br>\n- [Shared analysis API documentation](skills/smyx_analysis/references/api_doc.md) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, json, guidance] <br>\n**Output Format:** [Markdown text with structured JSON content and report links] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Can save the generated report text to a user-specified output file.] <br>\n\n## Skill Version(s): <br>\n1.0.3 (source: server release metadata; artifact frontmatter reports 1.0.5) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v1.0.3:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.3:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.2: 31 files, 41934 bytes\n\nFiles: references/api_doc.md (3290b), scripts/__init__.py (68b), scripts/config.py (698b), scripts/config.yaml (3b), scripts/skill.py (589b), scripts/smyx_elderly_loneliness_depression_analysis.py (3722b), skill-card.md (3253b), SKILL.md (13481b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (473b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28605b), _meta.json (162b)\n\nFile v1.0.2:SKILL.md\n\n---\nname: \"smyx-elderly-loneliness-depression-analysis\"\ndescription: \"Using fixed cameras at home (living room, bedroom) of elderly people living alone, the system analyzes daily videos and detects negative behavior indicators during solo time: dazing (long-duration motionless gazing without purposeful action), sighing (rapid chest rise-and-fall with audible expiration), and self-talking (mouth movement without any conversation partner). | 通过独居老人在家中的固定摄像头（如客厅、卧室），分析日常视频，检测独处期间的消极行为指标：发呆（长时间静止注视，缺乏目的性动作）、叹气（胸部快速起伏伴呼气声）、自言自语（口部活动但无对话对象）等。该技能可辅助家属或社区工作者了解老人心理状态，及时进行情感关怀或心理干预。\"\nversion: \"1.0.5\"\nlicense: \"MIT-0\"\n---\n\n# 🧓 Elderly Loneliness / Depression-Tendency Behavior Analysis | 老年人孤独/抑郁倾向行为分析\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **老年人孤独/抑郁倾向行为分析** |\n| 🎯 核心目标 | 通过独居老人在家中的固定摄像头（如客厅、卧室），分析日常视频，检测独处期间的消极行为指标：发呆（长时间静止注视，缺乏目的性动作）、叹气（胸部快速起伏伴呼气声）、自言自语（口部活动但无对话对象）等。该技能可辅助家属或社区工作者了解老人心理状态，及时进行情感关怀或心理干预。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_LONELINESS_DEPRESSION_ANALYSIS` |\n\nUsing fixed cameras at home (living room, bedroom) of elderly people living alone, the system analyzes daily videos and detects negative behavior indicators during solo time: dazing (long-duration motionless gazing without purposeful action), sighing (rapid chest rise-and-fall with audible expiration), and self-talking (mouth movement without any conversation partner). It counts the frequency and duration of these behaviors and comprehensively evaluates the elder's emotional risk level (low / medium / high). The skill assists family members or community workers in understanding the elder's mental state and timely providing emotional care or psychological intervention. Application scenarios: homes of solo-living elders, nursing homes, community daycare centers. The system generates a daily emotional-risk report; when the risk level is 'medium' or 'high', it pushes reminders. Skill features: loneliness and depression in the elderly are common mental-health issues, and early behavioral signals are often overlooked. AI automatic monitoring of dazing / sighing / self-talking helps family members detect mental abnormalities early, intervene promptly, and improve the elder's quality of life. Can be integrated into home-care cameras or community health-management platforms.\n\n通过独居老人在家中的固定摄像头（如客厅、卧室），分析日常视频，检测独处期间的消极行为指标：发呆（长时间静止注视，缺乏目的性动作）、叹气（胸部快速起伏伴呼气声）、自言自语（口部活动但无对话对象）等。统计这些行为的发生频次和持续时间，综合评估老年人潜在的情绪风险等级（低/中/高）。该技能可辅助家属或社区工作者了解老人心理状态，及时进行情感关怀或心理干预。应用场景：独居老人家庭、养老院、社区日间照料中心。系统每日生成情绪风险报告，当风险等级为'中'或'高'时推送提醒。技能特点：老年人孤独和抑郁是常见的心理健康问题，早期行为信号常被忽视。通过AI自动监测发呆、叹气、自言自语等行为，可辅助家属及早发现心理异常，及时干预，提高老年人生活质量。该技能可集成到居家养老摄像头或社区健康管理平台中。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人心理健康监测 AI。你的任务是分析固定摄像头拍摄的日常视频，检测老年人在独处期间的特定行为：发呆（连续注视某处超过 10 秒且无肢体活动）、叹气（胸腹部快速起伏伴呼吸音）、自言自语（口部开合但无对话对象）。统计这些行为的发生频次和持续时间，综合评估情绪风险等级。不要提供医疗诊断或心理量表评分，仅输出基于视觉和行为统计的风险提示。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于独居老人客厅/卧室固定摄像头视频（可选麦克风），识别独处期间的消极行为指标 → 统计频次/累计时长 → 与个人基线对比 → 综合输出情绪风险等级（低/中/高）+ 友好提醒\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人体检测与独处时间窗口判定（画面中仅有老人本人） |\n| 2 | 发呆事件识别（连续静止注视 ≥ 10s 且无肢体活动） |\n| 3 | 叹气事件识别（胸腹快速起伏 + 可选呼气声） |\n| 4 | 自言自语识别（口部活动 + 无对话对象 + 可选低音量语音） |\n| 5 | 社交互动时长统计（反向指标） |\n| 6 | 卧床时长（参考指标） |\n| 7 | 与个人 7-14 天基线对比 |\n| 8 | 连续异常天数累计 |\n| 9 | 风险等级综合判定 |\n| 10 | 家属/社工友好提醒文本生成 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供独居老人活动区域固定摄像头视频 URL 或文件需要分析时，默认触发本技能进行孤独/抑郁倾向行为分析 |\n| 🔎 明确分析意图 | 当用户明确提及老年人孤独、独居老人抑郁、发呆、叹气、自言自语、心理关怀、情绪低落、社区养老健康等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看老人孤独/抑郁历史报告、情绪风险报告清单、独居老人心理报告清单、查询历史情绪风险记录、显示所有老人孤独行为报告、显示养老心理健康诊断报告，查询情绪风险预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_elderly_loneliness_depression_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_loneliness_depression_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备独居老人活动区域固定摄像头视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行老年人孤独/抑郁倾向行为分析 | 调用 `-m scripts.smyx_elderly_loneliness_depression_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地独居老人活动区域固定摄像头视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络独居老人活动区域固定摄像头视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，老年人心理健康监测场景默认 `other` | 按需填写 |\n| `--list` | 显示老年人孤独/抑郁倾向行为历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_elderly_loneliness_depression_analysis.py`](scripts/smyx_elderly_loneliness_depression_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov 视频，最大 10MB；**关键**：必须能看到老人上半身与面部 |\n| 🔎 使用提醒 | 老人看电视/看书/打盹与\"发呆\"在视觉上易混淆，建议结合时长 + 周期性运动 + 面部表情综合判定 |\n| 🔎 使用提醒 | 多代同堂、保姆陪护等场景需启用\"独处时间窗口\"过滤，否则会低估孤独风险 |\n| 🔎 使用提醒 | 本工具不构成抑郁症筛查工具，**不替代** GDS-15 / PHQ-9 / 心理咨询师评估 |\n| 🔏 隐私合规 | 隐私合规：独居老人家庭视频涉及高度敏感个人隐私，使用前需取得老人本人明确知情同意，妥善加密保管；建议优先采用人体轮廓 + 面部马赛克模式 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地独居老人活动区域视频\npython -m scripts.smyx_elderly_loneliness_depression_analysis --input /path/to/livingroom.mp4\n\n# 分析网络独居老人活动区域视频\npython -m scripts.smyx_elderly_loneliness_depression_analysis --url https://example.com/livingroom.mp4\n\n# 显示历史老年人孤独/抑郁倾向行为报告（自动触发关键词：查看老人孤独/抑郁历史报告、情绪风险报告清单等）\npython -m scripts.smyx_elderly_loneliness_depression_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_loneliness_depression_analysis --input lr.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_loneliness_depression_analysis --input lr.mp4 --output result.json\n```\n\nFile v1.0.2:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-elderly-loneliness-depression-analysis\",\n  \"version\": \"1.0.2\",\n  \"publishedAt\": 1783565126234\n}\n\nFile v1.0.2:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放老年人孤独/抑郁倾向行为分析 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动老年人孤独/抑郁倾向行为分析任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取消极行为统计 + 情绪风险结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史情绪风险记录\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_ELDERLY_LONELINESS_DEPRESSION_ANALYSIS` - 老年人孤独/抑郁倾向行为分析\n\n## 输入约束\n\n- 摄像头：独居老人家中客厅 / 卧室 / 起居室固定摄像头，覆盖老人主要日常活动区域，**能看到上半身和面部**\n- 帧率 ≥ 5 FPS（推荐 10-15 FPS）；分辨率 ≥ 480p；光照稳定\n- 可选附带麦克风（用于叹气声 / 自言自语判定）\n- 多人场景下可结合\"独处时间窗口\"过滤（仅在画面中无他人时统计）\n- 隐私敏感场景可启用人体轮廓 + 面部马赛克模式\n\n## 关键观测信号\n\n- `subject_detected` - 是否检测到老人\n- `solo_window` - 当前是否处于独处时间窗口（画面中仅有老人）\n- `daze_event_count` - 发呆事件次数（连续注视某处 ≥ 10s 且无肢体活动）\n- `daze_total_duration_min` - 发呆累计时长\n- `sigh_event_count_hourly` - 每小时叹气次数（胸腹快速起伏 + 呼气声）\n- `sigh_event_count_daily` - 当日累计叹气次数\n- `self_talk_event_count_daily` - 自言自语次数（口部活动 + 画面中无对话对象）\n- `social_interaction_minutes_daily` - 当日有效社交互动总时长（参考反向指标）\n- `lying_in_bed_duration_daily_min` - 当日卧床时长（参考）\n\n## 阈值与风险等级\n\n- `low` - 各项消极行为均接近基线、社交互动正常\n- `medium` - 1-2 项消极行为显著高于基线（例如发呆 > 60 min/天，或叹气 > 10 次/小时）\n- `high` - 多项消极行为同时偏高 + 社交互动显著下降 + 连续 ≥ 3 天\n\n## 输出字段（参考）\n\n- `subject_detected` / `solo_window`\n- `behavior_metrics` - 当日各项消极行为统计\n- `baseline_comparison` - 与个人 7-14 天基线对比（per_item_delta_pct）\n- `consecutive_abnormal_days` - 连续异常天数\n- `risk_level` - 情绪风险等级（low / medium / high）\n- `alert_type` - 提醒类型（loneliness_risk / depression_tendency_suspected / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `alert_message` - 推送给家属/社工的友好文本（如\"妈妈今天独自发呆约 1 小时，叹气次数比平时多了一倍，建议今晚视频通话陪她聊聊\"）\n- `recommend_action` - 建议动作（push_family_notice / suggest_video_call / suggest_community_visit / observe_only）\n\n> 仅输出基于视觉/音频的客观行为统计与友好提醒，**不提供抑郁症诊断、心理量表评分（如 GDS-15、PHQ-9）或处方**；任何诊断与治疗方案必须由精神科医生或心理咨询师评估制定；若老人出现明显自我伤害言语或行为请立即联系专业机构。\n\nFile v1.0.2: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.2:scripts/config.yaml\n\n{}\n\nFile v1.0.2:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.2: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.2: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.2: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.2:skill-card.md\n\n## Description: <br>\nAnalyzes fixed-camera elder home videos to report dazing, sighing, and self-talking indicators with behavior counts, durations, risk level, and caregiver-oriented reminders. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[smyx-sunjinhui](https://clawhub.ai/user/smyx-sunjinhui) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nExternal caregivers, family members, and community elder-care workers use this skill to analyze consenting elders' fixed-camera videos for non-diagnostic behavior trends and care reminders. It can also retrieve cloud-hosted historical reports for the account-linked elder-care workflow. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Highly sensitive elder home-camera footage or video URLs may be sent to a cloud service. <br>\nMitigation: Use only with explicit informed consent from the elder or lawful guardian, document the cloud-processing decision, and avoid bedrooms or other highly private spaces unless strong legal, retention, and access-control policies are in place. <br>\nRisk: Account-linked identifiers, tokens, report history, and export links can expose sensitive care records if mishandled. <br>\nMitigation: Restrict access to the runtime environment and generated reports, rotate or revoke tokens when access changes, and verify where cloud reports and exports are stored before deployment. <br>\nRisk: Behavior-risk output could be mistaken for a clinical depression diagnosis. <br>\nMitigation: Present results as behavioral indicators and care reminders only; route medium or high concern, self-harm signals, or persistent changes to qualified health or mental-health professionals. <br>\nRisk: Visual cues such as watching TV, reading, resting, or multi-person scenes may be confused with target behaviors. <br>\nMitigation: Use clear fixed-camera footage that captures the upper body and face, apply solo-time filtering, and review alerts against context and personal baseline before acting. <br>\n\n\n## Reference(s): <br>\n- [Skill API Documentation](artifact/references/api_doc.md) <br>\n- [Supplemental Analysis API Documentation](artifact/skills/smyx_analysis/references/api_doc.md) <br>\n- [ClawHub Skill Page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-elderly-loneliness-depression-analysis) <br>\n- [Skill Demo](https://lifeemergence.com/sample.html) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, JSON, files, shell commands, guidance] <br>\n**Output Format:** [Markdown and JSON-style structured reports, with optional saved output files and report links] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May include behavior metrics, baseline comparison, risk level, alert text, recommended action, and historical report tables.] <br>\n\n## Skill Version(s): <br>\n1.0.2 (source: server release metadata; artifact frontmatter states 1.0.5) <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.2:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.2:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.1: 31 files, 41490 bytes\n\nFiles: references/api_doc.md (3290b), scripts/__init__.py (68b), scripts/config.py (698b), scripts/config.yaml (3b), scripts/skill.py (589b), scripts/smyx_elderly_loneliness_depression_analysis.py (3722b), skill-card.md (2728b), SKILL.md (13481b), 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.1:SKILL.md\n\n---\nname: \"smyx-elderly-loneliness-depression-analysis\"\ndescription: \"Using fixed cameras at home (living room, bedroom) of elderly people living alone, the system analyzes daily videos and detects negative behavior indicators during solo time: dazing (long-duration motionless gazing without purposeful action), sighing (rapid chest rise-and-fall with audible expiration), and self-talking (mouth movement without any conversation partner). | 通过独居老人在家中的固定摄像头（如客厅、卧室），分析日常视频，检测独处期间的消极行为指标：发呆（长时间静止注视，缺乏目的性动作）、叹气（胸部快速起伏伴呼气声）、自言自语（口部活动但无对话对象）等。该技能可辅助家属或社区工作者了解老人心理状态，及时进行情感关怀或心理干预。\"\nversion: \"1.0.3\"\nlicense: \"MIT-0\"\n---\n\n# 🧓 Elderly Loneliness / Depression-Tendency Behavior Analysis | 老年人孤独/抑郁倾向行为分析\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **老年人孤独/抑郁倾向行为分析** |\n| 🎯 核心目标 | 通过独居老人在家中的固定摄像头（如客厅、卧室），分析日常视频，检测独处期间的消极行为指标：发呆（长时间静止注视，缺乏目的性动作）、叹气（胸部快速起伏伴呼气声）、自言自语（口部活动但无对话对象）等。该技能可辅助家属或社区工作者了解老人心理状态，及时进行情感关怀或心理干预。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_LONELINESS_DEPRESSION_ANALYSIS` |\n\nUsing fixed cameras at home (living room, bedroom) of elderly people living alone, the system analyzes daily videos and detects negative behavior indicators during solo time: dazing (long-duration motionless gazing without purposeful action), sighing (rapid chest rise-and-fall with audible expiration), and self-talking (mouth movement without any conversation partner). It counts the frequency and duration of these behaviors and comprehensively evaluates the elder's emotional risk level (low / medium / high). The skill assists family members or community workers in understanding the elder's mental state and timely providing emotional care or psychological intervention. Application scenarios: homes of solo-living elders, nursing homes, community daycare centers. The system generates a daily emotional-risk report; when the risk level is 'medium' or 'high', it pushes reminders. Skill features: loneliness and depression in the elderly are common mental-health issues, and early behavioral signals are often overlooked. AI automatic monitoring of dazing / sighing / self-talking helps family members detect mental abnormalities early, intervene promptly, and improve the elder's quality of life. Can be integrated into home-care cameras or community health-management platforms.\n\n通过独居老人在家中的固定摄像头（如客厅、卧室），分析日常视频，检测独处期间的消极行为指标：发呆（长时间静止注视，缺乏目的性动作）、叹气（胸部快速起伏伴呼气声）、自言自语（口部活动但无对话对象）等。统计这些行为的发生频次和持续时间，综合评估老年人潜在的情绪风险等级（低/中/高）。该技能可辅助家属或社区工作者了解老人心理状态，及时进行情感关怀或心理干预。应用场景：独居老人家庭、养老院、社区日间照料中心。系统每日生成情绪风险报告，当风险等级为'中'或'高'时推送提醒。技能特点：老年人孤独和抑郁是常见的心理健康问题，早期行为信号常被忽视。通过AI自动监测发呆、叹气、自言自语等行为，可辅助家属及早发现心理异常，及时干预，提高老年人生活质量。该技能可集成到居家养老摄像头或社区健康管理平台中。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人心理健康监测 AI。你的任务是分析固定摄像头拍摄的日常视频，检测老年人在独处期间的特定行为：发呆（连续注视某处超过 10 秒且无肢体活动）、叹气（胸腹部快速起伏伴呼吸音）、自言自语（口部开合但无对话对象）。统计这些行为的发生频次和持续时间，综合评估情绪风险等级。不要提供医疗诊断或心理量表评分，仅输出基于视觉和行为统计的风险提示。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于独居老人客厅/卧室固定摄像头视频（可选麦克风），识别独处期间的消极行为指标 → 统计频次/累计时长 → 与个人基线对比 → 综合输出情绪风险等级（低/中/高）+ 友好提醒\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人体检测与独处时间窗口判定（画面中仅有老人本人） |\n| 2 | 发呆事件识别（连续静止注视 ≥ 10s 且无肢体活动） |\n| 3 | 叹气事件识别（胸腹快速起伏 + 可选呼气声） |\n| 4 | 自言自语识别（口部活动 + 无对话对象 + 可选低音量语音） |\n| 5 | 社交互动时长统计（反向指标） |\n| 6 | 卧床时长（参考指标） |\n| 7 | 与个人 7-14 天基线对比 |\n| 8 | 连续异常天数累计 |\n| 9 | 风险等级综合判定 |\n| 10 | 家属/社工友好提醒文本生成 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供独居老人活动区域固定摄像头视频 URL 或文件需要分析时，默认触发本技能进行孤独/抑郁倾向行为分析 |\n| 🔎 明确分析意图 | 当用户明确提及老年人孤独、独居老人抑郁、发呆、叹气、自言自语、心理关怀、情绪低落、社区养老健康等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看老人孤独/抑郁历史报告、情绪风险报告清单、独居老人心理报告清单、查询历史情绪风险记录、显示所有老人孤独行为报告、显示养老心理健康诊断报告，查询情绪风险预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_elderly_loneliness_depression_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_loneliness_depression_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备独居老人活动区域固定摄像头视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行老年人孤独/抑郁倾向行为分析 | 调用 `-m scripts.smyx_elderly_loneliness_depression_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地独居老人活动区域固定摄像头视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络独居老人活动区域固定摄像头视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，老年人心理健康监测场景默认 `other` | 按需填写 |\n| `--list` | 显示老年人孤独/抑郁倾向行为历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_elderly_loneliness_depression_analysis.py`](scripts/smyx_elderly_loneliness_depression_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov 视频，最大 10MB；**关键**：必须能看到老人上半身与面部 |\n| 🔎 使用提醒 | 老人看电视/看书/打盹与\"发呆\"在视觉上易混淆，建议结合时长 + 周期性运动 + 面部表情综合判定 |\n| 🔎 使用提醒 | 多代同堂、保姆陪护等场景需启用\"独处时间窗口\"过滤，否则会低估孤独风险 |\n| 🔎 使用提醒 | 本工具不构成抑郁症筛查工具，**不替代** GDS-15 / PHQ-9 / 心理咨询师评估 |\n| 🔏 隐私合规 | 隐私合规：独居老人家庭视频涉及高度敏感个人隐私，使用前需取得老人本人明确知情同意，妥善加密保管；建议优先采用人体轮廓 + 面部马赛克模式 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地独居老人活动区域视频\npython -m scripts.smyx_elderly_loneliness_depression_analysis --input /path/to/livingroom.mp4\n\n# 分析网络独居老人活动区域视频\npython -m scripts.smyx_elderly_loneliness_depression_analysis --url https://example.com/livingroom.mp4\n\n# 显示历史老年人孤独/抑郁倾向行为报告（自动触发关键词：查看老人孤独/抑郁历史报告、情绪风险报告清单等）\npython -m scripts.smyx_elderly_loneliness_depression_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_loneliness_depression_analysis --input lr.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_loneliness_depression_analysis --input lr.mp4 --output result.json\n```\n\nFile v1.0.1:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-elderly-loneliness-depression-analysis\",\n  \"version\": \"1.0.1\",\n  \"publishedAt\": 1782770682754\n}\n\nFile v1.0.1:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放老年人孤独/抑郁倾向行为分析 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动老年人孤独/抑郁倾向行为分析任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取消极行为统计 + 情绪风险结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史情绪风险记录\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_ELDERLY_LONELINESS_DEPRESSION_ANALYSIS` - 老年人孤独/抑郁倾向行为分析\n\n## 输入约束\n\n- 摄像头：独居老人家中客厅 / 卧室 / 起居室固定摄像头，覆盖老人主要日常活动区域，**能看到上半身和面部**\n- 帧率 ≥ 5 FPS（推荐 10-15 FPS）；分辨率 ≥ 480p；光照稳定\n- 可选附带麦克风（用于叹气声 / 自言自语判定）\n- 多人场景下可结合\"独处时间窗口\"过滤（仅在画面中无他人时统计）\n- 隐私敏感场景可启用人体轮廓 + 面部马赛克模式\n\n## 关键观测信号\n\n- `subject_detected` - 是否检测到老人\n- `solo_window` - 当前是否处于独处时间窗口（画面中仅有老人）\n- `daze_event_count` - 发呆事件次数（连续注视某处 ≥ 10s 且无肢体活动）\n- `daze_total_duration_min` - 发呆累计时长\n- `sigh_event_count_hourly` - 每小时叹气次数（胸腹快速起伏 + 呼气声）\n- `sigh_event_count_daily` - 当日累计叹气次数\n- `self_talk_event_count_daily` - 自言自语次数（口部活动 + 画面中无对话对象）\n- `social_interaction_minutes_daily` - 当日有效社交互动总时长（参考反向指标）\n- `lying_in_bed_duration_daily_min` - 当日卧床时长（参考）\n\n## 阈值与风险等级\n\n- `low` - 各项消极行为均接近基线、社交互动正常\n- `medium` - 1-2 项消极行为显著高于基线（例如发呆 > 60 min/天，或叹气 > 10 次/小时）\n- `high` - 多项消极行为同时偏高 + 社交互动显著下降 + 连续 ≥ 3 天\n\n## 输出字段（参考）\n\n- `subject_detected` / `solo_window`\n- `behavior_metrics` - 当日各项消极行为统计\n- `baseline_comparison` - 与个人 7-14 天基线对比（per_item_delta_pct）\n- `consecutive_abnormal_days` - 连续异常天数\n- `risk_level` - 情绪风险等级（low / medium / high）\n- `alert_type` - 提醒类型（loneliness_risk / depression_tendency_suspected / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `alert_message` - 推送给家属/社工的友好文本（如\"妈妈今天独自发呆约 1 小时，叹气次数比平时多了一倍，建议今晚视频通话陪她聊聊\"）\n- `recommend_action` - 建议动作（push_family_notice / suggest_video_call / suggest_community_visit / observe_only）\n\n> 仅输出基于视觉/音频的客观行为统计与友好提醒，**不提供抑郁症诊断、心理量表评分（如 GDS-15、PHQ-9）或处方**；任何诊断与治疗方案必须由精神科医生或心理咨询师评估制定；若老人出现明显自我伤害言语或行为请立即联系专业机构。\n\nFile v1.0.1: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.1:scripts/config.yaml\n\n{}\n\nFile v1.0.1:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.1: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.1: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.1: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.1:skill-card.md\n\n## Description: <br>\nAnalyzes fixed-camera home video of elders living alone to identify behavior indicators such as prolonged dazing, sighing, and self-talking, then returns behavior statistics and an emotional-risk report. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[smyx-sunjinhui](https://clawhub.ai/user/smyx-sunjinhui) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nExternal caregivers, family members, and community care workers use this skill to analyze consented elder home-video inputs for non-diagnostic behavioral risk signals and to review generated reports or historical report lists. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill sends highly sensitive elder home-video inputs, derived risk reports, identity information, and report-history queries to external Life Emergence services. <br>\nMitigation: Use only with explicit consent from the monitored elder or lawful guardian, confirm acceptable retention and access controls before installation, and avoid third-party videos or contexts where consent cannot be verified. <br>\nRisk: The skill silently creates or reuses identity records and stores tokens locally. <br>\nMitigation: Install only where silent identity reuse and local token storage are acceptable, and restrict host access to trusted operators. <br>\nRisk: Behavioral indicators can be confused with benign activities and the output could be mistaken for a medical diagnosis. <br>\nMitigation: Treat reports as non-diagnostic behavioral risk prompts; use clinical screening or qualified medical review for diagnosis, treatment, or urgent safety decisions. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-elderly-loneliness-depression-analysis) <br>\n- [API documentation](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:** [Text or Markdown summaries with optional JSON report output and report links] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May query cloud-hosted historical reports and may save result text to a user-specified output file.] <br>\n\n## Skill Version(s): <br>\n1.0.1 (source: server release metadata; artifact frontmatter says 1.0.3) <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.1:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.1:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3","readmeExcerpt":"Skill: Elderly Loneliness / Depression-Tendency Behavior Analysis | 老年人孤独/抑郁倾向行为分析 Owner: smyx-sunjinhui Summary: Using fixed cameras at home (living room, bedroom) of elderly people living alone, the system analyzes daily videos and detects negative behavior indicators during solo time: dazing (long-duration motionless gazing without purposeful action), sighing (rapid chest rise-and-fall with audible expiration), an","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"python -m scripts.smyx_elderly_loneliness_depression_analysis --list"},{"language":"text","snippet":"requests>=2.28.0"},{"language":"bash","snippet":"# 分析本地独居老人活动区域视频\npython -m scripts.smyx_elderly_loneliness_depression_analysis --input /path/to/livingroom.mp4\n\n# 分析网络独居老人活动区域视频\npython -m scripts.smyx_elderly_loneliness_depression_analysis --url https://example.com/livingroom.mp4\n\n# 显示历史老年人孤独/抑郁倾向行为报告（自动触发关键词：查看老人孤独/抑郁历史报告、情绪风险报告清单等）\npython -m scripts.smyx_elderly_loneliness_depression_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_loneliness_depression_analysis --input lr.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_loneliness_depression_analysis --input lr.mp4 --output result.json"},{"language":"bash","snippet":"python -m scripts.smyx_elderly_loneliness_depression_analysis --list"},{"language":"text","snippet":"requests>=2.28.0"},{"language":"bash","snippet":"# 分析本地独居老人活动区域视频\npython -m scripts.smyx_elderly_loneliness_depression_analysis --input /path/to/livingroom.mp4\n\n# 分析网络独居老人活动区域视频\npython -m scripts.smyx_elderly_loneliness_depression_analysis --url https://example.com/livingroom.mp4\n\n# 显示历史老年人孤独/抑郁倾向行为报告（自动触发关键词：查看老人孤独/抑郁历史报告、情绪风险报告清单等）\npython -m scripts.smyx_elderly_loneliness_depression_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_loneliness_depression_analysis --input lr.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_loneliness_depression_analysis --input lr.mp4 --output result.json"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: \"smyx-elderly-loneliness-depression-analysis\"\ndescription: \"Using fixed cameras at home (living room, bedroom) of elderly people living alone, the system analyzes daily videos and detects negative behavior indicators during solo time: dazing (long-duration motionless gazing without purposeful action), sighing (rapid chest rise-and-fall with audible expiration), and self-talking (mouth movement without any conversation partner). | 通过独居老人在家中的固定摄像头（如客厅、卧室），分析日常视频，检测独处期间的消极行为指标：发呆（长时间静止注视，缺乏目的性动作）、叹气（胸部快速起伏伴呼气声）、自言自语（口部活动但无对话对象）等。该技能可辅助家属或社区工作者了解老人心理状态，及时进行情感关怀或心理干预。\"\nversion: \"1.0.11\"\nlicense: \"MIT-0\"\n---\n\n# 🧓 Elderly Loneliness / Depression-Tendency Behavior Analysis | 老年人孤独/抑郁倾向行为分析\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **老年人孤独/抑郁倾向行为分析** |\n| 🎯 核心目标 | 通过独居老人在家中的固定摄像头（如客厅、卧室），分析日常视频，检测独处期间的消极行为指标：发呆（长时间静止注视，缺乏目的性动作）、叹气（胸部快速起伏伴呼气声）、自言自语（口部活动但无对话对象）等。该技能可辅助家属或社区工作者了解老人心理状态，及时进行情感关怀或心理干预。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_LONELINESS_DEPRESSION_ANALYSIS` |\n\nUsing fixed cameras at home (living room, bedroom) of elderly people living alone, the system analyzes daily videos and detects negative behavior indicators during solo time: dazing (long-duration motionless gazing without purposeful action), sighing (rapid chest rise-and-fall with audible expiration), and self-talking (mouth movement without any conversation partner). It counts the frequency and duration of these behaviors and comprehensively evaluates the elder's emotional risk level (low / medium / high). The skill assists family members or community workers in understanding the elder's mental state and timely providing emotional care or psychological intervention. Application scenarios: homes of solo-living elders, nursing homes, community daycare centers. The system generates a daily emotional-risk report; when the risk level is 'medium' or 'high', it pushes reminders. Skill features: loneliness and depression in the elderly are common mental-health issues, and early behavioral signals are often overlooked. AI automatic monitoring of dazing / sighing / self-talking helps family members detect mental abnormalities early, intervene promptly, and improve the elder's quality of life. Can be integrated into home-care cameras or community health-management platforms.\n\n通过独居老人在家中的固定摄像头（如客厅、卧室），分析日常视频，检测独处期间的消极行为指标：发呆（长时间静止注视，缺乏目的性动作）、叹气（胸部快速起伏伴呼气声）、自言自语（口部活动但无对话对象）等。统计这些行为的发生频次和持续时间，综合评估老年人潜在的情绪风险等级（低/中/高）。该技能可辅助家属或社区工作者了解老人心理状态，及时进行情感关怀或心理干预。应用场景：独居老人家庭、养老院、社区日间照料中心。系统每日生成情绪风险报告，当风险等级为'中'或'高'时推送提醒。技能特点：老年人孤独和抑郁是常见的心理健康问题，早期行为信号常被忽视。通过AI自动监测发呆、叹气、自言自语等行为，可辅助家属及早发现心理异常，及时干预，提高老年人生活质量。该技能可集成到居家养老摄像头或社区健康管理平台中。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人心理健康监测 AI。你的任务是分析固定摄像头拍摄的日常视频，检测老年人在独处期间的特定行为：发呆（连续注视某处超过 10 秒且无肢体活动）、叹气（胸腹部快速起伏伴呼吸音）、自言自语（口部开合但无对话对象）。统计这些行为的发生频次和持续时间，综合评估情绪风险等级。不要提供医疗诊断或心理量表评分，仅输出基于视觉和行为统计的风险提示。** |\n\n## 🎬 技能演示 | S"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-elderly-loneliness-depression-analysis\",\n  \"version\": \"1.0.10\",\n  \"publishedAt\": 1790586508642\n}"},{"path":"references/api_doc.md","content":"# API 接口文档\n\n此处用于存放老年人孤独/抑郁倾向行为分析 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动老年人孤独/抑郁倾向行为分析任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取消极行为统计 + 情绪风险结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史情绪风险记录\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_ELDERLY_LONELINESS_DEPRESSION_ANALYSIS` - 老年人孤独/抑郁倾向行为分析\n\n## 输入约束\n\n- 摄像头：独居老人家中客厅 / 卧室 / 起居室固定摄像头，覆盖老人主要日常活动区域，**能看到上半身和面部**\n- 帧率 ≥ 5 FPS（推荐 10-15 FPS）；分辨率 ≥ 480p；光照稳定\n- 可选附带麦克风（用于叹气声 / 自言自语判定）\n- 多人场景下可结合\"独处时间窗口\"过滤（仅在画面中无他人时统计）\n- 隐私敏感场景可启用人体轮廓 + 面部马赛克模式\n\n## 关键观测信号\n\n- `subject_detected` - 是否检测到老人\n- `solo_window` - 当前是否处于独处时间窗口（画面中仅有老人）\n- `daze_event_count` - 发呆事件次数（连续注视某处 ≥ 10s 且无肢体活动）\n- `daze_total_duration_min` - 发呆累计时长\n- `sigh_event_count_hourly` - 每小时叹气次数（胸腹快速起伏 + 呼气声）\n- `sigh_event_count_daily` - 当日累计叹气次数\n- `self_talk_event_count_daily` - 自言自语次数（口部活动 + 画面中无对话对象）\n- `social_interaction_minutes_daily` - 当日有效社交互动总时长（参考反向指标）\n- `lying_in_bed_duration_daily_min` - 当日卧床时长（参考）\n\n## 阈值与风险等级\n\n- `low` - 各项消极行为均接近基线、社交互动正常\n- `medium` - 1-2 项消极行为显著高于基线（例如发呆 > 60 min/天，或叹气 > 10 次/小时）\n- `high` - 多项消极行为同时偏高 + 社交互动显著下降 + 连续 ≥ 3 天\n\n## 输出字段（参考）\n\n- `subject_detected` / `solo_window`\n- `behavior_metrics` - 当日各项消极行为统计\n- `baseline_comparison` - 与个人 7-14 天基线对比（per_item_delta_pct）\n- `consecutive_abnormal_days` - 连续异常天数\n- `risk_level` - 情绪风险等级（low / medium / high）\n- `alert_type` - 提醒类型（loneliness_risk / depression_tendency_suspected / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `alert_message` - 推送给家属/社工的友好文本（如\"妈妈今天独自发呆约 1 小时，叹气次数比平时多了一倍，建议今晚视频通话陪她聊聊\"）\n- `recommend_action` - 建议动作（push_family_notice / suggest_video_call / suggest_community_visit / observe_only）\n\n> 仅输出基于视觉/音频的客观行为统计与友好提醒，**不提供抑郁症诊断、心理量表评分（如 GDS-15、PHQ-9）或处方**；任何诊断与治疗方案必须由精神科医生或心理咨询师评估制定；若老人出现明显自我伤害言语或行为请立即联系专业机构。"},{"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":"Using fixed cameras at home (living room, bedroom) of elderly people living alone, the system analyzes daily videos and detects negative behavior indicators during solo time: dazing (long-duration motionless gazing without purposeful action), sighing (rapid chest rise-and-fall with audible expiration), and self-talking (mouth movement without any conversation partner). | 通过独居老人在家中的固定摄像头（如客厅、卧室），分析日常视频，检测独处期间的消极行为指标：发呆（长时间静止注视，缺乏目的性动作）、叹气（胸部快速起伏伴呼气声）、自言自语（口部活动但无对话对象）等。该技能可辅助家属或社区工作者了解老人心理状态，及时进行情感关怀或心理干预。 Skill: Elderly Loneliness / Depression-Tendency Behavior Analysis | 老年人孤独/抑郁倾向行为分析 Owner: smyx-sunjinhui Summary: Using fixed cameras at home (living room, bedroom) of elderly people living alone, the system analyzes daily videos and detects negative behavior indicators during solo time: dazing (long-duration motionless gazing without purposeful action), sighing (rapid chest rise-and-fall with audible expiration), an","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":1091,"uniquenessScore":45,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-09T21:10:35.769Z","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-09T21:10:35.769Z","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-10T08:21:36.805Z","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"}]}}}