{"id":"5a0463cc-5e2d-4b0d-b090-4f74d76829ee","entityType":"agent","slug":"clawhub-18072937735-smyx-elderly-night-bed-exit-wandering-analy","name":"Infant Blanket Kick Detection | 老年人夜间离床时长与徘徊识别","canonicalUrl":"https://www.xpersona.co/agent/clawhub-18072937735-smyx-elderly-night-bed-exit-wandering-analy","canonicalPath":"/agent/clawhub-18072937735-smyx-elderly-night-bed-exit-wandering-analy","generatedAt":"2026-10-10T08:09:40.461Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-09T21:28:49.616Z","emptyReason":null},"description":"Using fixed cameras (infrared night vision) in nursing-home or home bedrooms, the system continuously monitors elderly bed-exit status and activity trajectory at night. | 通过养老院或居家卧室的固定摄像头（红外夜视），夜间连续监测老年人的离床状态和活动轨迹。输出异常预警，可联动护理人员手机或护士站大屏，防止老人走失、跌倒或发生意外。 Skill: Infant Blanket Kick Detection | 老年人夜间离床时长与徘徊识别 Owner: 18072937735 Summary: Using fixed cameras (infrared night vision) in nursing-home or home bedrooms, the system continuously monitors elderly bed-exit status and activity trajectory at night. | 通过养老院或居家卧室的固定摄像头（红外夜视），夜间连续监测老年人的离床状态和活动轨迹。输出异常预警，可联动护理人员手机或护士站大屏，防止老人走失、跌倒或发生意外。 Tags: latest:1.0.14 Version history: v1.0.14 | 2026-09-28T18:45:33.981Z | auto - Remo","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 2K downloads reported by the source. Last updated 10/9/2026.","installCommand":"clawhub skill install s17f8q65zg3y98t86jdg1177g583whq8:smyx-elderly-night-bed-exit-wandering-analysis","sourceUrl":"https://clawhub.ai/18072937735/smyx-elderly-night-bed-exit-wandering-analysis","homepage":"https://clawhub.ai/18072937735/skills/smyx-elderly-night-bed-exit-wandering-analysis","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/18072937735/smyx-elderly-night-bed-exit-wandering-analysis","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/18072937735/skills/smyx-elderly-night-bed-exit-wandering-analysis","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":66,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Using fixed cameras (infrared night vision) in nursing-home or home bedrooms, the system continuously monitors elderly bed-exit status and activity trajectory a"},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-09T21:28:49.616Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-09T21:28:49.616Z","emptyReason":null},"stars":null,"forks":null,"downloads":1980,"packageName":null,"latestVersion":"1.0.14","tractionLabel":"2K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-09T21:28:49.178Z","emptyReason":null},"lastUpdatedAt":"2026-10-09T21:28:49.616Z","lastCrawledAt":"2026-10-09T21:28:49.178Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-10T21:28:49.178Z","lastVerifiedAt":null,"highlights":[{"version":"1.0.14","createdAt":"2026-09-28T18:45:33.981Z","changelog":"- Removed the file skill-card.md from the project. - No changes to core functionality or documentation in SKILL.md. - This update is a minor cleanup, affecting only ancillary documentation files.","fileCount":31,"zipByteSize":40497},{"version":"1.0.13","createdAt":"2026-09-26T19:15:34.217Z","changelog":"- Version update from 1.0.13 to 1.0.15. - Updated internal documentation (SKILL.md), including version number and metadata. - The file skill-card.md was removed. - No functional changes to skill logic or user-facing behavior documented. - Minor maintenance and documentation cleanup.","fileCount":31,"zipByteSize":40472},{"version":"1.0.12","createdAt":"2026-09-08T04:47:35.819Z","changelog":"- Bumped version to 1.0.13. - Updated documentation in SKILL.md; minor wording and format improvements. - Removed the skill-card.md file.","fileCount":31,"zipByteSize":40676},{"version":"1.0.11","createdAt":"2026-08-30T00:34:50.527Z","changelog":"- Version updated to 1.0.11. - Documentation updated: content changes in SKILL.md. - Removed file: skill-card.md. - No functional or API changes indicated; changes are documentation/metadata only.","fileCount":31,"zipByteSize":40544},{"version":"1.0.10","createdAt":"2026-08-18T08:12:28.239Z","changelog":"- Updated version to 1.0.10. - Documentation improvements in SKILL.md for clarity and structure. - Updated configuration in skills/smyx_common/scripts/config.yaml. - Removed the redundant skill-card.md file.","fileCount":31,"zipByteSize":40607},{"version":"1.0.9","createdAt":"2026-08-11T08:10:34.105Z","changelog":"- Removed the file: skill-card.md - No other changes to functionality or documentation in this version.","fileCount":31,"zipByteSize":40781},{"version":"1.0.8","createdAt":"2026-08-06T05:10:36.181Z","changelog":"- Updated version to 1.0.8 in SKILL.md. - Removed the skill-card.md file for simplification. - No changes to features or workflow; documentation content remains consistent. - Ensured version and documentation alignment.","fileCount":31,"zipByteSize":40650},{"version":"1.0.7","createdAt":"2026-08-01T05:13:31.656Z","changelog":"- Updated skill version number in documentation from 1.0.4 to 1.0.6. - Removed the file: skill-card.md. - No functional or behavioral changes to the skill are indicated; documentation and version updates only.","fileCount":31,"zipByteSize":40599}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s17f8q65zg3y98t86jdg1177g583whq8:smyx-elderly-night-bed-exit-wandering-analysis","setupComplexity":"low","setupSteps":["Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-elderly-night-bed-exit-wandering-analy/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-elderly-night-bed-exit-wandering-analy/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-elderly-night-bed-exit-wandering-analy/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-elderly-night-bed-exit-wandering-analy/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-elderly-night-bed-exit-wandering-analy/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-elderly-night-bed-exit-wandering-analy/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-10T08:09:40.457Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-elderly-night-bed-exit-wandering-analy/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-elderly-night-bed-exit-wandering-analy/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-elderly-night-bed-exit-wandering-analy/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-elderly-night-bed-exit-wandering-analy/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-10-09T21:28:49.616Z","emptyReason":null},"readme":"Skill: Infant Blanket Kick Detection | 老年人夜间离床时长与徘徊识别\n\nOwner: 18072937735\n\nSummary: Using fixed cameras (infrared night vision) in nursing-home or home bedrooms, the system continuously monitors elderly bed-exit status and activity trajectory at night. | 通过养老院或居家卧室的固定摄像头（红外夜视），夜间连续监测老年人的离床状态和活动轨迹。输出异常预警，可联动护理人员手机或护士站大屏，防止老人走失、跌倒或发生意外。\n\nTags: latest:1.0.14\n\nVersion history:\n\nv1.0.14 | 2026-09-28T18:45:33.981Z | auto\n\n- Removed the file skill-card.md from the project.\n- No changes to core functionality or documentation in SKILL.md.\n- This update is a minor cleanup, affecting only ancillary documentation files.\n\nv1.0.13 | 2026-09-26T19:15:34.217Z | auto\n\n- Version update from 1.0.13 to 1.0.15.\n- Updated internal documentation (SKILL.md), including version number and metadata.\n- The file skill-card.md was removed.\n- No functional changes to skill logic or user-facing behavior documented.\n- Minor maintenance and documentation cleanup.\n\nv1.0.12 | 2026-09-08T04:47:35.819Z | auto\n\n- Bumped version to 1.0.13.\n- Updated documentation in SKILL.md; minor wording and format improvements.\n- Removed the skill-card.md file.\n\nv1.0.11 | 2026-08-30T00:34:50.527Z | auto\n\n- Version updated to 1.0.11.\n- Documentation updated: content changes in SKILL.md.\n- Removed file: skill-card.md.\n- No functional or API changes indicated; changes are documentation/metadata only.\n\nv1.0.10 | 2026-08-18T08:12:28.239Z | auto\n\n- Updated version to 1.0.10.\n- Documentation improvements in SKILL.md for clarity and structure.\n- Updated configuration in skills/smyx_common/scripts/config.yaml.\n- Removed the redundant skill-card.md file.\n\nv1.0.9 | 2026-08-11T08:10:34.105Z | auto\n\n- Removed the file: skill-card.md\n- No other changes to functionality or documentation in this version.\n\nv1.0.8 | 2026-08-06T05:10:36.181Z | auto\n\n- Updated version to 1.0.8 in SKILL.md.\n- Removed the skill-card.md file for simplification.\n- No changes to features or workflow; documentation content remains consistent.\n- Ensured version and documentation alignment.\n\nv1.0.7 | 2026-08-01T05:13:31.656Z | auto\n\n- Updated skill version number in documentation from 1.0.4 to 1.0.6.\n- Removed the file: skill-card.md.\n- No functional or behavioral changes to the skill are indicated; documentation and version updates only.\n\nv1.0.6 | 2026-07-14T19:20:33.866Z | auto\n\n- Removed the file: skill-card.md\n- No code or feature changes; documentation only update (file cleanup)\n- All core skill functionality remains unchanged\n\nv1.0.5 | 2026-07-10T11:32:28.417Z | auto\n\n- Updated version metadata in SKILL.md (version now \"1.0.4\" instead of \"1.0.2\").\n- Removed the file skill-card.md.\n- Made changes to SKILL.md content (minor version and possibly other text adjustments).\n- Updated utility script: skills/smyx_common/scripts/util.py.\n\nv1.0.4 | 2026-07-04T05:59:28.053Z | auto\n\n- Updated internal scripts: config.py, dao.py, and util.py for improved functionality and maintenance.\n- Updated documentation in SKILL.md; minor corrections and formatting changes.\n- Removed the deprecated skill-card.md file.\n- No changes to user-facing commands or external interfaces.\n\nv1.0.3 | 2026-06-24T16:33:32.151Z | auto\n\n**This update refines user identity handling and streamlines historical cloud report queries.**\n\n- Identity validation is now handled entirely internally; users are no longer prompted for or shown open-id or personal identifiers.\n- All historical analysis report queries strictly fetch data from the cloud API, never from local, memory, or manually aggregated records.\n- Documentation is streamlined: user-facing instructions focus on core operations, examples, capabilities, and do not mention technical identity-handling steps.\n- Removed files related to outdated local API and legacy documentation.\n- Enhanced Markdown formatting and clarity throughout documentation.\n\nv1.0.2 | 2026-06-19T19:47:44.437Z | auto\n\n- Updated open-id configuration search order for improved reliability (now prioritizes scripts/config.yaml in the current skill directory).\n- Added license field to SKILL.md for clarity.\n- SKILL.md and related documentation refined for conciseness and accuracy.\n- Removed deprecated file (skill-card.md).\n- Various code and configuration updates for improved consistency and maintainability.\n\nv1.0.1 | 2026-05-24T18:03:00.164Z | auto\n\nNo user-facing changes.  \n- Version updated to 1.0.1 with no modifications to files or documentation.  \n- No new features, fixes, or updates in this release.\n\nv1.0.0 | 2026-05-24T17:56:52.416Z | auto\n\nInitial release of elderly night bed-exit and wandering detection skill:\n\n- Monitors elderly nighttime bed-exit and wandering using fixed infrared cameras in bedrooms.\n- Detects bed-exit start time, total bed-exit duration, wandering events, and evaluates safety thresholds.\n- Pushes abnormal alerts to caregivers’ phones or nurse station when thresholds are exceeded.\n- Enforces strict open-id retrieval procedure for user identification and report management.\n- Supports querying and outputting structured historic reports in Markdown table format.\n- Integrates with nursing-home management and smart-home platforms, focusing on timely accident prevention and care efficiency.\n\nArchive index:\n\nArchive v1.0.14: 31 files, 40497 bytes\n\nFiles: references/api_doc.md (2022b), scripts/__init__.py (60b), scripts/config.py (703b), scripts/config.yaml (3b), scripts/skill.py (591b), scripts/smyx_elderly_night_bed_exit_wandering_analysis.py (3628b), skill-card.md (2324b), SKILL.md (12123b), 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 (166b)\n\nFile v1.0.14:SKILL.md\n\n---\nname: \"smyx-elderly-night-bed-exit-wandering-analysis\"\ndescription: \"Using fixed cameras (infrared night vision) in nursing-home or home bedrooms, the system continuously monitors elderly bed-exit status and activity trajectory at night. | 通过养老院或居家卧室的固定摄像头（红外夜视），夜间连续监测老年人的离床状态和活动轨迹。输出异常预警，可联动护理人员手机或护士站大屏，防止老人走失、跌倒或发生意外。\"\nversion: \"1.0.15\"\nlicense: \"MIT-0\"\n---\n\n# 🛏️ Elderly Night Bed-Exit & Wandering Detection | 老年人夜间离床时长与徘徊识别\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **老年人夜间离床时长与徘徊识别** |\n| 🎯 核心目标 | 通过养老院或居家卧室的固定摄像头（红外夜视），夜间连续监测老年人的离床状态和活动轨迹。输出异常预警，可联动护理人员手机或护士站大屏，防止老人走失、跌倒或发生意外。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_NIGHT_BED_EXIT_WANDERING_ANALYSIS` |\n\nUsing fixed cameras (infrared night vision) in nursing-home or home bedrooms, the system continuously monitors elderly bed-exit status and activity trajectory at night. It identifies bed-exit start time, total bed-exit duration, whether the person repeatedly walks back and forth in the hallway or room (wandering), and judges whether preset safety thresholds (e.g., bed-exit > 30 min or wandering > 10 min) are exceeded. Abnormal alerts are pushed to caregivers' phones or the nurse-station big screen to prevent wandering away, falls, or accidents. Application scenarios: nursing homes, home-based elderly care, community day-care centers. The system runs automatically at night; when bed-exit lasts too long or repeated wandering occurs, it pushes alerts via app or care system (e.g., 'Grandpa Zhang in bed 3 has been out of bed for 45 minutes, please check in time'). Skill features: prolonged night bed-exit (e.g., fall after getting up) and wandering (e.g., night roaming by elders with cognitive impairment) are high-risk events in elderly care. AI real-time monitoring enables timely warnings, reduces accidents, and improves caregiving efficiency. Can be integrated into nursing-home management systems or smart-home security platforms.\n\n通过养老院或居家卧室的固定摄像头（红外夜视），夜间连续监测老年人的离床状态和活动轨迹。识别离床开始时间、离床总时长、是否在走廊或房间内反复来回走动（徘徊），并判断是否超过预设的安全阈值（如离床>30分钟或徘徊>10分钟）。输出异常预警，可联动护理人员手机或护士站大屏，防止老人走失、跌倒或发生意外。应用场景：养老院、居家养老、社区日间照料中心。系统在夜间自动运行，当老人离床时间过长或出现反复徘徊行为时，通过APP或护理系统推送提醒（如'3号床张爷爷离床已45分钟，请及时查看'）。技能特点：夜间离床时间过长（如老人下床后跌倒无法起身）和徘徊（如认知障碍老人夜间游荡）是养老院和居家养老中的高风险事件。通过AI实时监测，可及时预警，减少意外发生，提升护理效率。该技能可集成到养老院管理系统或智能家居安防平台。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人夜间行为安全 AI。你的任务是分析卧室或走廊摄像头的夜间视频（红外模式），检测老年人是否离开床铺，记录离床的总时长，并识别是否存在反复来回走动的徘徊行为。当离床时长超过设定阈值（如 30 分钟）或徘徊持续时间超过阈值（如 10 分钟）时，输出异常预警。不要提供医疗诊断或具体护理操作方案，仅输出行为统计与报警信息。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于夜间红外卧室/走廊监控视频，检测老年人离床事件、累计离床时长与徘徊行为，并按安全阈值输出预警\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 床铺区域分割 |\n| 2 | 人体检测与跟踪 |\n| 3 | 离床/上床事件识别 |\n| 4 | 离床时长统计 |\n| 5 | 活动轨迹分析 |\n| 6 | 徘徊识别（反复来回走动） |\n| 7 | 安全阈值判定（默认离床>30 分钟 / 徘徊>10 分钟 |\n| 8 | 可覆盖） |\n| 9 | 分级预警（none/info/warning/critical） |\n| 10 | 预警文本生成 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供卧室/走廊夜间监控视频 URL 或文件需要分析时，默认触发本技能进行老年人夜间离床/徘徊识别 |\n| 🔎 明确分析意图 | 当用户明确提及离床、起夜、夜间起床、徘徊、夜游、卧室监控、夜间监护、养老院夜班、护士站、走失预警、跌倒风险等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看夜间离床历史报告、徘徊预警报告清单、夜间监护报告清单、查询历史离床记录、显示所有夜间离床报告、显示老人夜间监护诊断报告，查询夜间预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备夜间监控视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行夜间离床/徘徊识别 | 调用 `-m scripts.smyx_elderly_night_bed_exit_wandering_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地卧室/走廊夜间监控视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络夜间监控视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，老年人夜间监护场景默认 `other` | 按需填写 |\n| `--list` | 显示老年人夜间离床/徘徊历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_elderly_night_bed_exit_wandering_analysis.py`](scripts/smyx_elderly_night_bed_exit_wandering_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov 视频，最大 10MB；建议夜视模式、覆盖整夜时段 |\n| 🧑‍⚖️ 结果性质 | 预警结果仅作为护理参考，疑似跌倒/失踪请立即人工核实并采取紧急行动 |\n| 🔏 隐私合规 | 隐私合规：夜间卧室视频涉及个人隐私，使用前需取得被监护人或家属知情同意 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地夜间监控视频\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --input /path/to/night_room.mp4\n\n# 分析网络夜间监控视频\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --url https://example.com/night_room.mp4\n\n# 显示历史夜间监护报告/徘徊预警报告清单（自动触发关键词：查看夜间离床历史报告、徘徊预警报告清单等）\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --input night.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --input night.mp4 --output result.json\n```\n\nFile v1.0.14:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-elderly-night-bed-exit-wandering-analysis\",\n  \"version\": \"1.0.14\",\n  \"publishedAt\": 1790621133981\n}\n\nFile v1.0.14:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放老年人夜间离床时长与徘徊识别 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动老年人夜间离床/徘徊分析任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取分析结果与预警信息\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史夜间监护记录\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_ELDERLY_NIGHT_BED_EXIT_WANDERING_ANALYSIS` - 老年人夜间离床时长与徘徊识别\n\n## 输入约束\n\n- 推荐使用卧室固定摄像头夜视模式（红外/低照度），覆盖床铺与走廊出入口\n- 时间范围建议覆盖整夜（如 22:00 - 次日 07:00）\n- 关键观测对象：床铺区域、人体目标、活动轨迹\n\n## 关键检测事件\n\n- 离床时间点（bed_exit_time）\n- 上床时间点（bed_return_time）\n- 单次离床时长（exit_duration_sec）\n- 总离床时长（total_exit_duration_sec）\n- 走廊/房间内来回行走轨迹（wandering_track）\n- 徘徊持续时长（wandering_duration_sec）\n\n## 默认安全阈值（可由调用方覆盖）\n\n- 离床时长阈值：30 分钟（exit_duration_threshold_min）\n- 徘徊持续阈值：10 分钟（wandering_duration_threshold_min）\n\n## 输出字段（参考）\n\n- `bed_exit_events` - 离床事件列表（含开始/结束时间、持续秒数）\n- `total_exit_duration_min` - 当晚累计离床时长（分钟）\n- `wandering_detected` - 是否检测到徘徊行为\n- `wandering_duration_min` - 徘徊持续时长（分钟）\n- `alert_level` - 预警等级（none / info / warning / critical）\n- `alert_message` - 预警文本（如\"3 号床张爷爷离床已 45 分钟，请及时查看\"）\n\n> 仅输出行为统计与预警信息，不提供医疗诊断或具体护理方案。\n\nFile v1.0.14:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.14:scripts/config.yaml\n\n{}\n\nFile v1.0.14:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.14:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.14:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.14:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: prod\n\nFile v1.0.14:skill-card.md\n\n## Description:\n\nAnalyzes submitted nighttime bedroom or hallway videos for elderly bed-exit and wandering events and provides reports or historical report links.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[18072937735](https://clawhub.ai/user/18072937735)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nAuthorized caregivers and care teams use the skill to request analysis of nighttime monitoring videos and review bed-exit or wandering reports and prior results. Findings require human review before care decisions.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Sensitive elder bedroom or hallway footage and video URLs are sent to a remote service.\n\nMitigation: Use only with consent from the monitored person or authorized representative; verify the provider's access, retention, and deletion practices before sharing footage.\n\nRisk: Identity-linked reports and reusable service tokens may expose private care information.\n\nMitigation: Restrict access to report data and tokens, and review the provider's authorization controls before use.\n\nRisk: Descriptions of continuous monitoring and alerts may exceed the demonstrated analysis workflow.\n\nMitigation: Do not rely on this skill as a standalone emergency or continuous safety-monitoring system; verify alerting capabilities independently and have caregivers check urgent findings.\n\n## Reference(s):\n\n- [ClawHub skill release](https://clawhub.ai/18072937735/skills/smyx-elderly-night-bed-exit-wandering-analysis)\n- [Skill API documentation](references/api_doc.md)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Markdown, JSON, Guidance]\n\n**Output Format:** [Structured analysis results, report links, or Markdown report listings; JSON is available as a detail setting.]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Can save results to a file; historical report listings come from the remote service.]\n\n## Skill Version(s):\n\n1.0.14 (source: server-resolved ClawHub release; artifact frontmatter says 1.0.15)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.14:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.14:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.13: 31 files, 40472 bytes\n\nFiles: references/api_doc.md (2022b), scripts/__init__.py (60b), scripts/config.py (703b), scripts/config.yaml (3b), scripts/skill.py (591b), scripts/smyx_elderly_night_bed_exit_wandering_analysis.py (3628b), skill-card.md (2237b), SKILL.md (12123b), 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 (166b)\n\nFile v1.0.13:SKILL.md\n\n---\nname: \"smyx-elderly-night-bed-exit-wandering-analysis\"\ndescription: \"Using fixed cameras (infrared night vision) in nursing-home or home bedrooms, the system continuously monitors elderly bed-exit status and activity trajectory at night. | 通过养老院或居家卧室的固定摄像头（红外夜视），夜间连续监测老年人的离床状态和活动轨迹。输出异常预警，可联动护理人员手机或护士站大屏，防止老人走失、跌倒或发生意外。\"\nversion: \"1.0.15\"\nlicense: \"MIT-0\"\n---\n\n# 🛏️ Elderly Night Bed-Exit & Wandering Detection | 老年人夜间离床时长与徘徊识别\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **老年人夜间离床时长与徘徊识别** |\n| 🎯 核心目标 | 通过养老院或居家卧室的固定摄像头（红外夜视），夜间连续监测老年人的离床状态和活动轨迹。输出异常预警，可联动护理人员手机或护士站大屏，防止老人走失、跌倒或发生意外。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_NIGHT_BED_EXIT_WANDERING_ANALYSIS` |\n\nUsing fixed cameras (infrared night vision) in nursing-home or home bedrooms, the system continuously monitors elderly bed-exit status and activity trajectory at night. It identifies bed-exit start time, total bed-exit duration, whether the person repeatedly walks back and forth in the hallway or room (wandering), and judges whether preset safety thresholds (e.g., bed-exit > 30 min or wandering > 10 min) are exceeded. Abnormal alerts are pushed to caregivers' phones or the nurse-station big screen to prevent wandering away, falls, or accidents. Application scenarios: nursing homes, home-based elderly care, community day-care centers. The system runs automatically at night; when bed-exit lasts too long or repeated wandering occurs, it pushes alerts via app or care system (e.g., 'Grandpa Zhang in bed 3 has been out of bed for 45 minutes, please check in time'). Skill features: prolonged night bed-exit (e.g., fall after getting up) and wandering (e.g., night roaming by elders with cognitive impairment) are high-risk events in elderly care. AI real-time monitoring enables timely warnings, reduces accidents, and improves caregiving efficiency. Can be integrated into nursing-home management systems or smart-home security platforms.\n\n通过养老院或居家卧室的固定摄像头（红外夜视），夜间连续监测老年人的离床状态和活动轨迹。识别离床开始时间、离床总时长、是否在走廊或房间内反复来回走动（徘徊），并判断是否超过预设的安全阈值（如离床>30分钟或徘徊>10分钟）。输出异常预警，可联动护理人员手机或护士站大屏，防止老人走失、跌倒或发生意外。应用场景：养老院、居家养老、社区日间照料中心。系统在夜间自动运行，当老人离床时间过长或出现反复徘徊行为时，通过APP或护理系统推送提醒（如'3号床张爷爷离床已45分钟，请及时查看'）。技能特点：夜间离床时间过长（如老人下床后跌倒无法起身）和徘徊（如认知障碍老人夜间游荡）是养老院和居家养老中的高风险事件。通过AI实时监测，可及时预警，减少意外发生，提升护理效率。该技能可集成到养老院管理系统或智能家居安防平台。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人夜间行为安全 AI。你的任务是分析卧室或走廊摄像头的夜间视频（红外模式），检测老年人是否离开床铺，记录离床的总时长，并识别是否存在反复来回走动的徘徊行为。当离床时长超过设定阈值（如 30 分钟）或徘徊持续时间超过阈值（如 10 分钟）时，输出异常预警。不要提供医疗诊断或具体护理操作方案，仅输出行为统计与报警信息。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于夜间红外卧室/走廊监控视频，检测老年人离床事件、累计离床时长与徘徊行为，并按安全阈值输出预警\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 床铺区域分割 |\n| 2 | 人体检测与跟踪 |\n| 3 | 离床/上床事件识别 |\n| 4 | 离床时长统计 |\n| 5 | 活动轨迹分析 |\n| 6 | 徘徊识别（反复来回走动） |\n| 7 | 安全阈值判定（默认离床>30 分钟 / 徘徊>10 分钟 |\n| 8 | 可覆盖） |\n| 9 | 分级预警（none/info/warning/critical） |\n| 10 | 预警文本生成 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供卧室/走廊夜间监控视频 URL 或文件需要分析时，默认触发本技能进行老年人夜间离床/徘徊识别 |\n| 🔎 明确分析意图 | 当用户明确提及离床、起夜、夜间起床、徘徊、夜游、卧室监控、夜间监护、养老院夜班、护士站、走失预警、跌倒风险等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看夜间离床历史报告、徘徊预警报告清单、夜间监护报告清单、查询历史离床记录、显示所有夜间离床报告、显示老人夜间监护诊断报告，查询夜间预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备夜间监控视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行夜间离床/徘徊识别 | 调用 `-m scripts.smyx_elderly_night_bed_exit_wandering_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地卧室/走廊夜间监控视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络夜间监控视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，老年人夜间监护场景默认 `other` | 按需填写 |\n| `--list` | 显示老年人夜间离床/徘徊历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_elderly_night_bed_exit_wandering_analysis.py`](scripts/smyx_elderly_night_bed_exit_wandering_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov 视频，最大 10MB；建议夜视模式、覆盖整夜时段 |\n| 🧑‍⚖️ 结果性质 | 预警结果仅作为护理参考，疑似跌倒/失踪请立即人工核实并采取紧急行动 |\n| 🔏 隐私合规 | 隐私合规：夜间卧室视频涉及个人隐私，使用前需取得被监护人或家属知情同意 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地夜间监控视频\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --input /path/to/night_room.mp4\n\n# 分析网络夜间监控视频\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --url https://example.com/night_room.mp4\n\n# 显示历史夜间监护报告/徘徊预警报告清单（自动触发关键词：查看夜间离床历史报告、徘徊预警报告清单等）\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --input night.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --input night.mp4 --output result.json\n```\n\nFile v1.0.13:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-elderly-night-bed-exit-wandering-analysis\",\n  \"version\": \"1.0.13\",\n  \"publishedAt\": 1790450134217\n}\n\nFile v1.0.13:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放老年人夜间离床时长与徘徊识别 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动老年人夜间离床/徘徊分析任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取分析结果与预警信息\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史夜间监护记录\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_ELDERLY_NIGHT_BED_EXIT_WANDERING_ANALYSIS` - 老年人夜间离床时长与徘徊识别\n\n## 输入约束\n\n- 推荐使用卧室固定摄像头夜视模式（红外/低照度），覆盖床铺与走廊出入口\n- 时间范围建议覆盖整夜（如 22:00 - 次日 07:00）\n- 关键观测对象：床铺区域、人体目标、活动轨迹\n\n## 关键检测事件\n\n- 离床时间点（bed_exit_time）\n- 上床时间点（bed_return_time）\n- 单次离床时长（exit_duration_sec）\n- 总离床时长（total_exit_duration_sec）\n- 走廊/房间内来回行走轨迹（wandering_track）\n- 徘徊持续时长（wandering_duration_sec）\n\n## 默认安全阈值（可由调用方覆盖）\n\n- 离床时长阈值：30 分钟（exit_duration_threshold_min）\n- 徘徊持续阈值：10 分钟（wandering_duration_threshold_min）\n\n## 输出字段（参考）\n\n- `bed_exit_events` - 离床事件列表（含开始/结束时间、持续秒数）\n- `total_exit_duration_min` - 当晚累计离床时长（分钟）\n- `wandering_detected` - 是否检测到徘徊行为\n- `wandering_duration_min` - 徘徊持续时长（分钟）\n- `alert_level` - 预警等级（none / info / warning / critical）\n- `alert_message` - 预警文本（如\"3 号床张爷爷离床已 45 分钟，请及时查看\"）\n\n> 仅输出行为统计与预警信息，不提供医疗诊断或具体护理方案。\n\nFile v1.0.13:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.13:scripts/config.yaml\n\n{}\n\nFile v1.0.13:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.13:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.13:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.13:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: prod\n\nFile v1.0.13:skill-card.md\n\n## Description:\n\nAnalyzes nighttime bedroom or hallway video to report older adults' bed exits, time out of bed, wandering, and threshold-based alerts.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[18072937735](https://clawhub.ai/user/18072937735)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nCaregivers and care-service teams use the skill to review nighttime bedroom or hallway footage for prolonged bed exits and wandering, and to consult alerts and historical reports. Alerts support human review, not medical diagnosis.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Private nighttime bedroom footage is processed by an external cloud service.\n\nMitigation: Obtain clear consent before submitting footage, and ask the publisher about retention, deletion, access controls, and audit practices before using real resident data.\n\nRisk: The skill may silently create or reuse an identity and retain authentication tokens in the workspace.\n\nMitigation: Review identity and local token storage behavior before installing; use only in an environment where both are acceptable.\n\nRisk: Automated behavior alerts may be mistaken for confirmed emergencies.\n\nMitigation: Have caregivers promptly verify suspected falls or absences and take appropriate action rather than relying on alerts as a diagnosis.\n\n## Reference(s):\n\n- [ClawHub skill listing](https://clawhub.ai/18072937735/skills/smyx-elderly-night-bed-exit-wandering-analysis)\n- [API documentation](references/api_doc.md)\n- [Skill demonstration](https://lifeemergence.com/sample.html)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Markdown, Guidance]\n\n**Output Format:** [Structured analysis results and alerts; historical report lists in Markdown]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May include report links and risk alerts; not a medical diagnosis.]\n\n## Skill Version(s):\n\n1.0.13 (source: ClawHub release metadata)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.13:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.13:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.12: 31 files, 40676 bytes\n\nFiles: references/api_doc.md (2022b), scripts/__init__.py (60b), scripts/config.py (703b), scripts/config.yaml (3b), scripts/skill.py (591b), scripts/smyx_elderly_night_bed_exit_wandering_analysis.py (3628b), skill-card.md (2693b), SKILL.md (12123b), 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 (166b)\n\nFile v1.0.12:SKILL.md\n\n---\nname: \"smyx-elderly-night-bed-exit-wandering-analysis\"\ndescription: \"Using fixed cameras (infrared night vision) in nursing-home or home bedrooms, the system continuously monitors elderly bed-exit status and activity trajectory at night. | 通过养老院或居家卧室的固定摄像头（红外夜视），夜间连续监测老年人的离床状态和活动轨迹。输出异常预警，可联动护理人员手机或护士站大屏，防止老人走失、跌倒或发生意外。\"\nversion: \"1.0.13\"\nlicense: \"MIT-0\"\n---\n\n# 🛏️ Elderly Night Bed-Exit & Wandering Detection | 老年人夜间离床时长与徘徊识别\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **老年人夜间离床时长与徘徊识别** |\n| 🎯 核心目标 | 通过养老院或居家卧室的固定摄像头（红外夜视），夜间连续监测老年人的离床状态和活动轨迹。输出异常预警，可联动护理人员手机或护士站大屏，防止老人走失、跌倒或发生意外。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_NIGHT_BED_EXIT_WANDERING_ANALYSIS` |\n\nUsing fixed cameras (infrared night vision) in nursing-home or home bedrooms, the system continuously monitors elderly bed-exit status and activity trajectory at night. It identifies bed-exit start time, total bed-exit duration, whether the person repeatedly walks back and forth in the hallway or room (wandering), and judges whether preset safety thresholds (e.g., bed-exit > 30 min or wandering > 10 min) are exceeded. Abnormal alerts are pushed to caregivers' phones or the nurse-station big screen to prevent wandering away, falls, or accidents. Application scenarios: nursing homes, home-based elderly care, community day-care centers. The system runs automatically at night; when bed-exit lasts too long or repeated wandering occurs, it pushes alerts via app or care system (e.g., 'Grandpa Zhang in bed 3 has been out of bed for 45 minutes, please check in time'). Skill features: prolonged night bed-exit (e.g., fall after getting up) and wandering (e.g., night roaming by elders with cognitive impairment) are high-risk events in elderly care. AI real-time monitoring enables timely warnings, reduces accidents, and improves caregiving efficiency. Can be integrated into nursing-home management systems or smart-home security platforms.\n\n通过养老院或居家卧室的固定摄像头（红外夜视），夜间连续监测老年人的离床状态和活动轨迹。识别离床开始时间、离床总时长、是否在走廊或房间内反复来回走动（徘徊），并判断是否超过预设的安全阈值（如离床>30分钟或徘徊>10分钟）。输出异常预警，可联动护理人员手机或护士站大屏，防止老人走失、跌倒或发生意外。应用场景：养老院、居家养老、社区日间照料中心。系统在夜间自动运行，当老人离床时间过长或出现反复徘徊行为时，通过APP或护理系统推送提醒（如'3号床张爷爷离床已45分钟，请及时查看'）。技能特点：夜间离床时间过长（如老人下床后跌倒无法起身）和徘徊（如认知障碍老人夜间游荡）是养老院和居家养老中的高风险事件。通过AI实时监测，可及时预警，减少意外发生，提升护理效率。该技能可集成到养老院管理系统或智能家居安防平台。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人夜间行为安全 AI。你的任务是分析卧室或走廊摄像头的夜间视频（红外模式），检测老年人是否离开床铺，记录离床的总时长，并识别是否存在反复来回走动的徘徊行为。当离床时长超过设定阈值（如 30 分钟）或徘徊持续时间超过阈值（如 10 分钟）时，输出异常预警。不要提供医疗诊断或具体护理操作方案，仅输出行为统计与报警信息。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于夜间红外卧室/走廊监控视频，检测老年人离床事件、累计离床时长与徘徊行为，并按安全阈值输出预警\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 床铺区域分割 |\n| 2 | 人体检测与跟踪 |\n| 3 | 离床/上床事件识别 |\n| 4 | 离床时长统计 |\n| 5 | 活动轨迹分析 |\n| 6 | 徘徊识别（反复来回走动） |\n| 7 | 安全阈值判定（默认离床>30 分钟 / 徘徊>10 分钟 |\n| 8 | 可覆盖） |\n| 9 | 分级预警（none/info/warning/critical） |\n| 10 | 预警文本生成 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供卧室/走廊夜间监控视频 URL 或文件需要分析时，默认触发本技能进行老年人夜间离床/徘徊识别 |\n| 🔎 明确分析意图 | 当用户明确提及离床、起夜、夜间起床、徘徊、夜游、卧室监控、夜间监护、养老院夜班、护士站、走失预警、跌倒风险等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看夜间离床历史报告、徘徊预警报告清单、夜间监护报告清单、查询历史离床记录、显示所有夜间离床报告、显示老人夜间监护诊断报告，查询夜间预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备夜间监控视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行夜间离床/徘徊识别 | 调用 `-m scripts.smyx_elderly_night_bed_exit_wandering_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地卧室/走廊夜间监控视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络夜间监控视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，老年人夜间监护场景默认 `other` | 按需填写 |\n| `--list` | 显示老年人夜间离床/徘徊历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_elderly_night_bed_exit_wandering_analysis.py`](scripts/smyx_elderly_night_bed_exit_wandering_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov 视频，最大 10MB；建议夜视模式、覆盖整夜时段 |\n| 🧑‍⚖️ 结果性质 | 预警结果仅作为护理参考，疑似跌倒/失踪请立即人工核实并采取紧急行动 |\n| 🔏 隐私合规 | 隐私合规：夜间卧室视频涉及个人隐私，使用前需取得被监护人或家属知情同意 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地夜间监控视频\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --input /path/to/night_room.mp4\n\n# 分析网络夜间监控视频\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --url https://example.com/night_room.mp4\n\n# 显示历史夜间监护报告/徘徊预警报告清单（自动触发关键词：查看夜间离床历史报告、徘徊预警报告清单等）\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --input night.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --input night.mp4 --output result.json\n```\n\nFile v1.0.12:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-elderly-night-bed-exit-wandering-analysis\",\n  \"version\": \"1.0.12\",\n  \"publishedAt\": 1788842855819\n}\n\nFile v1.0.12:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放老年人夜间离床时长与徘徊识别 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动老年人夜间离床/徘徊分析任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取分析结果与预警信息\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史夜间监护记录\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_ELDERLY_NIGHT_BED_EXIT_WANDERING_ANALYSIS` - 老年人夜间离床时长与徘徊识别\n\n## 输入约束\n\n- 推荐使用卧室固定摄像头夜视模式（红外/低照度），覆盖床铺与走廊出入口\n- 时间范围建议覆盖整夜（如 22:00 - 次日 07:00）\n- 关键观测对象：床铺区域、人体目标、活动轨迹\n\n## 关键检测事件\n\n- 离床时间点（bed_exit_time）\n- 上床时间点（bed_return_time）\n- 单次离床时长（exit_duration_sec）\n- 总离床时长（total_exit_duration_sec）\n- 走廊/房间内来回行走轨迹（wandering_track）\n- 徘徊持续时长（wandering_duration_sec）\n\n## 默认安全阈值（可由调用方覆盖）\n\n- 离床时长阈值：30 分钟（exit_duration_threshold_min）\n- 徘徊持续阈值：10 分钟（wandering_duration_threshold_min）\n\n## 输出字段（参考）\n\n- `bed_exit_events` - 离床事件列表（含开始/结束时间、持续秒数）\n- `total_exit_duration_min` - 当晚累计离床时长（分钟）\n- `wandering_detected` - 是否检测到徘徊行为\n- `wandering_duration_min` - 徘徊持续时长（分钟）\n- `alert_level` - 预警等级（none / info / warning / critical）\n- `alert_message` - 预警文本（如\"3 号床张爷爷离床已 45 分钟，请及时查看\"）\n\n> 仅输出行为统计与预警信息，不提供医疗诊断或具体护理方案。\n\nFile v1.0.12:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.12:scripts/config.yaml\n\n{}\n\nFile v1.0.12:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.12:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.12:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.12:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: dev\n\nFile v1.0.12:skill-card.md\n\n## Description:\n\nUsing fixed cameras with infrared night vision in nursing-home or home bedrooms, this skill monitors elderly bed-exit status and nighttime activity trajectory, then produces abnormal alerts for prolonged bed exits or wandering.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[18072937735](https://clawhub.ai/user/18072937735)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal care teams, integrators, and developers use this skill to analyze nighttime bedroom or hallway camera footage for elderly bed-exit duration, wandering behavior, alert levels, and historical report lookup. The output is intended as behavior statistics and alerting support, not medical diagnosis or a substitute for human verification.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill may upload or reference sensitive bedroom-monitoring video and retrieve cloud reports.\n\nMitigation: Use only with explicit consent, HTTPS-only endpoints, defined retention limits, access controls, and human review before acting on alerts.\n\nRisk: The security summary flags silent identity handling and persistent local tokens.\n\nMitigation: Confirm identity behavior, credential storage, token rotation, and least-privilege access before using the skill with real elder-care footage.\n\nRisk: The security guidance flags plaintext HTTP defaults and recommends careful review before installation.\n\nMitigation: Review configuration before deployment and avoid production use unless transport security and endpoint ownership are verified.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/18072937735/skills/smyx-elderly-night-bed-exit-wandering-analysis)\n- [API interface documentation](references/api_doc.md)\n- [SMYX analysis API documentation](skills/smyx_analysis/references/api_doc.md)\n- [Skill demo](https://lifeemergence.com/sample.html)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Markdown, JSON, Shell commands]\n\n**Output Format:** [Markdown report text or JSON, with optional saved output file]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May include bed-exit events, total exit duration, wandering status and duration, alert level, alert message, recommendations, report links, or a Markdown history table.]\n\n## Skill Version(s):\n\n1.0.12 (source: evidence.release.version and target metadata; artifact frontmatter says 1.0.13)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.12:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.12:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.11: 31 files, 40544 bytes\n\nFiles: references/api_doc.md (2022b), scripts/__init__.py (60b), scripts/config.py (703b), scripts/config.yaml (3b), scripts/skill.py (591b), scripts/smyx_elderly_night_bed_exit_wandering_analysis.py (3628b), skill-card.md (2362b), SKILL.md (12123b), 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 (166b)\n\nFile v1.0.11:SKILL.md\n\n---\nname: \"smyx-elderly-night-bed-exit-wandering-analysis\"\ndescription: \"Using fixed cameras (infrared night vision) in nursing-home or home bedrooms, the system continuously monitors elderly bed-exit status and activity trajectory at night. | 通过养老院或居家卧室的固定摄像头（红外夜视），夜间连续监测老年人的离床状态和活动轨迹。输出异常预警，可联动护理人员手机或护士站大屏，防止老人走失、跌倒或发生意外。\"\nversion: \"1.0.11\"\nlicense: \"MIT-0\"\n---\n\n# 🛏️ Elderly Night Bed-Exit & Wandering Detection | 老年人夜间离床时长与徘徊识别\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **老年人夜间离床时长与徘徊识别** |\n| 🎯 核心目标 | 通过养老院或居家卧室的固定摄像头（红外夜视），夜间连续监测老年人的离床状态和活动轨迹。输出异常预警，可联动护理人员手机或护士站大屏，防止老人走失、跌倒或发生意外。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_NIGHT_BED_EXIT_WANDERING_ANALYSIS` |\n\nUsing fixed cameras (infrared night vision) in nursing-home or home bedrooms, the system continuously monitors elderly bed-exit status and activity trajectory at night. It identifies bed-exit start time, total bed-exit duration, whether the person repeatedly walks back and forth in the hallway or room (wandering), and judges whether preset safety thresholds (e.g., bed-exit > 30 min or wandering > 10 min) are exceeded. Abnormal alerts are pushed to caregivers' phones or the nurse-station big screen to prevent wandering away, falls, or accidents. Application scenarios: nursing homes, home-based elderly care, community day-care centers. The system runs automatically at night; when bed-exit lasts too long or repeated wandering occurs, it pushes alerts via app or care system (e.g., 'Grandpa Zhang in bed 3 has been out of bed for 45 minutes, please check in time'). Skill features: prolonged night bed-exit (e.g., fall after getting up) and wandering (e.g., night roaming by elders with cognitive impairment) are high-risk events in elderly care. AI real-time monitoring enables timely warnings, reduces accidents, and improves caregiving efficiency. Can be integrated into nursing-home management systems or smart-home security platforms.\n\n通过养老院或居家卧室的固定摄像头（红外夜视），夜间连续监测老年人的离床状态和活动轨迹。识别离床开始时间、离床总时长、是否在走廊或房间内反复来回走动（徘徊），并判断是否超过预设的安全阈值（如离床>30分钟或徘徊>10分钟）。输出异常预警，可联动护理人员手机或护士站大屏，防止老人走失、跌倒或发生意外。应用场景：养老院、居家养老、社区日间照料中心。系统在夜间自动运行，当老人离床时间过长或出现反复徘徊行为时，通过APP或护理系统推送提醒（如'3号床张爷爷离床已45分钟，请及时查看'）。技能特点：夜间离床时间过长（如老人下床后跌倒无法起身）和徘徊（如认知障碍老人夜间游荡）是养老院和居家养老中的高风险事件。通过AI实时监测，可及时预警，减少意外发生，提升护理效率。该技能可集成到养老院管理系统或智能家居安防平台。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人夜间行为安全 AI。你的任务是分析卧室或走廊摄像头的夜间视频（红外模式），检测老年人是否离开床铺，记录离床的总时长，并识别是否存在反复来回走动的徘徊行为。当离床时长超过设定阈值（如 30 分钟）或徘徊持续时间超过阈值（如 10 分钟）时，输出异常预警。不要提供医疗诊断或具体护理操作方案，仅输出行为统计与报警信息。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于夜间红外卧室/走廊监控视频，检测老年人离床事件、累计离床时长与徘徊行为，并按安全阈值输出预警\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 床铺区域分割 |\n| 2 | 人体检测与跟踪 |\n| 3 | 离床/上床事件识别 |\n| 4 | 离床时长统计 |\n| 5 | 活动轨迹分析 |\n| 6 | 徘徊识别（反复来回走动） |\n| 7 | 安全阈值判定（默认离床>30 分钟 / 徘徊>10 分钟 |\n| 8 | 可覆盖） |\n| 9 | 分级预警（none/info/warning/critical） |\n| 10 | 预警文本生成 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供卧室/走廊夜间监控视频 URL 或文件需要分析时，默认触发本技能进行老年人夜间离床/徘徊识别 |\n| 🔎 明确分析意图 | 当用户明确提及离床、起夜、夜间起床、徘徊、夜游、卧室监控、夜间监护、养老院夜班、护士站、走失预警、跌倒风险等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看夜间离床历史报告、徘徊预警报告清单、夜间监护报告清单、查询历史离床记录、显示所有夜间离床报告、显示老人夜间监护诊断报告，查询夜间预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备夜间监控视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行夜间离床/徘徊识别 | 调用 `-m scripts.smyx_elderly_night_bed_exit_wandering_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地卧室/走廊夜间监控视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络夜间监控视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，老年人夜间监护场景默认 `other` | 按需填写 |\n| `--list` | 显示老年人夜间离床/徘徊历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_elderly_night_bed_exit_wandering_analysis.py`](scripts/smyx_elderly_night_bed_exit_wandering_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov 视频，最大 10MB；建议夜视模式、覆盖整夜时段 |\n| 🧑‍⚖️ 结果性质 | 预警结果仅作为护理参考，疑似跌倒/失踪请立即人工核实并采取紧急行动 |\n| 🔏 隐私合规 | 隐私合规：夜间卧室视频涉及个人隐私，使用前需取得被监护人或家属知情同意 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地夜间监控视频\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --input /path/to/night_room.mp4\n\n# 分析网络夜间监控视频\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --url https://example.com/night_room.mp4\n\n# 显示历史夜间监护报告/徘徊预警报告清单（自动触发关键词：查看夜间离床历史报告、徘徊预警报告清单等）\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --input night.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --input night.mp4 --output result.json\n```\n\nFile v1.0.11:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-elderly-night-bed-exit-wandering-analysis\",\n  \"version\": \"1.0.11\",\n  \"publishedAt\": 1788050090527\n}\n\nFile v1.0.11:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放老年人夜间离床时长与徘徊识别 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动老年人夜间离床/徘徊分析任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取分析结果与预警信息\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史夜间监护记录\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_ELDERLY_NIGHT_BED_EXIT_WANDERING_ANALYSIS` - 老年人夜间离床时长与徘徊识别\n\n## 输入约束\n\n- 推荐使用卧室固定摄像头夜视模式（红外/低照度），覆盖床铺与走廊出入口\n- 时间范围建议覆盖整夜（如 22:00 - 次日 07:00）\n- 关键观测对象：床铺区域、人体目标、活动轨迹\n\n## 关键检测事件\n\n- 离床时间点（bed_exit_time）\n- 上床时间点（bed_return_time）\n- 单次离床时长（exit_duration_sec）\n- 总离床时长（total_exit_duration_sec）\n- 走廊/房间内来回行走轨迹（wandering_track）\n- 徘徊持续时长（wandering_duration_sec）\n\n## 默认安全阈值（可由调用方覆盖）\n\n- 离床时长阈值：30 分钟（exit_duration_threshold_min）\n- 徘徊持续阈值：10 分钟（wandering_duration_threshold_min）\n\n## 输出字段（参考）\n\n- `bed_exit_events` - 离床事件列表（含开始/结束时间、持续秒数）\n- `total_exit_duration_min` - 当晚累计离床时长（分钟）\n- `wandering_detected` - 是否检测到徘徊行为\n- `wandering_duration_min` - 徘徊持续时长（分钟）\n- `alert_level` - 预警等级（none / info / warning / critical）\n- `alert_message` - 预警文本（如\"3 号床张爷爷离床已 45 分钟，请及时查看\"）\n\n> 仅输出行为统计与预警信息，不提供医疗诊断或具体护理方案。\n\nFile v1.0.11:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.11:scripts/config.yaml\n\n{}\n\nFile v1.0.11:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.11:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.11:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.11:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: dev\n\nFile v1.0.11:skill-card.md\n\n## Description:\n\nAnalyzes fixed night-vision camera video from elder-care bedrooms or hallways to detect bed-exit events, total time out of bed, wandering patterns, and threshold-based alerts.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[18072937735](https://clawhub.ai/user/18072937735)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal caregivers, nursing-home operators, home-care teams, and developers use this skill to analyze night monitoring footage for bed-exit duration, wandering behavior, alert levels, report links, and historical report lookup.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Elder bedroom or hallway monitoring footage and video URLs may be sent to a configured cloud service.\n\nMitigation: Confirm consent from the monitored person or legal representative, verify the service destination and retention policy, and avoid sending footage that is not needed for the requested analysis.\n\nRisk: The skill can silently create or reuse generated user identifiers and stores service tokens for report access.\n\nMitigation: Review account isolation, authorization, audit logging, and token storage controls before installation, especially in regulated care environments.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/18072937735/skills/smyx-elderly-night-bed-exit-wandering-analysis)\n- [Skill demo](https://lifeemergence.com/sample.html)\n- [API interface documentation](artifact/references/api_doc.md)\n- [SMYX 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, configuration, guidance]\n\n**Output Format:** [Markdown and JSON text with structured analysis results, alert messages, and report links]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May output historical report lists from the configured cloud API; local file analysis supports mp4, avi, and mov inputs up to 10 MB.]\n\n## Skill Version(s):\n\n1.0.11 (source: frontmatter, server release metadata)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.11:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.11:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.10: 31 files, 40607 bytes\n\nFiles: references/api_doc.md (2022b), scripts/__init__.py (60b), scripts/config.py (703b), scripts/config.yaml (3b), scripts/skill.py (591b), scripts/smyx_elderly_night_bed_exit_wandering_analysis.py (3628b), skill-card.md (2555b), SKILL.md (12123b), 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 (166b)\n\nFile v1.0.10:SKILL.md\n\n---\nname: \"smyx-elderly-night-bed-exit-wandering-analysis\"\ndescription: \"Using fixed cameras (infrared night vision) in nursing-home or home bedrooms, the system continuously monitors elderly bed-exit status and activity trajectory at night. | 通过养老院或居家卧室的固定摄像头（红外夜视），夜间连续监测老年人的离床状态和活动轨迹。输出异常预警，可联动护理人员手机或护士站大屏，防止老人走失、跌倒或发生意外。\"\nversion: \"1.0.10\"\nlicense: \"MIT-0\"\n---\n\n# 🛏️ Elderly Night Bed-Exit & Wandering Detection | 老年人夜间离床时长与徘徊识别\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **老年人夜间离床时长与徘徊识别** |\n| 🎯 核心目标 | 通过养老院或居家卧室的固定摄像头（红外夜视），夜间连续监测老年人的离床状态和活动轨迹。输出异常预警，可联动护理人员手机或护士站大屏，防止老人走失、跌倒或发生意外。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_NIGHT_BED_EXIT_WANDERING_ANALYSIS` |\n\nUsing fixed cameras (infrared night vision) in nursing-home or home bedrooms, the system continuously monitors elderly bed-exit status and activity trajectory at night. It identifies bed-exit start time, total bed-exit duration, whether the person repeatedly walks back and forth in the hallway or room (wandering), and judges whether preset safety thresholds (e.g., bed-exit > 30 min or wandering > 10 min) are exceeded. Abnormal alerts are pushed to caregivers' phones or the nurse-station big screen to prevent wandering away, falls, or accidents. Application scenarios: nursing homes, home-based elderly care, community day-care centers. The system runs automatically at night; when bed-exit lasts too long or repeated wandering occurs, it pushes alerts via app or care system (e.g., 'Grandpa Zhang in bed 3 has been out of bed for 45 minutes, please check in time'). Skill features: prolonged night bed-exit (e.g., fall after getting up) and wandering (e.g., night roaming by elders with cognitive impairment) are high-risk events in elderly care. AI real-time monitoring enables timely warnings, reduces accidents, and improves caregiving efficiency. Can be integrated into nursing-home management systems or smart-home security platforms.\n\n通过养老院或居家卧室的固定摄像头（红外夜视），夜间连续监测老年人的离床状态和活动轨迹。识别离床开始时间、离床总时长、是否在走廊或房间内反复来回走动（徘徊），并判断是否超过预设的安全阈值（如离床>30分钟或徘徊>10分钟）。输出异常预警，可联动护理人员手机或护士站大屏，防止老人走失、跌倒或发生意外。应用场景：养老院、居家养老、社区日间照料中心。系统在夜间自动运行，当老人离床时间过长或出现反复徘徊行为时，通过APP或护理系统推送提醒（如'3号床张爷爷离床已45分钟，请及时查看'）。技能特点：夜间离床时间过长（如老人下床后跌倒无法起身）和徘徊（如认知障碍老人夜间游荡）是养老院和居家养老中的高风险事件。通过AI实时监测，可及时预警，减少意外发生，提升护理效率。该技能可集成到养老院管理系统或智能家居安防平台。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人夜间行为安全 AI。你的任务是分析卧室或走廊摄像头的夜间视频（红外模式），检测老年人是否离开床铺，记录离床的总时长，并识别是否存在反复来回走动的徘徊行为。当离床时长超过设定阈值（如 30 分钟）或徘徊持续时间超过阈值（如 10 分钟）时，输出异常预警。不要提供医疗诊断或具体护理操作方案，仅输出行为统计与报警信息。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于夜间红外卧室/走廊监控视频，检测老年人离床事件、累计离床时长与徘徊行为，并按安全阈值输出预警\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 床铺区域分割 |\n| 2 | 人体检测与跟踪 |\n| 3 | 离床/上床事件识别 |\n| 4 | 离床时长统计 |\n| 5 | 活动轨迹分析 |\n| 6 | 徘徊识别（反复来回走动） |\n| 7 | 安全阈值判定（默认离床>30 分钟 / 徘徊>10 分钟 |\n| 8 | 可覆盖） |\n| 9 | 分级预警（none/info/warning/critical） |\n| 10 | 预警文本生成 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供卧室/走廊夜间监控视频 URL 或文件需要分析时，默认触发本技能进行老年人夜间离床/徘徊识别 |\n| 🔎 明确分析意图 | 当用户明确提及离床、起夜、夜间起床、徘徊、夜游、卧室监控、夜间监护、养老院夜班、护士站、走失预警、跌倒风险等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看夜间离床历史报告、徘徊预警报告清单、夜间监护报告清单、查询历史离床记录、显示所有夜间离床报告、显示老人夜间监护诊断报告，查询夜间预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备夜间监控视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行夜间离床/徘徊识别 | 调用 `-m scripts.smyx_elderly_night_bed_exit_wandering_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地卧室/走廊夜间监控视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络夜间监控视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，老年人夜间监护场景默认 `other` | 按需填写 |\n| `--list` | 显示老年人夜间离床/徘徊历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_elderly_night_bed_exit_wandering_analysis.py`](scripts/smyx_elderly_night_bed_exit_wandering_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov 视频，最大 10MB；建议夜视模式、覆盖整夜时段 |\n| 🧑‍⚖️ 结果性质 | 预警结果仅作为护理参考，疑似跌倒/失踪请立即人工核实并采取紧急行动 |\n| 🔏 隐私合规 | 隐私合规：夜间卧室视频涉及个人隐私，使用前需取得被监护人或家属知情同意 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地夜间监控视频\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --input /path/to/night_room.mp4\n\n# 分析网络夜间监控视频\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --url https://example.com/night_room.mp4\n\n# 显示历史夜间监护报告/徘徊预警报告清单（自动触发关键词：查看夜间离床历史报告、徘徊预警报告清单等）\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --input night.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --input night.mp4 --output result.json\n```\n\nFile v1.0.10:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-elderly-night-bed-exit-wandering-analysis\",\n  \"version\": \"1.0.10\",\n  \"publishedAt\": 1787040748239\n}\n\nFile v1.0.10:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放老年人夜间离床时长与徘徊识别 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动老年人夜间离床/徘徊分析任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取分析结果与预警信息\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史夜间监护记录\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_ELDERLY_NIGHT_BED_EXIT_WANDERING_ANALYSIS` - 老年人夜间离床时长与徘徊识别\n\n## 输入约束\n\n- 推荐使用卧室固定摄像头夜视模式（红外/低照度），覆盖床铺与走廊出入口\n- 时间范围建议覆盖整夜（如 22:00 - 次日 07:00）\n- 关键观测对象：床铺区域、人体目标、活动轨迹\n\n## 关键检测事件\n\n- 离床时间点（bed_exit_time）\n- 上床时间点（bed_return_time）\n- 单次离床时长（exit_duration_sec）\n- 总离床时长（total_exit_duration_sec）\n- 走廊/房间内来回行走轨迹（wandering_track）\n- 徘徊持续时长（wandering_duration_sec）\n\n## 默认安全阈值（可由调用方覆盖）\n\n- 离床时长阈值：30 分钟（exit_duration_threshold_min）\n- 徘徊持续阈值：10 分钟（wandering_duration_threshold_min）\n\n## 输出字段（参考）\n\n- `bed_exit_events` - 离床事件列表（含开始/结束时间、持续秒数）\n- `total_exit_duration_min` - 当晚累计离床时长（分钟）\n- `wandering_detected` - 是否检测到徘徊行为\n- `wandering_duration_min` - 徘徊持续时长（分钟）\n- `alert_level` - 预警等级（none / info / warning / critical）\n- `alert_message` - 预警文本（如\"3 号床张爷爷离床已 45 分钟，请及时查看\"）\n\n> 仅输出行为统计与预警信息，不提供医疗诊断或具体护理方案。\n\nFile v1.0.10:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.10:scripts/config.yaml\n\n{}\n\nFile v1.0.10:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.10:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.10:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.10:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: dev\n\nFile v1.0.10:skill-card.md\n\n## Description:\n\nUsing fixed infrared cameras in nursing-home or home bedrooms, this skill monitors nighttime bed-exit status and movement trajectories, detects wandering, and outputs threshold-based alerts.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[18072937735](https://clawhub.ai/user/18072937735)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nCare teams, family caregivers, and agent developers use this skill to analyze nighttime bedroom or hallway monitoring video for elderly bed-exit duration and wandering alerts. It produces behavior statistics and alert information for caregiver review, not medical diagnosis or care instructions.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Private night-monitoring video and identity-linked report data may be sent to configured services.\n\nMitigation: Use only with informed consent, approved service endpoints, production HTTPS, and documented retention and deletion controls.\n\nRisk: The skill can create or reuse identities and store tokens locally.\n\nMitigation: Review identity handling and token storage before installation, restrict local file permissions, and define token rotation or deletion procedures.\n\nRisk: Security evidence marks the release as suspicious because sensitive monitoring data is handled with limited user control.\n\nMitigation: Install only after security review, deployment configuration review, and confirmation that data handling matches the care setting's privacy requirements.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/18072937735/skills/smyx-elderly-night-bed-exit-wandering-analysis)\n- [Skill demo](https://lifeemergence.com/sample.html)\n- [API interface documentation](references/api_doc.md)\n- [Analysis API documentation](skills/smyx_analysis/references/api_doc.md)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, JSON, shell commands, configuration]\n\n**Output Format:** [Markdown tables or JSON structured analysis with alert text, behavior statistics, and report links when available.]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May write an optional result file when an output path is supplied.]\n\n## Skill Version(s):\n\n1.0.10 (source: frontmatter and server release metadata)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.10:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.10:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.9: 31 files, 40781 bytes\n\nFiles: references/api_doc.md (2022b), scripts/__init__.py (60b), scripts/config.py (703b), scripts/config.yaml (3b), scripts/skill.py (591b), scripts/smyx_elderly_night_bed_exit_wandering_analysis.py (3628b), skill-card.md (2886b), SKILL.md (12122b), 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 (165b)\n\nFile v1.0.9:SKILL.md\n\n---\nname: \"smyx-elderly-night-bed-exit-wandering-analysis\"\ndescription: \"Using fixed cameras (infrared night vision) in nursing-home or home bedrooms, the system continuously monitors elderly bed-exit status and activity trajectory at night. | 通过养老院或居家卧室的固定摄像头（红外夜视），夜间连续监测老年人的离床状态和活动轨迹。输出异常预警，可联动护理人员手机或护士站大屏，防止老人走失、跌倒或发生意外。\"\nversion: \"1.0.8\"\nlicense: \"MIT-0\"\n---\n\n# 🛏️ Elderly Night Bed-Exit & Wandering Detection | 老年人夜间离床时长与徘徊识别\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **老年人夜间离床时长与徘徊识别** |\n| 🎯 核心目标 | 通过养老院或居家卧室的固定摄像头（红外夜视），夜间连续监测老年人的离床状态和活动轨迹。输出异常预警，可联动护理人员手机或护士站大屏，防止老人走失、跌倒或发生意外。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_NIGHT_BED_EXIT_WANDERING_ANALYSIS` |\n\nUsing fixed cameras (infrared night vision) in nursing-home or home bedrooms, the system continuously monitors elderly bed-exit status and activity trajectory at night. It identifies bed-exit start time, total bed-exit duration, whether the person repeatedly walks back and forth in the hallway or room (wandering), and judges whether preset safety thresholds (e.g., bed-exit > 30 min or wandering > 10 min) are exceeded. Abnormal alerts are pushed to caregivers' phones or the nurse-station big screen to prevent wandering away, falls, or accidents. Application scenarios: nursing homes, home-based elderly care, community day-care centers. The system runs automatically at night; when bed-exit lasts too long or repeated wandering occurs, it pushes alerts via app or care system (e.g., 'Grandpa Zhang in bed 3 has been out of bed for 45 minutes, please check in time'). Skill features: prolonged night bed-exit (e.g., fall after getting up) and wandering (e.g., night roaming by elders with cognitive impairment) are high-risk events in elderly care. AI real-time monitoring enables timely warnings, reduces accidents, and improves caregiving efficiency. Can be integrated into nursing-home management systems or smart-home security platforms.\n\n通过养老院或居家卧室的固定摄像头（红外夜视），夜间连续监测老年人的离床状态和活动轨迹。识别离床开始时间、离床总时长、是否在走廊或房间内反复来回走动（徘徊），并判断是否超过预设的安全阈值（如离床>30分钟或徘徊>10分钟）。输出异常预警，可联动护理人员手机或护士站大屏，防止老人走失、跌倒或发生意外。应用场景：养老院、居家养老、社区日间照料中心。系统在夜间自动运行，当老人离床时间过长或出现反复徘徊行为时，通过APP或护理系统推送提醒（如'3号床张爷爷离床已45分钟，请及时查看'）。技能特点：夜间离床时间过长（如老人下床后跌倒无法起身）和徘徊（如认知障碍老人夜间游荡）是养老院和居家养老中的高风险事件。通过AI实时监测，可及时预警，减少意外发生，提升护理效率。该技能可集成到养老院管理系统或智能家居安防平台。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人夜间行为安全 AI。你的任务是分析卧室或走廊摄像头的夜间视频（红外模式），检测老年人是否离开床铺，记录离床的总时长，并识别是否存在反复来回走动的徘徊行为。当离床时长超过设定阈值（如 30 分钟）或徘徊持续时间超过阈值（如 10 分钟）时，输出异常预警。不要提供医疗诊断或具体护理操作方案，仅输出行为统计与报警信息。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于夜间红外卧室/走廊监控视频，检测老年人离床事件、累计离床时长与徘徊行为，并按安全阈值输出预警\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 床铺区域分割 |\n| 2 | 人体检测与跟踪 |\n| 3 | 离床/上床事件识别 |\n| 4 | 离床时长统计 |\n| 5 | 活动轨迹分析 |\n| 6 | 徘徊识别（反复来回走动） |\n| 7 | 安全阈值判定（默认离床>30 分钟 / 徘徊>10 分钟 |\n| 8 | 可覆盖） |\n| 9 | 分级预警（none/info/warning/critical） |\n| 10 | 预警文本生成 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供卧室/走廊夜间监控视频 URL 或文件需要分析时，默认触发本技能进行老年人夜间离床/徘徊识别 |\n| 🔎 明确分析意图 | 当用户明确提及离床、起夜、夜间起床、徘徊、夜游、卧室监控、夜间监护、养老院夜班、护士站、走失预警、跌倒风险等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看夜间离床历史报告、徘徊预警报告清单、夜间监护报告清单、查询历史离床记录、显示所有夜间离床报告、显示老人夜间监护诊断报告，查询夜间预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备夜间监控视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行夜间离床/徘徊识别 | 调用 `-m scripts.smyx_elderly_night_bed_exit_wandering_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地卧室/走廊夜间监控视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络夜间监控视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，老年人夜间监护场景默认 `other` | 按需填写 |\n| `--list` | 显示老年人夜间离床/徘徊历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_elderly_night_bed_exit_wandering_analysis.py`](scripts/smyx_elderly_night_bed_exit_wandering_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov 视频，最大 10MB；建议夜视模式、覆盖整夜时段 |\n| 🧑‍⚖️ 结果性质 | 预警结果仅作为护理参考，疑似跌倒/失踪请立即人工核实并采取紧急行动 |\n| 🔏 隐私合规 | 隐私合规：夜间卧室视频涉及个人隐私，使用前需取得被监护人或家属知情同意 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地夜间监控视频\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --input /path/to/night_room.mp4\n\n# 分析网络夜间监控视频\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --url https://example.com/night_room.mp4\n\n# 显示历史夜间监护报告/徘徊预警报告清单（自动触发关键词：查看夜间离床历史报告、徘徊预警报告清单等）\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --input night.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --input night.mp4 --output result.json\n```\n\nFile v1.0.9:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-elderly-night-bed-exit-wandering-analysis\",\n  \"version\": \"1.0.9\",\n  \"publishedAt\": 1786435834105\n}\n\nFile v1.0.9:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放老年人夜间离床时长与徘徊识别 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动老年人夜间离床/徘徊分析任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取分析结果与预警信息\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史夜间监护记录\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_ELDERLY_NIGHT_BED_EXIT_WANDERING_ANALYSIS` - 老年人夜间离床时长与徘徊识别\n\n## 输入约束\n\n- 推荐使用卧室固定摄像头夜视模式（红外/低照度），覆盖床铺与走廊出入口\n- 时间范围建议覆盖整夜（如 22:00 - 次日 07:00）\n- 关键观测对象：床铺区域、人体目标、活动轨迹\n\n## 关键检测事件\n\n- 离床时间点（bed_exit_time）\n- 上床时间点（bed_return_time）\n- 单次离床时长（exit_duration_sec）\n- 总离床时长（total_exit_duration_sec）\n- 走廊/房间内来回行走轨迹（wandering_track）\n- 徘徊持续时长（wandering_duration_sec）\n\n## 默认安全阈值（可由调用方覆盖）\n\n- 离床时长阈值：30 分钟（exit_duration_threshold_min）\n- 徘徊持续阈值：10 分钟（wandering_duration_threshold_min）\n\n## 输出字段（参考）\n\n- `bed_exit_events` - 离床事件列表（含开始/结束时间、持续秒数）\n- `total_exit_duration_min` - 当晚累计离床时长（分钟）\n- `wandering_detected` - 是否检测到徘徊行为\n- `wandering_duration_min` - 徘徊持续时长（分钟）\n- `alert_level` - 预警等级（none / info / warning / critical）\n- `alert_message` - 预警文本（如\"3 号床张爷爷离床已 45 分钟，请及时查看\"）\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\nUsing fixed cameras with infrared night vision in nursing-home or home bedrooms, the skill monitors elderly bed-exit status and nighttime activity trajectory, then outputs behavioral statistics and abnormal alerts.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[18072937735](https://clawhub.ai/user/18072937735)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal care teams, nursing-home operators, home-care providers, and developers use this skill to analyze nighttime bedroom or hallway video for bed-exit duration, wandering behavior, threshold-based alerts, and historical report lookup. The output is for care-monitoring reference and is not a medical diagnosis or a substitute for human verification.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Bedroom and hallway monitoring videos can contain highly sensitive personal information and are sent to Life Emergence cloud services for analysis.\n\nMitigation: Use only with informed consent from the monitored person or authorized family or care representatives, and confirm the cloud service's retention, access-control, and data-handling terms before submitting media or URLs.\n\nRisk: The skill may silently reuse or create an internal identity and query cloud report history tied to that identity.\n\nMitigation: Run it in a dedicated workspace, restrict access to local configuration and token files, and verify that account provisioning and historical report access match the deployment's privacy expectations.\n\nRisk: Alert outputs are care-monitoring references and may be incomplete or incorrect for urgent events such as suspected falls or wandering away.\n\nMitigation: Require human review of alerts and keep emergency response procedures outside the automated skill output.\n\n## Reference(s):\n\n- [Elderly Night Bed-Exit and Wandering API Documentation](references/api_doc.md)\n- [SMYX Analysis API Error Codes](skills/smyx_analysis/references/api_doc.md)\n- [Skill Demo](https://lifeemergence.com/sample.html)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, JSON, shell commands, guidance]\n\n**Output Format:** [Markdown and JSON-style structured analysis reports with alert text, report links, and optional Markdown tables for historical reports]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May include bed-exit events, total exit duration, wandering status and duration, alert level, alert message, recommendations, and cloud report links.]\n\n## Skill Version(s):\n\n1.0.9 (source: server release metadata; artifact frontmatter lists 1.0.8)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.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, 40650 bytes\n\nFiles: references/api_doc.md (2022b), scripts/__init__.py (60b), scripts/config.py (703b), scripts/config.yaml (3b), scripts/skill.py (591b), scripts/smyx_elderly_night_bed_exit_wandering_analysis.py (3628b), skill-card.md (2630b), SKILL.md (12122b), 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 (165b)\n\nFile v1.0.8:SKILL.md\n\n---\nname: \"smyx-elderly-night-bed-exit-wandering-analysis\"\ndescription: \"Using fixed cameras (infrared night vision) in nursing-home or home bedrooms, the system continuously monitors elderly bed-exit status and activity trajectory at night. | 通过养老院或居家卧室的固定摄像头（红外夜视），夜间连续监测老年人的离床状态和活动轨迹。输出异常预警，可联动护理人员手机或护士站大屏，防止老人走失、跌倒或发生意外。\"\nversion: \"1.0.8\"\nlicense: \"MIT-0\"\n---\n\n# 🛏️ Elderly Night Bed-Exit & Wandering Detection | 老年人夜间离床时长与徘徊识别\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **老年人夜间离床时长与徘徊识别** |\n| 🎯 核心目标 | 通过养老院或居家卧室的固定摄像头（红外夜视），夜间连续监测老年人的离床状态和活动轨迹。输出异常预警，可联动护理人员手机或护士站大屏，防止老人走失、跌倒或发生意外。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_NIGHT_BED_EXIT_WANDERING_ANALYSIS` |\n\nUsing fixed cameras (infrared night vision) in nursing-home or home bedrooms, the system continuously monitors elderly bed-exit status and activity trajectory at night. It identifies bed-exit start time, total bed-exit duration, whether the person repeatedly walks back and forth in the hallway or room (wandering), and judges whether preset safety thresholds (e.g., bed-exit > 30 min or wandering > 10 min) are exceeded. Abnormal alerts are pushed to caregivers' phones or the nurse-station big screen to prevent wandering away, falls, or accidents. Application scenarios: nursing homes, home-based elderly care, community day-care centers. The system runs automatically at night; when bed-exit lasts too long or repeated wandering occurs, it pushes alerts via app or care system (e.g., 'Grandpa Zhang in bed 3 has been out of bed for 45 minutes, please check in time'). Skill features: prolonged night bed-exit (e.g., fall after getting up) and wandering (e.g., night roaming by elders with cognitive impairment) are high-risk events in elderly care. AI real-time monitoring enables timely warnings, reduces accidents, and improves caregiving efficiency. Can be integrated into nursing-home management systems or smart-home security platforms.\n\n通过养老院或居家卧室的固定摄像头（红外夜视），夜间连续监测老年人的离床状态和活动轨迹。识别离床开始时间、离床总时长、是否在走廊或房间内反复来回走动（徘徊），并判断是否超过预设的安全阈值（如离床>30分钟或徘徊>10分钟）。输出异常预警，可联动护理人员手机或护士站大屏，防止老人走失、跌倒或发生意外。应用场景：养老院、居家养老、社区日间照料中心。系统在夜间自动运行，当老人离床时间过长或出现反复徘徊行为时，通过APP或护理系统推送提醒（如'3号床张爷爷离床已45分钟，请及时查看'）。技能特点：夜间离床时间过长（如老人下床后跌倒无法起身）和徘徊（如认知障碍老人夜间游荡）是养老院和居家养老中的高风险事件。通过AI实时监测，可及时预警，减少意外发生，提升护理效率。该技能可集成到养老院管理系统或智能家居安防平台。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人夜间行为安全 AI。你的任务是分析卧室或走廊摄像头的夜间视频（红外模式），检测老年人是否离开床铺，记录离床的总时长，并识别是否存在反复来回走动的徘徊行为。当离床时长超过设定阈值（如 30 分钟）或徘徊持续时间超过阈值（如 10 分钟）时，输出异常预警。不要提供医疗诊断或具体护理操作方案，仅输出行为统计与报警信息。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于夜间红外卧室/走廊监控视频，检测老年人离床事件、累计离床时长与徘徊行为，并按安全阈值输出预警\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 床铺区域分割 |\n| 2 | 人体检测与跟踪 |\n| 3 | 离床/上床事件识别 |\n| 4 | 离床时长统计 |\n| 5 | 活动轨迹分析 |\n| 6 | 徘徊识别（反复来回走动） |\n| 7 | 安全阈值判定（默认离床>30 分钟 / 徘徊>10 分钟 |\n| 8 | 可覆盖） |\n| 9 | 分级预警（none/info/warning/critical） |\n| 10 | 预警文本生成 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供卧室/走廊夜间监控视频 URL 或文件需要分析时，默认触发本技能进行老年人夜间离床/徘徊识别 |\n| 🔎 明确分析意图 | 当用户明确提及离床、起夜、夜间起床、徘徊、夜游、卧室监控、夜间监护、养老院夜班、护士站、走失预警、跌倒风险等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看夜间离床历史报告、徘徊预警报告清单、夜间监护报告清单、查询历史离床记录、显示所有夜间离床报告、显示老人夜间监护诊断报告，查询夜间预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备夜间监控视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行夜间离床/徘徊识别 | 调用 `-m scripts.smyx_elderly_night_bed_exit_wandering_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地卧室/走廊夜间监控视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络夜间监控视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，老年人夜间监护场景默认 `other` | 按需填写 |\n| `--list` | 显示老年人夜间离床/徘徊历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_elderly_night_bed_exit_wandering_analysis.py`](scripts/smyx_elderly_night_bed_exit_wandering_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov 视频，最大 10MB；建议夜视模式、覆盖整夜时段 |\n| 🧑‍⚖️ 结果性质 | 预警结果仅作为护理参考，疑似跌倒/失踪请立即人工核实并采取紧急行动 |\n| 🔏 隐私合规 | 隐私合规：夜间卧室视频涉及个人隐私，使用前需取得被监护人或家属知情同意 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地夜间监控视频\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --input /path/to/night_room.mp4\n\n# 分析网络夜间监控视频\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --url https://example.com/night_room.mp4\n\n# 显示历史夜间监护报告/徘徊预警报告清单（自动触发关键词：查看夜间离床历史报告、徘徊预警报告清单等）\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --input night.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --input night.mp4 --output result.json\n```\n\nFile v1.0.8:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-elderly-night-bed-exit-wandering-analysis\",\n  \"version\": \"1.0.8\",\n  \"publishedAt\": 1785993036181\n}\n\nFile v1.0.8:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放老年人夜间离床时长与徘徊识别 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动老年人夜间离床/徘徊分析任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取分析结果与预警信息\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史夜间监护记录\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_ELDERLY_NIGHT_BED_EXIT_WANDERING_ANALYSIS` - 老年人夜间离床时长与徘徊识别\n\n## 输入约束\n\n- 推荐使用卧室固定摄像头夜视模式（红外/低照度），覆盖床铺与走廊出入口\n- 时间范围建议覆盖整夜（如 22:00 - 次日 07:00）\n- 关键观测对象：床铺区域、人体目标、活动轨迹\n\n## 关键检测事件\n\n- 离床时间点（bed_exit_time）\n- 上床时间点（bed_return_time）\n- 单次离床时长（exit_duration_sec）\n- 总离床时长（total_exit_duration_sec）\n- 走廊/房间内来回行走轨迹（wandering_track）\n- 徘徊持续时长（wandering_duration_sec）\n\n## 默认安全阈值（可由调用方覆盖）\n\n- 离床时长阈值：30 分钟（exit_duration_threshold_min）\n- 徘徊持续阈值：10 分钟（wandering_duration_threshold_min）\n\n## 输出字段（参考）\n\n- `bed_exit_events` - 离床事件列表（含开始/结束时间、持续秒数）\n- `total_exit_duration_min` - 当晚累计离床时长（分钟）\n- `wandering_detected` - 是否检测到徘徊行为\n- `wandering_duration_min` - 徘徊持续时长（分钟）\n- `alert_level` - 预警等级（none / info / warning / critical）\n- `alert_message` - 预警文本（如\"3 号床张爷爷离床已 45 分钟，请及时查看\"）\n\n> 仅输出行为统计与预警信息，不提供医疗诊断或具体护理方案。\n\nFile v1.0.8:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.8:scripts/config.yaml\n\n{}\n\nFile v1.0.8:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.8:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.8:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.8:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: prod\n\nFile v1.0.8:skill-card.md\n\n## Description:\n\nUsing fixed cameras with infrared night vision in nursing-home or home bedrooms, this skill monitors elderly bed-exit status and night activity trajectories and produces abnormal alerts for prolonged bed exit or wandering.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[18072937735](https://clawhub.ai/user/18072937735)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal care teams, home-care users, and developers use this skill to analyze night camera video or video URLs for elderly bed-exit duration, wandering behavior, alert level, and report links. Outputs are care-reference behavior statistics and alerts, not medical diagnosis or specific care instructions.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill processes highly sensitive elder-care bedroom or hallway video and may send private files or URLs to configured cloud services.\n\nMitigation: Use only with appropriate consent from monitored residents or authorized caregivers, and verify the configured service's security, retention, export, and access controls before deployment.\n\nRisk: The skill may create or reuse an identity and store session tokens in a local workspace database.\n\nMitigation: Review local storage handling before installation, restrict workspace access, and clear stored tokens or reports according to the care organization's retention policy.\n\nRisk: Behavior alerts are care-reference signals and can be incomplete or incorrect.\n\nMitigation: Require human review of suspected bed-exit, wandering, fall, or missing-person situations before taking care actions.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/18072937735/skills/smyx-elderly-night-bed-exit-wandering-analysis)\n- [Elderly night bed-exit and wandering API documentation](references/api_doc.md)\n- [Skill demo](https://lifeemergence.com/sample.html)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, json, shell commands, guidance]\n\n**Output Format:** [Markdown and JSON analysis reports with alert text, report links, and optional saved output files]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May query cloud-hosted historical reports and return Markdown tables for report lists.]\n\n## Skill Version(s):\n\n1.0.8 (source: server release evidence and SKILL.md frontmatter)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.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, 40599 bytes\n\nFiles: references/api_doc.md (2022b), scripts/__init__.py (60b), scripts/config.py (703b), scripts/config.yaml (3b), scripts/skill.py (591b), scripts/smyx_elderly_night_bed_exit_wandering_analysis.py (3628b), skill-card.md (2575b), SKILL.md (12122b), 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 (165b)\n\nFile v1.0.7:SKILL.md\n\n---\nname: \"smyx-elderly-night-bed-exit-wandering-analysis\"\ndescription: \"Using fixed cameras (infrared night vision) in nursing-home or home bedrooms, the system continuously monitors elderly bed-exit status and activity trajectory at night. | 通过养老院或居家卧室的固定摄像头（红外夜视），夜间连续监测老年人的离床状态和活动轨迹。输出异常预警，可联动护理人员手机或护士站大屏，防止老人走失、跌倒或发生意外。\"\nversion: \"1.0.6\"\nlicense: \"MIT-0\"\n---\n\n# 🛏️ Elderly Night Bed-Exit & Wandering Detection | 老年人夜间离床时长与徘徊识别\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **老年人夜间离床时长与徘徊识别** |\n| 🎯 核心目标 | 通过养老院或居家卧室的固定摄像头（红外夜视），夜间连续监测老年人的离床状态和活动轨迹。输出异常预警，可联动护理人员手机或护士站大屏，防止老人走失、跌倒或发生意外。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_NIGHT_BED_EXIT_WANDERING_ANALYSIS` |\n\nUsing fixed cameras (infrared night vision) in nursing-home or home bedrooms, the system continuously monitors elderly bed-exit status and activity trajectory at night. It identifies bed-exit start time, total bed-exit duration, whether the person repeatedly walks back and forth in the hallway or room (wandering), and judges whether preset safety thresholds (e.g., bed-exit > 30 min or wandering > 10 min) are exceeded. Abnormal alerts are pushed to caregivers' phones or the nurse-station big screen to prevent wandering away, falls, or accidents. Application scenarios: nursing homes, home-based elderly care, community day-care centers. The system runs automatically at night; when bed-exit lasts too long or repeated wandering occurs, it pushes alerts via app or care system (e.g., 'Grandpa Zhang in bed 3 has been out of bed for 45 minutes, please check in time'). Skill features: prolonged night bed-exit (e.g., fall after getting up) and wandering (e.g., night roaming by elders with cognitive impairment) are high-risk events in elderly care. AI real-time monitoring enables timely warnings, reduces accidents, and improves caregiving efficiency. Can be integrated into nursing-home management systems or smart-home security platforms.\n\n通过养老院或居家卧室的固定摄像头（红外夜视），夜间连续监测老年人的离床状态和活动轨迹。识别离床开始时间、离床总时长、是否在走廊或房间内反复来回走动（徘徊），并判断是否超过预设的安全阈值（如离床>30分钟或徘徊>10分钟）。输出异常预警，可联动护理人员手机或护士站大屏，防止老人走失、跌倒或发生意外。应用场景：养老院、居家养老、社区日间照料中心。系统在夜间自动运行，当老人离床时间过长或出现反复徘徊行为时，通过APP或护理系统推送提醒（如'3号床张爷爷离床已45分钟，请及时查看'）。技能特点：夜间离床时间过长（如老人下床后跌倒无法起身）和徘徊（如认知障碍老人夜间游荡）是养老院和居家养老中的高风险事件。通过AI实时监测，可及时预警，减少意外发生，提升护理效率。该技能可集成到养老院管理系统或智能家居安防平台。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人夜间行为安全 AI。你的任务是分析卧室或走廊摄像头的夜间视频（红外模式），检测老年人是否离开床铺，记录离床的总时长，并识别是否存在反复来回走动的徘徊行为。当离床时长超过设定阈值（如 30 分钟）或徘徊持续时间超过阈值（如 10 分钟）时，输出异常预警。不要提供医疗诊断或具体护理操作方案，仅输出行为统计与报警信息。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于夜间红外卧室/走廊监控视频，检测老年人离床事件、累计离床时长与徘徊行为，并按安全阈值输出预警\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 床铺区域分割 |\n| 2 | 人体检测与跟踪 |\n| 3 | 离床/上床事件识别 |\n| 4 | 离床时长统计 |\n| 5 | 活动轨迹分析 |\n| 6 | 徘徊识别（反复来回走动） |\n| 7 | 安全阈值判定（默认离床>30 分钟 / 徘徊>10 分钟 |\n| 8 | 可覆盖） |\n| 9 | 分级预警（none/info/warning/critical） |\n| 10 | 预警文本生成 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供卧室/走廊夜间监控视频 URL 或文件需要分析时，默认触发本技能进行老年人夜间离床/徘徊识别 |\n| 🔎 明确分析意图 | 当用户明确提及离床、起夜、夜间起床、徘徊、夜游、卧室监控、夜间监护、养老院夜班、护士站、走失预警、跌倒风险等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看夜间离床历史报告、徘徊预警报告清单、夜间监护报告清单、查询历史离床记录、显示所有夜间离床报告、显示老人夜间监护诊断报告，查询夜间预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备夜间监控视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行夜间离床/徘徊识别 | 调用 `-m scripts.smyx_elderly_night_bed_exit_wandering_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地卧室/走廊夜间监控视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络夜间监控视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，老年人夜间监护场景默认 `other` | 按需填写 |\n| `--list` | 显示老年人夜间离床/徘徊历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_elderly_night_bed_exit_wandering_analysis.py`](scripts/smyx_elderly_night_bed_exit_wandering_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov 视频，最大 10MB；建议夜视模式、覆盖整夜时段 |\n| 🧑‍⚖️ 结果性质 | 预警结果仅作为护理参考，疑似跌倒/失踪请立即人工核实并采取紧急行动 |\n| 🔏 隐私合规 | 隐私合规：夜间卧室视频涉及个人隐私，使用前需取得被监护人或家属知情同意 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地夜间监控视频\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --input /path/to/night_room.mp4\n\n# 分析网络夜间监控视频\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --url https://example.com/night_room.mp4\n\n# 显示历史夜间监护报告/徘徊预警报告清单（自动触发关键词：查看夜间离床历史报告、徘徊预警报告清单等）\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --input night.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --input night.mp4 --output result.json\n```\n\nFile v1.0.7:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-elderly-night-bed-exit-wandering-analysis\",\n  \"version\": \"1.0.7\",\n  \"publishedAt\": 1785561211656\n}\n\nFile v1.0.7:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放老年人夜间离床时长与徘徊识别 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动老年人夜间离床/徘徊分析任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取分析结果与预警信息\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史夜间监护记录\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_ELDERLY_NIGHT_BED_EXIT_WANDERING_ANALYSIS` - 老年人夜间离床时长与徘徊识别\n\n## 输入约束\n\n- 推荐使用卧室固定摄像头夜视模式（红外/低照度），覆盖床铺与走廊出入口\n- 时间范围建议覆盖整夜（如 22:00 - 次日 07:00）\n- 关键观测对象：床铺区域、人体目标、活动轨迹\n\n## 关键检测事件\n\n- 离床时间点（bed_exit_time）\n- 上床时间点（bed_return_time）\n- 单次离床时长（exit_duration_sec）\n- 总离床时长（total_exit_duration_sec）\n- 走廊/房间内来回行走轨迹（wandering_track）\n- 徘徊持续时长（wandering_duration_sec）\n\n## 默认安全阈值（可由调用方覆盖）\n\n- 离床时长阈值：30 分钟（exit_duration_threshold_min）\n- 徘徊持续阈值：10 分钟（wandering_duration_threshold_min）\n\n## 输出字段（参考）\n\n- `bed_exit_events` - 离床事件列表（含开始/结束时间、持续秒数）\n- `total_exit_duration_min` - 当晚累计离床时长（分钟）\n- `wandering_detected` - 是否检测到徘徊行为\n- `wandering_duration_min` - 徘徊持续时长（分钟）\n- `alert_level` - 预警等级（none / info / warning / critical）\n- `alert_message` - 预警文本（如\"3 号床张爷爷离床已 45 分钟，请及时查看\"）\n\n> 仅输出行为统计与预警信息，不提供医疗诊断或具体护理方案。\n\nFile v1.0.7:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.7:scripts/config.yaml\n\n{}\n\nFile v1.0.7:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.7:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.7:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.7:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: prod\n\nFile v1.0.7:skill-card.md\n\n## Description: <br>\nUses fixed infrared bedroom or hallway camera video to detect elder bed-exit duration, wandering behavior, and threshold-based alerts for home or nursing-home care. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[18072937735](https://clawhub.ai/user/18072937735) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nCare teams, family caregivers, and developers integrating elder-care monitoring workflows use this skill to analyze night-vision bedroom or hallway videos and generate behavior statistics, alert levels, and report links. Results are for care reference and should be confirmed by humans in suspected fall, wandering, or emergency situations. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Sensitive bedroom video, report data, and history lookups may be sent to cloud APIs. <br>\nMitigation: Use only authorized camera or video sources with informed consent, and confirm that cloud processing and report-retention policies are acceptable for the care setting. <br>\nRisk: The skill may silently create or reuse identities and store tokens locally. <br>\nMitigation: Review identity handling and local token storage before deployment; run in a controlled environment with an approved token cleanup and retention process. <br>\nRisk: Alerts and reports are healthcare-adjacent care signals, not medical diagnoses or emergency response guarantees. <br>\nMitigation: Require human review of suspected fall, wandering, or emergency events and keep escalation procedures outside the skill. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/18072937735/skills/smyx-elderly-night-bed-exit-wandering-analysis) <br>\n- [API interface reference](artifact/references/api_doc.md) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Text, Markdown, JSON, Guidance] <br>\n**Output Format:** [Markdown text with structured JSON report content and report links] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May save output to a file when an output path is provided; history listing returns cloud report records.] <br>\n\n## Skill Version(s): <br>\n1.0.7 (source: server release evidence; artifact frontmatter reports 1.0.6) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v1.0.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, 40557 bytes\n\nFiles: references/api_doc.md (2022b), scripts/__init__.py (60b), scripts/config.py (703b), scripts/config.yaml (3b), scripts/skill.py (591b), scripts/smyx_elderly_night_bed_exit_wandering_analysis.py (3628b), skill-card.md (2447b), SKILL.md (12122b), 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 (165b)\n\nFile v1.0.6:SKILL.md\n\n---\nname: \"smyx-elderly-night-bed-exit-wandering-analysis\"\ndescription: \"Using fixed cameras (infrared night vision) in nursing-home or home bedrooms, the system continuously monitors elderly bed-exit status and activity trajectory at night. | 通过养老院或居家卧室的固定摄像头（红外夜视），夜间连续监测老年人的离床状态和活动轨迹。输出异常预警，可联动护理人员手机或护士站大屏，防止老人走失、跌倒或发生意外。\"\nversion: \"1.0.4\"\nlicense: \"MIT-0\"\n---\n\n# 🛏️ Elderly Night Bed-Exit & Wandering Detection | 老年人夜间离床时长与徘徊识别\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **老年人夜间离床时长与徘徊识别** |\n| 🎯 核心目标 | 通过养老院或居家卧室的固定摄像头（红外夜视），夜间连续监测老年人的离床状态和活动轨迹。输出异常预警，可联动护理人员手机或护士站大屏，防止老人走失、跌倒或发生意外。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_NIGHT_BED_EXIT_WANDERING_ANALYSIS` |\n\nUsing fixed cameras (infrared night vision) in nursing-home or home bedrooms, the system continuously monitors elderly bed-exit status and activity trajectory at night. It identifies bed-exit start time, total bed-exit duration, whether the person repeatedly walks back and forth in the hallway or room (wandering), and judges whether preset safety thresholds (e.g., bed-exit > 30 min or wandering > 10 min) are exceeded. Abnormal alerts are pushed to caregivers' phones or the nurse-station big screen to prevent wandering away, falls, or accidents. Application scenarios: nursing homes, home-based elderly care, community day-care centers. The system runs automatically at night; when bed-exit lasts too long or repeated wandering occurs, it pushes alerts via app or care system (e.g., 'Grandpa Zhang in bed 3 has been out of bed for 45 minutes, please check in time'). Skill features: prolonged night bed-exit (e.g., fall after getting up) and wandering (e.g., night roaming by elders with cognitive impairment) are high-risk events in elderly care. AI real-time monitoring enables timely warnings, reduces accidents, and improves caregiving efficiency. Can be integrated into nursing-home management systems or smart-home security platforms.\n\n通过养老院或居家卧室的固定摄像头（红外夜视），夜间连续监测老年人的离床状态和活动轨迹。识别离床开始时间、离床总时长、是否在走廊或房间内反复来回走动（徘徊），并判断是否超过预设的安全阈值（如离床>30分钟或徘徊>10分钟）。输出异常预警，可联动护理人员手机或护士站大屏，防止老人走失、跌倒或发生意外。应用场景：养老院、居家养老、社区日间照料中心。系统在夜间自动运行，当老人离床时间过长或出现反复徘徊行为时，通过APP或护理系统推送提醒（如'3号床张爷爷离床已45分钟，请及时查看'）。技能特点：夜间离床时间过长（如老人下床后跌倒无法起身）和徘徊（如认知障碍老人夜间游荡）是养老院和居家养老中的高风险事件。通过AI实时监测，可及时预警，减少意外发生，提升护理效率。该技能可集成到养老院管理系统或智能家居安防平台。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人夜间行为安全 AI。你的任务是分析卧室或走廊摄像头的夜间视频（红外模式），检测老年人是否离开床铺，记录离床的总时长，并识别是否存在反复来回走动的徘徊行为。当离床时长超过设定阈值（如 30 分钟）或徘徊持续时间超过阈值（如 10 分钟）时，输出异常预警。不要提供医疗诊断或具体护理操作方案，仅输出行为统计与报警信息。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于夜间红外卧室/走廊监控视频，检测老年人离床事件、累计离床时长与徘徊行为，并按安全阈值输出预警\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 床铺区域分割 |\n| 2 | 人体检测与跟踪 |\n| 3 | 离床/上床事件识别 |\n| 4 | 离床时长统计 |\n| 5 | 活动轨迹分析 |\n| 6 | 徘徊识别（反复来回走动） |\n| 7 | 安全阈值判定（默认离床>30 分钟 / 徘徊>10 分钟 |\n| 8 | 可覆盖） |\n| 9 | 分级预警（none/info/warning/critical） |\n| 10 | 预警文本生成 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供卧室/走廊夜间监控视频 URL 或文件需要分析时，默认触发本技能进行老年人夜间离床/徘徊识别 |\n| 🔎 明确分析意图 | 当用户明确提及离床、起夜、夜间起床、徘徊、夜游、卧室监控、夜间监护、养老院夜班、护士站、走失预警、跌倒风险等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看夜间离床历史报告、徘徊预警报告清单、夜间监护报告清单、查询历史离床记录、显示所有夜间离床报告、显示老人夜间监护诊断报告，查询夜间预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备夜间监控视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行夜间离床/徘徊识别 | 调用 `-m scripts.smyx_elderly_night_bed_exit_wandering_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地卧室/走廊夜间监控视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络夜间监控视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，老年人夜间监护场景默认 `other` | 按需填写 |\n| `--list` | 显示老年人夜间离床/徘徊历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_elderly_night_bed_exit_wandering_analysis.py`](scripts/smyx_elderly_night_bed_exit_wandering_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov 视频，最大 10MB；建议夜视模式、覆盖整夜时段 |\n| 🧑‍⚖️ 结果性质 | 预警结果仅作为护理参考，疑似跌倒/失踪请立即人工核实并采取紧急行动 |\n| 🔏 隐私合规 | 隐私合规：夜间卧室视频涉及个人隐私，使用前需取得被监护人或家属知情同意 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地夜间监控视频\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --input /path/to/night_room.mp4\n\n# 分析网络夜间监控视频\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --url https://example.com/night_room.mp4\n\n# 显示历史夜间监护报告/徘徊预警报告清单（自动触发关键词：查看夜间离床历史报告、徘徊预警报告清单等）\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --input night.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --input night.mp4 --output result.json\n```\n\nFile v1.0.6:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-elderly-night-bed-exit-wandering-analysis\",\n  \"version\": \"1.0.6\",\n  \"publishedAt\": 1784056833866\n}\n\nFile v1.0.6:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放老年人夜间离床时长与徘徊识别 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动老年人夜间离床/徘徊分析任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取分析结果与预警信息\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史夜间监护记录\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_ELDERLY_NIGHT_BED_EXIT_WANDERING_ANALYSIS` - 老年人夜间离床时长与徘徊识别\n\n## 输入约束\n\n- 推荐使用卧室固定摄像头夜视模式（红外/低照度），覆盖床铺与走廊出入口\n- 时间范围建议覆盖整夜（如 22:00 - 次日 07:00）\n- 关键观测对象：床铺区域、人体目标、活动轨迹\n\n## 关键检测事件\n\n- 离床时间点（bed_exit_time）\n- 上床时间点（bed_return_time）\n- 单次离床时长（exit_duration_sec）\n- 总离床时长（total_exit_duration_sec）\n- 走廊/房间内来回行走轨迹（wandering_track）\n- 徘徊持续时长（wandering_duration_sec）\n\n## 默认安全阈值（可由调用方覆盖）\n\n- 离床时长阈值：30 分钟（exit_duration_threshold_min）\n- 徘徊持续阈值：10 分钟（wandering_duration_threshold_min）\n\n## 输出字段（参考）\n\n- `bed_exit_events` - 离床事件列表（含开始/结束时间、持续秒数）\n- `total_exit_duration_min` - 当晚累计离床时长（分钟）\n- `wandering_detected` - 是否检测到徘徊行为\n- `wandering_duration_min` - 徘徊持续时长（分钟）\n- `alert_level` - 预警等级（none / info / warning / critical）\n- `alert_message` - 预警文本（如\"3 号床张爷爷离床已 45 分钟，请及时查看\"）\n\n> 仅输出行为统计与预警信息，不提供医疗诊断或具体护理方案。\n\nFile v1.0.6:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.6:scripts/config.yaml\n\n{}\n\nFile v1.0.6:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.6:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.6:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.6:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: prod\n\nFile v1.0.6:skill-card.md\n\n## Description: <br>\nAnalyzes night-vision bedroom or hallway media to detect elderly bed-exit duration, wandering behavior, and threshold-based alert information. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[18072937735](https://clawhub.ai/user/18072937735) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nCaregiving teams, nursing-home operators, and smart-home integrators use this skill to analyze authorized night-bedroom or hallway media for prolonged bed exits and wandering alerts. The skill outputs behavioral statistics and alerts, not medical diagnoses or care instructions. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Sensitive night-bedroom video or URLs may be processed by the configured remote service. <br>\nMitigation: Use only authorized media with informed consent from monitored people or guardians, and confirm the remote service is appropriate for the deployment. <br>\nRisk: The skill may silently create or reuse an account identity and store access tokens in the workspace. <br>\nMitigation: Run it only in controlled workspaces, restrict access to generated tokens and reports, and rotate or remove stored credentials when access is no longer needed. <br>\nRisk: Outputs are behavioral alerts and may be incorrect or incomplete for urgent safety events. <br>\nMitigation: Require caregiver review and immediate human verification for suspected falls, wandering away, or other emergencies. <br>\n\n\n## Reference(s): <br>\n- [API 接口文档](references/api_doc.md) <br>\n- [Shared analysis API documentation](skills/smyx_analysis/references/api_doc.md) <br>\n- [Skill demo](https://lifeemergence.com/sample.html) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, json] <br>\n**Output Format:** [Markdown report text with JSON analysis content and optional report link] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Can save the report text to a caller-specified output file.] <br>\n\n## Skill Version(s): <br>\n1.0.6 (source: server release metadata; artifact frontmatter lists 1.0.4) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v1.0.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, 40717 bytes\n\nFiles: references/api_doc.md (2022b), scripts/__init__.py (60b), scripts/config.py (703b), scripts/config.yaml (3b), scripts/skill.py (591b), scripts/smyx_elderly_night_bed_exit_wandering_analysis.py (3628b), skill-card.md (2896b), SKILL.md (12122b), 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 (165b)\n\nFile v1.0.5:SKILL.md\n\n---\nname: \"smyx-elderly-night-bed-exit-wandering-analysis\"\ndescription: \"Using fixed cameras (infrared night vision) in nursing-home or home bedrooms, the system continuously monitors elderly bed-exit status and activity trajectory at night. | 通过养老院或居家卧室的固定摄像头（红外夜视），夜间连续监测老年人的离床状态和活动轨迹。输出异常预警，可联动护理人员手机或护士站大屏，防止老人走失、跌倒或发生意外。\"\nversion: \"1.0.4\"\nlicense: \"MIT-0\"\n---\n\n# 🛏️ Elderly Night Bed-Exit & Wandering Detection | 老年人夜间离床时长与徘徊识别\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **老年人夜间离床时长与徘徊识别** |\n| 🎯 核心目标 | 通过养老院或居家卧室的固定摄像头（红外夜视），夜间连续监测老年人的离床状态和活动轨迹。输出异常预警，可联动护理人员手机或护士站大屏，防止老人走失、跌倒或发生意外。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_NIGHT_BED_EXIT_WANDERING_ANALYSIS` |\n\nUsing fixed cameras (infrared night vision) in nursing-home or home bedrooms, the system continuously monitors elderly bed-exit status and activity trajectory at night. It identifies bed-exit start time, total bed-exit duration, whether the person repeatedly walks back and forth in the hallway or room (wandering), and judges whether preset safety thresholds (e.g., bed-exit > 30 min or wandering > 10 min) are exceeded. Abnormal alerts are pushed to caregivers' phones or the nurse-station big screen to prevent wandering away, falls, or accidents. Application scenarios: nursing homes, home-based elderly care, community day-care centers. The system runs automatically at night; when bed-exit lasts too long or repeated wandering occurs, it pushes alerts via app or care system (e.g., 'Grandpa Zhang in bed 3 has been out of bed for 45 minutes, please check in time'). Skill features: prolonged night bed-exit (e.g., fall after getting up) and wandering (e.g., night roaming by elders with cognitive impairment) are high-risk events in elderly care. AI real-time monitoring enables timely warnings, reduces accidents, and improves caregiving efficiency. Can be integrated into nursing-home management systems or smart-home security platforms.\n\n通过养老院或居家卧室的固定摄像头（红外夜视），夜间连续监测老年人的离床状态和活动轨迹。识别离床开始时间、离床总时长、是否在走廊或房间内反复来回走动（徘徊），并判断是否超过预设的安全阈值（如离床>30分钟或徘徊>10分钟）。输出异常预警，可联动护理人员手机或护士站大屏，防止老人走失、跌倒或发生意外。应用场景：养老院、居家养老、社区日间照料中心。系统在夜间自动运行，当老人离床时间过长或出现反复徘徊行为时，通过APP或护理系统推送提醒（如'3号床张爷爷离床已45分钟，请及时查看'）。技能特点：夜间离床时间过长（如老人下床后跌倒无法起身）和徘徊（如认知障碍老人夜间游荡）是养老院和居家养老中的高风险事件。通过AI实时监测，可及时预警，减少意外发生，提升护理效率。该技能可集成到养老院管理系统或智能家居安防平台。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人夜间行为安全 AI。你的任务是分析卧室或走廊摄像头的夜间视频（红外模式），检测老年人是否离开床铺，记录离床的总时长，并识别是否存在反复来回走动的徘徊行为。当离床时长超过设定阈值（如 30 分钟）或徘徊持续时间超过阈值（如 10 分钟）时，输出异常预警。不要提供医疗诊断或具体护理操作方案，仅输出行为统计与报警信息。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于夜间红外卧室/走廊监控视频，检测老年人离床事件、累计离床时长与徘徊行为，并按安全阈值输出预警\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 床铺区域分割 |\n| 2 | 人体检测与跟踪 |\n| 3 | 离床/上床事件识别 |\n| 4 | 离床时长统计 |\n| 5 | 活动轨迹分析 |\n| 6 | 徘徊识别（反复来回走动） |\n| 7 | 安全阈值判定（默认离床>30 分钟 / 徘徊>10 分钟 |\n| 8 | 可覆盖） |\n| 9 | 分级预警（none/info/warning/critical） |\n| 10 | 预警文本生成 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供卧室/走廊夜间监控视频 URL 或文件需要分析时，默认触发本技能进行老年人夜间离床/徘徊识别 |\n| 🔎 明确分析意图 | 当用户明确提及离床、起夜、夜间起床、徘徊、夜游、卧室监控、夜间监护、养老院夜班、护士站、走失预警、跌倒风险等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看夜间离床历史报告、徘徊预警报告清单、夜间监护报告清单、查询历史离床记录、显示所有夜间离床报告、显示老人夜间监护诊断报告，查询夜间预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备夜间监控视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行夜间离床/徘徊识别 | 调用 `-m scripts.smyx_elderly_night_bed_exit_wandering_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地卧室/走廊夜间监控视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络夜间监控视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，老年人夜间监护场景默认 `other` | 按需填写 |\n| `--list` | 显示老年人夜间离床/徘徊历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_elderly_night_bed_exit_wandering_analysis.py`](scripts/smyx_elderly_night_bed_exit_wandering_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov 视频，最大 10MB；建议夜视模式、覆盖整夜时段 |\n| 🧑‍⚖️ 结果性质 | 预警结果仅作为护理参考，疑似跌倒/失踪请立即人工核实并采取紧急行动 |\n| 🔏 隐私合规 | 隐私合规：夜间卧室视频涉及个人隐私，使用前需取得被监护人或家属知情同意 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地夜间监控视频\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --input /path/to/night_room.mp4\n\n# 分析网络夜间监控视频\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --url https://example.com/night_room.mp4\n\n# 显示历史夜间监护报告/徘徊预警报告清单（自动触发关键词：查看夜间离床历史报告、徘徊预警报告清单等）\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --input night.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --input night.mp4 --output result.json\n```\n\nFile v1.0.5:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-elderly-night-bed-exit-wandering-analysis\",\n  \"version\": \"1.0.5\",\n  \"publishedAt\": 1783683148417\n}\n\nFile v1.0.5:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放老年人夜间离床时长与徘徊识别 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动老年人夜间离床/徘徊分析任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取分析结果与预警信息\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史夜间监护记录\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_ELDERLY_NIGHT_BED_EXIT_WANDERING_ANALYSIS` - 老年人夜间离床时长与徘徊识别\n\n## 输入约束\n\n- 推荐使用卧室固定摄像头夜视模式（红外/低照度），覆盖床铺与走廊出入口\n- 时间范围建议覆盖整夜（如 22:00 - 次日 07:00）\n- 关键观测对象：床铺区域、人体目标、活动轨迹\n\n## 关键检测事件\n\n- 离床时间点（bed_exit_time）\n- 上床时间点（bed_return_time）\n- 单次离床时长（exit_duration_sec）\n- 总离床时长（total_exit_duration_sec）\n- 走廊/房间内来回行走轨迹（wandering_track）\n- 徘徊持续时长（wandering_duration_sec）\n\n## 默认安全阈值（可由调用方覆盖）\n\n- 离床时长阈值：30 分钟（exit_duration_threshold_min）\n- 徘徊持续阈值：10 分钟（wandering_duration_threshold_min）\n\n## 输出字段（参考）\n\n- `bed_exit_events` - 离床事件列表（含开始/结束时间、持续秒数）\n- `total_exit_duration_min` - 当晚累计离床时长（分钟）\n- `wandering_detected` - 是否检测到徘徊行为\n- `wandering_duration_min` - 徘徊持续时长（分钟）\n- `alert_level` - 预警等级（none / info / warning / critical）\n- `alert_message` - 预警文本（如\"3 号床张爷爷离床已 45 分钟，请及时查看\"）\n\n> 仅输出行为统计与预警信息，不提供医疗诊断或具体护理方案。\n\nFile v1.0.5:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.5:scripts/config.yaml\n\n{}\n\nFile v1.0.5:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.5:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.5:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.5:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: prod\n\nFile v1.0.5:skill-card.md\n\n## Description: <br>\nUsing fixed cameras with infrared night vision, this skill analyzes nursing-home or home bedroom and hallway media for elderly night bed-exit duration, wandering behavior, and threshold-based alerts. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[18072937735](https://clawhub.ai/user/18072937735) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nExternal caregivers, elder-care operators, and developers use this skill to analyze night-vision bedroom or hallway videos for bed-exit events, cumulative bed-exit duration, wandering behavior, and alert levels. Results are behavior statistics and warnings for human follow-up, not medical diagnosis or care instructions. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill may send sensitive elder-care bedroom or hallway videos and report queries to an external service. <br>\nMitigation: Use only with consent from the monitored person or their legal representative, minimize uploaded media, and confirm the external service is approved for the deployment environment. <br>\nRisk: The local workspace data directory may contain reusable identity or authentication tokens. <br>\nMitigation: Treat local data as sensitive, restrict filesystem access, avoid sharing generated logs or caches, and rotate credentials if local data is exposed. <br>\nRisk: The security verdict is suspicious because the skill silently manages account identity, uploads sensitive footage, retrieves historical reports, and stores tokens locally. <br>\nMitigation: Review before installing, run in a controlled environment, and verify the identity, storage, and upload behavior against organizational privacy requirements. <br>\n\n\n## Reference(s): <br>\n- [API interface documentation](references/api_doc.md) <br>\n- [Skill demo](https://lifeemergence.com/sample.html) <br>\n- [ClawHub skill page](https://clawhub.ai/18072937735/skills/smyx-elderly-night-bed-exit-wandering-analysis) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Analysis, API Calls, Markdown, JSON, Files, Shell commands, Guidance] <br>\n**Output Format:** [Markdown and JSON analysis reports with alert text, report links, and optional saved result files] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Outputs may include structured bed-exit events, total duration, wandering status, alert level, alert message, history tables, and report links.] <br>\n\n## Skill Version(s): <br>\n1.0.5 (source: ClawHub release evidence; artifact frontmatter reports 1.0.4) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v1.0.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","readmeExcerpt":"Skill: Infant Blanket Kick Detection | 老年人夜间离床时长与徘徊识别 Owner: 18072937735 Summary: Using fixed cameras (infrared night vision) in nursing-home or home bedrooms, the system continuously monitors elderly bed-exit status and activity trajectory at night. | 通过养老院或居家卧室的固定摄像头（红外夜视），夜间连续监测老年人的离床状态和活动轨迹。输出异常预警，可联动护理人员手机或护士站大屏，防止老人走失、跌倒或发生意外。 Tags: latest:1.0.14 Version history: v1.0.14 | 2026-09-28T18:45:33.981Z | auto - Remo","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"python -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --list"},{"language":"text","snippet":"requests>=2.28.0"},{"language":"bash","snippet":"# 分析本地夜间监控视频\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --input /path/to/night_room.mp4\n\n# 分析网络夜间监控视频\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --url https://example.com/night_room.mp4\n\n# 显示历史夜间监护报告/徘徊预警报告清单（自动触发关键词：查看夜间离床历史报告、徘徊预警报告清单等）\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --input night.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --input night.mp4 --output result.json"},{"language":"bash","snippet":"python -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --list"},{"language":"text","snippet":"requests>=2.28.0"},{"language":"bash","snippet":"# 分析本地夜间监控视频\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --input /path/to/night_room.mp4\n\n# 分析网络夜间监控视频\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --url https://example.com/night_room.mp4\n\n# 显示历史夜间监护报告/徘徊预警报告清单（自动触发关键词：查看夜间离床历史报告、徘徊预警报告清单等）\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --input night.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_night_bed_exit_wandering_analysis --input night.mp4 --output result.json"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: \"smyx-elderly-night-bed-exit-wandering-analysis\"\ndescription: \"Using fixed cameras (infrared night vision) in nursing-home or home bedrooms, the system continuously monitors elderly bed-exit status and activity trajectory at night. | 通过养老院或居家卧室的固定摄像头（红外夜视），夜间连续监测老年人的离床状态和活动轨迹。输出异常预警，可联动护理人员手机或护士站大屏，防止老人走失、跌倒或发生意外。\"\nversion: \"1.0.15\"\nlicense: \"MIT-0\"\n---\n\n# 🛏️ Elderly Night Bed-Exit & Wandering Detection | 老年人夜间离床时长与徘徊识别\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **老年人夜间离床时长与徘徊识别** |\n| 🎯 核心目标 | 通过养老院或居家卧室的固定摄像头（红外夜视），夜间连续监测老年人的离床状态和活动轨迹。输出异常预警，可联动护理人员手机或护士站大屏，防止老人走失、跌倒或发生意外。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_NIGHT_BED_EXIT_WANDERING_ANALYSIS` |\n\nUsing fixed cameras (infrared night vision) in nursing-home or home bedrooms, the system continuously monitors elderly bed-exit status and activity trajectory at night. It identifies bed-exit start time, total bed-exit duration, whether the person repeatedly walks back and forth in the hallway or room (wandering), and judges whether preset safety thresholds (e.g., bed-exit > 30 min or wandering > 10 min) are exceeded. Abnormal alerts are pushed to caregivers' phones or the nurse-station big screen to prevent wandering away, falls, or accidents. Application scenarios: nursing homes, home-based elderly care, community day-care centers. The system runs automatically at night; when bed-exit lasts too long or repeated wandering occurs, it pushes alerts via app or care system (e.g., 'Grandpa Zhang in bed 3 has been out of bed for 45 minutes, please check in time'). Skill features: prolonged night bed-exit (e.g., fall after getting up) and wandering (e.g., night roaming by elders with cognitive impairment) are high-risk events in elderly care. AI real-time monitoring enables timely warnings, reduces accidents, and improves caregiving efficiency. Can be integrated into nursing-home management systems or smart-home security platforms.\n\n通过养老院或居家卧室的固定摄像头（红外夜视），夜间连续监测老年人的离床状态和活动轨迹。识别离床开始时间、离床总时长、是否在走廊或房间内反复来回走动（徘徊），并判断是否超过预设的安全阈值（如离床>30分钟或徘徊>10分钟）。输出异常预警，可联动护理人员手机或护士站大屏，防止老人走失、跌倒或发生意外。应用场景：养老院、居家养老、社区日间照料中心。系统在夜间自动运行，当老人离床时间过长或出现反复徘徊行为时，通过APP或护理系统推送提醒（如'3号床张爷爷离床已45分钟，请及时查看'）。技能特点：夜间离床时间过长（如老人下床后跌倒无法起身）和徘徊（如认知障碍老人夜间游荡）是养老院和居家养老中的高风险事件。通过AI实时监测，可及时预警，减少意外发生，提升护理效率。该技能可集成到养老院管理系统或智能家居安防平台。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人夜间行为安全 AI。你的任务是分析卧室或走廊摄像头的夜间视频（红外模式），检测老年人是否离开床铺，记录离床的总时长，并识别是否存在反复来回走动的徘徊行为。当离床时长超过设定阈值（如 30 分钟）或徘徊持续时间超过阈值（如 10 分钟）时，输出异常预警。不要提供医疗诊断或具体护理操作方案，仅输出行为统计与报警信息。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于夜间红外卧室/走廊监控视频，检测老年人离床事件、累计离床时长与徘徊行为，并按安全阈值输出预警\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 床铺区域分割 |\n| 2 | 人体检测与跟踪 |\n| 3 | 离床/上床事件识别 |\n| 4 | 离床时长统计 |\n| 5 | 活动轨迹分析 |\n| 6 | 徘徊识别（反复来回走动） |\n| 7 | 安全阈值判定（默认离床>30 分钟 / 徘徊>10 分钟 |\n| 8 | 可覆盖） |\n| 9 | 分级"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-elderly-night-bed-exit-wandering-analysis\",\n  \"version\": \"1.0.14\",\n  \"publishedAt\": 1790621133981\n}"},{"path":"references/api_doc.md","content":"# API 接口文档\n\n此处用于存放老年人夜间离床时长与徘徊识别 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动老年人夜间离床/徘徊分析任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取分析结果与预警信息\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史夜间监护记录\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_ELDERLY_NIGHT_BED_EXIT_WANDERING_ANALYSIS` - 老年人夜间离床时长与徘徊识别\n\n## 输入约束\n\n- 推荐使用卧室固定摄像头夜视模式（红外/低照度），覆盖床铺与走廊出入口\n- 时间范围建议覆盖整夜（如 22:00 - 次日 07:00）\n- 关键观测对象：床铺区域、人体目标、活动轨迹\n\n## 关键检测事件\n\n- 离床时间点（bed_exit_time）\n- 上床时间点（bed_return_time）\n- 单次离床时长（exit_duration_sec）\n- 总离床时长（total_exit_duration_sec）\n- 走廊/房间内来回行走轨迹（wandering_track）\n- 徘徊持续时长（wandering_duration_sec）\n\n## 默认安全阈值（可由调用方覆盖）\n\n- 离床时长阈值：30 分钟（exit_duration_threshold_min）\n- 徘徊持续阈值：10 分钟（wandering_duration_threshold_min）\n\n## 输出字段（参考）\n\n- `bed_exit_events` - 离床事件列表（含开始/结束时间、持续秒数）\n- `total_exit_duration_min` - 当晚累计离床时长（分钟）\n- `wandering_detected` - 是否检测到徘徊行为\n- `wandering_duration_min` - 徘徊持续时长（分钟）\n- `alert_level` - 预警等级（none / info / warning / critical）\n- `alert_message` - 预警文本（如\"3 号床张爷爷离床已 45 分钟，请及时查看\"）\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":"Using fixed cameras (infrared night vision) in nursing-home or home bedrooms, the system continuously monitors elderly bed-exit status and activity trajectory at night. | 通过养老院或居家卧室的固定摄像头（红外夜视），夜间连续监测老年人的离床状态和活动轨迹。输出异常预警，可联动护理人员手机或护士站大屏，防止老人走失、跌倒或发生意外。 Skill: Infant Blanket Kick Detection | 老年人夜间离床时长与徘徊识别 Owner: 18072937735 Summary: Using fixed cameras (infrared night vision) in nursing-home or home bedrooms, the system continuously monitors elderly bed-exit status and activity trajectory at night. | 通过养老院或居家卧室的固定摄像头（红外夜视），夜间连续监测老年人的离床状态和活动轨迹。输出异常预警，可联动护理人员手机或护士站大屏，防止老人走失、跌倒或发生意外。 Tags: latest:1.0.14 Version history: v1.0.14 | 2026-09-28T18:45:33.981Z | auto - Remo","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":1010,"uniquenessScore":48,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-09T21:28:49.616Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-09T21:28:49.616Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-10T08:09:40.461Z","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"}]}}}