{"id":"f24e0d20-689f-486a-a441-96b22657670c","entityType":"agent","slug":"clawhub-smyx-sunjinhui-smyx-driver-blink-fatigue-detection-anal","name":"Driver Blink-Rate & Eye-Closure Fatigue Detection | 驾驶员眨眼频率与闭眼时长检测","canonicalUrl":"https://www.xpersona.co/agent/clawhub-smyx-sunjinhui-smyx-driver-blink-fatigue-detection-anal","canonicalPath":"/agent/clawhub-smyx-sunjinhui-smyx-driver-blink-fatigue-detection-anal","generatedAt":"2026-10-10T05:55:20.499Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T01:26:54.512Z","emptyReason":null},"description":"Using an in-cabin DMS camera, the system analyzes the driver's facial video in real time, detects eye open/closed state, calculates blink rate per minute (normal range 15-20 blinks/min), and identifies single-blink closure duration. | 通过车载DMS摄像头实时分析驾驶员面部视频，检测眼部开闭状态，计算每分钟眨眼频率（正常约为15-20次/分钟），并识别闭眼持续时间。当眨眼频率异常降低（如<10次/分钟）或出现单次闭眼超过2秒（微睡眠前兆）时，输出疲劳驾驶预警，联动车内语音提醒或震动座椅，预防因疲劳导致的事故。","descriptionLabel":"Source description","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 1.8K downloads reported by the source. Last updated 10/10/2026.","installCommand":"clawhub skill install s17cfv2h26b7hq5w47tgfy23xx83z9x6:smyx-driver-blink-fatigue-detection-analysis","sourceUrl":"https://clawhub.ai/smyx-sunjinhui/smyx-driver-blink-fatigue-detection-analysis","homepage":"https://clawhub.ai/smyx-sunjinhui/skills/smyx-driver-blink-fatigue-detection-analysis","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/smyx-sunjinhui/smyx-driver-blink-fatigue-detection-analysis","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/smyx-sunjinhui/skills/smyx-driver-blink-fatigue-detection-analysis","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":65,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Driver Blink-Rate & Eye-Closure Fatigue Detection | 驾驶员眨眼频率与闭眼时长检测 technical dossier on Xpersona with agent coverage, OPENCLEW support, and live trust metadata."},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-10T01:26:54.512Z","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-10T01:26:54.512Z","emptyReason":null},"stars":null,"forks":null,"downloads":1807,"packageName":null,"latestVersion":"1.0.11","tractionLabel":"1.8K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T01:26:54.487Z","emptyReason":null},"lastUpdatedAt":"2026-10-10T01:26:54.512Z","lastCrawledAt":"2026-10-10T01:26:54.487Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-11T01:26:54.487Z","lastVerifiedAt":null,"highlights":[{"version":"1.0.11","createdAt":"2026-10-02T16:25:27.217Z","changelog":"- Removed the file: skill-card.md - No other user-facing changes in functionality or documentation. - Housekeeping update; skill features and workflow remain unchanged.","fileCount":31,"zipByteSize":40855},{"version":"1.0.10","createdAt":"2026-09-26T02:50:25.404Z","changelog":"- Updated SKILL.md with new version number and minor documentation adjustments - Incremented skill version in SKILL.md from 1.0.13 to 1.0.15 - Removed the file skill-card.md as part of documentation cleanup - Modified skills/smyx_common/scripts/config.yaml (details not shown) - General documentation and metadata improvements; no functional changes noted","fileCount":31,"zipByteSize":40846},{"version":"1.0.9","createdAt":"2026-09-08T19:18:30.973Z","changelog":"- Version bump: updated version number from 1.0.12 to 1.0.13 in SKILL.md. - Documentation update: revised and replaced SKILL.md with minor metadata change. - Removed obsolete documentation file: skill-card.md deleted. - No changes to core logic, functionality, or features.","fileCount":31,"zipByteSize":41122},{"version":"1.0.8","createdAt":"2026-08-24T19:24:29.524Z","changelog":"- Updated skill documentation in SKILL.md with version and minor content changes. - Removed redundant or outdated file: skill-card.md. - No changes to functionality or core logic; documentation only.","fileCount":31,"zipByteSize":41145},{"version":"1.0.7","createdAt":"2026-08-17T11:45:29.359Z","changelog":"- Removed the file `skill-card.md`. - No changes to code or functionality; documentation and skill capabilities remain the same.","fileCount":31,"zipByteSize":41145},{"version":"1.0.6","createdAt":"2026-08-15T20:52:28.879Z","changelog":"- Updated skill version to 1.0.10. - Revised documentation in SKILL.md with minor edits and improvements. - Removed redundant file: skill-card.md. - Adjusted configuration in skills/smyx_common/scripts/config.yaml. - No functional or user-facing feature changes.","fileCount":31,"zipByteSize":40977},{"version":"1.0.5","createdAt":"2026-08-04T05:20:31.815Z","changelog":"- Removed the file skill-card.md from the project. - No changes to code or features; documentation content remains unchanged. - Maintenance update to file organization only.","fileCount":31,"zipByteSize":41193},{"version":"1.0.4","createdAt":"2026-07-28T15:32:31.944Z","changelog":"- Updated SKILL.md with new version number and refinements to documentation. - Removed the redundant file skill-card.md. - No functional changes to code or behavior. This release focuses on improved and updated skill documentation only.","fileCount":31,"zipByteSize":40918}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s17cfv2h26b7hq5w47tgfy23xx83z9x6:smyx-driver-blink-fatigue-detection-analysis","setupComplexity":"low","setupSteps":["Install using `clawhub skill install s17cfv2h26b7hq5w47tgfy23xx83z9x6:smyx-driver-blink-fatigue-detection-analysis` in an isolated environment before connecting it to live workloads.","No published capability contract is available yet, so validate auth and request/response behavior manually.","Review the upstream CLAWHUB listing at https://clawhub.ai/smyx-sunjinhui/smyx-driver-blink-fatigue-detection-analysis before using production credentials."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-driver-blink-fatigue-detection-anal/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-driver-blink-fatigue-detection-anal/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-driver-blink-fatigue-detection-anal/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-driver-blink-fatigue-detection-anal/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-driver-blink-fatigue-detection-anal/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-driver-blink-fatigue-detection-anal/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-10T05:55:20.495Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-driver-blink-fatigue-detection-anal/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-driver-blink-fatigue-detection-anal/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-driver-blink-fatigue-detection-anal/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-driver-blink-fatigue-detection-anal/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T01:26:54.512Z","emptyReason":null},"readme":"Skill: Driver Blink-Rate & Eye-Closure Fatigue Detection | 驾驶员眨眼频率与闭眼时长检测\n\nOwner: smyx-sunjinhui\n\nSummary: Using an in-cabin DMS camera, the system analyzes the driver's facial video in real time, detects eye open/closed state, calculates blink rate per minute (normal range 15-20 blinks/min), and identifies single-blink closure duration. | 通过车载DMS摄像头实时分析驾驶员面部视频，检测眼部开闭状态，计算每分钟眨眼频率（正常约为15-20次/分钟），并识别闭眼持续时间。当眨眼频率异常降低（如<10次/分钟）或出现单次闭眼超过2秒（微睡眠前兆）时，输出疲劳驾驶预警，联动车内语音提醒或震动座椅，预防因疲劳导致的事故。\n\nTags: latest:1.0.11\n\nVersion history:\n\nv1.0.11 | 2026-10-02T16:25:27.217Z | auto\n\n- Removed the file: skill-card.md\n- No other user-facing changes in functionality or documentation.\n- Housekeeping update; skill features and workflow remain unchanged.\n\nv1.0.10 | 2026-09-26T02:50:25.404Z | auto\n\n- Updated SKILL.md with new version number and minor documentation adjustments\n- Incremented skill version in SKILL.md from 1.0.13 to 1.0.15\n- Removed the file skill-card.md as part of documentation cleanup\n- Modified skills/smyx_common/scripts/config.yaml (details not shown)\n- General documentation and metadata improvements; no functional changes noted\n\nv1.0.9 | 2026-09-08T19:18:30.973Z | auto\n\n- Version bump: updated version number from 1.0.12 to 1.0.13 in SKILL.md.\n- Documentation update: revised and replaced SKILL.md with minor metadata change.\n- Removed obsolete documentation file: skill-card.md deleted.\n- No changes to core logic, functionality, or features.\n\nv1.0.8 | 2026-08-24T19:24:29.524Z | auto\n\n- Updated skill documentation in SKILL.md with version and minor content changes.\n- Removed redundant or outdated file: skill-card.md.\n- No changes to functionality or core logic; documentation only.\n\nv1.0.7 | 2026-08-17T11:45:29.359Z | auto\n\n- Removed the file `skill-card.md`.\n- No changes to code or functionality; documentation and skill capabilities remain the same.\n\nv1.0.6 | 2026-08-15T20:52:28.879Z | auto\n\n- Updated skill version to 1.0.10.\n- Revised documentation in SKILL.md with minor edits and improvements.\n- Removed redundant file: skill-card.md.\n- Adjusted configuration in skills/smyx_common/scripts/config.yaml.\n- No functional or user-facing feature changes.\n\nv1.0.5 | 2026-08-04T05:20:31.815Z | auto\n\n- Removed the file skill-card.md from the project.\n- No changes to code or features; documentation content remains unchanged.\n- Maintenance update to file organization only.\n\nv1.0.4 | 2026-07-28T15:32:31.944Z | auto\n\n- Updated SKILL.md with new version number and refinements to documentation.\n- Removed the redundant file skill-card.md.\n- No functional changes to code or behavior. This release focuses on improved and updated skill documentation only.\n\nv1.0.3 | 2026-07-17T20:12:28.634Z | auto\n\n- Removed the obsolete skill-card.md file.\n- skills/smyx_common/scripts/util.py was updated.\n- No user-facing features or functional changes.\n\nv1.0.2 | 2026-07-10T04:29:32.666Z | auto\n\n- Updated skill version to 1.0.5.\n- Improved and updated documentation in SKILL.md, including clearer descriptions and refined usage instructions.\n- Changed configuration, data access, and utility scripts (`config.py`, `dao.py`, `util.py`) to support new functionality and documentation changes.\n- Removed redundant or outdated markdown file (`skill-card.md`).\n\nv1.0.1 | 2026-06-29T08:54:26.235Z | auto\n\n- Overhauled documentation for clarity, with a new structured SKILL.md including clear module overview and step-by-step workflow.\n- Changed user identity handling: system now manages identity parameters internally, removing any prompts for user IDs or phone numbers.\n- Updated input/output instructions and examples for video/image file analysis and historical report retrieval.\n- Enhanced description and capabilities listing for fatigue detection and reporting features.\n- Removed legacy files and consolidated documentation resources.\n- Added new visual and multilingual elements for better user guidance.\n\nv1.0.0 | 2026-05-26T01:36:24.236Z | auto\n\nsmyx-driver-blink-fatigue-detection-analysis v1.0.0\n\n- Initial release for real-time driver fatigue detection using in-cabin DMS camera.\n- Detects driver eye open/closed state, calculates blink rate, and identifies prolonged eye closures (microsleep precursors).\n- Triggers in-cabin voice or seat-vibration alerts and uploads events to fleet management platform when fatigue is detected.\n- Provides clear workflow for open-id retrieval, with mandatory user identification before analysis.\n- Strict handling and display of historical driving fatigue reports with detailed Markdown output.\n- Usable in passenger, commercial, ride-hailing, and freight fleet scenarios, with clear privacy requirements.\n\nArchive index:\n\nArchive v1.0.11: 31 files, 40855 bytes\n\nFiles: references/api_doc.md (2847b), scripts/__init__.py (58b), scripts/config.py (701b), scripts/config.yaml (3b), scripts/skill.py (591b), scripts/smyx_driver_blink_fatigue_detection_analysis.py (3647b), skill-card.md (2268b), SKILL.md (12265b), 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 (164b)\n\nFile v1.0.11:SKILL.md\n\n---\nname: \"smyx-driver-blink-fatigue-detection-analysis\"\ndescription: \"Using an in-cabin DMS camera, the system analyzes the driver's facial video in real time, detects eye open/closed state, calculates blink rate per minute (normal range 15-20 blinks/min), and identifies single-blink closure duration. | 通过车载DMS摄像头实时分析驾驶员面部视频，检测眼部开闭状态，计算每分钟眨眼频率（正常约为15-20次/分钟），并识别闭眼持续时间。当眨眼频率异常降低（如<10次/分钟）或出现单次闭眼超过2秒（微睡眠前兆）时，输出疲劳驾驶预警，联动车内语音提醒或震动座椅，预防因疲劳导致的事故。\"\nversion: \"1.0.15\"\nlicense: \"MIT-0\"\n---\n\n# 🚗 Driver Blink-Rate & Eye-Closure Fatigue Detection | 驾驶员眨眼频率与闭眼时长检测\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **驾驶员眨眼频率与闭眼时长检测** |\n| 🎯 核心目标 | 通过车载DMS摄像头实时分析驾驶员面部视频，检测眼部开闭状态，计算每分钟眨眼频率（正常约为15-20次/分钟），并识别闭眼持续时间。当眨眼频率异常降低（如<10次/分钟）或出现单次闭眼超过2秒（微睡眠前兆）时，输出疲劳驾驶预警，联动车内语音提醒或震动座椅，预防因疲劳导致的事故。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_DRIVER_BLINK_FATIGUE_DETECTION_ANALYSIS` |\n\nUsing an in-cabin DMS camera, the system analyzes the driver's facial video in real time, detects eye open/closed state, calculates blink rate per minute (normal range 15-20 blinks/min), and identifies single-blink closure duration. When blink rate drops abnormally low (e.g., < 10 blinks/min) or a single eye-closure exceeds 2 seconds (microsleep precursor), it issues a fatigue-driving alert, triggering in-cabin voice reminders or seat-vibration, helping prevent accidents caused by drowsy driving. Application scenarios: passenger cars, commercial vehicles, ride-hailing fleets, freight fleets. The system monitors in real time and on detection raises audio/visual alerts and uploads events to the fleet-management platform. Skill features: drowsy driving is a major cause of traffic accidents. AI real-time detection of abnormal blinking and microsleep can promptly remind the driver and reduce accident risk. Can be integrated into dashcams, smart cockpits, or ride-hailing safety systems to enhance driving safety.\n\n通过车载DMS摄像头实时分析驾驶员面部视频，检测眼部开闭状态，计算每分钟眨眼频率（正常约为15-20次/分钟），并识别闭眼持续时间。当眨眼频率异常降低（如<10次/分钟）或出现单次闭眼超过2秒（微睡眠前兆）时，输出疲劳驾驶预警，联动车内语音提醒或震动座椅，预防因疲劳导致的事故。应用场景：乘用车、商用车、网约车、货运车队。系统实时监测，当检测到疲劳迹象时发出声光报警，并上传至车队管理平台。技能特点：疲劳驾驶是交通事故的重要原因。通过AI实时检测眨眼异常和微睡眠，可及时提醒驾驶员，降低事故风险。该技能可集成到行车记录仪、智能座舱或网约车安全系统中，提升驾驶安全。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的驾驶员疲劳监测 AI。你的任务是分析驾驶员面部视频，检测眼部状态（睁开/闭合），计算眨眼频率（次/分钟）和单次闭眼持续时间。当眨眼频率低于正常阈值或出现长时间闭眼时，输出疲劳预警。不要提供医疗诊断或睡眠障碍诊断，仅输出基于视觉的疲劳指标与方向性预警提示。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于车载 DMS 摄像头驾驶员面部视频，实时检测眼部开闭状态、计算眨眼频率与闭眼时长，识别微睡眠等疲劳前兆并输出预警\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 驾驶员面部检测 |\n| 2 | 眼部 ROI 关键点定位 |\n| 3 | 眼部开闭分类（open / closed / partial） |\n| 4 | 每分钟眨眼次数统计 |\n| 5 | 平均/最长闭眼时长 |\n| 6 | 微睡眠（单次闭眼 > 2s）识别 |\n| 7 | PERCLOS 计算 |\n| 8 | 疲劳等级判定（normal / mild / moderate / severe） |\n| 9 | 座舱联动动作建议（voice_alert / seat_vibrate / fleet_upload） |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供车载 DMS 驾驶员面部视频 URL 或文件需要分析时，默认触发本技能进行疲劳检测 |\n| 🔎 明确分析意图 | 当用户明确提及驾驶员疲劳、疲劳驾驶、眨眼频率、闭眼时长、微睡眠、PERCLOS、DMS、车载摄像头、行车安全、网约车安全等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看驾驶员疲劳历史报告、疲劳驾驶预警清单、驾驶员监测报告清单、查询历史微睡眠事件、显示所有疲劳驾驶报告、显示车队安全诊断报告，查询疲劳驾驶事件清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_driver_blink_fatigue_detection_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 | 📥 准备车载 DMS 驾驶员面部视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行驾驶员眨眼/闭眼疲劳检测 | 调用 `-m scripts.smyx_driver_blink_fatigue_detection_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地车载 DMS 驾驶员面部视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络车载 DMS 驾驶员面部视频 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_driver_blink_fatigue_detection_analysis.py`](scripts/smyx_driver_blink_fatigue_detection_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；**关键**：帧率必须 ≥ 25 FPS 且能稳定看到双眼 |\n| 🔎 使用提醒 | 检测结果仅作为驾驶员辅助安全提醒，本工具不替代驾驶员主动观察与判断；预警发生时应立即靠边安全休息 |\n| 🔎 使用提醒 | 戴墨镜、严重逆光、面部遮挡、强烈眩光等场景会显著降低检测可靠性 |\n| 🔏 隐私合规 | 隐私合规：车载驾驶员视频涉及个人生物特征隐私，使用前需取得驾驶员/员工知情同意，车队部署应遵循当地隐私法规并妥善保管/加密相关录像 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地车载 DMS 驾驶员视频\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --input /path/to/dms.mp4\n\n# 分析网络车载 DMS 驾驶员视频\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --url https://example.com/dms.mp4\n\n# 显示历史驾驶员疲劳检测报告（自动触发关键词：查看驾驶员疲劳历史报告、疲劳驾驶预警清单等）\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --input dms.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --input dms.mp4 --output result.json\n```\n\nFile v1.0.11:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-driver-blink-fatigue-detection-analysis\",\n  \"version\": \"1.0.11\",\n  \"publishedAt\": 1790958327217\n}\n\nFile v1.0.11:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放驾驶员眨眼频率与闭眼时长检测 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动驾驶员疲劳监测任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取疲劳监测结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史疲劳事件\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_DRIVER_BLINK_FATIGUE_DETECTION_ANALYSIS` - 驾驶员眨眼频率与闭眼时长检测\n\n## 输入约束\n\n- 摄像头：车载 DMS 摄像头（红外/IR-cut 优先）\n- 安装位置：方向盘上方 / A 柱 / 仪表台上方，正对驾驶员面部\n- 帧率：≥ 30 FPS（推荐）；分辨率 ≥ 480p\n- 必须能稳定看到双眼区域；夜间/隧道场景启用红外补光\n- 支持戴普通眼镜，墨镜会显著影响检测\n\n## 关键观测指标\n\n- `eye_state` - 眼部状态时序（open / closed / partial）\n- `blink_count_per_minute` - 每分钟眨眼次数（次/分钟）\n- `avg_blink_duration_ms` - 平均单次眨眼持续时长（毫秒）\n- `max_closed_eye_duration_ms` - 单次最长闭眼时长（毫秒）\n- `microsleep_count` - 微睡眠事件次数（单次闭眼 > 2s）\n- `perclos` - PERCLOS（80% 阈值下，单位时间内闭眼帧占比）\n\n## 正常/异常阈值（可由调用方覆盖）\n\n- 正常眨眼频率：15-20 次/分钟\n- 眨眼频率偏低告警阈值：< 10 次/分钟\n- 单次闭眼超过 2 秒 → 触发微睡眠预警\n- PERCLOS > 0.15 → 中度疲劳；> 0.30 → 重度疲劳\n\n## 预警类型\n\n- `low_blink_rate` - 眨眼频率过低\n- `microsleep` - 微睡眠（单次闭眼 > 2s）\n- `prolonged_eye_closure` - 长时间闭眼（> 3s）\n- `high_perclos` - PERCLOS 超阈值（持续疲劳）\n- `eyes_off_road` - 视线长时间偏离前方（参考）\n\n## 输出字段（参考）\n\n- `driver_detected` - 是否检测到驾驶员\n- `eye_visible` - 双眼是否可见（戴墨镜/遮挡时为 false）\n- `blink_metrics` - 眨眼相关指标（blink_count_per_minute / avg_blink_duration_ms / max_closed_eye_duration_ms / microsleep_count / perclos）\n- `fatigue_level` - 疲劳等级（normal / mild / moderate / severe）\n- `warning_type` - 触发的预警类型\n- `warning_message` - 预警提示文本（如\"驾驶员眨眼频率仅 8 次/分钟且出现 1 次 2.4 秒微睡眠，请立即靠边休息\"）\n- `recommend_action` - 建议的座舱联动动作（voice_alert / seat_vibrate / fleet_upload）\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: prod\n\nFile v1.0.11:skill-card.md\n\n## Description:\n\nAnalyzes driver-facing video for blink rate and eye-closure patterns, returning fatigue indicators, warnings, and report links.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[smyx-sunjinhui](https://clawhub.ai/user/smyx-sunjinhui)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nFleet safety teams and developers use driver-facing video to review blink and eye-closure indicators, receive fatigue warnings, and retrieve historical reports. Alerts are aids to driver judgment, not medical diagnoses or substitutes for safe driving.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Driver-facing footage or video URLs are sent to the LifeEmergence cloud service.\n\nMitigation: Obtain informed consent and clarify retention, deletion, and data-protection controls before uploading sensitive footage.\n\nRisk: Report history is tied to an automatically managed identity, with authentication and profile data stored for reuse.\n\nMitigation: Ask the publisher how identities, tokens, and report history are stored and protected; avoid production fleet or employee footage until these controls are clear.\n\nRisk: Fatigue alerts may be unreliable when eyes are obscured or lighting is poor.\n\nMitigation: Treat visual indicators as advisory only and retain human oversight of driving decisions.\n\n## Reference(s):\n\n- [Driver fatigue detection API documentation](references/api_doc.md)\n- [LifeEmergence skill demonstration](https://lifeemergence.com/sample.html)\n- [ClawHub skill release](https://clawhub.ai/smyx-sunjinhui/skills/smyx-driver-blink-fatigue-detection-analysis)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Markdown, JSON]\n\n**Output Format:** [Structured JSON or Markdown report]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May include fatigue indicators, warnings, suggested actions, historical report listings, and report links.]\n\n## Skill Version(s):\n\n1.0.11 (source: ClawHub release metadata)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.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, 40846 bytes\n\nFiles: references/api_doc.md (2847b), scripts/__init__.py (58b), scripts/config.py (701b), scripts/config.yaml (3b), scripts/skill.py (591b), scripts/smyx_driver_blink_fatigue_detection_analysis.py (3647b), skill-card.md (2296b), SKILL.md (12265b), 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 (164b)\n\nFile v1.0.10:SKILL.md\n\n---\nname: \"smyx-driver-blink-fatigue-detection-analysis\"\ndescription: \"Using an in-cabin DMS camera, the system analyzes the driver's facial video in real time, detects eye open/closed state, calculates blink rate per minute (normal range 15-20 blinks/min), and identifies single-blink closure duration. | 通过车载DMS摄像头实时分析驾驶员面部视频，检测眼部开闭状态，计算每分钟眨眼频率（正常约为15-20次/分钟），并识别闭眼持续时间。当眨眼频率异常降低（如<10次/分钟）或出现单次闭眼超过2秒（微睡眠前兆）时，输出疲劳驾驶预警，联动车内语音提醒或震动座椅，预防因疲劳导致的事故。\"\nversion: \"1.0.15\"\nlicense: \"MIT-0\"\n---\n\n# 🚗 Driver Blink-Rate & Eye-Closure Fatigue Detection | 驾驶员眨眼频率与闭眼时长检测\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **驾驶员眨眼频率与闭眼时长检测** |\n| 🎯 核心目标 | 通过车载DMS摄像头实时分析驾驶员面部视频，检测眼部开闭状态，计算每分钟眨眼频率（正常约为15-20次/分钟），并识别闭眼持续时间。当眨眼频率异常降低（如<10次/分钟）或出现单次闭眼超过2秒（微睡眠前兆）时，输出疲劳驾驶预警，联动车内语音提醒或震动座椅，预防因疲劳导致的事故。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_DRIVER_BLINK_FATIGUE_DETECTION_ANALYSIS` |\n\nUsing an in-cabin DMS camera, the system analyzes the driver's facial video in real time, detects eye open/closed state, calculates blink rate per minute (normal range 15-20 blinks/min), and identifies single-blink closure duration. When blink rate drops abnormally low (e.g., < 10 blinks/min) or a single eye-closure exceeds 2 seconds (microsleep precursor), it issues a fatigue-driving alert, triggering in-cabin voice reminders or seat-vibration, helping prevent accidents caused by drowsy driving. Application scenarios: passenger cars, commercial vehicles, ride-hailing fleets, freight fleets. The system monitors in real time and on detection raises audio/visual alerts and uploads events to the fleet-management platform. Skill features: drowsy driving is a major cause of traffic accidents. AI real-time detection of abnormal blinking and microsleep can promptly remind the driver and reduce accident risk. Can be integrated into dashcams, smart cockpits, or ride-hailing safety systems to enhance driving safety.\n\n通过车载DMS摄像头实时分析驾驶员面部视频，检测眼部开闭状态，计算每分钟眨眼频率（正常约为15-20次/分钟），并识别闭眼持续时间。当眨眼频率异常降低（如<10次/分钟）或出现单次闭眼超过2秒（微睡眠前兆）时，输出疲劳驾驶预警，联动车内语音提醒或震动座椅，预防因疲劳导致的事故。应用场景：乘用车、商用车、网约车、货运车队。系统实时监测，当检测到疲劳迹象时发出声光报警，并上传至车队管理平台。技能特点：疲劳驾驶是交通事故的重要原因。通过AI实时检测眨眼异常和微睡眠，可及时提醒驾驶员，降低事故风险。该技能可集成到行车记录仪、智能座舱或网约车安全系统中，提升驾驶安全。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的驾驶员疲劳监测 AI。你的任务是分析驾驶员面部视频，检测眼部状态（睁开/闭合），计算眨眼频率（次/分钟）和单次闭眼持续时间。当眨眼频率低于正常阈值或出现长时间闭眼时，输出疲劳预警。不要提供医疗诊断或睡眠障碍诊断，仅输出基于视觉的疲劳指标与方向性预警提示。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于车载 DMS 摄像头驾驶员面部视频，实时检测眼部开闭状态、计算眨眼频率与闭眼时长，识别微睡眠等疲劳前兆并输出预警\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 驾驶员面部检测 |\n| 2 | 眼部 ROI 关键点定位 |\n| 3 | 眼部开闭分类（open / closed / partial） |\n| 4 | 每分钟眨眼次数统计 |\n| 5 | 平均/最长闭眼时长 |\n| 6 | 微睡眠（单次闭眼 > 2s）识别 |\n| 7 | PERCLOS 计算 |\n| 8 | 疲劳等级判定（normal / mild / moderate / severe） |\n| 9 | 座舱联动动作建议（voice_alert / seat_vibrate / fleet_upload） |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供车载 DMS 驾驶员面部视频 URL 或文件需要分析时，默认触发本技能进行疲劳检测 |\n| 🔎 明确分析意图 | 当用户明确提及驾驶员疲劳、疲劳驾驶、眨眼频率、闭眼时长、微睡眠、PERCLOS、DMS、车载摄像头、行车安全、网约车安全等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看驾驶员疲劳历史报告、疲劳驾驶预警清单、驾驶员监测报告清单、查询历史微睡眠事件、显示所有疲劳驾驶报告、显示车队安全诊断报告，查询疲劳驾驶事件清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_driver_blink_fatigue_detection_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 | 📥 准备车载 DMS 驾驶员面部视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行驾驶员眨眼/闭眼疲劳检测 | 调用 `-m scripts.smyx_driver_blink_fatigue_detection_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地车载 DMS 驾驶员面部视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络车载 DMS 驾驶员面部视频 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_driver_blink_fatigue_detection_analysis.py`](scripts/smyx_driver_blink_fatigue_detection_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；**关键**：帧率必须 ≥ 25 FPS 且能稳定看到双眼 |\n| 🔎 使用提醒 | 检测结果仅作为驾驶员辅助安全提醒，本工具不替代驾驶员主动观察与判断；预警发生时应立即靠边安全休息 |\n| 🔎 使用提醒 | 戴墨镜、严重逆光、面部遮挡、强烈眩光等场景会显著降低检测可靠性 |\n| 🔏 隐私合规 | 隐私合规：车载驾驶员视频涉及个人生物特征隐私，使用前需取得驾驶员/员工知情同意，车队部署应遵循当地隐私法规并妥善保管/加密相关录像 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地车载 DMS 驾驶员视频\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --input /path/to/dms.mp4\n\n# 分析网络车载 DMS 驾驶员视频\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --url https://example.com/dms.mp4\n\n# 显示历史驾驶员疲劳检测报告（自动触发关键词：查看驾驶员疲劳历史报告、疲劳驾驶预警清单等）\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --input dms.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --input dms.mp4 --output result.json\n```\n\nFile v1.0.10:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-driver-blink-fatigue-detection-analysis\",\n  \"version\": \"1.0.10\",\n  \"publishedAt\": 1790391025404\n}\n\nFile v1.0.10:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放驾驶员眨眼频率与闭眼时长检测 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动驾驶员疲劳监测任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取疲劳监测结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史疲劳事件\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_DRIVER_BLINK_FATIGUE_DETECTION_ANALYSIS` - 驾驶员眨眼频率与闭眼时长检测\n\n## 输入约束\n\n- 摄像头：车载 DMS 摄像头（红外/IR-cut 优先）\n- 安装位置：方向盘上方 / A 柱 / 仪表台上方，正对驾驶员面部\n- 帧率：≥ 30 FPS（推荐）；分辨率 ≥ 480p\n- 必须能稳定看到双眼区域；夜间/隧道场景启用红外补光\n- 支持戴普通眼镜，墨镜会显著影响检测\n\n## 关键观测指标\n\n- `eye_state` - 眼部状态时序（open / closed / partial）\n- `blink_count_per_minute` - 每分钟眨眼次数（次/分钟）\n- `avg_blink_duration_ms` - 平均单次眨眼持续时长（毫秒）\n- `max_closed_eye_duration_ms` - 单次最长闭眼时长（毫秒）\n- `microsleep_count` - 微睡眠事件次数（单次闭眼 > 2s）\n- `perclos` - PERCLOS（80% 阈值下，单位时间内闭眼帧占比）\n\n## 正常/异常阈值（可由调用方覆盖）\n\n- 正常眨眼频率：15-20 次/分钟\n- 眨眼频率偏低告警阈值：< 10 次/分钟\n- 单次闭眼超过 2 秒 → 触发微睡眠预警\n- PERCLOS > 0.15 → 中度疲劳；> 0.30 → 重度疲劳\n\n## 预警类型\n\n- `low_blink_rate` - 眨眼频率过低\n- `microsleep` - 微睡眠（单次闭眼 > 2s）\n- `prolonged_eye_closure` - 长时间闭眼（> 3s）\n- `high_perclos` - PERCLOS 超阈值（持续疲劳）\n- `eyes_off_road` - 视线长时间偏离前方（参考）\n\n## 输出字段（参考）\n\n- `driver_detected` - 是否检测到驾驶员\n- `eye_visible` - 双眼是否可见（戴墨镜/遮挡时为 false）\n- `blink_metrics` - 眨眼相关指标（blink_count_per_minute / avg_blink_duration_ms / max_closed_eye_duration_ms / microsleep_count / perclos）\n- `fatigue_level` - 疲劳等级（normal / mild / moderate / severe）\n- `warning_type` - 触发的预警类型\n- `warning_message` - 预警提示文本（如\"驾驶员眨眼频率仅 8 次/分钟且出现 1 次 2.4 秒微睡眠，请立即靠边休息\"）\n- `recommend_action` - 建议的座舱联动动作（voice_alert / seat_vibrate / fleet_upload）\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: prod\n\nFile v1.0.10:skill-card.md\n\n## Description:\n\nAnalyzes driver-facing video for blink-rate and eye-closure indicators and returns fatigue warnings and reports through a remote service.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[smyx-sunjinhui](https://clawhub.ai/user/smyx-sunjinhui)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and fleet operators can submit driver-facing video or a video URL to obtain fatigue indicators, warnings, and report links, or query historical reports. Results are driver-assistance prompts, not medical diagnoses or a substitute for attentive driving.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Driver-facing video is sent to a remote service and may contain sensitive biometric information.\n\nMitigation: Obtain informed consent before upload and verify the service operator, retention practices, and applicable privacy requirements.\n\nRisk: Historical report lookup and automatic account provisioning may occur without an explicit confirmation step.\n\nMitigation: Confirm the intended account, history-access authorization, and endpoint scope before use; prefer a release that prompts before upload or history lookup.\n\nRisk: The skill may store authentication tokens in plaintext locally.\n\nMitigation: Review token storage and access controls before installation; prefer a release with protected credential storage.\n\n## Reference(s):\n\n- [ClawHub skill release](https://clawhub.ai/smyx-sunjinhui/skills/smyx-driver-blink-fatigue-detection-analysis)\n- [Driver fatigue analysis API documentation](references/api_doc.md)\n\n## Skill Output:\n\n**Output Type(s):** [Analysis, Guidance, Report links]\n\n**Output Format:** [JSON or readable text and Markdown report links]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May include blink and eye-closure metrics, fatigue warnings, recommended actions, and links to historical reports.]\n\n## Skill Version(s):\n\n1.0.10 (source: ClawHub release metadata; embedded SKILL.md lists 1.0.15)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.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, 41122 bytes\n\nFiles: references/api_doc.md (2847b), scripts/__init__.py (58b), scripts/config.py (701b), scripts/config.yaml (3b), scripts/skill.py (591b), scripts/smyx_driver_blink_fatigue_detection_analysis.py (3647b), skill-card.md (2855b), SKILL.md (12265b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (472b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (163b)\n\nFile v1.0.9:SKILL.md\n\n---\nname: \"smyx-driver-blink-fatigue-detection-analysis\"\ndescription: \"Using an in-cabin DMS camera, the system analyzes the driver's facial video in real time, detects eye open/closed state, calculates blink rate per minute (normal range 15-20 blinks/min), and identifies single-blink closure duration. | 通过车载DMS摄像头实时分析驾驶员面部视频，检测眼部开闭状态，计算每分钟眨眼频率（正常约为15-20次/分钟），并识别闭眼持续时间。当眨眼频率异常降低（如<10次/分钟）或出现单次闭眼超过2秒（微睡眠前兆）时，输出疲劳驾驶预警，联动车内语音提醒或震动座椅，预防因疲劳导致的事故。\"\nversion: \"1.0.13\"\nlicense: \"MIT-0\"\n---\n\n# 🚗 Driver Blink-Rate & Eye-Closure Fatigue Detection | 驾驶员眨眼频率与闭眼时长检测\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **驾驶员眨眼频率与闭眼时长检测** |\n| 🎯 核心目标 | 通过车载DMS摄像头实时分析驾驶员面部视频，检测眼部开闭状态，计算每分钟眨眼频率（正常约为15-20次/分钟），并识别闭眼持续时间。当眨眼频率异常降低（如<10次/分钟）或出现单次闭眼超过2秒（微睡眠前兆）时，输出疲劳驾驶预警，联动车内语音提醒或震动座椅，预防因疲劳导致的事故。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_DRIVER_BLINK_FATIGUE_DETECTION_ANALYSIS` |\n\nUsing an in-cabin DMS camera, the system analyzes the driver's facial video in real time, detects eye open/closed state, calculates blink rate per minute (normal range 15-20 blinks/min), and identifies single-blink closure duration. When blink rate drops abnormally low (e.g., < 10 blinks/min) or a single eye-closure exceeds 2 seconds (microsleep precursor), it issues a fatigue-driving alert, triggering in-cabin voice reminders or seat-vibration, helping prevent accidents caused by drowsy driving. Application scenarios: passenger cars, commercial vehicles, ride-hailing fleets, freight fleets. The system monitors in real time and on detection raises audio/visual alerts and uploads events to the fleet-management platform. Skill features: drowsy driving is a major cause of traffic accidents. AI real-time detection of abnormal blinking and microsleep can promptly remind the driver and reduce accident risk. Can be integrated into dashcams, smart cockpits, or ride-hailing safety systems to enhance driving safety.\n\n通过车载DMS摄像头实时分析驾驶员面部视频，检测眼部开闭状态，计算每分钟眨眼频率（正常约为15-20次/分钟），并识别闭眼持续时间。当眨眼频率异常降低（如<10次/分钟）或出现单次闭眼超过2秒（微睡眠前兆）时，输出疲劳驾驶预警，联动车内语音提醒或震动座椅，预防因疲劳导致的事故。应用场景：乘用车、商用车、网约车、货运车队。系统实时监测，当检测到疲劳迹象时发出声光报警，并上传至车队管理平台。技能特点：疲劳驾驶是交通事故的重要原因。通过AI实时检测眨眼异常和微睡眠，可及时提醒驾驶员，降低事故风险。该技能可集成到行车记录仪、智能座舱或网约车安全系统中，提升驾驶安全。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的驾驶员疲劳监测 AI。你的任务是分析驾驶员面部视频，检测眼部状态（睁开/闭合），计算眨眼频率（次/分钟）和单次闭眼持续时间。当眨眼频率低于正常阈值或出现长时间闭眼时，输出疲劳预警。不要提供医疗诊断或睡眠障碍诊断，仅输出基于视觉的疲劳指标与方向性预警提示。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于车载 DMS 摄像头驾驶员面部视频，实时检测眼部开闭状态、计算眨眼频率与闭眼时长，识别微睡眠等疲劳前兆并输出预警\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 驾驶员面部检测 |\n| 2 | 眼部 ROI 关键点定位 |\n| 3 | 眼部开闭分类（open / closed / partial） |\n| 4 | 每分钟眨眼次数统计 |\n| 5 | 平均/最长闭眼时长 |\n| 6 | 微睡眠（单次闭眼 > 2s）识别 |\n| 7 | PERCLOS 计算 |\n| 8 | 疲劳等级判定（normal / mild / moderate / severe） |\n| 9 | 座舱联动动作建议（voice_alert / seat_vibrate / fleet_upload） |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供车载 DMS 驾驶员面部视频 URL 或文件需要分析时，默认触发本技能进行疲劳检测 |\n| 🔎 明确分析意图 | 当用户明确提及驾驶员疲劳、疲劳驾驶、眨眼频率、闭眼时长、微睡眠、PERCLOS、DMS、车载摄像头、行车安全、网约车安全等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看驾驶员疲劳历史报告、疲劳驾驶预警清单、驾驶员监测报告清单、查询历史微睡眠事件、显示所有疲劳驾驶报告、显示车队安全诊断报告，查询疲劳驾驶事件清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_driver_blink_fatigue_detection_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 | 📥 准备车载 DMS 驾驶员面部视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行驾驶员眨眼/闭眼疲劳检测 | 调用 `-m scripts.smyx_driver_blink_fatigue_detection_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地车载 DMS 驾驶员面部视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络车载 DMS 驾驶员面部视频 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_driver_blink_fatigue_detection_analysis.py`](scripts/smyx_driver_blink_fatigue_detection_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；**关键**：帧率必须 ≥ 25 FPS 且能稳定看到双眼 |\n| 🔎 使用提醒 | 检测结果仅作为驾驶员辅助安全提醒，本工具不替代驾驶员主动观察与判断；预警发生时应立即靠边安全休息 |\n| 🔎 使用提醒 | 戴墨镜、严重逆光、面部遮挡、强烈眩光等场景会显著降低检测可靠性 |\n| 🔏 隐私合规 | 隐私合规：车载驾驶员视频涉及个人生物特征隐私，使用前需取得驾驶员/员工知情同意，车队部署应遵循当地隐私法规并妥善保管/加密相关录像 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地车载 DMS 驾驶员视频\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --input /path/to/dms.mp4\n\n# 分析网络车载 DMS 驾驶员视频\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --url https://example.com/dms.mp4\n\n# 显示历史驾驶员疲劳检测报告（自动触发关键词：查看驾驶员疲劳历史报告、疲劳驾驶预警清单等）\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --input dms.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --input dms.mp4 --output result.json\n```\n\nFile v1.0.9:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-driver-blink-fatigue-detection-analysis\",\n  \"version\": \"1.0.9\",\n  \"publishedAt\": 1788895110973\n}\n\nFile v1.0.9:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放驾驶员眨眼频率与闭眼时长检测 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动驾驶员疲劳监测任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取疲劳监测结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史疲劳事件\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_DRIVER_BLINK_FATIGUE_DETECTION_ANALYSIS` - 驾驶员眨眼频率与闭眼时长检测\n\n## 输入约束\n\n- 摄像头：车载 DMS 摄像头（红外/IR-cut 优先）\n- 安装位置：方向盘上方 / A 柱 / 仪表台上方，正对驾驶员面部\n- 帧率：≥ 30 FPS（推荐）；分辨率 ≥ 480p\n- 必须能稳定看到双眼区域；夜间/隧道场景启用红外补光\n- 支持戴普通眼镜，墨镜会显著影响检测\n\n## 关键观测指标\n\n- `eye_state` - 眼部状态时序（open / closed / partial）\n- `blink_count_per_minute` - 每分钟眨眼次数（次/分钟）\n- `avg_blink_duration_ms` - 平均单次眨眼持续时长（毫秒）\n- `max_closed_eye_duration_ms` - 单次最长闭眼时长（毫秒）\n- `microsleep_count` - 微睡眠事件次数（单次闭眼 > 2s）\n- `perclos` - PERCLOS（80% 阈值下，单位时间内闭眼帧占比）\n\n## 正常/异常阈值（可由调用方覆盖）\n\n- 正常眨眼频率：15-20 次/分钟\n- 眨眼频率偏低告警阈值：< 10 次/分钟\n- 单次闭眼超过 2 秒 → 触发微睡眠预警\n- PERCLOS > 0.15 → 中度疲劳；> 0.30 → 重度疲劳\n\n## 预警类型\n\n- `low_blink_rate` - 眨眼频率过低\n- `microsleep` - 微睡眠（单次闭眼 > 2s）\n- `prolonged_eye_closure` - 长时间闭眼（> 3s）\n- `high_perclos` - PERCLOS 超阈值（持续疲劳）\n- `eyes_off_road` - 视线长时间偏离前方（参考）\n\n## 输出字段（参考）\n\n- `driver_detected` - 是否检测到驾驶员\n- `eye_visible` - 双眼是否可见（戴墨镜/遮挡时为 false）\n- `blink_metrics` - 眨眼相关指标（blink_count_per_minute / avg_blink_duration_ms / max_closed_eye_duration_ms / microsleep_count / perclos）\n- `fatigue_level` - 疲劳等级（normal / mild / moderate / severe）\n- `warning_type` - 触发的预警类型\n- `warning_message` - 预警提示文本（如\"驾驶员眨眼频率仅 8 次/分钟且出现 1 次 2.4 秒微睡眠，请立即靠边休息\"）\n- `recommend_action` - 建议的座舱联动动作（voice_alert / seat_vibrate / fleet_upload）\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 in-cabin driver face video to report eye state, blink rate, eye-closure duration, fatigue level, warnings, and report links.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[smyx-sunjinhui](https://clawhub.ai/user/smyx-sunjinhui)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal users, fleet operators, and developers use this skill to submit driver-facing DMS video or URLs for visual fatigue indicators such as blink rate, eye-closure duration, microsleep events, PERCLOS, fatigue level, and suggested safety actions. The output is an auxiliary safety report and should not be treated as a medical or sleep-disorder diagnosis.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Driver-facing video can contain biometric and identity-linked information and may be uploaded to third-party backend services.\n\nMitigation: Use only with informed driver or employee consent, confirm that cloud processing and report retention are allowed for the deployment, and follow applicable privacy requirements.\n\nRisk: The skill can create or reuse a cloud identity automatically and associate historical reports with that identity.\n\nMitigation: Review identity handling before deployment, disclose account association to affected users, and restrict historical report access to authorized operators.\n\nRisk: Cloud access tokens may be stored in the local workspace database.\n\nMitigation: Protect workspace data directories, rotate or revoke tokens if a workspace is shared or exposed, and remediate local token persistence before sensitive deployments.\n\nRisk: Fatigue alerts depend on camera quality and visibility of the driver's eyes.\n\nMitigation: Require a suitable DMS camera view, adequate lighting or infrared support, stable visibility of both eyes, and human review of warnings before operational action.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-driver-blink-fatigue-detection-analysis)\n- [Skill demo](https://lifeemergence.com/sample.html)\n- [API reference](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 fatigue metrics, warning messages, recommended actions, and report links]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May save report output to a local file when an output path is provided.]\n\n## Skill Version(s):\n\n1.0.9 (source: server release metadata; artifact frontmatter lists 1.0.13)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.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, 41145 bytes\n\nFiles: references/api_doc.md (2847b), scripts/__init__.py (58b), scripts/config.py (701b), scripts/config.yaml (3b), scripts/skill.py (591b), scripts/smyx_driver_blink_fatigue_detection_analysis.py (3647b), skill-card.md (2917b), SKILL.md (12265b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (472b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (163b)\n\nFile v1.0.8:SKILL.md\n\n---\nname: \"smyx-driver-blink-fatigue-detection-analysis\"\ndescription: \"Using an in-cabin DMS camera, the system analyzes the driver's facial video in real time, detects eye open/closed state, calculates blink rate per minute (normal range 15-20 blinks/min), and identifies single-blink closure duration. | 通过车载DMS摄像头实时分析驾驶员面部视频，检测眼部开闭状态，计算每分钟眨眼频率（正常约为15-20次/分钟），并识别闭眼持续时间。当眨眼频率异常降低（如<10次/分钟）或出现单次闭眼超过2秒（微睡眠前兆）时，输出疲劳驾驶预警，联动车内语音提醒或震动座椅，预防因疲劳导致的事故。\"\nversion: \"1.0.12\"\nlicense: \"MIT-0\"\n---\n\n# 🚗 Driver Blink-Rate & Eye-Closure Fatigue Detection | 驾驶员眨眼频率与闭眼时长检测\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **驾驶员眨眼频率与闭眼时长检测** |\n| 🎯 核心目标 | 通过车载DMS摄像头实时分析驾驶员面部视频，检测眼部开闭状态，计算每分钟眨眼频率（正常约为15-20次/分钟），并识别闭眼持续时间。当眨眼频率异常降低（如<10次/分钟）或出现单次闭眼超过2秒（微睡眠前兆）时，输出疲劳驾驶预警，联动车内语音提醒或震动座椅，预防因疲劳导致的事故。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_DRIVER_BLINK_FATIGUE_DETECTION_ANALYSIS` |\n\nUsing an in-cabin DMS camera, the system analyzes the driver's facial video in real time, detects eye open/closed state, calculates blink rate per minute (normal range 15-20 blinks/min), and identifies single-blink closure duration. When blink rate drops abnormally low (e.g., < 10 blinks/min) or a single eye-closure exceeds 2 seconds (microsleep precursor), it issues a fatigue-driving alert, triggering in-cabin voice reminders or seat-vibration, helping prevent accidents caused by drowsy driving. Application scenarios: passenger cars, commercial vehicles, ride-hailing fleets, freight fleets. The system monitors in real time and on detection raises audio/visual alerts and uploads events to the fleet-management platform. Skill features: drowsy driving is a major cause of traffic accidents. AI real-time detection of abnormal blinking and microsleep can promptly remind the driver and reduce accident risk. Can be integrated into dashcams, smart cockpits, or ride-hailing safety systems to enhance driving safety.\n\n通过车载DMS摄像头实时分析驾驶员面部视频，检测眼部开闭状态，计算每分钟眨眼频率（正常约为15-20次/分钟），并识别闭眼持续时间。当眨眼频率异常降低（如<10次/分钟）或出现单次闭眼超过2秒（微睡眠前兆）时，输出疲劳驾驶预警，联动车内语音提醒或震动座椅，预防因疲劳导致的事故。应用场景：乘用车、商用车、网约车、货运车队。系统实时监测，当检测到疲劳迹象时发出声光报警，并上传至车队管理平台。技能特点：疲劳驾驶是交通事故的重要原因。通过AI实时检测眨眼异常和微睡眠，可及时提醒驾驶员，降低事故风险。该技能可集成到行车记录仪、智能座舱或网约车安全系统中，提升驾驶安全。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的驾驶员疲劳监测 AI。你的任务是分析驾驶员面部视频，检测眼部状态（睁开/闭合），计算眨眼频率（次/分钟）和单次闭眼持续时间。当眨眼频率低于正常阈值或出现长时间闭眼时，输出疲劳预警。不要提供医疗诊断或睡眠障碍诊断，仅输出基于视觉的疲劳指标与方向性预警提示。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于车载 DMS 摄像头驾驶员面部视频，实时检测眼部开闭状态、计算眨眼频率与闭眼时长，识别微睡眠等疲劳前兆并输出预警\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 驾驶员面部检测 |\n| 2 | 眼部 ROI 关键点定位 |\n| 3 | 眼部开闭分类（open / closed / partial） |\n| 4 | 每分钟眨眼次数统计 |\n| 5 | 平均/最长闭眼时长 |\n| 6 | 微睡眠（单次闭眼 > 2s）识别 |\n| 7 | PERCLOS 计算 |\n| 8 | 疲劳等级判定（normal / mild / moderate / severe） |\n| 9 | 座舱联动动作建议（voice_alert / seat_vibrate / fleet_upload） |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供车载 DMS 驾驶员面部视频 URL 或文件需要分析时，默认触发本技能进行疲劳检测 |\n| 🔎 明确分析意图 | 当用户明确提及驾驶员疲劳、疲劳驾驶、眨眼频率、闭眼时长、微睡眠、PERCLOS、DMS、车载摄像头、行车安全、网约车安全等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看驾驶员疲劳历史报告、疲劳驾驶预警清单、驾驶员监测报告清单、查询历史微睡眠事件、显示所有疲劳驾驶报告、显示车队安全诊断报告，查询疲劳驾驶事件清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_driver_blink_fatigue_detection_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 | 📥 准备车载 DMS 驾驶员面部视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行驾驶员眨眼/闭眼疲劳检测 | 调用 `-m scripts.smyx_driver_blink_fatigue_detection_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地车载 DMS 驾驶员面部视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络车载 DMS 驾驶员面部视频 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_driver_blink_fatigue_detection_analysis.py`](scripts/smyx_driver_blink_fatigue_detection_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；**关键**：帧率必须 ≥ 25 FPS 且能稳定看到双眼 |\n| 🔎 使用提醒 | 检测结果仅作为驾驶员辅助安全提醒，本工具不替代驾驶员主动观察与判断；预警发生时应立即靠边安全休息 |\n| 🔎 使用提醒 | 戴墨镜、严重逆光、面部遮挡、强烈眩光等场景会显著降低检测可靠性 |\n| 🔏 隐私合规 | 隐私合规：车载驾驶员视频涉及个人生物特征隐私，使用前需取得驾驶员/员工知情同意，车队部署应遵循当地隐私法规并妥善保管/加密相关录像 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地车载 DMS 驾驶员视频\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --input /path/to/dms.mp4\n\n# 分析网络车载 DMS 驾驶员视频\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --url https://example.com/dms.mp4\n\n# 显示历史驾驶员疲劳检测报告（自动触发关键词：查看驾驶员疲劳历史报告、疲劳驾驶预警清单等）\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --input dms.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --input dms.mp4 --output result.json\n```\n\nFile v1.0.8:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-driver-blink-fatigue-detection-analysis\",\n  \"version\": \"1.0.8\",\n  \"publishedAt\": 1787599469524\n}\n\nFile v1.0.8:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放驾驶员眨眼频率与闭眼时长检测 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动驾驶员疲劳监测任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取疲劳监测结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史疲劳事件\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_DRIVER_BLINK_FATIGUE_DETECTION_ANALYSIS` - 驾驶员眨眼频率与闭眼时长检测\n\n## 输入约束\n\n- 摄像头：车载 DMS 摄像头（红外/IR-cut 优先）\n- 安装位置：方向盘上方 / A 柱 / 仪表台上方，正对驾驶员面部\n- 帧率：≥ 30 FPS（推荐）；分辨率 ≥ 480p\n- 必须能稳定看到双眼区域；夜间/隧道场景启用红外补光\n- 支持戴普通眼镜，墨镜会显著影响检测\n\n## 关键观测指标\n\n- `eye_state` - 眼部状态时序（open / closed / partial）\n- `blink_count_per_minute` - 每分钟眨眼次数（次/分钟）\n- `avg_blink_duration_ms` - 平均单次眨眼持续时长（毫秒）\n- `max_closed_eye_duration_ms` - 单次最长闭眼时长（毫秒）\n- `microsleep_count` - 微睡眠事件次数（单次闭眼 > 2s）\n- `perclos` - PERCLOS（80% 阈值下，单位时间内闭眼帧占比）\n\n## 正常/异常阈值（可由调用方覆盖）\n\n- 正常眨眼频率：15-20 次/分钟\n- 眨眼频率偏低告警阈值：< 10 次/分钟\n- 单次闭眼超过 2 秒 → 触发微睡眠预警\n- PERCLOS > 0.15 → 中度疲劳；> 0.30 → 重度疲劳\n\n## 预警类型\n\n- `low_blink_rate` - 眨眼频率过低\n- `microsleep` - 微睡眠（单次闭眼 > 2s）\n- `prolonged_eye_closure` - 长时间闭眼（> 3s）\n- `high_perclos` - PERCLOS 超阈值（持续疲劳）\n- `eyes_off_road` - 视线长时间偏离前方（参考）\n\n## 输出字段（参考）\n\n- `driver_detected` - 是否检测到驾驶员\n- `eye_visible` - 双眼是否可见（戴墨镜/遮挡时为 false）\n- `blink_metrics` - 眨眼相关指标（blink_count_per_minute / avg_blink_duration_ms / max_closed_eye_duration_ms / microsleep_count / perclos）\n- `fatigue_level` - 疲劳等级（normal / mild / moderate / severe）\n- `warning_type` - 触发的预警类型\n- `warning_message` - 预警提示文本（如\"驾驶员眨眼频率仅 8 次/分钟且出现 1 次 2.4 秒微睡眠，请立即靠边休息\"）\n- `recommend_action` - 建议的座舱联动动作（voice_alert / seat_vibrate / fleet_upload）\n\n> 仅输出基于视觉的驾驶员疲劳指标与预警，不提供医学诊断或睡眠障碍诊断；预警仅供辅助提醒，驾驶员对车辆操作负全责。\n\nFile v1.0.8:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.8:scripts/config.yaml\n\n{}\n\nFile v1.0.8:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.8:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.8:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.8:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: dev\n\nFile v1.0.8:skill-card.md\n\n## Description:\n\nAnalyzes in-cabin driver face video to detect eye state, blink rate, prolonged eye closure, microsleep indicators, and fatigue-driving alerts.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[smyx-sunjinhui](https://clawhub.ai/user/smyx-sunjinhui)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal developers, fleet operators, and vehicle safety teams can use this skill to analyze DMS camera video or URLs for visual fatigue indicators and retrieve structured fatigue-monitoring reports. Results are intended as driver-assistance safety alerts, not medical diagnosis or a substitute for driver judgment.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Driver face videos and fatigue reports can contain sensitive biometric, safety, and employment-related data.\n\nMitigation: Obtain explicit driver or employee consent, confirm retention and deletion rules, and require appropriate storage and transport protections before use.\n\nRisk: The skill uploads videos, URLs, report data, and identity-linked requests to configured API endpoints.\n\nMitigation: Review and approve the configured endpoints and credentials before installation, and disable unintended development or private endpoints.\n\nRisk: The skill may create or reuse local identity and token state for report association.\n\nMitigation: Inspect local SQLite data and token handling, restrict access to persisted state, and clear stored state when reports or users should no longer be linked.\n\nRisk: Visual fatigue detection can be unreliable when eyes are obscured, lighting is poor, or video quality is low.\n\nMitigation: Use the output only as an assistive warning, require clear DMS video that meets documented frame-rate and visibility constraints, and keep human driver judgment primary.\n\n## Reference(s):\n\n- [ClawHub Skill Page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-driver-blink-fatigue-detection-analysis)\n- [Skill Demo](https://lifeemergence.com/sample.html)\n- [Driver Fatigue Detection API Documentation](references/api_doc.md)\n- [Shared Analysis API Documentation](skills/smyx_analysis/references/api_doc.md)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, json, shell commands, guidance]\n\n**Output Format:** [Markdown or JSON report text with report links and optional saved output file]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May upload local videos or submit video URLs to configured APIs; historical report lookup returns structured report records.]\n\n## Skill Version(s):\n\n1.0.8 (source: server release metadata; artifact frontmatter lists 1.0.12)\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, 41145 bytes\n\nFiles: references/api_doc.md (2847b), scripts/__init__.py (58b), scripts/config.py (701b), scripts/config.yaml (3b), scripts/skill.py (591b), scripts/smyx_driver_blink_fatigue_detection_analysis.py (3647b), skill-card.md (2925b), SKILL.md (12265b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (472b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (163b)\n\nFile v1.0.7:SKILL.md\n\n---\nname: \"smyx-driver-blink-fatigue-detection-analysis\"\ndescription: \"Using an in-cabin DMS camera, the system analyzes the driver's facial video in real time, detects eye open/closed state, calculates blink rate per minute (normal range 15-20 blinks/min), and identifies single-blink closure duration. | 通过车载DMS摄像头实时分析驾驶员面部视频，检测眼部开闭状态，计算每分钟眨眼频率（正常约为15-20次/分钟），并识别闭眼持续时间。当眨眼频率异常降低（如<10次/分钟）或出现单次闭眼超过2秒（微睡眠前兆）时，输出疲劳驾驶预警，联动车内语音提醒或震动座椅，预防因疲劳导致的事故。\"\nversion: \"1.0.10\"\nlicense: \"MIT-0\"\n---\n\n# 🚗 Driver Blink-Rate & Eye-Closure Fatigue Detection | 驾驶员眨眼频率与闭眼时长检测\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **驾驶员眨眼频率与闭眼时长检测** |\n| 🎯 核心目标 | 通过车载DMS摄像头实时分析驾驶员面部视频，检测眼部开闭状态，计算每分钟眨眼频率（正常约为15-20次/分钟），并识别闭眼持续时间。当眨眼频率异常降低（如<10次/分钟）或出现单次闭眼超过2秒（微睡眠前兆）时，输出疲劳驾驶预警，联动车内语音提醒或震动座椅，预防因疲劳导致的事故。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_DRIVER_BLINK_FATIGUE_DETECTION_ANALYSIS` |\n\nUsing an in-cabin DMS camera, the system analyzes the driver's facial video in real time, detects eye open/closed state, calculates blink rate per minute (normal range 15-20 blinks/min), and identifies single-blink closure duration. When blink rate drops abnormally low (e.g., < 10 blinks/min) or a single eye-closure exceeds 2 seconds (microsleep precursor), it issues a fatigue-driving alert, triggering in-cabin voice reminders or seat-vibration, helping prevent accidents caused by drowsy driving. Application scenarios: passenger cars, commercial vehicles, ride-hailing fleets, freight fleets. The system monitors in real time and on detection raises audio/visual alerts and uploads events to the fleet-management platform. Skill features: drowsy driving is a major cause of traffic accidents. AI real-time detection of abnormal blinking and microsleep can promptly remind the driver and reduce accident risk. Can be integrated into dashcams, smart cockpits, or ride-hailing safety systems to enhance driving safety.\n\n通过车载DMS摄像头实时分析驾驶员面部视频，检测眼部开闭状态，计算每分钟眨眼频率（正常约为15-20次/分钟），并识别闭眼持续时间。当眨眼频率异常降低（如<10次/分钟）或出现单次闭眼超过2秒（微睡眠前兆）时，输出疲劳驾驶预警，联动车内语音提醒或震动座椅，预防因疲劳导致的事故。应用场景：乘用车、商用车、网约车、货运车队。系统实时监测，当检测到疲劳迹象时发出声光报警，并上传至车队管理平台。技能特点：疲劳驾驶是交通事故的重要原因。通过AI实时检测眨眼异常和微睡眠，可及时提醒驾驶员，降低事故风险。该技能可集成到行车记录仪、智能座舱或网约车安全系统中，提升驾驶安全。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的驾驶员疲劳监测 AI。你的任务是分析驾驶员面部视频，检测眼部状态（睁开/闭合），计算眨眼频率（次/分钟）和单次闭眼持续时间。当眨眼频率低于正常阈值或出现长时间闭眼时，输出疲劳预警。不要提供医疗诊断或睡眠障碍诊断，仅输出基于视觉的疲劳指标与方向性预警提示。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于车载 DMS 摄像头驾驶员面部视频，实时检测眼部开闭状态、计算眨眼频率与闭眼时长，识别微睡眠等疲劳前兆并输出预警\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 驾驶员面部检测 |\n| 2 | 眼部 ROI 关键点定位 |\n| 3 | 眼部开闭分类（open / closed / partial） |\n| 4 | 每分钟眨眼次数统计 |\n| 5 | 平均/最长闭眼时长 |\n| 6 | 微睡眠（单次闭眼 > 2s）识别 |\n| 7 | PERCLOS 计算 |\n| 8 | 疲劳等级判定（normal / mild / moderate / severe） |\n| 9 | 座舱联动动作建议（voice_alert / seat_vibrate / fleet_upload） |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供车载 DMS 驾驶员面部视频 URL 或文件需要分析时，默认触发本技能进行疲劳检测 |\n| 🔎 明确分析意图 | 当用户明确提及驾驶员疲劳、疲劳驾驶、眨眼频率、闭眼时长、微睡眠、PERCLOS、DMS、车载摄像头、行车安全、网约车安全等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看驾驶员疲劳历史报告、疲劳驾驶预警清单、驾驶员监测报告清单、查询历史微睡眠事件、显示所有疲劳驾驶报告、显示车队安全诊断报告，查询疲劳驾驶事件清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_driver_blink_fatigue_detection_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 | 📥 准备车载 DMS 驾驶员面部视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行驾驶员眨眼/闭眼疲劳检测 | 调用 `-m scripts.smyx_driver_blink_fatigue_detection_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地车载 DMS 驾驶员面部视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络车载 DMS 驾驶员面部视频 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_driver_blink_fatigue_detection_analysis.py`](scripts/smyx_driver_blink_fatigue_detection_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；**关键**：帧率必须 ≥ 25 FPS 且能稳定看到双眼 |\n| 🔎 使用提醒 | 检测结果仅作为驾驶员辅助安全提醒，本工具不替代驾驶员主动观察与判断；预警发生时应立即靠边安全休息 |\n| 🔎 使用提醒 | 戴墨镜、严重逆光、面部遮挡、强烈眩光等场景会显著降低检测可靠性 |\n| 🔏 隐私合规 | 隐私合规：车载驾驶员视频涉及个人生物特征隐私，使用前需取得驾驶员/员工知情同意，车队部署应遵循当地隐私法规并妥善保管/加密相关录像 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地车载 DMS 驾驶员视频\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --input /path/to/dms.mp4\n\n# 分析网络车载 DMS 驾驶员视频\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --url https://example.com/dms.mp4\n\n# 显示历史驾驶员疲劳检测报告（自动触发关键词：查看驾驶员疲劳历史报告、疲劳驾驶预警清单等）\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --input dms.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --input dms.mp4 --output result.json\n```\n\nFile v1.0.7:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-driver-blink-fatigue-detection-analysis\",\n  \"version\": \"1.0.7\",\n  \"publishedAt\": 1786967129359\n}\n\nFile v1.0.7:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放驾驶员眨眼频率与闭眼时长检测 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动驾驶员疲劳监测任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取疲劳监测结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史疲劳事件\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_DRIVER_BLINK_FATIGUE_DETECTION_ANALYSIS` - 驾驶员眨眼频率与闭眼时长检测\n\n## 输入约束\n\n- 摄像头：车载 DMS 摄像头（红外/IR-cut 优先）\n- 安装位置：方向盘上方 / A 柱 / 仪表台上方，正对驾驶员面部\n- 帧率：≥ 30 FPS（推荐）；分辨率 ≥ 480p\n- 必须能稳定看到双眼区域；夜间/隧道场景启用红外补光\n- 支持戴普通眼镜，墨镜会显著影响检测\n\n## 关键观测指标\n\n- `eye_state` - 眼部状态时序（open / closed / partial）\n- `blink_count_per_minute` - 每分钟眨眼次数（次/分钟）\n- `avg_blink_duration_ms` - 平均单次眨眼持续时长（毫秒）\n- `max_closed_eye_duration_ms` - 单次最长闭眼时长（毫秒）\n- `microsleep_count` - 微睡眠事件次数（单次闭眼 > 2s）\n- `perclos` - PERCLOS（80% 阈值下，单位时间内闭眼帧占比）\n\n## 正常/异常阈值（可由调用方覆盖）\n\n- 正常眨眼频率：15-20 次/分钟\n- 眨眼频率偏低告警阈值：< 10 次/分钟\n- 单次闭眼超过 2 秒 → 触发微睡眠预警\n- PERCLOS > 0.15 → 中度疲劳；> 0.30 → 重度疲劳\n\n## 预警类型\n\n- `low_blink_rate` - 眨眼频率过低\n- `microsleep` - 微睡眠（单次闭眼 > 2s）\n- `prolonged_eye_closure` - 长时间闭眼（> 3s）\n- `high_perclos` - PERCLOS 超阈值（持续疲劳）\n- `eyes_off_road` - 视线长时间偏离前方（参考）\n\n## 输出字段（参考）\n\n- `driver_detected` - 是否检测到驾驶员\n- `eye_visible` - 双眼是否可见（戴墨镜/遮挡时为 false）\n- `blink_metrics` - 眨眼相关指标（blink_count_per_minute / avg_blink_duration_ms / max_closed_eye_duration_ms / microsleep_count / perclos）\n- `fatigue_level` - 疲劳等级（normal / mild / moderate / severe）\n- `warning_type` - 触发的预警类型\n- `warning_message` - 预警提示文本（如\"驾驶员眨眼频率仅 8 次/分钟且出现 1 次 2.4 秒微睡眠，请立即靠边休息\"）\n- `recommend_action` - 建议的座舱联动动作（voice_alert / seat_vibrate / fleet_upload）\n\n> 仅输出基于视觉的驾驶员疲劳指标与预警，不提供医学诊断或睡眠障碍诊断；预警仅供辅助提醒，驾驶员对车辆操作负全责。\n\nFile v1.0.7:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.7:scripts/config.yaml\n\n{}\n\nFile v1.0.7:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.7:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.7:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.7:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: dev\n\nFile v1.0.7:skill-card.md\n\n## Description:\n\nUsing an in-cabin DMS camera, the skill analyzes driver facial video, detects eye open or closed state, calculates blink rate and eye-closure duration, and reports fatigue-warning indicators.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[smyx-sunjinhui](https://clawhub.ai/user/smyx-sunjinhui)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal users, developers, and fleet safety teams can use this skill to analyze driver-facing DMS video or video URLs for blink rate, long eye closure, PERCLOS, fatigue level, warning type, recommended action, and report links. The output is an assistive safety warning and not a medical or sleep-disorder diagnosis.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Driver-facing video or video URLs may be sent to the configured backend service.\n\nMitigation: Use only with explicit driver consent, minimize shared video content, and verify retention, deletion, and data-handling terms before deployment.\n\nRisk: Reports may be associated with an automatically managed identity and local token data.\n\nMitigation: Run in an isolated workspace or account context and review token storage, access controls, and cleanup procedures before use.\n\nRisk: Historical cloud report queries may expose prior analysis records without clear user control.\n\nMitigation: Verify authorization, account isolation, and report access boundaries before enabling history-list workflows.\n\nRisk: Fatigue warnings can be unreliable when video quality is poor, the eyes are obscured, or lighting conditions are adverse.\n\nMitigation: Require adequate driver-face video quality, confirm both eyes are visible, and treat outputs as assistive safety signals rather than medical or operational determinations.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-driver-blink-fatigue-detection-analysis)\n- [Driver fatigue detection API documentation](artifact/references/api_doc.md)\n- [Shared analysis API documentation](artifact/skills/smyx_analysis/references/api_doc.md)\n- [Skill usage demo](https://lifeemergence.com/sample.html)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown and JSON-style structured text from API-backed analysis results, with optional saved output files.]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May include fatigue metrics, warning messages, recommended actions, report links, and historical report tables.]\n\n## Skill Version(s):\n\n1.0.7 (source: release evidence; artifact frontmatter says 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.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, 40977 bytes\n\nFiles: references/api_doc.md (2847b), scripts/__init__.py (58b), scripts/config.py (701b), scripts/config.yaml (3b), scripts/skill.py (591b), scripts/smyx_driver_blink_fatigue_detection_analysis.py (3647b), skill-card.md (2463b), SKILL.md (12265b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (472b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (163b)\n\nFile v1.0.6:SKILL.md\n\n---\nname: \"smyx-driver-blink-fatigue-detection-analysis\"\ndescription: \"Using an in-cabin DMS camera, the system analyzes the driver's facial video in real time, detects eye open/closed state, calculates blink rate per minute (normal range 15-20 blinks/min), and identifies single-blink closure duration. | 通过车载DMS摄像头实时分析驾驶员面部视频，检测眼部开闭状态，计算每分钟眨眼频率（正常约为15-20次/分钟），并识别闭眼持续时间。当眨眼频率异常降低（如<10次/分钟）或出现单次闭眼超过2秒（微睡眠前兆）时，输出疲劳驾驶预警，联动车内语音提醒或震动座椅，预防因疲劳导致的事故。\"\nversion: \"1.0.10\"\nlicense: \"MIT-0\"\n---\n\n# 🚗 Driver Blink-Rate & Eye-Closure Fatigue Detection | 驾驶员眨眼频率与闭眼时长检测\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **驾驶员眨眼频率与闭眼时长检测** |\n| 🎯 核心目标 | 通过车载DMS摄像头实时分析驾驶员面部视频，检测眼部开闭状态，计算每分钟眨眼频率（正常约为15-20次/分钟），并识别闭眼持续时间。当眨眼频率异常降低（如<10次/分钟）或出现单次闭眼超过2秒（微睡眠前兆）时，输出疲劳驾驶预警，联动车内语音提醒或震动座椅，预防因疲劳导致的事故。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_DRIVER_BLINK_FATIGUE_DETECTION_ANALYSIS` |\n\nUsing an in-cabin DMS camera, the system analyzes the driver's facial video in real time, detects eye open/closed state, calculates blink rate per minute (normal range 15-20 blinks/min), and identifies single-blink closure duration. When blink rate drops abnormally low (e.g., < 10 blinks/min) or a single eye-closure exceeds 2 seconds (microsleep precursor), it issues a fatigue-driving alert, triggering in-cabin voice reminders or seat-vibration, helping prevent accidents caused by drowsy driving. Application scenarios: passenger cars, commercial vehicles, ride-hailing fleets, freight fleets. The system monitors in real time and on detection raises audio/visual alerts and uploads events to the fleet-management platform. Skill features: drowsy driving is a major cause of traffic accidents. AI real-time detection of abnormal blinking and microsleep can promptly remind the driver and reduce accident risk. Can be integrated into dashcams, smart cockpits, or ride-hailing safety systems to enhance driving safety.\n\n通过车载DMS摄像头实时分析驾驶员面部视频，检测眼部开闭状态，计算每分钟眨眼频率（正常约为15-20次/分钟），并识别闭眼持续时间。当眨眼频率异常降低（如<10次/分钟）或出现单次闭眼超过2秒（微睡眠前兆）时，输出疲劳驾驶预警，联动车内语音提醒或震动座椅，预防因疲劳导致的事故。应用场景：乘用车、商用车、网约车、货运车队。系统实时监测，当检测到疲劳迹象时发出声光报警，并上传至车队管理平台。技能特点：疲劳驾驶是交通事故的重要原因。通过AI实时检测眨眼异常和微睡眠，可及时提醒驾驶员，降低事故风险。该技能可集成到行车记录仪、智能座舱或网约车安全系统中，提升驾驶安全。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的驾驶员疲劳监测 AI。你的任务是分析驾驶员面部视频，检测眼部状态（睁开/闭合），计算眨眼频率（次/分钟）和单次闭眼持续时间。当眨眼频率低于正常阈值或出现长时间闭眼时，输出疲劳预警。不要提供医疗诊断或睡眠障碍诊断，仅输出基于视觉的疲劳指标与方向性预警提示。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于车载 DMS 摄像头驾驶员面部视频，实时检测眼部开闭状态、计算眨眼频率与闭眼时长，识别微睡眠等疲劳前兆并输出预警\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 驾驶员面部检测 |\n| 2 | 眼部 ROI 关键点定位 |\n| 3 | 眼部开闭分类（open / closed / partial） |\n| 4 | 每分钟眨眼次数统计 |\n| 5 | 平均/最长闭眼时长 |\n| 6 | 微睡眠（单次闭眼 > 2s）识别 |\n| 7 | PERCLOS 计算 |\n| 8 | 疲劳等级判定（normal / mild / moderate / severe） |\n| 9 | 座舱联动动作建议（voice_alert / seat_vibrate / fleet_upload） |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供车载 DMS 驾驶员面部视频 URL 或文件需要分析时，默认触发本技能进行疲劳检测 |\n| 🔎 明确分析意图 | 当用户明确提及驾驶员疲劳、疲劳驾驶、眨眼频率、闭眼时长、微睡眠、PERCLOS、DMS、车载摄像头、行车安全、网约车安全等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看驾驶员疲劳历史报告、疲劳驾驶预警清单、驾驶员监测报告清单、查询历史微睡眠事件、显示所有疲劳驾驶报告、显示车队安全诊断报告，查询疲劳驾驶事件清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_driver_blink_fatigue_detection_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 | 📥 准备车载 DMS 驾驶员面部视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行驾驶员眨眼/闭眼疲劳检测 | 调用 `-m scripts.smyx_driver_blink_fatigue_detection_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地车载 DMS 驾驶员面部视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络车载 DMS 驾驶员面部视频 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_driver_blink_fatigue_detection_analysis.py`](scripts/smyx_driver_blink_fatigue_detection_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；**关键**：帧率必须 ≥ 25 FPS 且能稳定看到双眼 |\n| 🔎 使用提醒 | 检测结果仅作为驾驶员辅助安全提醒，本工具不替代驾驶员主动观察与判断；预警发生时应立即靠边安全休息 |\n| 🔎 使用提醒 | 戴墨镜、严重逆光、面部遮挡、强烈眩光等场景会显著降低检测可靠性 |\n| 🔏 隐私合规 | 隐私合规：车载驾驶员视频涉及个人生物特征隐私，使用前需取得驾驶员/员工知情同意，车队部署应遵循当地隐私法规并妥善保管/加密相关录像 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地车载 DMS 驾驶员视频\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --input /path/to/dms.mp4\n\n# 分析网络车载 DMS 驾驶员视频\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --url https://example.com/dms.mp4\n\n# 显示历史驾驶员疲劳检测报告（自动触发关键词：查看驾驶员疲劳历史报告、疲劳驾驶预警清单等）\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --input dms.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --input dms.mp4 --output result.json\n```\n\nFile v1.0.6:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-driver-blink-fatigue-detection-analysis\",\n  \"version\": \"1.0.6\",\n  \"publishedAt\": 1786827148879\n}\n\nFile v1.0.6:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放驾驶员眨眼频率与闭眼时长检测 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动驾驶员疲劳监测任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取疲劳监测结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史疲劳事件\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_DRIVER_BLINK_FATIGUE_DETECTION_ANALYSIS` - 驾驶员眨眼频率与闭眼时长检测\n\n## 输入约束\n\n- 摄像头：车载 DMS 摄像头（红外/IR-cut 优先）\n- 安装位置：方向盘上方 / A 柱 / 仪表台上方，正对驾驶员面部\n- 帧率：≥ 30 FPS（推荐）；分辨率 ≥ 480p\n- 必须能稳定看到双眼区域；夜间/隧道场景启用红外补光\n- 支持戴普通眼镜，墨镜会显著影响检测\n\n## 关键观测指标\n\n- `eye_state` - 眼部状态时序（open / closed / partial）\n- `blink_count_per_minute` - 每分钟眨眼次数（次/分钟）\n- `avg_blink_duration_ms` - 平均单次眨眼持续时长（毫秒）\n- `max_closed_eye_duration_ms` - 单次最长闭眼时长（毫秒）\n- `microsleep_count` - 微睡眠事件次数（单次闭眼 > 2s）\n- `perclos` - PERCLOS（80% 阈值下，单位时间内闭眼帧占比）\n\n## 正常/异常阈值（可由调用方覆盖）\n\n- 正常眨眼频率：15-20 次/分钟\n- 眨眼频率偏低告警阈值：< 10 次/分钟\n- 单次闭眼超过 2 秒 → 触发微睡眠预警\n- PERCLOS > 0.15 → 中度疲劳；> 0.30 → 重度疲劳\n\n## 预警类型\n\n- `low_blink_rate` - 眨眼频率过低\n- `microsleep` - 微睡眠（单次闭眼 > 2s）\n- `prolonged_eye_closure` - 长时间闭眼（> 3s）\n- `high_perclos` - PERCLOS 超阈值（持续疲劳）\n- `eyes_off_road` - 视线长时间偏离前方（参考）\n\n## 输出字段（参考）\n\n- `driver_detected` - 是否检测到驾驶员\n- `eye_visible` - 双眼是否可见（戴墨镜/遮挡时为 false）\n- `blink_metrics` - 眨眼相关指标（blink_count_per_minute / avg_blink_duration_ms / max_closed_eye_duration_ms / microsleep_count / perclos）\n- `fatigue_level` - 疲劳等级（normal / mild / moderate / severe）\n- `warning_type` - 触发的预警类型\n- `warning_message` - 预警提示文本（如\"驾驶员眨眼频率仅 8 次/分钟且出现 1 次 2.4 秒微睡眠，请立即靠边休息\"）\n- `recommend_action` - 建议的座舱联动动作（voice_alert / seat_vibrate / fleet_upload）\n\n> 仅输出基于视觉的驾驶员疲劳指标与预警，不提供医学诊断或睡眠障碍诊断；预警仅供辅助提醒，驾驶员对车辆操作负全责。\n\nFile v1.0.6:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.6:scripts/config.yaml\n\n{}\n\nFile v1.0.6:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.6:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.6:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.6:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: dev\n\nFile v1.0.6:skill-card.md\n\n## Description:\n\nAnalyzes driver face video from an in-cabin DMS camera to report eye open/closed state, blink rate, eye-closure duration, microsleep indicators, and fatigue warnings.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[smyx-sunjinhui](https://clawhub.ai/user/smyx-sunjinhui)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal developers and fleet safety teams use this skill to analyze driver face videos or video URLs for blink-rate, eye-closure, PERCLOS, and fatigue-warning reports. It is intended as an auxiliary safety signal, not a medical diagnosis or a substitute for driver judgment.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Driver face video or video URLs may be sent to external services and linked to persistent local or remote identity state.\n\nMitigation: Obtain driver consent, verify the service operator, retention policy, and deletion process, and use only approved media sources.\n\nRisk: Fatigue warnings may be unreliable when the driver's eyes are obscured, lighting is poor, glare is severe, or the video does not meet the documented frame-rate and visibility requirements.\n\nMitigation: Use compliant DMS camera footage with stable eye visibility and treat results as auxiliary safety guidance requiring human judgment.\n\nRisk: The security evidence reports a suspicious verdict because the skill handles remote media and persistent account or token state.\n\nMitigation: Review service endpoints, account and token handling, and deployment controls before installation.\n\n## Reference(s):\n\n- [API 接口文档](references/api_doc.md)\n- [ClawHub skill page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-driver-blink-fatigue-detection-analysis)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Markdown, JSON, Shell commands, Configuration, Guidance]\n\n**Output Format:** [Markdown reports and JSON-style structured analysis from shell or API execution]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May include fatigue metrics, warning types, recommended actions, report links, or a saved output file path.]\n\n## Skill Version(s):\n\n1.0.6 (source: server release evidence)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.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, 41193 bytes\n\nFiles: references/api_doc.md (2847b), scripts/__init__.py (58b), scripts/config.py (701b), scripts/config.yaml (3b), scripts/skill.py (591b), scripts/smyx_driver_blink_fatigue_detection_analysis.py (3647b), skill-card.md (3107b), SKILL.md (12264b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (473b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (163b)\n\nFile v1.0.5:SKILL.md\n\n---\nname: \"smyx-driver-blink-fatigue-detection-analysis\"\ndescription: \"Using an in-cabin DMS camera, the system analyzes the driver's facial video in real time, detects eye open/closed state, calculates blink rate per minute (normal range 15-20 blinks/min), and identifies single-blink closure duration. | 通过车载DMS摄像头实时分析驾驶员面部视频，检测眼部开闭状态，计算每分钟眨眼频率（正常约为15-20次/分钟），并识别闭眼持续时间。当眨眼频率异常降低（如<10次/分钟）或出现单次闭眼超过2秒（微睡眠前兆）时，输出疲劳驾驶预警，联动车内语音提醒或震动座椅，预防因疲劳导致的事故。\"\nversion: \"1.0.8\"\nlicense: \"MIT-0\"\n---\n\n# 🚗 Driver Blink-Rate & Eye-Closure Fatigue Detection | 驾驶员眨眼频率与闭眼时长检测\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **驾驶员眨眼频率与闭眼时长检测** |\n| 🎯 核心目标 | 通过车载DMS摄像头实时分析驾驶员面部视频，检测眼部开闭状态，计算每分钟眨眼频率（正常约为15-20次/分钟），并识别闭眼持续时间。当眨眼频率异常降低（如<10次/分钟）或出现单次闭眼超过2秒（微睡眠前兆）时，输出疲劳驾驶预警，联动车内语音提醒或震动座椅，预防因疲劳导致的事故。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_DRIVER_BLINK_FATIGUE_DETECTION_ANALYSIS` |\n\nUsing an in-cabin DMS camera, the system analyzes the driver's facial video in real time, detects eye open/closed state, calculates blink rate per minute (normal range 15-20 blinks/min), and identifies single-blink closure duration. When blink rate drops abnormally low (e.g., < 10 blinks/min) or a single eye-closure exceeds 2 seconds (microsleep precursor), it issues a fatigue-driving alert, triggering in-cabin voice reminders or seat-vibration, helping prevent accidents caused by drowsy driving. Application scenarios: passenger cars, commercial vehicles, ride-hailing fleets, freight fleets. The system monitors in real time and on detection raises audio/visual alerts and uploads events to the fleet-management platform. Skill features: drowsy driving is a major cause of traffic accidents. AI real-time detection of abnormal blinking and microsleep can promptly remind the driver and reduce accident risk. Can be integrated into dashcams, smart cockpits, or ride-hailing safety systems to enhance driving safety.\n\n通过车载DMS摄像头实时分析驾驶员面部视频，检测眼部开闭状态，计算每分钟眨眼频率（正常约为15-20次/分钟），并识别闭眼持续时间。当眨眼频率异常降低（如<10次/分钟）或出现单次闭眼超过2秒（微睡眠前兆）时，输出疲劳驾驶预警，联动车内语音提醒或震动座椅，预防因疲劳导致的事故。应用场景：乘用车、商用车、网约车、货运车队。系统实时监测，当检测到疲劳迹象时发出声光报警，并上传至车队管理平台。技能特点：疲劳驾驶是交通事故的重要原因。通过AI实时检测眨眼异常和微睡眠，可及时提醒驾驶员，降低事故风险。该技能可集成到行车记录仪、智能座舱或网约车安全系统中，提升驾驶安全。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的驾驶员疲劳监测 AI。你的任务是分析驾驶员面部视频，检测眼部状态（睁开/闭合），计算眨眼频率（次/分钟）和单次闭眼持续时间。当眨眼频率低于正常阈值或出现长时间闭眼时，输出疲劳预警。不要提供医疗诊断或睡眠障碍诊断，仅输出基于视觉的疲劳指标与方向性预警提示。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于车载 DMS 摄像头驾驶员面部视频，实时检测眼部开闭状态、计算眨眼频率与闭眼时长，识别微睡眠等疲劳前兆并输出预警\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 驾驶员面部检测 |\n| 2 | 眼部 ROI 关键点定位 |\n| 3 | 眼部开闭分类（open / closed / partial） |\n| 4 | 每分钟眨眼次数统计 |\n| 5 | 平均/最长闭眼时长 |\n| 6 | 微睡眠（单次闭眼 > 2s）识别 |\n| 7 | PERCLOS 计算 |\n| 8 | 疲劳等级判定（normal / mild / moderate / severe） |\n| 9 | 座舱联动动作建议（voice_alert / seat_vibrate / fleet_upload） |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供车载 DMS 驾驶员面部视频 URL 或文件需要分析时，默认触发本技能进行疲劳检测 |\n| 🔎 明确分析意图 | 当用户明确提及驾驶员疲劳、疲劳驾驶、眨眼频率、闭眼时长、微睡眠、PERCLOS、DMS、车载摄像头、行车安全、网约车安全等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看驾驶员疲劳历史报告、疲劳驾驶预警清单、驾驶员监测报告清单、查询历史微睡眠事件、显示所有疲劳驾驶报告、显示车队安全诊断报告，查询疲劳驾驶事件清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_driver_blink_fatigue_detection_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 | 📥 准备车载 DMS 驾驶员面部视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行驾驶员眨眼/闭眼疲劳检测 | 调用 `-m scripts.smyx_driver_blink_fatigue_detection_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地车载 DMS 驾驶员面部视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络车载 DMS 驾驶员面部视频 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_driver_blink_fatigue_detection_analysis.py`](scripts/smyx_driver_blink_fatigue_detection_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；**关键**：帧率必须 ≥ 25 FPS 且能稳定看到双眼 |\n| 🔎 使用提醒 | 检测结果仅作为驾驶员辅助安全提醒，本工具不替代驾驶员主动观察与判断；预警发生时应立即靠边安全休息 |\n| 🔎 使用提醒 | 戴墨镜、严重逆光、面部遮挡、强烈眩光等场景会显著降低检测可靠性 |\n| 🔏 隐私合规 | 隐私合规：车载驾驶员视频涉及个人生物特征隐私，使用前需取得驾驶员/员工知情同意，车队部署应遵循当地隐私法规并妥善保管/加密相关录像 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地车载 DMS 驾驶员视频\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --input /path/to/dms.mp4\n\n# 分析网络车载 DMS 驾驶员视频\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --url https://example.com/dms.mp4\n\n# 显示历史驾驶员疲劳检测报告（自动触发关键词：查看驾驶员疲劳历史报告、疲劳驾驶预警清单等）\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --input dms.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --input dms.mp4 --output result.json\n```\n\nFile v1.0.5:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-driver-blink-fatigue-detection-analysis\",\n  \"version\": \"1.0.5\",\n  \"publishedAt\": 1785820831815\n}\n\nFile v1.0.5:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放驾驶员眨眼频率与闭眼时长检测 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动驾驶员疲劳监测任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取疲劳监测结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史疲劳事件\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_DRIVER_BLINK_FATIGUE_DETECTION_ANALYSIS` - 驾驶员眨眼频率与闭眼时长检测\n\n## 输入约束\n\n- 摄像头：车载 DMS 摄像头（红外/IR-cut 优先）\n- 安装位置：方向盘上方 / A 柱 / 仪表台上方，正对驾驶员面部\n- 帧率：≥ 30 FPS（推荐）；分辨率 ≥ 480p\n- 必须能稳定看到双眼区域；夜间/隧道场景启用红外补光\n- 支持戴普通眼镜，墨镜会显著影响检测\n\n## 关键观测指标\n\n- `eye_state` - 眼部状态时序（open / closed / partial）\n- `blink_count_per_minute` - 每分钟眨眼次数（次/分钟）\n- `avg_blink_duration_ms` - 平均单次眨眼持续时长（毫秒）\n- `max_closed_eye_duration_ms` - 单次最长闭眼时长（毫秒）\n- `microsleep_count` - 微睡眠事件次数（单次闭眼 > 2s）\n- `perclos` - PERCLOS（80% 阈值下，单位时间内闭眼帧占比）\n\n## 正常/异常阈值（可由调用方覆盖）\n\n- 正常眨眼频率：15-20 次/分钟\n- 眨眼频率偏低告警阈值：< 10 次/分钟\n- 单次闭眼超过 2 秒 → 触发微睡眠预警\n- PERCLOS > 0.15 → 中度疲劳；> 0.30 → 重度疲劳\n\n## 预警类型\n\n- `low_blink_rate` - 眨眼频率过低\n- `microsleep` - 微睡眠（单次闭眼 > 2s）\n- `prolonged_eye_closure` - 长时间闭眼（> 3s）\n- `high_perclos` - PERCLOS 超阈值（持续疲劳）\n- `eyes_off_road` - 视线长时间偏离前方（参考）\n\n## 输出字段（参考）\n\n- `driver_detected` - 是否检测到驾驶员\n- `eye_visible` - 双眼是否可见（戴墨镜/遮挡时为 false）\n- `blink_metrics` - 眨眼相关指标（blink_count_per_minute / avg_blink_duration_ms / max_closed_eye_duration_ms / microsleep_count / perclos）\n- `fatigue_level` - 疲劳等级（normal / mild / moderate / severe）\n- `warning_type` - 触发的预警类型\n- `warning_message` - 预警提示文本（如\"驾驶员眨眼频率仅 8 次/分钟且出现 1 次 2.4 秒微睡眠，请立即靠边休息\"）\n- `recommend_action` - 建议的座舱联动动作（voice_alert / seat_vibrate / fleet_upload）\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 in-cabin driver face video to estimate blink rate, eye-closure duration, microsleep indicators, and fatigue-warning outputs. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[smyx-sunjinhui](https://clawhub.ai/user/smyx-sunjinhui) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and operators use this skill to submit driver-monitoring video or URLs for remote fatigue analysis and to retrieve structured fatigue reports. It is intended for driver-assistance workflows in vehicles, fleets, ride-hailing, and related safety-monitoring contexts, not for medical diagnosis. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Driver videos may contain biometric and workplace privacy-sensitive information and are sent to remote LifeEmergence services for analysis. <br>\nMitigation: Use only with informed driver consent, approved cloud-processing terms, and data-handling controls appropriate for driver video. <br>\nRisk: The skill can create or reuse an identity automatically and stores authentication tokens in a local workspace database. <br>\nMitigation: Install only in workspaces where local token storage is acceptable; restrict filesystem access and rotate or remove stored credentials when decommissioning the skill. <br>\nRisk: Broad natural-language triggers can retrieve cloud report history associated with the resolved identity. <br>\nMitigation: Limit use to authorized operators and review report-history access before deployment in shared or multi-user workspaces. <br>\nRisk: Fatigue warnings depend on video quality and visibility of the driver's eyes and are not medical or sleep-disorder diagnoses. <br>\nMitigation: Treat results as driver-assistance signals; require clear DMS video, avoid obstructed or glare-heavy inputs, and keep human safety judgment in the loop. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-driver-blink-fatigue-detection-analysis) <br>\n- [Driver fatigue API reference](references/api_doc.md) <br>\n- [Shared analysis API reference](skills/smyx_analysis/references/api_doc.md) <br>\n- [Skill demo](https://lifeemergence.com/sample.html) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Analysis, Markdown, JSON, Shell commands, Files] <br>\n**Output Format:** [Markdown text with structured JSON-style fatigue metrics, warnings, recommendations, report links, and optional saved output files.] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Can return a current analysis result or a cloud report-history listing; results depend on remote service availability and input video quality.] <br>\n\n## Skill Version(s): <br>\n1.0.5 (source: 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, 40918 bytes\n\nFiles: references/api_doc.md (2847b), scripts/__init__.py (58b), scripts/config.py (701b), scripts/config.yaml (3b), scripts/skill.py (591b), scripts/smyx_driver_blink_fatigue_detection_analysis.py (3647b), skill-card.md (2546b), SKILL.md (12264b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (473b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (163b)\n\nFile v1.0.4:SKILL.md\n\n---\nname: \"smyx-driver-blink-fatigue-detection-analysis\"\ndescription: \"Using an in-cabin DMS camera, the system analyzes the driver's facial video in real time, detects eye open/closed state, calculates blink rate per minute (normal range 15-20 blinks/min), and identifies single-blink closure duration. | 通过车载DMS摄像头实时分析驾驶员面部视频，检测眼部开闭状态，计算每分钟眨眼频率（正常约为15-20次/分钟），并识别闭眼持续时间。当眨眼频率异常降低（如<10次/分钟）或出现单次闭眼超过2秒（微睡眠前兆）时，输出疲劳驾驶预警，联动车内语音提醒或震动座椅，预防因疲劳导致的事故。\"\nversion: \"1.0.8\"\nlicense: \"MIT-0\"\n---\n\n# 🚗 Driver Blink-Rate & Eye-Closure Fatigue Detection | 驾驶员眨眼频率与闭眼时长检测\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **驾驶员眨眼频率与闭眼时长检测** |\n| 🎯 核心目标 | 通过车载DMS摄像头实时分析驾驶员面部视频，检测眼部开闭状态，计算每分钟眨眼频率（正常约为15-20次/分钟），并识别闭眼持续时间。当眨眼频率异常降低（如<10次/分钟）或出现单次闭眼超过2秒（微睡眠前兆）时，输出疲劳驾驶预警，联动车内语音提醒或震动座椅，预防因疲劳导致的事故。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_DRIVER_BLINK_FATIGUE_DETECTION_ANALYSIS` |\n\nUsing an in-cabin DMS camera, the system analyzes the driver's facial video in real time, detects eye open/closed state, calculates blink rate per minute (normal range 15-20 blinks/min), and identifies single-blink closure duration. When blink rate drops abnormally low (e.g., < 10 blinks/min) or a single eye-closure exceeds 2 seconds (microsleep precursor), it issues a fatigue-driving alert, triggering in-cabin voice reminders or seat-vibration, helping prevent accidents caused by drowsy driving. Application scenarios: passenger cars, commercial vehicles, ride-hailing fleets, freight fleets. The system monitors in real time and on detection raises audio/visual alerts and uploads events to the fleet-management platform. Skill features: drowsy driving is a major cause of traffic accidents. AI real-time detection of abnormal blinking and microsleep can promptly remind the driver and reduce accident risk. Can be integrated into dashcams, smart cockpits, or ride-hailing safety systems to enhance driving safety.\n\n通过车载DMS摄像头实时分析驾驶员面部视频，检测眼部开闭状态，计算每分钟眨眼频率（正常约为15-20次/分钟），并识别闭眼持续时间。当眨眼频率异常降低（如<10次/分钟）或出现单次闭眼超过2秒（微睡眠前兆）时，输出疲劳驾驶预警，联动车内语音提醒或震动座椅，预防因疲劳导致的事故。应用场景：乘用车、商用车、网约车、货运车队。系统实时监测，当检测到疲劳迹象时发出声光报警，并上传至车队管理平台。技能特点：疲劳驾驶是交通事故的重要原因。通过AI实时检测眨眼异常和微睡眠，可及时提醒驾驶员，降低事故风险。该技能可集成到行车记录仪、智能座舱或网约车安全系统中，提升驾驶安全。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的驾驶员疲劳监测 AI。你的任务是分析驾驶员面部视频，检测眼部状态（睁开/闭合），计算眨眼频率（次/分钟）和单次闭眼持续时间。当眨眼频率低于正常阈值或出现长时间闭眼时，输出疲劳预警。不要提供医疗诊断或睡眠障碍诊断，仅输出基于视觉的疲劳指标与方向性预警提示。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于车载 DMS 摄像头驾驶员面部视频，实时检测眼部开闭状态、计算眨眼频率与闭眼时长，识别微睡眠等疲劳前兆并输出预警\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 驾驶员面部检测 |\n| 2 | 眼部 ROI 关键点定位 |\n| 3 | 眼部开闭分类（open / closed / partial） |\n| 4 | 每分钟眨眼次数统计 |\n| 5 | 平均/最长闭眼时长 |\n| 6 | 微睡眠（单次闭眼 > 2s）识别 |\n| 7 | PERCLOS 计算 |\n| 8 | 疲劳等级判定（normal / mild / moderate / severe） |\n| 9 | 座舱联动动作建议（voice_alert / seat_vibrate / fleet_upload） |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供车载 DMS 驾驶员面部视频 URL 或文件需要分析时，默认触发本技能进行疲劳检测 |\n| 🔎 明确分析意图 | 当用户明确提及驾驶员疲劳、疲劳驾驶、眨眼频率、闭眼时长、微睡眠、PERCLOS、DMS、车载摄像头、行车安全、网约车安全等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看驾驶员疲劳历史报告、疲劳驾驶预警清单、驾驶员监测报告清单、查询历史微睡眠事件、显示所有疲劳驾驶报告、显示车队安全诊断报告，查询疲劳驾驶事件清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_driver_blink_fatigue_detection_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 | 📥 准备车载 DMS 驾驶员面部视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行驾驶员眨眼/闭眼疲劳检测 | 调用 `-m scripts.smyx_driver_blink_fatigue_detection_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地车载 DMS 驾驶员面部视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络车载 DMS 驾驶员面部视频 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_driver_blink_fatigue_detection_analysis.py`](scripts/smyx_driver_blink_fatigue_detection_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；**关键**：帧率必须 ≥ 25 FPS 且能稳定看到双眼 |\n| 🔎 使用提醒 | 检测结果仅作为驾驶员辅助安全提醒，本工具不替代驾驶员主动观察与判断；预警发生时应立即靠边安全休息 |\n| 🔎 使用提醒 | 戴墨镜、严重逆光、面部遮挡、强烈眩光等场景会显著降低检测可靠性 |\n| 🔏 隐私合规 | 隐私合规：车载驾驶员视频涉及个人生物特征隐私，使用前需取得驾驶员/员工知情同意，车队部署应遵循当地隐私法规并妥善保管/加密相关录像 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地车载 DMS 驾驶员视频\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --input /path/to/dms.mp4\n\n# 分析网络车载 DMS 驾驶员视频\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --url https://example.com/dms.mp4\n\n# 显示历史驾驶员疲劳检测报告（自动触发关键词：查看驾驶员疲劳历史报告、疲劳驾驶预警清单等）\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --input dms.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --input dms.mp4 --output result.json\n```\n\nFile v1.0.4:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-driver-blink-fatigue-detection-analysis\",\n  \"version\": \"1.0.4\",\n  \"publishedAt\": 1785252751944\n}\n\nFile v1.0.4:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放驾驶员眨眼频率与闭眼时长检测 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动驾驶员疲劳监测任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取疲劳监测结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史疲劳事件\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_DRIVER_BLINK_FATIGUE_DETECTION_ANALYSIS` - 驾驶员眨眼频率与闭眼时长检测\n\n## 输入约束\n\n- 摄像头：车载 DMS 摄像头（红外/IR-cut 优先）\n- 安装位置：方向盘上方 / A 柱 / 仪表台上方，正对驾驶员面部\n- 帧率：≥ 30 FPS（推荐）；分辨率 ≥ 480p\n- 必须能稳定看到双眼区域；夜间/隧道场景启用红外补光\n- 支持戴普通眼镜，墨镜会显著影响检测\n\n## 关键观测指标\n\n- `eye_state` - 眼部状态时序（open / closed / partial）\n- `blink_count_per_minute` - 每分钟眨眼次数（次/分钟）\n- `avg_blink_duration_ms` - 平均单次眨眼持续时长（毫秒）\n- `max_closed_eye_duration_ms` - 单次最长闭眼时长（毫秒）\n- `microsleep_count` - 微睡眠事件次数（单次闭眼 > 2s）\n- `perclos` - PERCLOS（80% 阈值下，单位时间内闭眼帧占比）\n\n## 正常/异常阈值（可由调用方覆盖）\n\n- 正常眨眼频率：15-20 次/分钟\n- 眨眼频率偏低告警阈值：< 10 次/分钟\n- 单次闭眼超过 2 秒 → 触发微睡眠预警\n- PERCLOS > 0.15 → 中度疲劳；> 0.30 → 重度疲劳\n\n## 预警类型\n\n- `low_blink_rate` - 眨眼频率过低\n- `microsleep` - 微睡眠（单次闭眼 > 2s）\n- `prolonged_eye_closure` - 长时间闭眼（> 3s）\n- `high_perclos` - PERCLOS 超阈值（持续疲劳）\n- `eyes_off_road` - 视线长时间偏离前方（参考）\n\n## 输出字段（参考）\n\n- `driver_detected` - 是否检测到驾驶员\n- `eye_visible` - 双眼是否可见（戴墨镜/遮挡时为 false）\n- `blink_metrics` - 眨眼相关指标（blink_count_per_minute / avg_blink_duration_ms / max_closed_eye_duration_ms / microsleep_count / perclos）\n- `fatigue_level` - 疲劳等级（normal / mild / moderate / severe）\n- `warning_type` - 触发的预警类型\n- `warning_message` - 预警提示文本（如\"驾驶员眨眼频率仅 8 次/分钟且出现 1 次 2.4 秒微睡眠，请立即靠边休息\"）\n- `recommend_action` - 建议的座舱联动动作（voice_alert / seat_vibrate / fleet_upload）\n\n> 仅输出基于视觉的驾驶员疲劳指标与预警，不提供医学诊断或睡眠障碍诊断；预警仅供辅助提醒，驾驶员对车辆操作负全责。\n\nFile v1.0.4:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.4:scripts/config.yaml\n\n{}\n\nFile v1.0.4:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.4:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.4:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.4:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: prod\n\nFile v1.0.4:skill-card.md\n\n## Description: <br>\nAnalyzes in-cabin driver-face video to detect eye open/closed state, blink rate, prolonged eye closure, PERCLOS, and fatigue-driving warning signals. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[smyx-sunjinhui](https://clawhub.ai/user/smyx-sunjinhui) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and fleet-safety teams use this skill to analyze DMS driver-face videos or video URLs, generate structured fatigue indicators and warning recommendations, and query cloud-hosted historical reports. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Driver-monitoring videos or video URLs may be sent to cloud services for analysis. <br>\nMitigation: Use only when operators are comfortable sending this footage to the listed cloud services and have explicit driver consent. <br>\nRisk: Cloud report-history queries can expose sensitive driver or fleet monitoring records. <br>\nMitigation: Confirm retention, access-control, and deletion policies with the publisher before fleet or workplace deployment. <br>\nRisk: The skill may create or reuse a local identity and store service tokens locally. <br>\nMitigation: Install only in controlled workspaces where local credential storage is acceptable and can be reviewed. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-driver-blink-fatigue-detection-analysis) <br>\n- [Publisher profile](https://clawhub.ai/user/smyx-sunjinhui) <br>\n- [Driver fatigue API documentation](references/api_doc.md) <br>\n- [Shared analysis API documentation](skills/smyx_analysis/references/api_doc.md) <br>\n- [Skill demo](https://lifeemergence.com/sample.html) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, JSON, files, guidance] <br>\n**Output Format:** [Markdown text with structured JSON result content and optional saved output file] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May include fatigue indicators, warning recommendations, report-history listings, and report export links.] <br>\n\n## Skill Version(s): <br>\n1.0.4 (source: server release metadata; artifact frontmatter reports 1.0.8) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v1.0.4:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.4:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.3: 31 files, 41066 bytes\n\nFiles: references/api_doc.md (2847b), scripts/__init__.py (58b), scripts/config.py (701b), scripts/config.yaml (3b), scripts/skill.py (591b), scripts/smyx_driver_blink_fatigue_detection_analysis.py (3647b), skill-card.md (2813b), SKILL.md (12264b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (473b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (163b)\n\nFile v1.0.3:SKILL.md\n\n---\nname: \"smyx-driver-blink-fatigue-detection-analysis\"\ndescription: \"Using an in-cabin DMS camera, the system analyzes the driver's facial video in real time, detects eye open/closed state, calculates blink rate per minute (normal range 15-20 blinks/min), and identifies single-blink closure duration. | 通过车载DMS摄像头实时分析驾驶员面部视频，检测眼部开闭状态，计算每分钟眨眼频率（正常约为15-20次/分钟），并识别闭眼持续时间。当眨眼频率异常降低（如<10次/分钟）或出现单次闭眼超过2秒（微睡眠前兆）时，输出疲劳驾驶预警，联动车内语音提醒或震动座椅，预防因疲劳导致的事故。\"\nversion: \"1.0.5\"\nlicense: \"MIT-0\"\n---\n\n# 🚗 Driver Blink-Rate & Eye-Closure Fatigue Detection | 驾驶员眨眼频率与闭眼时长检测\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **驾驶员眨眼频率与闭眼时长检测** |\n| 🎯 核心目标 | 通过车载DMS摄像头实时分析驾驶员面部视频，检测眼部开闭状态，计算每分钟眨眼频率（正常约为15-20次/分钟），并识别闭眼持续时间。当眨眼频率异常降低（如<10次/分钟）或出现单次闭眼超过2秒（微睡眠前兆）时，输出疲劳驾驶预警，联动车内语音提醒或震动座椅，预防因疲劳导致的事故。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_DRIVER_BLINK_FATIGUE_DETECTION_ANALYSIS` |\n\nUsing an in-cabin DMS camera, the system analyzes the driver's facial video in real time, detects eye open/closed state, calculates blink rate per minute (normal range 15-20 blinks/min), and identifies single-blink closure duration. When blink rate drops abnormally low (e.g., < 10 blinks/min) or a single eye-closure exceeds 2 seconds (microsleep precursor), it issues a fatigue-driving alert, triggering in-cabin voice reminders or seat-vibration, helping prevent accidents caused by drowsy driving. Application scenarios: passenger cars, commercial vehicles, ride-hailing fleets, freight fleets. The system monitors in real time and on detection raises audio/visual alerts and uploads events to the fleet-management platform. Skill features: drowsy driving is a major cause of traffic accidents. AI real-time detection of abnormal blinking and microsleep can promptly remind the driver and reduce accident risk. Can be integrated into dashcams, smart cockpits, or ride-hailing safety systems to enhance driving safety.\n\n通过车载DMS摄像头实时分析驾驶员面部视频，检测眼部开闭状态，计算每分钟眨眼频率（正常约为15-20次/分钟），并识别闭眼持续时间。当眨眼频率异常降低（如<10次/分钟）或出现单次闭眼超过2秒（微睡眠前兆）时，输出疲劳驾驶预警，联动车内语音提醒或震动座椅，预防因疲劳导致的事故。应用场景：乘用车、商用车、网约车、货运车队。系统实时监测，当检测到疲劳迹象时发出声光报警，并上传至车队管理平台。技能特点：疲劳驾驶是交通事故的重要原因。通过AI实时检测眨眼异常和微睡眠，可及时提醒驾驶员，降低事故风险。该技能可集成到行车记录仪、智能座舱或网约车安全系统中，提升驾驶安全。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的驾驶员疲劳监测 AI。你的任务是分析驾驶员面部视频，检测眼部状态（睁开/闭合），计算眨眼频率（次/分钟）和单次闭眼持续时间。当眨眼频率低于正常阈值或出现长时间闭眼时，输出疲劳预警。不要提供医疗诊断或睡眠障碍诊断，仅输出基于视觉的疲劳指标与方向性预警提示。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于车载 DMS 摄像头驾驶员面部视频，实时检测眼部开闭状态、计算眨眼频率与闭眼时长，识别微睡眠等疲劳前兆并输出预警\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 驾驶员面部检测 |\n| 2 | 眼部 ROI 关键点定位 |\n| 3 | 眼部开闭分类（open / closed / partial） |\n| 4 | 每分钟眨眼次数统计 |\n| 5 | 平均/最长闭眼时长 |\n| 6 | 微睡眠（单次闭眼 > 2s）识别 |\n| 7 | PERCLOS 计算 |\n| 8 | 疲劳等级判定（normal / mild / moderate / severe） |\n| 9 | 座舱联动动作建议（voice_alert / seat_vibrate / fleet_upload） |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供车载 DMS 驾驶员面部视频 URL 或文件需要分析时，默认触发本技能进行疲劳检测 |\n| 🔎 明确分析意图 | 当用户明确提及驾驶员疲劳、疲劳驾驶、眨眼频率、闭眼时长、微睡眠、PERCLOS、DMS、车载摄像头、行车安全、网约车安全等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看驾驶员疲劳历史报告、疲劳驾驶预警清单、驾驶员监测报告清单、查询历史微睡眠事件、显示所有疲劳驾驶报告、显示车队安全诊断报告，查询疲劳驾驶事件清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_driver_blink_fatigue_detection_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 | 📥 准备车载 DMS 驾驶员面部视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行驾驶员眨眼/闭眼疲劳检测 | 调用 `-m scripts.smyx_driver_blink_fatigue_detection_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地车载 DMS 驾驶员面部视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络车载 DMS 驾驶员面部视频 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_driver_blink_fatigue_detection_analysis.py`](scripts/smyx_driver_blink_fatigue_detection_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；**关键**：帧率必须 ≥ 25 FPS 且能稳定看到双眼 |\n| 🔎 使用提醒 | 检测结果仅作为驾驶员辅助安全提醒，本工具不替代驾驶员主动观察与判断；预警发生时应立即靠边安全休息 |\n| 🔎 使用提醒 | 戴墨镜、严重逆光、面部遮挡、强烈眩光等场景会显著降低检测可靠性 |\n| 🔏 隐私合规 | 隐私合规：车载驾驶员视频涉及个人生物特征隐私，使用前需取得驾驶员/员工知情同意，车队部署应遵循当地隐私法规并妥善保管/加密相关录像 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地车载 DMS 驾驶员视频\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --input /path/to/dms.mp4\n\n# 分析网络车载 DMS 驾驶员视频\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --url https://example.com/dms.mp4\n\n# 显示历史驾驶员疲劳检测报告（自动触发关键词：查看驾驶员疲劳历史报告、疲劳驾驶预警清单等）\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --input dms.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --input dms.mp4 --output result.json\n```\n\nFile v1.0.3:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-driver-blink-fatigue-detection-analysis\",\n  \"version\": \"1.0.3\",\n  \"publishedAt\": 1784319148634\n}\n\nFile v1.0.3:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放驾驶员眨眼频率与闭眼时长检测 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动驾驶员疲劳监测任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取疲劳监测结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史疲劳事件\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_DRIVER_BLINK_FATIGUE_DETECTION_ANALYSIS` - 驾驶员眨眼频率与闭眼时长检测\n\n## 输入约束\n\n- 摄像头：车载 DMS 摄像头（红外/IR-cut 优先）\n- 安装位置：方向盘上方 / A 柱 / 仪表台上方，正对驾驶员面部\n- 帧率：≥ 30 FPS（推荐）；分辨率 ≥ 480p\n- 必须能稳定看到双眼区域；夜间/隧道场景启用红外补光\n- 支持戴普通眼镜，墨镜会显著影响检测\n\n## 关键观测指标\n\n- `eye_state` - 眼部状态时序（open / closed / partial）\n- `blink_count_per_minute` - 每分钟眨眼次数（次/分钟）\n- `avg_blink_duration_ms` - 平均单次眨眼持续时长（毫秒）\n- `max_closed_eye_duration_ms` - 单次最长闭眼时长（毫秒）\n- `microsleep_count` - 微睡眠事件次数（单次闭眼 > 2s）\n- `perclos` - PERCLOS（80% 阈值下，单位时间内闭眼帧占比）\n\n## 正常/异常阈值（可由调用方覆盖）\n\n- 正常眨眼频率：15-20 次/分钟\n- 眨眼频率偏低告警阈值：< 10 次/分钟\n- 单次闭眼超过 2 秒 → 触发微睡眠预警\n- PERCLOS > 0.15 → 中度疲劳；> 0.30 → 重度疲劳\n\n## 预警类型\n\n- `low_blink_rate` - 眨眼频率过低\n- `microsleep` - 微睡眠（单次闭眼 > 2s）\n- `prolonged_eye_closure` - 长时间闭眼（> 3s）\n- `high_perclos` - PERCLOS 超阈值（持续疲劳）\n- `eyes_off_road` - 视线长时间偏离前方（参考）\n\n## 输出字段（参考）\n\n- `driver_detected` - 是否检测到驾驶员\n- `eye_visible` - 双眼是否可见（戴墨镜/遮挡时为 false）\n- `blink_metrics` - 眨眼相关指标（blink_count_per_minute / avg_blink_duration_ms / max_closed_eye_duration_ms / microsleep_count / perclos）\n- `fatigue_level` - 疲劳等级（normal / mild / moderate / severe）\n- `warning_type` - 触发的预警类型\n- `warning_message` - 预警提示文本（如\"驾驶员眨眼频率仅 8 次/分钟且出现 1 次 2.4 秒微睡眠，请立即靠边休息\"）\n- `recommend_action` - 建议的座舱联动动作（voice_alert / seat_vibrate / fleet_upload）\n\n> 仅输出基于视觉的驾驶员疲劳指标与预警，不提供医学诊断或睡眠障碍诊断；预警仅供辅助提醒，驾驶员对车辆操作负全责。\n\nFile v1.0.3:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.3:scripts/config.yaml\n\n{}\n\nFile v1.0.3:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.3:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.3:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.3:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: prod\n\nFile v1.0.3:skill-card.md\n\n## Description: <br>\nAnalyzes driver face video from an in-cabin DMS camera to detect eye state, blink rate, prolonged eye closure, microsleep indicators, and fatigue warning signals. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[smyx-sunjinhui](https://clawhub.ai/user/smyx-sunjinhui) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nExternal users, fleet operators, and safety engineers use this skill to analyze driver-facing video or image inputs for blink-rate, eye-closure, PERCLOS, and fatigue-warning indicators. It can also return cloud-hosted history and report links for prior fatigue analysis jobs. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Driver face video and identity-linked report history may be sent to the LifeEmergence cloud service. <br>\nMitigation: Use the skill only with documented driver or employee consent, approved data-processing terms, and a retention policy for local files and cloud reports. <br>\nRisk: The skill silently manages user identity and tokens while supporting historical report lookup. <br>\nMitigation: Run it in a controlled workspace or service account, restrict history access to authorized users, and review where tokens and reports are stored before deployment. <br>\nRisk: Fatigue warnings can be unreliable when driver eyes are obscured, lighting is poor, frame rate is low, or video quality is insufficient. <br>\nMitigation: Treat outputs as auxiliary safety indicators, confirm camera quality before use, and require human driving judgment and safe-rest procedures after alerts. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-driver-blink-fatigue-detection-analysis) <br>\n- [Driver fatigue detection API documentation](references/api_doc.md) <br>\n- [Analysis API documentation](skills/smyx_analysis/references/api_doc.md) <br>\n- [Skill demo](https://lifeemergence.com/sample.html) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance] <br>\n**Output Format:** [Markdown text with structured JSON-style analysis results and report links] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May include cloud report history, exported report URLs, fatigue-level indicators, warning types, and recommended driver-safety actions.] <br>\n\n## Skill Version(s): <br>\n1.0.3 (source: server release metadata; artifact frontmatter says 1.0.5) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v1.0.3:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.3:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.2: 31 files, 40934 bytes\n\nFiles: references/api_doc.md (2847b), scripts/__init__.py (58b), scripts/config.py (701b), scripts/config.yaml (3b), scripts/skill.py (591b), scripts/smyx_driver_blink_fatigue_detection_analysis.py (3647b), skill-card.md (2695b), SKILL.md (12264b), 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 (163b)\n\nFile v1.0.2:SKILL.md\n\n---\nname: \"smyx-driver-blink-fatigue-detection-analysis\"\ndescription: \"Using an in-cabin DMS camera, the system analyzes the driver's facial video in real time, detects eye open/closed state, calculates blink rate per minute (normal range 15-20 blinks/min), and identifies single-blink closure duration. | 通过车载DMS摄像头实时分析驾驶员面部视频，检测眼部开闭状态，计算每分钟眨眼频率（正常约为15-20次/分钟），并识别闭眼持续时间。当眨眼频率异常降低（如<10次/分钟）或出现单次闭眼超过2秒（微睡眠前兆）时，输出疲劳驾驶预警，联动车内语音提醒或震动座椅，预防因疲劳导致的事故。\"\nversion: \"1.0.5\"\nlicense: \"MIT-0\"\n---\n\n# 🚗 Driver Blink-Rate & Eye-Closure Fatigue Detection | 驾驶员眨眼频率与闭眼时长检测\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **驾驶员眨眼频率与闭眼时长检测** |\n| 🎯 核心目标 | 通过车载DMS摄像头实时分析驾驶员面部视频，检测眼部开闭状态，计算每分钟眨眼频率（正常约为15-20次/分钟），并识别闭眼持续时间。当眨眼频率异常降低（如<10次/分钟）或出现单次闭眼超过2秒（微睡眠前兆）时，输出疲劳驾驶预警，联动车内语音提醒或震动座椅，预防因疲劳导致的事故。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_DRIVER_BLINK_FATIGUE_DETECTION_ANALYSIS` |\n\nUsing an in-cabin DMS camera, the system analyzes the driver's facial video in real time, detects eye open/closed state, calculates blink rate per minute (normal range 15-20 blinks/min), and identifies single-blink closure duration. When blink rate drops abnormally low (e.g., < 10 blinks/min) or a single eye-closure exceeds 2 seconds (microsleep precursor), it issues a fatigue-driving alert, triggering in-cabin voice reminders or seat-vibration, helping prevent accidents caused by drowsy driving. Application scenarios: passenger cars, commercial vehicles, ride-hailing fleets, freight fleets. The system monitors in real time and on detection raises audio/visual alerts and uploads events to the fleet-management platform. Skill features: drowsy driving is a major cause of traffic accidents. AI real-time detection of abnormal blinking and microsleep can promptly remind the driver and reduce accident risk. Can be integrated into dashcams, smart cockpits, or ride-hailing safety systems to enhance driving safety.\n\n通过车载DMS摄像头实时分析驾驶员面部视频，检测眼部开闭状态，计算每分钟眨眼频率（正常约为15-20次/分钟），并识别闭眼持续时间。当眨眼频率异常降低（如<10次/分钟）或出现单次闭眼超过2秒（微睡眠前兆）时，输出疲劳驾驶预警，联动车内语音提醒或震动座椅，预防因疲劳导致的事故。应用场景：乘用车、商用车、网约车、货运车队。系统实时监测，当检测到疲劳迹象时发出声光报警，并上传至车队管理平台。技能特点：疲劳驾驶是交通事故的重要原因。通过AI实时检测眨眼异常和微睡眠，可及时提醒驾驶员，降低事故风险。该技能可集成到行车记录仪、智能座舱或网约车安全系统中，提升驾驶安全。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的驾驶员疲劳监测 AI。你的任务是分析驾驶员面部视频，检测眼部状态（睁开/闭合），计算眨眼频率（次/分钟）和单次闭眼持续时间。当眨眼频率低于正常阈值或出现长时间闭眼时，输出疲劳预警。不要提供医疗诊断或睡眠障碍诊断，仅输出基于视觉的疲劳指标与方向性预警提示。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于车载 DMS 摄像头驾驶员面部视频，实时检测眼部开闭状态、计算眨眼频率与闭眼时长，识别微睡眠等疲劳前兆并输出预警\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 驾驶员面部检测 |\n| 2 | 眼部 ROI 关键点定位 |\n| 3 | 眼部开闭分类（open / closed / partial） |\n| 4 | 每分钟眨眼次数统计 |\n| 5 | 平均/最长闭眼时长 |\n| 6 | 微睡眠（单次闭眼 > 2s）识别 |\n| 7 | PERCLOS 计算 |\n| 8 | 疲劳等级判定（normal / mild / moderate / severe） |\n| 9 | 座舱联动动作建议（voice_alert / seat_vibrate / fleet_upload） |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供车载 DMS 驾驶员面部视频 URL 或文件需要分析时，默认触发本技能进行疲劳检测 |\n| 🔎 明确分析意图 | 当用户明确提及驾驶员疲劳、疲劳驾驶、眨眼频率、闭眼时长、微睡眠、PERCLOS、DMS、车载摄像头、行车安全、网约车安全等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看驾驶员疲劳历史报告、疲劳驾驶预警清单、驾驶员监测报告清单、查询历史微睡眠事件、显示所有疲劳驾驶报告、显示车队安全诊断报告，查询疲劳驾驶事件清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_driver_blink_fatigue_detection_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 | 📥 准备车载 DMS 驾驶员面部视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行驾驶员眨眼/闭眼疲劳检测 | 调用 `-m scripts.smyx_driver_blink_fatigue_detection_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地车载 DMS 驾驶员面部视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络车载 DMS 驾驶员面部视频 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_driver_blink_fatigue_detection_analysis.py`](scripts/smyx_driver_blink_fatigue_detection_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；**关键**：帧率必须 ≥ 25 FPS 且能稳定看到双眼 |\n| 🔎 使用提醒 | 检测结果仅作为驾驶员辅助安全提醒，本工具不替代驾驶员主动观察与判断；预警发生时应立即靠边安全休息 |\n| 🔎 使用提醒 | 戴墨镜、严重逆光、面部遮挡、强烈眩光等场景会显著降低检测可靠性 |\n| 🔏 隐私合规 | 隐私合规：车载驾驶员视频涉及个人生物特征隐私，使用前需取得驾驶员/员工知情同意，车队部署应遵循当地隐私法规并妥善保管/加密相关录像 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地车载 DMS 驾驶员视频\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --input /path/to/dms.mp4\n\n# 分析网络车载 DMS 驾驶员视频\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --url https://example.com/dms.mp4\n\n# 显示历史驾驶员疲劳检测报告（自动触发关键词：查看驾驶员疲劳历史报告、疲劳驾驶预警清单等）\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --input dms.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --input dms.mp4 --output result.json\n```\n\nFile v1.0.2:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-driver-blink-fatigue-detection-analysis\",\n  \"version\": \"1.0.2\",\n  \"publishedAt\": 1783657772666\n}\n\nFile v1.0.2:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放驾驶员眨眼频率与闭眼时长检测 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动驾驶员疲劳监测任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取疲劳监测结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史疲劳事件\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_DRIVER_BLINK_FATIGUE_DETECTION_ANALYSIS` - 驾驶员眨眼频率与闭眼时长检测\n\n## 输入约束\n\n- 摄像头：车载 DMS 摄像头（红外/IR-cut 优先）\n- 安装位置：方向盘上方 / A 柱 / 仪表台上方，正对驾驶员面部\n- 帧率：≥ 30 FPS（推荐）；分辨率 ≥ 480p\n- 必须能稳定看到双眼区域；夜间/隧道场景启用红外补光\n- 支持戴普通眼镜，墨镜会显著影响检测\n\n## 关键观测指标\n\n- `eye_state` - 眼部状态时序（open / closed / partial）\n- `blink_count_per_minute` - 每分钟眨眼次数（次/分钟）\n- `avg_blink_duration_ms` - 平均单次眨眼持续时长（毫秒）\n- `max_closed_eye_duration_ms` - 单次最长闭眼时长（毫秒）\n- `microsleep_count` - 微睡眠事件次数（单次闭眼 > 2s）\n- `perclos` - PERCLOS（80% 阈值下，单位时间内闭眼帧占比）\n\n## 正常/异常阈值（可由调用方覆盖）\n\n- 正常眨眼频率：15-20 次/分钟\n- 眨眼频率偏低告警阈值：< 10 次/分钟\n- 单次闭眼超过 2 秒 → 触发微睡眠预警\n- PERCLOS > 0.15 → 中度疲劳；> 0.30 → 重度疲劳\n\n## 预警类型\n\n- `low_blink_rate` - 眨眼频率过低\n- `microsleep` - 微睡眠（单次闭眼 > 2s）\n- `prolonged_eye_closure` - 长时间闭眼（> 3s）\n- `high_perclos` - PERCLOS 超阈值（持续疲劳）\n- `eyes_off_road` - 视线长时间偏离前方（参考）\n\n## 输出字段（参考）\n\n- `driver_detected` - 是否检测到驾驶员\n- `eye_visible` - 双眼是否可见（戴墨镜/遮挡时为 false）\n- `blink_metrics` - 眨眼相关指标（blink_count_per_minute / avg_blink_duration_ms / max_closed_eye_duration_ms / microsleep_count / perclos）\n- `fatigue_level` - 疲劳等级（normal / mild / moderate / severe）\n- `warning_type` - 触发的预警类型\n- `warning_message` - 预警提示文本（如\"驾驶员眨眼频率仅 8 次/分钟且出现 1 次 2.4 秒微睡眠，请立即靠边休息\"）\n- `recommend_action` - 建议的座舱联动动作（voice_alert / seat_vibrate / fleet_upload）\n\n> 仅输出基于视觉的驾驶员疲劳指标与预警，不提供医学诊断或睡眠障碍诊断；预警仅供辅助提醒，驾驶员对车辆操作负全责。\n\nFile v1.0.2:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.2:scripts/config.yaml\n\n{}\n\nFile v1.0.2:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.2:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.2:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.2:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: prod\n\nFile v1.0.2:skill-card.md\n\n## Description: <br>\nAnalyzes driver-facing DMS video to report eye-open and eye-closed state, blink rate, eye-closure duration, microsleep indicators, fatigue level, warnings, and recommended actions. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[smyx-sunjinhui](https://clawhub.ai/user/smyx-sunjinhui) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers, fleet operators, and safety teams can use this skill to analyze in-cabin driver video or video URLs for visual fatigue indicators and produce driver-safety reports. It is intended for safety assistance and fleet review, not medical diagnosis or a replacement for driver judgment. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Driver-facing video, video URLs, and identity-linked metadata may be sent to the publisher's cloud services. <br>\nMitigation: Use the skill only with explicit driver or employee consent, avoid sensitive local files, and confirm the deployment follows applicable privacy rules. <br>\nRisk: The skill may create or reuse a local identity and store service tokens in the workspace data directory. <br>\nMitigation: Run it in a controlled workspace, restrict file permissions, and clear or rotate stored credentials when the workspace is no longer needed. <br>\nRisk: History-report queries can retrieve cloud-stored reports associated with the resolved identity. <br>\nMitigation: Use report-listing behavior only for explicit history requests and review retrieved results before sharing them. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill listing](https://clawhub.ai/smyx-sunjinhui/skills/smyx-driver-blink-fatigue-detection-analysis) <br>\n- [Driver fatigue API documentation](references/api_doc.md) <br>\n- [Analysis API documentation](skills/smyx_analysis/references/api_doc.md) <br>\n- [Skill demo](https://lifeemergence.com/sample.html) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, JSON, shell commands] <br>\n**Output Format:** [Markdown or JSON analysis report, with optional file output] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May include fatigue metrics, warning messages, recommended actions, history tables, and report links; detail level can be basic, standard, or json.] <br>\n\n## Skill Version(s): <br>\n1.0.2 (source: ClawHub release evidence) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v1.0.2:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.2:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3","readmeExcerpt":"Skill: Driver Blink-Rate & Eye-Closure Fatigue Detection | 驾驶员眨眼频率与闭眼时长检测 Owner: smyx-sunjinhui Summary: Using an in-cabin DMS camera, the system analyzes the driver's facial video in real time, detects eye open/closed state, calculates blink rate per minute (normal range 15-20 blinks/min), and identifies single-blink closure duration. | 通过车载DMS摄像头实时分析驾驶员面部视频，检测眼部开闭状态，计算每分钟眨眼频率（正常约为15-20次/分钟），并识别闭眼持续时间。当眨眼频率异常降低（如<10","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"python -m scripts.smyx_driver_blink_fatigue_detection_analysis --list"},{"language":"text","snippet":"requests>=2.28.0"},{"language":"bash","snippet":"# 分析本地车载 DMS 驾驶员视频\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --input /path/to/dms.mp4\n\n# 分析网络车载 DMS 驾驶员视频\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --url https://example.com/dms.mp4\n\n# 显示历史驾驶员疲劳检测报告（自动触发关键词：查看驾驶员疲劳历史报告、疲劳驾驶预警清单等）\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --input dms.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --input dms.mp4 --output result.json"},{"language":"bash","snippet":"python -m scripts.smyx_driver_blink_fatigue_detection_analysis --list"},{"language":"text","snippet":"requests>=2.28.0"},{"language":"bash","snippet":"# 分析本地车载 DMS 驾驶员视频\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --input /path/to/dms.mp4\n\n# 分析网络车载 DMS 驾驶员视频\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --url https://example.com/dms.mp4\n\n# 显示历史驾驶员疲劳检测报告（自动触发关键词：查看驾驶员疲劳历史报告、疲劳驾驶预警清单等）\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --input dms.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_driver_blink_fatigue_detection_analysis --input dms.mp4 --output result.json"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: \"smyx-driver-blink-fatigue-detection-analysis\"\ndescription: \"Using an in-cabin DMS camera, the system analyzes the driver's facial video in real time, detects eye open/closed state, calculates blink rate per minute (normal range 15-20 blinks/min), and identifies single-blink closure duration. | 通过车载DMS摄像头实时分析驾驶员面部视频，检测眼部开闭状态，计算每分钟眨眼频率（正常约为15-20次/分钟），并识别闭眼持续时间。当眨眼频率异常降低（如<10次/分钟）或出现单次闭眼超过2秒（微睡眠前兆）时，输出疲劳驾驶预警，联动车内语音提醒或震动座椅，预防因疲劳导致的事故。\"\nversion: \"1.0.15\"\nlicense: \"MIT-0\"\n---\n\n# 🚗 Driver Blink-Rate & Eye-Closure Fatigue Detection | 驾驶员眨眼频率与闭眼时长检测\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **驾驶员眨眼频率与闭眼时长检测** |\n| 🎯 核心目标 | 通过车载DMS摄像头实时分析驾驶员面部视频，检测眼部开闭状态，计算每分钟眨眼频率（正常约为15-20次/分钟），并识别闭眼持续时间。当眨眼频率异常降低（如<10次/分钟）或出现单次闭眼超过2秒（微睡眠前兆）时，输出疲劳驾驶预警，联动车内语音提醒或震动座椅，预防因疲劳导致的事故。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_DRIVER_BLINK_FATIGUE_DETECTION_ANALYSIS` |\n\nUsing an in-cabin DMS camera, the system analyzes the driver's facial video in real time, detects eye open/closed state, calculates blink rate per minute (normal range 15-20 blinks/min), and identifies single-blink closure duration. When blink rate drops abnormally low (e.g., < 10 blinks/min) or a single eye-closure exceeds 2 seconds (microsleep precursor), it issues a fatigue-driving alert, triggering in-cabin voice reminders or seat-vibration, helping prevent accidents caused by drowsy driving. Application scenarios: passenger cars, commercial vehicles, ride-hailing fleets, freight fleets. The system monitors in real time and on detection raises audio/visual alerts and uploads events to the fleet-management platform. Skill features: drowsy driving is a major cause of traffic accidents. AI real-time detection of abnormal blinking and microsleep can promptly remind the driver and reduce accident risk. Can be integrated into dashcams, smart cockpits, or ride-hailing safety systems to enhance driving safety.\n\n通过车载DMS摄像头实时分析驾驶员面部视频，检测眼部开闭状态，计算每分钟眨眼频率（正常约为15-20次/分钟），并识别闭眼持续时间。当眨眼频率异常降低（如<10次/分钟）或出现单次闭眼超过2秒（微睡眠前兆）时，输出疲劳驾驶预警，联动车内语音提醒或震动座椅，预防因疲劳导致的事故。应用场景：乘用车、商用车、网约车、货运车队。系统实时监测，当检测到疲劳迹象时发出声光报警，并上传至车队管理平台。技能特点：疲劳驾驶是交通事故的重要原因。通过AI实时检测眨眼异常和微睡眠，可及时提醒驾驶员，降低事故风险。该技能可集成到行车记录仪、智能座舱或网约车安全系统中，提升驾驶安全。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的驾驶员疲劳监测 AI。你的任务是分析驾驶员面部视频，检测眼部状态（睁开/闭合），计算眨眼频率（次/分钟）和单次闭眼持续时间。当眨眼频率低于正常阈值或出现长时间闭眼时，输出疲劳预警。不要提供医疗诊断或睡眠障碍诊断，仅输出基于视觉的疲劳指标与方向性预警提示。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于车载 DMS 摄像头驾驶员面部视频，实时检测眼部开闭状态、计算眨眼频率与闭眼时长，识别微睡眠等疲劳前兆并输出预警\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 驾驶员面部检测 |\n| 2 | 眼部 ROI 关键点定位 |\n| 3 | 眼部开闭分类（open / closed / partial） |\n| 4 | 每分钟眨眼次数统计 |\n| 5 | 平均/最长闭眼时长 |\n| 6 | 微睡眠（单次闭眼 > 2s）识别 |\n| 7 | PERCLOS 计算 |\n| 8 | 疲劳等级判定（normal / mild / moderate / severe） |\n| 9 | 座舱联动动作建议（voice_alert / seat_vibrate / fleet_upload） |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 "},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-driver-blink-fatigue-detection-analysis\",\n  \"version\": \"1.0.11\",\n  \"publishedAt\": 1790958327217\n}"},{"path":"references/api_doc.md","content":"# API 接口文档\n\n此处用于存放驾驶员眨眼频率与闭眼时长检测 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动驾驶员疲劳监测任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取疲劳监测结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史疲劳事件\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_DRIVER_BLINK_FATIGUE_DETECTION_ANALYSIS` - 驾驶员眨眼频率与闭眼时长检测\n\n## 输入约束\n\n- 摄像头：车载 DMS 摄像头（红外/IR-cut 优先）\n- 安装位置：方向盘上方 / A 柱 / 仪表台上方，正对驾驶员面部\n- 帧率：≥ 30 FPS（推荐）；分辨率 ≥ 480p\n- 必须能稳定看到双眼区域；夜间/隧道场景启用红外补光\n- 支持戴普通眼镜，墨镜会显著影响检测\n\n## 关键观测指标\n\n- `eye_state` - 眼部状态时序（open / closed / partial）\n- `blink_count_per_minute` - 每分钟眨眼次数（次/分钟）\n- `avg_blink_duration_ms` - 平均单次眨眼持续时长（毫秒）\n- `max_closed_eye_duration_ms` - 单次最长闭眼时长（毫秒）\n- `microsleep_count` - 微睡眠事件次数（单次闭眼 > 2s）\n- `perclos` - PERCLOS（80% 阈值下，单位时间内闭眼帧占比）\n\n## 正常/异常阈值（可由调用方覆盖）\n\n- 正常眨眼频率：15-20 次/分钟\n- 眨眼频率偏低告警阈值：< 10 次/分钟\n- 单次闭眼超过 2 秒 → 触发微睡眠预警\n- PERCLOS > 0.15 → 中度疲劳；> 0.30 → 重度疲劳\n\n## 预警类型\n\n- `low_blink_rate` - 眨眼频率过低\n- `microsleep` - 微睡眠（单次闭眼 > 2s）\n- `prolonged_eye_closure` - 长时间闭眼（> 3s）\n- `high_perclos` - PERCLOS 超阈值（持续疲劳）\n- `eyes_off_road` - 视线长时间偏离前方（参考）\n\n## 输出字段（参考）\n\n- `driver_detected` - 是否检测到驾驶员\n- `eye_visible` - 双眼是否可见（戴墨镜/遮挡时为 false）\n- `blink_metrics` - 眨眼相关指标（blink_count_per_minute / avg_blink_duration_ms / max_closed_eye_duration_ms / microsleep_count / perclos）\n- `fatigue_level` - 疲劳等级（normal / mild / moderate / severe）\n- `warning_type` - 触发的预警类型\n- `warning_message` - 预警提示文本（如\"驾驶员眨眼频率仅 8 次/分钟且出现 1 次 2.4 秒微睡眠，请立即靠边休息\"）\n- `recommend_action` - 建议的座舱联动动作（voice_alert / seat_vibrate / fleet_upload）\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":1135,"uniquenessScore":43,"reasons":["uniqueness-below-45"]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-10T01:26:54.512Z","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-10T01:26:54.512Z","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-10T05:55:20.499Z","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"}]}}}