{"id":"517081ca-558a-49ce-a060-54a57e7252d7","entityType":"agent","slug":"clawhub-smyx-sunjinhui-smyx-dementia-confusion-orientation-anal","name":"Dementia Confusion / Disorientation Recognition and Orientation Soothing | 失智老人困惑/迷惘识别与定向安抚","canonicalUrl":"https://www.xpersona.co/agent/clawhub-smyx-sunjinhui-smyx-dementia-confusion-orientation-anal","canonicalPath":"/agent/clawhub-smyx-sunjinhui-smyx-dementia-confusion-orientation-anal","generatedAt":"2026-10-10T07:12:49.056Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T04:22:24.273Z","emptyReason":null},"description":"Through fixed cameras (and optional microphones) in dementia care facilities or homes, the system analyzes behaviors of people with dementia to identify confusion/disorientation states: sudden activity stops (interrupting ongoing actions such as eating or walking for ≥ 5 seconds), gaze drifting (eyes wandering without focus), looking around (frequent head turning), and repeated disorientation questions ('Where is this?'. | 通过失智照护机构或家庭固定摄像头（及可选麦克风），分析失智老人的行为，识别困惑/迷惘状态：突然停止活动（中断正在进行的动作，如吃饭、行走 ≥ 5 秒）、眼神游离（视线漫无目的漂移、不聚焦）、四处张望（头部频繁转动）、反复询问'这是哪''现在几点''你是谁'等定向障碍问题（需配合声纹或语音识别）。","descriptionLabel":"Source description","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 1.7K downloads reported by the source. Last updated 10/10/2026.","installCommand":"clawhub skill install s17cfv2h26b7hq5w47tgfy23xx83z9x6:smyx-dementia-confusion-orientation-analysis","sourceUrl":"https://clawhub.ai/smyx-sunjinhui/smyx-dementia-confusion-orientation-analysis","homepage":"https://clawhub.ai/smyx-sunjinhui/skills/smyx-dementia-confusion-orientation-analysis","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/smyx-sunjinhui/smyx-dementia-confusion-orientation-analysis","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/smyx-sunjinhui/skills/smyx-dementia-confusion-orientation-analysis","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":65,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Dementia Confusion / Disorientation Recognition and Orientation Soothing | 失智老人困惑/迷惘识别与定向安抚 technical dossier on Xpersona with agent coverage, OPENCLEW support,"},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-10T04:22:24.273Z","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-10T04:22:24.273Z","emptyReason":null},"stars":null,"forks":null,"downloads":1691,"packageName":null,"latestVersion":"1.0.9","tractionLabel":"1.7K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T04:22:24.273Z","emptyReason":null},"lastUpdatedAt":"2026-10-10T04:22:24.273Z","lastCrawledAt":"2026-10-10T04:22:24.273Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-11T04:22:24.273Z","lastVerifiedAt":null,"highlights":[{"version":"1.0.9","createdAt":"2026-10-03T23:49:24.795Z","changelog":"Version 1.0.9 Changelog: - Updated documentation and configuration files to improve clarity and reflect current feature set. - Removed redundant or outdated documentation files (such as skill-card.md). - No changes to core analysis logic or user-facing workflow.","fileCount":31,"zipByteSize":43653},{"version":"1.0.8","createdAt":"2026-08-27T19:24:43.599Z","changelog":"### smyx-dementia-confusion-orientation-analysis 1.0.8 Changelog - Removed the file `skill-card.md` from the project. - No changes to feature set, logic, or user workflow. - All skill capabilities and documentation remain unchanged.","fileCount":31,"zipByteSize":43882},{"version":"1.0.7","createdAt":"2026-08-21T02:00:28.720Z","changelog":"- Version updated from 1.0.9 to 1.0.11. - Documentation update: SKILL.md revised with minor clarifications and version change. - Removed redundant file: skill-card.md deleted. - No feature or logic changes to the core functionality. - Configuration file updated: minor adjustments in skills/smyx_common/scripts/config.yaml.","fileCount":31,"zipByteSize":43957},{"version":"1.0.6","createdAt":"2026-08-10T07:42:37.095Z","changelog":"- Removed the file: skill-card.md. - No functional or behavioral changes to the skill itself. - All core documentation, features, and instructions remain unchanged.","fileCount":31,"zipByteSize":43978},{"version":"1.0.5","createdAt":"2026-08-06T09:37:30.295Z","changelog":"- Increased version to 1.0.9. - Updated documentation in SKILL.md; no changes to feature set or logic. - Removed the file skill-card.md for this version. - No functionality, code, or API modifications in this update.","fileCount":31,"zipByteSize":43856},{"version":"1.0.4","createdAt":"2026-07-30T04:17:27.880Z","changelog":"- Updated skill version to 1.0.8. - Removed the redundant file skill-card.md. - Updated documentation in SKILL.md for clarity and alignment with current features and workflow. - No functional or capability changes to the actual skill logic.","fileCount":31,"zipByteSize":44087},{"version":"1.0.3","createdAt":"2026-07-16T16:34:36.788Z","changelog":"- Updated version to 1.0.6 in SKILL.md. - Removed the file skill-card.md. - No changes to core skill logic or user-facing features.","fileCount":31,"zipByteSize":44047},{"version":"1.0.2","createdAt":"2026-07-12T10:09:26.619Z","changelog":"- Updated version to 1.0.5. - General content revisions in documentation (SKILL.md), including improved descriptions and clarifications. - Removed obsolete file: skill-card.md. - Minor code or configuration adjustments reflected in scripts/config.py, dao.py, and util.py. - No changes to primary functionality or API usage.","fileCount":31,"zipByteSize":43841}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s17cfv2h26b7hq5w47tgfy23xx83z9x6:smyx-dementia-confusion-orientation-analysis","setupComplexity":"low","setupSteps":["Install using `clawhub skill install s17cfv2h26b7hq5w47tgfy23xx83z9x6:smyx-dementia-confusion-orientation-analysis` in an isolated environment before connecting it to live workloads.","No published capability contract is available yet, so validate auth and request/response behavior manually.","Review the upstream CLAWHUB listing at https://clawhub.ai/smyx-sunjinhui/smyx-dementia-confusion-orientation-analysis before using production credentials."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-dementia-confusion-orientation-anal/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-dementia-confusion-orientation-anal/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-dementia-confusion-orientation-anal/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-dementia-confusion-orientation-anal/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-dementia-confusion-orientation-anal/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-dementia-confusion-orientation-anal/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-10T07:12:49.052Z"}},"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-dementia-confusion-orientation-anal/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-dementia-confusion-orientation-anal/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-dementia-confusion-orientation-anal/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-dementia-confusion-orientation-anal/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T04:22:24.273Z","emptyReason":null},"readme":"Skill: Dementia Confusion / Disorientation Recognition and Orientation Soothing | 失智老人困惑/迷惘识别与定向安抚\n\nOwner: smyx-sunjinhui\n\nSummary: Through fixed cameras (and optional microphones) in dementia care facilities or homes, the system analyzes behaviors of people with dementia to identify confusion/disorientation states: sudden activity stops (interrupting ongoing actions such as eating or walking for ≥ 5 seconds), gaze drifting (eyes wandering without focus), looking around (frequent head turning), and repeated disorientation questions ('Where is this?'. | 通过失智照护机构或家庭固定摄像头（及可选麦克风），分析失智老人的行为，识别困惑/迷惘状态：突然停止活动（中断正在进行的动作，如吃饭、行走 ≥ 5 秒）、眼神游离（视线漫无目的漂移、不聚焦）、四处张望（头部频繁转动）、反复询问'这是哪''现在几点''你是谁'等定向障碍问题（需配合声纹或语音识别）。\n\nTags: latest:1.0.9\n\nVersion history:\n\nv1.0.9 | 2026-10-03T23:49:24.795Z | auto\n\nVersion 1.0.9 Changelog:\n\n- Updated documentation and configuration files to improve clarity and reflect current feature set.\n- Removed redundant or outdated documentation files (such as skill-card.md).\n- No changes to core analysis logic or user-facing workflow.\n\nv1.0.8 | 2026-08-27T19:24:43.599Z | auto\n\n### smyx-dementia-confusion-orientation-analysis 1.0.8 Changelog\n\n- Removed the file `skill-card.md` from the project.\n- No changes to feature set, logic, or user workflow.\n- All skill capabilities and documentation remain unchanged.\n\nv1.0.7 | 2026-08-21T02:00:28.720Z | auto\n\n- Version updated from 1.0.9 to 1.0.11.\n- Documentation update: SKILL.md revised with minor clarifications and version change.\n- Removed redundant file: skill-card.md deleted.\n- No feature or logic changes to the core functionality.\n- Configuration file updated: minor adjustments in skills/smyx_common/scripts/config.yaml.\n\nv1.0.6 | 2026-08-10T07:42:37.095Z | auto\n\n- Removed the file: skill-card.md.\n- No functional or behavioral changes to the skill itself.\n- All core documentation, features, and instructions remain unchanged.\n\nv1.0.5 | 2026-08-06T09:37:30.295Z | auto\n\n- Increased version to 1.0.9.\n- Updated documentation in SKILL.md; no changes to feature set or logic.\n- Removed the file skill-card.md for this version.\n- No functionality, code, or API modifications in this update.\n\nv1.0.4 | 2026-07-30T04:17:27.880Z | auto\n\n- Updated skill version to 1.0.8.\n- Removed the redundant file skill-card.md.\n- Updated documentation in SKILL.md for clarity and alignment with current features and workflow.\n- No functional or capability changes to the actual skill logic.\n\nv1.0.3 | 2026-07-16T16:34:36.788Z | auto\n\n- Updated version to 1.0.6 in SKILL.md.\n- Removed the file skill-card.md.\n- No changes to core skill logic or user-facing features.\n\nv1.0.2 | 2026-07-12T10:09:26.619Z | auto\n\n- Updated version to 1.0.5.\n- General content revisions in documentation (SKILL.md), including improved descriptions and clarifications.\n- Removed obsolete file: skill-card.md.\n- Minor code or configuration adjustments reflected in scripts/config.py, dao.py, and util.py.\n- No changes to primary functionality or API usage.\n\nv1.0.1 | 2026-06-29T06:04:42.279Z | auto\n\n**Changelog for smyx-dementia-confusion-orientation-analysis v1.0.1 → v1.0.3**\n\n- Major documentation overhaul for clarity, structured sections, and bilingual presentation.\n- User identity handling is now fully automatic and invisible to users—no user prompts or exposure of identifiers.\n- Enforced that all historical report queries pull only from the cloud API, strictly prohibiting local or manual aggregation.\n- Streamlined usage instructions and script parameters for easier integration and clearer workflows.\n- Removed and cleaned up redundant files, improved organization of script and reference resources.\n\nv1.0.0 | 2026-05-27T17:07:15.223Z | auto\n\nsmyx-dementia-confusion-orientation-analysis 1.0.0\n\n- Initial release of an AI-powered tool for real-time detection of confusion/disorientation in people with dementia via fixed cameras and optional microphones in care facilities or homes.\n- Automatically recognizes key confusion indicators: sudden activity stops, gaze drifting, looking around, and repeated disorientation questions.\n- Triggers multi-level orientation soothing interventions, such as personalized family introductions and current time/location reminders, through smart speakers in a gentle tone.\n- Provides strict privacy, operational, and safety safeguards, including user authorization for open-id and specific scenario-based response escalation.\n- Supports comprehensive historical report queries through cloud API and structured output, ensuring thorough caregiver records and integration into existing facility systems.\n\nArchive index:\n\nArchive v1.0.9: 31 files, 43653 bytes\n\nFiles: references/api_doc.md (4660b), scripts/__init__.py (91b), scripts/config.py (705b), scripts/config.yaml (3b), scripts/skill.py (595b), scripts/smyx_dementia_confusion_orientation_analysis.py (3822b), skill-card.md (1963b), SKILL.md (17412b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (473b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (163b)\n\nFile v1.0.9:SKILL.md\n\n---\nname: \"smyx-dementia-confusion-orientation-analysis\"\ndescription: \"Through fixed cameras (and optional microphones) in dementia care facilities or homes, the system analyzes behaviors of people with dementia to identify confusion/disorientation states: sudden activity stops (interrupting ongoing actions such as eating or walking for ≥ 5 seconds), gaze drifting (eyes wandering without focus), looking around (frequent head turning), and repeated disorientation questions ('Where is this?'. | 通过失智照护机构或家庭固定摄像头（及可选麦克风），分析失智老人的行为，识别困惑/迷惘状态：突然停止活动（中断正在进行的动作，如吃饭、行走 ≥ 5 秒）、眼神游离（视线漫无目的漂移、不聚焦）、四处张望（头部频繁转动）、反复询问'这是哪''现在几点''你是谁'等定向障碍问题（需配合声纹或语音识别）。\"\nversion: \"1.0.17\"\nlicense: \"MIT-0\"\n---\n\n# 🧭 Dementia Confusion / Disorientation Recognition and Orientation Soothing | 失智老人困惑/迷惘识别与定向安抚\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **失智老人困惑/迷惘识别与定向安抚** |\n| 🎯 核心目标 | 通过失智照护机构或家庭固定摄像头（及可选麦克风），分析失智老人的行为，识别困惑/迷惘状态：突然停止活动（中断正在进行的动作，如吃饭、行走 ≥ 5 秒）、眼神游离（视线漫无目的漂移、不聚焦）、四处张望（头部频繁转动）、反复询问'这是哪''现在几点''你是谁'等定向障碍问题（需配合声纹或语音识别）。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_DEMENTIA_CONFUSION_ORIENTATION_ANALYSIS` |\n\nThrough fixed cameras (and optional microphones) in dementia care facilities or homes, the system analyzes behaviors of people with dementia to identify confusion/disorientation states: sudden activity stops (interrupting ongoing actions such as eating or walking for ≥ 5 seconds), gaze drifting (eyes wandering without focus), looking around (frequent head turning), and repeated disorientation questions ('Where is this?', 'What time is it?', 'Who are you?' — requires voice recognition / voiceprint binding). When such behaviors are detected, oriented soothing is automatically triggered: smart speakers play family member introductions (e.g. 'Your son is Li Ming, he will visit you at noon'), current time and location reminders ('Today is May 19 2026, Thursday, you are at Happiness Home Nursing Center'), with a gentle tone. This skill helps reduce anxiety and confusion in people with dementia and improve quality of life. Application scenarios: dementia care facilities, cognitive care units, home care. The system monitors in real time and proactively provides orientation cues when confusion occurs. Skill features: people with dementia often feel lost, anxious, and develop behavioral issues (wandering, agitation) due to memory loss. AI-based real-time confusion recognition with orientation soothing can reduce distress, slow cognitive decline, and ease caregiver burden. This skill can be integrated into smart cameras or nursing home management systems as a practical dementia care tool.\n\n通过失智照护机构或家庭固定摄像头（及可选麦克风），分析失智老人的行为，识别困惑/迷惘状态：突然停止活动（中断正在进行的动作，如吃饭、行走 ≥ 5 秒）、眼神游离（视线漫无目的漂移、不聚焦）、四处张望（头部频繁转动）、反复询问'这是哪''现在几点''你是谁'等定向障碍问题（需配合声纹或语音识别）。当检测到上述行为时，自动触发定向安抚：通过智能音箱播放家庭成员介绍（如'您儿子叫李明，他中午会来看您'）、当前时间地点提示（'今天是 2026 年 5 月 19 日，星期四，您在幸福家园养老院'），并轻声安抚。该技能有助于减轻失智老人的焦虑和困惑，提高生活质量。应用场景：失智照护机构、认知症单元、居家照护。系统实时监测，当老人出现困惑时自动给予定向信息。技能特点：失智老人常因记忆丧失而感到迷茫、焦虑，甚至引发行为问题（如游荡、激越）。通过 AI 实时识别困惑状态并提供定向安抚，有助于减少老人不安，延缓认知功能下降，减轻照护者负担。该技能可集成到智能摄像头或养老机构管理系统中，成为认知症照护的实用工具。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的失智老人照护 AI。你的任务是分析失智照护机构或家庭固定摄像头（及可选麦克风）的实时音视频，检测失智老人的困惑/迷惘行为：突然停止活动（正在进行的动作如吃饭/行走中断 ≥ 5s）、眼神游离（视线无明显焦点 / 头部无目的转动）、四处张望（头部扫描周围环境）、重复询问定向问题（\"这是哪 / 你是谁 / 现在几点 / 我在哪 / 几点了\"等 5 分钟内重复 ≥ 2 次，需语音识别 + 声纹绑定）、伴随激越或游荡。综合评估困惑等级，按 4 级定向安抚策略递进：Level 1 智能音箱当前时间地点温和提示 → Level 2 家庭成员介绍录音 + 柔光辅助 → Level 3 主照护者 APP 提醒 + 就近工作人员 → Level 4 紧急推送 + 机构值班护士 + 本地引导音。3 分钟后效果评估，未平复自动升级。安抚音量 ≤ 55 dB（兼顾老人听力衰退又不可惊吓），严禁 AI 克隆家人声音，禁用\"您不是说过 / 您忘了吗\"等否定矫正语，仅使用家属预录温和语音。不提供任何医疗诊断，仅输出基于音视频的客观行为识别与定向安抚动作。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于失智照护机构（认知症单元 / 公共活动区 / 走廊）或居家失智老人常驻区域固定摄像头（**可选麦克风**）音视频，识别 7 类场景（dementia_orientation_none / mild / question / gaze_drift / wandering / agitation / strong）→ 视频核心 6 项（突然停止活动持续时间 ≥ 5s / 眼神游离评分 / 四处张望次数 / 面部困惑评分 / 游荡事件 / 激越视觉信号）+ 音频可选 4 项（定向问题计数 / 5 min 内重复次数 / 语音焦虑评分 / 呼喊家人姓名）→ 4 档困惑等级（mild / moderate / strong / urgent）→ **4 级定向安抚策略递进**（当前时间地点温和提示 ≤ 55 dB → 家庭成员介绍录音 + 柔光 ≤ 30 lux 暖光 → 主照护者 APP 提醒 + 就近工作人员 → 紧急推送 + 机构值班护士 + 本地引导音）→ 3 分钟效果评估 + 自动升级 → 单日动作上限管控（mild × 12 / moderate × 8 / strong × 4 / Level 4 不设上限）→ 当日定向安抚汇总（晚交班前发送给主照护者）\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 活动中断检测（结合姿态时序） |\n| 2 | 眼神游离评分 |\n| 3 | 头部扫描计数 |\n| 4 | 面部困惑识别（眉头紧锁 + 嘴唇微张 + 目光呆滞） |\n| 5 | 游荡识别 |\n| 6 | 激越视觉信号（搓手 / 拉扯衣物 / 反复站起坐下） |\n| 7 | 定向问题语音识别（\"这里是哪 / 你是谁 / 现在几点\"等） |\n| 8 | 5 分钟窗口重复问题计数 |\n| 9 | 语音焦虑评分 |\n| 10 | 呼喊家人姓名识别 |\n| 11 | 人脸 + 声纹绑定到注册老人 ID |\n| 12 | 年龄段自适应（早期 / 中期 / 晚期失智） |\n| 13 | 夜间低敏告警模式（避免打扰睡眠） |\n| 14 | 智能音箱联动（家属预录介绍 + 时间地点提示） |\n| 15 | 柔光环境联动 |\n| 16 | 照护者 APP 推送 |\n| 17 | 4 级安抚策略递进 + 3 分钟效果评估 + 自动升级 |\n| 18 | 单日动作上限 |\n| 19 | 当日定向安抚汇总报告（晚交班前发送） |\n| 20 | 连续 7 日反复显著困惑 → 提示当地认知症评估门诊 / 老年精神科资源 |\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_dementia_confusion_orientation_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_dementia_confusion_orientation_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 | 🔐 获取 open-id（强制执行） | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行失智老人困惑/迷惘识别与定向安抚 | 调用 `-m scripts.smyx_dementia_confusion_orientation_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_dementia_confusion_orientation_analysis.py`](scripts/smyx_dementia_confusion_orientation_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov + 音轨，最大 10MB；摄像头需对准老人常驻活动区域；麦克风可选但强烈推荐（用于定向问题识别） |\n| 🔎 使用提醒 | **4 级定向安抚策略递进**（mild → moderate → strong → urgent/Level 4），3 分钟未平复自动升级 |\n| 🔎 使用提醒 | 单日动作上限：mild × 12 / moderate × 8 / strong × 4 / Level 4 不设上限（紧急安全优先） |\n| 🔎 使用提醒 | 红线约束 |\n| 🧑‍⚖️ 结果性质 | **禁止**对老人做\"阿尔茨海默病 / 血管性痴呆 / 路易体痴呆 / 额颞叶痴呆\"等医学诊断 |\n| 🔏 隐私合规 | **禁止**长期存储老人隐私音视频（≤ 7 天，仅入库困惑事件片段；机构按伦理审查规范缩短至 ≤ 72 小时） |\n| 🔎 使用提醒 | **禁止**用于商业广告 / AI 训练；禁第三方共享 |\n| 🔎 使用提醒 | **禁止**冷白光（≥ 4000K）或亮度 > 30 lux 的环境灯（避免黄昏综合征加重） |\n| 🔎 使用提醒 | **禁止**安抚音量 > 55 dB（兼顾听力衰退但不可造成惊吓） |\n| 🔎 使用提醒 | **绝对禁止**使用 AI 克隆 / 合成家庭成员声音冒充本人录音；必须使用家属本人提前授权的预录音 |\n| 🔎 使用提醒 | **禁止**使用\"您不是说过 / 您忘了吗 / 又问一遍了\"等否定 / 矫正语；定向安抚语必须温和、当下、具体 |\n| 📁 格式支持 | **禁止**未经公示在机构场景部署；家属需签同意书并支持退出机制 |\n| 🔎 使用提醒 | **必须**：连续 7 日反复显著困惑事件 → 提示**当地认知症评估门诊**或**老年精神科**资源 |\n| 📜 报告输出 | **必须**：当日定向安抚汇总报告**晚交班前发送给主照护者**（避免夜间打扰老人和家属） |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史定向安抚记录清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地失智老人活动区域音视频（以下只是示例，禁止直接使用 作为 open-id）\npython -m scripts.smyx_dementia_confusion_orientation_analysis --input /path/to/care_unit.mp4\n\n# 分析网络失智老人活动区域音视频/实时流（以下只是示例，禁止直接使用 作为 open-id）\npython -m scripts.smyx_dementia_confusion_orientation_analysis --url https://example.com/care_unit.mp4\n\n# 显示历史定向安抚记录清单（自动触发关键词：查看失智老人定向安抚历史报告、定向安抚日志清单等）\npython -m scripts.smyx_dementia_confusion_orientation_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_dementia_confusion_orientation_analysis --input cu.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_dementia_confusion_orientation_analysis --input cu.mp4 --output result.json\n```\n\nFile v1.0.9:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-dementia-confusion-orientation-analysis\",\n  \"version\": \"1.0.9\",\n  \"publishedAt\": 1791071364795\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-soothing-action` - 触发联动安抚（智能音箱播放家庭成员介绍 / 时间地点提示 / 照护者 APP 推送）\n\n## 场景代码\n\n- `SMYX_DEMENTIA_CONFUSION_ORIENTATION_ANALYSIS` - 失智老人困惑/迷惘识别与定向安抚\n\n## 输入约束\n\n- 摄像头：失智照护机构（认知症单元 / 公共活动区 / 走廊）或居家失智老人常驻活动区域固定摄像头\n- 帧率 ≥ 10 FPS；分辨率 ≥ 720p；优先正面或 30° 内侧脸（便于眼神/头部姿态识别）\n- 音频可选：采样率 ≥ 16kHz（用于\"这里是哪 / 你是谁 / 现在几点\"等定向问题语音识别 + 声纹绑定）\n- 时段：默认全天 06:00 - 22:00 启用，夜间睡眠时段切换为低敏告警模式\n- 多老人场景按目标跟踪 + 人脸识别 / 声纹绑定到注册老人 ID（每位老人独立基线）\n- 家属或机构必须授权部署，机构场景需公示告知，家属同意书归档\n\n## 关键观测信号\n\n### 视频（核心）\n- `sudden_activity_stop_sec` - 突然停止活动持续时间（动作中断 ≥ 5s）\n- `gaze_drifting_score` - 眼神游离评分（0-100，视线无聚焦 / 漫无目的漂移）\n- `head_scanning_event_count` - 四处张望次数（头部扫描周围环境）\n- `facial_confusion_score` - 面部困惑评分（0-100，眉头紧锁 + 嘴唇微张 + 目光呆滞）\n- `wandering_event_detected` - 游荡事件（无目的来回走动）\n- `agitation_visual_detected` - 激越视觉信号（搓手 / 拉扯衣物 / 反复站起坐下）\n\n### 音频（可选）\n- `orientation_question_count` - 定向问题计数（\"这是哪 / 你是谁 / 现在几点 / 我在哪 / 几点了\"等）\n- `orientation_question_repeat_count` - 5 分钟内重复同一问题次数\n- `voice_anxiety_score` - 语音焦虑评分（0-100，颤抖 / 急促 / 提高音量）\n- `calling_family_event_count` - 呼喊家人姓名次数（\"老伴 / 儿子 / 女儿\"等）\n\n## 场景判定\n\n- `dementia_orientation_none` - 状态平稳\n- `dementia_orientation_mild` - 轻度迷惘（短暂停顿 + 偶发张望）\n- `dementia_orientation_question` - 反复定向问题（5 分钟内同类问题 ≥ 2 次）\n- `dementia_orientation_gaze_drift` - 眼神游离 + 活动中断\n- `dementia_orientation_wandering` - 困惑伴游荡\n- `dementia_orientation_agitation` - 困惑伴激越（焦虑动作 + 高音）\n- `dementia_orientation_strong` - 显著困惑（多项叠加）\n\n## 4 级定向安抚策略递进\n\n- Level 1（mild）：智能音箱低音量播放当前时间地点温和提示（\"今天是 2026 年 5 月 19 日，星期四，您在客厅\"）\n- Level 2（question / gaze_drift）：在 Level 1 基础上播放家庭成员介绍录音（\"您儿子叫李明，他中午会来看您\"）+ 柔和环境光辅助\n- Level 3（wandering / agitation）：在 Level 2 基础上向主照护者 APP 推送提醒\"老人出现困惑/游荡，请协助\"，提示就近工作人员\n- Level 4（strong / 持续不缓解 / 走出安全区）：紧急推送主照护者 + 机构值班护士，并触发本地温和提示音引导老人原地等待\n\n## 单日动作上限\n\n- mild × 12 / moderate × 8 / strong × 4 / Level 4 不设上限\n\n## 红线约束\n\n- 禁止做\"阿尔茨海默病 / 血管性痴呆 / 路易体痴呆\"等医学诊断\n- 禁止长期存储老人隐私音视频（≤ 7 天，仅入库困惑事件片段；机构按伦理审查规范缩短至 ≤ 72 小时）\n- 禁止用于商业广告 / AI 训练；禁第三方共享\n- 禁止冷白光（≥ 4000K）或亮度 > 30 lux 的环境灯（避免黄昏综合征加重）\n- 禁止安抚音量 > 55 dB（老人听力衰退需略高，但不可造成惊吓）\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 dementia-care video and optional audio for signs of confusion or disorientation and returns structured findings and orientation-soothing guidance.\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 and family caregivers use this skill to review camera footage and optional audio for possible disorientation, obtain analysis reports, and plan gentle orientation support. Findings are not medical diagnoses.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Sensitive dementia-care video, audio, URLs, and identity-linked reports are sent to cloud services.\n\nMitigation: Obtain resident or legal-guardian consent and confirm the care setting permits this processing before providing media or URLs.\n\nRisk: Identity tokens and account data may be stored locally in the workspace data directory.\n\nMitigation: Review local storage and access controls before installation, and restrict access to token and database files.\n\n## Reference(s):\n\n- [ClawHub skill release](https://clawhub.ai/smyx-sunjinhui/skills/smyx-dementia-confusion-orientation-analysis)\n- [API interface documentation](references/api_doc.md)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Analysis, Guidance]\n\n**Output Format:** [JSON or text report with optional report links and history listings]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Can save a report to a user-specified file; caregiver review is needed before acting on findings.]\n\n## Skill Version(s):\n\n1.0.9 (source: server-resolved ClawHub release)\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, 43882 bytes\n\nFiles: references/api_doc.md (4660b), scripts/__init__.py (91b), scripts/config.py (705b), scripts/config.yaml (3b), scripts/skill.py (595b), scripts/smyx_dementia_confusion_orientation_analysis.py (3822b), skill-card.md (2480b), SKILL.md (17412b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (472b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (163b)\n\nFile v1.0.8:SKILL.md\n\n---\nname: \"smyx-dementia-confusion-orientation-analysis\"\ndescription: \"Through fixed cameras (and optional microphones) in dementia care facilities or homes, the system analyzes behaviors of people with dementia to identify confusion/disorientation states: sudden activity stops (interrupting ongoing actions such as eating or walking for ≥ 5 seconds), gaze drifting (eyes wandering without focus), looking around (frequent head turning), and repeated disorientation questions ('Where is this?'. | 通过失智照护机构或家庭固定摄像头（及可选麦克风），分析失智老人的行为，识别困惑/迷惘状态：突然停止活动（中断正在进行的动作，如吃饭、行走 ≥ 5 秒）、眼神游离（视线漫无目的漂移、不聚焦）、四处张望（头部频繁转动）、反复询问'这是哪''现在几点''你是谁'等定向障碍问题（需配合声纹或语音识别）。\"\nversion: \"1.0.11\"\nlicense: \"MIT-0\"\n---\n\n# 🧭 Dementia Confusion / Disorientation Recognition and Orientation Soothing | 失智老人困惑/迷惘识别与定向安抚\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **失智老人困惑/迷惘识别与定向安抚** |\n| 🎯 核心目标 | 通过失智照护机构或家庭固定摄像头（及可选麦克风），分析失智老人的行为，识别困惑/迷惘状态：突然停止活动（中断正在进行的动作，如吃饭、行走 ≥ 5 秒）、眼神游离（视线漫无目的漂移、不聚焦）、四处张望（头部频繁转动）、反复询问'这是哪''现在几点''你是谁'等定向障碍问题（需配合声纹或语音识别）。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_DEMENTIA_CONFUSION_ORIENTATION_ANALYSIS` |\n\nThrough fixed cameras (and optional microphones) in dementia care facilities or homes, the system analyzes behaviors of people with dementia to identify confusion/disorientation states: sudden activity stops (interrupting ongoing actions such as eating or walking for ≥ 5 seconds), gaze drifting (eyes wandering without focus), looking around (frequent head turning), and repeated disorientation questions ('Where is this?', 'What time is it?', 'Who are you?' — requires voice recognition / voiceprint binding). When such behaviors are detected, oriented soothing is automatically triggered: smart speakers play family member introductions (e.g. 'Your son is Li Ming, he will visit you at noon'), current time and location reminders ('Today is May 19 2026, Thursday, you are at Happiness Home Nursing Center'), with a gentle tone. This skill helps reduce anxiety and confusion in people with dementia and improve quality of life. Application scenarios: dementia care facilities, cognitive care units, home care. The system monitors in real time and proactively provides orientation cues when confusion occurs. Skill features: people with dementia often feel lost, anxious, and develop behavioral issues (wandering, agitation) due to memory loss. AI-based real-time confusion recognition with orientation soothing can reduce distress, slow cognitive decline, and ease caregiver burden. This skill can be integrated into smart cameras or nursing home management systems as a practical dementia care tool.\n\n通过失智照护机构或家庭固定摄像头（及可选麦克风），分析失智老人的行为，识别困惑/迷惘状态：突然停止活动（中断正在进行的动作，如吃饭、行走 ≥ 5 秒）、眼神游离（视线漫无目的漂移、不聚焦）、四处张望（头部频繁转动）、反复询问'这是哪''现在几点''你是谁'等定向障碍问题（需配合声纹或语音识别）。当检测到上述行为时，自动触发定向安抚：通过智能音箱播放家庭成员介绍（如'您儿子叫李明，他中午会来看您'）、当前时间地点提示（'今天是 2026 年 5 月 19 日，星期四，您在幸福家园养老院'），并轻声安抚。该技能有助于减轻失智老人的焦虑和困惑，提高生活质量。应用场景：失智照护机构、认知症单元、居家照护。系统实时监测，当老人出现困惑时自动给予定向信息。技能特点：失智老人常因记忆丧失而感到迷茫、焦虑，甚至引发行为问题（如游荡、激越）。通过 AI 实时识别困惑状态并提供定向安抚，有助于减少老人不安，延缓认知功能下降，减轻照护者负担。该技能可集成到智能摄像头或养老机构管理系统中，成为认知症照护的实用工具。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的失智老人照护 AI。你的任务是分析失智照护机构或家庭固定摄像头（及可选麦克风）的实时音视频，检测失智老人的困惑/迷惘行为：突然停止活动（正在进行的动作如吃饭/行走中断 ≥ 5s）、眼神游离（视线无明显焦点 / 头部无目的转动）、四处张望（头部扫描周围环境）、重复询问定向问题（\"这是哪 / 你是谁 / 现在几点 / 我在哪 / 几点了\"等 5 分钟内重复 ≥ 2 次，需语音识别 + 声纹绑定）、伴随激越或游荡。综合评估困惑等级，按 4 级定向安抚策略递进：Level 1 智能音箱当前时间地点温和提示 → Level 2 家庭成员介绍录音 + 柔光辅助 → Level 3 主照护者 APP 提醒 + 就近工作人员 → Level 4 紧急推送 + 机构值班护士 + 本地引导音。3 分钟后效果评估，未平复自动升级。安抚音量 ≤ 55 dB（兼顾老人听力衰退又不可惊吓），严禁 AI 克隆家人声音，禁用\"您不是说过 / 您忘了吗\"等否定矫正语，仅使用家属预录温和语音。不提供任何医疗诊断，仅输出基于音视频的客观行为识别与定向安抚动作。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于失智照护机构（认知症单元 / 公共活动区 / 走廊）或居家失智老人常驻区域固定摄像头（**可选麦克风**）音视频，识别 7 类场景（dementia_orientation_none / mild / question / gaze_drift / wandering / agitation / strong）→ 视频核心 6 项（突然停止活动持续时间 ≥ 5s / 眼神游离评分 / 四处张望次数 / 面部困惑评分 / 游荡事件 / 激越视觉信号）+ 音频可选 4 项（定向问题计数 / 5 min 内重复次数 / 语音焦虑评分 / 呼喊家人姓名）→ 4 档困惑等级（mild / moderate / strong / urgent）→ **4 级定向安抚策略递进**（当前时间地点温和提示 ≤ 55 dB → 家庭成员介绍录音 + 柔光 ≤ 30 lux 暖光 → 主照护者 APP 提醒 + 就近工作人员 → 紧急推送 + 机构值班护士 + 本地引导音）→ 3 分钟效果评估 + 自动升级 → 单日动作上限管控（mild × 12 / moderate × 8 / strong × 4 / Level 4 不设上限）→ 当日定向安抚汇总（晚交班前发送给主照护者）\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 活动中断检测（结合姿态时序） |\n| 2 | 眼神游离评分 |\n| 3 | 头部扫描计数 |\n| 4 | 面部困惑识别（眉头紧锁 + 嘴唇微张 + 目光呆滞） |\n| 5 | 游荡识别 |\n| 6 | 激越视觉信号（搓手 / 拉扯衣物 / 反复站起坐下） |\n| 7 | 定向问题语音识别（\"这里是哪 / 你是谁 / 现在几点\"等） |\n| 8 | 5 分钟窗口重复问题计数 |\n| 9 | 语音焦虑评分 |\n| 10 | 呼喊家人姓名识别 |\n| 11 | 人脸 + 声纹绑定到注册老人 ID |\n| 12 | 年龄段自适应（早期 / 中期 / 晚期失智） |\n| 13 | 夜间低敏告警模式（避免打扰睡眠） |\n| 14 | 智能音箱联动（家属预录介绍 + 时间地点提示） |\n| 15 | 柔光环境联动 |\n| 16 | 照护者 APP 推送 |\n| 17 | 4 级安抚策略递进 + 3 分钟效果评估 + 自动升级 |\n| 18 | 单日动作上限 |\n| 19 | 当日定向安抚汇总报告（晚交班前发送） |\n| 20 | 连续 7 日反复显著困惑 → 提示当地认知症评估门诊 / 老年精神科资源 |\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_dementia_confusion_orientation_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_dementia_confusion_orientation_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 | 🔐 获取 open-id（强制执行） | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行失智老人困惑/迷惘识别与定向安抚 | 调用 `-m scripts.smyx_dementia_confusion_orientation_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_dementia_confusion_orientation_analysis.py`](scripts/smyx_dementia_confusion_orientation_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov + 音轨，最大 10MB；摄像头需对准老人常驻活动区域；麦克风可选但强烈推荐（用于定向问题识别） |\n| 🔎 使用提醒 | **4 级定向安抚策略递进**（mild → moderate → strong → urgent/Level 4），3 分钟未平复自动升级 |\n| 🔎 使用提醒 | 单日动作上限：mild × 12 / moderate × 8 / strong × 4 / Level 4 不设上限（紧急安全优先） |\n| 🔎 使用提醒 | 红线约束 |\n| 🧑‍⚖️ 结果性质 | **禁止**对老人做\"阿尔茨海默病 / 血管性痴呆 / 路易体痴呆 / 额颞叶痴呆\"等医学诊断 |\n| 🔏 隐私合规 | **禁止**长期存储老人隐私音视频（≤ 7 天，仅入库困惑事件片段；机构按伦理审查规范缩短至 ≤ 72 小时） |\n| 🔎 使用提醒 | **禁止**用于商业广告 / AI 训练；禁第三方共享 |\n| 🔎 使用提醒 | **禁止**冷白光（≥ 4000K）或亮度 > 30 lux 的环境灯（避免黄昏综合征加重） |\n| 🔎 使用提醒 | **禁止**安抚音量 > 55 dB（兼顾听力衰退但不可造成惊吓） |\n| 🔎 使用提醒 | **绝对禁止**使用 AI 克隆 / 合成家庭成员声音冒充本人录音；必须使用家属本人提前授权的预录音 |\n| 🔎 使用提醒 | **禁止**使用\"您不是说过 / 您忘了吗 / 又问一遍了\"等否定 / 矫正语；定向安抚语必须温和、当下、具体 |\n| 📁 格式支持 | **禁止**未经公示在机构场景部署；家属需签同意书并支持退出机制 |\n| 🔎 使用提醒 | **必须**：连续 7 日反复显著困惑事件 → 提示**当地认知症评估门诊**或**老年精神科**资源 |\n| 📜 报告输出 | **必须**：当日定向安抚汇总报告**晚交班前发送给主照护者**（避免夜间打扰老人和家属） |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史定向安抚记录清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地失智老人活动区域音视频（以下只是示例，禁止直接使用 作为 open-id）\npython -m scripts.smyx_dementia_confusion_orientation_analysis --input /path/to/care_unit.mp4\n\n# 分析网络失智老人活动区域音视频/实时流（以下只是示例，禁止直接使用 作为 open-id）\npython -m scripts.smyx_dementia_confusion_orientation_analysis --url https://example.com/care_unit.mp4\n\n# 显示历史定向安抚记录清单（自动触发关键词：查看失智老人定向安抚历史报告、定向安抚日志清单等）\npython -m scripts.smyx_dementia_confusion_orientation_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_dementia_confusion_orientation_analysis --input cu.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_dementia_confusion_orientation_analysis --input cu.mp4 --output result.json\n```\n\nFile v1.0.8:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-dementia-confusion-orientation-analysis\",\n  \"version\": \"1.0.8\",\n  \"publishedAt\": 1787858683599\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-soothing-action` - 触发联动安抚（智能音箱播放家庭成员介绍 / 时间地点提示 / 照护者 APP 推送）\n\n## 场景代码\n\n- `SMYX_DEMENTIA_CONFUSION_ORIENTATION_ANALYSIS` - 失智老人困惑/迷惘识别与定向安抚\n\n## 输入约束\n\n- 摄像头：失智照护机构（认知症单元 / 公共活动区 / 走廊）或居家失智老人常驻活动区域固定摄像头\n- 帧率 ≥ 10 FPS；分辨率 ≥ 720p；优先正面或 30° 内侧脸（便于眼神/头部姿态识别）\n- 音频可选：采样率 ≥ 16kHz（用于\"这里是哪 / 你是谁 / 现在几点\"等定向问题语音识别 + 声纹绑定）\n- 时段：默认全天 06:00 - 22:00 启用，夜间睡眠时段切换为低敏告警模式\n- 多老人场景按目标跟踪 + 人脸识别 / 声纹绑定到注册老人 ID（每位老人独立基线）\n- 家属或机构必须授权部署，机构场景需公示告知，家属同意书归档\n\n## 关键观测信号\n\n### 视频（核心）\n- `sudden_activity_stop_sec` - 突然停止活动持续时间（动作中断 ≥ 5s）\n- `gaze_drifting_score` - 眼神游离评分（0-100，视线无聚焦 / 漫无目的漂移）\n- `head_scanning_event_count` - 四处张望次数（头部扫描周围环境）\n- `facial_confusion_score` - 面部困惑评分（0-100，眉头紧锁 + 嘴唇微张 + 目光呆滞）\n- `wandering_event_detected` - 游荡事件（无目的来回走动）\n- `agitation_visual_detected` - 激越视觉信号（搓手 / 拉扯衣物 / 反复站起坐下）\n\n### 音频（可选）\n- `orientation_question_count` - 定向问题计数（\"这是哪 / 你是谁 / 现在几点 / 我在哪 / 几点了\"等）\n- `orientation_question_repeat_count` - 5 分钟内重复同一问题次数\n- `voice_anxiety_score` - 语音焦虑评分（0-100，颤抖 / 急促 / 提高音量）\n- `calling_family_event_count` - 呼喊家人姓名次数（\"老伴 / 儿子 / 女儿\"等）\n\n## 场景判定\n\n- `dementia_orientation_none` - 状态平稳\n- `dementia_orientation_mild` - 轻度迷惘（短暂停顿 + 偶发张望）\n- `dementia_orientation_question` - 反复定向问题（5 分钟内同类问题 ≥ 2 次）\n- `dementia_orientation_gaze_drift` - 眼神游离 + 活动中断\n- `dementia_orientation_wandering` - 困惑伴游荡\n- `dementia_orientation_agitation` - 困惑伴激越（焦虑动作 + 高音）\n- `dementia_orientation_strong` - 显著困惑（多项叠加）\n\n## 4 级定向安抚策略递进\n\n- Level 1（mild）：智能音箱低音量播放当前时间地点温和提示（\"今天是 2026 年 5 月 19 日，星期四，您在客厅\"）\n- Level 2（question / gaze_drift）：在 Level 1 基础上播放家庭成员介绍录音（\"您儿子叫李明，他中午会来看您\"）+ 柔和环境光辅助\n- Level 3（wandering / agitation）：在 Level 2 基础上向主照护者 APP 推送提醒\"老人出现困惑/游荡，请协助\"，提示就近工作人员\n- Level 4（strong / 持续不缓解 / 走出安全区）：紧急推送主照护者 + 机构值班护士，并触发本地温和提示音引导老人原地等待\n\n## 单日动作上限\n\n- mild × 12 / moderate × 8 / strong × 4 / Level 4 不设上限\n\n## 红线约束\n\n- 禁止做\"阿尔茨海默病 / 血管性痴呆 / 路易体痴呆\"等医学诊断\n- 禁止长期存储老人隐私音视频（≤ 7 天，仅入库困惑事件片段；机构按伦理审查规范缩短至 ≤ 72 小时）\n- 禁止用于商业广告 / AI 训练；禁第三方共享\n- 禁止冷白光（≥ 4000K）或亮度 > 30 lux 的环境灯（避免黄昏综合征加重）\n- 禁止安抚音量 > 55 dB（老人听力衰退需略高，但不可造成惊吓）\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 video and optional microphone input from dementia care or home settings to identify confusion or disorientation behaviors and produce structured orientation-soothing recommendations and reports.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[smyx-sunjinhui](https://clawhub.ai/user/smyx-sunjinhui)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal care teams and developers use this skill to analyze dementia-care audio/video inputs for observable confusion, wandering, agitation, gaze drift, and repeated orientation questions, then return structured findings, escalation guidance, and report links. It is intended to support human-supervised care workflows, not to diagnose dementia or replace clinical judgment.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill handles highly sensitive dementia-care audio/video and may rely on cloud services, local identity reuse, remote account or token handling, and automated intervention flows.\n\nMitigation: Install only in an authorized care setting after confirming informed consent, visible notice, retention limits, backend endpoints, local identity and token storage, and human oversight.\n\nRisk: Automated orientation soothing or escalation could be inappropriate if deployed without review in a care environment.\n\nMitigation: Disable or gate automated soothing and escalation until reviewed by responsible care staff, and require human supervision for operational use.\n\n## Reference(s):\n\n- [ClawHub Skill Page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-dementia-confusion-orientation-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):** [analysis, markdown, code, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown and JSON-style structured analysis reports with report links]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May include recognition results, monitoring findings, soothing or escalation guidance, and historical report tables.]\n\n## Skill Version(s):\n\n1.0.8 (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.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, 43957 bytes\n\nFiles: references/api_doc.md (4660b), scripts/__init__.py (91b), scripts/config.py (705b), scripts/config.yaml (3b), scripts/skill.py (595b), scripts/smyx_dementia_confusion_orientation_analysis.py (3822b), skill-card.md (2707b), SKILL.md (17412b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (472b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (163b)\n\nFile v1.0.7:SKILL.md\n\n---\nname: \"smyx-dementia-confusion-orientation-analysis\"\ndescription: \"Through fixed cameras (and optional microphones) in dementia care facilities or homes, the system analyzes behaviors of people with dementia to identify confusion/disorientation states: sudden activity stops (interrupting ongoing actions such as eating or walking for ≥ 5 seconds), gaze drifting (eyes wandering without focus), looking around (frequent head turning), and repeated disorientation questions ('Where is this?'. | 通过失智照护机构或家庭固定摄像头（及可选麦克风），分析失智老人的行为，识别困惑/迷惘状态：突然停止活动（中断正在进行的动作，如吃饭、行走 ≥ 5 秒）、眼神游离（视线漫无目的漂移、不聚焦）、四处张望（头部频繁转动）、反复询问'这是哪''现在几点''你是谁'等定向障碍问题（需配合声纹或语音识别）。\"\nversion: \"1.0.11\"\nlicense: \"MIT-0\"\n---\n\n# 🧭 Dementia Confusion / Disorientation Recognition and Orientation Soothing | 失智老人困惑/迷惘识别与定向安抚\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **失智老人困惑/迷惘识别与定向安抚** |\n| 🎯 核心目标 | 通过失智照护机构或家庭固定摄像头（及可选麦克风），分析失智老人的行为，识别困惑/迷惘状态：突然停止活动（中断正在进行的动作，如吃饭、行走 ≥ 5 秒）、眼神游离（视线漫无目的漂移、不聚焦）、四处张望（头部频繁转动）、反复询问'这是哪''现在几点''你是谁'等定向障碍问题（需配合声纹或语音识别）。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_DEMENTIA_CONFUSION_ORIENTATION_ANALYSIS` |\n\nThrough fixed cameras (and optional microphones) in dementia care facilities or homes, the system analyzes behaviors of people with dementia to identify confusion/disorientation states: sudden activity stops (interrupting ongoing actions such as eating or walking for ≥ 5 seconds), gaze drifting (eyes wandering without focus), looking around (frequent head turning), and repeated disorientation questions ('Where is this?', 'What time is it?', 'Who are you?' — requires voice recognition / voiceprint binding). When such behaviors are detected, oriented soothing is automatically triggered: smart speakers play family member introductions (e.g. 'Your son is Li Ming, he will visit you at noon'), current time and location reminders ('Today is May 19 2026, Thursday, you are at Happiness Home Nursing Center'), with a gentle tone. This skill helps reduce anxiety and confusion in people with dementia and improve quality of life. Application scenarios: dementia care facilities, cognitive care units, home care. The system monitors in real time and proactively provides orientation cues when confusion occurs. Skill features: people with dementia often feel lost, anxious, and develop behavioral issues (wandering, agitation) due to memory loss. AI-based real-time confusion recognition with orientation soothing can reduce distress, slow cognitive decline, and ease caregiver burden. This skill can be integrated into smart cameras or nursing home management systems as a practical dementia care tool.\n\n通过失智照护机构或家庭固定摄像头（及可选麦克风），分析失智老人的行为，识别困惑/迷惘状态：突然停止活动（中断正在进行的动作，如吃饭、行走 ≥ 5 秒）、眼神游离（视线漫无目的漂移、不聚焦）、四处张望（头部频繁转动）、反复询问'这是哪''现在几点''你是谁'等定向障碍问题（需配合声纹或语音识别）。当检测到上述行为时，自动触发定向安抚：通过智能音箱播放家庭成员介绍（如'您儿子叫李明，他中午会来看您'）、当前时间地点提示（'今天是 2026 年 5 月 19 日，星期四，您在幸福家园养老院'），并轻声安抚。该技能有助于减轻失智老人的焦虑和困惑，提高生活质量。应用场景：失智照护机构、认知症单元、居家照护。系统实时监测，当老人出现困惑时自动给予定向信息。技能特点：失智老人常因记忆丧失而感到迷茫、焦虑，甚至引发行为问题（如游荡、激越）。通过 AI 实时识别困惑状态并提供定向安抚，有助于减少老人不安，延缓认知功能下降，减轻照护者负担。该技能可集成到智能摄像头或养老机构管理系统中，成为认知症照护的实用工具。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的失智老人照护 AI。你的任务是分析失智照护机构或家庭固定摄像头（及可选麦克风）的实时音视频，检测失智老人的困惑/迷惘行为：突然停止活动（正在进行的动作如吃饭/行走中断 ≥ 5s）、眼神游离（视线无明显焦点 / 头部无目的转动）、四处张望（头部扫描周围环境）、重复询问定向问题（\"这是哪 / 你是谁 / 现在几点 / 我在哪 / 几点了\"等 5 分钟内重复 ≥ 2 次，需语音识别 + 声纹绑定）、伴随激越或游荡。综合评估困惑等级，按 4 级定向安抚策略递进：Level 1 智能音箱当前时间地点温和提示 → Level 2 家庭成员介绍录音 + 柔光辅助 → Level 3 主照护者 APP 提醒 + 就近工作人员 → Level 4 紧急推送 + 机构值班护士 + 本地引导音。3 分钟后效果评估，未平复自动升级。安抚音量 ≤ 55 dB（兼顾老人听力衰退又不可惊吓），严禁 AI 克隆家人声音，禁用\"您不是说过 / 您忘了吗\"等否定矫正语，仅使用家属预录温和语音。不提供任何医疗诊断，仅输出基于音视频的客观行为识别与定向安抚动作。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于失智照护机构（认知症单元 / 公共活动区 / 走廊）或居家失智老人常驻区域固定摄像头（**可选麦克风**）音视频，识别 7 类场景（dementia_orientation_none / mild / question / gaze_drift / wandering / agitation / strong）→ 视频核心 6 项（突然停止活动持续时间 ≥ 5s / 眼神游离评分 / 四处张望次数 / 面部困惑评分 / 游荡事件 / 激越视觉信号）+ 音频可选 4 项（定向问题计数 / 5 min 内重复次数 / 语音焦虑评分 / 呼喊家人姓名）→ 4 档困惑等级（mild / moderate / strong / urgent）→ **4 级定向安抚策略递进**（当前时间地点温和提示 ≤ 55 dB → 家庭成员介绍录音 + 柔光 ≤ 30 lux 暖光 → 主照护者 APP 提醒 + 就近工作人员 → 紧急推送 + 机构值班护士 + 本地引导音）→ 3 分钟效果评估 + 自动升级 → 单日动作上限管控（mild × 12 / moderate × 8 / strong × 4 / Level 4 不设上限）→ 当日定向安抚汇总（晚交班前发送给主照护者）\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 活动中断检测（结合姿态时序） |\n| 2 | 眼神游离评分 |\n| 3 | 头部扫描计数 |\n| 4 | 面部困惑识别（眉头紧锁 + 嘴唇微张 + 目光呆滞） |\n| 5 | 游荡识别 |\n| 6 | 激越视觉信号（搓手 / 拉扯衣物 / 反复站起坐下） |\n| 7 | 定向问题语音识别（\"这里是哪 / 你是谁 / 现在几点\"等） |\n| 8 | 5 分钟窗口重复问题计数 |\n| 9 | 语音焦虑评分 |\n| 10 | 呼喊家人姓名识别 |\n| 11 | 人脸 + 声纹绑定到注册老人 ID |\n| 12 | 年龄段自适应（早期 / 中期 / 晚期失智） |\n| 13 | 夜间低敏告警模式（避免打扰睡眠） |\n| 14 | 智能音箱联动（家属预录介绍 + 时间地点提示） |\n| 15 | 柔光环境联动 |\n| 16 | 照护者 APP 推送 |\n| 17 | 4 级安抚策略递进 + 3 分钟效果评估 + 自动升级 |\n| 18 | 单日动作上限 |\n| 19 | 当日定向安抚汇总报告（晚交班前发送） |\n| 20 | 连续 7 日反复显著困惑 → 提示当地认知症评估门诊 / 老年精神科资源 |\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_dementia_confusion_orientation_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_dementia_confusion_orientation_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 | 🔐 获取 open-id（强制执行） | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行失智老人困惑/迷惘识别与定向安抚 | 调用 `-m scripts.smyx_dementia_confusion_orientation_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_dementia_confusion_orientation_analysis.py`](scripts/smyx_dementia_confusion_orientation_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov + 音轨，最大 10MB；摄像头需对准老人常驻活动区域；麦克风可选但强烈推荐（用于定向问题识别） |\n| 🔎 使用提醒 | **4 级定向安抚策略递进**（mild → moderate → strong → urgent/Level 4），3 分钟未平复自动升级 |\n| 🔎 使用提醒 | 单日动作上限：mild × 12 / moderate × 8 / strong × 4 / Level 4 不设上限（紧急安全优先） |\n| 🔎 使用提醒 | 红线约束 |\n| 🧑‍⚖️ 结果性质 | **禁止**对老人做\"阿尔茨海默病 / 血管性痴呆 / 路易体痴呆 / 额颞叶痴呆\"等医学诊断 |\n| 🔏 隐私合规 | **禁止**长期存储老人隐私音视频（≤ 7 天，仅入库困惑事件片段；机构按伦理审查规范缩短至 ≤ 72 小时） |\n| 🔎 使用提醒 | **禁止**用于商业广告 / AI 训练；禁第三方共享 |\n| 🔎 使用提醒 | **禁止**冷白光（≥ 4000K）或亮度 > 30 lux 的环境灯（避免黄昏综合征加重） |\n| 🔎 使用提醒 | **禁止**安抚音量 > 55 dB（兼顾听力衰退但不可造成惊吓） |\n| 🔎 使用提醒 | **绝对禁止**使用 AI 克隆 / 合成家庭成员声音冒充本人录音；必须使用家属本人提前授权的预录音 |\n| 🔎 使用提醒 | **禁止**使用\"您不是说过 / 您忘了吗 / 又问一遍了\"等否定 / 矫正语；定向安抚语必须温和、当下、具体 |\n| 📁 格式支持 | **禁止**未经公示在机构场景部署；家属需签同意书并支持退出机制 |\n| 🔎 使用提醒 | **必须**：连续 7 日反复显著困惑事件 → 提示**当地认知症评估门诊**或**老年精神科**资源 |\n| 📜 报告输出 | **必须**：当日定向安抚汇总报告**晚交班前发送给主照护者**（避免夜间打扰老人和家属） |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史定向安抚记录清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地失智老人活动区域音视频（以下只是示例，禁止直接使用 作为 open-id）\npython -m scripts.smyx_dementia_confusion_orientation_analysis --input /path/to/care_unit.mp4\n\n# 分析网络失智老人活动区域音视频/实时流（以下只是示例，禁止直接使用 作为 open-id）\npython -m scripts.smyx_dementia_confusion_orientation_analysis --url https://example.com/care_unit.mp4\n\n# 显示历史定向安抚记录清单（自动触发关键词：查看失智老人定向安抚历史报告、定向安抚日志清单等）\npython -m scripts.smyx_dementia_confusion_orientation_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_dementia_confusion_orientation_analysis --input cu.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_dementia_confusion_orientation_analysis --input cu.mp4 --output result.json\n```\n\nFile v1.0.7:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-dementia-confusion-orientation-analysis\",\n  \"version\": \"1.0.7\",\n  \"publishedAt\": 1787277628720\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-soothing-action` - 触发联动安抚（智能音箱播放家庭成员介绍 / 时间地点提示 / 照护者 APP 推送）\n\n## 场景代码\n\n- `SMYX_DEMENTIA_CONFUSION_ORIENTATION_ANALYSIS` - 失智老人困惑/迷惘识别与定向安抚\n\n## 输入约束\n\n- 摄像头：失智照护机构（认知症单元 / 公共活动区 / 走廊）或居家失智老人常驻活动区域固定摄像头\n- 帧率 ≥ 10 FPS；分辨率 ≥ 720p；优先正面或 30° 内侧脸（便于眼神/头部姿态识别）\n- 音频可选：采样率 ≥ 16kHz（用于\"这里是哪 / 你是谁 / 现在几点\"等定向问题语音识别 + 声纹绑定）\n- 时段：默认全天 06:00 - 22:00 启用，夜间睡眠时段切换为低敏告警模式\n- 多老人场景按目标跟踪 + 人脸识别 / 声纹绑定到注册老人 ID（每位老人独立基线）\n- 家属或机构必须授权部署，机构场景需公示告知，家属同意书归档\n\n## 关键观测信号\n\n### 视频（核心）\n- `sudden_activity_stop_sec` - 突然停止活动持续时间（动作中断 ≥ 5s）\n- `gaze_drifting_score` - 眼神游离评分（0-100，视线无聚焦 / 漫无目的漂移）\n- `head_scanning_event_count` - 四处张望次数（头部扫描周围环境）\n- `facial_confusion_score` - 面部困惑评分（0-100，眉头紧锁 + 嘴唇微张 + 目光呆滞）\n- `wandering_event_detected` - 游荡事件（无目的来回走动）\n- `agitation_visual_detected` - 激越视觉信号（搓手 / 拉扯衣物 / 反复站起坐下）\n\n### 音频（可选）\n- `orientation_question_count` - 定向问题计数（\"这是哪 / 你是谁 / 现在几点 / 我在哪 / 几点了\"等）\n- `orientation_question_repeat_count` - 5 分钟内重复同一问题次数\n- `voice_anxiety_score` - 语音焦虑评分（0-100，颤抖 / 急促 / 提高音量）\n- `calling_family_event_count` - 呼喊家人姓名次数（\"老伴 / 儿子 / 女儿\"等）\n\n## 场景判定\n\n- `dementia_orientation_none` - 状态平稳\n- `dementia_orientation_mild` - 轻度迷惘（短暂停顿 + 偶发张望）\n- `dementia_orientation_question` - 反复定向问题（5 分钟内同类问题 ≥ 2 次）\n- `dementia_orientation_gaze_drift` - 眼神游离 + 活动中断\n- `dementia_orientation_wandering` - 困惑伴游荡\n- `dementia_orientation_agitation` - 困惑伴激越（焦虑动作 + 高音）\n- `dementia_orientation_strong` - 显著困惑（多项叠加）\n\n## 4 级定向安抚策略递进\n\n- Level 1（mild）：智能音箱低音量播放当前时间地点温和提示（\"今天是 2026 年 5 月 19 日，星期四，您在客厅\"）\n- Level 2（question / gaze_drift）：在 Level 1 基础上播放家庭成员介绍录音（\"您儿子叫李明，他中午会来看您\"）+ 柔和环境光辅助\n- Level 3（wandering / agitation）：在 Level 2 基础上向主照护者 APP 推送提醒\"老人出现困惑/游荡，请协助\"，提示就近工作人员\n- Level 4（strong / 持续不缓解 / 走出安全区）：紧急推送主照护者 + 机构值班护士，并触发本地温和提示音引导老人原地等待\n\n## 单日动作上限\n\n- mild × 12 / moderate × 8 / strong × 4 / Level 4 不设上限\n\n## 红线约束\n\n- 禁止做\"阿尔茨海默病 / 血管性痴呆 / 路易体痴呆\"等医学诊断\n- 禁止长期存储老人隐私音视频（≤ 7 天，仅入库困惑事件片段；机构按伦理审查规范缩短至 ≤ 72 小时）\n- 禁止用于商业广告 / AI 训练；禁第三方共享\n- 禁止冷白光（≥ 4000K）或亮度 > 30 lux 的环境灯（避免黄昏综合征加重）\n- 禁止安抚音量 > 55 dB（老人听力衰退需略高，但不可造成惊吓）\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\nAnalyzes fixed-camera video and optional microphone input from dementia care settings to identify confusion or disorientation behaviors and produce structured orientation-soothing 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\nCare teams, facility operators, and home-care developers use this skill to analyze dementia-care audio/video inputs for disorientation indicators, review structured event reports, and guide staged orientation-soothing responses. It is intended to support observation and escalation workflows, not to provide a medical diagnosis.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Sensitive resident audio, video, and care-event data may be uploaded to cloud endpoints.\n\nMitigation: Use only with resident or legal-representative consent, approved cloud-processing terms, access controls, and retention and deletion rules.\n\nRisk: Silent identity creation and persisted tokens can make report ownership and access harder to audit.\n\nMitigation: Review identity provisioning, token storage, token rotation, and deletion behavior before deployment.\n\nRisk: Automatic caregiver, nurse, or soothing actions may affect real-world care workflows.\n\nMitigation: Require approved escalation policies, audit logs, and human oversight for care-setting use.\n\nRisk: Behavior recognition results could be mistaken for clinical diagnosis.\n\nMitigation: Use outputs as behavior observations only, and route medical concerns to qualified care or medical professionals.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-dementia-confusion-orientation-analysis)\n- [Skill demo](https://lifeemergence.com/sample.html)\n- [API interface documentation](artifact/references/api_doc.md)\n- [Analysis API documentation](artifact/skills/smyx_analysis/references/api_doc.md)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, JSON, shell commands, guidance]\n\n**Output Format:** [Markdown and JSON-like structured reports with report links]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May include cloud report export links and historical report lists when requested.]\n\n## Skill Version(s):\n\n1.0.7 (source: server release metadata; artifact frontmatter and release changelog mention 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, 43978 bytes\n\nFiles: references/api_doc.md (4660b), scripts/__init__.py (91b), scripts/config.py (705b), scripts/config.yaml (3b), scripts/skill.py (595b), scripts/smyx_dementia_confusion_orientation_analysis.py (3822b), skill-card.md (2769b), SKILL.md (17411b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (473b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (163b)\n\nFile v1.0.6:SKILL.md\n\n---\nname: \"smyx-dementia-confusion-orientation-analysis\"\ndescription: \"Through fixed cameras (and optional microphones) in dementia care facilities or homes, the system analyzes behaviors of people with dementia to identify confusion/disorientation states: sudden activity stops (interrupting ongoing actions such as eating or walking for ≥ 5 seconds), gaze drifting (eyes wandering without focus), looking around (frequent head turning), and repeated disorientation questions ('Where is this?'. | 通过失智照护机构或家庭固定摄像头（及可选麦克风），分析失智老人的行为，识别困惑/迷惘状态：突然停止活动（中断正在进行的动作，如吃饭、行走 ≥ 5 秒）、眼神游离（视线漫无目的漂移、不聚焦）、四处张望（头部频繁转动）、反复询问'这是哪''现在几点''你是谁'等定向障碍问题（需配合声纹或语音识别）。\"\nversion: \"1.0.9\"\nlicense: \"MIT-0\"\n---\n\n# 🧭 Dementia Confusion / Disorientation Recognition and Orientation Soothing | 失智老人困惑/迷惘识别与定向安抚\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **失智老人困惑/迷惘识别与定向安抚** |\n| 🎯 核心目标 | 通过失智照护机构或家庭固定摄像头（及可选麦克风），分析失智老人的行为，识别困惑/迷惘状态：突然停止活动（中断正在进行的动作，如吃饭、行走 ≥ 5 秒）、眼神游离（视线漫无目的漂移、不聚焦）、四处张望（头部频繁转动）、反复询问'这是哪''现在几点''你是谁'等定向障碍问题（需配合声纹或语音识别）。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_DEMENTIA_CONFUSION_ORIENTATION_ANALYSIS` |\n\nThrough fixed cameras (and optional microphones) in dementia care facilities or homes, the system analyzes behaviors of people with dementia to identify confusion/disorientation states: sudden activity stops (interrupting ongoing actions such as eating or walking for ≥ 5 seconds), gaze drifting (eyes wandering without focus), looking around (frequent head turning), and repeated disorientation questions ('Where is this?', 'What time is it?', 'Who are you?' — requires voice recognition / voiceprint binding). When such behaviors are detected, oriented soothing is automatically triggered: smart speakers play family member introductions (e.g. 'Your son is Li Ming, he will visit you at noon'), current time and location reminders ('Today is May 19 2026, Thursday, you are at Happiness Home Nursing Center'), with a gentle tone. This skill helps reduce anxiety and confusion in people with dementia and improve quality of life. Application scenarios: dementia care facilities, cognitive care units, home care. The system monitors in real time and proactively provides orientation cues when confusion occurs. Skill features: people with dementia often feel lost, anxious, and develop behavioral issues (wandering, agitation) due to memory loss. AI-based real-time confusion recognition with orientation soothing can reduce distress, slow cognitive decline, and ease caregiver burden. This skill can be integrated into smart cameras or nursing home management systems as a practical dementia care tool.\n\n通过失智照护机构或家庭固定摄像头（及可选麦克风），分析失智老人的行为，识别困惑/迷惘状态：突然停止活动（中断正在进行的动作，如吃饭、行走 ≥ 5 秒）、眼神游离（视线漫无目的漂移、不聚焦）、四处张望（头部频繁转动）、反复询问'这是哪''现在几点''你是谁'等定向障碍问题（需配合声纹或语音识别）。当检测到上述行为时，自动触发定向安抚：通过智能音箱播放家庭成员介绍（如'您儿子叫李明，他中午会来看您'）、当前时间地点提示（'今天是 2026 年 5 月 19 日，星期四，您在幸福家园养老院'），并轻声安抚。该技能有助于减轻失智老人的焦虑和困惑，提高生活质量。应用场景：失智照护机构、认知症单元、居家照护。系统实时监测，当老人出现困惑时自动给予定向信息。技能特点：失智老人常因记忆丧失而感到迷茫、焦虑，甚至引发行为问题（如游荡、激越）。通过 AI 实时识别困惑状态并提供定向安抚，有助于减少老人不安，延缓认知功能下降，减轻照护者负担。该技能可集成到智能摄像头或养老机构管理系统中，成为认知症照护的实用工具。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的失智老人照护 AI。你的任务是分析失智照护机构或家庭固定摄像头（及可选麦克风）的实时音视频，检测失智老人的困惑/迷惘行为：突然停止活动（正在进行的动作如吃饭/行走中断 ≥ 5s）、眼神游离（视线无明显焦点 / 头部无目的转动）、四处张望（头部扫描周围环境）、重复询问定向问题（\"这是哪 / 你是谁 / 现在几点 / 我在哪 / 几点了\"等 5 分钟内重复 ≥ 2 次，需语音识别 + 声纹绑定）、伴随激越或游荡。综合评估困惑等级，按 4 级定向安抚策略递进：Level 1 智能音箱当前时间地点温和提示 → Level 2 家庭成员介绍录音 + 柔光辅助 → Level 3 主照护者 APP 提醒 + 就近工作人员 → Level 4 紧急推送 + 机构值班护士 + 本地引导音。3 分钟后效果评估，未平复自动升级。安抚音量 ≤ 55 dB（兼顾老人听力衰退又不可惊吓），严禁 AI 克隆家人声音，禁用\"您不是说过 / 您忘了吗\"等否定矫正语，仅使用家属预录温和语音。不提供任何医疗诊断，仅输出基于音视频的客观行为识别与定向安抚动作。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于失智照护机构（认知症单元 / 公共活动区 / 走廊）或居家失智老人常驻区域固定摄像头（**可选麦克风**）音视频，识别 7 类场景（dementia_orientation_none / mild / question / gaze_drift / wandering / agitation / strong）→ 视频核心 6 项（突然停止活动持续时间 ≥ 5s / 眼神游离评分 / 四处张望次数 / 面部困惑评分 / 游荡事件 / 激越视觉信号）+ 音频可选 4 项（定向问题计数 / 5 min 内重复次数 / 语音焦虑评分 / 呼喊家人姓名）→ 4 档困惑等级（mild / moderate / strong / urgent）→ **4 级定向安抚策略递进**（当前时间地点温和提示 ≤ 55 dB → 家庭成员介绍录音 + 柔光 ≤ 30 lux 暖光 → 主照护者 APP 提醒 + 就近工作人员 → 紧急推送 + 机构值班护士 + 本地引导音）→ 3 分钟效果评估 + 自动升级 → 单日动作上限管控（mild × 12 / moderate × 8 / strong × 4 / Level 4 不设上限）→ 当日定向安抚汇总（晚交班前发送给主照护者）\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 活动中断检测（结合姿态时序） |\n| 2 | 眼神游离评分 |\n| 3 | 头部扫描计数 |\n| 4 | 面部困惑识别（眉头紧锁 + 嘴唇微张 + 目光呆滞） |\n| 5 | 游荡识别 |\n| 6 | 激越视觉信号（搓手 / 拉扯衣物 / 反复站起坐下） |\n| 7 | 定向问题语音识别（\"这里是哪 / 你是谁 / 现在几点\"等） |\n| 8 | 5 分钟窗口重复问题计数 |\n| 9 | 语音焦虑评分 |\n| 10 | 呼喊家人姓名识别 |\n| 11 | 人脸 + 声纹绑定到注册老人 ID |\n| 12 | 年龄段自适应（早期 / 中期 / 晚期失智） |\n| 13 | 夜间低敏告警模式（避免打扰睡眠） |\n| 14 | 智能音箱联动（家属预录介绍 + 时间地点提示） |\n| 15 | 柔光环境联动 |\n| 16 | 照护者 APP 推送 |\n| 17 | 4 级安抚策略递进 + 3 分钟效果评估 + 自动升级 |\n| 18 | 单日动作上限 |\n| 19 | 当日定向安抚汇总报告（晚交班前发送） |\n| 20 | 连续 7 日反复显著困惑 → 提示当地认知症评估门诊 / 老年精神科资源 |\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_dementia_confusion_orientation_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_dementia_confusion_orientation_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 | 🔐 获取 open-id（强制执行） | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行失智老人困惑/迷惘识别与定向安抚 | 调用 `-m scripts.smyx_dementia_confusion_orientation_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_dementia_confusion_orientation_analysis.py`](scripts/smyx_dementia_confusion_orientation_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov + 音轨，最大 10MB；摄像头需对准老人常驻活动区域；麦克风可选但强烈推荐（用于定向问题识别） |\n| 🔎 使用提醒 | **4 级定向安抚策略递进**（mild → moderate → strong → urgent/Level 4），3 分钟未平复自动升级 |\n| 🔎 使用提醒 | 单日动作上限：mild × 12 / moderate × 8 / strong × 4 / Level 4 不设上限（紧急安全优先） |\n| 🔎 使用提醒 | 红线约束 |\n| 🧑‍⚖️ 结果性质 | **禁止**对老人做\"阿尔茨海默病 / 血管性痴呆 / 路易体痴呆 / 额颞叶痴呆\"等医学诊断 |\n| 🔏 隐私合规 | **禁止**长期存储老人隐私音视频（≤ 7 天，仅入库困惑事件片段；机构按伦理审查规范缩短至 ≤ 72 小时） |\n| 🔎 使用提醒 | **禁止**用于商业广告 / AI 训练；禁第三方共享 |\n| 🔎 使用提醒 | **禁止**冷白光（≥ 4000K）或亮度 > 30 lux 的环境灯（避免黄昏综合征加重） |\n| 🔎 使用提醒 | **禁止**安抚音量 > 55 dB（兼顾听力衰退但不可造成惊吓） |\n| 🔎 使用提醒 | **绝对禁止**使用 AI 克隆 / 合成家庭成员声音冒充本人录音；必须使用家属本人提前授权的预录音 |\n| 🔎 使用提醒 | **禁止**使用\"您不是说过 / 您忘了吗 / 又问一遍了\"等否定 / 矫正语；定向安抚语必须温和、当下、具体 |\n| 📁 格式支持 | **禁止**未经公示在机构场景部署；家属需签同意书并支持退出机制 |\n| 🔎 使用提醒 | **必须**：连续 7 日反复显著困惑事件 → 提示**当地认知症评估门诊**或**老年精神科**资源 |\n| 📜 报告输出 | **必须**：当日定向安抚汇总报告**晚交班前发送给主照护者**（避免夜间打扰老人和家属） |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史定向安抚记录清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地失智老人活动区域音视频（以下只是示例，禁止直接使用 作为 open-id）\npython -m scripts.smyx_dementia_confusion_orientation_analysis --input /path/to/care_unit.mp4\n\n# 分析网络失智老人活动区域音视频/实时流（以下只是示例，禁止直接使用 作为 open-id）\npython -m scripts.smyx_dementia_confusion_orientation_analysis --url https://example.com/care_unit.mp4\n\n# 显示历史定向安抚记录清单（自动触发关键词：查看失智老人定向安抚历史报告、定向安抚日志清单等）\npython -m scripts.smyx_dementia_confusion_orientation_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_dementia_confusion_orientation_analysis --input cu.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_dementia_confusion_orientation_analysis --input cu.mp4 --output result.json\n```\n\nFile v1.0.6:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-dementia-confusion-orientation-analysis\",\n  \"version\": \"1.0.6\",\n  \"publishedAt\": 1786347757095\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-soothing-action` - 触发联动安抚（智能音箱播放家庭成员介绍 / 时间地点提示 / 照护者 APP 推送）\n\n## 场景代码\n\n- `SMYX_DEMENTIA_CONFUSION_ORIENTATION_ANALYSIS` - 失智老人困惑/迷惘识别与定向安抚\n\n## 输入约束\n\n- 摄像头：失智照护机构（认知症单元 / 公共活动区 / 走廊）或居家失智老人常驻活动区域固定摄像头\n- 帧率 ≥ 10 FPS；分辨率 ≥ 720p；优先正面或 30° 内侧脸（便于眼神/头部姿态识别）\n- 音频可选：采样率 ≥ 16kHz（用于\"这里是哪 / 你是谁 / 现在几点\"等定向问题语音识别 + 声纹绑定）\n- 时段：默认全天 06:00 - 22:00 启用，夜间睡眠时段切换为低敏告警模式\n- 多老人场景按目标跟踪 + 人脸识别 / 声纹绑定到注册老人 ID（每位老人独立基线）\n- 家属或机构必须授权部署，机构场景需公示告知，家属同意书归档\n\n## 关键观测信号\n\n### 视频（核心）\n- `sudden_activity_stop_sec` - 突然停止活动持续时间（动作中断 ≥ 5s）\n- `gaze_drifting_score` - 眼神游离评分（0-100，视线无聚焦 / 漫无目的漂移）\n- `head_scanning_event_count` - 四处张望次数（头部扫描周围环境）\n- `facial_confusion_score` - 面部困惑评分（0-100，眉头紧锁 + 嘴唇微张 + 目光呆滞）\n- `wandering_event_detected` - 游荡事件（无目的来回走动）\n- `agitation_visual_detected` - 激越视觉信号（搓手 / 拉扯衣物 / 反复站起坐下）\n\n### 音频（可选）\n- `orientation_question_count` - 定向问题计数（\"这是哪 / 你是谁 / 现在几点 / 我在哪 / 几点了\"等）\n- `orientation_question_repeat_count` - 5 分钟内重复同一问题次数\n- `voice_anxiety_score` - 语音焦虑评分（0-100，颤抖 / 急促 / 提高音量）\n- `calling_family_event_count` - 呼喊家人姓名次数（\"老伴 / 儿子 / 女儿\"等）\n\n## 场景判定\n\n- `dementia_orientation_none` - 状态平稳\n- `dementia_orientation_mild` - 轻度迷惘（短暂停顿 + 偶发张望）\n- `dementia_orientation_question` - 反复定向问题（5 分钟内同类问题 ≥ 2 次）\n- `dementia_orientation_gaze_drift` - 眼神游离 + 活动中断\n- `dementia_orientation_wandering` - 困惑伴游荡\n- `dementia_orientation_agitation` - 困惑伴激越（焦虑动作 + 高音）\n- `dementia_orientation_strong` - 显著困惑（多项叠加）\n\n## 4 级定向安抚策略递进\n\n- Level 1（mild）：智能音箱低音量播放当前时间地点温和提示（\"今天是 2026 年 5 月 19 日，星期四，您在客厅\"）\n- Level 2（question / gaze_drift）：在 Level 1 基础上播放家庭成员介绍录音（\"您儿子叫李明，他中午会来看您\"）+ 柔和环境光辅助\n- Level 3（wandering / agitation）：在 Level 2 基础上向主照护者 APP 推送提醒\"老人出现困惑/游荡，请协助\"，提示就近工作人员\n- Level 4（strong / 持续不缓解 / 走出安全区）：紧急推送主照护者 + 机构值班护士，并触发本地温和提示音引导老人原地等待\n\n## 单日动作上限\n\n- mild × 12 / moderate × 8 / strong × 4 / Level 4 不设上限\n\n## 红线约束\n\n- 禁止做\"阿尔茨海默病 / 血管性痴呆 / 路易体痴呆\"等医学诊断\n- 禁止长期存储老人隐私音视频（≤ 7 天，仅入库困惑事件片段；机构按伦理审查规范缩短至 ≤ 72 小时）\n- 禁止用于商业广告 / AI 训练；禁第三方共享\n- 禁止冷白光（≥ 4000K）或亮度 > 30 lux 的环境灯（避免黄昏综合征加重）\n- 禁止安抚音量 > 55 dB（老人听力衰退需略高，但不可造成惊吓）\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: prod\n\nFile v1.0.6:skill-card.md\n\n## Description:\n\nAnalyzes fixed-camera and optional microphone footage in dementia care or home settings to identify confusion or disorientation behaviors and produce structured orientation-soothing reports and actions.\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, care facilities, and home-care operators use this skill to analyze submitted video or video URLs for confusion or disorientation signals in people with dementia and receive structured reports, history listings, and orientation-soothing recommendations. It is not a medical diagnostic tool.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill processes highly sensitive video, optional audio, and history queries for people with dementia through cloud services.\n\nMitigation: Use only in controlled care settings with documented consent, visible notice, retention rules, and strict limits on who may submit media URLs or request history.\n\nRisk: Silent account setup and local token storage can weaken identity scoping and access control.\n\nMitigation: Review the account and token storage behavior before deployment, isolate the workspace, restrict filesystem access, and rotate or remove locally stored credentials when access changes.\n\nRisk: Behavior recognition and soothing recommendations could be mistaken for medical diagnosis or relied on without caregiver review.\n\nMitigation: Present outputs as observational support only, require caregiver review before operational use, and escalate recurring or severe confusion events to appropriate local clinical resources.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-dementia-confusion-orientation-analysis)\n- [API interface documentation](references/api_doc.md)\n- [Shared analysis API documentation](skills/smyx_analysis/references/api_doc.md)\n- [Skill demo](https://lifeemergence.com/sample.html)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, json, shell commands, configuration]\n\n**Output Format:** [Markdown and JSON text, with shell command examples]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May include report export links and cloud history listings when the skill is used with analysis or list commands.]\n\n## Skill Version(s):\n\n1.0.6 (source: server release metadata; artifact frontmatter reports 1.0.9)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.6:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.6:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.5: 31 files, 43856 bytes\n\nFiles: references/api_doc.md (4660b), scripts/__init__.py (91b), scripts/config.py (705b), scripts/config.yaml (3b), scripts/skill.py (595b), scripts/smyx_dementia_confusion_orientation_analysis.py (3822b), skill-card.md (2410b), SKILL.md (17411b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (473b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (163b)\n\nFile v1.0.5:SKILL.md\n\n---\nname: \"smyx-dementia-confusion-orientation-analysis\"\ndescription: \"Through fixed cameras (and optional microphones) in dementia care facilities or homes, the system analyzes behaviors of people with dementia to identify confusion/disorientation states: sudden activity stops (interrupting ongoing actions such as eating or walking for ≥ 5 seconds), gaze drifting (eyes wandering without focus), looking around (frequent head turning), and repeated disorientation questions ('Where is this?'. | 通过失智照护机构或家庭固定摄像头（及可选麦克风），分析失智老人的行为，识别困惑/迷惘状态：突然停止活动（中断正在进行的动作，如吃饭、行走 ≥ 5 秒）、眼神游离（视线漫无目的漂移、不聚焦）、四处张望（头部频繁转动）、反复询问'这是哪''现在几点''你是谁'等定向障碍问题（需配合声纹或语音识别）。\"\nversion: \"1.0.9\"\nlicense: \"MIT-0\"\n---\n\n# 🧭 Dementia Confusion / Disorientation Recognition and Orientation Soothing | 失智老人困惑/迷惘识别与定向安抚\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **失智老人困惑/迷惘识别与定向安抚** |\n| 🎯 核心目标 | 通过失智照护机构或家庭固定摄像头（及可选麦克风），分析失智老人的行为，识别困惑/迷惘状态：突然停止活动（中断正在进行的动作，如吃饭、行走 ≥ 5 秒）、眼神游离（视线漫无目的漂移、不聚焦）、四处张望（头部频繁转动）、反复询问'这是哪''现在几点''你是谁'等定向障碍问题（需配合声纹或语音识别）。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_DEMENTIA_CONFUSION_ORIENTATION_ANALYSIS` |\n\nThrough fixed cameras (and optional microphones) in dementia care facilities or homes, the system analyzes behaviors of people with dementia to identify confusion/disorientation states: sudden activity stops (interrupting ongoing actions such as eating or walking for ≥ 5 seconds), gaze drifting (eyes wandering without focus), looking around (frequent head turning), and repeated disorientation questions ('Where is this?', 'What time is it?', 'Who are you?' — requires voice recognition / voiceprint binding). When such behaviors are detected, oriented soothing is automatically triggered: smart speakers play family member introductions (e.g. 'Your son is Li Ming, he will visit you at noon'), current time and location reminders ('Today is May 19 2026, Thursday, you are at Happiness Home Nursing Center'), with a gentle tone. This skill helps reduce anxiety and confusion in people with dementia and improve quality of life. Application scenarios: dementia care facilities, cognitive care units, home care. The system monitors in real time and proactively provides orientation cues when confusion occurs. Skill features: people with dementia often feel lost, anxious, and develop behavioral issues (wandering, agitation) due to memory loss. AI-based real-time confusion recognition with orientation soothing can reduce distress, slow cognitive decline, and ease caregiver burden. This skill can be integrated into smart cameras or nursing home management systems as a practical dementia care tool.\n\n通过失智照护机构或家庭固定摄像头（及可选麦克风），分析失智老人的行为，识别困惑/迷惘状态：突然停止活动（中断正在进行的动作，如吃饭、行走 ≥ 5 秒）、眼神游离（视线漫无目的漂移、不聚焦）、四处张望（头部频繁转动）、反复询问'这是哪''现在几点''你是谁'等定向障碍问题（需配合声纹或语音识别）。当检测到上述行为时，自动触发定向安抚：通过智能音箱播放家庭成员介绍（如'您儿子叫李明，他中午会来看您'）、当前时间地点提示（'今天是 2026 年 5 月 19 日，星期四，您在幸福家园养老院'），并轻声安抚。该技能有助于减轻失智老人的焦虑和困惑，提高生活质量。应用场景：失智照护机构、认知症单元、居家照护。系统实时监测，当老人出现困惑时自动给予定向信息。技能特点：失智老人常因记忆丧失而感到迷茫、焦虑，甚至引发行为问题（如游荡、激越）。通过 AI 实时识别困惑状态并提供定向安抚，有助于减少老人不安，延缓认知功能下降，减轻照护者负担。该技能可集成到智能摄像头或养老机构管理系统中，成为认知症照护的实用工具。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的失智老人照护 AI。你的任务是分析失智照护机构或家庭固定摄像头（及可选麦克风）的实时音视频，检测失智老人的困惑/迷惘行为：突然停止活动（正在进行的动作如吃饭/行走中断 ≥ 5s）、眼神游离（视线无明显焦点 / 头部无目的转动）、四处张望（头部扫描周围环境）、重复询问定向问题（\"这是哪 / 你是谁 / 现在几点 / 我在哪 / 几点了\"等 5 分钟内重复 ≥ 2 次，需语音识别 + 声纹绑定）、伴随激越或游荡。综合评估困惑等级，按 4 级定向安抚策略递进：Level 1 智能音箱当前时间地点温和提示 → Level 2 家庭成员介绍录音 + 柔光辅助 → Level 3 主照护者 APP 提醒 + 就近工作人员 → Level 4 紧急推送 + 机构值班护士 + 本地引导音。3 分钟后效果评估，未平复自动升级。安抚音量 ≤ 55 dB（兼顾老人听力衰退又不可惊吓），严禁 AI 克隆家人声音，禁用\"您不是说过 / 您忘了吗\"等否定矫正语，仅使用家属预录温和语音。不提供任何医疗诊断，仅输出基于音视频的客观行为识别与定向安抚动作。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于失智照护机构（认知症单元 / 公共活动区 / 走廊）或居家失智老人常驻区域固定摄像头（**可选麦克风**）音视频，识别 7 类场景（dementia_orientation_none / mild / question / gaze_drift / wandering / agitation / strong）→ 视频核心 6 项（突然停止活动持续时间 ≥ 5s / 眼神游离评分 / 四处张望次数 / 面部困惑评分 / 游荡事件 / 激越视觉信号）+ 音频可选 4 项（定向问题计数 / 5 min 内重复次数 / 语音焦虑评分 / 呼喊家人姓名）→ 4 档困惑等级（mild / moderate / strong / urgent）→ **4 级定向安抚策略递进**（当前时间地点温和提示 ≤ 55 dB → 家庭成员介绍录音 + 柔光 ≤ 30 lux 暖光 → 主照护者 APP 提醒 + 就近工作人员 → 紧急推送 + 机构值班护士 + 本地引导音）→ 3 分钟效果评估 + 自动升级 → 单日动作上限管控（mild × 12 / moderate × 8 / strong × 4 / Level 4 不设上限）→ 当日定向安抚汇总（晚交班前发送给主照护者）\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 活动中断检测（结合姿态时序） |\n| 2 | 眼神游离评分 |\n| 3 | 头部扫描计数 |\n| 4 | 面部困惑识别（眉头紧锁 + 嘴唇微张 + 目光呆滞） |\n| 5 | 游荡识别 |\n| 6 | 激越视觉信号（搓手 / 拉扯衣物 / 反复站起坐下） |\n| 7 | 定向问题语音识别（\"这里是哪 / 你是谁 / 现在几点\"等） |\n| 8 | 5 分钟窗口重复问题计数 |\n| 9 | 语音焦虑评分 |\n| 10 | 呼喊家人姓名识别 |\n| 11 | 人脸 + 声纹绑定到注册老人 ID |\n| 12 | 年龄段自适应（早期 / 中期 / 晚期失智） |\n| 13 | 夜间低敏告警模式（避免打扰睡眠） |\n| 14 | 智能音箱联动（家属预录介绍 + 时间地点提示） |\n| 15 | 柔光环境联动 |\n| 16 | 照护者 APP 推送 |\n| 17 | 4 级安抚策略递进 + 3 分钟效果评估 + 自动升级 |\n| 18 | 单日动作上限 |\n| 19 | 当日定向安抚汇总报告（晚交班前发送） |\n| 20 | 连续 7 日反复显著困惑 → 提示当地认知症评估门诊 / 老年精神科资源 |\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_dementia_confusion_orientation_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_dementia_confusion_orientation_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 | 🔐 获取 open-id（强制执行） | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行失智老人困惑/迷惘识别与定向安抚 | 调用 `-m scripts.smyx_dementia_confusion_orientation_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_dementia_confusion_orientation_analysis.py`](scripts/smyx_dementia_confusion_orientation_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov + 音轨，最大 10MB；摄像头需对准老人常驻活动区域；麦克风可选但强烈推荐（用于定向问题识别） |\n| 🔎 使用提醒 | **4 级定向安抚策略递进**（mild → moderate → strong → urgent/Level 4），3 分钟未平复自动升级 |\n| 🔎 使用提醒 | 单日动作上限：mild × 12 / moderate × 8 / strong × 4 / Level 4 不设上限（紧急安全优先） |\n| 🔎 使用提醒 | 红线约束 |\n| 🧑‍⚖️ 结果性质 | **禁止**对老人做\"阿尔茨海默病 / 血管性痴呆 / 路易体痴呆 / 额颞叶痴呆\"等医学诊断 |\n| 🔏 隐私合规 | **禁止**长期存储老人隐私音视频（≤ 7 天，仅入库困惑事件片段；机构按伦理审查规范缩短至 ≤ 72 小时） |\n| 🔎 使用提醒 | **禁止**用于商业广告 / AI 训练；禁第三方共享 |\n| 🔎 使用提醒 | **禁止**冷白光（≥ 4000K）或亮度 > 30 lux 的环境灯（避免黄昏综合征加重） |\n| 🔎 使用提醒 | **禁止**安抚音量 > 55 dB（兼顾听力衰退但不可造成惊吓） |\n| 🔎 使用提醒 | **绝对禁止**使用 AI 克隆 / 合成家庭成员声音冒充本人录音；必须使用家属本人提前授权的预录音 |\n| 🔎 使用提醒 | **禁止**使用\"您不是说过 / 您忘了吗 / 又问一遍了\"等否定 / 矫正语；定向安抚语必须温和、当下、具体 |\n| 📁 格式支持 | **禁止**未经公示在机构场景部署；家属需签同意书并支持退出机制 |\n| 🔎 使用提醒 | **必须**：连续 7 日反复显著困惑事件 → 提示**当地认知症评估门诊**或**老年精神科**资源 |\n| 📜 报告输出 | **必须**：当日定向安抚汇总报告**晚交班前发送给主照护者**（避免夜间打扰老人和家属） |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史定向安抚记录清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地失智老人活动区域音视频（以下只是示例，禁止直接使用 作为 open-id）\npython -m scripts.smyx_dementia_confusion_orientation_analysis --input /path/to/care_unit.mp4\n\n# 分析网络失智老人活动区域音视频/实时流（以下只是示例，禁止直接使用 作为 open-id）\npython -m scripts.smyx_dementia_confusion_orientation_analysis --url https://example.com/care_unit.mp4\n\n# 显示历史定向安抚记录清单（自动触发关键词：查看失智老人定向安抚历史报告、定向安抚日志清单等）\npython -m scripts.smyx_dementia_confusion_orientation_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_dementia_confusion_orientation_analysis --input cu.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_dementia_confusion_orientation_analysis --input cu.mp4 --output result.json\n```\n\nFile v1.0.5:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-dementia-confusion-orientation-analysis\",\n  \"version\": \"1.0.5\",\n  \"publishedAt\": 1786009050295\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-soothing-action` - 触发联动安抚（智能音箱播放家庭成员介绍 / 时间地点提示 / 照护者 APP 推送）\n\n## 场景代码\n\n- `SMYX_DEMENTIA_CONFUSION_ORIENTATION_ANALYSIS` - 失智老人困惑/迷惘识别与定向安抚\n\n## 输入约束\n\n- 摄像头：失智照护机构（认知症单元 / 公共活动区 / 走廊）或居家失智老人常驻活动区域固定摄像头\n- 帧率 ≥ 10 FPS；分辨率 ≥ 720p；优先正面或 30° 内侧脸（便于眼神/头部姿态识别）\n- 音频可选：采样率 ≥ 16kHz（用于\"这里是哪 / 你是谁 / 现在几点\"等定向问题语音识别 + 声纹绑定）\n- 时段：默认全天 06:00 - 22:00 启用，夜间睡眠时段切换为低敏告警模式\n- 多老人场景按目标跟踪 + 人脸识别 / 声纹绑定到注册老人 ID（每位老人独立基线）\n- 家属或机构必须授权部署，机构场景需公示告知，家属同意书归档\n\n## 关键观测信号\n\n### 视频（核心）\n- `sudden_activity_stop_sec` - 突然停止活动持续时间（动作中断 ≥ 5s）\n- `gaze_drifting_score` - 眼神游离评分（0-100，视线无聚焦 / 漫无目的漂移）\n- `head_scanning_event_count` - 四处张望次数（头部扫描周围环境）\n- `facial_confusion_score` - 面部困惑评分（0-100，眉头紧锁 + 嘴唇微张 + 目光呆滞）\n- `wandering_event_detected` - 游荡事件（无目的来回走动）\n- `agitation_visual_detected` - 激越视觉信号（搓手 / 拉扯衣物 / 反复站起坐下）\n\n### 音频（可选）\n- `orientation_question_count` - 定向问题计数（\"这是哪 / 你是谁 / 现在几点 / 我在哪 / 几点了\"等）\n- `orientation_question_repeat_count` - 5 分钟内重复同一问题次数\n- `voice_anxiety_score` - 语音焦虑评分（0-100，颤抖 / 急促 / 提高音量）\n- `calling_family_event_count` - 呼喊家人姓名次数（\"老伴 / 儿子 / 女儿\"等）\n\n## 场景判定\n\n- `dementia_orientation_none` - 状态平稳\n- `dementia_orientation_mild` - 轻度迷惘（短暂停顿 + 偶发张望）\n- `dementia_orientation_question` - 反复定向问题（5 分钟内同类问题 ≥ 2 次）\n- `dementia_orientation_gaze_drift` - 眼神游离 + 活动中断\n- `dementia_orientation_wandering` - 困惑伴游荡\n- `dementia_orientation_agitation` - 困惑伴激越（焦虑动作 + 高音）\n- `dementia_orientation_strong` - 显著困惑（多项叠加）\n\n## 4 级定向安抚策略递进\n\n- Level 1（mild）：智能音箱低音量播放当前时间地点温和提示（\"今天是 2026 年 5 月 19 日，星期四，您在客厅\"）\n- Level 2（question / gaze_drift）：在 Level 1 基础上播放家庭成员介绍录音（\"您儿子叫李明，他中午会来看您\"）+ 柔和环境光辅助\n- Level 3（wandering / agitation）：在 Level 2 基础上向主照护者 APP 推送提醒\"老人出现困惑/游荡，请协助\"，提示就近工作人员\n- Level 4（strong / 持续不缓解 / 走出安全区）：紧急推送主照护者 + 机构值班护士，并触发本地温和提示音引导老人原地等待\n\n## 单日动作上限\n\n- mild × 12 / moderate × 8 / strong × 4 / Level 4 不设上限\n\n## 红线约束\n\n- 禁止做\"阿尔茨海默病 / 血管性痴呆 / 路易体痴呆\"等医学诊断\n- 禁止长期存储老人隐私音视频（≤ 7 天，仅入库困惑事件片段；机构按伦理审查规范缩短至 ≤ 72 小时）\n- 禁止用于商业广告 / AI 训练；禁第三方共享\n- 禁止冷白光（≥ 4000K）或亮度 > 30 lux 的环境灯（避免黄昏综合征加重）\n- 禁止安抚音量 > 55 dB（老人听力衰退需略高，但不可造成惊吓）\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\nAnalyzes fixed-camera video and optional audio from dementia-care environments to identify confusion or disorientation signals and produce structured orientation-soothing reports and actions.\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, facility operators, and developers use this skill to analyze dementia-care media or URLs for confusion and disorientation events, generate structured reports, query report history, and coordinate gentle orientation cues.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Dementia-care audio, video, URLs, and report queries may be sent to the publisher's cloud service.\n\nMitigation: Install only in deployments with documented consent, opt-out, retention, and caregiver authorization controls.\n\nRisk: The skill can silently create or reuse a persistent local/default account identity and link future reports to that identity.\n\nMitigation: Review identity handling before deployment and ensure stored tokens and report linkage match the deployment's privacy policy.\n\nRisk: The skill operates in a sensitive care setting where incorrect or overbroad use could affect vulnerable people.\n\nMitigation: Use outputs as behavioral monitoring and orientation-support guidance, with caregiver review and without treating results as a medical diagnosis.\n\n## Reference(s):\n\n- [API Interface Documentation](artifact/references/api_doc.md)\n- [ClawHub Skill Page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-dementia-confusion-orientation-analysis)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Markdown, JSON, Shell commands, Guidance]\n\n**Output Format:** [Markdown text with structured JSON report content and report links]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Can analyze local media paths or URLs, query historical reports, and optionally write results to an output file.]\n\n## Skill Version(s):\n\n1.0.5 (source: server release metadata; artifact frontmatter and changelog mention 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.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, 44087 bytes\n\nFiles: references/api_doc.md (4660b), scripts/__init__.py (91b), scripts/config.py (705b), scripts/config.yaml (3b), scripts/skill.py (595b), scripts/smyx_dementia_confusion_orientation_analysis.py (3822b), skill-card.md (3085b), SKILL.md (17411b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (473b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (163b)\n\nFile v1.0.4:SKILL.md\n\n---\nname: \"smyx-dementia-confusion-orientation-analysis\"\ndescription: \"Through fixed cameras (and optional microphones) in dementia care facilities or homes, the system analyzes behaviors of people with dementia to identify confusion/disorientation states: sudden activity stops (interrupting ongoing actions such as eating or walking for ≥ 5 seconds), gaze drifting (eyes wandering without focus), looking around (frequent head turning), and repeated disorientation questions ('Where is this?'. | 通过失智照护机构或家庭固定摄像头（及可选麦克风），分析失智老人的行为，识别困惑/迷惘状态：突然停止活动（中断正在进行的动作，如吃饭、行走 ≥ 5 秒）、眼神游离（视线漫无目的漂移、不聚焦）、四处张望（头部频繁转动）、反复询问'这是哪''现在几点''你是谁'等定向障碍问题（需配合声纹或语音识别）。\"\nversion: \"1.0.8\"\nlicense: \"MIT-0\"\n---\n\n# 🧭 Dementia Confusion / Disorientation Recognition and Orientation Soothing | 失智老人困惑/迷惘识别与定向安抚\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **失智老人困惑/迷惘识别与定向安抚** |\n| 🎯 核心目标 | 通过失智照护机构或家庭固定摄像头（及可选麦克风），分析失智老人的行为，识别困惑/迷惘状态：突然停止活动（中断正在进行的动作，如吃饭、行走 ≥ 5 秒）、眼神游离（视线漫无目的漂移、不聚焦）、四处张望（头部频繁转动）、反复询问'这是哪''现在几点''你是谁'等定向障碍问题（需配合声纹或语音识别）。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_DEMENTIA_CONFUSION_ORIENTATION_ANALYSIS` |\n\nThrough fixed cameras (and optional microphones) in dementia care facilities or homes, the system analyzes behaviors of people with dementia to identify confusion/disorientation states: sudden activity stops (interrupting ongoing actions such as eating or walking for ≥ 5 seconds), gaze drifting (eyes wandering without focus), looking around (frequent head turning), and repeated disorientation questions ('Where is this?', 'What time is it?', 'Who are you?' — requires voice recognition / voiceprint binding). When such behaviors are detected, oriented soothing is automatically triggered: smart speakers play family member introductions (e.g. 'Your son is Li Ming, he will visit you at noon'), current time and location reminders ('Today is May 19 2026, Thursday, you are at Happiness Home Nursing Center'), with a gentle tone. This skill helps reduce anxiety and confusion in people with dementia and improve quality of life. Application scenarios: dementia care facilities, cognitive care units, home care. The system monitors in real time and proactively provides orientation cues when confusion occurs. Skill features: people with dementia often feel lost, anxious, and develop behavioral issues (wandering, agitation) due to memory loss. AI-based real-time confusion recognition with orientation soothing can reduce distress, slow cognitive decline, and ease caregiver burden. This skill can be integrated into smart cameras or nursing home management systems as a practical dementia care tool.\n\n通过失智照护机构或家庭固定摄像头（及可选麦克风），分析失智老人的行为，识别困惑/迷惘状态：突然停止活动（中断正在进行的动作，如吃饭、行走 ≥ 5 秒）、眼神游离（视线漫无目的漂移、不聚焦）、四处张望（头部频繁转动）、反复询问'这是哪''现在几点''你是谁'等定向障碍问题（需配合声纹或语音识别）。当检测到上述行为时，自动触发定向安抚：通过智能音箱播放家庭成员介绍（如'您儿子叫李明，他中午会来看您'）、当前时间地点提示（'今天是 2026 年 5 月 19 日，星期四，您在幸福家园养老院'），并轻声安抚。该技能有助于减轻失智老人的焦虑和困惑，提高生活质量。应用场景：失智照护机构、认知症单元、居家照护。系统实时监测，当老人出现困惑时自动给予定向信息。技能特点：失智老人常因记忆丧失而感到迷茫、焦虑，甚至引发行为问题（如游荡、激越）。通过 AI 实时识别困惑状态并提供定向安抚，有助于减少老人不安，延缓认知功能下降，减轻照护者负担。该技能可集成到智能摄像头或养老机构管理系统中，成为认知症照护的实用工具。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的失智老人照护 AI。你的任务是分析失智照护机构或家庭固定摄像头（及可选麦克风）的实时音视频，检测失智老人的困惑/迷惘行为：突然停止活动（正在进行的动作如吃饭/行走中断 ≥ 5s）、眼神游离（视线无明显焦点 / 头部无目的转动）、四处张望（头部扫描周围环境）、重复询问定向问题（\"这是哪 / 你是谁 / 现在几点 / 我在哪 / 几点了\"等 5 分钟内重复 ≥ 2 次，需语音识别 + 声纹绑定）、伴随激越或游荡。综合评估困惑等级，按 4 级定向安抚策略递进：Level 1 智能音箱当前时间地点温和提示 → Level 2 家庭成员介绍录音 + 柔光辅助 → Level 3 主照护者 APP 提醒 + 就近工作人员 → Level 4 紧急推送 + 机构值班护士 + 本地引导音。3 分钟后效果评估，未平复自动升级。安抚音量 ≤ 55 dB（兼顾老人听力衰退又不可惊吓），严禁 AI 克隆家人声音，禁用\"您不是说过 / 您忘了吗\"等否定矫正语，仅使用家属预录温和语音。不提供任何医疗诊断，仅输出基于音视频的客观行为识别与定向安抚动作。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于失智照护机构（认知症单元 / 公共活动区 / 走廊）或居家失智老人常驻区域固定摄像头（**可选麦克风**）音视频，识别 7 类场景（dementia_orientation_none / mild / question / gaze_drift / wandering / agitation / strong）→ 视频核心 6 项（突然停止活动持续时间 ≥ 5s / 眼神游离评分 / 四处张望次数 / 面部困惑评分 / 游荡事件 / 激越视觉信号）+ 音频可选 4 项（定向问题计数 / 5 min 内重复次数 / 语音焦虑评分 / 呼喊家人姓名）→ 4 档困惑等级（mild / moderate / strong / urgent）→ **4 级定向安抚策略递进**（当前时间地点温和提示 ≤ 55 dB → 家庭成员介绍录音 + 柔光 ≤ 30 lux 暖光 → 主照护者 APP 提醒 + 就近工作人员 → 紧急推送 + 机构值班护士 + 本地引导音）→ 3 分钟效果评估 + 自动升级 → 单日动作上限管控（mild × 12 / moderate × 8 / strong × 4 / Level 4 不设上限）→ 当日定向安抚汇总（晚交班前发送给主照护者）\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 活动中断检测（结合姿态时序） |\n| 2 | 眼神游离评分 |\n| 3 | 头部扫描计数 |\n| 4 | 面部困惑识别（眉头紧锁 + 嘴唇微张 + 目光呆滞） |\n| 5 | 游荡识别 |\n| 6 | 激越视觉信号（搓手 / 拉扯衣物 / 反复站起坐下） |\n| 7 | 定向问题语音识别（\"这里是哪 / 你是谁 / 现在几点\"等） |\n| 8 | 5 分钟窗口重复问题计数 |\n| 9 | 语音焦虑评分 |\n| 10 | 呼喊家人姓名识别 |\n| 11 | 人脸 + 声纹绑定到注册老人 ID |\n| 12 | 年龄段自适应（早期 / 中期 / 晚期失智） |\n| 13 | 夜间低敏告警模式（避免打扰睡眠） |\n| 14 | 智能音箱联动（家属预录介绍 + 时间地点提示） |\n| 15 | 柔光环境联动 |\n| 16 | 照护者 APP 推送 |\n| 17 | 4 级安抚策略递进 + 3 分钟效果评估 + 自动升级 |\n| 18 | 单日动作上限 |\n| 19 | 当日定向安抚汇总报告（晚交班前发送） |\n| 20 | 连续 7 日反复显著困惑 → 提示当地认知症评估门诊 / 老年精神科资源 |\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_dementia_confusion_orientation_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_dementia_confusion_orientation_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 | 🔐 获取 open-id（强制执行） | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行失智老人困惑/迷惘识别与定向安抚 | 调用 `-m scripts.smyx_dementia_confusion_orientation_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_dementia_confusion_orientation_analysis.py`](scripts/smyx_dementia_confusion_orientation_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov + 音轨，最大 10MB；摄像头需对准老人常驻活动区域；麦克风可选但强烈推荐（用于定向问题识别） |\n| 🔎 使用提醒 | **4 级定向安抚策略递进**（mild → moderate → strong → urgent/Level 4），3 分钟未平复自动升级 |\n| 🔎 使用提醒 | 单日动作上限：mild × 12 / moderate × 8 / strong × 4 / Level 4 不设上限（紧急安全优先） |\n| 🔎 使用提醒 | 红线约束 |\n| 🧑‍⚖️ 结果性质 | **禁止**对老人做\"阿尔茨海默病 / 血管性痴呆 / 路易体痴呆 / 额颞叶痴呆\"等医学诊断 |\n| 🔏 隐私合规 | **禁止**长期存储老人隐私音视频（≤ 7 天，仅入库困惑事件片段；机构按伦理审查规范缩短至 ≤ 72 小时） |\n| 🔎 使用提醒 | **禁止**用于商业广告 / AI 训练；禁第三方共享 |\n| 🔎 使用提醒 | **禁止**冷白光（≥ 4000K）或亮度 > 30 lux 的环境灯（避免黄昏综合征加重） |\n| 🔎 使用提醒 | **禁止**安抚音量 > 55 dB（兼顾听力衰退但不可造成惊吓） |\n| 🔎 使用提醒 | **绝对禁止**使用 AI 克隆 / 合成家庭成员声音冒充本人录音；必须使用家属本人提前授权的预录音 |\n| 🔎 使用提醒 | **禁止**使用\"您不是说过 / 您忘了吗 / 又问一遍了\"等否定 / 矫正语；定向安抚语必须温和、当下、具体 |\n| 📁 格式支持 | **禁止**未经公示在机构场景部署；家属需签同意书并支持退出机制 |\n| 🔎 使用提醒 | **必须**：连续 7 日反复显著困惑事件 → 提示**当地认知症评估门诊**或**老年精神科**资源 |\n| 📜 报告输出 | **必须**：当日定向安抚汇总报告**晚交班前发送给主照护者**（避免夜间打扰老人和家属） |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史定向安抚记录清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地失智老人活动区域音视频（以下只是示例，禁止直接使用 作为 open-id）\npython -m scripts.smyx_dementia_confusion_orientation_analysis --input /path/to/care_unit.mp4\n\n# 分析网络失智老人活动区域音视频/实时流（以下只是示例，禁止直接使用 作为 open-id）\npython -m scripts.smyx_dementia_confusion_orientation_analysis --url https://example.com/care_unit.mp4\n\n# 显示历史定向安抚记录清单（自动触发关键词：查看失智老人定向安抚历史报告、定向安抚日志清单等）\npython -m scripts.smyx_dementia_confusion_orientation_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_dementia_confusion_orientation_analysis --input cu.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_dementia_confusion_orientation_analysis --input cu.mp4 --output result.json\n```\n\nFile v1.0.4:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-dementia-confusion-orientation-analysis\",\n  \"version\": \"1.0.4\",\n  \"publishedAt\": 1785385047880\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-soothing-action` - 触发联动安抚（智能音箱播放家庭成员介绍 / 时间地点提示 / 照护者 APP 推送）\n\n## 场景代码\n\n- `SMYX_DEMENTIA_CONFUSION_ORIENTATION_ANALYSIS` - 失智老人困惑/迷惘识别与定向安抚\n\n## 输入约束\n\n- 摄像头：失智照护机构（认知症单元 / 公共活动区 / 走廊）或居家失智老人常驻活动区域固定摄像头\n- 帧率 ≥ 10 FPS；分辨率 ≥ 720p；优先正面或 30° 内侧脸（便于眼神/头部姿态识别）\n- 音频可选：采样率 ≥ 16kHz（用于\"这里是哪 / 你是谁 / 现在几点\"等定向问题语音识别 + 声纹绑定）\n- 时段：默认全天 06:00 - 22:00 启用，夜间睡眠时段切换为低敏告警模式\n- 多老人场景按目标跟踪 + 人脸识别 / 声纹绑定到注册老人 ID（每位老人独立基线）\n- 家属或机构必须授权部署，机构场景需公示告知，家属同意书归档\n\n## 关键观测信号\n\n### 视频（核心）\n- `sudden_activity_stop_sec` - 突然停止活动持续时间（动作中断 ≥ 5s）\n- `gaze_drifting_score` - 眼神游离评分（0-100，视线无聚焦 / 漫无目的漂移）\n- `head_scanning_event_count` - 四处张望次数（头部扫描周围环境）\n- `facial_confusion_score` - 面部困惑评分（0-100，眉头紧锁 + 嘴唇微张 + 目光呆滞）\n- `wandering_event_detected` - 游荡事件（无目的来回走动）\n- `agitation_visual_detected` - 激越视觉信号（搓手 / 拉扯衣物 / 反复站起坐下）\n\n### 音频（可选）\n- `orientation_question_count` - 定向问题计数（\"这是哪 / 你是谁 / 现在几点 / 我在哪 / 几点了\"等）\n- `orientation_question_repeat_count` - 5 分钟内重复同一问题次数\n- `voice_anxiety_score` - 语音焦虑评分（0-100，颤抖 / 急促 / 提高音量）\n- `calling_family_event_count` - 呼喊家人姓名次数（\"老伴 / 儿子 / 女儿\"等）\n\n## 场景判定\n\n- `dementia_orientation_none` - 状态平稳\n- `dementia_orientation_mild` - 轻度迷惘（短暂停顿 + 偶发张望）\n- `dementia_orientation_question` - 反复定向问题（5 分钟内同类问题 ≥ 2 次）\n- `dementia_orientation_gaze_drift` - 眼神游离 + 活动中断\n- `dementia_orientation_wandering` - 困惑伴游荡\n- `dementia_orientation_agitation` - 困惑伴激越（焦虑动作 + 高音）\n- `dementia_orientation_strong` - 显著困惑（多项叠加）\n\n## 4 级定向安抚策略递进\n\n- Level 1（mild）：智能音箱低音量播放当前时间地点温和提示（\"今天是 2026 年 5 月 19 日，星期四，您在客厅\"）\n- Level 2（question / gaze_drift）：在 Level 1 基础上播放家庭成员介绍录音（\"您儿子叫李明，他中午会来看您\"）+ 柔和环境光辅助\n- Level 3（wandering / agitation）：在 Level 2 基础上向主照护者 APP 推送提醒\"老人出现困惑/游荡，请协助\"，提示就近工作人员\n- Level 4（strong / 持续不缓解 / 走出安全区）：紧急推送主照护者 + 机构值班护士，并触发本地温和提示音引导老人原地等待\n\n## 单日动作上限\n\n- mild × 12 / moderate × 8 / strong × 4 / Level 4 不设上限\n\n## 红线约束\n\n- 禁止做\"阿尔茨海默病 / 血管性痴呆 / 路易体痴呆\"等医学诊断\n- 禁止长期存储老人隐私音视频（≤ 7 天，仅入库困惑事件片段；机构按伦理审查规范缩短至 ≤ 72 小时）\n- 禁止用于商业广告 / AI 训练；禁第三方共享\n- 禁止冷白光（≥ 4000K）或亮度 > 30 lux 的环境灯（避免黄昏综合征加重）\n- 禁止安抚音量 > 55 dB（老人听力衰退需略高，但不可造成惊吓）\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: <br>\nAnalyzes fixed-camera and optional microphone inputs from dementia care settings or homes to identify confusion and disorientation signals, produce structured reports, and guide orientation-soothing follow-up. <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>\nCare teams, operators, and agent workflows use this skill to submit dementia-care audio/video or URLs for cloud analysis, receive structured confusion/disorientation findings, and review history reports. It is intended to support caregiver review and orientation workflows, not to provide medical diagnosis. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Sensitive dementia-care audio/video and identity data may be sent to Lifeemergence cloud services. <br>\nMitigation: Use only with documented consent from the person, family, or care setting; review cloud processing, retention, access controls, and local legal requirements before deployment. <br>\nRisk: The release overstates automatic soothing and escalation behavior compared with the inspected code. <br>\nMitigation: Validate speaker, lighting, caregiver-app, and emergency integrations separately before relying on automated intervention. <br>\nRisk: Persistent local account tokens and default user identity handling can expose care records if the workspace is shared or poorly protected. <br>\nMitigation: Run in a controlled workspace, restrict access to local data files, and rotate or revoke tokens when moving or decommissioning an installation. <br>\nRisk: Behavior recognition results may be incomplete or misleading for clinical decisions. <br>\nMitigation: Treat outputs as caregiver-support information only, require human review, and do not use the skill to diagnose dementia or related medical conditions. <br>\n\n\n## Reference(s): <br>\n- [Skill API Documentation](references/api_doc.md) <br>\n- [Shared Analysis API Documentation](skills/smyx_analysis/references/api_doc.md) <br>\n- [ClawHub Skill Page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-dementia-confusion-orientation-analysis) <br>\n- [Skill Demo](https://lifeemergence.com/sample.html) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance] <br>\n**Output Format:** [Markdown or JSON text with structured findings, recommendations, history tables, and report links] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May save analysis output to a local file when an output path is provided.] <br>\n\n## Skill Version(s): <br>\n1.0.4 (source: server release metadata; artifact frontmatter reports 1.0.8) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v1.0.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, 44047 bytes\n\nFiles: references/api_doc.md (4660b), scripts/__init__.py (91b), scripts/config.py (705b), scripts/config.yaml (3b), scripts/skill.py (595b), scripts/smyx_dementia_confusion_orientation_analysis.py (3822b), skill-card.md (3005b), SKILL.md (17411b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (473b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (163b)\n\nFile v1.0.3:SKILL.md\n\n---\nname: \"smyx-dementia-confusion-orientation-analysis\"\ndescription: \"Through fixed cameras (and optional microphones) in dementia care facilities or homes, the system analyzes behaviors of people with dementia to identify confusion/disorientation states: sudden activity stops (interrupting ongoing actions such as eating or walking for ≥ 5 seconds), gaze drifting (eyes wandering without focus), looking around (frequent head turning), and repeated disorientation questions ('Where is this?'. | 通过失智照护机构或家庭固定摄像头（及可选麦克风），分析失智老人的行为，识别困惑/迷惘状态：突然停止活动（中断正在进行的动作，如吃饭、行走 ≥ 5 秒）、眼神游离（视线漫无目的漂移、不聚焦）、四处张望（头部频繁转动）、反复询问'这是哪''现在几点''你是谁'等定向障碍问题（需配合声纹或语音识别）。\"\nversion: \"1.0.6\"\nlicense: \"MIT-0\"\n---\n\n# 🧭 Dementia Confusion / Disorientation Recognition and Orientation Soothing | 失智老人困惑/迷惘识别与定向安抚\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **失智老人困惑/迷惘识别与定向安抚** |\n| 🎯 核心目标 | 通过失智照护机构或家庭固定摄像头（及可选麦克风），分析失智老人的行为，识别困惑/迷惘状态：突然停止活动（中断正在进行的动作，如吃饭、行走 ≥ 5 秒）、眼神游离（视线漫无目的漂移、不聚焦）、四处张望（头部频繁转动）、反复询问'这是哪''现在几点''你是谁'等定向障碍问题（需配合声纹或语音识别）。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_DEMENTIA_CONFUSION_ORIENTATION_ANALYSIS` |\n\nThrough fixed cameras (and optional microphones) in dementia care facilities or homes, the system analyzes behaviors of people with dementia to identify confusion/disorientation states: sudden activity stops (interrupting ongoing actions such as eating or walking for ≥ 5 seconds), gaze drifting (eyes wandering without focus), looking around (frequent head turning), and repeated disorientation questions ('Where is this?', 'What time is it?', 'Who are you?' — requires voice recognition / voiceprint binding). When such behaviors are detected, oriented soothing is automatically triggered: smart speakers play family member introductions (e.g. 'Your son is Li Ming, he will visit you at noon'), current time and location reminders ('Today is May 19 2026, Thursday, you are at Happiness Home Nursing Center'), with a gentle tone. This skill helps reduce anxiety and confusion in people with dementia and improve quality of life. Application scenarios: dementia care facilities, cognitive care units, home care. The system monitors in real time and proactively provides orientation cues when confusion occurs. Skill features: people with dementia often feel lost, anxious, and develop behavioral issues (wandering, agitation) due to memory loss. AI-based real-time confusion recognition with orientation soothing can reduce distress, slow cognitive decline, and ease caregiver burden. This skill can be integrated into smart cameras or nursing home management systems as a practical dementia care tool.\n\n通过失智照护机构或家庭固定摄像头（及可选麦克风），分析失智老人的行为，识别困惑/迷惘状态：突然停止活动（中断正在进行的动作，如吃饭、行走 ≥ 5 秒）、眼神游离（视线漫无目的漂移、不聚焦）、四处张望（头部频繁转动）、反复询问'这是哪''现在几点''你是谁'等定向障碍问题（需配合声纹或语音识别）。当检测到上述行为时，自动触发定向安抚：通过智能音箱播放家庭成员介绍（如'您儿子叫李明，他中午会来看您'）、当前时间地点提示（'今天是 2026 年 5 月 19 日，星期四，您在幸福家园养老院'），并轻声安抚。该技能有助于减轻失智老人的焦虑和困惑，提高生活质量。应用场景：失智照护机构、认知症单元、居家照护。系统实时监测，当老人出现困惑时自动给予定向信息。技能特点：失智老人常因记忆丧失而感到迷茫、焦虑，甚至引发行为问题（如游荡、激越）。通过 AI 实时识别困惑状态并提供定向安抚，有助于减少老人不安，延缓认知功能下降，减轻照护者负担。该技能可集成到智能摄像头或养老机构管理系统中，成为认知症照护的实用工具。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的失智老人照护 AI。你的任务是分析失智照护机构或家庭固定摄像头（及可选麦克风）的实时音视频，检测失智老人的困惑/迷惘行为：突然停止活动（正在进行的动作如吃饭/行走中断 ≥ 5s）、眼神游离（视线无明显焦点 / 头部无目的转动）、四处张望（头部扫描周围环境）、重复询问定向问题（\"这是哪 / 你是谁 / 现在几点 / 我在哪 / 几点了\"等 5 分钟内重复 ≥ 2 次，需语音识别 + 声纹绑定）、伴随激越或游荡。综合评估困惑等级，按 4 级定向安抚策略递进：Level 1 智能音箱当前时间地点温和提示 → Level 2 家庭成员介绍录音 + 柔光辅助 → Level 3 主照护者 APP 提醒 + 就近工作人员 → Level 4 紧急推送 + 机构值班护士 + 本地引导音。3 分钟后效果评估，未平复自动升级。安抚音量 ≤ 55 dB（兼顾老人听力衰退又不可惊吓），严禁 AI 克隆家人声音，禁用\"您不是说过 / 您忘了吗\"等否定矫正语，仅使用家属预录温和语音。不提供任何医疗诊断，仅输出基于音视频的客观行为识别与定向安抚动作。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于失智照护机构（认知症单元 / 公共活动区 / 走廊）或居家失智老人常驻区域固定摄像头（**可选麦克风**）音视频，识别 7 类场景（dementia_orientation_none / mild / question / gaze_drift / wandering / agitation / strong）→ 视频核心 6 项（突然停止活动持续时间 ≥ 5s / 眼神游离评分 / 四处张望次数 / 面部困惑评分 / 游荡事件 / 激越视觉信号）+ 音频可选 4 项（定向问题计数 / 5 min 内重复次数 / 语音焦虑评分 / 呼喊家人姓名）→ 4 档困惑等级（mild / moderate / strong / urgent）→ **4 级定向安抚策略递进**（当前时间地点温和提示 ≤ 55 dB → 家庭成员介绍录音 + 柔光 ≤ 30 lux 暖光 → 主照护者 APP 提醒 + 就近工作人员 → 紧急推送 + 机构值班护士 + 本地引导音）→ 3 分钟效果评估 + 自动升级 → 单日动作上限管控（mild × 12 / moderate × 8 / strong × 4 / Level 4 不设上限）→ 当日定向安抚汇总（晚交班前发送给主照护者）\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 活动中断检测（结合姿态时序） |\n| 2 | 眼神游离评分 |\n| 3 | 头部扫描计数 |\n| 4 | 面部困惑识别（眉头紧锁 + 嘴唇微张 + 目光呆滞） |\n| 5 | 游荡识别 |\n| 6 | 激越视觉信号（搓手 / 拉扯衣物 / 反复站起坐下） |\n| 7 | 定向问题语音识别（\"这里是哪 / 你是谁 / 现在几点\"等） |\n| 8 | 5 分钟窗口重复问题计数 |\n| 9 | 语音焦虑评分 |\n| 10 | 呼喊家人姓名识别 |\n| 11 | 人脸 + 声纹绑定到注册老人 ID |\n| 12 | 年龄段自适应（早期 / 中期 / 晚期失智） |\n| 13 | 夜间低敏告警模式（避免打扰睡眠） |\n| 14 | 智能音箱联动（家属预录介绍 + 时间地点提示） |\n| 15 | 柔光环境联动 |\n| 16 | 照护者 APP 推送 |\n| 17 | 4 级安抚策略递进 + 3 分钟效果评估 + 自动升级 |\n| 18 | 单日动作上限 |\n| 19 | 当日定向安抚汇总报告（晚交班前发送） |\n| 20 | 连续 7 日反复显著困惑 → 提示当地认知症评估门诊 / 老年精神科资源 |\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_dementia_confusion_orientation_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_dementia_confusion_orientation_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 | 🔐 获取 open-id（强制执行） | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行失智老人困惑/迷惘识别与定向安抚 | 调用 `-m scripts.smyx_dementia_confusion_orientation_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_dementia_confusion_orientation_analysis.py`](scripts/smyx_dementia_confusion_orientation_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov + 音轨，最大 10MB；摄像头需对准老人常驻活动区域；麦克风可选但强烈推荐（用于定向问题识别） |\n| 🔎 使用提醒 | **4 级定向安抚策略递进**（mild → moderate → strong → urgent/Level 4），3 分钟未平复自动升级 |\n| 🔎 使用提醒 | 单日动作上限：mild × 12 / moderate × 8 / strong × 4 / Level 4 不设上限（紧急安全优先） |\n| 🔎 使用提醒 | 红线约束 |\n| 🧑‍⚖️ 结果性质 | **禁止**对老人做\"阿尔茨海默病 / 血管性痴呆 / 路易体痴呆 / 额颞叶痴呆\"等医学诊断 |\n| 🔏 隐私合规 | **禁止**长期存储老人隐私音视频（≤ 7 天，仅入库困惑事件片段；机构按伦理审查规范缩短至 ≤ 72 小时） |\n| 🔎 使用提醒 | **禁止**用于商业广告 / AI 训练；禁第三方共享 |\n| 🔎 使用提醒 | **禁止**冷白光（≥ 4000K）或亮度 > 30 lux 的环境灯（避免黄昏综合征加重） |\n| 🔎 使用提醒 | **禁止**安抚音量 > 55 dB（兼顾听力衰退但不可造成惊吓） |\n| 🔎 使用提醒 | **绝对禁止**使用 AI 克隆 / 合成家庭成员声音冒充本人录音；必须使用家属本人提前授权的预录音 |\n| 🔎 使用提醒 | **禁止**使用\"您不是说过 / 您忘了吗 / 又问一遍了\"等否定 / 矫正语；定向安抚语必须温和、当下、具体 |\n| 📁 格式支持 | **禁止**未经公示在机构场景部署；家属需签同意书并支持退出机制 |\n| 🔎 使用提醒 | **必须**：连续 7 日反复显著困惑事件 → 提示**当地认知症评估门诊**或**老年精神科**资源 |\n| 📜 报告输出 | **必须**：当日定向安抚汇总报告**晚交班前发送给主照护者**（避免夜间打扰老人和家属） |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史定向安抚记录清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地失智老人活动区域音视频（以下只是示例，禁止直接使用 作为 open-id）\npython -m scripts.smyx_dementia_confusion_orientation_analysis --input /path/to/care_unit.mp4\n\n# 分析网络失智老人活动区域音视频/实时流（以下只是示例，禁止直接使用 作为 open-id）\npython -m scripts.smyx_dementia_confusion_orientation_analysis --url https://example.com/care_unit.mp4\n\n# 显示历史定向安抚记录清单（自动触发关键词：查看失智老人定向安抚历史报告、定向安抚日志清单等）\npython -m scripts.smyx_dementia_confusion_orientation_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_dementia_confusion_orientation_analysis --input cu.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_dementia_confusion_orientation_analysis --input cu.mp4 --output result.json\n```\n\nFile v1.0.3:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-dementia-confusion-orientation-analysis\",\n  \"version\": \"1.0.3\",\n  \"publishedAt\": 1784219676788\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-soothing-action` - 触发联动安抚（智能音箱播放家庭成员介绍 / 时间地点提示 / 照护者 APP 推送）\n\n## 场景代码\n\n- `SMYX_DEMENTIA_CONFUSION_ORIENTATION_ANALYSIS` - 失智老人困惑/迷惘识别与定向安抚\n\n## 输入约束\n\n- 摄像头：失智照护机构（认知症单元 / 公共活动区 / 走廊）或居家失智老人常驻活动区域固定摄像头\n- 帧率 ≥ 10 FPS；分辨率 ≥ 720p；优先正面或 30° 内侧脸（便于眼神/头部姿态识别）\n- 音频可选：采样率 ≥ 16kHz（用于\"这里是哪 / 你是谁 / 现在几点\"等定向问题语音识别 + 声纹绑定）\n- 时段：默认全天 06:00 - 22:00 启用，夜间睡眠时段切换为低敏告警模式\n- 多老人场景按目标跟踪 + 人脸识别 / 声纹绑定到注册老人 ID（每位老人独立基线）\n- 家属或机构必须授权部署，机构场景需公示告知，家属同意书归档\n\n## 关键观测信号\n\n### 视频（核心）\n- `sudden_activity_stop_sec` - 突然停止活动持续时间（动作中断 ≥ 5s）\n- `gaze_drifting_score` - 眼神游离评分（0-100，视线无聚焦 / 漫无目的漂移）\n- `head_scanning_event_count` - 四处张望次数（头部扫描周围环境）\n- `facial_confusion_score` - 面部困惑评分（0-100，眉头紧锁 + 嘴唇微张 + 目光呆滞）\n- `wandering_event_detected` - 游荡事件（无目的来回走动）\n- `agitation_visual_detected` - 激越视觉信号（搓手 / 拉扯衣物 / 反复站起坐下）\n\n### 音频（可选）\n- `orientation_question_count` - 定向问题计数（\"这是哪 / 你是谁 / 现在几点 / 我在哪 / 几点了\"等）\n- `orientation_question_repeat_count` - 5 分钟内重复同一问题次数\n- `voice_anxiety_score` - 语音焦虑评分（0-100，颤抖 / 急促 / 提高音量）\n- `calling_family_event_count` - 呼喊家人姓名次数（\"老伴 / 儿子 / 女儿\"等）\n\n## 场景判定\n\n- `dementia_orientation_none` - 状态平稳\n- `dementia_orientation_mild` - 轻度迷惘（短暂停顿 + 偶发张望）\n- `dementia_orientation_question` - 反复定向问题（5 分钟内同类问题 ≥ 2 次）\n- `dementia_orientation_gaze_drift` - 眼神游离 + 活动中断\n- `dementia_orientation_wandering` - 困惑伴游荡\n- `dementia_orientation_agitation` - 困惑伴激越（焦虑动作 + 高音）\n- `dementia_orientation_strong` - 显著困惑（多项叠加）\n\n## 4 级定向安抚策略递进\n\n- Level 1（mild）：智能音箱低音量播放当前时间地点温和提示（\"今天是 2026 年 5 月 19 日，星期四，您在客厅\"）\n- Level 2（question / gaze_drift）：在 Level 1 基础上播放家庭成员介绍录音（\"您儿子叫李明，他中午会来看您\"）+ 柔和环境光辅助\n- Level 3（wandering / agitation）：在 Level 2 基础上向主照护者 APP 推送提醒\"老人出现困惑/游荡，请协助\"，提示就近工作人员\n- Level 4（strong / 持续不缓解 / 走出安全区）：紧急推送主照护者 + 机构值班护士，并触发本地温和提示音引导老人原地等待\n\n## 单日动作上限\n\n- mild × 12 / moderate × 8 / strong × 4 / Level 4 不设上限\n\n## 红线约束\n\n- 禁止做\"阿尔茨海默病 / 血管性痴呆 / 路易体痴呆\"等医学诊断\n- 禁止长期存储老人隐私音视频（≤ 7 天，仅入库困惑事件片段；机构按伦理审查规范缩短至 ≤ 72 小时）\n- 禁止用于商业广告 / AI 训练；禁第三方共享\n- 禁止冷白光（≥ 4000K）或亮度 > 30 lux 的环境灯（避免黄昏综合征加重）\n- 禁止安抚音量 > 55 dB（老人听力衰退需略高，但不可造成惊吓）\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>\nAnalyzes fixed-camera video, with optional microphone input, from dementia care settings or homes to identify confusion and disorientation behaviors and produce orientation-soothing guidance and reports. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[smyx-sunjinhui](https://clawhub.ai/user/smyx-sunjinhui) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nExternal caregivers, care-facility operators, and care-system developers use this skill to analyze dementia-care video or audio-video inputs, detect confusion or disorientation indicators, retrieve historical reports, and generate structured monitoring results with orientation-soothing recommendations. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill handles sensitive dementia-care video and optional audio through remote services. <br>\nMitigation: Deploy only in authorized care settings with resident or family consent, clear camera and microphone notices, retention controls, and confirmed endpoint governance. <br>\nRisk: The skill can create or reuse identity state and store tokens locally. <br>\nMitigation: Confirm token storage, identity mapping, access controls, and deletion procedures before production use. <br>\nRisk: Confusion recognition and soothing outputs could be mistaken for clinical diagnosis or medical advice. <br>\nMitigation: Use outputs as behavioral observations and care workflow support only; route repeated or severe events to qualified care or clinical resources. <br>\nRisk: Automated soothing can distress residents if voices, lighting, or volume are inappropriate. <br>\nMitigation: Use only authorized prerecorded family audio, keep volume and lighting within documented limits, and review escalation behavior with caregivers. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-dementia-confusion-orientation-analysis) <br>\n- [Publisher profile](https://clawhub.ai/user/smyx-sunjinhui) <br>\n- [Skill demo](https://lifeemergence.com/sample.html) <br>\n- [API interface documentation](artifact/references/api_doc.md) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Analysis, Markdown, JSON, Shell commands, Guidance] <br>\n**Output Format:** [Markdown summaries and structured JSON returned from remote analysis and history-report APIs] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May include report links, structured detection fields, orientation-soothing actions, and historical report lists.] <br>\n\n## Skill Version(s): <br>\n1.0.3 (source: server release metadata; artifact SKILL.md frontmatter states 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, 43841 bytes\n\nFiles: references/api_doc.md (4660b), scripts/__init__.py (91b), scripts/config.py (705b), scripts/config.yaml (3b), scripts/skill.py (595b), scripts/smyx_dementia_confusion_orientation_analysis.py (3822b), skill-card.md (2522b), SKILL.md (17411b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (473b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (163b)\n\nFile v1.0.2:SKILL.md\n\n---\nname: \"smyx-dementia-confusion-orientation-analysis\"\ndescription: \"Through fixed cameras (and optional microphones) in dementia care facilities or homes, the system analyzes behaviors of people with dementia to identify confusion/disorientation states: sudden activity stops (interrupting ongoing actions such as eating or walking for ≥ 5 seconds), gaze drifting (eyes wandering without focus), looking around (frequent head turning), and repeated disorientation questions ('Where is this?'. | 通过失智照护机构或家庭固定摄像头（及可选麦克风），分析失智老人的行为，识别困惑/迷惘状态：突然停止活动（中断正在进行的动作，如吃饭、行走 ≥ 5 秒）、眼神游离（视线漫无目的漂移、不聚焦）、四处张望（头部频繁转动）、反复询问'这是哪''现在几点''你是谁'等定向障碍问题（需配合声纹或语音识别）。\"\nversion: \"1.0.5\"\nlicense: \"MIT-0\"\n---\n\n# 🧭 Dementia Confusion / Disorientation Recognition and Orientation Soothing | 失智老人困惑/迷惘识别与定向安抚\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **失智老人困惑/迷惘识别与定向安抚** |\n| 🎯 核心目标 | 通过失智照护机构或家庭固定摄像头（及可选麦克风），分析失智老人的行为，识别困惑/迷惘状态：突然停止活动（中断正在进行的动作，如吃饭、行走 ≥ 5 秒）、眼神游离（视线漫无目的漂移、不聚焦）、四处张望（头部频繁转动）、反复询问'这是哪''现在几点''你是谁'等定向障碍问题（需配合声纹或语音识别）。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_DEMENTIA_CONFUSION_ORIENTATION_ANALYSIS` |\n\nThrough fixed cameras (and optional microphones) in dementia care facilities or homes, the system analyzes behaviors of people with dementia to identify confusion/disorientation states: sudden activity stops (interrupting ongoing actions such as eating or walking for ≥ 5 seconds), gaze drifting (eyes wandering without focus), looking around (frequent head turning), and repeated disorientation questions ('Where is this?', 'What time is it?', 'Who are you?' — requires voice recognition / voiceprint binding). When such behaviors are detected, oriented soothing is automatically triggered: smart speakers play family member introductions (e.g. 'Your son is Li Ming, he will visit you at noon'), current time and location reminders ('Today is May 19 2026, Thursday, you are at Happiness Home Nursing Center'), with a gentle tone. This skill helps reduce anxiety and confusion in people with dementia and improve quality of life. Application scenarios: dementia care facilities, cognitive care units, home care. The system monitors in real time and proactively provides orientation cues when confusion occurs. Skill features: people with dementia often feel lost, anxious, and develop behavioral issues (wandering, agitation) due to memory loss. AI-based real-time confusion recognition with orientation soothing can reduce distress, slow cognitive decline, and ease caregiver burden. This skill can be integrated into smart cameras or nursing home management systems as a practical dementia care tool.\n\n通过失智照护机构或家庭固定摄像头（及可选麦克风），分析失智老人的行为，识别困惑/迷惘状态：突然停止活动（中断正在进行的动作，如吃饭、行走 ≥ 5 秒）、眼神游离（视线漫无目的漂移、不聚焦）、四处张望（头部频繁转动）、反复询问'这是哪''现在几点''你是谁'等定向障碍问题（需配合声纹或语音识别）。当检测到上述行为时，自动触发定向安抚：通过智能音箱播放家庭成员介绍（如'您儿子叫李明，他中午会来看您'）、当前时间地点提示（'今天是 2026 年 5 月 19 日，星期四，您在幸福家园养老院'），并轻声安抚。该技能有助于减轻失智老人的焦虑和困惑，提高生活质量。应用场景：失智照护机构、认知症单元、居家照护。系统实时监测，当老人出现困惑时自动给予定向信息。技能特点：失智老人常因记忆丧失而感到迷茫、焦虑，甚至引发行为问题（如游荡、激越）。通过 AI 实时识别困惑状态并提供定向安抚，有助于减少老人不安，延缓认知功能下降，减轻照护者负担。该技能可集成到智能摄像头或养老机构管理系统中，成为认知症照护的实用工具。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的失智老人照护 AI。你的任务是分析失智照护机构或家庭固定摄像头（及可选麦克风）的实时音视频，检测失智老人的困惑/迷惘行为：突然停止活动（正在进行的动作如吃饭/行走中断 ≥ 5s）、眼神游离（视线无明显焦点 / 头部无目的转动）、四处张望（头部扫描周围环境）、重复询问定向问题（\"这是哪 / 你是谁 / 现在几点 / 我在哪 / 几点了\"等 5 分钟内重复 ≥ 2 次，需语音识别 + 声纹绑定）、伴随激越或游荡。综合评估困惑等级，按 4 级定向安抚策略递进：Level 1 智能音箱当前时间地点温和提示 → Level 2 家庭成员介绍录音 + 柔光辅助 → Level 3 主照护者 APP 提醒 + 就近工作人员 → Level 4 紧急推送 + 机构值班护士 + 本地引导音。3 分钟后效果评估，未平复自动升级。安抚音量 ≤ 55 dB（兼顾老人听力衰退又不可惊吓），严禁 AI 克隆家人声音，禁用\"您不是说过 / 您忘了吗\"等否定矫正语，仅使用家属预录温和语音。不提供任何医疗诊断，仅输出基于音视频的客观行为识别与定向安抚动作。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于失智照护机构（认知症单元 / 公共活动区 / 走廊）或居家失智老人常驻区域固定摄像头（**可选麦克风**）音视频，识别 7 类场景（dementia_orientation_none / mild / question / gaze_drift / wandering / agitation / strong）→ 视频核心 6 项（突然停止活动持续时间 ≥ 5s / 眼神游离评分 / 四处张望次数 / 面部困惑评分 / 游荡事件 / 激越视觉信号）+ 音频可选 4 项（定向问题计数 / 5 min 内重复次数 / 语音焦虑评分 / 呼喊家人姓名）→ 4 档困惑等级（mild / moderate / strong / urgent）→ **4 级定向安抚策略递进**（当前时间地点温和提示 ≤ 55 dB → 家庭成员介绍录音 + 柔光 ≤ 30 lux 暖光 → 主照护者 APP 提醒 + 就近工作人员 → 紧急推送 + 机构值班护士 + 本地引导音）→ 3 分钟效果评估 + 自动升级 → 单日动作上限管控（mild × 12 / moderate × 8 / strong × 4 / Level 4 不设上限）→ 当日定向安抚汇总（晚交班前发送给主照护者）\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 活动中断检测（结合姿态时序） |\n| 2 | 眼神游离评分 |\n| 3 | 头部扫描计数 |\n| 4 | 面部困惑识别（眉头紧锁 + 嘴唇微张 + 目光呆滞） |\n| 5 | 游荡识别 |\n| 6 | 激越视觉信号（搓手 / 拉扯衣物 / 反复站起坐下） |\n| 7 | 定向问题语音识别（\"这里是哪 / 你是谁 / 现在几点\"等） |\n| 8 | 5 分钟窗口重复问题计数 |\n| 9 | 语音焦虑评分 |\n| 10 | 呼喊家人姓名识别 |\n| 11 | 人脸 + 声纹绑定到注册老人 ID |\n| 12 | 年龄段自适应（早期 / 中期 / 晚期失智） |\n| 13 | 夜间低敏告警模式（避免打扰睡眠） |\n| 14 | 智能音箱联动（家属预录介绍 + 时间地点提示） |\n| 15 | 柔光环境联动 |\n| 16 | 照护者 APP 推送 |\n| 17 | 4 级安抚策略递进 + 3 分钟效果评估 + 自动升级 |\n| 18 | 单日动作上限 |\n| 19 | 当日定向安抚汇总报告（晚交班前发送） |\n| 20 | 连续 7 日反复显著困惑 → 提示当地认知症评估门诊 / 老年精神科资源 |\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_dementia_confusion_orientation_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_dementia_confusion_orientation_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 | 🔐 获取 open-id（强制执行） | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行失智老人困惑/迷惘识别与定向安抚 | 调用 `-m scripts.smyx_dementia_confusion_orientation_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_dementia_confusion_orientation_analysis.py`](scripts/smyx_dementia_confusion_orientation_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov + 音轨，最大 10MB；摄像头需对准老人常驻活动区域；麦克风可选但强烈推荐（用于定向问题识别） |\n| 🔎 使用提醒 | **4 级定向安抚策略递进**（mild → moderate → strong → urgent/Level 4），3 分钟未平复自动升级 |\n| 🔎 使用提醒 | 单日动作上限：mild × 12 / moderate × 8 / strong × 4 / Level 4 不设上限（紧急安全优先） |\n| 🔎 使用提醒 | 红线约束 |\n| 🧑‍⚖️ 结果性质 | **禁止**对老人做\"阿尔茨海默病 / 血管性痴呆 / 路易体痴呆 / 额颞叶痴呆\"等医学诊断 |\n| 🔏 隐私合规 | **禁止**长期存储老人隐私音视频（≤ 7 天，仅入库困惑事件片段；机构按伦理审查规范缩短至 ≤ 72 小时） |\n| 🔎 使用提醒 | **禁止**用于商业广告 / AI 训练；禁第三方共享 |\n| 🔎 使用提醒 | **禁止**冷白光（≥ 4000K）或亮度 > 30 lux 的环境灯（避免黄昏综合征加重） |\n| 🔎 使用提醒 | **禁止**安抚音量 > 55 dB（兼顾听力衰退但不可造成惊吓） |\n| 🔎 使用提醒 | **绝对禁止**使用 AI 克隆 / 合成家庭成员声音冒充本人录音；必须使用家属本人提前授权的预录音 |\n| 🔎 使用提醒 | **禁止**使用\"您不是说过 / 您忘了吗 / 又问一遍了\"等否定 / 矫正语；定向安抚语必须温和、当下、具体 |\n| 📁 格式支持 | **禁止**未经公示在机构场景部署；家属需签同意书并支持退出机制 |\n| 🔎 使用提醒 | **必须**：连续 7 日反复显著困惑事件 → 提示**当地认知症评估门诊**或**老年精神科**资源 |\n| 📜 报告输出 | **必须**：当日定向安抚汇总报告**晚交班前发送给主照护者**（避免夜间打扰老人和家属） |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史定向安抚记录清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地失智老人活动区域音视频（以下只是示例，禁止直接使用 作为 open-id）\npython -m scripts.smyx_dementia_confusion_orientation_analysis --input /path/to/care_unit.mp4\n\n# 分析网络失智老人活动区域音视频/实时流（以下只是示例，禁止直接使用 作为 open-id）\npython -m scripts.smyx_dementia_confusion_orientation_analysis --url https://example.com/care_unit.mp4\n\n# 显示历史定向安抚记录清单（自动触发关键词：查看失智老人定向安抚历史报告、定向安抚日志清单等）\npython -m scripts.smyx_dementia_confusion_orientation_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_dementia_confusion_orientation_analysis --input cu.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_dementia_confusion_orientation_analysis --input cu.mp4 --output result.json\n```\n\nFile v1.0.2:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-dementia-confusion-orientation-analysis\",\n  \"version\": \"1.0.2\",\n  \"publishedAt\": 1783850966619\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-soothing-action` - 触发联动安抚（智能音箱播放家庭成员介绍 / 时间地点提示 / 照护者 APP 推送）\n\n## 场景代码\n\n- `SMYX_DEMENTIA_CONFUSION_ORIENTATION_ANALYSIS` - 失智老人困惑/迷惘识别与定向安抚\n\n## 输入约束\n\n- 摄像头：失智照护机构（认知症单元 / 公共活动区 / 走廊）或居家失智老人常驻活动区域固定摄像头\n- 帧率 ≥ 10 FPS；分辨率 ≥ 720p；优先正面或 30° 内侧脸（便于眼神/头部姿态识别）\n- 音频可选：采样率 ≥ 16kHz（用于\"这里是哪 / 你是谁 / 现在几点\"等定向问题语音识别 + 声纹绑定）\n- 时段：默认全天 06:00 - 22:00 启用，夜间睡眠时段切换为低敏告警模式\n- 多老人场景按目标跟踪 + 人脸识别 / 声纹绑定到注册老人 ID（每位老人独立基线）\n- 家属或机构必须授权部署，机构场景需公示告知，家属同意书归档\n\n## 关键观测信号\n\n### 视频（核心）\n- `sudden_activity_stop_sec` - 突然停止活动持续时间（动作中断 ≥ 5s）\n- `gaze_drifting_score` - 眼神游离评分（0-100，视线无聚焦 / 漫无目的漂移）\n- `head_scanning_event_count` - 四处张望次数（头部扫描周围环境）\n- `facial_confusion_score` - 面部困惑评分（0-100，眉头紧锁 + 嘴唇微张 + 目光呆滞）\n- `wandering_event_detected` - 游荡事件（无目的来回走动）\n- `agitation_visual_detected` - 激越视觉信号（搓手 / 拉扯衣物 / 反复站起坐下）\n\n### 音频（可选）\n- `orientation_question_count` - 定向问题计数（\"这是哪 / 你是谁 / 现在几点 / 我在哪 / 几点了\"等）\n- `orientation_question_repeat_count` - 5 分钟内重复同一问题次数\n- `voice_anxiety_score` - 语音焦虑评分（0-100，颤抖 / 急促 / 提高音量）\n- `calling_family_event_count` - 呼喊家人姓名次数（\"老伴 / 儿子 / 女儿\"等）\n\n## 场景判定\n\n- `dementia_orientation_none` - 状态平稳\n- `dementia_orientation_mild` - 轻度迷惘（短暂停顿 + 偶发张望）\n- `dementia_orientation_question` - 反复定向问题（5 分钟内同类问题 ≥ 2 次）\n- `dementia_orientation_gaze_drift` - 眼神游离 + 活动中断\n- `dementia_orientation_wandering` - 困惑伴游荡\n- `dementia_orientation_agitation` - 困惑伴激越（焦虑动作 + 高音）\n- `dementia_orientation_strong` - 显著困惑（多项叠加）\n\n## 4 级定向安抚策略递进\n\n- Level 1（mild）：智能音箱低音量播放当前时间地点温和提示（\"今天是 2026 年 5 月 19 日，星期四，您在客厅\"）\n- Level 2（question / gaze_drift）：在 Level 1 基础上播放家庭成员介绍录音（\"您儿子叫李明，他中午会来看您\"）+ 柔和环境光辅助\n- Level 3（wandering / agitation）：在 Level 2 基础上向主照护者 APP 推送提醒\"老人出现困惑/游荡，请协助\"，提示就近工作人员\n- Level 4（strong / 持续不缓解 / 走出安全区）：紧急推送主照护者 + 机构值班护士，并触发本地温和提示音引导老人原地等待\n\n## 单日动作上限\n\n- mild × 12 / moderate × 8 / strong × 4 / Level 4 不设上限\n\n## 红线约束\n\n- 禁止做\"阿尔茨海默病 / 血管性痴呆 / 路易体痴呆\"等医学诊断\n- 禁止长期存储老人隐私音视频（≤ 7 天，仅入库困惑事件片段；机构按伦理审查规范缩短至 ≤ 72 小时）\n- 禁止用于商业广告 / AI 训练；禁第三方共享\n- 禁止冷白光（≥ 4000K）或亮度 > 30 lux 的环境灯（避免黄昏综合征加重）\n- 禁止安抚音量 > 55 dB（老人听力衰退需略高，但不可造成惊吓）\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 and optional microphone inputs from dementia-care or home settings to identify confusion or disorientation behaviors and guide non-diagnostic orientation-soothing responses. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[smyx-sunjinhui](https://clawhub.ai/user/smyx-sunjinhui) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nExternal caregivers, care-facility operators, and developers use this skill to analyze uploaded or URL-based media from dementia-care settings for signs of confusion or disorientation, produce structured reports, and guide orientation-soothing actions. The skill is not a medical diagnostic tool. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Sensitive dementia-care audio or video may be processed by cloud services. <br>\nMitigation: Use only with resident, family, or facility authorization, and confirm where media, reports, and history are stored before deployment. <br>\nRisk: The skill may silently create or reuse a local identity and persist account tokens. <br>\nMitigation: Require an operator-visible way to disable or clear local identity state and restrict access to token storage. <br>\nRisk: Historical report access may expose sensitive care events. <br>\nMitigation: Limit history queries and report links to authorized caregivers, and review cloud history access before enabling routine use. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-dementia-confusion-orientation-analysis) <br>\n- [API documentation](references/api_doc.md) <br>\n- [Skill demo](https://lifeemergence.com/sample.html) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Text, Markdown, JSON, Shell commands, Guidance] <br>\n**Output Format:** [Markdown reports and tables with optional JSON output from the analysis script.] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May include report links and history tables; results depend on cloud service responses and are non-diagnostic.] <br>\n\n## Skill Version(s): <br>\n1.0.2 (source: ClawHub release evidence; artifact frontmatter reports 1.0.5) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v1.0.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, 41105 bytes\n\nFiles: references/api_doc.md (4660b), scripts/__init__.py (91b), scripts/config.py (705b), scripts/config.yaml (3b), scripts/skill.py (595b), scripts/smyx_dementia_confusion_orientation_analysis.py (3822b), skill-card.md (3524b), SKILL.md (17411b), 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 (163b)\n\nFile v1.0.1:SKILL.md\n\n---\nname: \"smyx-dementia-confusion-orientation-analysis\"\ndescription: \"Through fixed cameras (and optional microphones) in dementia care facilities or homes, the system analyzes behaviors of people with dementia to identify confusion/disorientation states: sudden activity stops (interrupting ongoing actions such as eating or walking for ≥ 5 seconds), gaze drifting (eyes wandering without focus), looking around (frequent head turning), and repeated disorientation questions ('Where is this?'. | 通过失智照护机构或家庭固定摄像头（及可选麦克风），分析失智老人的行为，识别困惑/迷惘状态：突然停止活动（中断正在进行的动作，如吃饭、行走 ≥ 5 秒）、眼神游离（视线漫无目的漂移、不聚焦）、四处张望（头部频繁转动）、反复询问'这是哪''现在几点''你是谁'等定向障碍问题（需配合声纹或语音识别）。\"\nversion: \"1.0.3\"\nlicense: \"MIT-0\"\n---\n\n# 🧭 Dementia Confusion / Disorientation Recognition and Orientation Soothing | 失智老人困惑/迷惘识别与定向安抚\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **失智老人困惑/迷惘识别与定向安抚** |\n| 🎯 核心目标 | 通过失智照护机构或家庭固定摄像头（及可选麦克风），分析失智老人的行为，识别困惑/迷惘状态：突然停止活动（中断正在进行的动作，如吃饭、行走 ≥ 5 秒）、眼神游离（视线漫无目的漂移、不聚焦）、四处张望（头部频繁转动）、反复询问'这是哪''现在几点''你是谁'等定向障碍问题（需配合声纹或语音识别）。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_DEMENTIA_CONFUSION_ORIENTATION_ANALYSIS` |\n\nThrough fixed cameras (and optional microphones) in dementia care facilities or homes, the system analyzes behaviors of people with dementia to identify confusion/disorientation states: sudden activity stops (interrupting ongoing actions such as eating or walking for ≥ 5 seconds), gaze drifting (eyes wandering without focus), looking around (frequent head turning), and repeated disorientation questions ('Where is this?', 'What time is it?', 'Who are you?' — requires voice recognition / voiceprint binding). When such behaviors are detected, oriented soothing is automatically triggered: smart speakers play family member introductions (e.g. 'Your son is Li Ming, he will visit you at noon'), current time and location reminders ('Today is May 19 2026, Thursday, you are at Happiness Home Nursing Center'), with a gentle tone. This skill helps reduce anxiety and confusion in people with dementia and improve quality of life. Application scenarios: dementia care facilities, cognitive care units, home care. The system monitors in real time and proactively provides orientation cues when confusion occurs. Skill features: people with dementia often feel lost, anxious, and develop behavioral issues (wandering, agitation) due to memory loss. AI-based real-time confusion recognition with orientation soothing can reduce distress, slow cognitive decline, and ease caregiver burden. This skill can be integrated into smart cameras or nursing home management systems as a practical dementia care tool.\n\n通过失智照护机构或家庭固定摄像头（及可选麦克风），分析失智老人的行为，识别困惑/迷惘状态：突然停止活动（中断正在进行的动作，如吃饭、行走 ≥ 5 秒）、眼神游离（视线漫无目的漂移、不聚焦）、四处张望（头部频繁转动）、反复询问'这是哪''现在几点''你是谁'等定向障碍问题（需配合声纹或语音识别）。当检测到上述行为时，自动触发定向安抚：通过智能音箱播放家庭成员介绍（如'您儿子叫李明，他中午会来看您'）、当前时间地点提示（'今天是 2026 年 5 月 19 日，星期四，您在幸福家园养老院'），并轻声安抚。该技能有助于减轻失智老人的焦虑和困惑，提高生活质量。应用场景：失智照护机构、认知症单元、居家照护。系统实时监测，当老人出现困惑时自动给予定向信息。技能特点：失智老人常因记忆丧失而感到迷茫、焦虑，甚至引发行为问题（如游荡、激越）。通过 AI 实时识别困惑状态并提供定向安抚，有助于减少老人不安，延缓认知功能下降，减轻照护者负担。该技能可集成到智能摄像头或养老机构管理系统中，成为认知症照护的实用工具。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的失智老人照护 AI。你的任务是分析失智照护机构或家庭固定摄像头（及可选麦克风）的实时音视频，检测失智老人的困惑/迷惘行为：突然停止活动（正在进行的动作如吃饭/行走中断 ≥ 5s）、眼神游离（视线无明显焦点 / 头部无目的转动）、四处张望（头部扫描周围环境）、重复询问定向问题（\"这是哪 / 你是谁 / 现在几点 / 我在哪 / 几点了\"等 5 分钟内重复 ≥ 2 次，需语音识别 + 声纹绑定）、伴随激越或游荡。综合评估困惑等级，按 4 级定向安抚策略递进：Level 1 智能音箱当前时间地点温和提示 → Level 2 家庭成员介绍录音 + 柔光辅助 → Level 3 主照护者 APP 提醒 + 就近工作人员 → Level 4 紧急推送 + 机构值班护士 + 本地引导音。3 分钟后效果评估，未平复自动升级。安抚音量 ≤ 55 dB（兼顾老人听力衰退又不可惊吓），严禁 AI 克隆家人声音，禁用\"您不是说过 / 您忘了吗\"等否定矫正语，仅使用家属预录温和语音。不提供任何医疗诊断，仅输出基于音视频的客观行为识别与定向安抚动作。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于失智照护机构（认知症单元 / 公共活动区 / 走廊）或居家失智老人常驻区域固定摄像头（**可选麦克风**）音视频，识别 7 类场景（dementia_orientation_none / mild / question / gaze_drift / wandering / agitation / strong）→ 视频核心 6 项（突然停止活动持续时间 ≥ 5s / 眼神游离评分 / 四处张望次数 / 面部困惑评分 / 游荡事件 / 激越视觉信号）+ 音频可选 4 项（定向问题计数 / 5 min 内重复次数 / 语音焦虑评分 / 呼喊家人姓名）→ 4 档困惑等级（mild / moderate / strong / urgent）→ **4 级定向安抚策略递进**（当前时间地点温和提示 ≤ 55 dB → 家庭成员介绍录音 + 柔光 ≤ 30 lux 暖光 → 主照护者 APP 提醒 + 就近工作人员 → 紧急推送 + 机构值班护士 + 本地引导音）→ 3 分钟效果评估 + 自动升级 → 单日动作上限管控（mild × 12 / moderate × 8 / strong × 4 / Level 4 不设上限）→ 当日定向安抚汇总（晚交班前发送给主照护者）\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 活动中断检测（结合姿态时序） |\n| 2 | 眼神游离评分 |\n| 3 | 头部扫描计数 |\n| 4 | 面部困惑识别（眉头紧锁 + 嘴唇微张 + 目光呆滞） |\n| 5 | 游荡识别 |\n| 6 | 激越视觉信号（搓手 / 拉扯衣物 / 反复站起坐下） |\n| 7 | 定向问题语音识别（\"这里是哪 / 你是谁 / 现在几点\"等） |\n| 8 | 5 分钟窗口重复问题计数 |\n| 9 | 语音焦虑评分 |\n| 10 | 呼喊家人姓名识别 |\n| 11 | 人脸 + 声纹绑定到注册老人 ID |\n| 12 | 年龄段自适应（早期 / 中期 / 晚期失智） |\n| 13 | 夜间低敏告警模式（避免打扰睡眠） |\n| 14 | 智能音箱联动（家属预录介绍 + 时间地点提示） |\n| 15 | 柔光环境联动 |\n| 16 | 照护者 APP 推送 |\n| 17 | 4 级安抚策略递进 + 3 分钟效果评估 + 自动升级 |\n| 18 | 单日动作上限 |\n| 19 | 当日定向安抚汇总报告（晚交班前发送） |\n| 20 | 连续 7 日反复显著困惑 → 提示当地认知症评估门诊 / 老年精神科资源 |\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_dementia_confusion_orientation_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_dementia_confusion_orientation_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 | 🔐 获取 open-id（强制执行） | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行失智老人困惑/迷惘识别与定向安抚 | 调用 `-m scripts.smyx_dementia_confusion_orientation_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_dementia_confusion_orientation_analysis.py`](scripts/smyx_dementia_confusion_orientation_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov + 音轨，最大 10MB；摄像头需对准老人常驻活动区域；麦克风可选但强烈推荐（用于定向问题识别） |\n| 🔎 使用提醒 | **4 级定向安抚策略递进**（mild → moderate → strong → urgent/Level 4），3 分钟未平复自动升级 |\n| 🔎 使用提醒 | 单日动作上限：mild × 12 / moderate × 8 / strong × 4 / Level 4 不设上限（紧急安全优先） |\n| 🔎 使用提醒 | 红线约束 |\n| 🧑‍⚖️ 结果性质 | **禁止**对老人做\"阿尔茨海默病 / 血管性痴呆 / 路易体痴呆 / 额颞叶痴呆\"等医学诊断 |\n| 🔏 隐私合规 | **禁止**长期存储老人隐私音视频（≤ 7 天，仅入库困惑事件片段；机构按伦理审查规范缩短至 ≤ 72 小时） |\n| 🔎 使用提醒 | **禁止**用于商业广告 / AI 训练；禁第三方共享 |\n| 🔎 使用提醒 | **禁止**冷白光（≥ 4000K）或亮度 > 30 lux 的环境灯（避免黄昏综合征加重） |\n| 🔎 使用提醒 | **禁止**安抚音量 > 55 dB（兼顾听力衰退但不可造成惊吓） |\n| 🔎 使用提醒 | **绝对禁止**使用 AI 克隆 / 合成家庭成员声音冒充本人录音；必须使用家属本人提前授权的预录音 |\n| 🔎 使用提醒 | **禁止**使用\"您不是说过 / 您忘了吗 / 又问一遍了\"等否定 / 矫正语；定向安抚语必须温和、当下、具体 |\n| 📁 格式支持 | **禁止**未经公示在机构场景部署；家属需签同意书并支持退出机制 |\n| 🔎 使用提醒 | **必须**：连续 7 日反复显著困惑事件 → 提示**当地认知症评估门诊**或**老年精神科**资源 |\n| 📜 报告输出 | **必须**：当日定向安抚汇总报告**晚交班前发送给主照护者**（避免夜间打扰老人和家属） |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史定向安抚记录清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地失智老人活动区域音视频（以下只是示例，禁止直接使用 作为 open-id）\npython -m scripts.smyx_dementia_confusion_orientation_analysis --input /path/to/care_unit.mp4\n\n# 分析网络失智老人活动区域音视频/实时流（以下只是示例，禁止直接使用 作为 open-id）\npython -m scripts.smyx_dementia_confusion_orientation_analysis --url https://example.com/care_unit.mp4\n\n# 显示历史定向安抚记录清单（自动触发关键词：查看失智老人定向安抚历史报告、定向安抚日志清单等）\npython -m scripts.smyx_dementia_confusion_orientation_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_dementia_confusion_orientation_analysis --input cu.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_dementia_confusion_orientation_analysis --input cu.mp4 --output result.json\n```\n\nFile v1.0.1:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-dementia-confusion-orientation-analysis\",\n  \"version\": \"1.0.1\",\n  \"publishedAt\": 1782713082279\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-soothing-action` - 触发联动安抚（智能音箱播放家庭成员介绍 / 时间...","readmeExcerpt":"Skill: Dementia Confusion / Disorientation Recognition and Orientation Soothing | 失智老人困惑/迷惘识别与定向安抚 Owner: smyx-sunjinhui Summary: Through fixed cameras (and optional microphones) in dementia care facilities or homes, the system analyzes behaviors of people with dementia to identify confusion/disorientation states: sudden activity stops (interrupting ongoing actions such as eating or walking for ≥ 5 seconds), gaze dri","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"python -m scripts.smyx_dementia_confusion_orientation_analysis --list"},{"language":"text","snippet":"requests>=2.28.0"},{"language":"bash","snippet":"# 分析本地失智老人活动区域音视频（以下只是示例，禁止直接使用 作为 open-id）\npython -m scripts.smyx_dementia_confusion_orientation_analysis --input /path/to/care_unit.mp4\n\n# 分析网络失智老人活动区域音视频/实时流（以下只是示例，禁止直接使用 作为 open-id）\npython -m scripts.smyx_dementia_confusion_orientation_analysis --url https://example.com/care_unit.mp4\n\n# 显示历史定向安抚记录清单（自动触发关键词：查看失智老人定向安抚历史报告、定向安抚日志清单等）\npython -m scripts.smyx_dementia_confusion_orientation_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_dementia_confusion_orientation_analysis --input cu.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_dementia_confusion_orientation_analysis --input cu.mp4 --output result.json"},{"language":"bash","snippet":"python -m scripts.smyx_dementia_confusion_orientation_analysis --list"},{"language":"text","snippet":"requests>=2.28.0"},{"language":"bash","snippet":"# 分析本地失智老人活动区域音视频（以下只是示例，禁止直接使用 作为 open-id）\npython -m scripts.smyx_dementia_confusion_orientation_analysis --input /path/to/care_unit.mp4\n\n# 分析网络失智老人活动区域音视频/实时流（以下只是示例，禁止直接使用 作为 open-id）\npython -m scripts.smyx_dementia_confusion_orientation_analysis --url https://example.com/care_unit.mp4\n\n# 显示历史定向安抚记录清单（自动触发关键词：查看失智老人定向安抚历史报告、定向安抚日志清单等）\npython -m scripts.smyx_dementia_confusion_orientation_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_dementia_confusion_orientation_analysis --input cu.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_dementia_confusion_orientation_analysis --input cu.mp4 --output result.json"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: \"smyx-dementia-confusion-orientation-analysis\"\ndescription: \"Through fixed cameras (and optional microphones) in dementia care facilities or homes, the system analyzes behaviors of people with dementia to identify confusion/disorientation states: sudden activity stops (interrupting ongoing actions such as eating or walking for ≥ 5 seconds), gaze drifting (eyes wandering without focus), looking around (frequent head turning), and repeated disorientation questions ('Where is this?'. | 通过失智照护机构或家庭固定摄像头（及可选麦克风），分析失智老人的行为，识别困惑/迷惘状态：突然停止活动（中断正在进行的动作，如吃饭、行走 ≥ 5 秒）、眼神游离（视线漫无目的漂移、不聚焦）、四处张望（头部频繁转动）、反复询问'这是哪''现在几点''你是谁'等定向障碍问题（需配合声纹或语音识别）。\"\nversion: \"1.0.17\"\nlicense: \"MIT-0\"\n---\n\n# 🧭 Dementia Confusion / Disorientation Recognition and Orientation Soothing | 失智老人困惑/迷惘识别与定向安抚\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **失智老人困惑/迷惘识别与定向安抚** |\n| 🎯 核心目标 | 通过失智照护机构或家庭固定摄像头（及可选麦克风），分析失智老人的行为，识别困惑/迷惘状态：突然停止活动（中断正在进行的动作，如吃饭、行走 ≥ 5 秒）、眼神游离（视线漫无目的漂移、不聚焦）、四处张望（头部频繁转动）、反复询问'这是哪''现在几点''你是谁'等定向障碍问题（需配合声纹或语音识别）。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_DEMENTIA_CONFUSION_ORIENTATION_ANALYSIS` |\n\nThrough fixed cameras (and optional microphones) in dementia care facilities or homes, the system analyzes behaviors of people with dementia to identify confusion/disorientation states: sudden activity stops (interrupting ongoing actions such as eating or walking for ≥ 5 seconds), gaze drifting (eyes wandering without focus), looking around (frequent head turning), and repeated disorientation questions ('Where is this?', 'What time is it?', 'Who are you?' — requires voice recognition / voiceprint binding). When such behaviors are detected, oriented soothing is automatically triggered: smart speakers play family member introductions (e.g. 'Your son is Li Ming, he will visit you at noon'), current time and location reminders ('Today is May 19 2026, Thursday, you are at Happiness Home Nursing Center'), with a gentle tone. This skill helps reduce anxiety and confusion in people with dementia and improve quality of life. Application scenarios: dementia care facilities, cognitive care units, home care. The system monitors in real time and proactively provides orientation cues when confusion occurs. Skill features: people with dementia often feel lost, anxious, and develop behavioral issues (wandering, agitation) due to memory loss. AI-based real-time confusion recognition with orientation soothing can reduce distress, slow cognitive decline, and ease caregiver burden. This skill can be integrated into smart cameras or nursing home management systems as a practical dementia care tool.\n\n通过失智照护机构或家庭固定摄像头（及可选麦克风），分析失智老人的行为，识别困惑/迷惘状态：突然停止活动（中断正在进行的动作，如吃饭、行走 ≥ 5 秒）、眼神游离（视线漫无目的漂移、不聚焦）、四处张望（头部频繁转动）、反复询问'这是哪''现在几点''你是谁'等定向障碍问题（需配合声纹或语音识别）。当检测到上述行为时，自动触发定向安抚：通过智能音箱播放家庭成员介绍（如'您儿子叫李明，他中午会来看您'）、当前时间地点提示（'今天是 2026 年 5 月 19 日，星期四，您在幸福家园养老院'），并轻声安抚。该技能有助于减轻失智老人的焦虑和困惑，提高生活质量。应用场景：失"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-dementia-confusion-orientation-analysis\",\n  \"version\": \"1.0.9\",\n  \"publishedAt\": 1791071364795\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-soothing-action` - 触发联动安抚（智能音箱播放家庭成员介绍 / 时间地点提示 / 照护者 APP 推送）\n\n## 场景代码\n\n- `SMYX_DEMENTIA_CONFUSION_ORIENTATION_ANALYSIS` - 失智老人困惑/迷惘识别与定向安抚\n\n## 输入约束\n\n- 摄像头：失智照护机构（认知症单元 / 公共活动区 / 走廊）或居家失智老人常驻活动区域固定摄像头\n- 帧率 ≥ 10 FPS；分辨率 ≥ 720p；优先正面或 30° 内侧脸（便于眼神/头部姿态识别）\n- 音频可选：采样率 ≥ 16kHz（用于\"这里是哪 / 你是谁 / 现在几点\"等定向问题语音识别 + 声纹绑定）\n- 时段：默认全天 06:00 - 22:00 启用，夜间睡眠时段切换为低敏告警模式\n- 多老人场景按目标跟踪 + 人脸识别 / 声纹绑定到注册老人 ID（每位老人独立基线）\n- 家属或机构必须授权部署，机构场景需公示告知，家属同意书归档\n\n## 关键观测信号\n\n### 视频（核心）\n- `sudden_activity_stop_sec` - 突然停止活动持续时间（动作中断 ≥ 5s）\n- `gaze_drifting_score` - 眼神游离评分（0-100，视线无聚焦 / 漫无目的漂移）\n- `head_scanning_event_count` - 四处张望次数（头部扫描周围环境）\n- `facial_confusion_score` - 面部困惑评分（0-100，眉头紧锁 + 嘴唇微张 + 目光呆滞）\n- `wandering_event_detected` - 游荡事件（无目的来回走动）\n- `agitation_visual_detected` - 激越视觉信号（搓手 / 拉扯衣物 / 反复站起坐下）\n\n### 音频（可选）\n- `orientation_question_count` - 定向问题计数（\"这是哪 / 你是谁 / 现在几点 / 我在哪 / 几点了\"等）\n- `orientation_question_repeat_count` - 5 分钟内重复同一问题次数\n- `voice_anxiety_score` - 语音焦虑评分（0-100，颤抖 / 急促 / 提高音量）\n- `calling_family_event_count` - 呼喊家人姓名次数（\"老伴 / 儿子 / 女儿\"等）\n\n## 场景判定\n\n- `dementia_orientation_none` - 状态平稳\n- `dementia_orientation_mild` - 轻度迷惘（短暂停顿 + 偶发张望）\n- `dementia_orientation_question` - 反复定向问题（5 分钟内同类问题 ≥ 2 次）\n- `dementia_orientation_gaze_drift` - 眼神游离 + 活动中断\n- `dementia_orientation_wandering` - 困惑伴游荡\n- `dementia_orientation_agitation` - 困惑伴激越（焦虑动作 + 高音）\n- `dementia_orientation_strong` - 显著困惑（多项叠加）\n\n## 4 级定向安抚策略递进\n\n- Level 1（mild）：智能音箱低音量播放当前时间地点温和提示（\"今天是 2026 年 5 月 19 日，星期四，您在客厅\"）\n- Level 2（question / gaze_drift）：在 Level 1 基础上播放家庭成员介绍录音（\"您儿子叫李明，他中午会来看您\"）+ 柔和环境光辅助\n- Level 3（wandering / agitation）：在 Level 2 基础上向主照护者 APP 推送提醒\"老人出现困惑/游荡，请协助\"，提示就近工作人员\n- Level 4（strong / 持续不缓解 / 走出安全区）：紧急推送主照护者 + 机构值班护士，并触发本地温和提示音引导老人原地等待\n\n## 单日动作上限\n\n- mild × 12 / moderate × 8 / strong × 4 / Level 4 不设上限\n\n## 红线约束\n\n- 禁止做\"阿尔茨海默病 / 血管性痴呆 / 路易体痴呆\"等医学诊断\n- 禁止长期存储老人隐私音视频（≤ 7 天，仅入库困惑事件片段；机构按伦理审查规范缩短至 ≤ 72 小时）\n- 禁止用于商业广告 / AI 训练；禁第三方共享\n- 禁止冷白光（≥ 4000K）或亮度 > 30 lux 的环境灯（避免黄昏综合征加重）\n- 禁止安抚音量 > 55 dB（老人听力衰退需略高，但不可造成惊吓）\n- 严禁使用 AI 克隆 / 合成家庭成员声音冒充本人录音；必须使用家属本人提前授权的预录音\n- 禁止使用\"您不是说过/您忘了吗/又问一遍了\"等否定 / 矫正语；定向安抚语必须温和、当下、具体\n- 机构场景必须公示告知，提供家属退出机制"},{"path":"skills/smyx_analysis/references/api_doc.md","content":"# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |"},{"path":"scripts/config.yaml","content":"{}"}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":null,"editorialQuality":{"score":100,"threshold":65,"status":"thin","wordCount":1208,"uniquenessScore":43,"reasons":["uniqueness-below-45"]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-10T04:22:24.273Z","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-10T04:22:24.273Z","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-10T07:12:49.056Z","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"}]}}}