agentix-cli 0.13.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/README.md +65 -478
  2. package/dist/agent-LRSSVFDR.js +2 -0
  3. package/dist/board-dashboard-DAPHL6W2.js +4508 -0
  4. package/dist/board-dashboard-DAPHL6W2.js.map +1 -0
  5. package/dist/chunk-3XULOWYB.js +199 -0
  6. package/dist/chunk-3XULOWYB.js.map +1 -0
  7. package/dist/chunk-6U2XOQHU.js +7 -0
  8. package/dist/chunk-6U2XOQHU.js.map +1 -0
  9. package/dist/{chunk-ZRYBSI5G.js → chunk-7MBTMCKY.js} +2 -2
  10. package/dist/{chunk-D6EDMQRV.js → chunk-AU37OREL.js} +5 -5
  11. package/dist/chunk-B4Q4X7D5.js +6 -0
  12. package/dist/chunk-B4Q4X7D5.js.map +1 -0
  13. package/dist/chunk-CXY2RYNI.js +11 -0
  14. package/dist/chunk-CXY2RYNI.js.map +1 -0
  15. package/dist/chunk-FIOB3MEX.js +2 -0
  16. package/dist/chunk-HLRVDCNH.js +5 -0
  17. package/dist/chunk-HLRVDCNH.js.map +1 -0
  18. package/dist/chunk-IEVEMKAI.js +168 -0
  19. package/dist/chunk-IEVEMKAI.js.map +1 -0
  20. package/dist/chunk-RB7265LO.js +12 -0
  21. package/dist/chunk-RB7265LO.js.map +1 -0
  22. package/dist/chunk-RGUYBH77.js +7 -0
  23. package/dist/chunk-RGUYBH77.js.map +1 -0
  24. package/dist/chunk-WVNSWBCU.js +138 -0
  25. package/dist/chunk-WVNSWBCU.js.map +1 -0
  26. package/dist/cli.js +64 -48
  27. package/dist/cli.js.map +1 -1
  28. package/dist/{compaction-7I3E5QUO.js → compaction-JBZZ7I7Y.js} +4 -4
  29. package/dist/config-DCJYECL4.js +2 -0
  30. package/dist/config-mutator-6EJHSP3Y.js +2 -0
  31. package/dist/debug-3MEUO2P2.js +2 -0
  32. package/dist/{heal-OTGT5HHJ.js → heal-WKY5I4KB.js} +2 -2
  33. package/dist/index.d.ts +894 -70
  34. package/dist/index.js +11 -11
  35. package/dist/index.js.map +1 -1
  36. package/dist/loader-PTCXLJEX.js +2 -0
  37. package/dist/memory-extract-AD7KMRPC.js +2 -0
  38. package/dist/{providers-G3WZ4RVJ.js → providers-VUIWO3ZK.js} +2 -2
  39. package/dist/registry-5ND7GLFJ.js +2 -0
  40. package/dist/scheduler-FCXOXCN5.js +2 -0
  41. package/dist/scheduler-FCXOXCN5.js.map +1 -0
  42. package/dist/{subagent-WV7QKQ3L.js → subagent-2SJHSSJS.js} +2 -2
  43. package/dist/{usage-dashboard-2TJQBFSH.js → usage-dashboard-QX3CF6KK.js} +8 -8
  44. package/dist/usage-dashboard-QX3CF6KK.js.map +1 -0
  45. package/dist/whatsapp-state-6D6FHHD2.js +2 -0
  46. package/dist/whatsapp-state-6D6FHHD2.js.map +1 -0
  47. package/dist/workspace-setup-ZWTT42XT.js +2 -0
  48. package/dist/workspace-setup-ZWTT42XT.js.map +1 -0
  49. package/package.json +10 -1
  50. package/dist/agent-5KIMJI3F.js +0 -2
  51. package/dist/chunk-34UAFPK4.js +0 -10
  52. package/dist/chunk-34UAFPK4.js.map +0 -1
  53. package/dist/chunk-4YCH6IZV.js +0 -2
  54. package/dist/chunk-CJ45Y2IR.js +0 -12
  55. package/dist/chunk-CJ45Y2IR.js.map +0 -1
  56. package/dist/chunk-T25UEXVK.js +0 -126
  57. package/dist/chunk-T25UEXVK.js.map +0 -1
  58. package/dist/chunk-VH23CDHL.js +0 -157
  59. package/dist/chunk-VH23CDHL.js.map +0 -1
  60. package/dist/chunk-WJ6ZF6EZ.js +0 -6
  61. package/dist/chunk-WJ6ZF6EZ.js.map +0 -1
  62. package/dist/config-HAD5E4YX.js +0 -2
  63. package/dist/debug-N3B5NVJU.js +0 -2
  64. package/dist/loader-YQE6XJBT.js +0 -2
  65. package/dist/memory-extract-RGPUPMKU.js +0 -2
  66. package/dist/registry-CDWY7CLL.js +0 -2
  67. package/dist/usage-dashboard-2TJQBFSH.js.map +0 -1
  68. package/dist/workspace-setup-QQTCJY4B.js +0 -2
  69. /package/dist/{agent-5KIMJI3F.js.map → agent-LRSSVFDR.js.map} +0 -0
  70. /package/dist/{chunk-ZRYBSI5G.js.map → chunk-7MBTMCKY.js.map} +0 -0
  71. /package/dist/{chunk-D6EDMQRV.js.map → chunk-AU37OREL.js.map} +0 -0
  72. /package/dist/{chunk-4YCH6IZV.js.map → chunk-FIOB3MEX.js.map} +0 -0
  73. /package/dist/{compaction-7I3E5QUO.js.map → compaction-JBZZ7I7Y.js.map} +0 -0
  74. /package/dist/{config-HAD5E4YX.js.map → config-DCJYECL4.js.map} +0 -0
  75. /package/dist/{debug-N3B5NVJU.js.map → config-mutator-6EJHSP3Y.js.map} +0 -0
  76. /package/dist/{heal-OTGT5HHJ.js.map → debug-3MEUO2P2.js.map} +0 -0
  77. /package/dist/{loader-YQE6XJBT.js.map → heal-WKY5I4KB.js.map} +0 -0
  78. /package/dist/{memory-extract-RGPUPMKU.js.map → loader-PTCXLJEX.js.map} +0 -0
  79. /package/dist/{providers-G3WZ4RVJ.js.map → memory-extract-AD7KMRPC.js.map} +0 -0
  80. /package/dist/{registry-CDWY7CLL.js.map → providers-VUIWO3ZK.js.map} +0 -0
  81. /package/dist/{workspace-setup-QQTCJY4B.js.map → registry-5ND7GLFJ.js.map} +0 -0
  82. /package/dist/{subagent-WV7QKQ3L.js.map → subagent-2SJHSSJS.js.map} +0 -0
