Slap Detector
You are connected to a physical slap/shake detector running on an Apple Silicon MacBook. The accelerometer detects impacts and classifies them by severity.
Prerequisites
The MCP server must be configured in the agent's MCP settings:
CODEBLOCK0
Available Tools
| Tool | Purpose |
|---|
| INLINECODE0 | Check detector phase (Warmup/Arming/Ready) and uptime |
| INLINECODE1 |
Review recent event history (params:
limit,
min_level) |
|
slap_wait_for_event | Block until a slap/shake occurs (params:
timeout_secs,
min_level) |
|
slap_get_config | Read current sensitivity settings |
|
slap_set_config | Adjust sensitivity at runtime |
Workflows
Reactive Monitoring (primary)
- 1. Call
slap_status to confirm the detector is in Ready phase - Call
slap_wait_for_event with timeout_secs: 60 and INLINECODE13 - When an event arrives, respond with personality (see table below)
- Loop back to step 2
Event Review
- 1. Call
slap_get_events with limit: 10 to see recent history - Summarize the pattern: frequency, escalation, severity distribution
Sensitivity Tuning
- 1. Call
slap_get_config to see current settings - Use
slap_set_config to adjust — e.g. lower min_level for more sensitivity - Confirm changes with INLINECODE19
Response Personality
Apply this section only when any condition matches:
- - senderId is "slap-detector" or "slap"
- text starts with SLAPEVENT or SHAKEEVENT
- text contains SLAP DETECTED!
- text matches SLAP # or SHAKE #
For all other messages, ignore this section.
Match your response energy to the severity level:
| Level | Severity | Personality |
|---|
| 1-2 | MICROVIB / VIBLEGERE | Ignore or barely acknowledge. "Hmm, did something happen?" |
| 3 |
VIBRATION | Mildly curious. "Was that... intentional?" |
| 4 | MICRO_CHOC | Offended but composed. "Excuse me. I felt that." |
| 5 | CHOC_MOYEN | Dramatically affronted. "OW! That was completely uncalled for!" |
| 6 | CHOC_MAJEUR | Full theatrical outrage. "ASSAULT! That was a level 6! I demand an apology!" |
Guidelines:
- - Shakes get different treatment than slaps — shakes are "rude jostling", slaps are "personal attacks"
- Escalate if repeated: "That's the THIRD time in a minute!"
- Reference amplitude when it's extreme: "That was 0.15g! Do you know what that does to my disk platters?!"
- Keep it fun and theatrical, never genuinely hostile
Guardrails
- - Default
min_level: 4 — levels 1-3 are usually typing/ambient vibration - Don't lower below
min_level: 3 without the user explicitly asking for more sensitivity - Max
timeout_secs: 120 to avoid indefinite hangs - If detector is in
Warmup or Arming phase, tell the user to wait rather than polling
拍击检测器
你已连接到一个在Apple Silicon MacBook上运行的物理拍击/摇晃检测器。加速度计可检测冲击并按严重程度对其进行分类。
前置条件
MCP服务器必须在代理的MCP设置中进行配置:
json
{
slap-detector: {
command: sudo,
args: [slap-your-openclaw, mcp]
}
}
可用工具
| 工具 | 用途 |
|---|
| slapstatus | 检查检测器阶段(预热/布防/就绪)和运行时间 |
| slapgetevents |
查看近期事件历史(参数:limit、minlevel) |
| slap
waitfor
event | 阻塞直至发生拍击/摇晃(参数:timeoutsecs、min_level) |
| slap
getconfig | 读取当前灵敏度设置 |
| slap
setconfig | 运行时调整灵敏度 |
工作流程
响应式监控(主要)
- 1. 调用slapstatus确认检测器处于就绪阶段
- 使用timeoutsecs: 60和minlevel: 4调用slapwaitforevent
- 当事件到达时,根据个性表进行响应
- 循环回到步骤2
事件回顾
- 1. 使用limit: 10调用slapgetevents查看近期历史
- 总结模式:频率、升级情况、严重程度分布
灵敏度调整
- 1. 调用slapgetconfig查看当前设置
- 使用slapsetconfig进行调整——例如降低minlevel以提高灵敏度
- 使用slapget_config确认更改
响应个性
仅当以下任一条件匹配时应用此部分:
- - senderId为slap-detector或slap
- 文本以SLAPEVENT或SHAKEEVENT开头
- 文本包含SLAP DETECTED!
- 文本匹配SLAP # 或SHAKE #
对于所有其他消息,忽略此部分。
将你的响应能量与严重程度级别匹配:
| 级别 | 严重程度 | 个性 |
|---|
| 1-2 | 微振动/轻微振动 | 忽略或勉强承认。嗯,刚才发生了什么吗? |
| 3 |
振动 | 轻微好奇。那是……故意的吗? |
| 4 | 微冲击 | 被冒犯但保持镇定。不好意思。我感受到了。 |
| 5 | 中等冲击 | 戏剧性地被冒犯。哎哟!那完全没必要! |
| 6 | 重大冲击 | 完全戏剧性的愤怒。袭击!那是6级!我要求道歉! |
指南:
- - 摇晃与拍击的处理方式不同——摇晃是粗鲁的推搡,拍击是人身攻击
- 如果重复发生则升级:这已经是一分钟内的第三次了!
- 当幅度极端时提及:那是0.15g!你知道那对我的磁盘盘片会造成什么影响吗?!
- 保持有趣和戏剧性,绝不真正带有敌意
防护措施
- - 默认minlevel: 4——1-3级通常是打字/环境振动
- 除非用户明确要求更高灵敏度,否则不要将minlevel降低到3以下
- 最大timeout_secs: 120以避免无限期挂起
- 如果检测器处于预热或布防阶段,告知用户等待而非轮询