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

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

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.jsonstart · notify · completeUserPromptSubmit drives the working state; Notification and Stop can alert you.
Codex~/.codex/config.tomlcompleteThe Stop hook reports a completed turn. Run /hooks in Codex once to trust it.
Grok~/.grok/hooks/liu-notify.jsonnotify · completeNotification and top-level Stop events are handled; sub-agent completions stay silent.
OpenCode~/.config/opencode/plugins/liu-notify.jscompleteThe managed plugin listens for top-level session.idle events.
Antigravity~/.gemini/config/hooks.jsoncompleteA named Stop hook reports when the top-level execution loop ends.
Command Code~/.commandcode/settings.jsoncompleteIts Claude-compatible settings schema is wired to the top-level Stop event.

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

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

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

startstopnotifyerrorcomplete
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) بحيث يكون استبدال أو تعطيل أحدها تغييرًا في ملف واحد.

التالي التكوين →

المستندات

البدء

الأدلة

المراجع

لغات أخرى

English · Türkçe · 简体中文 · 한국어 · Español · Deutsch · Italiano · Français · 日本語