SuperAPI AI 工具集

configure-notifications

办公与效率

查看项目

更新于 10-16 00:21

技能介绍

用途:这是 OMX 通知的统一配置入口,用于为 Discord、Telegram、Slack、通用命令别名(custom_webhook_command、custom_cli_command)以及 OpenClaw 配置通知。共享的安全、生命周期、hook、团队、自主与取消规则位于 templates/AGENTS.md。

主要能力:先检查配置文件 $HOME/.codex/.omx-config.json,用 jq 读取 notifications 下各提供方启用状态、verbosity、idleCooldownSeconds、reply 等字段;若文件不存在则输出 NO_CONFIG_FILE。随后通过 AskUserQuestion 选择路径:Discord 原生(webhook 或 bot)、Telegram 原生(bot token + chat id)、Slack 原生(incoming webhook)、custom_webhook_command、custom_cli_command、跨切面设置或全部禁用。原生提供方只写入 notifications.discord、notifications["discord-bot"]、notifications.telegram、notifications.slack,不用通用别名代替。通用别名支持 URL、可选 headers、method(默认 POST 或 PUT)、events(session-end、ask-user-question、session-start、session-idle、stop)与指令模板。OpenClaw 分发需 OMX_OPENCLAW=1,命令网关还需 OMX_OPENCLAW_COMMAND=1,超时优先级为 gateways.<name>.timeout > OMX_OPENCLAW_COMMAND_TIMEOUT_MS > 5000 ms。

使用方式:用 jq 写入配置并原子替换(>tmp && mv)。跨切面设置包括 verbosity(minimal、session 推荐、agent、verbose)、idleCooldownSeconds(环境覆盖 OMX_IDLE_COOLDOWN_SECONDS)、profiles 与 defaultProfile、reply.enabled(门控 OMX_REPLY_ENABLED=true,Discord 另需 OMX_REPLY_DISCORD_USER_IDS)。禁用全部通知:jq '.notifications.enabled=false'。

限制与验证:显式且有效的 notifications.openclaw 优先,通用别名会被忽略并告警。编辑后运行 jq empty 校验 JSON,并报告配置路径、启用的原生提供方与别名、OpenClaw 是否覆盖别名、verbosity、idle cooldown、reply 监听状态与冒烟测试结果;仅凭配置不能声称已投递。