{"id":"e1b10d9e-c083-40d1-a72b-232a46fede3c","entityType":"agent","slug":"clawhub-18072937735-smyx-elderly-toilet-time-abnormal-analysis","name":"Elderly Toilet Time Abnormal Detection (>30 min) | 老年人如厕时间异常（超30分钟）识别","canonicalUrl":"https://www.xpersona.co/agent/clawhub-18072937735-smyx-elderly-toilet-time-abnormal-analysis","canonicalPath":"/agent/clawhub-18072937735-smyx-elderly-toilet-time-abnormal-analysis","generatedAt":"2026-10-10T07:21:33.466Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-09T16:57:50.973Z","emptyReason":null},"description":"Using a camera installed at the bathroom doorway (or inside the bathroom only detecting human silhouettes, without capturing private details), the system uses human detection and entry/exit tracking to identify when an elderly person enters or leaves the toilet and calculates the continuous occupancy time. | 通过在卫生间门口（或内部仅检测人体，不采集隐私细节）安装的摄像头，利用人体检测和进出跟踪技术，识别老年人进入和离开卫生间的时刻，计算连续占用时间。当占用时间超过预设安全阈值（默认30分钟）时，输出异常预警，通知家属或护理人员及时查看，预防老年人因跌倒、突发疾病（如中风、心梗）或体力不支导致的无法自主移动等意外。","descriptionLabel":"Source description","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 2.3K downloads reported by the source. Last updated 10/9/2026.","installCommand":"clawhub skill install s17f8q65zg3y98t86jdg1177g583whq8:smyx-elderly-toilet-time-abnormal-analysis","sourceUrl":"https://clawhub.ai/18072937735/smyx-elderly-toilet-time-abnormal-analysis","homepage":"https://clawhub.ai/18072937735/skills/smyx-elderly-toilet-time-abnormal-analysis","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/18072937735/smyx-elderly-toilet-time-abnormal-analysis","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/18072937735/skills/smyx-elderly-toilet-time-abnormal-analysis","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":67,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Elderly Toilet Time Abnormal Detection (>30 min) | 老年人如厕时间异常（超30分钟）识别 technical dossier on Xpersona with agent coverage, OPENCLEW support, and live trust metada"},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-09T16:57:50.973Z","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-09T16:57:50.973Z","emptyReason":null},"stars":null,"forks":null,"downloads":2260,"packageName":null,"latestVersion":"1.0.13","tractionLabel":"2.3K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-09T16:57:50.973Z","emptyReason":null},"lastUpdatedAt":"2026-10-09T16:57:50.973Z","lastCrawledAt":"2026-10-09T16:57:50.973Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-10T16:57:50.973Z","lastVerifiedAt":null,"highlights":[{"version":"1.0.13","createdAt":"2026-09-27T21:19:34.438Z","changelog":"- Removed the file: skill-card.md. - No changes to code or functionality; documentation cleanup only.","fileCount":31,"zipByteSize":40726},{"version":"1.0.12","createdAt":"2026-09-26T09:28:41.152Z","changelog":"- Updated version to 1.0.14. - Minor documentation and metadata adjustments in SKILL.md (version number update, no functional or interface changes). - Removed outdated file: skill-card.md. - No changes to skill functionality or usage.","fileCount":31,"zipByteSize":40656},{"version":"1.0.11","createdAt":"2026-09-15T09:47:36.272Z","changelog":"- Version bumped from 1.0.11 to 1.0.13. - Documentation updated in SKILL.md; removed redundant or obsolete content. - skill-card.md file removed from the project.","fileCount":31,"zipByteSize":40919},{"version":"1.0.10","createdAt":"2026-08-28T13:02:37.598Z","changelog":"- Version updated to 1.0.11. - Documentation updated in SKILL.md. - Removed redundant file: skill-card.md.","fileCount":31,"zipByteSize":40856},{"version":"1.0.9","createdAt":"2026-08-19T13:07:32.366Z","changelog":"smyx-elderly-toilet-time-abnormal-analysis v1.0.9 - Updated documentation in SKILL.md, including version number and details. - Removed deprecated skill-card.md file. - Made configuration adjustments in skills/smyx_common/scripts/config.yaml. - No changes to core analysis logic or interfaces.","fileCount":31,"zipByteSize":40910},{"version":"1.0.8","createdAt":"2026-08-13T05:43:35.912Z","changelog":"### smyx-elderly-toilet-time-abnormal-analysis v1.0.8 - Version updated to 1.0.8 in skill metadata. - Documentation updated in SKILL.md; improved or clarified information. - Removed skill-card.md file.","fileCount":31,"zipByteSize":40880},{"version":"1.0.7","createdAt":"2026-08-03T11:03:29.409Z","changelog":"- Version updated to 1.0.7. - Documentation updated in SKILL.md; skill-card.md file removed. - No functional or API changes, only doc and file organization adjustments. - Maintains all core features and usage instructions as before.","fileCount":31,"zipByteSize":40833},{"version":"1.0.6","createdAt":"2026-07-26T21:24:29.464Z","changelog":"- Version updated to 1.0.6. - Documentation refined in SKILL.md; minor clarifications and updates to text. - Outdated file skill-card.md removed.","fileCount":31,"zipByteSize":41048}]},"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-toilet-time-abnormal-analysis","setupComplexity":"low","setupSteps":["Install using `clawhub skill install s17f8q65zg3y98t86jdg1177g583whq8:smyx-elderly-toilet-time-abnormal-analysis` in an isolated environment before connecting it to live workloads.","No published capability contract is available yet, so validate auth and request/response behavior manually.","Review the upstream CLAWHUB listing at https://clawhub.ai/18072937735/smyx-elderly-toilet-time-abnormal-analysis before using production credentials."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-elderly-toilet-time-abnormal-analysis/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-elderly-toilet-time-abnormal-analysis/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-elderly-toilet-time-abnormal-analysis/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-elderly-toilet-time-abnormal-analysis/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-elderly-toilet-time-abnormal-analysis/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-elderly-toilet-time-abnormal-analysis/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-10T07:21:33.462Z"}},"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-toilet-time-abnormal-analysis/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-elderly-toilet-time-abnormal-analysis/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-elderly-toilet-time-abnormal-analysis/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-elderly-toilet-time-abnormal-analysis/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-09T16:57:50.973Z","emptyReason":null},"readme":"Skill: Elderly Toilet Time Abnormal Detection (>30 min) | 老年人如厕时间异常（超30分钟）识别\n\nOwner: 18072937735\n\nSummary: Using a camera installed at the bathroom doorway (or inside the bathroom only detecting human silhouettes, without capturing private details), the system uses human detection and entry/exit tracking to identify when an elderly person enters or leaves the toilet and calculates the continuous occupancy time. | 通过在卫生间门口（或内部仅检测人体，不采集隐私细节）安装的摄像头，利用人体检测和进出跟踪技术，识别老年人进入和离开卫生间的时刻，计算连续占用时间。当占用时间超过预设安全阈值（默认30分钟）时，输出异常预警，通知家属或护理人员及时查看，预防老年人因跌倒、突发疾病（如中风、心梗）或体力不支导致的无法自主移动等意外。\n\nTags: latest:1.0.13\n\nVersion history:\n\nv1.0.13 | 2026-09-27T21:19:34.438Z | auto\n\n- Removed the file: skill-card.md.\n- No changes to code or functionality; documentation cleanup only.\n\nv1.0.12 | 2026-09-26T09:28:41.152Z | auto\n\n- Updated version to 1.0.14.\n- Minor documentation and metadata adjustments in SKILL.md (version number update, no functional or interface changes).\n- Removed outdated file: skill-card.md.\n- No changes to skill functionality or usage.\n\nv1.0.11 | 2026-09-15T09:47:36.272Z | auto\n\n- Version bumped from 1.0.11 to 1.0.13.\n- Documentation updated in SKILL.md; removed redundant or obsolete content.\n- skill-card.md file removed from the project.\n\nv1.0.10 | 2026-08-28T13:02:37.598Z | auto\n\n- Version updated to 1.0.11.\n- Documentation updated in SKILL.md.\n- Removed redundant file: skill-card.md.\n\nv1.0.9 | 2026-08-19T13:07:32.366Z | auto\n\nsmyx-elderly-toilet-time-abnormal-analysis v1.0.9\n\n- Updated documentation in SKILL.md, including version number and details.\n- Removed deprecated skill-card.md file.\n- Made configuration adjustments in skills/smyx_common/scripts/config.yaml.\n- No changes to core analysis logic or interfaces.\n\nv1.0.8 | 2026-08-13T05:43:35.912Z | auto\n\n### smyx-elderly-toilet-time-abnormal-analysis v1.0.8\n\n- Version updated to 1.0.8 in skill metadata.\n- Documentation updated in SKILL.md; improved or clarified information.\n- Removed skill-card.md file.\n\nv1.0.7 | 2026-08-03T11:03:29.409Z | auto\n\n- Version updated to 1.0.7.\n- Documentation updated in SKILL.md; skill-card.md file removed.\n- No functional or API changes, only doc and file organization adjustments.\n- Maintains all core features and usage instructions as before.\n\nv1.0.6 | 2026-07-26T21:24:29.464Z | auto\n\n- Version updated to 1.0.6.\n- Documentation refined in SKILL.md; minor clarifications and updates to text.\n- Outdated file skill-card.md removed.\n\nv1.0.5 | 2026-07-17T01:34:31.008Z | auto\n\nsmyx-elderly-toilet-time-abnormal-analysis v1.0.5\n\n- Updated version number and documentation to 1.0.5 for alignment and accuracy.\n- Minor adjustments in SKILL.md for improved clarity and completeness.\n- Removed redundant skill-card.md file for better project organization.\n\nv1.0.4 | 2026-07-09T04:17:27.486Z | auto\n\n- Version number updated to 1.0.4 in SKILL.md.\n- Minor documentation cleanup in SKILL.md; no functional or logic changes.\n- Removed skill-card.md file.\n\nv1.0.3 | 2026-07-04T12:23:26.915Z | auto\n\n**Changelog v1.0.3**\n\n- Removed all user-facing requirements to provide or see internal identity parameters (open-id); identity is now handled entirely by the system backend.\n- Updated workflow, SKILL.md, and API parameter guidance to reflect internal-only identity handling and eliminate related prompts or error messages.\n- Improved documentation for clarity and separation of user-visible and internal behaviors.\n- Cleaned up and reorganized skill resource references; deprecated \"open-id\" acquisition logic from the user journey.\n- Removed obsolete files and updated code to align with the new identity-oblivious user experience.\n\nv1.0.2 | 2026-06-22T18:15:42.744Z | auto\n\nsmyx-elderly-toilet-time-abnormal-analysis v1.0.2\n\n- Internal scripts updated across analysis, config, DAO, and utility modules.\n- Removed obsolete documentation file (skill-card.md).\n- Likely includes bug fixes or improvements in configuration and data handling.\n- No user-facing features or options were changed.\n\nv1.0.1 | 2026-06-20T17:54:29.010Z | auto\n\n- Updated documentation to clarify the open-id configuration file search order and file locations.\n- Revised SKILL.md to simplify and condense the description and usage details.\n- Added MIT-0 license information to SKILL.md.\n- Removed the outdated skill-card.md file.\n- No changes to core logic or APIs; changes are documentation and configuration related.\n\nv1.0.0 | 2026-05-25T09:45:53.010Z | auto\n\nsmyx-elderly-toilet-time-abnormal-analysis 1.0.0 – Initial Release\n\n- Detects elderly entry/exit from bathroom using privacy-protecting human detection via camera, calculates occupancy time.\n- Automatically triggers abnormal alert and notifies caregivers if stay exceeds safety threshold (default 30 minutes).\n- Provides report listing, detailed alerting (severity levels), and integration guidelines for nursing home or smart home systems.\n- Enforces strict privacy/data access controls and user identification (open-id) requirements prior to analysis.\n- Includes step-by-step operation, API/script usage, and Mandarin/English documentation for deployment and compliance.\n\nArchive index:\n\nArchive v1.0.13: 31 files, 40726 bytes\n\nFiles: references/api_doc.md (2358b), scripts/__init__.py (56b), scripts/config.py (707b), scripts/config.yaml (3b), scripts/skill.py (599b), scripts/smyx_elderly_toilet_time_abnormal_analysis.py (3655b), skill-card.md (2210b), SKILL.md (12803b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (473b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (162b)\n\nFile v1.0.13:SKILL.md\n\n---\nname: \"smyx-elderly-toilet-time-abnormal-analysis\"\ndescription: \"Using a camera installed at the bathroom doorway (or inside the bathroom only detecting human silhouettes, without capturing private details), the system uses human detection and entry/exit tracking to identify when an elderly person enters or leaves the toilet and calculates the continuous occupancy time. | 通过在卫生间门口（或内部仅检测人体，不采集隐私细节）安装的摄像头，利用人体检测和进出跟踪技术，识别老年人进入和离开卫生间的时刻，计算连续占用时间。当占用时间超过预设安全阈值（默认30分钟）时，输出异常预警，通知家属或护理人员及时查看，预防老年人因跌倒、突发疾病（如中风、心梗）或体力不支导致的无法自主移动等意外。\"\nversion: \"1.0.14\"\nlicense: \"MIT-0\"\n---\n\n# 🚽 Elderly Toilet Time Abnormal Detection (>30 min) | 老年人如厕时间异常（超30分钟）识别\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **老年人如厕时间异常（超30分钟）识别** |\n| 🎯 核心目标 | 通过在卫生间门口（或内部仅检测人体，不采集隐私细节）安装的摄像头，利用人体检测和进出跟踪技术，识别老年人进入和离开卫生间的时刻，计算连续占用时间。当占用时间超过预设安全阈值（默认30分钟）时，输出异常预警，通知家属或护理人员及时查看，预防老年人因跌倒、突发疾病（如中风、心梗）或体力不支导致的无法自主移动等意外。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_TOILET_TIME_ABNORMAL_ANALYSIS` |\n\nUsing a camera installed at the bathroom doorway (or inside the bathroom only detecting human silhouettes, without capturing private details), the system uses human detection and entry/exit tracking to identify when an elderly person enters or leaves the toilet and calculates the continuous occupancy time. When occupancy exceeds a preset safety threshold (default 30 minutes), the system outputs an abnormal alert and notifies family members or caregivers to check in time, preventing accidents such as falls, sudden illness (stroke, heart attack) or exhaustion that may prevent the elderly from moving by themselves. Application scenarios: solo-living elder households, nursing homes, senior apartments. The system runs automatically; if the elderly stay in the toilet for more than 30 minutes without coming out, urgent reminders are pushed via app suggesting an on-site check. Skill features: sudden illness or falls during toileting that prevent the elderly from calling for help is a common safety risk. Automatic occupancy-time monitoring helps detect anomalies in time and gain rescue time. Can be integrated into nursing-home management systems or home-security platforms to enhance elderly safety.\n\n通过在卫生间门口（或内部仅检测人体，不采集隐私细节）安装的摄像头，利用人体检测和进出跟踪技术，识别老年人进入和离开卫生间的时刻，计算连续占用时间。当占用时间超过预设安全阈值（默认30分钟）时，输出异常预警，通知家属或护理人员及时查看，预防老年人因跌倒、突发疾病（如中风、心梗）或体力不支导致的无法自主移动等意外。应用场景：独居老人家庭、养老院、老年公寓。系统自动监测，若老人进入卫生间超过30分钟未出，通过APP推送紧急提醒并建议上门查看。技能特点：老年人如厕时突发疾病或跌倒后无法呼救是常见安全隐患。通过自动监测停留时间，可及时发现异常，争取救援时间。该技能可集成到养老院管理系统或居家安防平台中，提升老人安全保障水平。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人安全监测 AI。你的任务是分析卫生间门口（或内部仅检测人体轮廓）固定摄像头的视频，检测老年人的进入和离开事件，计算每次在卫生间内的连续停留时间。当停留时间超过预设阈值（默认 30 分钟）时，输出异常预警。为保护隐私，系统可对画面进行模糊化处理，仅识别人体进出。不要提供医疗诊断或具体救援操作方案，仅输出基于人体进出的统计与预警结果。** |\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 | 阈值判定（默认 30 分钟 |\n| 6 | 可覆盖） |\n| 7 | 分级预警（none / info / warning / critical） |\n| 8 | 紧急联系人通知建议 |\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_toilet_time_abnormal_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_toilet_time_abnormal_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_toilet_time_abnormal_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_toilet_time_abnormal_analysis.py`](scripts/smyx_elderly_toilet_time_abnormal_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_toilet_time_abnormal_analysis --input /path/to/toilet_door.mp4\n\n# 分析网络卫生间门口监控视频\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --url https://example.com/toilet_door.mp4\n\n# 显示历史如厕监测报告（自动触发关键词：查看如厕时间历史报告、卫生间停留报告清单等）\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --input toilet.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --input toilet.mp4 --output result.json\n```\n\nFile v1.0.13:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-elderly-toilet-time-abnormal-analysis\",\n  \"version\": \"1.0.13\",\n  \"publishedAt\": 1790543974438\n}\n\nFile v1.0.13:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放老年人如厕时间异常（超30分钟）识别 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_TOILET_TIME_ABNORMAL_ANALYSIS` - 老年人如厕时间异常（超30分钟）识别\n\n## 输入约束\n\n- 推荐摄像头安装于卫生间门口（首选）\n- 如必须安装在卫生间内部，**仅检测人体轮廓**，画面建议做模糊化/像素化处理，禁止采集隐私细节\n- 24 小时全天候采集（含红外夜视）\n- 视频帧率建议 ≥ 10 FPS\n\n## 关键检测事件\n\n- `enter_toilet` - 进入卫生间事件（含时间戳）\n- `exit_toilet` - 离开卫生间事件（含时间戳）\n- `current_occupancy_sec` - 当前连续停留秒数\n- `occupancy_session` - 完整一次停留会话（起止时间 + 持续秒数）\n\n## 默认安全阈值（可由调用方覆盖）\n\n- 如厕停留预警阈值：30 分钟（toilet_duration_threshold_min）\n- 分级预警：\n  - 20-30min → info（接近阈值）\n  - 30-60min → warning（异常）\n  - ≥ 60min → critical（紧急，疑似突发疾病/跌倒）\n\n## 输出字段（参考）\n\n- `person_detected` - 是否检测到人体\n- `is_in_toilet` - 当前是否在卫生间内\n- `enter_time` - 本次进入时间\n- `current_duration_min` - 本次停留时长（分钟）\n- `occupancy_history` - 当日如厕会话历史\n- `abnormal_alert` - 是否触发停留时间异常预警\n- `alert_level` - 预警等级（none / info / warning / critical）\n- `alert_message` - 预警文本（如\"老人已在卫生间停留 35 分钟，建议立即上门查看\"）\n- `suggested_contacts` - 建议通知的联系人（子女 / 护理人员 / 社区网格员）\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 bathroom doorway video to track occupancy and flag stays exceeding a 30-minute threshold for caregiver review.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[18072937735](https://clawhub.ai/user/18072937735)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nCaregivers and elder-care teams use the skill to review occupancy alerts and historical monitoring reports for older adults. Alerts prompt a human check rather than a medical diagnosis.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Bathroom-monitoring video may expose highly sensitive personal details when sent to cloud services.\n\nMitigation: Obtain explicit consent from the monitored person or authorized caregiver; prefer doorway-only or pre-blurred footage and avoid uploading raw private bathroom video.\n\nRisk: Cloud report history and locally stored identity or tokens may be accessed or retained beyond the user's expectations.\n\nMitigation: Confirm the publisher's retention and access controls, and restrict access to the workspace data directory.\n\nRisk: An occupancy alert cannot establish whether a person needs medical attention.\n\nMitigation: Have a caregiver promptly verify urgent alerts directly; do not treat the result as a medical diagnosis.\n\n## Reference(s):\n\n- [API documentation](references/api_doc.md)\n- [ClawHub skill release](https://clawhub.ai/18072937735/skills/smyx-elderly-toilet-time-abnormal-analysis)\n- [Skill demo](https://lifeemergence.com/sample.html)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Markdown, JSON]\n\n**Output Format:** [Structured analysis text and Markdown report links, with JSON data in reports]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Occupancy alerts, report summaries, and cloud history links]\n\n## Skill Version(s):\n\n1.0.13 (source: server-resolved ClawHub release metadata; artifact frontmatter lists 1.0.14)\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, 40656 bytes\n\nFiles: references/api_doc.md (2358b), scripts/__init__.py (56b), scripts/config.py (707b), scripts/config.yaml (3b), scripts/skill.py (599b), scripts/smyx_elderly_toilet_time_abnormal_analysis.py (3655b), skill-card.md (2062b), SKILL.md (12803b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (473b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (162b)\n\nFile v1.0.12:SKILL.md\n\n---\nname: \"smyx-elderly-toilet-time-abnormal-analysis\"\ndescription: \"Using a camera installed at the bathroom doorway (or inside the bathroom only detecting human silhouettes, without capturing private details), the system uses human detection and entry/exit tracking to identify when an elderly person enters or leaves the toilet and calculates the continuous occupancy time. | 通过在卫生间门口（或内部仅检测人体，不采集隐私细节）安装的摄像头，利用人体检测和进出跟踪技术，识别老年人进入和离开卫生间的时刻，计算连续占用时间。当占用时间超过预设安全阈值（默认30分钟）时，输出异常预警，通知家属或护理人员及时查看，预防老年人因跌倒、突发疾病（如中风、心梗）或体力不支导致的无法自主移动等意外。\"\nversion: \"1.0.14\"\nlicense: \"MIT-0\"\n---\n\n# 🚽 Elderly Toilet Time Abnormal Detection (>30 min) | 老年人如厕时间异常（超30分钟）识别\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **老年人如厕时间异常（超30分钟）识别** |\n| 🎯 核心目标 | 通过在卫生间门口（或内部仅检测人体，不采集隐私细节）安装的摄像头，利用人体检测和进出跟踪技术，识别老年人进入和离开卫生间的时刻，计算连续占用时间。当占用时间超过预设安全阈值（默认30分钟）时，输出异常预警，通知家属或护理人员及时查看，预防老年人因跌倒、突发疾病（如中风、心梗）或体力不支导致的无法自主移动等意外。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_TOILET_TIME_ABNORMAL_ANALYSIS` |\n\nUsing a camera installed at the bathroom doorway (or inside the bathroom only detecting human silhouettes, without capturing private details), the system uses human detection and entry/exit tracking to identify when an elderly person enters or leaves the toilet and calculates the continuous occupancy time. When occupancy exceeds a preset safety threshold (default 30 minutes), the system outputs an abnormal alert and notifies family members or caregivers to check in time, preventing accidents such as falls, sudden illness (stroke, heart attack) or exhaustion that may prevent the elderly from moving by themselves. Application scenarios: solo-living elder households, nursing homes, senior apartments. The system runs automatically; if the elderly stay in the toilet for more than 30 minutes without coming out, urgent reminders are pushed via app suggesting an on-site check. Skill features: sudden illness or falls during toileting that prevent the elderly from calling for help is a common safety risk. Automatic occupancy-time monitoring helps detect anomalies in time and gain rescue time. Can be integrated into nursing-home management systems or home-security platforms to enhance elderly safety.\n\n通过在卫生间门口（或内部仅检测人体，不采集隐私细节）安装的摄像头，利用人体检测和进出跟踪技术，识别老年人进入和离开卫生间的时刻，计算连续占用时间。当占用时间超过预设安全阈值（默认30分钟）时，输出异常预警，通知家属或护理人员及时查看，预防老年人因跌倒、突发疾病（如中风、心梗）或体力不支导致的无法自主移动等意外。应用场景：独居老人家庭、养老院、老年公寓。系统自动监测，若老人进入卫生间超过30分钟未出，通过APP推送紧急提醒并建议上门查看。技能特点：老年人如厕时突发疾病或跌倒后无法呼救是常见安全隐患。通过自动监测停留时间，可及时发现异常，争取救援时间。该技能可集成到养老院管理系统或居家安防平台中，提升老人安全保障水平。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人安全监测 AI。你的任务是分析卫生间门口（或内部仅检测人体轮廓）固定摄像头的视频，检测老年人的进入和离开事件，计算每次在卫生间内的连续停留时间。当停留时间超过预设阈值（默认 30 分钟）时，输出异常预警。为保护隐私，系统可对画面进行模糊化处理，仅识别人体进出。不要提供医疗诊断或具体救援操作方案，仅输出基于人体进出的统计与预警结果。** |\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 | 阈值判定（默认 30 分钟 |\n| 6 | 可覆盖） |\n| 7 | 分级预警（none / info / warning / critical） |\n| 8 | 紧急联系人通知建议 |\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_toilet_time_abnormal_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_toilet_time_abnormal_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_toilet_time_abnormal_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_toilet_time_abnormal_analysis.py`](scripts/smyx_elderly_toilet_time_abnormal_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_toilet_time_abnormal_analysis --input /path/to/toilet_door.mp4\n\n# 分析网络卫生间门口监控视频\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --url https://example.com/toilet_door.mp4\n\n# 显示历史如厕监测报告（自动触发关键词：查看如厕时间历史报告、卫生间停留报告清单等）\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --input toilet.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --input toilet.mp4 --output result.json\n```\n\nFile v1.0.12:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-elderly-toilet-time-abnormal-analysis\",\n  \"version\": \"1.0.12\",\n  \"publishedAt\": 1790414921152\n}\n\nFile v1.0.12:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放老年人如厕时间异常（超30分钟）识别 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_TOILET_TIME_ABNORMAL_ANALYSIS` - 老年人如厕时间异常（超30分钟）识别\n\n## 输入约束\n\n- 推荐摄像头安装于卫生间门口（首选）\n- 如必须安装在卫生间内部，**仅检测人体轮廓**，画面建议做模糊化/像素化处理，禁止采集隐私细节\n- 24 小时全天候采集（含红外夜视）\n- 视频帧率建议 ≥ 10 FPS\n\n## 关键检测事件\n\n- `enter_toilet` - 进入卫生间事件（含时间戳）\n- `exit_toilet` - 离开卫生间事件（含时间戳）\n- `current_occupancy_sec` - 当前连续停留秒数\n- `occupancy_session` - 完整一次停留会话（起止时间 + 持续秒数）\n\n## 默认安全阈值（可由调用方覆盖）\n\n- 如厕停留预警阈值：30 分钟（toilet_duration_threshold_min）\n- 分级预警：\n  - 20-30min → info（接近阈值）\n  - 30-60min → warning（异常）\n  - ≥ 60min → critical（紧急，疑似突发疾病/跌倒）\n\n## 输出字段（参考）\n\n- `person_detected` - 是否检测到人体\n- `is_in_toilet` - 当前是否在卫生间内\n- `enter_time` - 本次进入时间\n- `current_duration_min` - 本次停留时长（分钟）\n- `occupancy_history` - 当日如厕会话历史\n- `abnormal_alert` - 是否触发停留时间异常预警\n- `alert_level` - 预警等级（none / info / warning / critical）\n- `alert_message` - 预警文本（如\"老人已在卫生间停留 35 分钟，建议立即上门查看\"）\n- `suggested_contacts` - 建议通知的联系人（子女 / 护理人员 / 社区网格员）\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: prod\n\nFile v1.0.12:skill-card.md\n\n## Description:\n\nAnalyzes bathroom doorway or silhouette-only video to estimate an older adult's bathroom occupancy and flag stays exceeding a default 30-minute threshold.\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 elder-care providers use bathroom entry and exit footage to identify unusually long stays and review alerts or historical reports. Alerts support, but do not replace, an in-person safety check.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Sensitive bathroom footage and report history are sent to a cloud service.\n\nMitigation: Obtain informed consent from the monitored person or authorized caregiver; prefer doorway footage or pre-blurred, silhouette-only video over raw in-bathroom footage.\n\nRisk: The skill automatically creates or reuses a local identity and token state for cloud requests.\n\nMitigation: Review the configured service and local identity handling before installation or use, and limit access to stored identity and reports.\n\nRisk: An occupancy alert may not establish why a person has remained in the bathroom.\n\nMitigation: Have a caregiver promptly verify urgent alerts by phone or in person; do not treat the output as a medical diagnosis.\n\n## Reference(s):\n\n- [API documentation](references/api_doc.md)\n\n## Skill Output:\n\n**Output Type(s):** [Analysis, Guidance, Text]\n\n**Output Format:** [JSON or Markdown, including report tables and links]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Optional saved report file and cloud-hosted report links.]\n\n## Skill Version(s):\n\n1.0.12 (source: server-resolved ClawHub release; packaged SKILL.md says 1.0.14)\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, 40919 bytes\n\nFiles: references/api_doc.md (2358b), scripts/__init__.py (56b), scripts/config.py (707b), scripts/config.yaml (3b), scripts/skill.py (599b), scripts/smyx_elderly_toilet_time_abnormal_analysis.py (3655b), skill-card.md (2656b), SKILL.md (12803b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (472b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (162b)\n\nFile v1.0.11:SKILL.md\n\n---\nname: \"smyx-elderly-toilet-time-abnormal-analysis\"\ndescription: \"Using a camera installed at the bathroom doorway (or inside the bathroom only detecting human silhouettes, without capturing private details), the system uses human detection and entry/exit tracking to identify when an elderly person enters or leaves the toilet and calculates the continuous occupancy time. | 通过在卫生间门口（或内部仅检测人体，不采集隐私细节）安装的摄像头，利用人体检测和进出跟踪技术，识别老年人进入和离开卫生间的时刻，计算连续占用时间。当占用时间超过预设安全阈值（默认30分钟）时，输出异常预警，通知家属或护理人员及时查看，预防老年人因跌倒、突发疾病（如中风、心梗）或体力不支导致的无法自主移动等意外。\"\nversion: \"1.0.13\"\nlicense: \"MIT-0\"\n---\n\n# 🚽 Elderly Toilet Time Abnormal Detection (>30 min) | 老年人如厕时间异常（超30分钟）识别\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **老年人如厕时间异常（超30分钟）识别** |\n| 🎯 核心目标 | 通过在卫生间门口（或内部仅检测人体，不采集隐私细节）安装的摄像头，利用人体检测和进出跟踪技术，识别老年人进入和离开卫生间的时刻，计算连续占用时间。当占用时间超过预设安全阈值（默认30分钟）时，输出异常预警，通知家属或护理人员及时查看，预防老年人因跌倒、突发疾病（如中风、心梗）或体力不支导致的无法自主移动等意外。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_TOILET_TIME_ABNORMAL_ANALYSIS` |\n\nUsing a camera installed at the bathroom doorway (or inside the bathroom only detecting human silhouettes, without capturing private details), the system uses human detection and entry/exit tracking to identify when an elderly person enters or leaves the toilet and calculates the continuous occupancy time. When occupancy exceeds a preset safety threshold (default 30 minutes), the system outputs an abnormal alert and notifies family members or caregivers to check in time, preventing accidents such as falls, sudden illness (stroke, heart attack) or exhaustion that may prevent the elderly from moving by themselves. Application scenarios: solo-living elder households, nursing homes, senior apartments. The system runs automatically; if the elderly stay in the toilet for more than 30 minutes without coming out, urgent reminders are pushed via app suggesting an on-site check. Skill features: sudden illness or falls during toileting that prevent the elderly from calling for help is a common safety risk. Automatic occupancy-time monitoring helps detect anomalies in time and gain rescue time. Can be integrated into nursing-home management systems or home-security platforms to enhance elderly safety.\n\n通过在卫生间门口（或内部仅检测人体，不采集隐私细节）安装的摄像头，利用人体检测和进出跟踪技术，识别老年人进入和离开卫生间的时刻，计算连续占用时间。当占用时间超过预设安全阈值（默认30分钟）时，输出异常预警，通知家属或护理人员及时查看，预防老年人因跌倒、突发疾病（如中风、心梗）或体力不支导致的无法自主移动等意外。应用场景：独居老人家庭、养老院、老年公寓。系统自动监测，若老人进入卫生间超过30分钟未出，通过APP推送紧急提醒并建议上门查看。技能特点：老年人如厕时突发疾病或跌倒后无法呼救是常见安全隐患。通过自动监测停留时间，可及时发现异常，争取救援时间。该技能可集成到养老院管理系统或居家安防平台中，提升老人安全保障水平。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人安全监测 AI。你的任务是分析卫生间门口（或内部仅检测人体轮廓）固定摄像头的视频，检测老年人的进入和离开事件，计算每次在卫生间内的连续停留时间。当停留时间超过预设阈值（默认 30 分钟）时，输出异常预警。为保护隐私，系统可对画面进行模糊化处理，仅识别人体进出。不要提供医疗诊断或具体救援操作方案，仅输出基于人体进出的统计与预警结果。** |\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 | 阈值判定（默认 30 分钟 |\n| 6 | 可覆盖） |\n| 7 | 分级预警（none / info / warning / critical） |\n| 8 | 紧急联系人通知建议 |\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_toilet_time_abnormal_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_toilet_time_abnormal_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_toilet_time_abnormal_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_toilet_time_abnormal_analysis.py`](scripts/smyx_elderly_toilet_time_abnormal_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_toilet_time_abnormal_analysis --input /path/to/toilet_door.mp4\n\n# 分析网络卫生间门口监控视频\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --url https://example.com/toilet_door.mp4\n\n# 显示历史如厕监测报告（自动触发关键词：查看如厕时间历史报告、卫生间停留报告清单等）\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --input toilet.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --input toilet.mp4 --output result.json\n```\n\nFile v1.0.11:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-elderly-toilet-time-abnormal-analysis\",\n  \"version\": \"1.0.11\",\n  \"publishedAt\": 1789465656272\n}\n\nFile v1.0.11:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放老年人如厕时间异常（超30分钟）识别 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_TOILET_TIME_ABNORMAL_ANALYSIS` - 老年人如厕时间异常（超30分钟）识别\n\n## 输入约束\n\n- 推荐摄像头安装于卫生间门口（首选）\n- 如必须安装在卫生间内部，**仅检测人体轮廓**，画面建议做模糊化/像素化处理，禁止采集隐私细节\n- 24 小时全天候采集（含红外夜视）\n- 视频帧率建议 ≥ 10 FPS\n\n## 关键检测事件\n\n- `enter_toilet` - 进入卫生间事件（含时间戳）\n- `exit_toilet` - 离开卫生间事件（含时间戳）\n- `current_occupancy_sec` - 当前连续停留秒数\n- `occupancy_session` - 完整一次停留会话（起止时间 + 持续秒数）\n\n## 默认安全阈值（可由调用方覆盖）\n\n- 如厕停留预警阈值：30 分钟（toilet_duration_threshold_min）\n- 分级预警：\n  - 20-30min → info（接近阈值）\n  - 30-60min → warning（异常）\n  - ≥ 60min → critical（紧急，疑似突发疾病/跌倒）\n\n## 输出字段（参考）\n\n- `person_detected` - 是否检测到人体\n- `is_in_toilet` - 当前是否在卫生间内\n- `enter_time` - 本次进入时间\n- `current_duration_min` - 本次停留时长（分钟）\n- `occupancy_history` - 当日如厕会话历史\n- `abnormal_alert` - 是否触发停留时间异常预警\n- `alert_level` - 预警等级（none / info / warning / critical）\n- `alert_message` - 预警文本（如\"老人已在卫生间停留 35 分钟，建议立即上门查看\"）\n- `suggested_contacts` - 建议通知的联系人（子女 / 护理人员 / 社区网格员）\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\nUsing a camera installed at the bathroom doorway, or inside the bathroom only detecting human silhouettes without capturing private details, this skill detects elderly bathroom entry and exit events, calculates continuous occupancy time, and raises an abnormal alert when the stay exceeds the configured threshold.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[18072937735](https://clawhub.ai/user/18072937735)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal caregivers, family members, and elder-care operators use this skill to analyze privacy-minimized bathroom doorway or silhouette video for prolonged toilet occupancy alerts and report history. It supports safety monitoring workflows for solo-living elder households, nursing homes, senior apartments, and home-security integrations.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill may send highly sensitive bathroom-adjacent video, video URLs, and report history to a configured cloud service.\n\nMitigation: Use only with explicit consent, privacy-minimized camera placement, HTTPS production endpoints, and documented data retention controls.\n\nRisk: The skill silently manages local identity and persistent tokens for report association.\n\nMitigation: Review identity and token storage before deployment, restrict access to local configuration and history, and rotate or revoke credentials when needed.\n\nRisk: Alerts are safety-monitoring signals and may be incorrect or incomplete.\n\nMitigation: Treat abnormal occupancy alerts as prompts for human verification, not as medical diagnosis or a substitute for emergency response judgment.\n\n## Reference(s):\n\n- [ClawHub Skill Page](https://clawhub.ai/18072937735/skills/smyx-elderly-toilet-time-abnormal-analysis)\n- [API Documentation](references/api_doc.md)\n- [Skill Demo](https://lifeemergence.com/sample.html)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, JSON, shell commands, guidance]\n\n**Output Format:** [Structured analysis report or history table, with JSON detail available by parameter]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May include occupancy duration, entry and exit events, alert level, suggested contacts, and report links.]\n\n## Skill Version(s):\n\n1.0.11 (source: server release evidence; artifact frontmatter states 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.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, 40856 bytes\n\nFiles: references/api_doc.md (2358b), scripts/__init__.py (56b), scripts/config.py (707b), scripts/config.yaml (3b), scripts/skill.py (599b), scripts/smyx_elderly_toilet_time_abnormal_analysis.py (3655b), skill-card.md (2548b), SKILL.md (12803b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (472b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (162b)\n\nFile v1.0.10:SKILL.md\n\n---\nname: \"smyx-elderly-toilet-time-abnormal-analysis\"\ndescription: \"Using a camera installed at the bathroom doorway (or inside the bathroom only detecting human silhouettes, without capturing private details), the system uses human detection and entry/exit tracking to identify when an elderly person enters or leaves the toilet and calculates the continuous occupancy time. | 通过在卫生间门口（或内部仅检测人体，不采集隐私细节）安装的摄像头，利用人体检测和进出跟踪技术，识别老年人进入和离开卫生间的时刻，计算连续占用时间。当占用时间超过预设安全阈值（默认30分钟）时，输出异常预警，通知家属或护理人员及时查看，预防老年人因跌倒、突发疾病（如中风、心梗）或体力不支导致的无法自主移动等意外。\"\nversion: \"1.0.11\"\nlicense: \"MIT-0\"\n---\n\n# 🚽 Elderly Toilet Time Abnormal Detection (>30 min) | 老年人如厕时间异常（超30分钟）识别\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **老年人如厕时间异常（超30分钟）识别** |\n| 🎯 核心目标 | 通过在卫生间门口（或内部仅检测人体，不采集隐私细节）安装的摄像头，利用人体检测和进出跟踪技术，识别老年人进入和离开卫生间的时刻，计算连续占用时间。当占用时间超过预设安全阈值（默认30分钟）时，输出异常预警，通知家属或护理人员及时查看，预防老年人因跌倒、突发疾病（如中风、心梗）或体力不支导致的无法自主移动等意外。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_TOILET_TIME_ABNORMAL_ANALYSIS` |\n\nUsing a camera installed at the bathroom doorway (or inside the bathroom only detecting human silhouettes, without capturing private details), the system uses human detection and entry/exit tracking to identify when an elderly person enters or leaves the toilet and calculates the continuous occupancy time. When occupancy exceeds a preset safety threshold (default 30 minutes), the system outputs an abnormal alert and notifies family members or caregivers to check in time, preventing accidents such as falls, sudden illness (stroke, heart attack) or exhaustion that may prevent the elderly from moving by themselves. Application scenarios: solo-living elder households, nursing homes, senior apartments. The system runs automatically; if the elderly stay in the toilet for more than 30 minutes without coming out, urgent reminders are pushed via app suggesting an on-site check. Skill features: sudden illness or falls during toileting that prevent the elderly from calling for help is a common safety risk. Automatic occupancy-time monitoring helps detect anomalies in time and gain rescue time. Can be integrated into nursing-home management systems or home-security platforms to enhance elderly safety.\n\n通过在卫生间门口（或内部仅检测人体，不采集隐私细节）安装的摄像头，利用人体检测和进出跟踪技术，识别老年人进入和离开卫生间的时刻，计算连续占用时间。当占用时间超过预设安全阈值（默认30分钟）时，输出异常预警，通知家属或护理人员及时查看，预防老年人因跌倒、突发疾病（如中风、心梗）或体力不支导致的无法自主移动等意外。应用场景：独居老人家庭、养老院、老年公寓。系统自动监测，若老人进入卫生间超过30分钟未出，通过APP推送紧急提醒并建议上门查看。技能特点：老年人如厕时突发疾病或跌倒后无法呼救是常见安全隐患。通过自动监测停留时间，可及时发现异常，争取救援时间。该技能可集成到养老院管理系统或居家安防平台中，提升老人安全保障水平。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人安全监测 AI。你的任务是分析卫生间门口（或内部仅检测人体轮廓）固定摄像头的视频，检测老年人的进入和离开事件，计算每次在卫生间内的连续停留时间。当停留时间超过预设阈值（默认 30 分钟）时，输出异常预警。为保护隐私，系统可对画面进行模糊化处理，仅识别人体进出。不要提供医疗诊断或具体救援操作方案，仅输出基于人体进出的统计与预警结果。** |\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 | 阈值判定（默认 30 分钟 |\n| 6 | 可覆盖） |\n| 7 | 分级预警（none / info / warning / critical） |\n| 8 | 紧急联系人通知建议 |\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_toilet_time_abnormal_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_toilet_time_abnormal_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_toilet_time_abnormal_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_toilet_time_abnormal_analysis.py`](scripts/smyx_elderly_toilet_time_abnormal_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_toilet_time_abnormal_analysis --input /path/to/toilet_door.mp4\n\n# 分析网络卫生间门口监控视频\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --url https://example.com/toilet_door.mp4\n\n# 显示历史如厕监测报告（自动触发关键词：查看如厕时间历史报告、卫生间停留报告清单等）\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --input toilet.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --input toilet.mp4 --output result.json\n```\n\nFile v1.0.10:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-elderly-toilet-time-abnormal-analysis\",\n  \"version\": \"1.0.10\",\n  \"publishedAt\": 1787922157598\n}\n\nFile v1.0.10:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放老年人如厕时间异常（超30分钟）识别 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_TOILET_TIME_ABNORMAL_ANALYSIS` - 老年人如厕时间异常（超30分钟）识别\n\n## 输入约束\n\n- 推荐摄像头安装于卫生间门口（首选）\n- 如必须安装在卫生间内部，**仅检测人体轮廓**，画面建议做模糊化/像素化处理，禁止采集隐私细节\n- 24 小时全天候采集（含红外夜视）\n- 视频帧率建议 ≥ 10 FPS\n\n## 关键检测事件\n\n- `enter_toilet` - 进入卫生间事件（含时间戳）\n- `exit_toilet` - 离开卫生间事件（含时间戳）\n- `current_occupancy_sec` - 当前连续停留秒数\n- `occupancy_session` - 完整一次停留会话（起止时间 + 持续秒数）\n\n## 默认安全阈值（可由调用方覆盖）\n\n- 如厕停留预警阈值：30 分钟（toilet_duration_threshold_min）\n- 分级预警：\n  - 20-30min → info（接近阈值）\n  - 30-60min → warning（异常）\n  - ≥ 60min → critical（紧急，疑似突发疾病/跌倒）\n\n## 输出字段（参考）\n\n- `person_detected` - 是否检测到人体\n- `is_in_toilet` - 当前是否在卫生间内\n- `enter_time` - 本次进入时间\n- `current_duration_min` - 本次停留时长（分钟）\n- `occupancy_history` - 当日如厕会话历史\n- `abnormal_alert` - 是否触发停留时间异常预警\n- `alert_level` - 预警等级（none / info / warning / critical）\n- `alert_message` - 预警文本（如\"老人已在卫生间停留 35 分钟，建议立即上门查看\"）\n- `suggested_contacts` - 建议通知的联系人（子女 / 护理人员 / 社区网格员）\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\nAnalyzes privacy-preserving bathroom doorway or silhouette-only video to track elderly toilet occupancy duration and produce abnormal-stay alerts when the configured threshold is exceeded.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[18072937735](https://clawhub.ai/user/18072937735)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal caregivers, family members, and senior-care or home-security operators use this skill to analyze privacy-preserving bathroom monitoring video, identify entry and exit events, measure continuous occupancy, and surface abnormal stays for human follow-up.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Sensitive bathroom-adjacent media and identifiers may be sent to cloud services.\n\nMitigation: Use only with explicit consent from the monitored person or legal caregiver, confirm backend endpoints and retention policies before deployment, and prefer doorway views or blurred/silhouette-only footage.\n\nRisk: The skill silently creates and reuses a persistent local identity.\n\nMitigation: Do not deploy in production until identity creation, token storage, and account-linking behavior are clearly governed and reviewable.\n\nRisk: Development or test HTTP endpoints may be present in configuration evidence.\n\nMitigation: Confirm production endpoints and remove or govern dev HTTP endpoint use before installation.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/18072937735/skills/smyx-elderly-toilet-time-abnormal-analysis)\n- [Skill demo](https://lifeemergence.com/sample.html)\n- [API interface documentation](artifact/references/api_doc.md)\n- [Shared analysis API documentation](artifact/skills/smyx_analysis/references/api_doc.md)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, JSON, shell commands, guidance]\n\n**Output Format:** [Markdown or JSON structured analysis report with alert status, occupancy timing, recommendations, and report links.]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May query cloud APIs for analysis results and historical reports; supports basic, standard, and json detail modes.]\n\n## Skill Version(s):\n\n1.0.10 (source: server release metadata; artifact frontmatter reports 1.0.11)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.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, 40910 bytes\n\nFiles: references/api_doc.md (2358b), scripts/__init__.py (56b), scripts/config.py (707b), scripts/config.yaml (3b), scripts/skill.py (599b), scripts/smyx_elderly_toilet_time_abnormal_analysis.py (3655b), skill-card.md (2635b), SKILL.md (12803b), 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 (161b)\n\nFile v1.0.9:SKILL.md\n\n---\nname: \"smyx-elderly-toilet-time-abnormal-analysis\"\ndescription: \"Using a camera installed at the bathroom doorway (or inside the bathroom only detecting human silhouettes, without capturing private details), the system uses human detection and entry/exit tracking to identify when an elderly person enters or leaves the toilet and calculates the continuous occupancy time. | 通过在卫生间门口（或内部仅检测人体，不采集隐私细节）安装的摄像头，利用人体检测和进出跟踪技术，识别老年人进入和离开卫生间的时刻，计算连续占用时间。当占用时间超过预设安全阈值（默认30分钟）时，输出异常预警，通知家属或护理人员及时查看，预防老年人因跌倒、突发疾病（如中风、心梗）或体力不支导致的无法自主移动等意外。\"\nversion: \"1.0.10\"\nlicense: \"MIT-0\"\n---\n\n# 🚽 Elderly Toilet Time Abnormal Detection (>30 min) | 老年人如厕时间异常（超30分钟）识别\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **老年人如厕时间异常（超30分钟）识别** |\n| 🎯 核心目标 | 通过在卫生间门口（或内部仅检测人体，不采集隐私细节）安装的摄像头，利用人体检测和进出跟踪技术，识别老年人进入和离开卫生间的时刻，计算连续占用时间。当占用时间超过预设安全阈值（默认30分钟）时，输出异常预警，通知家属或护理人员及时查看，预防老年人因跌倒、突发疾病（如中风、心梗）或体力不支导致的无法自主移动等意外。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_TOILET_TIME_ABNORMAL_ANALYSIS` |\n\nUsing a camera installed at the bathroom doorway (or inside the bathroom only detecting human silhouettes, without capturing private details), the system uses human detection and entry/exit tracking to identify when an elderly person enters or leaves the toilet and calculates the continuous occupancy time. When occupancy exceeds a preset safety threshold (default 30 minutes), the system outputs an abnormal alert and notifies family members or caregivers to check in time, preventing accidents such as falls, sudden illness (stroke, heart attack) or exhaustion that may prevent the elderly from moving by themselves. Application scenarios: solo-living elder households, nursing homes, senior apartments. The system runs automatically; if the elderly stay in the toilet for more than 30 minutes without coming out, urgent reminders are pushed via app suggesting an on-site check. Skill features: sudden illness or falls during toileting that prevent the elderly from calling for help is a common safety risk. Automatic occupancy-time monitoring helps detect anomalies in time and gain rescue time. Can be integrated into nursing-home management systems or home-security platforms to enhance elderly safety.\n\n通过在卫生间门口（或内部仅检测人体，不采集隐私细节）安装的摄像头，利用人体检测和进出跟踪技术，识别老年人进入和离开卫生间的时刻，计算连续占用时间。当占用时间超过预设安全阈值（默认30分钟）时，输出异常预警，通知家属或护理人员及时查看，预防老年人因跌倒、突发疾病（如中风、心梗）或体力不支导致的无法自主移动等意外。应用场景：独居老人家庭、养老院、老年公寓。系统自动监测，若老人进入卫生间超过30分钟未出，通过APP推送紧急提醒并建议上门查看。技能特点：老年人如厕时突发疾病或跌倒后无法呼救是常见安全隐患。通过自动监测停留时间，可及时发现异常，争取救援时间。该技能可集成到养老院管理系统或居家安防平台中，提升老人安全保障水平。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人安全监测 AI。你的任务是分析卫生间门口（或内部仅检测人体轮廓）固定摄像头的视频，检测老年人的进入和离开事件，计算每次在卫生间内的连续停留时间。当停留时间超过预设阈值（默认 30 分钟）时，输出异常预警。为保护隐私，系统可对画面进行模糊化处理，仅识别人体进出。不要提供医疗诊断或具体救援操作方案，仅输出基于人体进出的统计与预警结果。** |\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 | 阈值判定（默认 30 分钟 |\n| 6 | 可覆盖） |\n| 7 | 分级预警（none / info / warning / critical） |\n| 8 | 紧急联系人通知建议 |\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_toilet_time_abnormal_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_toilet_time_abnormal_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_toilet_time_abnormal_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_toilet_time_abnormal_analysis.py`](scripts/smyx_elderly_toilet_time_abnormal_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_toilet_time_abnormal_analysis --input /path/to/toilet_door.mp4\n\n# 分析网络卫生间门口监控视频\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --url https://example.com/toilet_door.mp4\n\n# 显示历史如厕监测报告（自动触发关键词：查看如厕时间历史报告、卫生间停留报告清单等）\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --input toilet.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --input toilet.mp4 --output result.json\n```\n\nFile v1.0.9:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-elderly-toilet-time-abnormal-analysis\",\n  \"version\": \"1.0.9\",\n  \"publishedAt\": 1787144852366\n}\n\nFile v1.0.9:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放老年人如厕时间异常（超30分钟）识别 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_TOILET_TIME_ABNORMAL_ANALYSIS` - 老年人如厕时间异常（超30分钟）识别\n\n## 输入约束\n\n- 推荐摄像头安装于卫生间门口（首选）\n- 如必须安装在卫生间内部，**仅检测人体轮廓**，画面建议做模糊化/像素化处理，禁止采集隐私细节\n- 24 小时全天候采集（含红外夜视）\n- 视频帧率建议 ≥ 10 FPS\n\n## 关键检测事件\n\n- `enter_toilet` - 进入卫生间事件（含时间戳）\n- `exit_toilet` - 离开卫生间事件（含时间戳）\n- `current_occupancy_sec` - 当前连续停留秒数\n- `occupancy_session` - 完整一次停留会话（起止时间 + 持续秒数）\n\n## 默认安全阈值（可由调用方覆盖）\n\n- 如厕停留预警阈值：30 分钟（toilet_duration_threshold_min）\n- 分级预警：\n  - 20-30min → info（接近阈值）\n  - 30-60min → warning（异常）\n  - ≥ 60min → critical（紧急，疑似突发疾病/跌倒）\n\n## 输出字段（参考）\n\n- `person_detected` - 是否检测到人体\n- `is_in_toilet` - 当前是否在卫生间内\n- `enter_time` - 本次进入时间\n- `current_duration_min` - 本次停留时长（分钟）\n- `occupancy_history` - 当日如厕会话历史\n- `abnormal_alert` - 是否触发停留时间异常预警\n- `alert_level` - 预警等级（none / info / warning / critical）\n- `alert_message` - 预警文本（如\"老人已在卫生间停留 35 分钟，建议立即上门查看\"）\n- `suggested_contacts` - 建议通知的联系人（子女 / 护理人员 / 社区网格员）\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: dev\n\nFile v1.0.9:skill-card.md\n\n## Description:\n\nAnalyzes bathroom doorway or privacy-filtered bathroom video to detect elderly toilet entry and exit events, calculate continuous occupancy time, and alert when the stay exceeds the default 30-minute threshold.\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, family members, nursing-home operators, and safety-monitoring agents use this skill to analyze provided video or video URLs for unusually long elderly bathroom occupancy and to retrieve structured monitoring reports. It supports alert-oriented monitoring only and does not provide medical diagnosis.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill processes highly sensitive bathroom-related video, URLs, report history, and identity-linked metadata through configured lifeemergence.com services.\n\nMitigation: Use only with clear consent from the monitored person or legal caregiver, prefer doorway-only or pre-blurred footage, avoid unrelated URLs, and verify retention, account, and credential handling before production use.\n\nRisk: The skill silently creates or reuses local account identity and tokens.\n\nMitigation: Review account and token handling before installation, restrict execution to trusted environments, and avoid exposing identity values in user-facing output.\n\nRisk: Long bathroom occupancy alerts can be mistaken for medical conclusions.\n\nMitigation: Treat results as auxiliary occupancy alerts and require human verification for emergency response or care decisions.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/18072937735/skills/smyx-elderly-toilet-time-abnormal-analysis)\n- [API interface reference](references/api_doc.md)\n- [Skill demo](https://lifeemergence.com/sample.html)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, json, shell commands, guidance]\n\n**Output Format:** [Markdown text containing structured JSON analysis results, alert details, history listings, and report links.]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Accepts local video files or video URLs; documented inputs include mp4, avi, and mov files up to 10 MB.]\n\n## Skill Version(s):\n\n1.0.9 (source: server release metadata; artifact frontmatter reports 1.0.10)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.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, 40880 bytes\n\nFiles: references/api_doc.md (2358b), scripts/__init__.py (56b), scripts/config.py (707b), scripts/config.yaml (3b), scripts/skill.py (599b), scripts/smyx_elderly_toilet_time_abnormal_analysis.py (3655b), skill-card.md (2606b), SKILL.md (12802b), 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 (161b)\n\nFile v1.0.8:SKILL.md\n\n---\nname: \"smyx-elderly-toilet-time-abnormal-analysis\"\ndescription: \"Using a camera installed at the bathroom doorway (or inside the bathroom only detecting human silhouettes, without capturing private details), the system uses human detection and entry/exit tracking to identify when an elderly person enters or leaves the toilet and calculates the continuous occupancy time. | 通过在卫生间门口（或内部仅检测人体，不采集隐私细节）安装的摄像头，利用人体检测和进出跟踪技术，识别老年人进入和离开卫生间的时刻，计算连续占用时间。当占用时间超过预设安全阈值（默认30分钟）时，输出异常预警，通知家属或护理人员及时查看，预防老年人因跌倒、突发疾病（如中风、心梗）或体力不支导致的无法自主移动等意外。\"\nversion: \"1.0.8\"\nlicense: \"MIT-0\"\n---\n\n# 🚽 Elderly Toilet Time Abnormal Detection (>30 min) | 老年人如厕时间异常（超30分钟）识别\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **老年人如厕时间异常（超30分钟）识别** |\n| 🎯 核心目标 | 通过在卫生间门口（或内部仅检测人体，不采集隐私细节）安装的摄像头，利用人体检测和进出跟踪技术，识别老年人进入和离开卫生间的时刻，计算连续占用时间。当占用时间超过预设安全阈值（默认30分钟）时，输出异常预警，通知家属或护理人员及时查看，预防老年人因跌倒、突发疾病（如中风、心梗）或体力不支导致的无法自主移动等意外。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_TOILET_TIME_ABNORMAL_ANALYSIS` |\n\nUsing a camera installed at the bathroom doorway (or inside the bathroom only detecting human silhouettes, without capturing private details), the system uses human detection and entry/exit tracking to identify when an elderly person enters or leaves the toilet and calculates the continuous occupancy time. When occupancy exceeds a preset safety threshold (default 30 minutes), the system outputs an abnormal alert and notifies family members or caregivers to check in time, preventing accidents such as falls, sudden illness (stroke, heart attack) or exhaustion that may prevent the elderly from moving by themselves. Application scenarios: solo-living elder households, nursing homes, senior apartments. The system runs automatically; if the elderly stay in the toilet for more than 30 minutes without coming out, urgent reminders are pushed via app suggesting an on-site check. Skill features: sudden illness or falls during toileting that prevent the elderly from calling for help is a common safety risk. Automatic occupancy-time monitoring helps detect anomalies in time and gain rescue time. Can be integrated into nursing-home management systems or home-security platforms to enhance elderly safety.\n\n通过在卫生间门口（或内部仅检测人体，不采集隐私细节）安装的摄像头，利用人体检测和进出跟踪技术，识别老年人进入和离开卫生间的时刻，计算连续占用时间。当占用时间超过预设安全阈值（默认30分钟）时，输出异常预警，通知家属或护理人员及时查看，预防老年人因跌倒、突发疾病（如中风、心梗）或体力不支导致的无法自主移动等意外。应用场景：独居老人家庭、养老院、老年公寓。系统自动监测，若老人进入卫生间超过30分钟未出，通过APP推送紧急提醒并建议上门查看。技能特点：老年人如厕时突发疾病或跌倒后无法呼救是常见安全隐患。通过自动监测停留时间，可及时发现异常，争取救援时间。该技能可集成到养老院管理系统或居家安防平台中，提升老人安全保障水平。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人安全监测 AI。你的任务是分析卫生间门口（或内部仅检测人体轮廓）固定摄像头的视频，检测老年人的进入和离开事件，计算每次在卫生间内的连续停留时间。当停留时间超过预设阈值（默认 30 分钟）时，输出异常预警。为保护隐私，系统可对画面进行模糊化处理，仅识别人体进出。不要提供医疗诊断或具体救援操作方案，仅输出基于人体进出的统计与预警结果。** |\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 | 阈值判定（默认 30 分钟 |\n| 6 | 可覆盖） |\n| 7 | 分级预警（none / info / warning / critical） |\n| 8 | 紧急联系人通知建议 |\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_toilet_time_abnormal_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_toilet_time_abnormal_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_toilet_time_abnormal_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_toilet_time_abnormal_analysis.py`](scripts/smyx_elderly_toilet_time_abnormal_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_toilet_time_abnormal_analysis --input /path/to/toilet_door.mp4\n\n# 分析网络卫生间门口监控视频\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --url https://example.com/toilet_door.mp4\n\n# 显示历史如厕监测报告（自动触发关键词：查看如厕时间历史报告、卫生间停留报告清单等）\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --input toilet.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --input toilet.mp4 --output result.json\n```\n\nFile v1.0.8:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-elderly-toilet-time-abnormal-analysis\",\n  \"version\": \"1.0.8\",\n  \"publishedAt\": 1786599815912\n}\n\nFile v1.0.8:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放老年人如厕时间异常（超30分钟）识别 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_TOILET_TIME_ABNORMAL_ANALYSIS` - 老年人如厕时间异常（超30分钟）识别\n\n## 输入约束\n\n- 推荐摄像头安装于卫生间门口（首选）\n- 如必须安装在卫生间内部，**仅检测人体轮廓**，画面建议做模糊化/像素化处理，禁止采集隐私细节\n- 24 小时全天候采集（含红外夜视）\n- 视频帧率建议 ≥ 10 FPS\n\n## 关键检测事件\n\n- `enter_toilet` - 进入卫生间事件（含时间戳）\n- `exit_toilet` - 离开卫生间事件（含时间戳）\n- `current_occupancy_sec` - 当前连续停留秒数\n- `occupancy_session` - 完整一次停留会话（起止时间 + 持续秒数）\n\n## 默认安全阈值（可由调用方覆盖）\n\n- 如厕停留预警阈值：30 分钟（toilet_duration_threshold_min）\n- 分级预警：\n  - 20-30min → info（接近阈值）\n  - 30-60min → warning（异常）\n  - ≥ 60min → critical（紧急，疑似突发疾病/跌倒）\n\n## 输出字段（参考）\n\n- `person_detected` - 是否检测到人体\n- `is_in_toilet` - 当前是否在卫生间内\n- `enter_time` - 本次进入时间\n- `current_duration_min` - 本次停留时长（分钟）\n- `occupancy_history` - 当日如厕会话历史\n- `abnormal_alert` - 是否触发停留时间异常预警\n- `alert_level` - 预警等级（none / info / warning / critical）\n- `alert_message` - 预警文本（如\"老人已在卫生间停留 35 分钟，建议立即上门查看\"）\n- `suggested_contacts` - 建议通知的联系人（子女 / 护理人员 / 社区网格员）\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\nAnalyzes privacy-preserving bathroom doorway or silhouette-only video to track an elder's toilet occupancy duration and issue an alert when the configured threshold, default 30 minutes, is exceeded.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[18072937735](https://clawhub.ai/user/18072937735)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal caregivers, family members, nursing-home operators, and care-platform integrators use this skill to monitor toilet occupancy time from approved video sources and surface abnormal-stay alerts for human follow-up.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill processes highly sensitive bathroom-monitoring footage and occupancy reports.\n\nMitigation: Use only in controlled care settings with explicit informed consent, approved camera placement, and privacy-preserving capture such as doorway placement, silhouette-only detection, blur, or pixelation.\n\nRisk: Analysis, report history, identity values, and tokens may be handled by external lifeemergence cloud services and local SQLite storage.\n\nMitigation: Review cloud service use, token handling, retention, and local storage controls before installation; restrict access to trusted operators and approved environments.\n\nRisk: The skill emits safety alerts and suggestions but is not a medical diagnosis or emergency-response system.\n\nMitigation: Treat alerts as prompts for human verification and maintain a separate emergency response plan for elder care incidents.\n\n## Reference(s):\n\n- [ClawHub release page](https://clawhub.ai/18072937735/skills/smyx-elderly-toilet-time-abnormal-analysis)\n- [API interface documentation](references/api_doc.md)\n- [Shared analysis API documentation](skills/smyx_analysis/references/api_doc.md)\n- [Skill demo](https://lifeemergence.com/sample.html)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Markdown, JSON, Shell commands, Configuration]\n\n**Output Format:** [JSON or Markdown text containing structured monitoring results, alert status, suggestions, and report links.]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May save the returned report text to a local file when an output path is provided.]\n\n## Skill Version(s):\n\n1.0.8 (source: frontmatter and server release evidence)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.8:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.8:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.7: 31 files, 40833 bytes\n\nFiles: references/api_doc.md (2358b), scripts/__init__.py (56b), scripts/config.py (707b), scripts/config.yaml (3b), scripts/skill.py (599b), scripts/smyx_elderly_toilet_time_abnormal_analysis.py (3655b), skill-card.md (2681b), SKILL.md (12802b), 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 (161b)\n\nFile v1.0.7:SKILL.md\n\n---\nname: \"smyx-elderly-toilet-time-abnormal-analysis\"\ndescription: \"Using a camera installed at the bathroom doorway (or inside the bathroom only detecting human silhouettes, without capturing private details), the system uses human detection and entry/exit tracking to identify when an elderly person enters or leaves the toilet and calculates the continuous occupancy time. | 通过在卫生间门口（或内部仅检测人体，不采集隐私细节）安装的摄像头，利用人体检测和进出跟踪技术，识别老年人进入和离开卫生间的时刻，计算连续占用时间。当占用时间超过预设安全阈值（默认30分钟）时，输出异常预警，通知家属或护理人员及时查看，预防老年人因跌倒、突发疾病（如中风、心梗）或体力不支导致的无法自主移动等意外。\"\nversion: \"1.0.7\"\nlicense: \"MIT-0\"\n---\n\n# 🚽 Elderly Toilet Time Abnormal Detection (>30 min) | 老年人如厕时间异常（超30分钟）识别\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **老年人如厕时间异常（超30分钟）识别** |\n| 🎯 核心目标 | 通过在卫生间门口（或内部仅检测人体，不采集隐私细节）安装的摄像头，利用人体检测和进出跟踪技术，识别老年人进入和离开卫生间的时刻，计算连续占用时间。当占用时间超过预设安全阈值（默认30分钟）时，输出异常预警，通知家属或护理人员及时查看，预防老年人因跌倒、突发疾病（如中风、心梗）或体力不支导致的无法自主移动等意外。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_TOILET_TIME_ABNORMAL_ANALYSIS` |\n\nUsing a camera installed at the bathroom doorway (or inside the bathroom only detecting human silhouettes, without capturing private details), the system uses human detection and entry/exit tracking to identify when an elderly person enters or leaves the toilet and calculates the continuous occupancy time. When occupancy exceeds a preset safety threshold (default 30 minutes), the system outputs an abnormal alert and notifies family members or caregivers to check in time, preventing accidents such as falls, sudden illness (stroke, heart attack) or exhaustion that may prevent the elderly from moving by themselves. Application scenarios: solo-living elder households, nursing homes, senior apartments. The system runs automatically; if the elderly stay in the toilet for more than 30 minutes without coming out, urgent reminders are pushed via app suggesting an on-site check. Skill features: sudden illness or falls during toileting that prevent the elderly from calling for help is a common safety risk. Automatic occupancy-time monitoring helps detect anomalies in time and gain rescue time. Can be integrated into nursing-home management systems or home-security platforms to enhance elderly safety.\n\n通过在卫生间门口（或内部仅检测人体，不采集隐私细节）安装的摄像头，利用人体检测和进出跟踪技术，识别老年人进入和离开卫生间的时刻，计算连续占用时间。当占用时间超过预设安全阈值（默认30分钟）时，输出异常预警，通知家属或护理人员及时查看，预防老年人因跌倒、突发疾病（如中风、心梗）或体力不支导致的无法自主移动等意外。应用场景：独居老人家庭、养老院、老年公寓。系统自动监测，若老人进入卫生间超过30分钟未出，通过APP推送紧急提醒并建议上门查看。技能特点：老年人如厕时突发疾病或跌倒后无法呼救是常见安全隐患。通过自动监测停留时间，可及时发现异常，争取救援时间。该技能可集成到养老院管理系统或居家安防平台中，提升老人安全保障水平。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人安全监测 AI。你的任务是分析卫生间门口（或内部仅检测人体轮廓）固定摄像头的视频，检测老年人的进入和离开事件，计算每次在卫生间内的连续停留时间。当停留时间超过预设阈值（默认 30 分钟）时，输出异常预警。为保护隐私，系统可对画面进行模糊化处理，仅识别人体进出。不要提供医疗诊断或具体救援操作方案，仅输出基于人体进出的统计与预警结果。** |\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 | 阈值判定（默认 30 分钟 |\n| 6 | 可覆盖） |\n| 7 | 分级预警（none / info / warning / critical） |\n| 8 | 紧急联系人通知建议 |\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_toilet_time_abnormal_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_toilet_time_abnormal_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_toilet_time_abnormal_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_toilet_time_abnormal_analysis.py`](scripts/smyx_elderly_toilet_time_abnormal_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_toilet_time_abnormal_analysis --input /path/to/toilet_door.mp4\n\n# 分析网络卫生间门口监控视频\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --url https://example.com/toilet_door.mp4\n\n# 显示历史如厕监测报告（自动触发关键词：查看如厕时间历史报告、卫生间停留报告清单等）\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --input toilet.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --input toilet.mp4 --output result.json\n```\n\nFile v1.0.7:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-elderly-toilet-time-abnormal-analysis\",\n  \"version\": \"1.0.7\",\n  \"publishedAt\": 1785755009409\n}\n\nFile v1.0.7:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放老年人如厕时间异常（超30分钟）识别 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_TOILET_TIME_ABNORMAL_ANALYSIS` - 老年人如厕时间异常（超30分钟）识别\n\n## 输入约束\n\n- 推荐摄像头安装于卫生间门口（首选）\n- 如必须安装在卫生间内部，**仅检测人体轮廓**，画面建议做模糊化/像素化处理，禁止采集隐私细节\n- 24 小时全天候采集（含红外夜视）\n- 视频帧率建议 ≥ 10 FPS\n\n## 关键检测事件\n\n- `enter_toilet` - 进入卫生间事件（含时间戳）\n- `exit_toilet` - 离开卫生间事件（含时间戳）\n- `current_occupancy_sec` - 当前连续停留秒数\n- `occupancy_session` - 完整一次停留会话（起止时间 + 持续秒数）\n\n## 默认安全阈值（可由调用方覆盖）\n\n- 如厕停留预警阈值：30 分钟（toilet_duration_threshold_min）\n- 分级预警：\n  - 20-30min → info（接近阈值）\n  - 30-60min → warning（异常）\n  - ≥ 60min → critical（紧急，疑似突发疾病/跌倒）\n\n## 输出字段（参考）\n\n- `person_detected` - 是否检测到人体\n- `is_in_toilet` - 当前是否在卫生间内\n- `enter_time` - 本次进入时间\n- `current_duration_min` - 本次停留时长（分钟）\n- `occupancy_history` - 当日如厕会话历史\n- `abnormal_alert` - 是否触发停留时间异常预警\n- `alert_level` - 预警等级（none / info / warning / critical）\n- `alert_message` - 预警文本（如\"老人已在卫生间停留 35 分钟，建议立即上门查看\"）\n- `suggested_contacts` - 建议通知的联系人（子女 / 护理人员 / 社区网格员）\n\n> 仅基于人体进出与停留时长输出统计与预警，不提供医疗诊断；为保护隐私，原始画面建议在采集端做模糊化/像素化处理。\n\nFile v1.0.7:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.7:scripts/config.yaml\n\n{}\n\nFile v1.0.7:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.7:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.7:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.7:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: prod\n\nFile v1.0.7:skill-card.md\n\n## Description: <br>\nAnalyzes bathroom doorway or privacy-filtered monitoring video to track an elderly person's toilet occupancy time and produce an abnormal alert when the stay exceeds the configured threshold. <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>\nCaregivers, family members, and elder-care operators use this skill to analyze bathroom doorway or privacy-filtered monitoring video for extended toilet occupancy and receive structured alerts and report links when occupancy exceeds the threshold. It is an assistive monitoring tool and does not provide medical diagnosis. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Highly sensitive bathroom-monitoring videos or URLs may be sent to cloud services for analysis. <br>\nMitigation: Use only with explicit consent from the monitored person or authorized caregiver, prefer bathroom-doorway or privacy-filtered sources, and restrict inputs to trusted camera URLs or files. <br>\nRisk: The skill may automatically create or reuse identity records and store tokens locally. <br>\nMitigation: Run it in a controlled environment, review local storage and token handling before deployment, and avoid exposing internal identity values in user-facing output. <br>\nRisk: Automated occupancy alerts can be incomplete, delayed, or incorrect and are not medical diagnoses. <br>\nMitigation: Treat alerts as prompts for human verification and maintain a separate emergency-response process. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/18072937735/skills/smyx-elderly-toilet-time-abnormal-analysis) <br>\n- [Publisher profile](https://clawhub.ai/user/18072937735) <br>\n- [API interface reference](artifact/references/api_doc.md) <br>\n- [Skill demo](https://lifeemergence.com/sample.html) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Text, Markdown, JSON] <br>\n**Output Format:** [Markdown text with structured JSON content and report links] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Can optionally write the generated report text to a local output file when --output is provided.] <br>\n\n## Skill Version(s): <br>\n1.0.7 (source: server release metadata and SKILL.md frontmatter) <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, 41048 bytes\n\nFiles: references/api_doc.md (2358b), scripts/__init__.py (56b), scripts/config.py (707b), scripts/config.yaml (3b), scripts/skill.py (599b), scripts/smyx_elderly_toilet_time_abnormal_analysis.py (3655b), skill-card.md (3064b), SKILL.md (12802b), 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 (161b)\n\nFile v1.0.6:SKILL.md\n\n---\nname: \"smyx-elderly-toilet-time-abnormal-analysis\"\ndescription: \"Using a camera installed at the bathroom doorway (or inside the bathroom only detecting human silhouettes, without capturing private details), the system uses human detection and entry/exit tracking to identify when an elderly person enters or leaves the toilet and calculates the continuous occupancy time. | 通过在卫生间门口（或内部仅检测人体，不采集隐私细节）安装的摄像头，利用人体检测和进出跟踪技术，识别老年人进入和离开卫生间的时刻，计算连续占用时间。当占用时间超过预设安全阈值（默认30分钟）时，输出异常预警，通知家属或护理人员及时查看，预防老年人因跌倒、突发疾病（如中风、心梗）或体力不支导致的无法自主移动等意外。\"\nversion: \"1.0.6\"\nlicense: \"MIT-0\"\n---\n\n# 🚽 Elderly Toilet Time Abnormal Detection (>30 min) | 老年人如厕时间异常（超30分钟）识别\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **老年人如厕时间异常（超30分钟）识别** |\n| 🎯 核心目标 | 通过在卫生间门口（或内部仅检测人体，不采集隐私细节）安装的摄像头，利用人体检测和进出跟踪技术，识别老年人进入和离开卫生间的时刻，计算连续占用时间。当占用时间超过预设安全阈值（默认30分钟）时，输出异常预警，通知家属或护理人员及时查看，预防老年人因跌倒、突发疾病（如中风、心梗）或体力不支导致的无法自主移动等意外。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_TOILET_TIME_ABNORMAL_ANALYSIS` |\n\nUsing a camera installed at the bathroom doorway (or inside the bathroom only detecting human silhouettes, without capturing private details), the system uses human detection and entry/exit tracking to identify when an elderly person enters or leaves the toilet and calculates the continuous occupancy time. When occupancy exceeds a preset safety threshold (default 30 minutes), the system outputs an abnormal alert and notifies family members or caregivers to check in time, preventing accidents such as falls, sudden illness (stroke, heart attack) or exhaustion that may prevent the elderly from moving by themselves. Application scenarios: solo-living elder households, nursing homes, senior apartments. The system runs automatically; if the elderly stay in the toilet for more than 30 minutes without coming out, urgent reminders are pushed via app suggesting an on-site check. Skill features: sudden illness or falls during toileting that prevent the elderly from calling for help is a common safety risk. Automatic occupancy-time monitoring helps detect anomalies in time and gain rescue time. Can be integrated into nursing-home management systems or home-security platforms to enhance elderly safety.\n\n通过在卫生间门口（或内部仅检测人体，不采集隐私细节）安装的摄像头，利用人体检测和进出跟踪技术，识别老年人进入和离开卫生间的时刻，计算连续占用时间。当占用时间超过预设安全阈值（默认30分钟）时，输出异常预警，通知家属或护理人员及时查看，预防老年人因跌倒、突发疾病（如中风、心梗）或体力不支导致的无法自主移动等意外。应用场景：独居老人家庭、养老院、老年公寓。系统自动监测，若老人进入卫生间超过30分钟未出，通过APP推送紧急提醒并建议上门查看。技能特点：老年人如厕时突发疾病或跌倒后无法呼救是常见安全隐患。通过自动监测停留时间，可及时发现异常，争取救援时间。该技能可集成到养老院管理系统或居家安防平台中，提升老人安全保障水平。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人安全监测 AI。你的任务是分析卫生间门口（或内部仅检测人体轮廓）固定摄像头的视频，检测老年人的进入和离开事件，计算每次在卫生间内的连续停留时间。当停留时间超过预设阈值（默认 30 分钟）时，输出异常预警。为保护隐私，系统可对画面进行模糊化处理，仅识别人体进出。不要提供医疗诊断或具体救援操作方案，仅输出基于人体进出的统计与预警结果。** |\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 | 阈值判定（默认 30 分钟 |\n| 6 | 可覆盖） |\n| 7 | 分级预警（none / info / warning / critical） |\n| 8 | 紧急联系人通知建议 |\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_toilet_time_abnormal_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_toilet_time_abnormal_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_toilet_time_abnormal_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_toilet_time_abnormal_analysis.py`](scripts/smyx_elderly_toilet_time_abnormal_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_toilet_time_abnormal_analysis --input /path/to/toilet_door.mp4\n\n# 分析网络卫生间门口监控视频\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --url https://example.com/toilet_door.mp4\n\n# 显示历史如厕监测报告（自动触发关键词：查看如厕时间历史报告、卫生间停留报告清单等）\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --input toilet.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --input toilet.mp4 --output result.json\n```\n\nFile v1.0.6:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-elderly-toilet-time-abnormal-analysis\",\n  \"version\": \"1.0.6\",\n  \"publishedAt\": 1785101069464\n}\n\nFile v1.0.6:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放老年人如厕时间异常（超30分钟）识别 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_TOILET_TIME_ABNORMAL_ANALYSIS` - 老年人如厕时间异常（超30分钟）识别\n\n## 输入约束\n\n- 推荐摄像头安装于卫生间门口（首选）\n- 如必须安装在卫生间内部，**仅检测人体轮廓**，画面建议做模糊化/像素化处理，禁止采集隐私细节\n- 24 小时全天候采集（含红外夜视）\n- 视频帧率建议 ≥ 10 FPS\n\n## 关键检测事件\n\n- `enter_toilet` - 进入卫生间事件（含时间戳）\n- `exit_toilet` - 离开卫生间事件（含时间戳）\n- `current_occupancy_sec` - 当前连续停留秒数\n- `occupancy_session` - 完整一次停留会话（起止时间 + 持续秒数）\n\n## 默认安全阈值（可由调用方覆盖）\n\n- 如厕停留预警阈值：30 分钟（toilet_duration_threshold_min）\n- 分级预警：\n  - 20-30min → info（接近阈值）\n  - 30-60min → warning（异常）\n  - ≥ 60min → critical（紧急，疑似突发疾病/跌倒）\n\n## 输出字段（参考）\n\n- `person_detected` - 是否检测到人体\n- `is_in_toilet` - 当前是否在卫生间内\n- `enter_time` - 本次进入时间\n- `current_duration_min` - 本次停留时长（分钟）\n- `occupancy_history` - 当日如厕会话历史\n- `abnormal_alert` - 是否触发停留时间异常预警\n- `alert_level` - 预警等级（none / info / warning / critical）\n- `alert_message` - 预警文本（如\"老人已在卫生间停留 35 分钟，建议立即上门查看\"）\n- `suggested_contacts` - 建议通知的联系人（子女 / 护理人员 / 社区网格员）\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 privacy-conscious bathroom doorway or silhouette video to detect elderly toilet entry and exit events, estimate continuous occupancy time, and alert when the stay exceeds a configured threshold such as 30 minutes. <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, family members, nursing-home operators, and home-safety integrators use this skill to monitor toilet occupancy duration from approved camera feeds and surface abnormal-stay alerts for human follow-up. It provides safety monitoring support and does not provide medical diagnosis or emergency-response instructions. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Bathroom monitoring video and history are highly sensitive and are processed through configured cloud services. <br>\nMitigation: Deploy only with monitored-person or legal-guardian consent, confirm cloud processing is acceptable, prefer doorway placement or silhouette-only capture, and apply blur or pixelation where internal bathroom capture is unavoidable. <br>\nRisk: Local identity, account, token, and monitoring-history linkage can be stored in the workspace SQLite database. <br>\nMitigation: Treat the local data directory as sensitive, restrict filesystem access, avoid shared default identities in real deployments, and scope each household or user identity separately. <br>\nRisk: URL-based inputs can cause configured services to retrieve monitoring media from external locations. <br>\nMitigation: Accept only trusted video URLs and approved media sources, and verify that the configured lifeemergence.com service endpoints are appropriate for the deployment environment. <br>\n\n\n## Reference(s): <br>\n- [ClawHub Skill Page](https://clawhub.ai/18072937735/skills/smyx-elderly-toilet-time-abnormal-analysis) <br>\n- [Skill Demo](https://lifeemergence.com/sample.html) <br>\n- [API Documentation](artifact/references/api_doc.md) <br>\n- [Common Analysis API Documentation](artifact/skills/smyx_analysis/references/api_doc.md) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Text, Markdown, JSON, Files] <br>\n**Output Format:** [Markdown status text with structured JSON analysis content, alert details, history-list output, report links, and optional saved output files.] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Local video inputs are validated for supported formats and size before cloud submission; URL inputs are passed to the configured service for retrieval.] <br>\n\n## Skill Version(s): <br>\n1.0.6 (source: frontmatter and server release metadata) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v1.0.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, 40897 bytes\n\nFiles: references/api_doc.md (2358b), scripts/__init__.py (56b), scripts/config.py (707b), scripts/config.yaml (3b), scripts/skill.py (599b), scripts/smyx_elderly_toilet_time_abnormal_analysis.py (3655b), skill-card.md (2684b), SKILL.md (12802b), 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 (161b)\n\nFile v1.0.5:SKILL.md\n\n---\nname: \"smyx-elderly-toilet-time-abnormal-analysis\"\ndescription: \"Using a camera installed at the bathroom doorway (or inside the bathroom only detecting human silhouettes, without capturing private details), the system uses human detection and entry/exit tracking to identify when an elderly person enters or leaves the toilet and calculates the continuous occupancy time. | 通过在卫生间门口（或内部仅检测人体，不采集隐私细节）安装的摄像头，利用人体检测和进出跟踪技术，识别老年人进入和离开卫生间的时刻，计算连续占用时间。当占用时间超过预设安全阈值（默认30分钟）时，输出异常预警，通知家属或护理人员及时查看，预防老年人因跌倒、突发疾病（如中风、心梗）或体力不支导致的无法自主移动等意外。\"\nversion: \"1.0.5\"\nlicense: \"MIT-0\"\n---\n\n# 🚽 Elderly Toilet Time Abnormal Detection (>30 min) | 老年人如厕时间异常（超30分钟）识别\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **老年人如厕时间异常（超30分钟）识别** |\n| 🎯 核心目标 | 通过在卫生间门口（或内部仅检测人体，不采集隐私细节）安装的摄像头，利用人体检测和进出跟踪技术，识别老年人进入和离开卫生间的时刻，计算连续占用时间。当占用时间超过预设安全阈值（默认30分钟）时，输出异常预警，通知家属或护理人员及时查看，预防老年人因跌倒、突发疾病（如中风、心梗）或体力不支导致的无法自主移动等意外。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_TOILET_TIME_ABNORMAL_ANALYSIS` |\n\nUsing a camera installed at the bathroom doorway (or inside the bathroom only detecting human silhouettes, without capturing private details), the system uses human detection and entry/exit tracking to identify when an elderly person enters or leaves the toilet and calculates the continuous occupancy time. When occupancy exceeds a preset safety threshold (default 30 minutes), the system outputs an abnormal alert and notifies family members or caregivers to check in time, preventing accidents such as falls, sudden illness (stroke, heart attack) or exhaustion that may prevent the elderly from moving by themselves. Application scenarios: solo-living elder households, nursing homes, senior apartments. The system runs automatically; if the elderly stay in the toilet for more than 30 minutes without coming out, urgent reminders are pushed via app suggesting an on-site check. Skill features: sudden illness or falls during toileting that prevent the elderly from calling for help is a common safety risk. Automatic occupancy-time monitoring helps detect anomalies in time and gain rescue time. Can be integrated into nursing-home management systems or home-security platforms to enhance elderly safety.\n\n通过在卫生间门口（或内部仅检测人体，不采集隐私细节）安装的摄像头，利用人体检测和进出跟踪技术，识别老年人进入和离开卫生间的时刻，计算连续占用时间。当占用时间超过预设安全阈值（默认30分钟）时，输出异常预警，通知家属或护理人员及时查看，预防老年人因跌倒、突发疾病（如中风、心梗）或体力不支导致的无法自主移动等意外。应用场景：独居老人家庭、养老院、老年公寓。系统自动监测，若老人进入卫生间超过30分钟未出，通过APP推送紧急提醒并建议上门查看。技能特点：老年人如厕时突发疾病或跌倒后无法呼救是常见安全隐患。通过自动监测停留时间，可及时发现异常，争取救援时间。该技能可集成到养老院管理系统或居家安防平台中，提升老人安全保障水平。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人安全监测 AI。你的任务是分析卫生间门口（或内部仅检测人体轮廓）固定摄像头的视频，检测老年人的进入和离开事件，计算每次在卫生间内的连续停留时间。当停留时间超过预设阈值（默认 30 分钟）时，输出异常预警。为保护隐私，系统可对画面进行模糊化处理，仅识别人体进出。不要提供医疗诊断或具体救援操作方案，仅输出基于人体进出的统计与预警结果。** |\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 | 阈值判定（默认 30 分钟 |\n| 6 | 可覆盖） |\n| 7 | 分级预警（none / info / warning / critical） |\n| 8 | 紧急联系人通知建议 |\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_toilet_time_abnormal_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_toilet_time_abnormal_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_toilet_time_abnormal_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_toilet_time_abnormal_analysis.py`](scripts/smyx_elderly_toilet_time_abnormal_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_toilet_time_abnormal_analysis --input /path/to/toilet_door.mp4\n\n# 分析网络卫生间门口监控视频\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --url https://example.com/toilet_door.mp4\n\n# 显示历史如厕监测报告（自动触发关键词：查看如厕时间历史报告、卫生间停留报告清单等）\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --input toilet.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --input toilet.mp4 --output result.json\n```\n\nFile v1.0.5:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-elderly-toilet-time-abnormal-analysis\",\n  \"version\": \"1.0.5\",\n  \"publishedAt\": 1784252071008\n}\n\nFile v1.0.5:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放老年人如厕时间异常（超30分钟）识别 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_TOILET_TIME_ABNORMAL_ANALYSIS` - 老年人如厕时间异常（超30分钟）识别\n\n## 输入约束\n\n- 推荐摄像头安装于卫生间门口（首选）\n- 如必须安装在卫生间内部，**仅检测人体轮廓**，画面建议做模糊化/像素化处理，禁止采集隐私细节\n- 24 小时全天候采集（含红外夜视）\n- 视频帧率建议 ≥ 10 FPS\n\n## 关键检测事件\n\n- `enter_toilet` - 进入卫生间事件（含时间戳）\n- `exit_toilet` - 离开卫生间事件（含时间戳）\n- `current_occupancy_sec` - 当前连续停留秒数\n- `occupancy_session` - 完整一次停留会话（起止时间 + 持续秒数）\n\n## 默认安全阈值（可由调用方覆盖）\n\n- 如厕停留预警阈值：30 分钟（toilet_duration_threshold_min）\n- 分级预警：\n  - 20-30min → info（接近阈值）\n  - 30-60min → warning（异常）\n  - ≥ 60min → critical（紧急，疑似突发疾病/跌倒）\n\n## 输出字段（参考）\n\n- `person_detected` - 是否检测到人体\n- `is_in_toilet` - 当前是否在卫生间内\n- `enter_time` - 本次进入时间\n- `current_duration_min` - 本次停留时长（分钟）\n- `occupancy_history` - 当日如厕会话历史\n- `abnormal_alert` - 是否触发停留时间异常预警\n- `alert_level` - 预警等级（none / info / warning / critical）\n- `alert_message` - 预警文本（如\"老人已在卫生间停留 35 分钟，建议立即上门查看\"）\n- `suggested_contacts` - 建议通知的联系人（子女 / 护理人员 / 社区网格员）\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>\nAnalyzes bathroom doorway or privacy-preserving silhouette video to detect elderly toilet entry and exit events, calculate continuous occupancy time, and alert when a stay exceeds the configured safety threshold. <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>\nCaregivers, nursing-home operators, and home-safety system developers use this skill to monitor toilet occupancy duration from privacy-preserving camera inputs and surface abnormal-stay alerts for human follow-up. It provides monitoring statistics and alerts, not medical diagnosis or rescue instructions. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill processes highly sensitive bathroom-monitoring footage or URLs through cloud APIs. <br>\nMitigation: Use doorway-only or pre-blurred footage where possible, avoid credential-bearing URLs, and deploy only with informed consent from the monitored person or authorized caregivers. <br>\nRisk: Cloud history queries and report links may expose sensitive elder-care records if access controls or retention practices are weak. <br>\nMitigation: Verify publisher retention, deletion, authentication, and access-control practices before use in a care environment. <br>\nRisk: The skill silently creates or reuses persistent local or remote user identities and tokens. <br>\nMitigation: Review account association behavior before deployment and ensure operators understand how identities, tokens, and historical reports are created, reused, and revoked. <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-toilet-time-abnormal-analysis) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, json, shell commands, guidance] <br>\n**Output Format:** [Markdown summary with structured JSON analysis results and report links] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Can list cloud-hosted historical reports and export report links when requested.] <br>\n\n## Skill Version(s): <br>\n1.0.5 (source: SKILL.md frontmatter and server release metadata) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v1.0.5:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.5:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.4: 31 files, 40811 bytes\n\nFiles: references/api_doc.md (2358b), scripts/__init__.py (56b), scripts/config.py (707b), scripts/config.yaml (3b), scripts/skill.py (599b), scripts/smyx_elderly_toilet_time_abnormal_analysis.py (3655b), skill-card.md (2795b), SKILL.md (12802b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (473b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28605b), _meta.json (161b)\n\nFile v1.0.4:SKILL.md\n\n---\nname: \"smyx-elderly-toilet-time-abnormal-analysis\"\ndescription: \"Using a camera installed at the bathroom doorway (or inside the bathroom only detecting human silhouettes, without capturing private details), the system uses human detection and entry/exit tracking to identify when an elderly person enters or leaves the toilet and calculates the continuous occupancy time. | 通过在卫生间门口（或内部仅检测人体，不采集隐私细节）安装的摄像头，利用人体检测和进出跟踪技术，识别老年人进入和离开卫生间的时刻，计算连续占用时间。当占用时间超过预设安全阈值（默认30分钟）时，输出异常预警，通知家属或护理人员及时查看，预防老年人因跌倒、突发疾病（如中风、心梗）或体力不支导致的无法自主移动等意外。\"\nversion: \"1.0.4\"\nlicense: \"MIT-0\"\n---\n\n# 🚽 Elderly Toilet Time Abnormal Detection (>30 min) | 老年人如厕时间异常（超30分钟）识别\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **老年人如厕时间异常（超30分钟）识别** |\n| 🎯 核心目标 | 通过在卫生间门口（或内部仅检测人体，不采集隐私细节）安装的摄像头，利用人体检测和进出跟踪技术，识别老年人进入和离开卫生间的时刻，计算连续占用时间。当占用时间超过预设安全阈值（默认30分钟）时，输出异常预警，通知家属或护理人员及时查看，预防老年人因跌倒、突发疾病（如中风、心梗）或体力不支导致的无法自主移动等意外。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_TOILET_TIME_ABNORMAL_ANALYSIS` |\n\nUsing a camera installed at the bathroom doorway (or inside the bathroom only detecting human silhouettes, without capturing private details), the system uses human detection and entry/exit tracking to identify when an elderly person enters or leaves the toilet and calculates the continuous occupancy time. When occupancy exceeds a preset safety threshold (default 30 minutes), the system outputs an abnormal alert and notifies family members or caregivers to check in time, preventing accidents such as falls, sudden illness (stroke, heart attack) or exhaustion that may prevent the elderly from moving by themselves. Application scenarios: solo-living elder households, nursing homes, senior apartments. The system runs automatically; if the elderly stay in the toilet for more than 30 minutes without coming out, urgent reminders are pushed via app suggesting an on-site check. Skill features: sudden illness or falls during toileting that prevent the elderly from calling for help is a common safety risk. Automatic occupancy-time monitoring helps detect anomalies in time and gain rescue time. Can be integrated into nursing-home management systems or home-security platforms to enhance elderly safety.\n\n通过在卫生间门口（或内部仅检测人体，不采集隐私细节）安装的摄像头，利用人体检测和进出跟踪技术，识别老年人进入和离开卫生间的时刻，计算连续占用时间。当占用时间超过预设安全阈值（默认30分钟）时，输出异常预警，通知家属或护理人员及时查看，预防老年人因跌倒、突发疾病（如中风、心梗）或体力不支导致的无法自主移动等意外。应用场景：独居老人家庭、养老院、老年公寓。系统自动监测，若老人进入卫生间超过30分钟未出，通过APP推送紧急提醒并建议上门查看。技能特点：老年人如厕时突发疾病或跌倒后无法呼救是常见安全隐患。通过自动监测停留时间，可及时发现异常，争取救援时间。该技能可集成到养老院管理系统或居家安防平台中，提升老人安全保障水平。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人安全监测 AI。你的任务是分析卫生间门口（或内部仅检测人体轮廓）固定摄像头的视频，检测老年人的进入和离开事件，计算每次在卫生间内的连续停留时间。当停留时间超过预设阈值（默认 30 分钟）时，输出异常预警。为保护隐私，系统可对画面进行模糊化处理，仅识别人体进出。不要提供医疗诊断或具体救援操作方案，仅输出基于人体进出的统计与预警结果。** |\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 | 阈值判定（默认 30 分钟 |\n| 6 | 可覆盖） |\n| 7 | 分级预警（none / info / warning / critical） |\n| 8 | 紧急联系人通知建议 |\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_toilet_time_abnormal_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_elderly_toilet_time_abnormal_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_toilet_time_abnormal_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_toilet_time_abnormal_analysis.py`](scripts/smyx_elderly_toilet_time_abnormal_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_toilet_time_abnormal_analysis --input /path/to/toilet_door.mp4\n\n# 分析网络卫生间门口监控视频\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --url https://example.com/toilet_door.mp4\n\n# 显示历史如厕监测报告（自动触发关键词：查看如厕时间历史报告、卫生间停留报告清单等）\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --input toilet.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --input toilet.mp4 --output result.json\n```\n\nFile v1.0.4:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-elderly-toilet-time-abnormal-analysis\",\n  \"version\": \"1.0.4\",\n  \"publishedAt\": 1783570647486\n}\n\nFile v1.0.4:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放老年人如厕时间异常（超30分钟）识别 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_TOILET_TIME_ABNORMAL_ANALYSIS` - 老年人如厕时间异常（超30分钟）识别\n\n## 输入约束\n\n- 推荐摄像头安装于卫生间门口（首选）\n- 如必须安装在卫生间内部，**仅检测人体轮廓**，画面建议做模糊化/像素化处理，禁止采集隐私细节\n- 24 小时全天候采集（含红外夜视）\n- 视频帧率建议 ≥ 10 FPS\n\n## 关键检测事件\n\n- `enter_toilet` - 进入卫生间事件（含时间戳）\n- `exit_toilet` - 离开卫生间事件（含时间戳）\n- `current_occupancy_sec` - 当前连续停留秒数\n- `occupancy_session` - 完整一次停留会话（起止时间 + 持续秒数）\n\n## 默认安全阈值（可由调用方覆盖）\n\n- 如厕停留预警阈值：30 分钟（toilet_duration_threshold_min）\n- 分级预警：\n  - 20-30min → info（接近阈值）\n  - 30-60min → warning（异常）\n  - ≥ 60min → critical（紧急，疑似突发疾病/跌倒）\n\n## 输出字段（参考）\n\n- `person_detected` - 是否检测到人体\n- `is_in_toilet` - 当前是否在卫生间内\n- `enter_time` - 本次进入时间\n- `current_duration_min` - 本次停留时长（分钟）\n- `occupancy_history` - 当日如厕会话历史\n- `abnormal_alert` - 是否触发停留时间异常预警\n- `alert_level` - 预警等级（none / info / warning / critical）\n- `alert_message` - 预警文本（如\"老人已在卫生间停留 35 分钟，建议立即上门查看\"）\n- `suggested_contacts` - 建议通知的联系人（子女 / 护理人员 / 社区网格员）\n\n> 仅基于人体进出与停留时长输出统计与预警，不提供医疗诊断；为保护隐私，原始画面建议在采集端做模糊化/像素化处理。\n\nFile v1.0.4:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.4:scripts/config.yaml\n\n{}\n\nFile v1.0.4:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.4:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.4:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.4:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: prod\n\nFile v1.0.4:skill-card.md\n\n## Description: <br>\nDetects elderly bathroom occupancy from doorway or privacy-preserving silhouette video, tracks entry and exit, and alerts caregivers when continuous toilet time exceeds a configurable threshold, defaulting to 30 minutes. <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, family members, and elder-care operators use this skill to analyze bathroom doorway or privacy-preserving silhouette video and review structured alerts or history when an elderly person remains in the toilet longer than the safety threshold. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Bathroom-monitoring videos or URLs and cloud report history may expose highly sensitive personal information. <br>\nMitigation: Use the skill only with informed consent from the monitored person or legal caregiver, prefer doorway placement or silhouette-only blurred footage, and review the Life Emergence service provider and retention policy before deployment. <br>\nRisk: Cloud report history is tied to an automatically managed identity and local tokens. <br>\nMitigation: Deploy only where identity lifecycle, local token storage, access control, and report retention have been approved; do not expose internal identity values in user-facing output. <br>\nRisk: Arbitrary third-party video URLs or unblurred bathroom footage increase privacy and security exposure. <br>\nMitigation: Restrict inputs to trusted video sources and privacy-preserving footage, and avoid submitting unblurred bathroom media. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/18072937735/skills/smyx-elderly-toilet-time-abnormal-analysis) <br>\n- [Skill demo](https://lifeemergence.com/sample.html) <br>\n- [API interface documentation](references/api_doc.md) <br>\n- [SMYX analysis API documentation](skills/smyx_analysis/references/api_doc.md) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Text, Markdown, JSON, Guidance] <br>\n**Output Format:** [Markdown text containing structured JSON analysis, alert status, history listings, and report export links.] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May write the same textual result to a caller-specified output file.] <br>\n\n## Skill Version(s): <br>\n1.0.4 (source: server release metadata and SKILL.md frontmatter) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v1.0.4:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.4:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3","readmeExcerpt":"Skill: Elderly Toilet Time Abnormal Detection (>30 min) | 老年人如厕时间异常（超30分钟）识别 Owner: 18072937735 Summary: Using a camera installed at the bathroom doorway (or inside the bathroom only detecting human silhouettes, without capturing private details), the system uses human detection and entry/exit tracking to identify when an elderly person enters or leaves the toilet and calculates the continuous occupancy time. | 通过在卫生","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"python -m scripts.smyx_elderly_toilet_time_abnormal_analysis --list"},{"language":"text","snippet":"requests>=2.28.0"},{"language":"bash","snippet":"# 分析本地卫生间门口监控视频\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --input /path/to/toilet_door.mp4\n\n# 分析网络卫生间门口监控视频\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --url https://example.com/toilet_door.mp4\n\n# 显示历史如厕监测报告（自动触发关键词：查看如厕时间历史报告、卫生间停留报告清单等）\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --input toilet.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --input toilet.mp4 --output result.json"},{"language":"bash","snippet":"python -m scripts.smyx_elderly_toilet_time_abnormal_analysis --list"},{"language":"text","snippet":"requests>=2.28.0"},{"language":"bash","snippet":"# 分析本地卫生间门口监控视频\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --input /path/to/toilet_door.mp4\n\n# 分析网络卫生间门口监控视频\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --url https://example.com/toilet_door.mp4\n\n# 显示历史如厕监测报告（自动触发关键词：查看如厕时间历史报告、卫生间停留报告清单等）\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --input toilet.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_elderly_toilet_time_abnormal_analysis --input toilet.mp4 --output result.json"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: \"smyx-elderly-toilet-time-abnormal-analysis\"\ndescription: \"Using a camera installed at the bathroom doorway (or inside the bathroom only detecting human silhouettes, without capturing private details), the system uses human detection and entry/exit tracking to identify when an elderly person enters or leaves the toilet and calculates the continuous occupancy time. | 通过在卫生间门口（或内部仅检测人体，不采集隐私细节）安装的摄像头，利用人体检测和进出跟踪技术，识别老年人进入和离开卫生间的时刻，计算连续占用时间。当占用时间超过预设安全阈值（默认30分钟）时，输出异常预警，通知家属或护理人员及时查看，预防老年人因跌倒、突发疾病（如中风、心梗）或体力不支导致的无法自主移动等意外。\"\nversion: \"1.0.14\"\nlicense: \"MIT-0\"\n---\n\n# 🚽 Elderly Toilet Time Abnormal Detection (>30 min) | 老年人如厕时间异常（超30分钟）识别\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **老年人如厕时间异常（超30分钟）识别** |\n| 🎯 核心目标 | 通过在卫生间门口（或内部仅检测人体，不采集隐私细节）安装的摄像头，利用人体检测和进出跟踪技术，识别老年人进入和离开卫生间的时刻，计算连续占用时间。当占用时间超过预设安全阈值（默认30分钟）时，输出异常预警，通知家属或护理人员及时查看，预防老年人因跌倒、突发疾病（如中风、心梗）或体力不支导致的无法自主移动等意外。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_ELDERLY_TOILET_TIME_ABNORMAL_ANALYSIS` |\n\nUsing a camera installed at the bathroom doorway (or inside the bathroom only detecting human silhouettes, without capturing private details), the system uses human detection and entry/exit tracking to identify when an elderly person enters or leaves the toilet and calculates the continuous occupancy time. When occupancy exceeds a preset safety threshold (default 30 minutes), the system outputs an abnormal alert and notifies family members or caregivers to check in time, preventing accidents such as falls, sudden illness (stroke, heart attack) or exhaustion that may prevent the elderly from moving by themselves. Application scenarios: solo-living elder households, nursing homes, senior apartments. The system runs automatically; if the elderly stay in the toilet for more than 30 minutes without coming out, urgent reminders are pushed via app suggesting an on-site check. Skill features: sudden illness or falls during toileting that prevent the elderly from calling for help is a common safety risk. Automatic occupancy-time monitoring helps detect anomalies in time and gain rescue time. Can be integrated into nursing-home management systems or home-security platforms to enhance elderly safety.\n\n通过在卫生间门口（或内部仅检测人体，不采集隐私细节）安装的摄像头，利用人体检测和进出跟踪技术，识别老年人进入和离开卫生间的时刻，计算连续占用时间。当占用时间超过预设安全阈值（默认30分钟）时，输出异常预警，通知家属或护理人员及时查看，预防老年人因跌倒、突发疾病（如中风、心梗）或体力不支导致的无法自主移动等意外。应用场景：独居老人家庭、养老院、老年公寓。系统自动监测，若老人进入卫生间超过30分钟未出，通过APP推送紧急提醒并建议上门查看。技能特点：老年人如厕时突发疾病或跌倒后无法呼救是常见安全隐患。通过自动监测停留时间，可及时发现异常，争取救援时间。该技能可集成到养老院管理系统或居家安防平台中，提升老人安全保障水平。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的老年人安全监测 AI。你的任务是分析卫生间门口（或内部仅检测人体轮廓）固定摄像头的视频，检测老年人的进入和离开事件，计算每次在卫生间内的连续停留时间。当停留时间超过预设阈值（默认 30 分钟）时，输出异常预警。为保护隐私，系统可对画面进行模糊化处理，仅识别人体进出。不要提供医疗诊断或具体救援操作方案，仅输出基于人体进出的统计与预警结果。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于卫生间门口/内部隐私化人体监控视频，识别老人进出事件并"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-elderly-toilet-time-abnormal-analysis\",\n  \"version\": \"1.0.13\",\n  \"publishedAt\": 1790543974438\n}"},{"path":"references/api_doc.md","content":"# API 接口文档\n\n此处用于存放老年人如厕时间异常（超30分钟）识别 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_TOILET_TIME_ABNORMAL_ANALYSIS` - 老年人如厕时间异常（超30分钟）识别\n\n## 输入约束\n\n- 推荐摄像头安装于卫生间门口（首选）\n- 如必须安装在卫生间内部，**仅检测人体轮廓**，画面建议做模糊化/像素化处理，禁止采集隐私细节\n- 24 小时全天候采集（含红外夜视）\n- 视频帧率建议 ≥ 10 FPS\n\n## 关键检测事件\n\n- `enter_toilet` - 进入卫生间事件（含时间戳）\n- `exit_toilet` - 离开卫生间事件（含时间戳）\n- `current_occupancy_sec` - 当前连续停留秒数\n- `occupancy_session` - 完整一次停留会话（起止时间 + 持续秒数）\n\n## 默认安全阈值（可由调用方覆盖）\n\n- 如厕停留预警阈值：30 分钟（toilet_duration_threshold_min）\n- 分级预警：\n  - 20-30min → info（接近阈值）\n  - 30-60min → warning（异常）\n  - ≥ 60min → critical（紧急，疑似突发疾病/跌倒）\n\n## 输出字段（参考）\n\n- `person_detected` - 是否检测到人体\n- `is_in_toilet` - 当前是否在卫生间内\n- `enter_time` - 本次进入时间\n- `current_duration_min` - 本次停留时长（分钟）\n- `occupancy_history` - 当日如厕会话历史\n- `abnormal_alert` - 是否触发停留时间异常预警\n- `alert_level` - 预警等级（none / info / warning / critical）\n- `alert_message` - 预警文本（如\"老人已在卫生间停留 35 分钟，建议立即上门查看\"）\n- `suggested_contacts` - 建议通知的联系人（子女 / 护理人员 / 社区网格员）\n\n> 仅基于人体进出与停留时长输出统计与预警，不提供医疗诊断；为保护隐私，原始画面建议在采集端做模糊化/像素化处理。"},{"path":"skills/smyx_analysis/references/api_doc.md","content":"# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |"},{"path":"scripts/config.yaml","content":"{}"}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":null,"editorialQuality":{"score":100,"threshold":65,"status":"thin","wordCount":1079,"uniquenessScore":43,"reasons":["uniqueness-below-45"]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-09T16:57:50.973Z","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-09T16:57:50.973Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-10T07:21:33.466Z","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"}]}}}