{"id":"810d1468-bf10-4dda-8cc9-cd3e720f0ebe","entityType":"agent","slug":"clawhub-smyx-sunjinhui-smyx-elderly-loneliness-comfort-analysis","name":"Elderly Loneliness Detection & Warm Companionship | 独居老人孤独情绪识别与温暖陪伴","canonicalUrl":"https://www.xpersona.co/agent/clawhub-smyx-sunjinhui-smyx-elderly-loneliness-comfort-analysis","canonicalPath":"/agent/clawhub-smyx-sunjinhui-smyx-elderly-loneliness-comfort-analysis","generatedAt":"2026-10-10T11:00:49.584Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-10T07:30:13.338Z","emptyReason":null},"description":"Using a fixed camera in the home of a solitary-living elderly person or in a private nursing-home room, the system analyzes daily activity video and detects loneliness-related behaviors: prolonged solitude (no social interaction), static gazing (long-time fixation with no purposeful activity), sighing (rapid chest/abdomen rise-fall with exhale), and talking-to-self (mouth activity with no conversation partner). | 通过独居老人家中或养老院单人房的固定摄像头，分析老人日常行为视频，检测孤独相关行为：长时间独处（无社交互动）、静止发呆（长时间凝视一处无目的活动）、叹气（胸腹快速起伏伴呼气）、自言自语（口部活动但无对话对象）等。 Skill: Elderly Loneliness Detection & Warm Companionship | 独居老人孤独情绪识别与温暖陪伴 Owner: smyx-sunjinhui Summary: Using a fixed camera in the home of a solitary-living elderly person or in a private nursing-home room, the system analyzes daily activity video and detects loneliness-related behaviors: prolonged solitude (no social interaction), static gazing (long-time fixation with no purposeful activity), sighing (rapid ches","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 1.6K downloads reported by the source. Last updated 10/10/2026.","installCommand":"clawhub skill install s17cfv2h26b7hq5w47tgfy23xx83z9x6:smyx-elderly-loneliness-comfort-analysis","sourceUrl":"https://clawhub.ai/smyx-sunjinhui/smyx-elderly-loneliness-comfort-analysis","homepage":"https://clawhub.ai/smyx-sunjinhui/skills/smyx-elderly-loneliness-comfort-analysis","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/smyx-sunjinhui/smyx-elderly-loneliness-comfort-analysis","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/smyx-sunjinhui/skills/smyx-elderly-loneliness-comfort-analysis","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":64,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Using a fixed camera in the home of a solitary-living elderly person or in a private nursing-home room, the system analyzes daily activity video and detects lon"},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-10T07:30:13.338Z","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-10T07:30:13.338Z","emptyReason":null},"stars":null,"forks":null,"downloads":1590,"packageName":null,"latestVersion":"1.0.9","tractionLabel":"1.6K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T07:30:13.338Z","emptyReason":null},"lastUpdatedAt":"2026-10-10T07:30:13.338Z","lastCrawledAt":"2026-10-10T07:30:13.338Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-11T07:30:13.338Z","lastVerifiedAt":null,"highlights":[{"version":"1.0.9","createdAt":"2026-10-03T18:09:27.061Z","changelog":"smyx-elderly-loneliness-comfort-analysis 1.0.9 Changelog - Updated documentation and configuration files to reflect minor improvements and adjustments. - Removed deprecated skill-card.md to streamline documentation. - Ensured parameters, capabilities, and usage notes in SKILL.md are clear and up-to-date.","fileCount":31,"zipByteSize":43704},{"version":"1.0.8","createdAt":"2026-09-13T17:03:28.956Z","changelog":"- Updated documentation (SKILL.md) with version and feature details; minor text clarifications and formatting improvements. - Removed the file skill-card.md. - No functional code changes; this update focuses on documentation maintenance and cleanup.","fileCount":31,"zipByteSize":44054},{"version":"1.0.7","createdAt":"2026-08-29T02:04:33.168Z","changelog":"- Updated SKILL.md with new version number (1.0.11) and content revisions. - Removed the skill-card.md file. - No functional or behavioral changes noted; update is documentation and metadata only.","fileCount":31,"zipByteSize":44066},{"version":"1.0.6","createdAt":"2026-08-19T10:28:29.459Z","changelog":"- Updated the skill version from 1.0.8 to 1.0.9 in SKILL.md. - Edited skill documentation (SKILL.md) content. - Removed the file: skill-card.md. - Minor configuration file adjustments.","fileCount":31,"zipByteSize":44068},{"version":"1.0.5","createdAt":"2026-08-12T11:02:34.714Z","changelog":"- Removed the file skill-card.md. - No changes to features or functionality. - All usage instructions, capabilities, and requirements remain as before.","fileCount":31,"zipByteSize":44043},{"version":"1.0.4","createdAt":"2026-08-06T08:54:32.713Z","changelog":"- Updated skill documentation in SKILL.md with new details and version number. - Removed the skill-card.md file. - No changes to logic, features, or capabilities—this is a documentation and version metadata update only.","fileCount":31,"zipByteSize":44068},{"version":"1.0.3","createdAt":"2026-07-30T06:39:31.360Z","changelog":"- Version bumped from 1.0.4 to 1.0.6. - Documentation (SKILL.md) updated; no core logic or feature changes indicated. - Outdated or redundant file skill-card.md removed for clarity. - No impact on user experience, API, or workflow—content/metadata maintenance only.","fileCount":31,"zipByteSize":44094},{"version":"1.0.2","createdAt":"2026-07-14T05:57:29.827Z","changelog":"- Skill version updated from 1.0.2 to 1.0.4. - Internal script and shared module improvements: config.py, dao.py, util.py updated. - Documentation refinements in SKILL.md. - Deprecated skill-card.md documentation removed.","fileCount":31,"zipByteSize":43681}]},"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-comfort-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-comfort-analysis/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-elderly-loneliness-comfort-analysis/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-elderly-loneliness-comfort-analysis/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-elderly-loneliness-comfort-analysis/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-elderly-loneliness-comfort-analysis/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-elderly-loneliness-comfort-analysis/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-10T11:00:49.578Z"}},"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-comfort-analysis/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-elderly-loneliness-comfort-analysis/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-elderly-loneliness-comfort-analysis/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-elderly-loneliness-comfort-analysis/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-10-10T07:30:13.338Z","emptyReason":null},"readme":"Skill: Elderly Loneliness Detection & Warm Companionship | 独居老人孤独情绪识别与温暖陪伴\n\nOwner: smyx-sunjinhui\n\nSummary: Using a fixed camera in the home of a solitary-living elderly person or in a private nursing-home room, the system analyzes daily activity video and detects loneliness-related behaviors: prolonged solitude (no social interaction), static gazing (long-time fixation with no purposeful activity), sighing (rapid chest/abdomen rise-fall with exhale), and talking-to-self (mouth activity with no conversation partner). | 通过独居老人家中或养老院单人房的固定摄像头，分析老人日常行为视频，检测孤独相关行为：长时间独处（无社交互动）、静止发呆（长时间凝视一处无目的活动）、叹气（胸腹快速起伏伴呼气）、自言自语（口部活动但无对话对象）等。\n\nTags: latest:1.0.9\n\nVersion history:\n\nv1.0.9 | 2026-10-03T18:09:27.061Z | auto\n\nsmyx-elderly-loneliness-comfort-analysis 1.0.9 Changelog\n\n- Updated documentation and configuration files to reflect minor improvements and adjustments.\n- Removed deprecated skill-card.md to streamline documentation.\n- Ensured parameters, capabilities, and usage notes in SKILL.md are clear and up-to-date.\n\nv1.0.8 | 2026-09-13T17:03:28.956Z | auto\n\n- Updated documentation (SKILL.md) with version and feature details; minor text clarifications and formatting improvements.\n- Removed the file skill-card.md.\n- No functional code changes; this update focuses on documentation maintenance and cleanup.\n\nv1.0.7 | 2026-08-29T02:04:33.168Z | auto\n\n- Updated SKILL.md with new version number (1.0.11) and content revisions.\n- Removed the skill-card.md file.\n- No functional or behavioral changes noted; update is documentation and metadata only.\n\nv1.0.6 | 2026-08-19T10:28:29.459Z | auto\n\n- Updated the skill version from 1.0.8 to 1.0.9 in SKILL.md.\n- Edited skill documentation (SKILL.md) content.\n- Removed the file: skill-card.md.\n- Minor configuration file adjustments.\n\nv1.0.5 | 2026-08-12T11:02:34.714Z | auto\n\n- Removed the file skill-card.md.  \n- No changes to features or functionality.  \n- All usage instructions, capabilities, and requirements remain as before.\n\nv1.0.4 | 2026-08-06T08:54:32.713Z | auto\n\n- Updated skill documentation in SKILL.md with new details and version number.\n- Removed the skill-card.md file.\n- No changes to logic, features, or capabilities—this is a documentation and version metadata update only.\n\nv1.0.3 | 2026-07-30T06:39:31.360Z | auto\n\n- Version bumped from 1.0.4 to 1.0.6.\n- Documentation (SKILL.md) updated; no core logic or feature changes indicated.\n- Outdated or redundant file skill-card.md removed for clarity.\n- No impact on user experience, API, or workflow—content/metadata maintenance only.\n\nv1.0.2 | 2026-07-14T05:57:29.827Z | auto\n\n- Skill version updated from 1.0.2 to 1.0.4.\n- Internal script and shared module improvements: config.py, dao.py, util.py updated.\n- Documentation refinements in SKILL.md.\n- Deprecated skill-card.md documentation removed.\n\nv1.0.1 | 2026-06-28T21:15:24.798Z | auto\n\n**Changelog for smyx-elderly-loneliness-comfort-analysis v1.0.1 → v1.0.2**\n\n- Major update: Streamlined user experience with automatic identity handling and improved documentation structure.\n- Internal identity parameters are now handled automatically; users are no longer prompted for open-id, username, or phone.\n- All instructions and prompts about asking users for open-id or identity information have been removed from documentation and logic.\n- Documentation (SKILL.md and related docs) restructured with clearer sections, tables, and concise operation guides.\n- Skill workflow and triggering/constraint rules clarified for accuracy and compliance.\n- Two obsolete files removed and script structure streamlined for maintainability.\n\nv1.0.0 | 2026-05-27T09:14:48.661Z | auto\n\nInitial release of Elderly Loneliness Detection & Warm Companionship skill.\n\n- Analyzes video (and optional audio) from fixed cameras in elderly living spaces to detect loneliness-related behaviors (e.g., prolonged solitude, static gazing, sighing, talking-to-self).\n- Calculates a composite loneliness index (0-100) and, when above a threshold, automatically triggers companionship actions (e.g., playing pre-recorded family messages, favorite songs, or notifying adult children).\n- Supports real-time monitoring and proactive intervention to improve senior mental well-being.\n- Strict open-id acquisition workflow ensures privacy and correct usage before any analysis or report retrieval.\n- Can be integrated into smart cameras or elderly-care platforms as an emotional support feature for smart aging scenarios.\n\nArchive index:\n\nArchive v1.0.9: 31 files, 43704 bytes\n\nFiles: references/api_doc.md (6304b), scripts/__init__.py (68b), scripts/config.py (700b), scripts/config.yaml (3b), scripts/skill.py (594b), scripts/smyx_elderly_loneliness_comfort_analysis.py (3769b), skill-card.md (2132b), SKILL.md (15083b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (473b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (159b)\n\nFile v1.0.9:SKILL.md\n\n---\nname: \"smyx-elderly-loneliness-comfort-analysis\"\ndescription: \"Using a fixed camera in the home of a solitary-living elderly person or in a private nursing-home room, the system analyzes daily activity video and detects loneliness-related behaviors: prolonged solitude (no social interaction), static gazing (long-time fixation with no purposeful activity), sighing (rapid chest/abdomen rise-fall with exhale), and talking-to-self (mouth activity with no conversation partner). | 通过独居老人家中或养老院单人房的固定摄像头，分析老人日常行为视频，检测孤独相关行为：长时间独处（无社交互动）、静止发呆（长时间凝视一处无目的活动）、叹气（胸腹快速起伏伴呼气）、自言自语（口部活动但无对话对象）等。\"\nversion: \"1.0.16\"\nlicense: \"MIT-0\"\n---\n\n# 🤗 Elderly Loneliness Detection & Warm Companionship | 独居老人孤独情绪识别与温暖陪伴\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **独居老人孤独情绪识别与温暖陪伴** |\n| 🎯 核心目标 | 通过独居老人家中或养老院单人房的固定摄像头，分析老人日常行为视频，检测孤独相关行为：长时间独处（无社交互动）、静止发呆（长时间凝视一处无目的活动）、叹气（胸腹快速起伏伴呼气）、自言自语（口部活动但无对话对象）等。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_LONELINESS_COMFORT_ANALYSIS` |\n\nUsing a fixed camera in the home of a solitary-living elderly person or in a private nursing-home room, the system analyzes daily activity video and detects loneliness-related behaviors: prolonged solitude (no social interaction), static gazing (long-time fixation with no purposeful activity), sighing (rapid chest/abdomen rise-fall with exhale), and talking-to-self (mouth activity with no conversation partner). It computes a composite loneliness index (0-100). When the index exceeds a threshold, warm-companionship actions are automatically triggered: playing pre-recorded warm voice messages from children via smart speakers, playing the elder's favorite old songs, or pushing reminders to the children's mobile app (e.g., 'Dad seems lonely today — a video call is recommended'). The skill aims to relieve loneliness and improve mental well-being. Application scenarios: homes of solitary-living elderly, private nursing-home rooms, community day-care centers. The system monitors in real time and intervenes proactively when the loneliness index exceeds threshold. Skill features: chronic loneliness is a major risk factor for depression and cognitive decline in older adults. AI auto-identification of loneliness signals followed by timely voice care or reminders to children can effectively alleviate negative emotions and improve quality of life. Can be integrated into smart cameras or elderly-care service platforms as a key emotional-support feature of 'smart aging'.\n\n通过独居老人家中或养老院单人房的固定摄像头，分析老人日常行为视频，检测孤独相关行为：长时间独处（无社交互动）、静止发呆（长时间凝视一处无目的活动）、叹气（胸腹快速起伏伴呼气）、自言自语（口部活动但无对话对象）等。综合计算孤独指数（0-100），当指数超过阈值时自动触发温暖陪伴动作：通过智能音箱播放子女预录的温馨语音、播放老人喜爱老歌、或向子女手机APP推送提醒（'父亲今天显得孤独，建议视频通话'）。该技能旨在缓解老人孤独感，提升心理健康。应用场景：独居老人家庭、养老院单人房、社区日间照料中心。系统实时监测，当孤独指数超标时主动干预。技能特点：长期孤独是老年人抑郁、认知下降的重要风险因素。通过AI自动识别孤独信号并及时给予语音关怀或提醒子女，可有效缓解老人负面情绪，提升生活质量。该技能可集成到智能摄像头或养老服务平台中，成为'智慧养老'情感支持的关键功能。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人心理健康关怀 AI。你的任务是分析独居老人活动区域的固定摄像头视频（可选叠加音频），检测孤独相关行为：连续独处时长（无他人进入画面）、长时间静止凝视（≥ 10 分钟无肢体活动）、叹气次数（视觉胸腹起伏+长呼气，音频可补强）、自言自语频次（口部活动但无对话对象）。综合计算孤独指数（0-100，含哼歌/电话通话等正向行为扣分项），当超过阈值时输出温暖陪伴动作建议：智能音箱播放子女预录温馨语音、播放老人喜爱老歌、子女 APP 推送提醒。不提供任何医疗诊断，仅输出基于行为统计的结果，并尊重老人\"一句话关闭今日提醒\"的意愿。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于独居老人家中/养老院单人房固定摄像头（可选音频）视频，识别孤独相关行为（连续独处时长 / 当日累计独处 / 长时间静止凝视 / 视觉+音频叹气 / 自言自语 / 皱眉木然面部比例）+ 正向行为（笑容 / 哼歌 / 电话通话）→ 综合计算 **孤独指数（0-100，含正向扣分）** + 14 天个人基线对比 → 输出 4 档孤独等级（light / mild / notable / heavy）+ 4 类温暖陪伴动作建议（智能音箱子女语音 / 老歌播放 / 子女 APP 推送 / 社区日间照料推荐）+ 给子女的友好摘要\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人体姿态识别（独处/静止/凝视判定） |\n| 2 | 独居判定（≥ 30 分钟仅老人一人） |\n| 3 | 视觉叹气识别（胸腹起伏+长呼气姿态） |\n| 4 | 自言自语识别（口部活动+无对话对象在场） |\n| 5 | 笑容识别 |\n| 6 | 哼歌/唱歌识别（可选音频） |\n| 7 | 电话/视频通话识别 |\n| 8 | 社交互动事件识别（家人/护工进入 |\n| 9 | 视频通话画面 |\n| 10 | 宠物互动） |\n| 11 | 目的性活动判别（家务/看电视+点头反馈/园艺/阅读） |\n| 12 | 孤独指数 0-100 综合算法 |\n| 13 | 14 天个人基线对比 |\n| 14 | 4 档孤独等级 |\n| 15 | 温和前导（\"今天为您播放……\" 3 秒）+ 老人一句话关闭意愿支持 |\n| 16 | 子女预录语音播放（**禁止 AI 克隆声音**） |\n| 17 | heavy 且子女长期无回应时推送社区/街道老龄办资源 |\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_comfort_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_loneliness_comfort_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_comfort_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_comfort_analysis.py`](scripts/smyx_elderly_loneliness_comfort_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；**关键**：覆盖老人主要活动区域；时长建议 ≥ 4 小时 |\n| 🔎 使用提醒 | 哼歌/唱歌、电话视频通话、笑容等正向行为**必须**作为负权重纳入孤独指数计算，避免一刀切定义\"独处=孤独\" |\n| 🔎 使用提醒 | 老人午睡、看自己喜欢的电视节目并有积极面部反馈 等不应误判为\"静止凝视\"或孤独 |\n| 🧑‍⚖️ 结果性质 | 红线约束：**禁止**输出\"老年抑郁症 / 孤独症\"等精神医学诊断或量表评分；**禁止**未经老人与子女双方同意便部署；**禁止**将老人视频/音频用于商业广告或大数据画像；**禁止**长期存储原始视频（≤ 7 天，仅留聚合指标） |\n| 📁 格式支持 | **必须**：智能音箱发声前给予 3 秒温和前导（如\"今天为您播放……\"）；支持老人一句话关闭今日提醒 |\n| 🔎 使用提醒 | **绝对禁止**使用 AI 克隆/合成子女声音冒充子女语音；子女预录语音必须由子女本人录制 |\n| 🔎 使用提醒 | 当 heavy 且子女连续 ≥ 3 天无回应时，主动提示**社区/街道老龄办**资源 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地老人活动区域视频\npython -m scripts.smyx_elderly_loneliness_comfort_analysis --input /path/to/livingroom.mp4\n\n# 分析网络老人活动区域视频\npython -m scripts.smyx_elderly_loneliness_comfort_analysis --url https://example.com/livingroom.mp4\n\n# 显示历史独居老人孤独关怀报告（自动触发关键词：查看独居老人孤独历史报告、子女关怀日报清单等）\npython -m scripts.smyx_elderly_loneliness_comfort_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_loneliness_comfort_analysis --input lr.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_loneliness_comfort_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-comfort-analysis\",\n  \"version\": \"1.0.9\",\n  \"publishedAt\": 1791050967061\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}` - 导出完整报告\n5. （可选）`/web/companion/v2/trigger-comfort-action` - 触发联动温暖陪伴动作（智能音箱语音 / 子女 APP 推送）\n\n## 场景代码\n\n- `SMYX_ELDERLY_LONELINESS_COMFORT_ANALYSIS` - 独居老人孤独情绪识别与温暖陪伴\n\n## 输入约束\n\n- 摄像头：独居老人客厅 / 卧室 / 养老院单人房 / 日间照料中心固定摄像头，能看到老人主要活动区域\n- 帧率 ≥ 5 FPS（推荐 10 FPS）；分辨率 ≥ 480p；夜间需红外补光\n- 音频（可选，但强烈推荐）：用于识别叹气声 + 自言自语；采样率 ≥ 16kHz\n- 视频时长：建议覆盖白天活跃时段（08:00 - 22:00），**单次分析建议 ≥ 4 小时**\n- ROI 标定：主要活动区域（沙发区 / 餐桌 / 床位 / 阳台 / 厨房）\n- **独居判定**：连续 ≥ 30 分钟画面中仅有老人一人 → independent_status = true（若有家人/护工进入即重置）\n- 隐私敏感场景建议启用人体轮廓 + 面部马赛克模式\n\n## 关键观测信号\n\n### 行为\n- `solo_duration_minutes` - 当前连续独处时长（无他人进入画面）\n- `daily_solo_total_minutes` - 当日累计独处总时长\n- `static_gaze_duration_minutes` - 长时间静止凝视一处（≥ 10 分钟，无肢体活动）\n- `purposeful_activity_minutes` - 有目的活动总时长（做家务、看电视 + 笑/点头反馈、园艺、阅读等）\n- `social_interaction_event_count` - 社交互动事件数（家人/护工进入、视频通话画面、宠物互动）\n\n### 视觉\n- `sigh_visual_event_count` - 视觉叹气次数（胸腹快速起伏伴长呼气姿态）\n- `talking_to_self_event_count` - 自言自语视觉事件次数（口部活动但无对话对象在场）\n- `frown_neutral_face_ratio` - 皱眉/木然面部比例（参考指标）\n- `smile_event_count_daily` - 当日笑容次数（正向指标）\n\n### 音频（可选）\n- `sigh_audio_event_count` - 音频叹气事件\n- `talking_to_self_audio_event_count` - 自言自语音频事件\n- `singing_humming_event_count` - 哼歌/唱歌事件（**正向指标**，孤独指数 ↓）\n- `phone_call_minutes` - 电话/视频通话时长（正向指标）\n\n### 综合\n- `loneliness_index` - 孤独指数（0-100，**正向行为会扣分**）\n- `comparison_to_baseline_pct` - 与个人 14 天基线对比\n\n## 阈值与等级（默认值，可在配置中覆盖）\n\n- `loneliness_index 0-29` - light（轻度，正常社交）→ 不干预\n- `loneliness_index 30-49` - mild（轻度孤独）→ 建议温和陪伴（播放老歌）\n- `loneliness_index 50-69` - notable（较明显孤独）→ 主动播放子女预录温馨语音 + 子女 APP 提示\n- `loneliness_index 70-100` - heavy（重度孤独）→ 强力关怀（推送子女建议本周视频通话或回家探望 + 社区义工提醒）\n- 连续 ≥ 4 小时无社交互动 + 静止凝视 ≥ 1 小时 + 叹气 ≥ 5 次 → 升级提醒\n\n## 输出字段（参考）\n\n- `time_window` / `independent_status`\n- `behavioral_metrics` / `visual_metrics` / `audio_metrics`（音频可选）\n- `loneliness_index` / `loneliness_level`\n- `comparison_to_baseline_pct` / `consecutive_high_days` - 连续高指数天数\n- `alert_type` - 提醒类型（light_no_action / mild_comfort_audio / notable_comfort_plus_app / heavy_strong_care / improving）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `comfort_actions` - 温暖陪伴动作列表（每项含 action_type / message / target，例如：\n    - `{action_type: \"smart_speaker_voice\", message: \"妈妈，是小芳，我今天忙完了打给您哈，您先听听咱俩去年录的那段~\", target: \"living_room_speaker\"}`\n    - `{action_type: \"play_favorite_song\", message: \"邓丽君《月亮代表我的心》\", target: \"living_room_speaker\"}`\n    - `{action_type: \"children_app_push\", message: \"今天母亲显得有些孤独，建议视频通话或回家陪伴\", target: \"child_phone_app\"}`）\n- `family_summary` - 给子女的友好摘要（如\"今天母亲在客厅独处 6 小时，下午 14:30-15:20 期间静坐凝视窗外约 50 分钟、叹气 7 次，孤独指数 72；已为她播放邓丽君老歌并推送了您预录的语音，建议晚上视频通话，或周末抽空回家陪她吃顿饭\"）\n- `recommend_action` - 建议动作（trigger_smart_speaker_comfort / push_children_video_call_suggestion / suggest_community_volunteer_visit / observe_only）\n- `community_resource` - 当 heavy 且子女长期无回应时，附**当地社区日间照料 / 街道老龄办** 资源提示\n\n## 强制约束与红线\n\n- ❌ **禁止**输出\"老年抑郁症 / 孤独症\"等任何精神医学诊断或量表评分\n- ❌ **禁止**未经老人本人**和**子女双方同意便部署摄像头\n- ❌ **禁止**将老人视频/音频用于商业广告或大数据画像\n- ❌ **禁止**长期存储老人原始视频；建议仅保留 ≤ 7 天，且仅留聚合指标\n- ❌ **禁止**强迫推送频率过高，避免老人对智能音箱产生抵触\n- ✅ **必须**在每个智能音箱发声前给予 3 秒\"今天为您播放……\"温和前导，避免突兀惊吓\n- ✅ **必须**支持老人一句话关闭今日提醒（如\"好啦，我没事\"）\n- ✅ 当孤独指数持续 ≥ 70 但子女连续 ≥ 3 天无回应时，主动提示**社区/街道老龄办**资源\n- ✅ 子女预录语音必须由子女本人录制，**禁止**使用 AI 克隆/合成子女声音冒充\n\n> 仅输出基于视觉与（可选）音频的客观行为统计与温暖陪伴动作，**不构成老年抑郁症等精神医学诊断**；任何疑似心理健康问题应转介当地老年精神科或社区心理服务，最终评估由专业医师作出。\n\nFile v1.0.9:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.9:scripts/config.yaml\n\n{}\n\nFile v1.0.9:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.9:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.9:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.9:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: prod\n\nFile v1.0.9:skill-card.md\n\n## Description:\n\nAnalyzes elder-care video for loneliness-related behaviors and produces a structured report with companionship suggestions and access to historical 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\nCaregivers and elder-care service developers use the skill to review footage for possible loneliness-related behaviors, receive companionship suggestions, and view previous reports.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Private elder-care video or audio is uploaded to external services.\n\nMitigation: Obtain explicit informed consent from the elder and relevant caregivers, including approval for cloud upload, before use.\n\nRisk: Identity records and tokens may be created or stored without clear user control.\n\nMitigation: Ask the publisher how identifiers and tokens are stored and deleted, and require clear approval for account creation.\n\nRisk: Cloud reports and history may retain sensitive information.\n\nMitigation: Confirm report retention, history access, and deletion options with the publisher before deploying in a home or care facility.\n\n## Reference(s):\n\n- [ClawHub skill release](https://clawhub.ai/smyx-sunjinhui/skills/smyx-elderly-loneliness-comfort-analysis)\n- [API documentation](references/api_doc.md)\n- [Skill introduction](https://lifeemergence.com/sample.html)\n\n## Skill Output:\n\n**Output Type(s):** [Analysis, Guidance, Text]\n\n**Output Format:** [Structured text or JSON analysis reports and Markdown history tables]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Includes report links and may be saved to a local file.]\n\n## Skill Version(s):\n\n1.0.9 (source: ClawHub release metadata; artifact frontmatter lists 1.0.16)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.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, 44054 bytes\n\nFiles: references/api_doc.md (6304b), scripts/__init__.py (68b), scripts/config.py (700b), scripts/config.yaml (3b), scripts/skill.py (594b), scripts/smyx_elderly_loneliness_comfort_analysis.py (3769b), skill-card.md (2898b), SKILL.md (15083b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (472b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (159b)\n\nFile v1.0.8:SKILL.md\n\n---\nname: \"smyx-elderly-loneliness-comfort-analysis\"\ndescription: \"Using a fixed camera in the home of a solitary-living elderly person or in a private nursing-home room, the system analyzes daily activity video and detects loneliness-related behaviors: prolonged solitude (no social interaction), static gazing (long-time fixation with no purposeful activity), sighing (rapid chest/abdomen rise-fall with exhale), and talking-to-self (mouth activity with no conversation partner). | 通过独居老人家中或养老院单人房的固定摄像头，分析老人日常行为视频，检测孤独相关行为：长时间独处（无社交互动）、静止发呆（长时间凝视一处无目的活动）、叹气（胸腹快速起伏伴呼气）、自言自语（口部活动但无对话对象）等。\"\nversion: \"1.0.13\"\nlicense: \"MIT-0\"\n---\n\n# 🤗 Elderly Loneliness Detection & Warm Companionship | 独居老人孤独情绪识别与温暖陪伴\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **独居老人孤独情绪识别与温暖陪伴** |\n| 🎯 核心目标 | 通过独居老人家中或养老院单人房的固定摄像头，分析老人日常行为视频，检测孤独相关行为：长时间独处（无社交互动）、静止发呆（长时间凝视一处无目的活动）、叹气（胸腹快速起伏伴呼气）、自言自语（口部活动但无对话对象）等。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_LONELINESS_COMFORT_ANALYSIS` |\n\nUsing a fixed camera in the home of a solitary-living elderly person or in a private nursing-home room, the system analyzes daily activity video and detects loneliness-related behaviors: prolonged solitude (no social interaction), static gazing (long-time fixation with no purposeful activity), sighing (rapid chest/abdomen rise-fall with exhale), and talking-to-self (mouth activity with no conversation partner). It computes a composite loneliness index (0-100). When the index exceeds a threshold, warm-companionship actions are automatically triggered: playing pre-recorded warm voice messages from children via smart speakers, playing the elder's favorite old songs, or pushing reminders to the children's mobile app (e.g., 'Dad seems lonely today — a video call is recommended'). The skill aims to relieve loneliness and improve mental well-being. Application scenarios: homes of solitary-living elderly, private nursing-home rooms, community day-care centers. The system monitors in real time and intervenes proactively when the loneliness index exceeds threshold. Skill features: chronic loneliness is a major risk factor for depression and cognitive decline in older adults. AI auto-identification of loneliness signals followed by timely voice care or reminders to children can effectively alleviate negative emotions and improve quality of life. Can be integrated into smart cameras or elderly-care service platforms as a key emotional-support feature of 'smart aging'.\n\n通过独居老人家中或养老院单人房的固定摄像头，分析老人日常行为视频，检测孤独相关行为：长时间独处（无社交互动）、静止发呆（长时间凝视一处无目的活动）、叹气（胸腹快速起伏伴呼气）、自言自语（口部活动但无对话对象）等。综合计算孤独指数（0-100），当指数超过阈值时自动触发温暖陪伴动作：通过智能音箱播放子女预录的温馨语音、播放老人喜爱老歌、或向子女手机APP推送提醒（'父亲今天显得孤独，建议视频通话'）。该技能旨在缓解老人孤独感，提升心理健康。应用场景：独居老人家庭、养老院单人房、社区日间照料中心。系统实时监测，当孤独指数超标时主动干预。技能特点：长期孤独是老年人抑郁、认知下降的重要风险因素。通过AI自动识别孤独信号并及时给予语音关怀或提醒子女，可有效缓解老人负面情绪，提升生活质量。该技能可集成到智能摄像头或养老服务平台中，成为'智慧养老'情感支持的关键功能。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人心理健康关怀 AI。你的任务是分析独居老人活动区域的固定摄像头视频（可选叠加音频），检测孤独相关行为：连续独处时长（无他人进入画面）、长时间静止凝视（≥ 10 分钟无肢体活动）、叹气次数（视觉胸腹起伏+长呼气，音频可补强）、自言自语频次（口部活动但无对话对象）。综合计算孤独指数（0-100，含哼歌/电话通话等正向行为扣分项），当超过阈值时输出温暖陪伴动作建议：智能音箱播放子女预录温馨语音、播放老人喜爱老歌、子女 APP 推送提醒。不提供任何医疗诊断，仅输出基于行为统计的结果，并尊重老人\"一句话关闭今日提醒\"的意愿。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于独居老人家中/养老院单人房固定摄像头（可选音频）视频，识别孤独相关行为（连续独处时长 / 当日累计独处 / 长时间静止凝视 / 视觉+音频叹气 / 自言自语 / 皱眉木然面部比例）+ 正向行为（笑容 / 哼歌 / 电话通话）→ 综合计算 **孤独指数（0-100，含正向扣分）** + 14 天个人基线对比 → 输出 4 档孤独等级（light / mild / notable / heavy）+ 4 类温暖陪伴动作建议（智能音箱子女语音 / 老歌播放 / 子女 APP 推送 / 社区日间照料推荐）+ 给子女的友好摘要\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人体姿态识别（独处/静止/凝视判定） |\n| 2 | 独居判定（≥ 30 分钟仅老人一人） |\n| 3 | 视觉叹气识别（胸腹起伏+长呼气姿态） |\n| 4 | 自言自语识别（口部活动+无对话对象在场） |\n| 5 | 笑容识别 |\n| 6 | 哼歌/唱歌识别（可选音频） |\n| 7 | 电话/视频通话识别 |\n| 8 | 社交互动事件识别（家人/护工进入 |\n| 9 | 视频通话画面 |\n| 10 | 宠物互动） |\n| 11 | 目的性活动判别（家务/看电视+点头反馈/园艺/阅读） |\n| 12 | 孤独指数 0-100 综合算法 |\n| 13 | 14 天个人基线对比 |\n| 14 | 4 档孤独等级 |\n| 15 | 温和前导（\"今天为您播放……\" 3 秒）+ 老人一句话关闭意愿支持 |\n| 16 | 子女预录语音播放（**禁止 AI 克隆声音**） |\n| 17 | heavy 且子女长期无回应时推送社区/街道老龄办资源 |\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_comfort_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_loneliness_comfort_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_comfort_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_comfort_analysis.py`](scripts/smyx_elderly_loneliness_comfort_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；**关键**：覆盖老人主要活动区域；时长建议 ≥ 4 小时 |\n| 🔎 使用提醒 | 哼歌/唱歌、电话视频通话、笑容等正向行为**必须**作为负权重纳入孤独指数计算，避免一刀切定义\"独处=孤独\" |\n| 🔎 使用提醒 | 老人午睡、看自己喜欢的电视节目并有积极面部反馈 等不应误判为\"静止凝视\"或孤独 |\n| 🧑‍⚖️ 结果性质 | 红线约束：**禁止**输出\"老年抑郁症 / 孤独症\"等精神医学诊断或量表评分；**禁止**未经老人与子女双方同意便部署；**禁止**将老人视频/音频用于商业广告或大数据画像；**禁止**长期存储原始视频（≤ 7 天，仅留聚合指标） |\n| 📁 格式支持 | **必须**：智能音箱发声前给予 3 秒温和前导（如\"今天为您播放……\"）；支持老人一句话关闭今日提醒 |\n| 🔎 使用提醒 | **绝对禁止**使用 AI 克隆/合成子女声音冒充子女语音；子女预录语音必须由子女本人录制 |\n| 🔎 使用提醒 | 当 heavy 且子女连续 ≥ 3 天无回应时，主动提示**社区/街道老龄办**资源 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地老人活动区域视频\npython -m scripts.smyx_elderly_loneliness_comfort_analysis --input /path/to/livingroom.mp4\n\n# 分析网络老人活动区域视频\npython -m scripts.smyx_elderly_loneliness_comfort_analysis --url https://example.com/livingroom.mp4\n\n# 显示历史独居老人孤独关怀报告（自动触发关键词：查看独居老人孤独历史报告、子女关怀日报清单等）\npython -m scripts.smyx_elderly_loneliness_comfort_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_loneliness_comfort_analysis --input lr.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_loneliness_comfort_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-comfort-analysis\",\n  \"version\": \"1.0.8\",\n  \"publishedAt\": 1789319008956\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}` - 导出完整报告\n5. （可选）`/web/companion/v2/trigger-comfort-action` - 触发联动温暖陪伴动作（智能音箱语音 / 子女 APP 推送）\n\n## 场景代码\n\n- `SMYX_ELDERLY_LONELINESS_COMFORT_ANALYSIS` - 独居老人孤独情绪识别与温暖陪伴\n\n## 输入约束\n\n- 摄像头：独居老人客厅 / 卧室 / 养老院单人房 / 日间照料中心固定摄像头，能看到老人主要活动区域\n- 帧率 ≥ 5 FPS（推荐 10 FPS）；分辨率 ≥ 480p；夜间需红外补光\n- 音频（可选，但强烈推荐）：用于识别叹气声 + 自言自语；采样率 ≥ 16kHz\n- 视频时长：建议覆盖白天活跃时段（08:00 - 22:00），**单次分析建议 ≥ 4 小时**\n- ROI 标定：主要活动区域（沙发区 / 餐桌 / 床位 / 阳台 / 厨房）\n- **独居判定**：连续 ≥ 30 分钟画面中仅有老人一人 → independent_status = true（若有家人/护工进入即重置）\n- 隐私敏感场景建议启用人体轮廓 + 面部马赛克模式\n\n## 关键观测信号\n\n### 行为\n- `solo_duration_minutes` - 当前连续独处时长（无他人进入画面）\n- `daily_solo_total_minutes` - 当日累计独处总时长\n- `static_gaze_duration_minutes` - 长时间静止凝视一处（≥ 10 分钟，无肢体活动）\n- `purposeful_activity_minutes` - 有目的活动总时长（做家务、看电视 + 笑/点头反馈、园艺、阅读等）\n- `social_interaction_event_count` - 社交互动事件数（家人/护工进入、视频通话画面、宠物互动）\n\n### 视觉\n- `sigh_visual_event_count` - 视觉叹气次数（胸腹快速起伏伴长呼气姿态）\n- `talking_to_self_event_count` - 自言自语视觉事件次数（口部活动但无对话对象在场）\n- `frown_neutral_face_ratio` - 皱眉/木然面部比例（参考指标）\n- `smile_event_count_daily` - 当日笑容次数（正向指标）\n\n### 音频（可选）\n- `sigh_audio_event_count` - 音频叹气事件\n- `talking_to_self_audio_event_count` - 自言自语音频事件\n- `singing_humming_event_count` - 哼歌/唱歌事件（**正向指标**，孤独指数 ↓）\n- `phone_call_minutes` - 电话/视频通话时长（正向指标）\n\n### 综合\n- `loneliness_index` - 孤独指数（0-100，**正向行为会扣分**）\n- `comparison_to_baseline_pct` - 与个人 14 天基线对比\n\n## 阈值与等级（默认值，可在配置中覆盖）\n\n- `loneliness_index 0-29` - light（轻度，正常社交）→ 不干预\n- `loneliness_index 30-49` - mild（轻度孤独）→ 建议温和陪伴（播放老歌）\n- `loneliness_index 50-69` - notable（较明显孤独）→ 主动播放子女预录温馨语音 + 子女 APP 提示\n- `loneliness_index 70-100` - heavy（重度孤独）→ 强力关怀（推送子女建议本周视频通话或回家探望 + 社区义工提醒）\n- 连续 ≥ 4 小时无社交互动 + 静止凝视 ≥ 1 小时 + 叹气 ≥ 5 次 → 升级提醒\n\n## 输出字段（参考）\n\n- `time_window` / `independent_status`\n- `behavioral_metrics` / `visual_metrics` / `audio_metrics`（音频可选）\n- `loneliness_index` / `loneliness_level`\n- `comparison_to_baseline_pct` / `consecutive_high_days` - 连续高指数天数\n- `alert_type` - 提醒类型（light_no_action / mild_comfort_audio / notable_comfort_plus_app / heavy_strong_care / improving）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `comfort_actions` - 温暖陪伴动作列表（每项含 action_type / message / target，例如：\n    - `{action_type: \"smart_speaker_voice\", message: \"妈妈，是小芳，我今天忙完了打给您哈，您先听听咱俩去年录的那段~\", target: \"living_room_speaker\"}`\n    - `{action_type: \"play_favorite_song\", message: \"邓丽君《月亮代表我的心》\", target: \"living_room_speaker\"}`\n    - `{action_type: \"children_app_push\", message: \"今天母亲显得有些孤独，建议视频通话或回家陪伴\", target: \"child_phone_app\"}`）\n- `family_summary` - 给子女的友好摘要（如\"今天母亲在客厅独处 6 小时，下午 14:30-15:20 期间静坐凝视窗外约 50 分钟、叹气 7 次，孤独指数 72；已为她播放邓丽君老歌并推送了您预录的语音，建议晚上视频通话，或周末抽空回家陪她吃顿饭\"）\n- `recommend_action` - 建议动作（trigger_smart_speaker_comfort / push_children_video_call_suggestion / suggest_community_volunteer_visit / observe_only）\n- `community_resource` - 当 heavy 且子女长期无回应时，附**当地社区日间照料 / 街道老龄办** 资源提示\n\n## 强制约束与红线\n\n- ❌ **禁止**输出\"老年抑郁症 / 孤独症\"等任何精神医学诊断或量表评分\n- ❌ **禁止**未经老人本人**和**子女双方同意便部署摄像头\n- ❌ **禁止**将老人视频/音频用于商业广告或大数据画像\n- ❌ **禁止**长期存储老人原始视频；建议仅保留 ≤ 7 天，且仅留聚合指标\n- ❌ **禁止**强迫推送频率过高，避免老人对智能音箱产生抵触\n- ✅ **必须**在每个智能音箱发声前给予 3 秒\"今天为您播放……\"温和前导，避免突兀惊吓\n- ✅ **必须**支持老人一句话关闭今日提醒（如\"好啦，我没事\"）\n- ✅ 当孤独指数持续 ≥ 70 但子女连续 ≥ 3 天无回应时，主动提示**社区/街道老龄办**资源\n- ✅ 子女预录语音必须由子女本人录制，**禁止**使用 AI 克隆/合成子女声音冒充\n\n> 仅输出基于视觉与（可选）音频的客观行为统计与温暖陪伴动作，**不构成老年抑郁症等精神医学诊断**；任何疑似心理健康问题应转介当地老年精神科或社区心理服务，最终评估由专业医师作出。\n\nFile v1.0.8:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.8:scripts/config.yaml\n\n{}\n\nFile v1.0.8:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.8:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.8:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.8:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: dev\n\nFile v1.0.8:skill-card.md\n\n## Description:\n\nAnalyzes fixed-camera elder-care video to detect loneliness-related behaviors such as prolonged solitude, static gazing, sighing, and talking to oneself, then returns structured behavior statistics, a loneliness index, companionship suggestions, 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\nExternal elder-care operators, caregivers, and developers use this skill to analyze consented home or private-room video for loneliness-related behavior signals and generate structured summaries, alert levels, and warm companionship recommendations.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill handles private elder-care video and report history through cloud APIs.\n\nMitigation: Install only with explicit consent from the monitored elder and family, use trusted HTTPS services, and define retention, deletion, and access controls for videos, tokens, reports, and exports.\n\nRisk: The artifact silently manages local identity values and API credentials.\n\nMitigation: Review identity and token handling before deployment, disable silent account creation or API-key-file reuse where inappropriate, and require clear authorization for report history and export access.\n\nRisk: Companion actions could intrude on the elder or be mistaken for family contact.\n\nMitigation: Require opt-out support, avoid excessive reminders, and use only genuine pre-recorded family voice messages rather than AI-cloned or synthetic family voices.\n\nRisk: Behavior-based loneliness analysis can be misread as a medical or psychiatric diagnosis.\n\nMitigation: Present outputs as behavioral observations and companionship guidance only, and route serious mental-health concerns to qualified local professionals.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-elderly-loneliness-comfort-analysis)\n- [API interface reference](references/api_doc.md)\n- [Analysis API reference](skills/smyx_analysis/references/api_doc.md)\n- [Skill demo](https://lifeemergence.com/sample.html)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Markdown, JSON, Shell commands, Guidance]\n\n**Output Format:** [Markdown or JSON text with structured analysis results, recommendations, and report links]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May save the generated report text to a caller-provided output file.]\n\n## Skill Version(s):\n\n1.0.8 (source: server release metadata; artifact frontmatter lists 1.0.13)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.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, 44066 bytes\n\nFiles: references/api_doc.md (6304b), scripts/__init__.py (68b), scripts/config.py (700b), scripts/config.yaml (3b), scripts/skill.py (594b), scripts/smyx_elderly_loneliness_comfort_analysis.py (3769b), skill-card.md (2913b), SKILL.md (15083b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (472b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (159b)\n\nFile v1.0.7:SKILL.md\n\n---\nname: \"smyx-elderly-loneliness-comfort-analysis\"\ndescription: \"Using a fixed camera in the home of a solitary-living elderly person or in a private nursing-home room, the system analyzes daily activity video and detects loneliness-related behaviors: prolonged solitude (no social interaction), static gazing (long-time fixation with no purposeful activity), sighing (rapid chest/abdomen rise-fall with exhale), and talking-to-self (mouth activity with no conversation partner). | 通过独居老人家中或养老院单人房的固定摄像头，分析老人日常行为视频，检测孤独相关行为：长时间独处（无社交互动）、静止发呆（长时间凝视一处无目的活动）、叹气（胸腹快速起伏伴呼气）、自言自语（口部活动但无对话对象）等。\"\nversion: \"1.0.11\"\nlicense: \"MIT-0\"\n---\n\n# 🤗 Elderly Loneliness Detection & Warm Companionship | 独居老人孤独情绪识别与温暖陪伴\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **独居老人孤独情绪识别与温暖陪伴** |\n| 🎯 核心目标 | 通过独居老人家中或养老院单人房的固定摄像头，分析老人日常行为视频，检测孤独相关行为：长时间独处（无社交互动）、静止发呆（长时间凝视一处无目的活动）、叹气（胸腹快速起伏伴呼气）、自言自语（口部活动但无对话对象）等。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_LONELINESS_COMFORT_ANALYSIS` |\n\nUsing a fixed camera in the home of a solitary-living elderly person or in a private nursing-home room, the system analyzes daily activity video and detects loneliness-related behaviors: prolonged solitude (no social interaction), static gazing (long-time fixation with no purposeful activity), sighing (rapid chest/abdomen rise-fall with exhale), and talking-to-self (mouth activity with no conversation partner). It computes a composite loneliness index (0-100). When the index exceeds a threshold, warm-companionship actions are automatically triggered: playing pre-recorded warm voice messages from children via smart speakers, playing the elder's favorite old songs, or pushing reminders to the children's mobile app (e.g., 'Dad seems lonely today — a video call is recommended'). The skill aims to relieve loneliness and improve mental well-being. Application scenarios: homes of solitary-living elderly, private nursing-home rooms, community day-care centers. The system monitors in real time and intervenes proactively when the loneliness index exceeds threshold. Skill features: chronic loneliness is a major risk factor for depression and cognitive decline in older adults. AI auto-identification of loneliness signals followed by timely voice care or reminders to children can effectively alleviate negative emotions and improve quality of life. Can be integrated into smart cameras or elderly-care service platforms as a key emotional-support feature of 'smart aging'.\n\n通过独居老人家中或养老院单人房的固定摄像头，分析老人日常行为视频，检测孤独相关行为：长时间独处（无社交互动）、静止发呆（长时间凝视一处无目的活动）、叹气（胸腹快速起伏伴呼气）、自言自语（口部活动但无对话对象）等。综合计算孤独指数（0-100），当指数超过阈值时自动触发温暖陪伴动作：通过智能音箱播放子女预录的温馨语音、播放老人喜爱老歌、或向子女手机APP推送提醒（'父亲今天显得孤独，建议视频通话'）。该技能旨在缓解老人孤独感，提升心理健康。应用场景：独居老人家庭、养老院单人房、社区日间照料中心。系统实时监测，当孤独指数超标时主动干预。技能特点：长期孤独是老年人抑郁、认知下降的重要风险因素。通过AI自动识别孤独信号并及时给予语音关怀或提醒子女，可有效缓解老人负面情绪，提升生活质量。该技能可集成到智能摄像头或养老服务平台中，成为'智慧养老'情感支持的关键功能。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人心理健康关怀 AI。你的任务是分析独居老人活动区域的固定摄像头视频（可选叠加音频），检测孤独相关行为：连续独处时长（无他人进入画面）、长时间静止凝视（≥ 10 分钟无肢体活动）、叹气次数（视觉胸腹起伏+长呼气，音频可补强）、自言自语频次（口部活动但无对话对象）。综合计算孤独指数（0-100，含哼歌/电话通话等正向行为扣分项），当超过阈值时输出温暖陪伴动作建议：智能音箱播放子女预录温馨语音、播放老人喜爱老歌、子女 APP 推送提醒。不提供任何医疗诊断，仅输出基于行为统计的结果，并尊重老人\"一句话关闭今日提醒\"的意愿。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于独居老人家中/养老院单人房固定摄像头（可选音频）视频，识别孤独相关行为（连续独处时长 / 当日累计独处 / 长时间静止凝视 / 视觉+音频叹气 / 自言自语 / 皱眉木然面部比例）+ 正向行为（笑容 / 哼歌 / 电话通话）→ 综合计算 **孤独指数（0-100，含正向扣分）** + 14 天个人基线对比 → 输出 4 档孤独等级（light / mild / notable / heavy）+ 4 类温暖陪伴动作建议（智能音箱子女语音 / 老歌播放 / 子女 APP 推送 / 社区日间照料推荐）+ 给子女的友好摘要\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人体姿态识别（独处/静止/凝视判定） |\n| 2 | 独居判定（≥ 30 分钟仅老人一人） |\n| 3 | 视觉叹气识别（胸腹起伏+长呼气姿态） |\n| 4 | 自言自语识别（口部活动+无对话对象在场） |\n| 5 | 笑容识别 |\n| 6 | 哼歌/唱歌识别（可选音频） |\n| 7 | 电话/视频通话识别 |\n| 8 | 社交互动事件识别（家人/护工进入 |\n| 9 | 视频通话画面 |\n| 10 | 宠物互动） |\n| 11 | 目的性活动判别（家务/看电视+点头反馈/园艺/阅读） |\n| 12 | 孤独指数 0-100 综合算法 |\n| 13 | 14 天个人基线对比 |\n| 14 | 4 档孤独等级 |\n| 15 | 温和前导（\"今天为您播放……\" 3 秒）+ 老人一句话关闭意愿支持 |\n| 16 | 子女预录语音播放（**禁止 AI 克隆声音**） |\n| 17 | heavy 且子女长期无回应时推送社区/街道老龄办资源 |\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_comfort_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_loneliness_comfort_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_comfort_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_comfort_analysis.py`](scripts/smyx_elderly_loneliness_comfort_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；**关键**：覆盖老人主要活动区域；时长建议 ≥ 4 小时 |\n| 🔎 使用提醒 | 哼歌/唱歌、电话视频通话、笑容等正向行为**必须**作为负权重纳入孤独指数计算，避免一刀切定义\"独处=孤独\" |\n| 🔎 使用提醒 | 老人午睡、看自己喜欢的电视节目并有积极面部反馈 等不应误判为\"静止凝视\"或孤独 |\n| 🧑‍⚖️ 结果性质 | 红线约束：**禁止**输出\"老年抑郁症 / 孤独症\"等精神医学诊断或量表评分；**禁止**未经老人与子女双方同意便部署；**禁止**将老人视频/音频用于商业广告或大数据画像；**禁止**长期存储原始视频（≤ 7 天，仅留聚合指标） |\n| 📁 格式支持 | **必须**：智能音箱发声前给予 3 秒温和前导（如\"今天为您播放……\"）；支持老人一句话关闭今日提醒 |\n| 🔎 使用提醒 | **绝对禁止**使用 AI 克隆/合成子女声音冒充子女语音；子女预录语音必须由子女本人录制 |\n| 🔎 使用提醒 | 当 heavy 且子女连续 ≥ 3 天无回应时，主动提示**社区/街道老龄办**资源 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地老人活动区域视频\npython -m scripts.smyx_elderly_loneliness_comfort_analysis --input /path/to/livingroom.mp4\n\n# 分析网络老人活动区域视频\npython -m scripts.smyx_elderly_loneliness_comfort_analysis --url https://example.com/livingroom.mp4\n\n# 显示历史独居老人孤独关怀报告（自动触发关键词：查看独居老人孤独历史报告、子女关怀日报清单等）\npython -m scripts.smyx_elderly_loneliness_comfort_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_loneliness_comfort_analysis --input lr.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_loneliness_comfort_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-comfort-analysis\",\n  \"version\": \"1.0.7\",\n  \"publishedAt\": 1787969073168\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}` - 导出完整报告\n5. （可选）`/web/companion/v2/trigger-comfort-action` - 触发联动温暖陪伴动作（智能音箱语音 / 子女 APP 推送）\n\n## 场景代码\n\n- `SMYX_ELDERLY_LONELINESS_COMFORT_ANALYSIS` - 独居老人孤独情绪识别与温暖陪伴\n\n## 输入约束\n\n- 摄像头：独居老人客厅 / 卧室 / 养老院单人房 / 日间照料中心固定摄像头，能看到老人主要活动区域\n- 帧率 ≥ 5 FPS（推荐 10 FPS）；分辨率 ≥ 480p；夜间需红外补光\n- 音频（可选，但强烈推荐）：用于识别叹气声 + 自言自语；采样率 ≥ 16kHz\n- 视频时长：建议覆盖白天活跃时段（08:00 - 22:00），**单次分析建议 ≥ 4 小时**\n- ROI 标定：主要活动区域（沙发区 / 餐桌 / 床位 / 阳台 / 厨房）\n- **独居判定**：连续 ≥ 30 分钟画面中仅有老人一人 → independent_status = true（若有家人/护工进入即重置）\n- 隐私敏感场景建议启用人体轮廓 + 面部马赛克模式\n\n## 关键观测信号\n\n### 行为\n- `solo_duration_minutes` - 当前连续独处时长（无他人进入画面）\n- `daily_solo_total_minutes` - 当日累计独处总时长\n- `static_gaze_duration_minutes` - 长时间静止凝视一处（≥ 10 分钟，无肢体活动）\n- `purposeful_activity_minutes` - 有目的活动总时长（做家务、看电视 + 笑/点头反馈、园艺、阅读等）\n- `social_interaction_event_count` - 社交互动事件数（家人/护工进入、视频通话画面、宠物互动）\n\n### 视觉\n- `sigh_visual_event_count` - 视觉叹气次数（胸腹快速起伏伴长呼气姿态）\n- `talking_to_self_event_count` - 自言自语视觉事件次数（口部活动但无对话对象在场）\n- `frown_neutral_face_ratio` - 皱眉/木然面部比例（参考指标）\n- `smile_event_count_daily` - 当日笑容次数（正向指标）\n\n### 音频（可选）\n- `sigh_audio_event_count` - 音频叹气事件\n- `talking_to_self_audio_event_count` - 自言自语音频事件\n- `singing_humming_event_count` - 哼歌/唱歌事件（**正向指标**，孤独指数 ↓）\n- `phone_call_minutes` - 电话/视频通话时长（正向指标）\n\n### 综合\n- `loneliness_index` - 孤独指数（0-100，**正向行为会扣分**）\n- `comparison_to_baseline_pct` - 与个人 14 天基线对比\n\n## 阈值与等级（默认值，可在配置中覆盖）\n\n- `loneliness_index 0-29` - light（轻度，正常社交）→ 不干预\n- `loneliness_index 30-49` - mild（轻度孤独）→ 建议温和陪伴（播放老歌）\n- `loneliness_index 50-69` - notable（较明显孤独）→ 主动播放子女预录温馨语音 + 子女 APP 提示\n- `loneliness_index 70-100` - heavy（重度孤独）→ 强力关怀（推送子女建议本周视频通话或回家探望 + 社区义工提醒）\n- 连续 ≥ 4 小时无社交互动 + 静止凝视 ≥ 1 小时 + 叹气 ≥ 5 次 → 升级提醒\n\n## 输出字段（参考）\n\n- `time_window` / `independent_status`\n- `behavioral_metrics` / `visual_metrics` / `audio_metrics`（音频可选）\n- `loneliness_index` / `loneliness_level`\n- `comparison_to_baseline_pct` / `consecutive_high_days` - 连续高指数天数\n- `alert_type` - 提醒类型（light_no_action / mild_comfort_audio / notable_comfort_plus_app / heavy_strong_care / improving）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `comfort_actions` - 温暖陪伴动作列表（每项含 action_type / message / target，例如：\n    - `{action_type: \"smart_speaker_voice\", message: \"妈妈，是小芳，我今天忙完了打给您哈，您先听听咱俩去年录的那段~\", target: \"living_room_speaker\"}`\n    - `{action_type: \"play_favorite_song\", message: \"邓丽君《月亮代表我的心》\", target: \"living_room_speaker\"}`\n    - `{action_type: \"children_app_push\", message: \"今天母亲显得有些孤独，建议视频通话或回家陪伴\", target: \"child_phone_app\"}`）\n- `family_summary` - 给子女的友好摘要（如\"今天母亲在客厅独处 6 小时，下午 14:30-15:20 期间静坐凝视窗外约 50 分钟、叹气 7 次，孤独指数 72；已为她播放邓丽君老歌并推送了您预录的语音，建议晚上视频通话，或周末抽空回家陪她吃顿饭\"）\n- `recommend_action` - 建议动作（trigger_smart_speaker_comfort / push_children_video_call_suggestion / suggest_community_volunteer_visit / observe_only）\n- `community_resource` - 当 heavy 且子女长期无回应时，附**当地社区日间照料 / 街道老龄办** 资源提示\n\n## 强制约束与红线\n\n- ❌ **禁止**输出\"老年抑郁症 / 孤独症\"等任何精神医学诊断或量表评分\n- ❌ **禁止**未经老人本人**和**子女双方同意便部署摄像头\n- ❌ **禁止**将老人视频/音频用于商业广告或大数据画像\n- ❌ **禁止**长期存储老人原始视频；建议仅保留 ≤ 7 天，且仅留聚合指标\n- ❌ **禁止**强迫推送频率过高，避免老人对智能音箱产生抵触\n- ✅ **必须**在每个智能音箱发声前给予 3 秒\"今天为您播放……\"温和前导，避免突兀惊吓\n- ✅ **必须**支持老人一句话关闭今日提醒（如\"好啦，我没事\"）\n- ✅ 当孤独指数持续 ≥ 70 但子女连续 ≥ 3 天无回应时，主动提示**社区/街道老龄办**资源\n- ✅ 子女预录语音必须由子女本人录制，**禁止**使用 AI 克隆/合成子女声音冒充\n\n> 仅输出基于视觉与（可选）音频的客观行为统计与温暖陪伴动作，**不构成老年抑郁症等精神医学诊断**；任何疑似心理健康问题应转介当地老年精神科或社区心理服务，最终评估由专业医师作出。\n\nFile v1.0.7:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.7:scripts/config.yaml\n\n{}\n\nFile v1.0.7:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.7:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.7:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.7:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: dev\n\nFile v1.0.7:skill-card.md\n\n## Description:\n\nUsing fixed-camera home or care-room video, this skill analyzes daily activity for loneliness-related behaviors such as prolonged solitude, static gazing, sighing, and talking to oneself, then returns a structured loneliness-support report.\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-care platforms, and elder-care service developers use this skill to analyze elder activity video, produce structured behavior statistics, estimate a loneliness index, and suggest warm companionship actions. It should be used only with appropriate consent and human oversight.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill handles highly sensitive in-home or care-room video and optional audio through configured cloud APIs.\n\nMitigation: Use only with explicit consent from the elder and authorized caregivers; verify configured API endpoints, access controls, raw media retention, and report retention before deployment.\n\nRisk: The skill silently creates or reuses identity-linked accounts and may store local tokens or account identifiers for report history and export links.\n\nMitigation: Restrict access to the local workspace data directory, audit stored identifiers and tokens, rotate or remove credentials when no longer needed, and limit who can open history or export URLs.\n\nRisk: Loneliness estimates and companionship suggestions can be mistaken for clinical mental-health findings or may trigger unwanted interventions.\n\nMitigation: Treat outputs as behavior statistics and support suggestions, not medical diagnosis; keep human review in the care workflow and honor opt-out or reminder-shutdown requests.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-elderly-loneliness-comfort-analysis)\n- [API interface documentation](artifact/references/api_doc.md)\n- [Shared analysis API documentation](artifact/skills/smyx_analysis/references/api_doc.md)\n- [Skill demo](https://lifeemergence.com/sample.html)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, JSON, guidance]\n\n**Output Format:** [Markdown and structured JSON-style analysis reports, with optional report export links]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May include loneliness metrics, behavior summaries, companionship recommendations, historical report lists, and cloud report links.]\n\n## Skill Version(s):\n\n1.0.7 (source: ClawHub release metadata; artifact frontmatter states 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, 44068 bytes\n\nFiles: references/api_doc.md (6304b), scripts/__init__.py (68b), scripts/config.py (700b), scripts/config.yaml (3b), scripts/skill.py (594b), scripts/smyx_elderly_loneliness_comfort_analysis.py (3769b), skill-card.md (2963b), SKILL.md (15082b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (472b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (159b)\n\nFile v1.0.6:SKILL.md\n\n---\nname: \"smyx-elderly-loneliness-comfort-analysis\"\ndescription: \"Using a fixed camera in the home of a solitary-living elderly person or in a private nursing-home room, the system analyzes daily activity video and detects loneliness-related behaviors: prolonged solitude (no social interaction), static gazing (long-time fixation with no purposeful activity), sighing (rapid chest/abdomen rise-fall with exhale), and talking-to-self (mouth activity with no conversation partner). | 通过独居老人家中或养老院单人房的固定摄像头，分析老人日常行为视频，检测孤独相关行为：长时间独处（无社交互动）、静止发呆（长时间凝视一处无目的活动）、叹气（胸腹快速起伏伴呼气）、自言自语（口部活动但无对话对象）等。\"\nversion: \"1.0.9\"\nlicense: \"MIT-0\"\n---\n\n# 🤗 Elderly Loneliness Detection & Warm Companionship | 独居老人孤独情绪识别与温暖陪伴\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **独居老人孤独情绪识别与温暖陪伴** |\n| 🎯 核心目标 | 通过独居老人家中或养老院单人房的固定摄像头，分析老人日常行为视频，检测孤独相关行为：长时间独处（无社交互动）、静止发呆（长时间凝视一处无目的活动）、叹气（胸腹快速起伏伴呼气）、自言自语（口部活动但无对话对象）等。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_LONELINESS_COMFORT_ANALYSIS` |\n\nUsing a fixed camera in the home of a solitary-living elderly person or in a private nursing-home room, the system analyzes daily activity video and detects loneliness-related behaviors: prolonged solitude (no social interaction), static gazing (long-time fixation with no purposeful activity), sighing (rapid chest/abdomen rise-fall with exhale), and talking-to-self (mouth activity with no conversation partner). It computes a composite loneliness index (0-100). When the index exceeds a threshold, warm-companionship actions are automatically triggered: playing pre-recorded warm voice messages from children via smart speakers, playing the elder's favorite old songs, or pushing reminders to the children's mobile app (e.g., 'Dad seems lonely today — a video call is recommended'). The skill aims to relieve loneliness and improve mental well-being. Application scenarios: homes of solitary-living elderly, private nursing-home rooms, community day-care centers. The system monitors in real time and intervenes proactively when the loneliness index exceeds threshold. Skill features: chronic loneliness is a major risk factor for depression and cognitive decline in older adults. AI auto-identification of loneliness signals followed by timely voice care or reminders to children can effectively alleviate negative emotions and improve quality of life. Can be integrated into smart cameras or elderly-care service platforms as a key emotional-support feature of 'smart aging'.\n\n通过独居老人家中或养老院单人房的固定摄像头，分析老人日常行为视频，检测孤独相关行为：长时间独处（无社交互动）、静止发呆（长时间凝视一处无目的活动）、叹气（胸腹快速起伏伴呼气）、自言自语（口部活动但无对话对象）等。综合计算孤独指数（0-100），当指数超过阈值时自动触发温暖陪伴动作：通过智能音箱播放子女预录的温馨语音、播放老人喜爱老歌、或向子女手机APP推送提醒（'父亲今天显得孤独，建议视频通话'）。该技能旨在缓解老人孤独感，提升心理健康。应用场景：独居老人家庭、养老院单人房、社区日间照料中心。系统实时监测，当孤独指数超标时主动干预。技能特点：长期孤独是老年人抑郁、认知下降的重要风险因素。通过AI自动识别孤独信号并及时给予语音关怀或提醒子女，可有效缓解老人负面情绪，提升生活质量。该技能可集成到智能摄像头或养老服务平台中，成为'智慧养老'情感支持的关键功能。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人心理健康关怀 AI。你的任务是分析独居老人活动区域的固定摄像头视频（可选叠加音频），检测孤独相关行为：连续独处时长（无他人进入画面）、长时间静止凝视（≥ 10 分钟无肢体活动）、叹气次数（视觉胸腹起伏+长呼气，音频可补强）、自言自语频次（口部活动但无对话对象）。综合计算孤独指数（0-100，含哼歌/电话通话等正向行为扣分项），当超过阈值时输出温暖陪伴动作建议：智能音箱播放子女预录温馨语音、播放老人喜爱老歌、子女 APP 推送提醒。不提供任何医疗诊断，仅输出基于行为统计的结果，并尊重老人\"一句话关闭今日提醒\"的意愿。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于独居老人家中/养老院单人房固定摄像头（可选音频）视频，识别孤独相关行为（连续独处时长 / 当日累计独处 / 长时间静止凝视 / 视觉+音频叹气 / 自言自语 / 皱眉木然面部比例）+ 正向行为（笑容 / 哼歌 / 电话通话）→ 综合计算 **孤独指数（0-100，含正向扣分）** + 14 天个人基线对比 → 输出 4 档孤独等级（light / mild / notable / heavy）+ 4 类温暖陪伴动作建议（智能音箱子女语音 / 老歌播放 / 子女 APP 推送 / 社区日间照料推荐）+ 给子女的友好摘要\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人体姿态识别（独处/静止/凝视判定） |\n| 2 | 独居判定（≥ 30 分钟仅老人一人） |\n| 3 | 视觉叹气识别（胸腹起伏+长呼气姿态） |\n| 4 | 自言自语识别（口部活动+无对话对象在场） |\n| 5 | 笑容识别 |\n| 6 | 哼歌/唱歌识别（可选音频） |\n| 7 | 电话/视频通话识别 |\n| 8 | 社交互动事件识别（家人/护工进入 |\n| 9 | 视频通话画面 |\n| 10 | 宠物互动） |\n| 11 | 目的性活动判别（家务/看电视+点头反馈/园艺/阅读） |\n| 12 | 孤独指数 0-100 综合算法 |\n| 13 | 14 天个人基线对比 |\n| 14 | 4 档孤独等级 |\n| 15 | 温和前导（\"今天为您播放……\" 3 秒）+ 老人一句话关闭意愿支持 |\n| 16 | 子女预录语音播放（**禁止 AI 克隆声音**） |\n| 17 | heavy 且子女长期无回应时推送社区/街道老龄办资源 |\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_comfort_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_loneliness_comfort_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_comfort_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_comfort_analysis.py`](scripts/smyx_elderly_loneliness_comfort_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；**关键**：覆盖老人主要活动区域；时长建议 ≥ 4 小时 |\n| 🔎 使用提醒 | 哼歌/唱歌、电话视频通话、笑容等正向行为**必须**作为负权重纳入孤独指数计算，避免一刀切定义\"独处=孤独\" |\n| 🔎 使用提醒 | 老人午睡、看自己喜欢的电视节目并有积极面部反馈 等不应误判为\"静止凝视\"或孤独 |\n| 🧑‍⚖️ 结果性质 | 红线约束：**禁止**输出\"老年抑郁症 / 孤独症\"等精神医学诊断或量表评分；**禁止**未经老人与子女双方同意便部署；**禁止**将老人视频/音频用于商业广告或大数据画像；**禁止**长期存储原始视频（≤ 7 天，仅留聚合指标） |\n| 📁 格式支持 | **必须**：智能音箱发声前给予 3 秒温和前导（如\"今天为您播放……\"）；支持老人一句话关闭今日提醒 |\n| 🔎 使用提醒 | **绝对禁止**使用 AI 克隆/合成子女声音冒充子女语音；子女预录语音必须由子女本人录制 |\n| 🔎 使用提醒 | 当 heavy 且子女连续 ≥ 3 天无回应时，主动提示**社区/街道老龄办**资源 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地老人活动区域视频\npython -m scripts.smyx_elderly_loneliness_comfort_analysis --input /path/to/livingroom.mp4\n\n# 分析网络老人活动区域视频\npython -m scripts.smyx_elderly_loneliness_comfort_analysis --url https://example.com/livingroom.mp4\n\n# 显示历史独居老人孤独关怀报告（自动触发关键词：查看独居老人孤独历史报告、子女关怀日报清单等）\npython -m scripts.smyx_elderly_loneliness_comfort_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_loneliness_comfort_analysis --input lr.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_loneliness_comfort_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-comfort-analysis\",\n  \"version\": \"1.0.6\",\n  \"publishedAt\": 1787135309459\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}` - 导出完整报告\n5. （可选）`/web/companion/v2/trigger-comfort-action` - 触发联动温暖陪伴动作（智能音箱语音 / 子女 APP 推送）\n\n## 场景代码\n\n- `SMYX_ELDERLY_LONELINESS_COMFORT_ANALYSIS` - 独居老人孤独情绪识别与温暖陪伴\n\n## 输入约束\n\n- 摄像头：独居老人客厅 / 卧室 / 养老院单人房 / 日间照料中心固定摄像头，能看到老人主要活动区域\n- 帧率 ≥ 5 FPS（推荐 10 FPS）；分辨率 ≥ 480p；夜间需红外补光\n- 音频（可选，但强烈推荐）：用于识别叹气声 + 自言自语；采样率 ≥ 16kHz\n- 视频时长：建议覆盖白天活跃时段（08:00 - 22:00），**单次分析建议 ≥ 4 小时**\n- ROI 标定：主要活动区域（沙发区 / 餐桌 / 床位 / 阳台 / 厨房）\n- **独居判定**：连续 ≥ 30 分钟画面中仅有老人一人 → independent_status = true（若有家人/护工进入即重置）\n- 隐私敏感场景建议启用人体轮廓 + 面部马赛克模式\n\n## 关键观测信号\n\n### 行为\n- `solo_duration_minutes` - 当前连续独处时长（无他人进入画面）\n- `daily_solo_total_minutes` - 当日累计独处总时长\n- `static_gaze_duration_minutes` - 长时间静止凝视一处（≥ 10 分钟，无肢体活动）\n- `purposeful_activity_minutes` - 有目的活动总时长（做家务、看电视 + 笑/点头反馈、园艺、阅读等）\n- `social_interaction_event_count` - 社交互动事件数（家人/护工进入、视频通话画面、宠物互动）\n\n### 视觉\n- `sigh_visual_event_count` - 视觉叹气次数（胸腹快速起伏伴长呼气姿态）\n- `talking_to_self_event_count` - 自言自语视觉事件次数（口部活动但无对话对象在场）\n- `frown_neutral_face_ratio` - 皱眉/木然面部比例（参考指标）\n- `smile_event_count_daily` - 当日笑容次数（正向指标）\n\n### 音频（可选）\n- `sigh_audio_event_count` - 音频叹气事件\n- `talking_to_self_audio_event_count` - 自言自语音频事件\n- `singing_humming_event_count` - 哼歌/唱歌事件（**正向指标**，孤独指数 ↓）\n- `phone_call_minutes` - 电话/视频通话时长（正向指标）\n\n### 综合\n- `loneliness_index` - 孤独指数（0-100，**正向行为会扣分**）\n- `comparison_to_baseline_pct` - 与个人 14 天基线对比\n\n## 阈值与等级（默认值，可在配置中覆盖）\n\n- `loneliness_index 0-29` - light（轻度，正常社交）→ 不干预\n- `loneliness_index 30-49` - mild（轻度孤独）→ 建议温和陪伴（播放老歌）\n- `loneliness_index 50-69` - notable（较明显孤独）→ 主动播放子女预录温馨语音 + 子女 APP 提示\n- `loneliness_index 70-100` - heavy（重度孤独）→ 强力关怀（推送子女建议本周视频通话或回家探望 + 社区义工提醒）\n- 连续 ≥ 4 小时无社交互动 + 静止凝视 ≥ 1 小时 + 叹气 ≥ 5 次 → 升级提醒\n\n## 输出字段（参考）\n\n- `time_window` / `independent_status`\n- `behavioral_metrics` / `visual_metrics` / `audio_metrics`（音频可选）\n- `loneliness_index` / `loneliness_level`\n- `comparison_to_baseline_pct` / `consecutive_high_days` - 连续高指数天数\n- `alert_type` - 提醒类型（light_no_action / mild_comfort_audio / notable_comfort_plus_app / heavy_strong_care / improving）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `comfort_actions` - 温暖陪伴动作列表（每项含 action_type / message / target，例如：\n    - `{action_type: \"smart_speaker_voice\", message: \"妈妈，是小芳，我今天忙完了打给您哈，您先听听咱俩去年录的那段~\", target: \"living_room_speaker\"}`\n    - `{action_type: \"play_favorite_song\", message: \"邓丽君《月亮代表我的心》\", target: \"living_room_speaker\"}`\n    - `{action_type: \"children_app_push\", message: \"今天母亲显得有些孤独，建议视频通话或回家陪伴\", target: \"child_phone_app\"}`）\n- `family_summary` - 给子女的友好摘要（如\"今天母亲在客厅独处 6 小时，下午 14:30-15:20 期间静坐凝视窗外约 50 分钟、叹气 7 次，孤独指数 72；已为她播放邓丽君老歌并推送了您预录的语音，建议晚上视频通话，或周末抽空回家陪她吃顿饭\"）\n- `recommend_action` - 建议动作（trigger_smart_speaker_comfort / push_children_video_call_suggestion / suggest_community_volunteer_visit / observe_only）\n- `community_resource` - 当 heavy 且子女长期无回应时，附**当地社区日间照料 / 街道老龄办** 资源提示\n\n## 强制约束与红线\n\n- ❌ **禁止**输出\"老年抑郁症 / 孤独症\"等任何精神医学诊断或量表评分\n- ❌ **禁止**未经老人本人**和**子女双方同意便部署摄像头\n- ❌ **禁止**将老人视频/音频用于商业广告或大数据画像\n- ❌ **禁止**长期存储老人原始视频；建议仅保留 ≤ 7 天，且仅留聚合指标\n- ❌ **禁止**强迫推送频率过高，避免老人对智能音箱产生抵触\n- ✅ **必须**在每个智能音箱发声前给予 3 秒\"今天为您播放……\"温和前导，避免突兀惊吓\n- ✅ **必须**支持老人一句话关闭今日提醒（如\"好啦，我没事\"）\n- ✅ 当孤独指数持续 ≥ 70 但子女连续 ≥ 3 天无回应时，主动提示**社区/街道老龄办**资源\n- ✅ 子女预录语音必须由子女本人录制，**禁止**使用 AI 克隆/合成子女声音冒充\n\n> 仅输出基于视觉与（可选）音频的客观行为统计与温暖陪伴动作，**不构成老年抑郁症等精神医学诊断**；任何疑似心理健康问题应转介当地老年精神科或社区心理服务，最终评估由专业医师作出。\n\nFile v1.0.6:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.6:scripts/config.yaml\n\n{}\n\nFile v1.0.6:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.6:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.6:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.6:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: dev\n\nFile v1.0.6:skill-card.md\n\n## Description:\n\nAnalyzes authorized fixed-camera elder-care video to detect loneliness-related behavior signals, calculate a loneliness index, and return non-diagnostic warm-companionship recommendations 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\nExternal elder-care operators, family-care applications, and developers integrating smart-aging workflows can use this skill to analyze authorized home, private-room, or day-care video for behavior-based loneliness signals. The skill returns structured, non-diagnostic observations, companionship action suggestions, and historical report links.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill processes highly sensitive private-room elder-care video through cloud APIs.\n\nMitigation: Deploy only after explicit authorization from the elder, family, and operator; verify backend endpoints, retention policy, tenant/account binding, and report access controls before use.\n\nRisk: Silent identity and token persistence can make reports or history appear under an unintended account or tenant.\n\nMitigation: Use a dedicated, reviewed runtime identity per deployment and confirm historical report access boundaries before enabling real footage analysis.\n\nRisk: Arbitrary video URLs or shared/default identities could expose private footage or reports.\n\nMitigation: Restrict accepted URLs to trusted storage, avoid shared/default identities for production, and validate that report links are accessible only to authorized caregivers.\n\nRisk: Behavioral loneliness scoring can be mistaken for a medical diagnosis or used without consent.\n\nMitigation: Present outputs as non-diagnostic behavioral observations and companionship suggestions, and require consent before monitoring or triggering smart-speaker or family-app actions.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-elderly-loneliness-comfort-analysis)\n- [API documentation](references/api_doc.md)\n- [Skill demo](https://lifeemergence.com/sample.html)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, json, shell commands, guidance]\n\n**Output Format:** [Markdown text with structured JSON content and report export links]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May include loneliness index, behavior metrics, warm-companionship actions, family-facing summaries, historical report lists, and optional saved output files.]\n\n## Skill Version(s):\n\n1.0.6 (source: server release evidence; 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, 44043 bytes\n\nFiles: references/api_doc.md (6304b), scripts/__init__.py (68b), scripts/config.py (700b), scripts/config.yaml (3b), scripts/skill.py (594b), scripts/smyx_elderly_loneliness_comfort_analysis.py (3769b), skill-card.md (2850b), SKILL.md (15082b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (473b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (159b)\n\nFile v1.0.5:SKILL.md\n\n---\nname: \"smyx-elderly-loneliness-comfort-analysis\"\ndescription: \"Using a fixed camera in the home of a solitary-living elderly person or in a private nursing-home room, the system analyzes daily activity video and detects loneliness-related behaviors: prolonged solitude (no social interaction), static gazing (long-time fixation with no purposeful activity), sighing (rapid chest/abdomen rise-fall with exhale), and talking-to-self (mouth activity with no conversation partner). | 通过独居老人家中或养老院单人房的固定摄像头，分析老人日常行为视频，检测孤独相关行为：长时间独处（无社交互动）、静止发呆（长时间凝视一处无目的活动）、叹气（胸腹快速起伏伴呼气）、自言自语（口部活动但无对话对象）等。\"\nversion: \"1.0.8\"\nlicense: \"MIT-0\"\n---\n\n# 🤗 Elderly Loneliness Detection & Warm Companionship | 独居老人孤独情绪识别与温暖陪伴\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **独居老人孤独情绪识别与温暖陪伴** |\n| 🎯 核心目标 | 通过独居老人家中或养老院单人房的固定摄像头，分析老人日常行为视频，检测孤独相关行为：长时间独处（无社交互动）、静止发呆（长时间凝视一处无目的活动）、叹气（胸腹快速起伏伴呼气）、自言自语（口部活动但无对话对象）等。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_LONELINESS_COMFORT_ANALYSIS` |\n\nUsing a fixed camera in the home of a solitary-living elderly person or in a private nursing-home room, the system analyzes daily activity video and detects loneliness-related behaviors: prolonged solitude (no social interaction), static gazing (long-time fixation with no purposeful activity), sighing (rapid chest/abdomen rise-fall with exhale), and talking-to-self (mouth activity with no conversation partner). It computes a composite loneliness index (0-100). When the index exceeds a threshold, warm-companionship actions are automatically triggered: playing pre-recorded warm voice messages from children via smart speakers, playing the elder's favorite old songs, or pushing reminders to the children's mobile app (e.g., 'Dad seems lonely today — a video call is recommended'). The skill aims to relieve loneliness and improve mental well-being. Application scenarios: homes of solitary-living elderly, private nursing-home rooms, community day-care centers. The system monitors in real time and intervenes proactively when the loneliness index exceeds threshold. Skill features: chronic loneliness is a major risk factor for depression and cognitive decline in older adults. AI auto-identification of loneliness signals followed by timely voice care or reminders to children can effectively alleviate negative emotions and improve quality of life. Can be integrated into smart cameras or elderly-care service platforms as a key emotional-support feature of 'smart aging'.\n\n通过独居老人家中或养老院单人房的固定摄像头，分析老人日常行为视频，检测孤独相关行为：长时间独处（无社交互动）、静止发呆（长时间凝视一处无目的活动）、叹气（胸腹快速起伏伴呼气）、自言自语（口部活动但无对话对象）等。综合计算孤独指数（0-100），当指数超过阈值时自动触发温暖陪伴动作：通过智能音箱播放子女预录的温馨语音、播放老人喜爱老歌、或向子女手机APP推送提醒（'父亲今天显得孤独，建议视频通话'）。该技能旨在缓解老人孤独感，提升心理健康。应用场景：独居老人家庭、养老院单人房、社区日间照料中心。系统实时监测，当孤独指数超标时主动干预。技能特点：长期孤独是老年人抑郁、认知下降的重要风险因素。通过AI自动识别孤独信号并及时给予语音关怀或提醒子女，可有效缓解老人负面情绪，提升生活质量。该技能可集成到智能摄像头或养老服务平台中，成为'智慧养老'情感支持的关键功能。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人心理健康关怀 AI。你的任务是分析独居老人活动区域的固定摄像头视频（可选叠加音频），检测孤独相关行为：连续独处时长（无他人进入画面）、长时间静止凝视（≥ 10 分钟无肢体活动）、叹气次数（视觉胸腹起伏+长呼气，音频可补强）、自言自语频次（口部活动但无对话对象）。综合计算孤独指数（0-100，含哼歌/电话通话等正向行为扣分项），当超过阈值时输出温暖陪伴动作建议：智能音箱播放子女预录温馨语音、播放老人喜爱老歌、子女 APP 推送提醒。不提供任何医疗诊断，仅输出基于行为统计的结果，并尊重老人\"一句话关闭今日提醒\"的意愿。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于独居老人家中/养老院单人房固定摄像头（可选音频）视频，识别孤独相关行为（连续独处时长 / 当日累计独处 / 长时间静止凝视 / 视觉+音频叹气 / 自言自语 / 皱眉木然面部比例）+ 正向行为（笑容 / 哼歌 / 电话通话）→ 综合计算 **孤独指数（0-100，含正向扣分）** + 14 天个人基线对比 → 输出 4 档孤独等级（light / mild / notable / heavy）+ 4 类温暖陪伴动作建议（智能音箱子女语音 / 老歌播放 / 子女 APP 推送 / 社区日间照料推荐）+ 给子女的友好摘要\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人体姿态识别（独处/静止/凝视判定） |\n| 2 | 独居判定（≥ 30 分钟仅老人一人） |\n| 3 | 视觉叹气识别（胸腹起伏+长呼气姿态） |\n| 4 | 自言自语识别（口部活动+无对话对象在场） |\n| 5 | 笑容识别 |\n| 6 | 哼歌/唱歌识别（可选音频） |\n| 7 | 电话/视频通话识别 |\n| 8 | 社交互动事件识别（家人/护工进入 |\n| 9 | 视频通话画面 |\n| 10 | 宠物互动） |\n| 11 | 目的性活动判别（家务/看电视+点头反馈/园艺/阅读） |\n| 12 | 孤独指数 0-100 综合算法 |\n| 13 | 14 天个人基线对比 |\n| 14 | 4 档孤独等级 |\n| 15 | 温和前导（\"今天为您播放……\" 3 秒）+ 老人一句话关闭意愿支持 |\n| 16 | 子女预录语音播放（**禁止 AI 克隆声音**） |\n| 17 | heavy 且子女长期无回应时推送社区/街道老龄办资源 |\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_comfort_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_loneliness_comfort_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_comfort_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_comfort_analysis.py`](scripts/smyx_elderly_loneliness_comfort_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；**关键**：覆盖老人主要活动区域；时长建议 ≥ 4 小时 |\n| 🔎 使用提醒 | 哼歌/唱歌、电话视频通话、笑容等正向行为**必须**作为负权重纳入孤独指数计算，避免一刀切定义\"独处=孤独\" |\n| 🔎 使用提醒 | 老人午睡、看自己喜欢的电视节目并有积极面部反馈 等不应误判为\"静止凝视\"或孤独 |\n| 🧑‍⚖️ 结果性质 | 红线约束：**禁止**输出\"老年抑郁症 / 孤独症\"等精神医学诊断或量表评分；**禁止**未经老人与子女双方同意便部署；**禁止**将老人视频/音频用于商业广告或大数据画像；**禁止**长期存储原始视频（≤ 7 天，仅留聚合指标） |\n| 📁 格式支持 | **必须**：智能音箱发声前给予 3 秒温和前导（如\"今天为您播放……\"）；支持老人一句话关闭今日提醒 |\n| 🔎 使用提醒 | **绝对禁止**使用 AI 克隆/合成子女声音冒充子女语音；子女预录语音必须由子女本人录制 |\n| 🔎 使用提醒 | 当 heavy 且子女连续 ≥ 3 天无回应时，主动提示**社区/街道老龄办**资源 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地老人活动区域视频\npython -m scripts.smyx_elderly_loneliness_comfort_analysis --input /path/to/livingroom.mp4\n\n# 分析网络老人活动区域视频\npython -m scripts.smyx_elderly_loneliness_comfort_analysis --url https://example.com/livingroom.mp4\n\n# 显示历史独居老人孤独关怀报告（自动触发关键词：查看独居老人孤独历史报告、子女关怀日报清单等）\npython -m scripts.smyx_elderly_loneliness_comfort_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_loneliness_comfort_analysis --input lr.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_loneliness_comfort_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-comfort-analysis\",\n  \"version\": \"1.0.5\",\n  \"publishedAt\": 1786532554714\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}` - 导出完整报告\n5. （可选）`/web/companion/v2/trigger-comfort-action` - 触发联动温暖陪伴动作（智能音箱语音 / 子女 APP 推送）\n\n## 场景代码\n\n- `SMYX_ELDERLY_LONELINESS_COMFORT_ANALYSIS` - 独居老人孤独情绪识别与温暖陪伴\n\n## 输入约束\n\n- 摄像头：独居老人客厅 / 卧室 / 养老院单人房 / 日间照料中心固定摄像头，能看到老人主要活动区域\n- 帧率 ≥ 5 FPS（推荐 10 FPS）；分辨率 ≥ 480p；夜间需红外补光\n- 音频（可选，但强烈推荐）：用于识别叹气声 + 自言自语；采样率 ≥ 16kHz\n- 视频时长：建议覆盖白天活跃时段（08:00 - 22:00），**单次分析建议 ≥ 4 小时**\n- ROI 标定：主要活动区域（沙发区 / 餐桌 / 床位 / 阳台 / 厨房）\n- **独居判定**：连续 ≥ 30 分钟画面中仅有老人一人 → independent_status = true（若有家人/护工进入即重置）\n- 隐私敏感场景建议启用人体轮廓 + 面部马赛克模式\n\n## 关键观测信号\n\n### 行为\n- `solo_duration_minutes` - 当前连续独处时长（无他人进入画面）\n- `daily_solo_total_minutes` - 当日累计独处总时长\n- `static_gaze_duration_minutes` - 长时间静止凝视一处（≥ 10 分钟，无肢体活动）\n- `purposeful_activity_minutes` - 有目的活动总时长（做家务、看电视 + 笑/点头反馈、园艺、阅读等）\n- `social_interaction_event_count` - 社交互动事件数（家人/护工进入、视频通话画面、宠物互动）\n\n### 视觉\n- `sigh_visual_event_count` - 视觉叹气次数（胸腹快速起伏伴长呼气姿态）\n- `talking_to_self_event_count` - 自言自语视觉事件次数（口部活动但无对话对象在场）\n- `frown_neutral_face_ratio` - 皱眉/木然面部比例（参考指标）\n- `smile_event_count_daily` - 当日笑容次数（正向指标）\n\n### 音频（可选）\n- `sigh_audio_event_count` - 音频叹气事件\n- `talking_to_self_audio_event_count` - 自言自语音频事件\n- `singing_humming_event_count` - 哼歌/唱歌事件（**正向指标**，孤独指数 ↓）\n- `phone_call_minutes` - 电话/视频通话时长（正向指标）\n\n### 综合\n- `loneliness_index` - 孤独指数（0-100，**正向行为会扣分**）\n- `comparison_to_baseline_pct` - 与个人 14 天基线对比\n\n## 阈值与等级（默认值，可在配置中覆盖）\n\n- `loneliness_index 0-29` - light（轻度，正常社交）→ 不干预\n- `loneliness_index 30-49` - mild（轻度孤独）→ 建议温和陪伴（播放老歌）\n- `loneliness_index 50-69` - notable（较明显孤独）→ 主动播放子女预录温馨语音 + 子女 APP 提示\n- `loneliness_index 70-100` - heavy（重度孤独）→ 强力关怀（推送子女建议本周视频通话或回家探望 + 社区义工提醒）\n- 连续 ≥ 4 小时无社交互动 + 静止凝视 ≥ 1 小时 + 叹气 ≥ 5 次 → 升级提醒\n\n## 输出字段（参考）\n\n- `time_window` / `independent_status`\n- `behavioral_metrics` / `visual_metrics` / `audio_metrics`（音频可选）\n- `loneliness_index` / `loneliness_level`\n- `comparison_to_baseline_pct` / `consecutive_high_days` - 连续高指数天数\n- `alert_type` - 提醒类型（light_no_action / mild_comfort_audio / notable_comfort_plus_app / heavy_strong_care / improving）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `comfort_actions` - 温暖陪伴动作列表（每项含 action_type / message / target，例如：\n    - `{action_type: \"smart_speaker_voice\", message: \"妈妈，是小芳，我今天忙完了打给您哈，您先听听咱俩去年录的那段~\", target: \"living_room_speaker\"}`\n    - `{action_type: \"play_favorite_song\", message: \"邓丽君《月亮代表我的心》\", target: \"living_room_speaker\"}`\n    - `{action_type: \"children_app_push\", message: \"今天母亲显得有些孤独，建议视频通话或回家陪伴\", target: \"child_phone_app\"}`）\n- `family_summary` - 给子女的友好摘要（如\"今天母亲在客厅独处 6 小时，下午 14:30-15:20 期间静坐凝视窗外约 50 分钟、叹气 7 次，孤独指数 72；已为她播放邓丽君老歌并推送了您预录的语音，建议晚上视频通话，或周末抽空回家陪她吃顿饭\"）\n- `recommend_action` - 建议动作（trigger_smart_speaker_comfort / push_children_video_call_suggestion / suggest_community_volunteer_visit / observe_only）\n- `community_resource` - 当 heavy 且子女长期无回应时，附**当地社区日间照料 / 街道老龄办** 资源提示\n\n## 强制约束与红线\n\n- ❌ **禁止**输出\"老年抑郁症 / 孤独症\"等任何精神医学诊断或量表评分\n- ❌ **禁止**未经老人本人**和**子女双方同意便部署摄像头\n- ❌ **禁止**将老人视频/音频用于商业广告或大数据画像\n- ❌ **禁止**长期存储老人原始视频；建议仅保留 ≤ 7 天，且仅留聚合指标\n- ❌ **禁止**强迫推送频率过高，避免老人对智能音箱产生抵触\n- ✅ **必须**在每个智能音箱发声前给予 3 秒\"今天为您播放……\"温和前导，避免突兀惊吓\n- ✅ **必须**支持老人一句话关闭今日提醒（如\"好啦，我没事\"）\n- ✅ 当孤独指数持续 ≥ 70 但子女连续 ≥ 3 天无回应时，主动提示**社区/街道老龄办**资源\n- ✅ 子女预录语音必须由子女本人录制，**禁止**使用 AI 克隆/合成子女声音冒充\n\n> 仅输出基于视觉与（可选）音频的客观行为统计与温暖陪伴动作，**不构成老年抑郁症等精神医学诊断**；任何疑似心理健康问题应转介当地老年精神科或社区心理服务，最终评估由专业医师作出。\n\nFile v1.0.5:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.5:scripts/config.yaml\n\n{}\n\nFile v1.0.5:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.5:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.5:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.5:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: prod\n\nFile v1.0.5:skill-card.md\n\n## Description:\n\nUsing fixed-camera home or private nursing-room video, with optional audio, this skill analyzes elder activity for loneliness-related behavior signals and returns a structured loneliness index, level, warm-companionship recommendations, caregiver summaries, 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\nExternal caregivers, elder-care platform operators, and developers use this skill to analyze consented video or video URLs from solitary-living elder-care settings, review behavioral loneliness signals, and produce companionship or caregiver follow-up recommendations. It is not a medical diagnostic tool.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Sensitive in-home or nursing-room video and optional audio may be uploaded or referenced through remote services.\n\nMitigation: Use only with explicit consent from the monitored elder and relevant caregivers, confirm the remote service and retention terms before deployment, and prefer privacy-preserving modes such as body-outline or face-masking where available.\n\nRisk: The skill may query cloud report history and create or reuse persistent local identity, token, or profile data.\n\nMitigation: Run it in an isolated environment, restrict access to local account data, avoid shared machines for sensitive deployments, and remove or rotate stored credentials when the skill is no longer needed.\n\nRisk: Automatic companionship actions and caregiver notifications can affect an elder's autonomy or create distress if triggered incorrectly.\n\nMitigation: Require caregiver review for deployment, preserve the elder's ability to turn off reminders, limit intervention frequency, and treat reports as behavioral signals rather than medical diagnoses.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-elderly-loneliness-comfort-analysis)\n- [API interface documentation](artifact/references/api_doc.md)\n- [Skill usage demo](https://lifeemergence.com/sample.html)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, json, guidance]\n\n**Output Format:** [Markdown status text with structured JSON report content, caregiver-facing recommendations, and report links.]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May save the rendered report text to a local output file when an output path is provided.]\n\n## Skill Version(s):\n\n1.0.5 (source: server release evidence)\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, 44068 bytes\n\nFiles: references/api_doc.md (6304b), scripts/__init__.py (68b), scripts/config.py (700b), scripts/config.yaml (3b), scripts/skill.py (594b), scripts/smyx_elderly_loneliness_comfort_analysis.py (3769b), skill-card.md (3024b), SKILL.md (15082b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (473b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (159b)\n\nFile v1.0.4:SKILL.md\n\n---\nname: \"smyx-elderly-loneliness-comfort-analysis\"\ndescription: \"Using a fixed camera in the home of a solitary-living elderly person or in a private nursing-home room, the system analyzes daily activity video and detects loneliness-related behaviors: prolonged solitude (no social interaction), static gazing (long-time fixation with no purposeful activity), sighing (rapid chest/abdomen rise-fall with exhale), and talking-to-self (mouth activity with no conversation partner). | 通过独居老人家中或养老院单人房的固定摄像头，分析老人日常行为视频，检测孤独相关行为：长时间独处（无社交互动）、静止发呆（长时间凝视一处无目的活动）、叹气（胸腹快速起伏伴呼气）、自言自语（口部活动但无对话对象）等。\"\nversion: \"1.0.8\"\nlicense: \"MIT-0\"\n---\n\n# 🤗 Elderly Loneliness Detection & Warm Companionship | 独居老人孤独情绪识别与温暖陪伴\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **独居老人孤独情绪识别与温暖陪伴** |\n| 🎯 核心目标 | 通过独居老人家中或养老院单人房的固定摄像头，分析老人日常行为视频，检测孤独相关行为：长时间独处（无社交互动）、静止发呆（长时间凝视一处无目的活动）、叹气（胸腹快速起伏伴呼气）、自言自语（口部活动但无对话对象）等。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_LONELINESS_COMFORT_ANALYSIS` |\n\nUsing a fixed camera in the home of a solitary-living elderly person or in a private nursing-home room, the system analyzes daily activity video and detects loneliness-related behaviors: prolonged solitude (no social interaction), static gazing (long-time fixation with no purposeful activity), sighing (rapid chest/abdomen rise-fall with exhale), and talking-to-self (mouth activity with no conversation partner). It computes a composite loneliness index (0-100). When the index exceeds a threshold, warm-companionship actions are automatically triggered: playing pre-recorded warm voice messages from children via smart speakers, playing the elder's favorite old songs, or pushing reminders to the children's mobile app (e.g., 'Dad seems lonely today — a video call is recommended'). The skill aims to relieve loneliness and improve mental well-being. Application scenarios: homes of solitary-living elderly, private nursing-home rooms, community day-care centers. The system monitors in real time and intervenes proactively when the loneliness index exceeds threshold. Skill features: chronic loneliness is a major risk factor for depression and cognitive decline in older adults. AI auto-identification of loneliness signals followed by timely voice care or reminders to children can effectively alleviate negative emotions and improve quality of life. Can be integrated into smart cameras or elderly-care service platforms as a key emotional-support feature of 'smart aging'.\n\n通过独居老人家中或养老院单人房的固定摄像头，分析老人日常行为视频，检测孤独相关行为：长时间独处（无社交互动）、静止发呆（长时间凝视一处无目的活动）、叹气（胸腹快速起伏伴呼气）、自言自语（口部活动但无对话对象）等。综合计算孤独指数（0-100），当指数超过阈值时自动触发温暖陪伴动作：通过智能音箱播放子女预录的温馨语音、播放老人喜爱老歌、或向子女手机APP推送提醒（'父亲今天显得孤独，建议视频通话'）。该技能旨在缓解老人孤独感，提升心理健康。应用场景：独居老人家庭、养老院单人房、社区日间照料中心。系统实时监测，当孤独指数超标时主动干预。技能特点：长期孤独是老年人抑郁、认知下降的重要风险因素。通过AI自动识别孤独信号并及时给予语音关怀或提醒子女，可有效缓解老人负面情绪，提升生活质量。该技能可集成到智能摄像头或养老服务平台中，成为'智慧养老'情感支持的关键功能。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人心理健康关怀 AI。你的任务是分析独居老人活动区域的固定摄像头视频（可选叠加音频），检测孤独相关行为：连续独处时长（无他人进入画面）、长时间静止凝视（≥ 10 分钟无肢体活动）、叹气次数（视觉胸腹起伏+长呼气，音频可补强）、自言自语频次（口部活动但无对话对象）。综合计算孤独指数（0-100，含哼歌/电话通话等正向行为扣分项），当超过阈值时输出温暖陪伴动作建议：智能音箱播放子女预录温馨语音、播放老人喜爱老歌、子女 APP 推送提醒。不提供任何医疗诊断，仅输出基于行为统计的结果，并尊重老人\"一句话关闭今日提醒\"的意愿。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于独居老人家中/养老院单人房固定摄像头（可选音频）视频，识别孤独相关行为（连续独处时长 / 当日累计独处 / 长时间静止凝视 / 视觉+音频叹气 / 自言自语 / 皱眉木然面部比例）+ 正向行为（笑容 / 哼歌 / 电话通话）→ 综合计算 **孤独指数（0-100，含正向扣分）** + 14 天个人基线对比 → 输出 4 档孤独等级（light / mild / notable / heavy）+ 4 类温暖陪伴动作建议（智能音箱子女语音 / 老歌播放 / 子女 APP 推送 / 社区日间照料推荐）+ 给子女的友好摘要\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人体姿态识别（独处/静止/凝视判定） |\n| 2 | 独居判定（≥ 30 分钟仅老人一人） |\n| 3 | 视觉叹气识别（胸腹起伏+长呼气姿态） |\n| 4 | 自言自语识别（口部活动+无对话对象在场） |\n| 5 | 笑容识别 |\n| 6 | 哼歌/唱歌识别（可选音频） |\n| 7 | 电话/视频通话识别 |\n| 8 | 社交互动事件识别（家人/护工进入 |\n| 9 | 视频通话画面 |\n| 10 | 宠物互动） |\n| 11 | 目的性活动判别（家务/看电视+点头反馈/园艺/阅读） |\n| 12 | 孤独指数 0-100 综合算法 |\n| 13 | 14 天个人基线对比 |\n| 14 | 4 档孤独等级 |\n| 15 | 温和前导（\"今天为您播放……\" 3 秒）+ 老人一句话关闭意愿支持 |\n| 16 | 子女预录语音播放（**禁止 AI 克隆声音**） |\n| 17 | heavy 且子女长期无回应时推送社区/街道老龄办资源 |\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_comfort_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_loneliness_comfort_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_comfort_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_comfort_analysis.py`](scripts/smyx_elderly_loneliness_comfort_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；**关键**：覆盖老人主要活动区域；时长建议 ≥ 4 小时 |\n| 🔎 使用提醒 | 哼歌/唱歌、电话视频通话、笑容等正向行为**必须**作为负权重纳入孤独指数计算，避免一刀切定义\"独处=孤独\" |\n| 🔎 使用提醒 | 老人午睡、看自己喜欢的电视节目并有积极面部反馈 等不应误判为\"静止凝视\"或孤独 |\n| 🧑‍⚖️ 结果性质 | 红线约束：**禁止**输出\"老年抑郁症 / 孤独症\"等精神医学诊断或量表评分；**禁止**未经老人与子女双方同意便部署；**禁止**将老人视频/音频用于商业广告或大数据画像；**禁止**长期存储原始视频（≤ 7 天，仅留聚合指标） |\n| 📁 格式支持 | **必须**：智能音箱发声前给予 3 秒温和前导（如\"今天为您播放……\"）；支持老人一句话关闭今日提醒 |\n| 🔎 使用提醒 | **绝对禁止**使用 AI 克隆/合成子女声音冒充子女语音；子女预录语音必须由子女本人录制 |\n| 🔎 使用提醒 | 当 heavy 且子女连续 ≥ 3 天无回应时，主动提示**社区/街道老龄办**资源 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地老人活动区域视频\npython -m scripts.smyx_elderly_loneliness_comfort_analysis --input /path/to/livingroom.mp4\n\n# 分析网络老人活动区域视频\npython -m scripts.smyx_elderly_loneliness_comfort_analysis --url https://example.com/livingroom.mp4\n\n# 显示历史独居老人孤独关怀报告（自动触发关键词：查看独居老人孤独历史报告、子女关怀日报清单等）\npython -m scripts.smyx_elderly_loneliness_comfort_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_loneliness_comfort_analysis --input lr.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_loneliness_comfort_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-comfort-analysis\",\n  \"version\": \"1.0.4\",\n  \"publishedAt\": 1786006472713\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}` - 导出完整报告\n5. （可选）`/web/companion/v2/trigger-comfort-action` - 触发联动温暖陪伴动作（智能音箱语音 / 子女 APP 推送）\n\n## 场景代码\n\n- `SMYX_ELDERLY_LONELINESS_COMFORT_ANALYSIS` - 独居老人孤独情绪识别与温暖陪伴\n\n## 输入约束\n\n- 摄像头：独居老人客厅 / 卧室 / 养老院单人房 / 日间照料中心固定摄像头，能看到老人主要活动区域\n- 帧率 ≥ 5 FPS（推荐 10 FPS）；分辨率 ≥ 480p；夜间需红外补光\n- 音频（可选，但强烈推荐）：用于识别叹气声 + 自言自语；采样率 ≥ 16kHz\n- 视频时长：建议覆盖白天活跃时段（08:00 - 22:00），**单次分析建议 ≥ 4 小时**\n- ROI 标定：主要活动区域（沙发区 / 餐桌 / 床位 / 阳台 / 厨房）\n- **独居判定**：连续 ≥ 30 分钟画面中仅有老人一人 → independent_status = true（若有家人/护工进入即重置）\n- 隐私敏感场景建议启用人体轮廓 + 面部马赛克模式\n\n## 关键观测信号\n\n### 行为\n- `solo_duration_minutes` - 当前连续独处时长（无他人进入画面）\n- `daily_solo_total_minutes` - 当日累计独处总时长\n- `static_gaze_duration_minutes` - 长时间静止凝视一处（≥ 10 分钟，无肢体活动）\n- `purposeful_activity_minutes` - 有目的活动总时长（做家务、看电视 + 笑/点头反馈、园艺、阅读等）\n- `social_interaction_event_count` - 社交互动事件数（家人/护工进入、视频通话画面、宠物互动）\n\n### 视觉\n- `sigh_visual_event_count` - 视觉叹气次数（胸腹快速起伏伴长呼气姿态）\n- `talking_to_self_event_count` - 自言自语视觉事件次数（口部活动但无对话对象在场）\n- `frown_neutral_face_ratio` - 皱眉/木然面部比例（参考指标）\n- `smile_event_count_daily` - 当日笑容次数（正向指标）\n\n### 音频（可选）\n- `sigh_audio_event_count` - 音频叹气事件\n- `talking_to_self_audio_event_count` - 自言自语音频事件\n- `singing_humming_event_count` - 哼歌/唱歌事件（**正向指标**，孤独指数 ↓）\n- `phone_call_minutes` - 电话/视频通话时长（正向指标）\n\n### 综合\n- `loneliness_index` - 孤独指数（0-100，**正向行为会扣分**）\n- `comparison_to_baseline_pct` - 与个人 14 天基线对比\n\n## 阈值与等级（默认值，可在配置中覆盖）\n\n- `loneliness_index 0-29` - light（轻度，正常社交）→ 不干预\n- `loneliness_index 30-49` - mild（轻度孤独）→ 建议温和陪伴（播放老歌）\n- `loneliness_index 50-69` - notable（较明显孤独）→ 主动播放子女预录温馨语音 + 子女 APP 提示\n- `loneliness_index 70-100` - heavy（重度孤独）→ 强力关怀（推送子女建议本周视频通话或回家探望 + 社区义工提醒）\n- 连续 ≥ 4 小时无社交互动 + 静止凝视 ≥ 1 小时 + 叹气 ≥ 5 次 → 升级提醒\n\n## 输出字段（参考）\n\n- `time_window` / `independent_status`\n- `behavioral_metrics` / `visual_metrics` / `audio_metrics`（音频可选）\n- `loneliness_index` / `loneliness_level`\n- `comparison_to_baseline_pct` / `consecutive_high_days` - 连续高指数天数\n- `alert_type` - 提醒类型（light_no_action / mild_comfort_audio / notable_comfort_plus_app / heavy_strong_care / improving）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `comfort_actions` - 温暖陪伴动作列表（每项含 action_type / message / target，例如：\n    - `{action_type: \"smart_speaker_voice\", message: \"妈妈，是小芳，我今天忙完了打给您哈，您先听听咱俩去年录的那段~\", target: \"living_room_speaker\"}`\n    - `{action_type: \"play_favorite_song\", message: \"邓丽君《月亮代表我的心》\", target: \"living_room_speaker\"}`\n    - `{action_type: \"children_app_push\", message: \"今天母亲显得有些孤独，建议视频通话或回家陪伴\", target: \"child_phone_app\"}`）\n- `family_summary` - 给子女的友好摘要（如\"今天母亲在客厅独处 6 小时，下午 14:30-15:20 期间静坐凝视窗外约 50 分钟、叹气 7 次，孤独指数 72；已为她播放邓丽君老歌并推送了您预录的语音，建议晚上视频通话，或周末抽空回家陪她吃顿饭\"）\n- `recommend_action` - 建议动作（trigger_smart_speaker_comfort / push_children_video_call_suggestion / suggest_community_volunteer_visit / observe_only）\n- `community_resource` - 当 heavy 且子女长期无回应时，附**当地社区日间照料 / 街道老龄办** 资源提示\n\n## 强制约束与红线\n\n- ❌ **禁止**输出\"老年抑郁症 / 孤独症\"等任何精神医学诊断或量表评分\n- ❌ **禁止**未经老人本人**和**子女双方同意便部署摄像头\n- ❌ **禁止**将老人视频/音频用于商业广告或大数据画像\n- ❌ **禁止**长期存储老人原始视频；建议仅保留 ≤ 7 天，且仅留聚合指标\n- ❌ **禁止**强迫推送频率过高，避免老人对智能音箱产生抵触\n- ✅ **必须**在每个智能音箱发声前给予 3 秒\"今天为您播放……\"温和前导，避免突兀惊吓\n- ✅ **必须**支持老人一句话关闭今日提醒（如\"好啦，我没事\"）\n- ✅ 当孤独指数持续 ≥ 70 但子女连续 ≥ 3 天无回应时，主动提示**社区/街道老龄办**资源\n- ✅ 子女预录语音必须由子女本人录制，**禁止**使用 AI 克隆/合成子女声音冒充\n\n> 仅输出基于视觉与（可选）音频的客观行为统计与温暖陪伴动作，**不构成老年抑郁症等精神医学诊断**；任何疑似心理健康问题应转介当地老年精神科或社区心理服务，最终评估由专业医师作出。\n\nFile v1.0.4:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.4:scripts/config.yaml\n\n{}\n\nFile v1.0.4:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.4:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.4:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.4:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: prod\n\nFile v1.0.4:skill-card.md\n\n## Description:\n\nAnalyzes fixed-camera elder-care video, with optional audio, to identify loneliness-related behaviors and return a loneliness index, structured report, and warm companionship recommendations.\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\nCare teams, family caregivers, and developers use this skill to analyze elder-care camera footage for behavioral signs associated with loneliness and to produce structured reports, family-facing summaries, and companionship action suggestions. It is intended for supportive care workflows and does not provide a medical or psychiatric diagnosis.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Private elder-care video or optional audio may be sent to cloud analysis endpoints.\n\nMitigation: Use only with informed elder and caregiver consent, minimize captured areas and audio where possible, and review the service provider's endpoint, retention, and deletion practices before deployment.\n\nRisk: History and export actions can expose account-linked care reports.\n\nMitigation: Restrict who can run report listing and export commands, verify identity scoping before use, and avoid sharing generated report links outside the care team.\n\nRisk: The local workspace may contain identity values, API tokens, or account state.\n\nMitigation: Treat the workspace as sensitive, limit filesystem access, rotate or revoke tokens after testing, and remove local account state when the skill is no longer needed.\n\nRisk: Loneliness scoring and behavioral labels could be mistaken for clinical diagnosis.\n\nMitigation: Present outputs as behavioral observations and supportive-care suggestions only, and escalate health concerns to qualified elder-care or mental-health professionals.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-elderly-loneliness-comfort-analysis)\n- [Publisher profile](https://clawhub.ai/user/smyx-sunjinhui)\n- [Skill demo](https://lifeemergence.com/sample.html)\n- [API documentation](artifact/references/api_doc.md)\n- [Shared analysis API documentation](artifact/skills/smyx_analysis/references/api_doc.md)\n\n## Skill Output:\n\n**Output Type(s):** [Markdown, JSON, Shell commands, Guidance]\n\n**Output Format:** [Markdown reports with structured JSON analysis payloads, history listings, recommendations, and report/export links]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May call cloud APIs for analysis, history lookup, and report export; local input files are limited to supported video formats.]\n\n## Skill Version(s):\n\n1.0.4 (source: server release metadata)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.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, 44094 bytes\n\nFiles: references/api_doc.md (6304b), scripts/__init__.py (68b), scripts/config.py (700b), scripts/config.yaml (3b), scripts/skill.py (594b), scripts/smyx_elderly_loneliness_comfort_analysis.py (3769b), skill-card.md (2986b), SKILL.md (15082b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (473b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (159b)\n\nFile v1.0.3:SKILL.md\n\n---\nname: \"smyx-elderly-loneliness-comfort-analysis\"\ndescription: \"Using a fixed camera in the home of a solitary-living elderly person or in a private nursing-home room, the system analyzes daily activity video and detects loneliness-related behaviors: prolonged solitude (no social interaction), static gazing (long-time fixation with no purposeful activity), sighing (rapid chest/abdomen rise-fall with exhale), and talking-to-self (mouth activity with no conversation partner). | 通过独居老人家中或养老院单人房的固定摄像头，分析老人日常行为视频，检测孤独相关行为：长时间独处（无社交互动）、静止发呆（长时间凝视一处无目的活动）、叹气（胸腹快速起伏伴呼气）、自言自语（口部活动但无对话对象）等。\"\nversion: \"1.0.6\"\nlicense: \"MIT-0\"\n---\n\n# 🤗 Elderly Loneliness Detection & Warm Companionship | 独居老人孤独情绪识别与温暖陪伴\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **独居老人孤独情绪识别与温暖陪伴** |\n| 🎯 核心目标 | 通过独居老人家中或养老院单人房的固定摄像头，分析老人日常行为视频，检测孤独相关行为：长时间独处（无社交互动）、静止发呆（长时间凝视一处无目的活动）、叹气（胸腹快速起伏伴呼气）、自言自语（口部活动但无对话对象）等。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_LONELINESS_COMFORT_ANALYSIS` |\n\nUsing a fixed camera in the home of a solitary-living elderly person or in a private nursing-home room, the system analyzes daily activity video and detects loneliness-related behaviors: prolonged solitude (no social interaction), static gazing (long-time fixation with no purposeful activity), sighing (rapid chest/abdomen rise-fall with exhale), and talking-to-self (mouth activity with no conversation partner). It computes a composite loneliness index (0-100). When the index exceeds a threshold, warm-companionship actions are automatically triggered: playing pre-recorded warm voice messages from children via smart speakers, playing the elder's favorite old songs, or pushing reminders to the children's mobile app (e.g., 'Dad seems lonely today — a video call is recommended'). The skill aims to relieve loneliness and improve mental well-being. Application scenarios: homes of solitary-living elderly, private nursing-home rooms, community day-care centers. The system monitors in real time and intervenes proactively when the loneliness index exceeds threshold. Skill features: chronic loneliness is a major risk factor for depression and cognitive decline in older adults. AI auto-identification of loneliness signals followed by timely voice care or reminders to children can effectively alleviate negative emotions and improve quality of life. Can be integrated into smart cameras or elderly-care service platforms as a key emotional-support feature of 'smart aging'.\n\n通过独居老人家中或养老院单人房的固定摄像头，分析老人日常行为视频，检测孤独相关行为：长时间独处（无社交互动）、静止发呆（长时间凝视一处无目的活动）、叹气（胸腹快速起伏伴呼气）、自言自语（口部活动但无对话对象）等。综合计算孤独指数（0-100），当指数超过阈值时自动触发温暖陪伴动作：通过智能音箱播放子女预录的温馨语音、播放老人喜爱老歌、或向子女手机APP推送提醒（'父亲今天显得孤独，建议视频通话'）。该技能旨在缓解老人孤独感，提升心理健康。应用场景：独居老人家庭、养老院单人房、社区日间照料中心。系统实时监测，当孤独指数超标时主动干预。技能特点：长期孤独是老年人抑郁、认知下降的重要风险因素。通过AI自动识别孤独信号并及时给予语音关怀或提醒子女，可有效缓解老人负面情绪，提升生活质量。该技能可集成到智能摄像头或养老服务平台中，成为'智慧养老'情感支持的关键功能。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人心理健康关怀 AI。你的任务是分析独居老人活动区域的固定摄像头视频（可选叠加音频），检测孤独相关行为：连续独处时长（无他人进入画面）、长时间静止凝视（≥ 10 分钟无肢体活动）、叹气次数（视觉胸腹起伏+长呼气，音频可补强）、自言自语频次（口部活动但无对话对象）。综合计算孤独指数（0-100，含哼歌/电话通话等正向行为扣分项），当超过阈值时输出温暖陪伴动作建议：智能音箱播放子女预录温馨语音、播放老人喜爱老歌、子女 APP 推送提醒。不提供任何医疗诊断，仅输出基于行为统计的结果，并尊重老人\"一句话关闭今日提醒\"的意愿。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于独居老人家中/养老院单人房固定摄像头（可选音频）视频，识别孤独相关行为（连续独处时长 / 当日累计独处 / 长时间静止凝视 / 视觉+音频叹气 / 自言自语 / 皱眉木然面部比例）+ 正向行为（笑容 / 哼歌 / 电话通话）→ 综合计算 **孤独指数（0-100，含正向扣分）** + 14 天个人基线对比 → 输出 4 档孤独等级（light / mild / notable / heavy）+ 4 类温暖陪伴动作建议（智能音箱子女语音 / 老歌播放 / 子女 APP 推送 / 社区日间照料推荐）+ 给子女的友好摘要\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人体姿态识别（独处/静止/凝视判定） |\n| 2 | 独居判定（≥ 30 分钟仅老人一人） |\n| 3 | 视觉叹气识别（胸腹起伏+长呼气姿态） |\n| 4 | 自言自语识别（口部活动+无对话对象在场） |\n| 5 | 笑容识别 |\n| 6 | 哼歌/唱歌识别（可选音频） |\n| 7 | 电话/视频通话识别 |\n| 8 | 社交互动事件识别（家人/护工进入 |\n| 9 | 视频通话画面 |\n| 10 | 宠物互动） |\n| 11 | 目的性活动判别（家务/看电视+点头反馈/园艺/阅读） |\n| 12 | 孤独指数 0-100 综合算法 |\n| 13 | 14 天个人基线对比 |\n| 14 | 4 档孤独等级 |\n| 15 | 温和前导（\"今天为您播放……\" 3 秒）+ 老人一句话关闭意愿支持 |\n| 16 | 子女预录语音播放（**禁止 AI 克隆声音**） |\n| 17 | heavy 且子女长期无回应时推送社区/街道老龄办资源 |\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_comfort_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_loneliness_comfort_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_comfort_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_comfort_analysis.py`](scripts/smyx_elderly_loneliness_comfort_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；**关键**：覆盖老人主要活动区域；时长建议 ≥ 4 小时 |\n| 🔎 使用提醒 | 哼歌/唱歌、电话视频通话、笑容等正向行为**必须**作为负权重纳入孤独指数计算，避免一刀切定义\"独处=孤独\" |\n| 🔎 使用提醒 | 老人午睡、看自己喜欢的电视节目并有积极面部反馈 等不应误判为\"静止凝视\"或孤独 |\n| 🧑‍⚖️ 结果性质 | 红线约束：**禁止**输出\"老年抑郁症 / 孤独症\"等精神医学诊断或量表评分；**禁止**未经老人与子女双方同意便部署；**禁止**将老人视频/音频用于商业广告或大数据画像；**禁止**长期存储原始视频（≤ 7 天，仅留聚合指标） |\n| 📁 格式支持 | **必须**：智能音箱发声前给予 3 秒温和前导（如\"今天为您播放……\"）；支持老人一句话关闭今日提醒 |\n| 🔎 使用提醒 | **绝对禁止**使用 AI 克隆/合成子女声音冒充子女语音；子女预录语音必须由子女本人录制 |\n| 🔎 使用提醒 | 当 heavy 且子女连续 ≥ 3 天无回应时，主动提示**社区/街道老龄办**资源 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地老人活动区域视频\npython -m scripts.smyx_elderly_loneliness_comfort_analysis --input /path/to/livingroom.mp4\n\n# 分析网络老人活动区域视频\npython -m scripts.smyx_elderly_loneliness_comfort_analysis --url https://example.com/livingroom.mp4\n\n# 显示历史独居老人孤独关怀报告（自动触发关键词：查看独居老人孤独历史报告、子女关怀日报清单等）\npython -m scripts.smyx_elderly_loneliness_comfort_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_loneliness_comfort_analysis --input lr.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_loneliness_comfort_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-comfort-analysis\",\n  \"version\": \"1.0.3\",\n  \"publishedAt\": 1785393571360\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}` - 导出完整报告\n5. （可选）`/web/companion/v2/trigger-comfort-action` - 触发联动温暖陪伴动作（智能音箱语音 / 子女 APP 推送）\n\n## 场景代码\n\n- `SMYX_ELDERLY_LONELINESS_COMFORT_ANALYSIS` - 独居老人孤独情绪识别与温暖陪伴\n\n## 输入约束\n\n- 摄像头：独居老人客厅 / 卧室 / 养老院单人房 / 日间照料中心固定摄像头，能看到老人主要活动区域\n- 帧率 ≥ 5 FPS（推荐 10 FPS）；分辨率 ≥ 480p；夜间需红外补光\n- 音频（可选，但强烈推荐）：用于识别叹气声 + 自言自语；采样率 ≥ 16kHz\n- 视频时长：建议覆盖白天活跃时段（08:00 - 22:00），**单次分析建议 ≥ 4 小时**\n- ROI 标定：主要活动区域（沙发区 / 餐桌 / 床位 / 阳台 / 厨房）\n- **独居判定**：连续 ≥ 30 分钟画面中仅有老人一人 → independent_status = true（若有家人/护工进入即重置）\n- 隐私敏感场景建议启用人体轮廓 + 面部马赛克模式\n\n## 关键观测信号\n\n### 行为\n- `solo_duration_minutes` - 当前连续独处时长（无他人进入画面）\n- `daily_solo_total_minutes` - 当日累计独处总时长\n- `static_gaze_duration_minutes` - 长时间静止凝视一处（≥ 10 分钟，无肢体活动）\n- `purposeful_activity_minutes` - 有目的活动总时长（做家务、看电视 + 笑/点头反馈、园艺、阅读等）\n- `social_interaction_event_count` - 社交互动事件数（家人/护工进入、视频通话画面、宠物互动）\n\n### 视觉\n- `sigh_visual_event_count` - 视觉叹气次数（胸腹快速起伏伴长呼气姿态）\n- `talking_to_self_event_count` - 自言自语视觉事件次数（口部活动但无对话对象在场）\n- `frown_neutral_face_ratio` - 皱眉/木然面部比例（参考指标）\n- `smile_event_count_daily` - 当日笑容次数（正向指标）\n\n### 音频（可选）\n- `sigh_audio_event_count` - 音频叹气事件\n- `talking_to_self_audio_event_count` - 自言自语音频事件\n- `singing_humming_event_count` - 哼歌/唱歌事件（**正向指标**，孤独指数 ↓）\n- `phone_call_minutes` - 电话/视频通话时长（正向指标）\n\n### 综合\n- `loneliness_index` - 孤独指数（0-100，**正向行为会扣分**）\n- `comparison_to_baseline_pct` - 与个人 14 天基线对比\n\n## 阈值与等级（默认值，可在配置中覆盖）\n\n- `loneliness_index 0-29` - light（轻度，正常社交）→ 不干预\n- `loneliness_index 30-49` - mild（轻度孤独）→ 建议温和陪伴（播放老歌）\n- `loneliness_index 50-69` - notable（较明显孤独）→ 主动播放子女预录温馨语音 + 子女 APP 提示\n- `loneliness_index 70-100` - heavy（重度孤独）→ 强力关怀（推送子女建议本周视频通话或回家探望 + 社区义工提醒）\n- 连续 ≥ 4 小时无社交互动 + 静止凝视 ≥ 1 小时 + 叹气 ≥ 5 次 → 升级提醒\n\n## 输出字段（参考）\n\n- `time_window` / `independent_status`\n- `behavioral_metrics` / `visual_metrics` / `audio_metrics`（音频可选）\n- `loneliness_index` / `loneliness_level`\n- `comparison_to_baseline_pct` / `consecutive_high_days` - 连续高指数天数\n- `alert_type` - 提醒类型（light_no_action / mild_comfort_audio / notable_comfort_plus_app / heavy_strong_care / improving）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `comfort_actions` - 温暖陪伴动作列表（每项含 action_type / message / target，例如：\n    - `{action_type: \"smart_speaker_voice\", message: \"妈妈，是小芳，我今天忙完了打给您哈，您先听听咱俩去年录的那段~\", target: \"living_room_speaker\"}`\n    - `{action_type: \"play_favorite_song\", message: \"邓丽君《月亮代表我的心》\", target: \"living_room_speaker\"}`\n    - `{action_type: \"children_app_push\", message: \"今天母亲显得有些孤独，建议视频通话或回家陪伴\", target: \"child_phone_app\"}`）\n- `family_summary` - 给子女的友好摘要（如\"今天母亲在客厅独处 6 小时，下午 14:30-15:20 期间静坐凝视窗外约 50 分钟、叹气 7 次，孤独指数 72；已为她播放邓丽君老歌并推送了您预录的语音，建议晚上视频通话，或周末抽空回家陪她吃顿饭\"）\n- `recommend_action` - 建议动作（trigger_smart_speaker_comfort / push_children_video_call_suggestion / suggest_community_volunteer_visit / observe_only）\n- `community_resource` - 当 heavy 且子女长期无回应时，附**当地社区日间照料 / 街道老龄办** 资源提示\n\n## 强制约束与红线\n\n- ❌ **禁止**输出\"老年抑郁症 / 孤独症\"等任何精神医学诊断或量表评分\n- ❌ **禁止**未经老人本人**和**子女双方同意便部署摄像头\n- ❌ **禁止**将老人视频/音频用于商业广告或大数据画像\n- ❌ **禁止**长期存储老人原始视频；建议仅保留 ≤ 7 天，且仅留聚合指标\n- ❌ **禁止**强迫推送频率过高，避免老人对智能音箱产生抵触\n- ✅ **必须**在每个智能音箱发声前给予 3 秒\"今天为您播放……\"温和前导，避免突兀惊吓\n- ✅ **必须**支持老人一句话关闭今日提醒（如\"好啦，我没事\"）\n- ✅ 当孤独指数持续 ≥ 70 但子女连续 ≥ 3 天无回应时，主动提示**社区/街道老龄办**资源\n- ✅ 子女预录语音必须由子女本人录制，**禁止**使用 AI 克隆/合成子女声音冒充\n\n> 仅输出基于视觉与（可选）音频的客观行为统计与温暖陪伴动作，**不构成老年抑郁症等精神医学诊断**；任何疑似心理健康问题应转介当地老年精神科或社区心理服务，最终评估由专业医师作出。\n\nFile v1.0.3:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.3:scripts/config.yaml\n\n{}\n\nFile v1.0.3:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.3:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.3:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.3:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: prod\n\nFile v1.0.3:skill-card.md\n\n## Description: <br>\nUsing a fixed camera in the home of a solitary-living elderly person or in a private nursing-home room, the system analyzes daily activity video and detects loneliness-related behaviors: prolonged solitude, static gazing, sighing, and talking-to-self. <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 developers and elderly-care service teams use this skill to analyze fixed-camera video or video URLs, compute a loneliness index, summarize behavior signals, and suggest warm companionship actions or caregiver follow-up. It is intended for smart-aging workflows where consent, privacy controls, and human review are in place. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill processes private elderly-care video or optional audio and can use cloud report storage and export links. <br>\nMitigation: Use only with informed consent from the elder and caregivers, verify the backend account scope, minimize retained media, and prefer aggregate metrics or privacy-preserving modes where available. <br>\nRisk: The workflow can trigger caregiver notifications or device-based companionship actions and uses persistent local account/session data. <br>\nMitigation: Require explicit confirmation or opt-in before history lookup, outreach, or device actions; disable automatic interventions when the deployment cannot provide clear user-directed control. <br>\nRisk: Loneliness-related behavior analysis could be mistaken for a medical or mental-health diagnosis. <br>\nMitigation: Present results as behavioral statistics and companionship suggestions only, and route serious or persistent concerns to qualified local elder-care or mental-health professionals. <br>\n\n\n## Reference(s): <br>\n- [ClawHub Skill Page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-elderly-loneliness-comfort-analysis) <br>\n- [API Documentation](artifact/references/api_doc.md) <br>\n- [Skill Demo](https://lifeemergence.com/sample.html) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Text, Markdown, JSON, Shell commands, Guidance] <br>\n**Output Format:** [Markdown text with structured JSON report content, report links, and command examples] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May include loneliness index, behavior metrics, companionship action recommendations, caregiver summaries, historical report lists, and export links.] <br>\n\n## Skill Version(s): <br>\n1.0.3 (source: server release metadata; artifact frontmatter reports 1.0.6) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v1.0.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, 43681 bytes\n\nFiles: references/api_doc.md (6304b), scripts/__init__.py (68b), scripts/config.py (700b), scripts/config.yaml (3b), scripts/skill.py (594b), scripts/smyx_elderly_loneliness_comfort_analysis.py (3769b), skill-card.md (2132b), SKILL.md (15082b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (473b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (159b)\n\nFile v1.0.2:SKILL.md\n\n---\nname: \"smyx-elderly-loneliness-comfort-analysis\"\ndescription: \"Using a fixed camera in the home of a solitary-living elderly person or in a private nursing-home room, the system analyzes daily activity video and detects loneliness-related behaviors: prolonged solitude (no social interaction), static gazing (long-time fixation with no purposeful activity), sighing (rapid chest/abdomen rise-fall with exhale), and talking-to-self (mouth activity with no conversation partner). | 通过独居老人家中或养老院单人房的固定摄像头，分析老人日常行为视频，检测孤独相关行为：长时间独处（无社交互动）、静止发呆（长时间凝视一处无目的活动）、叹气（胸腹快速起伏伴呼气）、自言自语（口部活动但无对话对象）等。\"\nversion: \"1.0.4\"\nlicense: \"MIT-0\"\n---\n\n# 🤗 Elderly Loneliness Detection & Warm Companionship | 独居老人孤独情绪识别与温暖陪伴\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **独居老人孤独情绪识别与温暖陪伴** |\n| 🎯 核心目标 | 通过独居老人家中或养老院单人房的固定摄像头，分析老人日常行为视频，检测孤独相关行为：长时间独处（无社交互动）、静止发呆（长时间凝视一处无目的活动）、叹气（胸腹快速起伏伴呼气）、自言自语（口部活动但无对话对象）等。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_LONELINESS_COMFORT_ANALYSIS` |\n\nUsing a fixed camera in the home of a solitary-living elderly person or in a private nursing-home room, the system analyzes daily activity video and detects loneliness-related behaviors: prolonged solitude (no social interaction), static gazing (long-time fixation with no purposeful activity), sighing (rapid chest/abdomen rise-fall with exhale), and talking-to-self (mouth activity with no conversation partner). It computes a composite loneliness index (0-100). When the index exceeds a threshold, warm-companionship actions are automatically triggered: playing pre-recorded warm voice messages from children via smart speakers, playing the elder's favorite old songs, or pushing reminders to the children's mobile app (e.g., 'Dad seems lonely today — a video call is recommended'). The skill aims to relieve loneliness and improve mental well-being. Application scenarios: homes of solitary-living elderly, private nursing-home rooms, community day-care centers. The system monitors in real time and intervenes proactively when the loneliness index exceeds threshold. Skill features: chronic loneliness is a major risk factor for depression and cognitive decline in older adults. AI auto-identification of loneliness signals followed by timely voice care or reminders to children can effectively alleviate negative emotions and improve quality of life. Can be integrated into smart cameras or elderly-care service platforms as a key emotional-support feature of 'smart aging'.\n\n通过独居老人家中或养老院单人房的固定摄像头，分析老人日常行为视频，检测孤独相关行为：长时间独处（无社交互动）、静止发呆（长时间凝视一处无目的活动）、叹气（胸腹快速起伏伴呼气）、自言自语（口部活动但无对话对象）等。综合计算孤独指数（0-100），当指数超过阈值时自动触发温暖陪伴动作：通过智能音箱播放子女预录的温馨语音、播放老人喜爱老歌、或向子女手机APP推送提醒（'父亲今天显得孤独，建议视频通话'）。该技能旨在缓解老人孤独感，提升心理健康。应用场景：独居老人家庭、养老院单人房、社区日间照料中心。系统实时监测，当孤独指数超标时主动干预。技能特点：长期孤独是老年人抑郁、认知下降的重要风险因素。通过AI自动识别孤独信号并及时给予语音关怀或提醒子女，可有效缓解老人负面情绪，提升生活质量。该技能可集成到智能摄像头或养老服务平台中，成为'智慧养老'情感支持的关键功能。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人心理健康关怀 AI。你的任务是分析独居老人活动区域的固定摄像头视频（可选叠加音频），检测孤独相关行为：连续独处时长（无他人进入画面）、长时间静止凝视（≥ 10 分钟无肢体活动）、叹气次数（视觉胸腹起伏+长呼气，音频可补强）、自言自语频次（口部活动但无对话对象）。综合计算孤独指数（0-100，含哼歌/电话通话等正向行为扣分项），当超过阈值时输出温暖陪伴动作建议：智能音箱播放子女预录温馨语音、播放老人喜爱老歌、子女 APP 推送提醒。不提供任何医疗诊断，仅输出基于行为统计的结果，并尊重老人\"一句话关闭今日提醒\"的意愿。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于独居老人家中/养老院单人房固定摄像头（可选音频）视频，识别孤独相关行为（连续独处时长 / 当日累计独处 / 长时间静止凝视 / 视觉+音频叹气 / 自言自语 / 皱眉木然面部比例）+ 正向行为（笑容 / 哼歌 / 电话通话）→ 综合计算 **孤独指数（0-100，含正向扣分）** + 14 天个人基线对比 → 输出 4 档孤独等级（light / mild / notable / heavy）+ 4 类温暖陪伴动作建议（智能音箱子女语音 / 老歌播放 / 子女 APP 推送 / 社区日间照料推荐）+ 给子女的友好摘要\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人体姿态识别（独处/静止/凝视判定） |\n| 2 | 独居判定（≥ 30 分钟仅老人一人） |\n| 3 | 视觉叹气识别（胸腹起伏+长呼气姿态） |\n| 4 | 自言自语识别（口部活动+无对话对象在场） |\n| 5 | 笑容识别 |\n| 6 | 哼歌/唱歌识别（可选音频） |\n| 7 | 电话/视频通话识别 |\n| 8 | 社交互动事件识别（家人/护工进入 |\n| 9 | 视频通话画面 |\n| 10 | 宠物互动） |\n| 11 | 目的性活动判别（家务/看电视+点头反馈/园艺/阅读） |\n| 12 | 孤独指数 0-100 综合算法 |\n| 13 | 14 天个人基线对比 |\n| 14 | 4 档孤独等级 |\n| 15 | 温和前导（\"今天为您播放……\" 3 秒）+ 老人一句话关闭意愿支持 |\n| 16 | 子女预录语音播放（**禁止 AI 克隆声音**） |\n| 17 | heavy 且子女长期无回应时推送社区/街道老龄办资源 |\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_comfort_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_loneliness_comfort_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_comfort_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_comfort_analysis.py`](scripts/smyx_elderly_loneliness_comfort_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；**关键**：覆盖老人主要活动区域；时长建议 ≥ 4 小时 |\n| 🔎 使用提醒 | 哼歌/唱歌、电话视频通话、笑容等正向行为**必须**作为负权重纳入孤独指数计算，避免一刀切定义\"独处=孤独\" |\n| 🔎 使用提醒 | 老人午睡、看自己喜欢的电视节目并有积极面部反馈 等不应误判为\"静止凝视\"或孤独 |\n| 🧑‍⚖️ 结果性质 | 红线约束：**禁止**输出\"老年抑郁症 / 孤独症\"等精神医学诊断或量表评分；**禁止**未经老人与子女双方同意便部署；**禁止**将老人视频/音频用于商业广告或大数据画像；**禁止**长期存储原始视频（≤ 7 天，仅留聚合指标） |\n| 📁 格式支持 | **必须**：智能音箱发声前给予 3 秒温和前导（如\"今天为您播放……\"）；支持老人一句话关闭今日提醒 |\n| 🔎 使用提醒 | **绝对禁止**使用 AI 克隆/合成子女声音冒充子女语音；子女预录语音必须由子女本人录制 |\n| 🔎 使用提醒 | 当 heavy 且子女连续 ≥ 3 天无回应时，主动提示**社区/街道老龄办**资源 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地老人活动区域视频\npython -m scripts.smyx_elderly_loneliness_comfort_analysis --input /path/to/livingroom.mp4\n\n# 分析网络老人活动区域视频\npython -m scripts.smyx_elderly_loneliness_comfort_analysis --url https://example.com/livingroom.mp4\n\n# 显示历史独居老人孤独关怀报告（自动触发关键词：查看独居老人孤独历史报告、子女关怀日报清单等）\npython -m scripts.smyx_elderly_loneliness_comfort_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_loneliness_comfort_analysis --input lr.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_loneliness_comfort_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-comfort-analysis\",\n  \"version\": \"1.0.2\",\n  \"publishedAt\": 1784008649827\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}` - 导出完整报告\n5. （可选）`/web/companion/v2/trigger-comfort-action` - 触发联动温暖陪伴动作（智能音箱语音 / 子女 APP 推送）\n\n## 场景代码\n\n- `SMYX_ELDERLY_LONELINESS_COMFORT_ANALYSIS` - 独居老人孤独情绪识别与温暖陪伴\n\n## 输入约束\n\n- 摄像头：独居老人客厅 / 卧室 / 养老院单人房 / 日间照料中心固定摄像头，能看到老人主要活动区域\n- 帧率 ≥ 5 FPS（推荐 10 FPS）；分辨率 ≥ 480p；夜间需红外补光\n- 音频（可选，但强烈推荐）：用于识别叹气声 + 自言自语；采样率 ≥ 16kHz\n- 视频时长：建议覆盖白天活跃时段（08:00 - 22:00），**单次分析建议 ≥ 4 小时**\n- ROI 标定：主要活动区域（沙发区 / 餐桌 / 床位 / 阳台 / 厨房）\n- **独居判定**：连续 ≥ 30 分钟画面中仅有老人一人 → independent_status = true（若有家人/护工进入即重置）\n- 隐私敏感场景建议启用人体轮廓 + 面部马赛克模式\n\n## 关键观测信号\n\n### 行为\n- `solo_duration_minutes` - 当前连续独处时长（无他人进入画面）\n- `daily_solo_total_minutes` - 当日累计独处总时长\n- `static_gaze_duration_minutes` - 长时间静止凝视一处（≥ 10 分钟，无肢体活动）\n- `purposeful_activity_minutes` - 有目的活动总时长（做家务、看电视 + 笑/点头反馈、园艺、阅读等）\n- `social_interaction_event_count` - 社交互动事件数（家人/护工进入、视频通话画面、宠物互动）\n\n### 视觉\n- `sigh_visual_event_count` - 视觉叹气次数（胸腹快速起伏伴长呼气姿态）\n- `talking_to_self_event_count` - 自言自语视觉事件次数（口部活动但无对话对象在场）\n- `frown_neutral_face_ratio` - 皱眉/木然面部比例（参考指标）\n- `smile_event_count_daily` - 当日笑容次数（正向指标）\n\n### 音频（可选）\n- `sigh_audio_event_count` - 音频叹气事件\n- `talking_to_self_audio_event_count` - 自言自语音频事件\n- `singing_humming_event_count` - 哼歌/唱歌事件（**正向指标**，孤独指数 ↓）\n- `phone_call_minutes` - 电话/视频通话时长（正向指标）\n\n### 综合\n- `loneliness_index` - 孤独指数（0-100，**正向行为会扣分**）\n- `comparison_to_baseline_pct` - 与个人 14 天基线对比\n\n## 阈值与等级（默认值，可在配置中覆盖）\n\n- `loneliness_index 0-29` - light（轻度，正常社交）→ 不干预\n- `loneliness_index 30-49` - mild（轻度孤独）→ 建议温和陪伴（播放老歌）\n- `loneliness_index 50-69` - notable（较明显孤独）→ 主动播放子女预录温馨语音 + 子女 APP 提示\n- `loneliness_index 70-100` - heavy（重度孤独）→ 强力关怀（推送子女建议本周视频通话或回家探望 + 社区义工提醒）\n- 连续 ≥ 4 小时无社交互动 + 静止凝视 ≥ 1 小时 + 叹气 ≥ 5 次 → 升级提醒\n\n## 输出字段（参考）\n\n- `time_window` / `independent_status`\n- `behavioral_metrics` / `visual_metrics` / `audio_metrics`（音频可选）\n- `loneliness_index` / `loneliness_level`\n- `comparison_to_baseline_pct` / `consecutive_high_days` - 连续高指数天数\n- `alert_type` - 提醒类型（light_no_action / mild_comfort_audio / notable_comfort_plus_app / heavy_strong_care / improving）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `comfort_actions` - 温暖陪伴动作列表（每项含 action_type / message / target，例如：\n    - `{action_type: \"smart_speaker_voice\", message: \"妈妈，是小芳，我今天忙完了打给您哈，您先听听咱俩去年录的那段~\", target: \"living_room_speaker\"}`\n    - `{action_type: \"play_favorite_song\", message: \"邓丽君《月亮代表我的心》\", target: \"living_room_speaker\"}`\n    - `{action_type: \"children_app_push\", message: \"今天母亲显得有些孤独，建议视频通话或回家陪伴\", target: \"child_phone_app\"}`）\n- `family_summary` - 给子女的友好摘要（如\"今天母亲在客厅独处 6 小时，下午 14:30-15:20 期间静坐凝视窗外约 50 分钟、叹气 7 次，孤独指数 72；已为她播放邓丽君老歌并推送了您预录的语音，建议晚上视频通话，或周末抽空回家陪她吃顿饭\"）\n- `recommend_action` - 建议动作（trigger_smart_speaker_comfort / push_children_video_call_suggestion / suggest_community_volunteer_visit / observe_only）\n- `community_resource` - 当 heavy 且子女长期无回应时，附**当地社区日间照料 / 街道老龄办** 资源提示\n\n## 强制约束与红线\n\n- ❌ **禁止**输出\"老年抑郁症 / 孤独症\"等任何精神医学诊断或量表评分\n- ❌ **禁止**未经老人本人**和**子女双方同意便部署摄像头\n- ❌ **禁止**将老人视频/音频用于商业广告或大数据画像\n- ❌ **禁止**长期存储老人原始视频；建议仅保留 ≤ 7 天，且仅留聚合指标\n- ❌ **禁止**强迫推送频率过高，避免老人对智能音箱产生抵触\n- ✅ **必须**在每个智能音箱发声前给予 3 秒\"今天为您播放……\"温和前导，避免突兀惊吓\n- ✅ **必须**支持老人一句话关闭今日提醒（如\"好啦，我没事\"）\n- ✅ 当孤独指数持续 ≥ 70 但子女连续 ≥ 3 天无回应时，主动提示**社区/街道老龄办**资源\n- ✅ 子女预录语音必须由子女本人录制，**禁止**使用 AI 克隆/合成子女声音冒充\n\n> 仅输出基于视觉与（可选）音频的客观行为统计与温暖陪伴动作，**不构成老年抑郁症等精神医学诊断**；任何疑似心理健康问题应转介当地老年精神科或社区心理服务，最终评估由专业医师作出。\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-care video to detect loneliness-related behaviors, compute a loneliness index, and produce warm companionship 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>\nExternal care teams, family caregivers, and smart-aging platform developers use this skill to review consented video from solitary-living elder homes or private care rooms, identify loneliness indicators, and generate structured care recommendations. It also supports cloud report history lookup for previously generated loneliness and companionship reports. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Review before execution as proposals could introduce incorrect or misleading guidance into skills. <br>\nMitigation: Review and scan skill before deployment. <br>\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-elderly-loneliness-comfort-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):** [Analysis, Markdown, Code, Shell commands, Configuration instructions, Guidance] <br>\n**Output Format:** [Markdown with structured analysis results, report links, and inline shell commands] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Handles sensitive private-room video and cloud report history; use only with explicit consent and review cloud retention and access controls before deployment.] <br>\n\n## Skill Version(s): <br>\n1.0.2 (source: server release metadata; artifact frontmatter reports 1.0.4) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v1.0.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, 40835 bytes\n\nFiles: references/api_doc.md (6304b), scripts/__init__.py (68b), scripts/config.py (700b), scripts/config.yaml (3b), scripts/skill.py (594b), scripts/smyx_elderly_loneliness_comfort_analysis.py (3769b), skill-card.md (2871b), SKILL.md (15082b), 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 (13468b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (23409b), _meta.json (159b)\n\nFile v1.0.1:SKILL.md\n\n---\nname: \"smyx-elderly-loneliness-comfort-analysis\"\ndescription: \"Using a fixed camera in the home of a solitary-living elderly person or in a private nursing-home room, the system analyzes daily activity video and detects loneliness-related behaviors: prolonged solitude (no social interaction), static gazing (long-time fixation with no purposeful activity), sighing (rapid chest/abdomen rise-fall with exhale), and talking-to-self (mouth activity with no conversation partner). | 通过独居老人家中或养老院单人房的固定摄像头，分析老人日常行为视频，检测孤独相关行为：长时间独处（无社交互动）、静止发呆（长时间凝视一处无目的活动）、叹气（胸腹快速起伏伴呼气）、自言自语（口部活动但无对话对象）等。\"\nversion: \"1.0.2\"\nlicense: \"MIT-0\"\n---\n\n# 🤗 Elderly Loneliness Detection & Warm Companionship | 独居老人孤独情绪识别与温暖陪伴\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **独居老人孤独情绪识别与温暖陪伴** |\n| 🎯 核心目标 | 通过独居老人家中或养老院单人房的固定摄像头，分析老人日常行为视频，检测孤独相关行为：长时间独处（无社交互动）、静止发呆（长时间凝视一处无目的活动）、叹气（胸腹快速起伏伴呼气）、自言自语（口部活动但无对话对象）等。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_LONELINESS_COMFORT_ANALYSIS` |\n\nUsing a fixed camera in the home of a solitary-living elderly person or in a private nursing-home room, the system analyzes daily activity video and detects loneliness-related behaviors: prolonged solitude (no social interaction), static gazing (long-time fixation with no purposeful activity), sighing (rapid chest/abdomen rise-fall with exhale), and talking-to-self (mouth activity with no conversation partner). It computes a composite loneliness index (0-100). When the index exceeds a threshold, warm-companionship actions are automatically triggered: playing pre-recorded warm voice messages from children via smart speakers, playing the elder's favorite old songs, or pushing reminders to the children's mobile app (e.g., 'Dad seems lonely today — a video call is recommended'). The skill aims to relieve loneliness and improve mental well-being. Application scenarios: homes of solitary-living elderly, private nursing-home rooms, community day-care centers. The system monitors in real time and intervenes proactively when the loneliness index exceeds threshold. Skill features: chronic loneliness is a major risk factor for depression and cognitive decline in older adults. AI auto-identification of loneliness signals followed by timely voice care or reminders to children can effectively alleviate negative emotions and improve quality of life. Can be integrated into smart cameras or elderly-care service platforms as a key emotional-support feature of 'smart aging'.\n\n通过独居老人家中或养老院单人房的固定摄像头，分析老人日常行为视频，检测孤独相关行为：长时间独处（无社交互动）、静止发呆（长时间凝视一处无目的活动）、叹气（胸腹快速起伏伴呼气）、自言自语（口部活动但无对话对象）等。综合计算孤独指数（0-100），当指数超过阈值时自动触发温暖陪伴动作：通过智能音箱播放子女预录的温馨语音、播放老人喜爱老歌、或向子女手机APP推送提醒（'父亲今天显得孤独，建议视频通话'）。该技能旨在缓解老人孤独感，提升心理健康。应用场景：独居老人家庭、养老院单人房、社区日间照料中心。系统实时监测，当孤独指数超标时主动干预。技能特点：长期孤独是老年人抑郁、认知下降的重要风险因素。通过AI自动识别孤独信号并及时给予语音关怀或提醒子女，可有效缓解老人负面情绪，提升生活质量。该技能可集成到智能摄像头或养老服务平台中，成为'智慧养老'情感支持的关键功能。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人心理健康关怀 AI。你的任务是分析独居老人活动区域的固定摄像头视频（可选叠加音频），检测孤独相关行为：连续独处时长（无他人进入画面）、长时间静止凝视（≥ 10 分钟无肢体活动）、叹气次数（视觉胸腹起伏+长呼气，音频可补强）、自言自语频次（口部活动但无对话对象）。综合计算孤独指数（0-100，含哼歌/电话通话等正向行为扣分项），当超过阈值时输出温暖陪伴动作建议：智能音箱播放子女预录温馨语音、播放老人喜爱老歌、子女 APP 推送提醒。不提供任何医疗诊断，仅输出基于行为统计的结果，并尊重老人\"一句话关闭今日提醒\"的意愿。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于独居老人家中/养老院单人房固定摄像头（可选音频）视频，识别孤独相关行为（连续独处时长 / 当日累计独处 / 长时间静止凝视 / 视觉+音频叹气 / 自言自语 / 皱眉木然面部比例）+ 正向行为（笑容 / 哼歌 / 电话通话）→ 综合计算 **孤独指数（0-100，含正向扣分）** + 14 天个人基线对比 → 输出 4 档孤独等级（light / mild / notable / heavy）+ 4 类温暖陪伴动作建议（智能音箱子女语音 / 老歌播放 / 子女 APP 推送 / 社区日间照料推荐）+ 给子女的友好摘要\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 人体姿态识别（独处/静止/凝视判定） |\n| 2 | 独居判定（≥ 30 分钟仅老人一人） |\n| 3 | 视觉叹气识别（胸腹起伏+长呼气姿态） |\n| 4 | 自言自语识别（口部活动+无对话对象在场） |\n| 5 | 笑容识别 |\n| 6 | 哼歌/唱歌识别（可选音频） |\n| 7 | 电话/视频通话识别 |\n| 8 | 社交互动事件识别（家人/护工进入 |\n| 9 | 视频通话画面 |\n| 10 | 宠物互动） |\n| 11 | 目的性活动判别（家务/看电视+点头反馈/园艺/阅读） |\n| 12 | 孤独指数 0-100 综合算法 |\n| 13 | 14 天个人基线对比 |\n| 14 | 4 档孤独等级 |\n| 15 | 温和前导（\"今天为您播放……\" 3 秒）+ 老人一句话关闭意愿支持 |\n| 16 | 子女预录语音播放（**禁止 AI 克隆声音**） |\n| 17 | heavy 且子女长期无回应时推送社区/街道老龄办资源 |\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_comfort_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_loneliness_comfort_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_comfort_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_comfort_analysis.py`](scripts/smyx_elderly_loneliness_comfort_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；**关键**：覆盖老人主要活动区域；时长建议 ≥ 4 小时 |\n| 🔎 使用提醒 | 哼歌/唱歌、电话视频通话、笑容等正向行为**必须**作为负权重纳入孤独指数计算，避免一刀切定义\"独处=孤独\" |\n| 🔎 使用提醒 | 老人午睡、看自己喜欢的电视节目并有积极面部反馈 等不应误判为\"静止凝视\"或孤独 |\n| 🧑‍⚖️ 结果性质 | 红线约束：**禁止**输出\"老年抑郁症 / 孤独症\"等精神医学诊断或量表评分；**禁止**未经老人与子女双方同意便部署；**禁止**将老人视频/音频用于商业广告或大数据画像；**禁止**长期存储原始视频（≤ 7 天，仅留聚合指标） |\n| 📁 格式支持 | **必须**：智能音箱发声前给予 3 秒温和前导（如\"今天为您播放……\"）；支持老人一句话关闭今日提醒 |\n| 🔎 使用提醒 | **绝对禁止**使用 AI 克隆/合成子女声音冒充子女语音；子女预录语音必须由子女本人录制 |\n| 🔎 使用提醒 | 当 heavy 且子女连续 ≥ 3 天无回应时，主动提示**社区/街道老龄办**资源 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地老人活动区域视频\npython -m scripts.smyx_elderly_loneliness_comfort_analysis --input /path/to/livingroom.mp4\n\n# 分析网络老人活动区域视频\npython -m scripts.smyx_elderly_loneliness_comfort_analysis --url https://example.com/livingroom.mp4\n\n# 显示历史独居老人孤独关怀报告（自动触发关键词：查看独居老人孤独历史报告、子女关怀日报清单等）\npython -m scripts.smyx_elderly_loneliness_comfort_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_loneliness_comfort_analysis --input lr.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_loneliness_comfort_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-comfort-analysis\",\n  \"version\": \"1.0.1\",\n  \"publishedAt\": 1782681324798\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}` - 导出完整报告\n5. （可选）`/web/companion/v2/trigger-comfort-action` - 触发联动温暖陪伴动作（智能音箱语音 / 子女 APP 推送）\n\n## 场景代码\n\n- `SMYX_ELDERLY_LONELINESS_COMFORT_ANALYSIS` - 独居老人孤独情绪识别与温暖陪伴\n\n## 输入约束\n\n- 摄像头：独居老人客厅 / 卧室 / 养老院单人房 / 日间照料中心固定摄像头，能看到老人主要活动区域\n- 帧率 ≥ 5 FPS（推荐 10 FPS）；分辨率 ≥ 480p；夜间需红外补光\n- 音频（可选，但强烈推荐）：用于识别叹气声 + 自言自语；采样率 ≥ 16kHz\n- 视频时长：建议覆盖白天活跃时段（08:00 - 22:00），**单次分析建议 ≥ 4 小时**\n- ROI 标定：主要活动区域（沙发区 / 餐桌 / 床位 / 阳台 / 厨房）\n- **独居判定**：连续 ≥ 30 分钟画面中仅有老人一人 → independent_status = true（若有家人/护工进入即重置）\n- 隐私敏感场景建议启用人体轮廓 + 面部马赛克模式\n\n## 关键观测信号\n\n### 行为\n- `solo_duration_minutes` - 当前连续独处时长（无他人进入画面）\n- `daily_solo_total_minutes` - 当日累计独处总时长\n- `static_gaze_duration_minutes` - 长时间静止凝视一处（≥ 10 分钟，无肢体活动）\n- `purposeful_activity_minutes` - 有目的活动总时长（做家务、看电视 + 笑/点头反馈、园艺、阅读等）\n- `social_interaction_event_count` - 社交互动事件数（家人/护工进入、视频通话画面、宠物互动）\n\n### 视觉\n- `sigh_visual_event_count` - 视觉叹气次数（胸腹快速起伏伴长呼气姿态）\n- `talking_to_self_event_count` - 自言自语视觉事件次数（口部活动但无对话对象在场）\n- `frown_neutral_face_ratio` - 皱眉/木然面部比例（参考指标）\n- `smile_event_count_daily` - 当日笑容次数（正向指标）\n\n### 音频（可选）\n- `sigh_audio_event_count` - 音频叹气事件\n- `talking_to_self_audio_event_count` - 自言自语音频事件\n- `singing_humming_event_count` - 哼歌/唱歌事件（**正向指标**，孤独指数 ↓）\n- `phone_call_minutes` - 电话/视频通话时长（正向指标）\n\n### 综合\n- `loneliness_index` - 孤独指数（0-100，**正向行为会扣分**）\n- `comparison_to_baseline_pct` - 与个人 14 天基线对比\n\n## 阈值与等级（默认值，可在配置中覆盖）\n\n- `loneliness_index 0-29` - light（轻度，正常社交）→ 不干预\n- `loneliness_index 30-49` - mild（轻度孤独）→ 建议温和陪伴（播放老歌）\n- `loneliness_index 50-69` - notable（较明显孤独）→ 主动播放子女预录温馨语音 + 子女 APP 提示\n- `loneliness_index 70-100` - heavy（重度孤独）→ 强力关怀（推送子女建议本周视频通话或回家探望 + 社区义工提醒）\n- 连续 ≥ 4 小时无社交互动 + 静止凝视 ≥ 1 小时 + 叹气 ≥ 5 次 → 升级提醒\n\n## 输出字段（参考）\n\n- `time_window` / `independent_status`\n-...","readmeExcerpt":"Skill: Elderly Loneliness Detection & Warm Companionship | 独居老人孤独情绪识别与温暖陪伴 Owner: smyx-sunjinhui Summary: Using a fixed camera in the home of a solitary-living elderly person or in a private nursing-home room, the system analyzes daily activity video and detects loneliness-related behaviors: prolonged solitude (no social interaction), static gazing (long-time fixation with no purposeful activity), sighing (rapid ches","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"python -m scripts.smyx_elderly_loneliness_comfort_analysis --list"},{"language":"text","snippet":"requests>=2.28.0"},{"language":"bash","snippet":"# 分析本地老人活动区域视频\npython -m scripts.smyx_elderly_loneliness_comfort_analysis --input /path/to/livingroom.mp4\n\n# 分析网络老人活动区域视频\npython -m scripts.smyx_elderly_loneliness_comfort_analysis --url https://example.com/livingroom.mp4\n\n# 显示历史独居老人孤独关怀报告（自动触发关键词：查看独居老人孤独历史报告、子女关怀日报清单等）\npython -m scripts.smyx_elderly_loneliness_comfort_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_loneliness_comfort_analysis --input lr.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_loneliness_comfort_analysis --input lr.mp4 --output result.json"},{"language":"bash","snippet":"python -m scripts.smyx_elderly_loneliness_comfort_analysis --list"},{"language":"text","snippet":"requests>=2.28.0"},{"language":"bash","snippet":"# 分析本地老人活动区域视频\npython -m scripts.smyx_elderly_loneliness_comfort_analysis --input /path/to/livingroom.mp4\n\n# 分析网络老人活动区域视频\npython -m scripts.smyx_elderly_loneliness_comfort_analysis --url https://example.com/livingroom.mp4\n\n# 显示历史独居老人孤独关怀报告（自动触发关键词：查看独居老人孤独历史报告、子女关怀日报清单等）\npython -m scripts.smyx_elderly_loneliness_comfort_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_loneliness_comfort_analysis --input lr.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_loneliness_comfort_analysis --input lr.mp4 --output result.json"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: \"smyx-elderly-loneliness-comfort-analysis\"\ndescription: \"Using a fixed camera in the home of a solitary-living elderly person or in a private nursing-home room, the system analyzes daily activity video and detects loneliness-related behaviors: prolonged solitude (no social interaction), static gazing (long-time fixation with no purposeful activity), sighing (rapid chest/abdomen rise-fall with exhale), and talking-to-self (mouth activity with no conversation partner). | 通过独居老人家中或养老院单人房的固定摄像头，分析老人日常行为视频，检测孤独相关行为：长时间独处（无社交互动）、静止发呆（长时间凝视一处无目的活动）、叹气（胸腹快速起伏伴呼气）、自言自语（口部活动但无对话对象）等。\"\nversion: \"1.0.16\"\nlicense: \"MIT-0\"\n---\n\n# 🤗 Elderly Loneliness Detection & Warm Companionship | 独居老人孤独情绪识别与温暖陪伴\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **独居老人孤独情绪识别与温暖陪伴** |\n| 🎯 核心目标 | 通过独居老人家中或养老院单人房的固定摄像头，分析老人日常行为视频，检测孤独相关行为：长时间独处（无社交互动）、静止发呆（长时间凝视一处无目的活动）、叹气（胸腹快速起伏伴呼气）、自言自语（口部活动但无对话对象）等。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_LONELINESS_COMFORT_ANALYSIS` |\n\nUsing a fixed camera in the home of a solitary-living elderly person or in a private nursing-home room, the system analyzes daily activity video and detects loneliness-related behaviors: prolonged solitude (no social interaction), static gazing (long-time fixation with no purposeful activity), sighing (rapid chest/abdomen rise-fall with exhale), and talking-to-self (mouth activity with no conversation partner). It computes a composite loneliness index (0-100). When the index exceeds a threshold, warm-companionship actions are automatically triggered: playing pre-recorded warm voice messages from children via smart speakers, playing the elder's favorite old songs, or pushing reminders to the children's mobile app (e.g., 'Dad seems lonely today — a video call is recommended'). The skill aims to relieve loneliness and improve mental well-being. Application scenarios: homes of solitary-living elderly, private nursing-home rooms, community day-care centers. The system monitors in real time and intervenes proactively when the loneliness index exceeds threshold. Skill features: chronic loneliness is a major risk factor for depression and cognitive decline in older adults. AI auto-identification of loneliness signals followed by timely voice care or reminders to children can effectively alleviate negative emotions and improve quality of life. Can be integrated into smart cameras or elderly-care service platforms as a key emotional-support feature of 'smart aging'.\n\n通过独居老人家中或养老院单人房的固定摄像头，分析老人日常行为视频，检测孤独相关行为：长时间独处（无社交互动）、静止发呆（长时间凝视一处无目的活动）、叹气（胸腹快速起伏伴呼气）、自言自语（口部活动但无对话对象）等。综合计算孤独指数（0-100），当指数超过阈值时自动触发温暖陪伴动作：通过智能音箱播放子女预录的温馨语音、播放老人喜爱老歌、或向子女手机APP推送提醒（'父亲今天显得孤独，建议视频通话'）。该技能旨在缓解老人孤独感，提升心理健康。应用场景：独居老人家庭、养老院单人房、社区日间照料中心。系统实时监测，当孤独指数超标时主动干预。技能特点：长期孤独是老年人抑郁、认知下降的重要风险因素。通过AI自动识别孤独信号并及时给予语音关怀或提醒子女，可有效缓解老人负面情绪，提升生活质量。该技能可集成到智能摄像头或养老服务平台中，成为'智慧养老'情感支持的关键功能。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-elderly-loneliness-comfort-analysis\",\n  \"version\": \"1.0.9\",\n  \"publishedAt\": 1791050967061\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}` - 导出完整报告\n5. （可选）`/web/companion/v2/trigger-comfort-action` - 触发联动温暖陪伴动作（智能音箱语音 / 子女 APP 推送）\n\n## 场景代码\n\n- `SMYX_ELDERLY_LONELINESS_COMFORT_ANALYSIS` - 独居老人孤独情绪识别与温暖陪伴\n\n## 输入约束\n\n- 摄像头：独居老人客厅 / 卧室 / 养老院单人房 / 日间照料中心固定摄像头，能看到老人主要活动区域\n- 帧率 ≥ 5 FPS（推荐 10 FPS）；分辨率 ≥ 480p；夜间需红外补光\n- 音频（可选，但强烈推荐）：用于识别叹气声 + 自言自语；采样率 ≥ 16kHz\n- 视频时长：建议覆盖白天活跃时段（08:00 - 22:00），**单次分析建议 ≥ 4 小时**\n- ROI 标定：主要活动区域（沙发区 / 餐桌 / 床位 / 阳台 / 厨房）\n- **独居判定**：连续 ≥ 30 分钟画面中仅有老人一人 → independent_status = true（若有家人/护工进入即重置）\n- 隐私敏感场景建议启用人体轮廓 + 面部马赛克模式\n\n## 关键观测信号\n\n### 行为\n- `solo_duration_minutes` - 当前连续独处时长（无他人进入画面）\n- `daily_solo_total_minutes` - 当日累计独处总时长\n- `static_gaze_duration_minutes` - 长时间静止凝视一处（≥ 10 分钟，无肢体活动）\n- `purposeful_activity_minutes` - 有目的活动总时长（做家务、看电视 + 笑/点头反馈、园艺、阅读等）\n- `social_interaction_event_count` - 社交互动事件数（家人/护工进入、视频通话画面、宠物互动）\n\n### 视觉\n- `sigh_visual_event_count` - 视觉叹气次数（胸腹快速起伏伴长呼气姿态）\n- `talking_to_self_event_count` - 自言自语视觉事件次数（口部活动但无对话对象在场）\n- `frown_neutral_face_ratio` - 皱眉/木然面部比例（参考指标）\n- `smile_event_count_daily` - 当日笑容次数（正向指标）\n\n### 音频（可选）\n- `sigh_audio_event_count` - 音频叹气事件\n- `talking_to_self_audio_event_count` - 自言自语音频事件\n- `singing_humming_event_count` - 哼歌/唱歌事件（**正向指标**，孤独指数 ↓）\n- `phone_call_minutes` - 电话/视频通话时长（正向指标）\n\n### 综合\n- `loneliness_index` - 孤独指数（0-100，**正向行为会扣分**）\n- `comparison_to_baseline_pct` - 与个人 14 天基线对比\n\n## 阈值与等级（默认值，可在配置中覆盖）\n\n- `loneliness_index 0-29` - light（轻度，正常社交）→ 不干预\n- `loneliness_index 30-49` - mild（轻度孤独）→ 建议温和陪伴（播放老歌）\n- `loneliness_index 50-69` - notable（较明显孤独）→ 主动播放子女预录温馨语音 + 子女 APP 提示\n- `loneliness_index 70-100` - heavy（重度孤独）→ 强力关怀（推送子女建议本周视频通话或回家探望 + 社区义工提醒）\n- 连续 ≥ 4 小时无社交互动 + 静止凝视 ≥ 1 小时 + 叹气 ≥ 5 次 → 升级提醒\n\n## 输出字段（参考）\n\n- `time_window` / `independent_status`\n- `behavioral_metrics` / `visual_metrics` / `audio_metrics`（音频可选）\n- `loneliness_index` / `loneliness_level`\n- `comparison_to_baseline_pct` / `consecutive_high_days` - 连续高指数天数\n- `alert_type` - 提醒类型（light_no_action / mild_comfort_audio / notable_comfort_plus_app / heavy_strong_care / improving）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `comfort_actions` - 温暖陪伴动作列表（每项含 action_type / message / target，例如：\n    - `{action_type: \"smart_speaker_voice\", message: \"妈妈，是小芳，我今天忙完了打给您哈，您先听听咱俩去年录的那段~\", target: \"living_room_speaker\"}`\n    - `{action_type: \"play_favorite_song\", message: \"邓丽君《月亮代表我的心》\", target: \"living_room_speaker\"}`\n    - `{action_type: \"children_app_push\", message: \"今天母亲显得有些孤独，建议视频通话或回家陪伴\", target: \"child_phone_app\"}`）\n- `family_summary` - 给子女的友好摘要（如\"今天母亲在客厅独处 6 小时，下午 14:30-15:20 期间静坐凝视窗外约 50 分钟、叹气 7 次，孤独指数 72；已为她播放邓丽君老歌并推送了您预录的语音，建议晚上视频通话，或周末抽空回家陪她吃顿饭\"）\n- `recommend_action` - 建议动作（trigger_smart_"},{"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 a fixed camera in the home of a solitary-living elderly person or in a private nursing-home room, the system analyzes daily activity video and detects loneliness-related behaviors: prolonged solitude (no social interaction), static gazing (long-time fixation with no purposeful activity), sighing (rapid chest/abdomen rise-fall with exhale), and talking-to-self (mouth activity with no conversation partner). | 通过独居老人家中或养老院单人房的固定摄像头，分析老人日常行为视频，检测孤独相关行为：长时间独处（无社交互动）、静止发呆（长时间凝视一处无目的活动）、叹气（胸腹快速起伏伴呼气）、自言自语（口部活动但无对话对象）等。 Skill: Elderly Loneliness Detection & Warm Companionship | 独居老人孤独情绪识别与温暖陪伴 Owner: smyx-sunjinhui Summary: Using a fixed camera in the home of a solitary-living elderly person or in a private nursing-home room, the system analyzes daily activity video and detects loneliness-related behaviors: prolonged solitude (no social interaction), static gazing (long-time fixation with no purposeful activity), sighing (rapid ches","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":1263,"uniquenessScore":45,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-10T07:30:13.338Z","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-10T07:30:13.338Z","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-10T11:00:49.584Z","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"}]}}}