package/README.md CHANGED
@@ -1,515 +1,102 @@
1
1
  # AgentX
2
2
 
3
- **Self-hosted multi-agent orchestrator.** Routes messages from Telegram, WhatsApp, Discord, GitLab, crons, webhooks, and cross-machine mesh to AI agents running on Claude Code, OpenAI, Ollama, or any LLM provider.
3
+ **The AI operations layer for your team.** Plug in the channels your team already uses — Telegram, WhatsApp, Discord, GitLab — set schedules, and watch your agents work. Self-hosted. No Python, no YAML, no code.
4
4
 
5
- ## Why AgentX?
5
+ ## Who it's for
6
6
 
7
- Existing multi-agent frameworks (CrewAI, AutoGen, LangGraph) are SDK-first, Python-heavy, and cloud-dependent. AgentX is **infrastructure-first** — closer to systemd for AI agents than to another framework.
7
+ **Teams running AI agents on real channels.** Support queues, devops squads, ops teams, internal automation. You want multiple agents handling different jobs, coordinating across machines, answering on the tools your people already use.
8
8
 
9
- - **BYOAI** — Bring your own AI. Claude, OpenAI, Ollama, whatever
10
- - **Agents = directories** — Each agent is a workspace with config files. No code required
11
- - **Mesh federation** — Agents on different machines collaborate over Tailscale/VPN
12
- - **Channel routing** — Telegram, GitLab, WhatsApp, Discord, webhooks — built in
13
- - **Cross-channel messaging** — Agents receive on one channel, send to another via `/send` API
14
- - **Wiki memory** — Agents build compounding knowledge from conversations
15
- - **Live monitoring** — Real-time SSE event stream + debug mode with categories
9
+ > **Running AgentX solo for yourself?** [OpenClaw](https://github.com/openclaw/openclaw) is built for single-user assistants and has a lighter install path. If you outgrow it, we import your config — see [Migrate from OpenClaw](docs/migration/from-openclaw.md).
16
10
 
17
- ## Install
18
-
19
- ```bash
20
- npm install -g agentix-cli
21
- ```
22
-
23
- ## Quick Start
24
-
25
- ```bash
26
- agentx init # Create config + workspace
27
- agentx agent add # Add an agent (interactive)
28
- agentx channel add # Add a channel (Telegram/WhatsApp/Discord/GitLab)
29
- agentx daemon start # Start the daemon
30
- agentx daemon watch # Live activity feed (color-coded)
31
- ```
32
-
33
- ## Architecture
34
-
35
- ```
36
- Telegram ──┐
37
- WhatsApp ──┤ ┌─ claude -p --cwd /workspace
38
- Discord ───┤ agentx │
39
- GitLab ───┤ daemon ────┤─ openai API
40
- Cron ──────┤ │
41
- Webhook ───┤ └─ ollama generate
42
- A2A mesh ──┘
43
- │
44
- Context Engine
45
- (10 layers, token-budgeted)
46
- │
47
- ┌─────────┼─────────┐
48
- Wiki Memory Bootstrap
49
- (per-agent) (Haiku) (SOUL.md)
50
- ```
51
-
52
- Each agent = a workspace directory with Claude Code configuration (`.claude/`, `CLAUDE.md`, skills, hooks, MCP servers). AgentX orchestrates when and where agents run.
53
-
54
- ## Communication Matrix
55
-
56
- AgentX supports every communication path: human-to-agent, agent-to-human, agent-to-agent, and cross-channel — across all channels.
57
-
58
- | Path | Telegram | WhatsApp | Discord | GitLab | API |
59
- |------|:--------:|:--------:|:-------:|:------:|:---:|
60
- | **H2A** (human to agent) | mention/DM | route | mention/DM | @username | POST /task |
61
- | **A2H reply** | streaming | text | text | per-agent token | JSON |
62
- | **A2H initiate** | /send | /send | /send | /send | - |
63
- | **A2A delegation** | per-account bot chain | shared number + name prefix | shared + name prefix | @mention webhook | - |
64
- | **Cross-channel** | /send | /send | /send | /send | - |
65
- | **Cross-mesh** | mesh task | mesh task | mesh task | mesh task | mesh task |
66
-
67
- ### Cross-Channel Messaging
68
-
69
- Agents can send messages to ANY channel proactively — not just reply:
70
-
71
- ```bash
72
- # Agent on GitLab sends a notification to Telegram
73
- curl -X POST http://localhost:19900/send \
74
- -H "Content-Type: application/json" \
75
- -d '{"channel":"telegram","chatId":"-1001234567890","text":"Deploy complete!","agentId":"devops"}'
76
- ```
77
-
78
- This enables **H2A2H chains**: a human asks an agent on GitLab to notify someone on WhatsApp. The agent calls `/send` to deliver the message cross-channel.
79
-
80
- ### Automated Client Services
81
-
82
- Define predictable request-response services that intercept messages BEFORE agent routing — no LLM needed for known patterns:
83
-
84
- ```jsonc
85
- "services": {
86
- "monthly-report": {
87
- "name": "Monthly Client Report",
88
- "triggers": [
89
- { "pattern": "monthly report|client records|تقرير الشهر", "channel": "whatsapp" }
90
- ],
91
- "allowedContacts": ["+966"],
92
- "agent": "atlas",
93
- "prompt": "Run the monthly report SQL query and export as CSV...",
94
- "schedule": "0 9 1 * *",
95
- "notify": { "channel": "whatsapp", "chatId": "+966...@s.whatsapp.net" }
96
- }
97
- }
98
- ```
99
-
100
- - **Regex triggers** with optional channel filter (Arabic + English patterns)
101
- - **Contact allowlist** — only authorized contacts can trigger
102
- - **Predefined prompt** — service sends a known prompt, not the user's raw message
103
- - **Optional cron schedule** — also runs automatically on a schedule
104
- - **Cross-channel notify** — results delivered to any channel
105
-
106
- ## Features
107
-
108
- ### Channels
109
-
110
- | Channel | Highlights |
111
- |---------|-----------|
112
- | **Telegram** | Multi-account bots, streaming edits, bot-to-bot delegation, media handling |
113
- | **WhatsApp** | Baileys integration, QR pairing, per-contact/group routing, agent delegation (shared number, name-prefixed) |
114
- | **Discord** | Mention-based routing, DM support, agent delegation |
115
- | **GitLab** | Per-agent identity via PAT tokens, @mention routing, bot-to-bot handoff, image attachments, cascade prevention |
116
- | **Webhooks** | Generic `POST /webhook/:agentId` for Stripe, Sentry, GitHub, etc. |
117
-
118
- ### GitLab Integration
119
-
120
- Agents participate in GitLab as first-class team members:
121
- - **Per-agent identity** — Each agent has its own GitLab user and PAT. Agent usernames resolved from tokens at startup via API (not manual config)
122
- - **Deterministic @mention routing** — `@coding-agent` routes to that agent. Username-to-agent map built from token resolution
123
- - **Bot-to-bot handoff** — QA agent can `@mention` devops in its review, devops picks it up automatically
124
- - **Eye reaction** — Agents react with 👀 using their own token (never the global token)
125
- - **Cascade prevention** — Hidden signature `<!-- agentx:agentId -->`, sent-note dedup, bot-user detection
126
- - **Human mention filtering** — If @mentioned user isn't a known agent, the note is ignored
127
- - **Image attachments** — Screenshots and diagrams in comments are downloaded and passed to agents for analysis
128
-
129
- ### Context Compaction
130
-
131
- Long conversations don't lose context. When session history exceeds threshold:
132
- 1. **Memory flush** — Haiku extracts memorable facts before compaction
133
- 2. **Summarize** — Older messages compressed into a structured summary
134
- 3. **Preserve** — Last 6 messages kept verbatim, tool call pairs kept intact
135
-
136
- ### Message Queue
137
-
138
- When an agent is busy, incoming messages are queued instead of dropped:
139
-
140
- | Mode | Behavior |
141
- |------|----------|
142
- | `collect` (default) | Batch all messages, deliver as one when agent finishes |
143
- | `followup` | Process each queued message as a separate follow-up turn |
144
- | `drop` | Silently discard (for non-critical channels) |
145
-
146
- Configure per agent: `agents.<id>.queueMode`
147
-
148
- ### Sub-Agent Spawning
149
-
150
- Agents can spawn background sub-agents for parallel work:
151
- - `spawn_agent` tool available in orchestrator tier
152
- - Depth-limited (max 3 levels) to prevent infinite chains
153
- - Timeout enforcement per spawn
154
- - Results returned to parent agent
155
-
156
- ### Bootstrap Identity Files
157
-
158
- Structured workspace files loaded into agent context automatically:
159
-
160
- | File | Purpose | Lifecycle |
161
- |------|---------|-----------|
162
- | `SOUL.md` | Personality, tone, boundaries | Persistent |
163
- | `IDENTITY.md` | Name, role, tagline | Persistent |
164
- | `USER.md` | User profile, preferences | Persistent |
165
- | `AGENTS.md` | Operating rules, standing orders | Persistent |
166
- | `BOOTSTRAP.md` | First-run ritual | Auto-deleted after first load |
167
-
168
- ### Heartbeat
169
-
170
- Periodic in-session check-ins (unlike cron which creates isolated sessions):
171
-
172
- ```jsonc
173
- "agents": {
174
- "assistant": {
175
- "heartbeat": {
176
- "enabled": true,
177
- "intervalMinutes": 30,
178
- "prompt": "Check inbox, pending tasks, and system health."
179
- }
180
- }
181
- }
182
- ```
183
-
184
- Heartbeat runs in the agent's existing session context, preserving conversation history and memory.
185
-
186
- ### Cron with Retry & Missed Run Detection
187
-
188
- Scheduled jobs with production-grade reliability:
189
- - **Exponential backoff** on failure: 30s, 1m, 5m, 15m, 60m (up to 5 retries)
190
- - **Missed run detection** — On startup, compares saved last-run times against schedule and catches up
191
- - **Failure notifications** — Configure per-job `notify` destination (any channel)
192
- - **Auto-disable** after 3 consecutive failures (`onError: "disable"`)
193
- - **Health endpoint** — `GET /crons/health` returns healthy/failing/disabled/missed counts
194
-
195
- ```jsonc
196
- "crons": {
197
- "daily-report": {
198
- "schedule": "0 9 * * *",
199
- "agent": "assistant",
200
- "prompt": "Generate today's status report.",
201
- "notify": {
202
- "channel": "telegram",
203
- "chatId": "-1001234567890"
204
- }
205
- }
206
- }
207
- ```
208
-
209
- ### Smart Block Streaming
210
-
211
- Intelligent chunking for message delivery across channels:
212
- - **minChars** threshold — no fragment spam
213
- - **Paragraph-aware breaks** — never splits inside code fences
214
- - **Per-channel defaults** — Telegram (60 chars), WhatsApp (40 chars + human pacing), Discord (80 chars)
215
- - **Coalescing** — idle debounce merges consecutive small blocks
216
-
217
- ### Observability & Debug Mode
218
-
219
- Toggle verbose debug logging at runtime:
220
-
221
- ```bash
222
- # Enable debug for specific categories
223
- curl -X POST http://localhost:19900/debug/on?categories=webhook,agent
224
-
225
- # Check debug state + recent log entries
226
- curl http://localhost:19900/debug
227
-
228
- # Disable
229
- curl -X POST http://localhost:19900/debug/off
230
-
231
- # Or via environment variable
232
- AGENTX_DEBUG=webhook,agent agentx daemon start
233
- ```
234
-
235
- **Categories:** `webhook`, `agent`, `channel`, `cron`, `mesh`, `context`, `memory`, `config`, `all`
236
-
237
- ### Live Monitoring
238
-
239
- ```bash
240
- agentx daemon watch # Color-coded live feed
241
- ```
242
-
243
- Or connect via SSE:
244
- ```bash
245
- curl -N http://localhost:19900/events
246
- ```
247
-
248
- ### Wiki Knowledge Base
249
-
250
- Each agent has a personal wiki — a compounding knowledge artifact built from conversations.
251
-
252
- 1. **Ingest** — Every conversation saved as raw entry
253
- 2. **Absorb** — LLM compiles entries into wiki articles
254
- 3. **Query** — Agents get relevant context filtered by tags
255
- 4. **Sync** — Federated wiki view across mesh peers
256
-
257
- Three compilation modes: `unified` (default), `flat`, `graph`. Wikipedia-style UI at `agentx wiki serve`.
258
-
259
- ### Persistent Agent Memory
260
-
261
- Haiku-powered cross-session memory:
262
- - Facts, preferences, commitments extracted after each conversation
263
- - BM25 full-text search across memories
264
- - Injected into context for future conversations
265
- - Auto-pruning with configurable expiry
266
-
267
- ### Skills
268
-
269
- Reusable capabilities installed per-agent or globally:
11
+ ## What you get out of the box
270
12
 
271
- ```bash
272
- agentx skill add skills/my-skill --all
273
- agentx skill list
274
- ```
13
+ - **Answer on Telegram, WhatsApp, Discord, GitLab** — one config, all channels
14
+ - **Agents = folders, not code** — each agent has its own persona, knowledge, and tools in plain Markdown
15
+ - **Multiple machines, one team** — run AgentX across a laptop + a server and they'll share work automatically
16
+ - **Scheduled jobs in plain English** — `agentx schedule "every Monday at 9am" --agent sales`
17
+ - **Live dashboard** — a browser view of what every agent is doing right now, with full task history and replay
18
+ - **Scoped API tokens** — let external apps message an agent with a time-bound, scope-limited token (see [Tokens](docs/reference/tokens.md) and [Public agents](docs/reference/public-agents.md))
19
+ - **Bring your own AI** — Claude Code (deep reasoning + tools), OpenAI / Anthropic API, Ollama, or anything in between
20
+ - **Wiki memory** — conversations compound into a shared knowledge base each agent draws from
275
21
 
276
- ### Mesh Federation
22
+ ## Install
277
23
 
278
- Agents on different machines collaborate:
24
+ **One line:**
279
25
 
280
26
  ```bash
281
- agentx mesh add server-2 http://100.x.x.x:19900
282
- agentx daemon send devops "check disk space" --peer server-2
27
+ curl -fsSL https://raw.githubusercontent.com/anis-marrouchi/agentx/master/install.sh | bash
283
28
  ```
284
29
 
285
- - Static or mDNS peer discovery
286
- - Health checks every 60s
287
- - Wiki sync across peers
288
- - Cross-machine agent delegation via A2A protocol
289
-
290
- ### MCP Server
30
+ Installs the CLI and launches the web setup wizard — no YAML, no JSON.
291
31
 
292
- AgentX exposes its full capabilities as MCP tools, usable from Claude Code, Cursor, or Windsurf:
293
-
294
- | Tool | Description |
295
- |------|-------------|
296
- | `agentx_generate` | Generate code/components/APIs with tech stack awareness |
297
- | `agentx_inspect` | Analyze project tech stack and schemas |
298
- | `agentx_send` | Send messages to any channel (cross-channel routing) |
299
- | `agentx_task` | Delegate work to a specific agent |
300
- | `agentx_agents` | List agents and their status |
301
- | `agentx_health` | Daemon health check |
302
- | `agentx_crons` | Cron job health with error details |
303
- | `agentx_debug` | Toggle debug mode with categories |
32
+ **Docker:**
304
33
 
305
34
  ```bash
306
- # Start the MCP server (stdio transport)
307
- agentx mcp
35
+ git clone https://github.com/anis-marrouchi/agentx.git && cd agentx
36
+ cp agentx.example.json agentx-data/agentx.json # or run `agentx setup` later
37
+ docker compose up -d
308
38
  ```
309
39
 
310
- Configure in Claude Code's `.claude/settings.json` or Cursor's MCP settings.
311
-
312
- ## CLI Reference
40
+ **Manual:**
313
41
 
314
42
  ```bash
315
- # Daemon
316
- agentx daemon start [--detach]
317
- agentx daemon stop
318
- agentx daemon status
319
- agentx daemon watch
320
- agentx daemon logs [-f]
321
- agentx daemon send <agent> <msg> [--peer <name>]
322
- agentx daemon deploy <host> -i key [--restart]
323
-
324
- # Wiki
325
- agentx wiki status [--mode M]
326
- agentx wiki absorb [--agent X] [--mode M] [--dry-run]
327
- agentx wiki serve [--mode M] [--peer URL]
328
- agentx wiki sync [--peer URL]
329
- agentx wiki compare --agent X
330
- agentx wiki lint [--agent X]
331
- agentx wiki search <query>
332
-
333
- # Management
334
- agentx agent add | list | remove <id>
335
- agentx channel add | list
336
- agentx cron add | list | enable | disable <id>
337
- agentx mesh add | list | remove <name>
338
- agentx skill add <path> [--agent X] [--all] | list
339
- agentx hook add <agent>
340
- agentx config check | show
341
- agentx init [--force]
342
-
343
- # Usage
344
- agentx usage [report] [--days N]
345
- ```
346
-
347
- ## Configuration
348
-
349
- Single `agentx.json`. Environment variables expanded (`${VAR_NAME}`). Auto-loads `.env`.
350
-
351
- ```jsonc
352
- {
353
- "node": { "id": "my-machine", "name": "My Machine", "bind": "0.0.0.0:19900" },
354
-
355
- "agents": {
356
- "assistant": {
357
- "name": "Assistant",
358
- "workspace": "/path/to/workspace",
359
- "tier": "claude-code", // "sdk" or "orchestrator"
360
- "model": "claude-sonnet-4-6",
361
- "mentions": ["@my_bot", "my-gitlab-user"],
362
- "maxConcurrent": 2,
363
- "queueMode": "collect", // "followup" or "drop"
364
- "systemPrompt": "You are a helpful assistant.",
365
- "heartbeat": {
366
- "enabled": false,
367
- "intervalMinutes": 30,
368
- "prompt": "Check inbox and pending tasks."
369
- }
370
- }
371
- },
372
-
373
- "channels": {
374
- "telegram": {
375
- "enabled": true,
376
- "accounts": {
377
- "default": { "token": "${TG_BOT_TOKEN}", "agentBinding": "assistant" }
378
- },
379
- "policy": { "dm": "pair", "group": "mention-required" }
380
- },
381
- "gitlab": {
382
- "enabled": true,
383
- "host": "https://gitlab.example.com",
384
- "token": "${GITLAB_TOKEN}",
385
- "webhookPort": 18810,
386
- "routes": [
387
- { "project": "team/project-a", "agent": "pm-a" },
388
- { "project": "*", "agent": "default-agent" }
389
- ],
390
- "agentMappings": [
391
- {
392
- "agentId": "coder",
393
- "gitlabUsernames": ["coder-bot"],
394
- "token": "${CODER_GITLAB_TOKEN}"
395
- }
396
- ]
397
- }
398
- },
399
-
400
- "crons": {
401
- "daily-report": {
402
- "enabled": true,
403
- "schedule": "0 9 * * *",
404
- "timezone": "UTC",
405
- "agent": "assistant",
406
- "prompt": "Generate today's status report.",
407
- "onError": "notify",
408
- "notify": {
409
- "channel": "telegram",
410
- "chatId": "-1001234567890"
411
- }
412
- }
413
- },
414
-
415
- "mesh": {
416
- "enabled": true,
417
- "peers": [
418
- { "url": "http://100.x.x.x:19900", "name": "server-2" }
419
- ]
420
- }
421
- }
43
+ npm install -g agentix-cli
44
+ agentx setup # opens the web wizard
422
45
  ```
423
46
 
424
- ## HTTP API
47
+ Open the dashboard at **http://127.0.0.1:4202** — a plain-English control view, with a `?`-Glossary link if anything looks unfamiliar.
425
48
 
426
- | Endpoint | Method | Description |
427
- |----------|--------|-------------|
428
- | `/health` | GET | Status, agents, crons, mesh, usage |
429
- | `/events` | GET | SSE live event stream |
430
- | `/agents` | GET | List agents |
431
- | `/channels` | GET | List registered channels |
432
- | `/crons` | GET | List cron jobs |
433
- | `/crons/health` | GET | Cron health: healthy/failing/disabled/missed |
434
- | `/services` | GET | List registered automated services |
435
- | `/task` | POST | `{ "agent": "id", "message": "..." }` |
436
- | `/send` | POST | `{ "channel": "telegram", "chatId": "...", "text": "...", "agentId": "..." }` |
437
- | `/mesh/task` | POST | `{ "peer": "name", "message": "..." }` |
438
- | `/webhook/:agentId[/:source]` | POST | Webhook callback |
439
- | `/v1/chat/completions` | POST | OpenAI-compatible endpoint |
440
- | `/debug` | GET | Debug state + recent log entries |
441
- | `/debug/on` | POST | Enable debug (`?categories=webhook,agent`) |
442
- | `/debug/off` | POST | Disable debug |
443
- | `/.well-known/agent-card.json` | GET | A2A agent discovery |
49
+ See the [full install guide](docs/install.md) for advanced setups.
444
50
 
445
- ## Context Engine
51
+ ## Docs
446
52
 
447
- Every agent prompt is built from structured layers, each with a token budget:
53
+ Full documentation: **[https://agentx-docs.pages.dev](https://agentx-docs.pages.dev)** (or `pnpm docs:dev` locally).
448
54
 
449
- | Layer | Priority | Budget | Content |
450
- |-------|----------|--------|---------|
451
- | Channel | 1 | 200 | Channel type + formatting rules |
452
- | Scope | 2 | 200 | Group name, project path, or DM |
453
- | Landscape | 3 | 800 | Team roster, mesh peers, rules, /send API docs |
454
- | Identity | 4 | 200 | Agent system prompt |
455
- | Bootstrap | 4.5 | 500 | SOUL.md, IDENTITY.md, AGENTS.md |
456
- | Intent | 5 | 200 | Extracted: deploy, review, bugfix... |
457
- | Artifacts | 6 | 500 | Media, reply-to text, issue refs |
458
- | Memory | 6.5 | 600 | Cross-session facts (Haiku-extracted) |
459
- | History | 7 | 1200 | Conversation or session history |
460
- | Cross-chat | 7 | 800 | Context from other active chats |
461
- | Wiki | 8 | 1000 | Tag-matched knowledge articles |
55
+ **Start here:**
56
+ - [Install](docs/install.md) — from zero to a running daemon in 5 minutes
57
+ - [Concepts](docs/concepts.md) — what an agent, channel, schedule, and team network are (glossary also lives at `/glossary` in the dashboard)
462
58
 
463
- Total budget: 6000 tokens. Context always injected, even on resumed sessions.
59
+ **Worked examples, simple → advanced:**
60
+ - [1. Telegram Q&A bot](docs/journey/01-telegram-qa-bot.md) — one agent, one channel, one conversation
61
+ - [2. Scheduled reports with failure alerts](docs/journey/02-scheduled-reports.md)
62
+ - [3. Multi-agent group chat](docs/journey/03-multi-agent-group.md)
63
+ - [7. Run a team with AI agents](docs/journey/07-business-layer.md) — roles, KPIs, org chart
64
+ - [8. Two machines, one team](docs/journey/08-mesh-federation.md) — mesh federation
464
65
 
465
- ## Three Execution Tiers
66
+ **For configuration:**
67
+ - [CLI reference](docs/reference/cli.md) · [Config schema](docs/reference/config-schema.md) · [Communication matrix](docs/reference/communication-matrix.md)
68
+ - [Scoped API tokens](docs/reference/tokens.md) — mint / scope / revoke
69
+ - [Public agents](docs/reference/public-agents.md) — expose an agent over HTTP
70
+ - [`agentx doctor`](docs/reference/doctor.md) — pre-flight health check
71
+ - [Slack channel](docs/reference/slack.md) — Socket Mode setup
466
72
 
467
- | Tier | How | Auth | Best for |
468
- |------|-----|------|----------|
469
- | `claude-code` | Spawns `claude` CLI | Subscription | Full power: subagents, MCP, skills, hooks, 1M context |
470
- | `sdk` | Claude Agent SDK | API key | Programmatic control, headless servers |
471
- | `orchestrator` | AgentX's own loop | Any provider key | Non-Claude providers (OpenAI, Ollama) |
73
+ **Moving from another tool:**
74
+ - [Migrate from OpenClaw](docs/migration/from-openclaw.md) — we import the bulk of your config in one shot
472
75
 
473
- ## Daemon Management
76
+ [Contributing](docs/contributing.md)
474
77
 
475
- Single-instance guard via PID file — prevents orphan processes on restart:
476
-
477
- ```bash
478
- agentx daemon start # Checks .agentx/daemon.pid, exits if another is running
479
- agentx daemon stop # Graceful shutdown, saves cron last-run times
480
- systemctl --user restart agentx-daemon.service # Safe — PID guard prevents duplicates
481
- ```
482
-
483
- ## Use Cases
484
-
485
- - **Team of Telegram bots** — each project gets its own bot + agent
486
- - **GitLab CI/CD team** — coder, QA, devops, PM agents collaborate on issues via @mentions
487
- - **Cross-channel notifications** — GitLab agent notifies humans on Telegram/WhatsApp
488
- - **WhatsApp delegation** — shared phone number, agents identified by name prefix
489
- - **Scheduled automation** — cron jobs with retry, missed-run catch-up, failure alerts
490
- - **Multi-machine swarm** — agents on laptop + server collaborate via mesh
491
- - **Webhook automation** — Sentry error -> DevOps investigates, Stripe payment -> billing processes
492
- - **Personal wiki** — Every conversation compounds into searchable knowledge
493
-
494
- ## Contributing
78
+ ## Architecture
495
79
 
496
- ```bash
497
- git clone https://github.com/anis-marrouchi/agentx.git
498
- cd agentx
499
- npm install
500
- npm run build # ESM build via tsup
501
- npm test # Run tests
502
- agentx init --force # Create local config
503
- agentx daemon start # Start dev daemon
504
- agentx daemon watch # See what's happening
80
+ ```mermaid
81
+ graph LR
82
+ T[Telegram] --> R(Router)
83
+ W[WhatsApp] --> R
84
+ D[Discord] --> R
85
+ G[GitLab] --> R
86
+ C[Cron] --> R
87
+ H[Webhook] --> R
88
+ M[Mesh peer] --> R
89
+ R --> CTX[Context Engine<br/>10 layers, token-budgeted]
90
+ CTX --> AG[Agent workspace]
91
+ AG --> P1[claude -p]
92
+ AG --> P2[OpenAI]
93
+ AG --> P3[Ollama]
94
+ AG -.-> MEM[(Wiki + Memory)]
95
+ AG -.-> R
505
96
  ```
506
97
 
507
- Areas we're looking for help:
508
- - **Testing** — Unit and integration tests
509
- - **Channels** — Slack, Microsoft Teams adapters
510
- - **Dashboard** — Web UI for agent management
511
- - **Security** — Audit of token handling and permission boundaries
98
+ Each agent = a workspace directory with Claude Code configuration (`.claude/`, `CLAUDE.md`, skills, hooks, MCP servers). AgentX orchestrates when and where agents run.
512
99
 
513
100
  ## License
514
101
 
515
- MIT
102
+ MIT.
@@ -0,0 +1,2 @@
1
+ import{s as a,t as b,u as c}from"./chunk-AU37OREL.js";import"./chunk-SFQUP3BP.js";import"./chunk-RB7265LO.js";import"./chunk-KXZMYLHQ.js";import"./chunk-M7HKBG3V.js";import"./chunk-MCJUAE6V.js";import"./chunk-DSYKYZMT.js";import"./chunk-QOYAX2FT.js";import"./chunk-FIOB3MEX.js";export{a as createAgentContext,b as generate,c as generateStream};
2
+ //# sourceMappingURL=agent-LRSSVFDR.js.map