# الإشعارات — Liu Terminal

> إشعارات Liu Terminal. احصل على إشعار عندما ينهي وكلاء الذكاء الاصطناعي مهامهم، مع خطاطات قابلة للضبط وتنبيهات صوتية.

URL: https://liu.software/ar/docs/notify/  
Language: ar  
Updated: 2026-10-17

liu-notify عملية مستقلة اختيارية، بينما يمكن لواجهة Liu استضافة الخادم نفسه داخل العملية. تقبل رأس v1 بحجم 24 بايت أو رأس v2 الحالي بحجم 28 بايت مع بيانات وصفية اختيارية عبر مقبس محلي، وتحد المعدل وتزيل تكرار الأحداث وتوجه الصوت لكل زوج (وكيل، حدث).

## تشغيله

```
# البناء إلى جانب التطبيق الرئيسي
cmake --build build --target liu-notify

# بدء تشغيل الخادم الخلفي
./build/liu-notify daemon

# إرسال حدث لمرة واحدة
./build/liu-notify send --tool=claude --event=stop
```

يوجد التكوين في ~/.config/liu/notify.conf — منفصل عن config.json الخاص بالتطبيق الرئيسي بحيث يبقى الخادم الخلفي قابلاً للاستخدام دون تشغيل Liu نفسه.

When Liu is running, its GUI hosts the notification server in-process; the CLI does not need to start a second daemon. If no server is listening, send exits without delivering an event. Use the standalone daemon only when notifications must work without Liu.

## خطافات الوكلاء المدعومة

يمكن لـ Liu تثبيت خطافات دورة الحياة للوكلاء أدناه وإزالتها أثناء تشغيل التطبيق. يُكتب الخطاف في إعدادات الوكيل نفسه، ويزيل Liu الإدخال الذي يديره عند خروج النسخة المضيفة.

| الوكيل | موضع الخطاف | الإشارات | ملاحظات |
| --- | --- | --- | --- |
| Claude Code | `~/.claude/settings.json` | `start · notify · complete` | UserPromptSubmit drives the working state; Notification and Stop can alert you. |
| Codex | `~/.codex/config.toml` | `complete` | The Stop hook reports a completed turn. Run /hooks in Codex once to trust it. |
| Grok | `~/.grok/hooks/liu-notify.json` | `notify · complete` | Notification and top-level Stop events are handled; sub-agent completions stay silent. |
| OpenCode | `~/.config/opencode/plugins/liu-notify.js` | `complete` | The managed plugin listens for top-level session.idle events. |
| Antigravity | `~/.gemini/config/hooks.json` | `complete` | A named Stop hook reports when the top-level execution loop ends. |
| Command Code | `~/.commandcode/settings.json` | `complete` | Its Claude-compatible settings schema is wired to the top-level Stop event. |

يقبل بروتوكول الإشعارات منخفض المستوى ومصفوفة الأصوات Copilot وcustom، لكن Liu لا يثبت لهما خطاف دورة حياة تلقائيًا بعد. تظل الوكلاء الأخرى تعمل بشكل طبيعي في علامات تبويب Liu، لكنها لا تتلقى إشعارات الخطافات تلقائيًا.

## مصفوفة الأداة × الحدث

قم بتكوين قاعدة صوت لأي تركيبة. الخلايا غير المحددة تقع تحت القاعدة العامة.

|  | start | stop | notify | error | complete |
| --- | --- | --- | --- | --- | --- |
| claude | · | · | · | · | · |
| copilot | · | · | · | · | · |
| codex | · | · | · | · | · |
| custom | · | · | · | · | · |

## تنسيق الإطار

يبلغ رأس v1‏ 24 بايتًا، بينما يبلغ رأس v2 الحالي 28 بايتًا لأنه يضيف meta\_len. يقتصر الإطار الكامل على 4096 بايت. يختبر tests/fuzz\_notify\_validate.c التحقق عبر fuzzing لرفض الإطارات التالفة بأمان.

```
offset  size  field
0       4     magic      ('N','T','F','Y')
4       2     version    (1 or current 2)
6       2     flags      (speak=1, bell=2)
8       1     tool_id    (claude=1, copilot=2, codex=3, custom=255)
9       1     event_id   (start=1, stop=2, notify=3, error=4, complete=5)
10      1     priority   (reserved)
11      1     source     (cli=0, stdin=1, test=2)
12      4     seq        (client nonce — for dedup)
16      4     title_len  (<= 256)
20      4     body_len   (<= 3072)
24      4     meta_len   (v2 only, <= 512)
payload         title, body, then metadata key=value lines
                total frame <= 4096 bytes
```

يحتوي قسم البيانات الوصفية v2 حاليًا على أسطر cwd= وsession= وagent=. يستخدمها مرسلو الخطافات لإسناد الحدث إلى الجزء الصحيح، وتُتجاهل المفاتيح غير المعروفة للتوافق المستقبلي.

## الخلفيات الخاصة بالمنصة

نفس الإطار، مُكبر صوت مختلف. يستخدم macOS AVSpeechSynthesizer، وينفذ Linux الأمر notify-send. يقبع كل خلفية في ملف خاص به (platform\_notify\_macos.m، platform\_notify\_linux.c) بحيث يكون استبدال أو تعطيل أحدها تغييرًا في ملف واحد.

[التالي التكوين →](https://liu.software/ar/docs/config.md)
