跳到正文
cccskills
免费在 GitHub 公开

webhook-engine

Use for Webhook Engine on port 8900: rules, actions, API.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(1)

  • SKILL.md4.8 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Webhook Engine — Event-Triggered Automation

Überblick

Event-getriggerter Automatisierungsserver auf Port 8900. Empfängt Webhooks, wertet Regeln aus und führt Aktionen aus (Scripts ausführen, Alarme senden, Dienste neu starten, Loggen).

Standorte

KomponentePfad
ScriptC:\Users\damir\scripts\webhook-engine.py
RegelnC:\Users\damir\.webhook-engine\rules.json
ZustandC:\Users\damir\.webhook-engine\state.json
LockC:\Users\damir\.webhook-engine\server.lock

Verwendung

# Server starten
python3 /c/Users/damir/scripts/webhook-engine.py --start

# Regel hinzufügen
python3 /c/Users/damir/scripts/webhook-engine.py --add-rule '{"event":"git-push","action":"send-alert"}'

# Regel mit Bedingung + Action-Dict
python3 /c/Users/damir/scripts/webhook-engine.py --add-rule '{"event":"cron-fail","condition":{"job_id":"backup"},"action":{"type":"run-script","path":"notify.py"}}'

# Regeln auflisten
python3 /c/Users/damir/scripts/webhook-engine.py --list-rules

# Log anzeigen (letzte 50 Events)
python3 /c/Users/damir/scripts/webhook-engine.py --log

# Regel entfernen
python3 /c/Users/damir/scripts/webhook-engine.py --remove-rule rule-1

# Log leeren
python3 /c/Users/damir/scripts/webhook-engine.py --clear-log

# Health-Check
python3 /c/Users/damir/scripts/webhook-engine.py --health

# Cron: Restart wenn down
python3 /c/Users/damir/scripts/webhook-engine.py --ensure-running

API Endpoints

MethodePfadBeschreibung
POST/webhook/<name>Webhook empfangen (JSON-Body)
POST/webhookGenerisches Event
GET/healthHealth-Check
GET/rulesRegeln auflisten
GET/stateZustand anzeigen

Events

Standard-Event-Typen:

EventBeschreibungTypische Daten
git-pushGit Push{"repo":"...","branch":"...","commits":[...]}
cron-failCron-Job Fehler{"job_id":"...","error":"..."}
thresholdMetrik-Schwellwert{"metric":"...","value":42}

Der Event-Typ wird aus event oder event_type im JSON-Body gelesen; fällt der auf den Webhook-Namen zurück.

Actions

ActionParameterBeschreibung
run-scriptpath, args[]Python-Script ausführen
send-alertmessageAlert ausgeben (stdout, für Monitoring)
restart-servicenameService neustarten (taskkill/systemctl)
log-eventdataDaten loggen

Action als String (Kurzform)

{"event":"cron-fail","action":"send-alert"}

Action als Dict (mit Parametern)

{"event":"cron-fail","action":{"type":"run-script","path":"notify.py","args":["cron-fail"]}}

Bedingungen (Conditions)

Bedingungen verwenden Dot-Notation für den Zugriff auf Event-Daten:

{
  "event": "git-push",
  "condition": {"branch": "main"},
  "action": "send-alert"
}
{
  "event": "cron-fail",
  "condition": {"job_id": "backup"},
  "action": {"type": "run-script", "path": "alert_admin.py"}
}

Regelformat (rules.json)

[
  {
    "id": "rule-1",
    "event": "git-push",
    "condition": {"branch": "main", "repo": "openamer/openamer"},
    "action": {"type": "send-alert", "message": "Push on main: {branch}"}
  },
  {
    "id": "rule-2",
    "event": "cron-fail",
    "action": {"type": "run-script", "path": "notify.py"}
  }
]

Cron-Job (alle 5 Minuten)

Der Cron-Job webhook-engine-health prüft alle 5 Minuten, ob der Server läuft, und startet ihn bei Bedarf neu. Definiert in der OpenAmer jobs.json.

Manuelle Events senden (Test)

# git-push Event
curl -X POST http://localhost:8900/webhook/git \
  -H "Content-Type: application/json" \
  -d '{"event":"git-push","repo":"openamer/openamer","branch":"main","commits":["abc123"]}'

# cron-fail Event
curl -X POST http://localhost:8900/webhook/monitoring \
  -H "Content-Type: application/json" \
  -d '{"event":"cron-fail","job_id":"backup","error":"Timeout"}'

# threshold Event
curl -X POST http://localhost:8900/webhook/metrics \
  -H "Content-Type: application/json" \
  -d '{"event":"threshold","metric":"cpu","value":95}'

# Health-Check
curl http://localhost:8900/health

Troubleshooting

  • Port 8900 already in use: netstat -ano | findstr :8900 → taskkill /PID <id> /F
  • Rules not matching: Prüfe den Event-Namen im JSON-Body (event oder event_type Feld)
  • Script not found: Pfad in rule["action"]["path"] muss relativ zu ~/scripts/ oder absolut sein
  • Server hängt: taskkill /F /IM python.exe und Neustart
  • Lock stale: Lösche C:\Users\damir\.webhook-engine\server.lock

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Build integrated IS/BS/CF financial workbooks in Excel.

中文简介正在准备中。当前显示原文说明。

openamer/openamer82026年10月22日 更新

a2a-swarm

免费

Run and grow the OpenAmer Agent-to-Agent swarm: identity, trust, node-to-node ask, signed skill/insight sharing, and the autonomous self-learning loop.

中文简介正在准备中。当前显示原文说明。

openamer/openamer82026年10月22日 更新

Use for A/B experiments on OpenAmer configs and skills.

中文简介正在准备中。当前显示原文说明。

openamer/openamer82026年10月22日 更新

Roleplay a hostile user to find and triage UX pain points.

中文简介正在准备中。当前显示原文说明。

openamer/openamer82026年10月22日 更新

Agent mesh: master/worker nodes, HTTP delegation, heartbeat.

中文简介正在准备中。当前显示原文说明。

openamer/openamer82026年10月22日 更新

Use for agentic commerce payments tasks. Candidate synthesized from trend radar; awaiting trial promotion.

中文简介正在准备中。当前显示原文说明。

openamer/openamer82026年10月22日 更新

查看 openamer 的全部技能

报告此技能的问题