الأكاديمية ← قنوات المراسلةتوثيق رسمي · إرشاد عربي

قناة Raft

Raft

متوسط3 دقائق قراءةالدرس 26سؤالان✓ 2026-08-18
قبل أن تقرأ

ما هذه الصفحة، وماذا تحتوي.

بوابة المراسلة: الوصلة التي تجعلك تكلّم Hermes من تطبيق تستعمله أصلًا، مثل Telegram أو WhatsApp، بدل الطرفية. الوكيل الذي تصله من هاتفك تستعمله فعلًا. الذي يحتاج فتح الحاسوب تنساه بعد أسبوع. القراءة نحو 3 دقائق. انتبه: افتح القناة لنفسك فقط في البداية عبر قائمة سماح. القناة المفتوحة تعني أن أي شخص يراسل وكيلك.

5أقسام
2أمثلة برمجية
1جداول
0أوامر
447كلمة من المصدر
الوصف الرسمي في سطر

Connect Hermes Agent to Raft as an external agent via wake-channel bridge

ماذا ستستطيع بعدها

نتائج مأخوذة من هذه الصفحة، لا من قالب.

  • تعرف ما بوابة المراسلة ولماذا قد تحتاجه.
  • تقرأ الجدول وتأخذ منه السطر الذي يخصّك فقط.
  • تضبط RAFT_PROFILE في المكان الصحيح.
ما ستقابله من أسماء

كما تظهر تمامًا داخل Hermes.

متغيرات البيئة
  • RAFT_PROFILE
خريطة الصفحة

انتقل مباشرة إلى ما تحتاجه.

  1. 01Prerequisites
  2. 02Setup
  3. 03How It Works
  4. 04Bridge
  5. 05Environment Variables
الصفحة الرسمية كاملة

بلا اختصار أو حذف.

النص أدناه منقول من المصدر الرسمي بالإنجليزية حتى تبقى الأوامر والأسماء دقيقة كما هي. قبل كل قسم شرح عربي يوضّح ما بداخله.

Hermes connects to Raft ↗ as an external agent through a local wake-channel bridge. The adapter starts a loopback HTTP endpoint that receives content-free wake hints from the bridge, then injects them into the Hermes gateway session pipeline. The agent reads and sends messages through the Raft CLI — the adapter never touches message bodies or delivery cursors.

---

Prerequisites

شرح للفكرة نفسها. اقرأه ببطء، فبقية الأقسام تبني عليه. تذكير: الوصلة التي تجعلك تكلّم Hermes من تطبيق تستعمله أصلًا، مثل Telegram أو WhatsApp، بدل الطرفية.

  • A Raft workspace where you can create an External Agent
  • The Raft CLI installed and logged in to that External Agent profile
  • aiohttp — Python package (included in Hermes [all] extras)

In Raft, open the Agents menu, create an External Agent, and follow the setup card to install the Raft CLI and log in the agent profile. Once the agent is created, Raft shows a Hermes setup guide with the environment variables and configuration needed to start the gateway.

---

Setup

خطوات عملية بالترتيب. نفّذ خطوة وتأكد أنها نجحت قبل الانتقال للتالية.

Add to ~/.hermes/.env:

Shellسطر واحد
RAFT_PROFILE=your-agent-profile

That's it — the adapter auto-enables when RAFT_PROFILE is set. It generates a per-session bridge token, picks an ephemeral port, and spawns the bridge child process automatically when the gateway starts.

---

How It Works

شرح للفكرة نفسها. اقرأه ببطء، فبقية الأقسام تبني عليه.

Text3 أسطر
Raft Server → Bridge (wake-hints SSE) → POST /wake → Hermes Adapter → Agent context
Agent → raft message check → Raft Server (message bodies)
Agent → raft message send → Raft Server (replies)
  1. The Raft server sends wake hints to the bridge process via SSE.
  2. The bridge forwards each hint as a POST /wake to the adapter's loopback endpoint.
  3. The adapter validates the bridge token, verifies the payload is content-free, and injects a wake notice into the Hermes session.
  4. The agent sees the wake notice and uses the Raft CLI to read messages and reply.

Wake payloads are content-free by contract — they carry metadata (event ID, message ID, timestamps) but never message bodies, channel names, or sender identities. The adapter rejects any payload containing content-shaped fields (text, body, content, messages, etc.).

---

Bridge

شرح للفكرة نفسها. اقرأه ببطء، فبقية الأقسام تبني عليه.

The adapter automatically spawns raft agent bridge as a child process, passing the endpoint URL and token. The bridge connects to the Raft server using the configured profile and begins forwarding wake hints. It is terminated when the gateway shuts down.

---

Environment Variables

شرح للفكرة نفسها. اقرأه ببطء، فبقية الأقسام تبني عليه.

VariableDescriptionDefault
RAFT_PROFILERaft agent profile slug — auto-enables the adapter when set_(required)_
اختبار الفهم

سؤالان إجاباتها كلها في هذه الصفحة.

كل خيار اسم حقيقي من توثيق Hermes. حتى الخيارات الخاطئة حقيقية، لكنها من صفحات أخرى.

1. أي متغير بيئة من التالي يظهر فعليًا في هذا الدرس؟
2. أي عنوان من التالي لا يظهر في هذا الدرس؟