agentix-cli 0.170.0 → 0.172.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.
- package/README.md +175 -73
- package/dist/{App-BT67QQ5H.js → App-56QIEQGH.js} +2 -2
- package/dist/{ChatApp-64WRBUKX.js → ChatApp-JNWIXMDN.js} +2 -2
- package/dist/{absorb-eval-IHNCDJTM.js → absorb-eval-BYYFZJCC.js} +2 -2
- package/dist/{adapter-URLHEV3F.js → adapter-YQ37MDPV.js} +2 -2
- package/dist/{agent-Q73VAOJR.js → agent-4637FJMD.js} +2 -2
- package/dist/{board-dashboard-VZYUXVP6.js → board-dashboard-DJKRLABN.js} +731 -396
- package/dist/board-dashboard-DJKRLABN.js.map +1 -0
- package/dist/{chunk-7TEJJM24.js → chunk-2BJ7NIGG.js} +2 -2
- package/dist/{chunk-JXGREJDJ.js → chunk-35I76HQS.js} +2 -2
- package/dist/{chunk-E7VJU7FI.js → chunk-35R7Y7BT.js} +2 -2
- package/dist/{chunk-GKE7IP3T.js → chunk-5KVTIFRY.js} +2 -2
- package/dist/{chunk-FWT23FGY.js → chunk-7FGJOVML.js} +69 -69
- package/dist/chunk-7FGJOVML.js.map +1 -0
- package/dist/{chunk-4BVISFOC.js → chunk-7NA5VSQE.js} +311 -306
- package/dist/chunk-7NA5VSQE.js.map +1 -0
- package/dist/{chunk-OJ2XT27M.js → chunk-AQGQLVCD.js} +2 -2
- package/dist/{chunk-AU3VT7BD.js → chunk-DMCMV4UJ.js} +2 -2
- package/dist/{chunk-6JKFJM2D.js → chunk-DOBTHQ32.js} +2 -2
- package/dist/{chunk-EYC5DJR2.js → chunk-ES236GV6.js} +2 -2
- package/dist/{chunk-CLH4QJAO.js → chunk-FOTAGQEL.js} +2 -2
- package/dist/{chunk-I4VNUTLL.js → chunk-GALI5ANI.js} +3 -3
- package/dist/{chunk-FAU6WDVT.js → chunk-HZXLZIB4.js} +2 -2
- package/dist/{chunk-XGREDHJY.js → chunk-I7EO2WXC.js} +2 -2
- package/dist/{chunk-3Y6QTM4Z.js → chunk-IPHFWU2F.js} +2 -2
- package/dist/{chunk-SEQXJWSD.js → chunk-KE3KLMMK.js} +2 -2
- package/dist/{chunk-OV77U4GH.js → chunk-LB55Q3K4.js} +2 -2
- package/dist/{chunk-RE5XFWBY.js → chunk-MH55YCUS.js} +94 -94
- package/dist/chunk-MH55YCUS.js.map +1 -0
- package/dist/{chunk-CX6HUPUZ.js → chunk-MY7C6E4Y.js} +2 -2
- package/dist/{chunk-VUEQ4SL5.js → chunk-N6VBEITO.js} +2 -2
- package/dist/chunk-N6VBEITO.js.map +1 -0
- package/dist/{chunk-U5P7VICU.js → chunk-NGGEGY5K.js} +2 -2
- package/dist/chunk-NGGEGY5K.js.map +1 -0
- package/dist/{chunk-5P5TRMTT.js → chunk-NR5IZJYS.js} +2 -2
- package/dist/{chunk-OMD44DQ6.js → chunk-PD5BZYBO.js} +36 -35
- package/dist/chunk-PD5BZYBO.js.map +1 -0
- package/dist/{chunk-AKL5ZKJO.js → chunk-SP7VFTXO.js} +2 -2
- package/dist/{chunk-AKL5ZKJO.js.map → chunk-SP7VFTXO.js.map} +1 -1
- package/dist/{chunk-FP4DT6D5.js → chunk-TAUXWIYB.js} +2 -2
- package/dist/{chunk-WWH3SKMB.js → chunk-TB3ZEMTC.js} +2 -2
- package/dist/{chunk-CQBWWH2B.js → chunk-WO4XKOMM.js} +2 -2
- package/dist/{chunk-K4HQYC5M.js → chunk-WVPFWUR2.js} +2 -2
- package/dist/{chunk-IZDFUFAQ.js → chunk-XCYGF4RB.js} +2 -2
- package/dist/{chunk-7JX766OQ.js → chunk-XUT4RBU6.js} +2 -2
- package/dist/{chunk-CWYCCQ57.js → chunk-YLQZFV6Y.js} +2 -2
- package/dist/cli.js +1 -1
- package/dist/{client-WPOAEQSW.js → client-LP4PURY2.js} +2 -2
- package/dist/{config-7MCC4L7E.js → config-IBOY7BGF.js} +2 -2
- package/dist/{config-mutate-GLF2MEW4.js → config-mutate-PETOQADF.js} +2 -2
- package/dist/config-mutator-2NLZ37LL.js +2 -0
- package/dist/{contributions-A3JV2JW6.js → contributions-NQ3OQ4O4.js} +2 -2
- package/dist/{doctor-XWGGS3MM.js → doctor-AMX2GRRN.js} +2 -2
- package/dist/{follow-up-tool-TPR3BCCK.js → follow-up-tool-3XSPNZKM.js} +2 -2
- package/dist/{hub-RBVAC7NA.js → hub-DRCMPJMQ.js} +2 -2
- package/dist/index.d.ts +323 -43
- package/dist/index.js +1 -1
- package/dist/processes-EWARF6ZW.js +2 -0
- package/dist/{program-OBTSSEUB.js → program-XKQTHEQ3.js} +279 -278
- package/dist/program-XKQTHEQ3.js.map +1 -0
- package/dist/{promote-KMDLBVCS.js → promote-4F2H3WEB.js} +2 -2
- package/dist/{query-PC2V2M2H.js → query-25FU55U6.js} +2 -2
- package/dist/{query-settings-FK5QR7MM.js → query-settings-5BLTPQQQ.js} +2 -2
- package/dist/{registry-TDZCAQAS.js → registry-GROEORK6.js} +2 -2
- package/dist/{request-planner-OYY36H2K.js → request-planner-7JLFVL6Y.js} +2 -2
- package/dist/{review-candidates-STVUGCVM.js → review-candidates-MHIKLDT7.js} +2 -2
- package/dist/{routing-SHHD6M67.js → routing-ZSGWR6ID.js} +2 -2
- package/dist/schedule-tool-2VI5IWZD.js +2 -0
- package/dist/{scheduler-CIOGE7UG.js → scheduler-J6BGTTMH.js} +2 -2
- package/dist/{seat-LWJS5BKD.js → seat-WUEQNCSG.js} +2 -2
- package/dist/{select-VYBDUP4R.js → select-ASFYQYDU.js} +2 -2
- package/dist/{set-enabled-KBLEBANS.js → set-enabled-6NIDVEZF.js} +2 -2
- package/dist/{sprint-tool-TCASE2O7.js → sprint-tool-APMWCQF3.js} +2 -2
- package/dist/{tool-LSDMU5OX.js → tool-2CKQKDU5.js} +2 -2
- package/dist/{tool-YMWIUVOK.js → tool-JPSOIPZZ.js} +2 -2
- package/dist/{tool-RQX6IEY7.js → tool-MKUGBNSW.js} +2 -2
- package/dist/{wiki-IIAPP6RU.js → wiki-JR6U5PSV.js} +2 -2
- package/dist/wiki-enrich-KFVPA2JG.js +2 -0
- package/package.json +2 -2
- package/dist/board-dashboard-VZYUXVP6.js.map +0 -1
- package/dist/chunk-4BVISFOC.js.map +0 -1
- package/dist/chunk-FWT23FGY.js.map +0 -1
- package/dist/chunk-OMD44DQ6.js.map +0 -1
- package/dist/chunk-RE5XFWBY.js.map +0 -1
- package/dist/chunk-U5P7VICU.js.map +0 -1
- package/dist/chunk-VUEQ4SL5.js.map +0 -1
- package/dist/config-mutator-KWUDF36N.js +0 -2
- package/dist/processes-QZWODHBX.js +0 -2
- package/dist/program-OBTSSEUB.js.map +0 -1
- package/dist/schedule-tool-O6OIDKNV.js +0 -2
- package/dist/wiki-enrich-HNC76QED.js +0 -2
- /package/dist/{App-BT67QQ5H.js.map → App-56QIEQGH.js.map} +0 -0
- /package/dist/{ChatApp-64WRBUKX.js.map → ChatApp-JNWIXMDN.js.map} +0 -0
- /package/dist/{absorb-eval-IHNCDJTM.js.map → absorb-eval-BYYFZJCC.js.map} +0 -0
- /package/dist/{adapter-URLHEV3F.js.map → adapter-YQ37MDPV.js.map} +0 -0
- /package/dist/{agent-Q73VAOJR.js.map → agent-4637FJMD.js.map} +0 -0
- /package/dist/{chunk-7TEJJM24.js.map → chunk-2BJ7NIGG.js.map} +0 -0
- /package/dist/{chunk-JXGREJDJ.js.map → chunk-35I76HQS.js.map} +0 -0
- /package/dist/{chunk-E7VJU7FI.js.map → chunk-35R7Y7BT.js.map} +0 -0
- /package/dist/{chunk-GKE7IP3T.js.map → chunk-5KVTIFRY.js.map} +0 -0
- /package/dist/{chunk-OJ2XT27M.js.map → chunk-AQGQLVCD.js.map} +0 -0
- /package/dist/{chunk-AU3VT7BD.js.map → chunk-DMCMV4UJ.js.map} +0 -0
- /package/dist/{chunk-6JKFJM2D.js.map → chunk-DOBTHQ32.js.map} +0 -0
- /package/dist/{chunk-EYC5DJR2.js.map → chunk-ES236GV6.js.map} +0 -0
- /package/dist/{chunk-CLH4QJAO.js.map → chunk-FOTAGQEL.js.map} +0 -0
- /package/dist/{chunk-I4VNUTLL.js.map → chunk-GALI5ANI.js.map} +0 -0
- /package/dist/{chunk-FAU6WDVT.js.map → chunk-HZXLZIB4.js.map} +0 -0
- /package/dist/{chunk-XGREDHJY.js.map → chunk-I7EO2WXC.js.map} +0 -0
- /package/dist/{chunk-3Y6QTM4Z.js.map → chunk-IPHFWU2F.js.map} +0 -0
- /package/dist/{chunk-SEQXJWSD.js.map → chunk-KE3KLMMK.js.map} +0 -0
- /package/dist/{chunk-OV77U4GH.js.map → chunk-LB55Q3K4.js.map} +0 -0
- /package/dist/{chunk-CX6HUPUZ.js.map → chunk-MY7C6E4Y.js.map} +0 -0
- /package/dist/{chunk-5P5TRMTT.js.map → chunk-NR5IZJYS.js.map} +0 -0
- /package/dist/{chunk-FP4DT6D5.js.map → chunk-TAUXWIYB.js.map} +0 -0
- /package/dist/{chunk-WWH3SKMB.js.map → chunk-TB3ZEMTC.js.map} +0 -0
- /package/dist/{chunk-CQBWWH2B.js.map → chunk-WO4XKOMM.js.map} +0 -0
- /package/dist/{chunk-K4HQYC5M.js.map → chunk-WVPFWUR2.js.map} +0 -0
- /package/dist/{chunk-IZDFUFAQ.js.map → chunk-XCYGF4RB.js.map} +0 -0
- /package/dist/{chunk-7JX766OQ.js.map → chunk-XUT4RBU6.js.map} +0 -0
- /package/dist/{chunk-CWYCCQ57.js.map → chunk-YLQZFV6Y.js.map} +0 -0
- /package/dist/{client-WPOAEQSW.js.map → client-LP4PURY2.js.map} +0 -0
- /package/dist/{config-7MCC4L7E.js.map → config-IBOY7BGF.js.map} +0 -0
- /package/dist/{config-mutate-GLF2MEW4.js.map → config-mutate-PETOQADF.js.map} +0 -0
- /package/dist/{config-mutator-KWUDF36N.js.map → config-mutator-2NLZ37LL.js.map} +0 -0
- /package/dist/{contributions-A3JV2JW6.js.map → contributions-NQ3OQ4O4.js.map} +0 -0
- /package/dist/{doctor-XWGGS3MM.js.map → doctor-AMX2GRRN.js.map} +0 -0
- /package/dist/{follow-up-tool-TPR3BCCK.js.map → follow-up-tool-3XSPNZKM.js.map} +0 -0
- /package/dist/{hub-RBVAC7NA.js.map → hub-DRCMPJMQ.js.map} +0 -0
- /package/dist/{processes-QZWODHBX.js.map → processes-EWARF6ZW.js.map} +0 -0
- /package/dist/{promote-KMDLBVCS.js.map → promote-4F2H3WEB.js.map} +0 -0
- /package/dist/{query-PC2V2M2H.js.map → query-25FU55U6.js.map} +0 -0
- /package/dist/{query-settings-FK5QR7MM.js.map → query-settings-5BLTPQQQ.js.map} +0 -0
- /package/dist/{registry-TDZCAQAS.js.map → registry-GROEORK6.js.map} +0 -0
- /package/dist/{request-planner-OYY36H2K.js.map → request-planner-7JLFVL6Y.js.map} +0 -0
- /package/dist/{review-candidates-STVUGCVM.js.map → review-candidates-MHIKLDT7.js.map} +0 -0
- /package/dist/{routing-SHHD6M67.js.map → routing-ZSGWR6ID.js.map} +0 -0
- /package/dist/{schedule-tool-O6OIDKNV.js.map → schedule-tool-2VI5IWZD.js.map} +0 -0
- /package/dist/{scheduler-CIOGE7UG.js.map → scheduler-J6BGTTMH.js.map} +0 -0
- /package/dist/{seat-LWJS5BKD.js.map → seat-WUEQNCSG.js.map} +0 -0
- /package/dist/{select-VYBDUP4R.js.map → select-ASFYQYDU.js.map} +0 -0
- /package/dist/{set-enabled-KBLEBANS.js.map → set-enabled-6NIDVEZF.js.map} +0 -0
- /package/dist/{sprint-tool-TCASE2O7.js.map → sprint-tool-APMWCQF3.js.map} +0 -0
- /package/dist/{tool-LSDMU5OX.js.map → tool-2CKQKDU5.js.map} +0 -0
- /package/dist/{tool-YMWIUVOK.js.map → tool-JPSOIPZZ.js.map} +0 -0
- /package/dist/{tool-RQX6IEY7.js.map → tool-MKUGBNSW.js.map} +0 -0
- /package/dist/{wiki-IIAPP6RU.js.map → wiki-JR6U5PSV.js.map} +0 -0
- /package/dist/{wiki-enrich-HNC76QED.js.map → wiki-enrich-KFVPA2JG.js.map} +0 -0
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# AgentX
|
|
8
8
|
|
|
9
|
-
**AI
|
|
9
|
+
**AI staff for a small company: they find sales, answer clients, write your posts and watch the money, on a machine you own. You approve what matters.**
|
|
10
10
|
|
|
11
11
|
<a href="https://www.producthunt.com/products/agentx-4?embed=true&utm_source=badge-featured&utm_medium=badge&utm_campaign=badge-agentx-5" target="_blank" rel="noopener noreferrer"><img alt="AgentX - AI teammates in the tools your team already uses | Product Hunt" width="250" height="54" src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=1258056&theme=light&t=1790073592268" /></a>
|
|
12
12
|
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
[](package.json)
|
|
17
17
|
[](https://github.com/anis-marrouchi/agentx/actions/workflows/install-matrix.yml)
|
|
18
18
|
|
|
19
|
-
[
|
|
19
|
+
[The jobs](#the-jobs-agentx-does) · [Your questions](#your-questions-answered) · [See the demo](#see-it-without-an-account) · [Install](#install) · [How it works](#how-it-works)
|
|
20
20
|
|
|
21
21
|
</div>
|
|
22
22
|
|
|
@@ -24,24 +24,129 @@
|
|
|
24
24
|
2. **It works in your team's tools.** WhatsApp, Telegram, GitLab, GitHub and schedules, on a machine you own.
|
|
25
25
|
3. **You check the result and decide.** The browser dashboard shows what was done and what still needs you.
|
|
26
26
|
|
|
27
|
-
##
|
|
27
|
+
## What you get
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
29
|
+
- **More sales.** New leads every week, a morning brief on what changed, and a ready follow-up for every lead that went quiet.
|
|
30
|
+
- **Faster replies to clients.** A client who writes on WhatsApp after hours gets an answer within a minute, and each evening you see who still waits on you.
|
|
31
|
+
- **Content that goes out on time.** Next week's posts are planned on Friday and drafted in your voice on Monday. You say yes before anything is published.
|
|
32
|
+
- **Money under control.** A monthly dollar cap per agent, per project and for the whole company. You are warned at 80% and the work pauses at 100%.
|
|
33
|
+
- **Operations that report only problems.** One message a day lists what failed, what is stuck and what is paused. When nothing is wrong, nothing is sent.
|
|
34
|
+
|
|
35
|
+
Each job comes as a **ready-made team**: agents with their instructions and their schedules (tasks that run by themselves at set times), added in one command. You connect your chat app, and the first result arrives on the next scheduled run. [Start from a ready-made team](docs/jobs/ready-made-teams.md).
|
|
36
|
+
|
|
37
|
+
## The jobs AgentX does
|
|
38
|
+
|
|
39
|
+
One section per job a small company hires for. Each says what you approve, what it costs, and the first result you can check.
|
|
40
|
+
|
|
41
|
+
What it costs depends on your model account (a Claude subscription, or an API key you pay by use). AgentX itself is free. A **run** is one time an agent works: it reads, thinks and answers. Each run uses your model account. [What it costs](docs/help/costs.md).
|
|
42
|
+
|
|
43
|
+
### Sales
|
|
44
|
+
|
|
45
|
+
**The problem.** Leads come in, then go quiet because nobody followed up. Nobody has time to research new prospects or watch what competitors change.
|
|
46
|
+
|
|
47
|
+
**What AgentX does.** The `sales-follow-up` team finds up to 10 new leads a week that match the customers you describe, sends you a brief every weekday morning, watches your competitors' pages and reports only what changed, and drafts a follow-up for each quiet lead. Every fact links to the page it came from. People who asked not to be contacted are left out.
|
|
48
|
+
|
|
49
|
+
**What you approve.** Everything that reaches a person. The agent cannot send anything: you read each draft and send it yourself.
|
|
50
|
+
|
|
51
|
+
**What it costs.** About 12 runs a week (5 page checks, 5 briefs, 1 research list, 1 set of drafts), plus the questions you ask it.
|
|
52
|
+
|
|
53
|
+
**First result you can see.** **Terminal:** in `agents/sales/`, `agentx sales watch` lists the competitor pages it now watches. The next weekday after 08:30, the brief arrives in Telegram, every line with a link.
|
|
54
|
+
|
|
55
|
+
[Find and follow up sales leads](docs/jobs/sales.md)
|
|
56
|
+
|
|
57
|
+
### Content
|
|
58
|
+
|
|
59
|
+
**The problem.** Posts go out late or not at all, and when someone else writes them they do not sound like you.
|
|
60
|
+
|
|
61
|
+
**What AgentX does.** The `content` team learns your voice from a folder of your past posts, plans next week's posts every Friday, and drafts each one on Monday, naming the past posts it followed. It posts to LinkedIn or X, or saves the post ready to paste.
|
|
62
|
+
|
|
63
|
+
**What you approve.** Every post. Nothing is published until you say yes in **Approvals**.
|
|
64
|
+
|
|
65
|
+
**What it costs.** Two runs a week, plus the drafts you ask for.
|
|
66
|
+
|
|
67
|
+
**First result you can see.** **Terminal:** `agentx content drafts` lists one draft per planned post, each with the past posts it followed.
|
|
68
|
+
|
|
69
|
+

|
|
70
|
+
|
|
71
|
+
[Draft posts in your voice](docs/jobs/content.md)
|
|
72
|
+
|
|
73
|
+
### Clients and support
|
|
74
|
+
|
|
75
|
+
**The problem.** Clients write after hours and wait until morning, then ask again where their request stands.
|
|
76
|
+
|
|
77
|
+
**What AgentX does.** The `client-inbox` team answers on WhatsApp from your business notes, within a minute, and hands you prices, refunds, complaints and dates it cannot decide. Each evening you get the list of clients still waiting on you. An agent can answer on Telegram the same way. Each client can get a page of their own that shows what they asked for and where it stands.
|
|
78
|
+
|
|
79
|
+
**What you approve.** Replies go out **without** your approval, so use a separate number and give the agent clear notes on what it may promise. It passes anything it cannot decide to you. If you prefer to approve every reply, [watch a WhatsApp chat](docs/jobs/watch-whatsapp.md) instead: the agent drafts and nothing is sent until you say yes.
|
|
80
|
+
|
|
81
|
+
**What it costs.** One run per client message, plus one summary each weekday evening.
|
|
82
|
+
|
|
83
|
+
**First result you can see.** **Phone:** write to the paired number from an allowed number. The answer arrives in the same chat within a minute.
|
|
84
|
+
|
|
85
|
+
**Support from your own documents, by email too.** The `support` team answers from a folder of your guides and policies and ends each answer with the document it came from. Questions the documents don't cover come to you instead of being guessed. Connect a mailbox and it answers email in the same thread; each email reply waits in **Approvals** until you send it.
|
|
86
|
+
|
|
87
|
+
[Answer customers on WhatsApp](docs/jobs/answer-whatsapp.md) · [Answer customer email](docs/jobs/answer-email.md) · [Start from a ready-made team](docs/jobs/ready-made-teams.md) · [Give a client a page](docs/jobs/clients.md)
|
|
88
|
+
|
|
89
|
+
### Operations
|
|
90
|
+
|
|
91
|
+
**The problem.** Reports depend on someone remembering them, and automated checks that say "all fine" every day soon get ignored.
|
|
92
|
+
|
|
93
|
+
**What AgentX does.** A schedule asks an agent for the daily report at a set time. A check can stay quiet unless it finds a problem. The **exceptions digest** sends one message a day that lists failed or missed schedules, stuck requests and paused agents, and nothing when all is well.
|
|
94
|
+
|
|
95
|
+
**What you approve.** A new or removed schedule waits for your yes when an agent proposes it.
|
|
96
|
+
|
|
97
|
+
**What it costs.** One run per scheduled report. The exceptions digest uses no model, so it costs nothing.
|
|
98
|
+
|
|
99
|
+
**First result you can see.** **Browser:** open the dashboard, select **Operations**, and find your schedule under **Today's automations**, with each run and its result.
|
|
100
|
+
|
|
101
|
+

|
|
102
|
+
|
|
103
|
+
[Send a daily report](docs/jobs/daily-report.md) · [Get a daily list of what is wrong](docs/jobs/exceptions-digest.md) · [Operations page](docs/dashboard/operations.md)
|
|
104
|
+
|
|
105
|
+
### Money
|
|
106
|
+
|
|
107
|
+
**The problem.** AI spend can grow without anyone noticing until the bill arrives.
|
|
108
|
+
|
|
109
|
+
**What AgentX does.** You set a monthly dollar budget for an agent, a project, or all agents together. At 80% you get one notice. At 100% new work for that agent pauses and waits; it runs on the first day of the next month, or as soon as you raise the budget. Waiting messages survive a restart. The Cost page shows what each agent spent.
|
|
110
|
+
|
|
111
|
+
**What you approve.** You set the caps and raise them. Nothing raises a cap by itself.
|
|
112
|
+
|
|
113
|
+
**What it costs.** Nothing: counting and caps run on your machine.
|
|
114
|
+
|
|
115
|
+
**First result you can see.** **Browser:** open `/admin/cost` on your dashboard. The **Monthly budgets** card shows each agent's spend against its cap.
|
|
116
|
+
|
|
117
|
+

|
|
118
|
+
|
|
119
|
+
[Set a monthly budget](docs/help/costs.md#set-a-monthly-budget-for-an-agent)
|
|
120
|
+
|
|
121
|
+
### Dev
|
|
122
|
+
|
|
123
|
+
**The problem.** Small code fixes wait days for a developer, and code an agent wrote can pass its own tests and still miss the point.
|
|
124
|
+
|
|
125
|
+
**What AgentX does.** The `dev-team` team turns an issue you assign on GitLab into a small merge request with a test, and a second agent reviews it. On GitHub, the review gate checks each agent pull request against its issue before merge, and the same works on GitLab merge requests. Issues can come from Linear or Jira. Turn on worktrees and each issue gets its own folder, so two tasks on the same project do not mix.
|
|
126
|
+
|
|
127
|
+
**What you approve.** The merge. Neither agent merges.
|
|
128
|
+
|
|
129
|
+
**What it costs.** One run per issue and per review, plus one digest each weekday morning.
|
|
130
|
+
|
|
131
|
+
**First result you can see.** **Browser:** on the pull request, the check `agentx/review` shows **success** or **failure**, with a comment that lists what is missing.
|
|
132
|
+
|
|
133
|
+
[Watch GitLab work](docs/jobs/watch-gitlab.md) · [Review gate](docs/jobs/review-gate.md) · [Linear and Jira](docs/jobs/linear-jira.md) · [One folder per task](docs/jobs/task-worktrees.md)
|
|
134
|
+
|
|
135
|
+
## Your questions, answered
|
|
136
|
+
|
|
137
|
+
**Can the bill run away?** Not if you set a cap. A monthly budget pauses an agent, a project or the whole company at the amount you set. Without a cap, spend follows your use; start with schedules that run rarely. [Costs and caps](docs/help/costs.md).
|
|
138
|
+
|
|
139
|
+
**Will it send or publish something without me?** Sales messages are only drafts: you send them yourself. Content posts, email replies, replies in a watched WhatsApp chat, new schedules and a few other actions wait for your yes in **Approvals**. Some things go out on their own: answers on a WhatsApp or Telegram number you connected to an agent, and comments on issues. [What always waits for you](docs/jobs/keep-it-safe.md#what-always-waits-for-you) lists both, plainly.
|
|
140
|
+
|
|
141
|
+
**Where does my data go?** AgentX runs on your machine. The AI model belongs to a model provider (for example Anthropic or OpenAI), so what an agent reads to answer goes there. Nothing goes to the makers of AgentX: no usage statistics. [Your data](docs/your-data.md) lists everything that leaves, and how to keep it home.
|
|
142
|
+
|
|
143
|
+
**What happens when something fails?** A failed scheduled run sends a short failure message to its chat, and the exceptions digest lists it the next day. A task you stop keeps a plan and can be resumed. A restart lets running tasks finish first, and messages paused by a budget are kept. [Daily list of what is wrong](docs/jobs/exceptions-digest.md) · [Restart without losing work](docs/jobs/restart-safely.md) · [Pause and resume](docs/jobs/pause-and-resume.md).
|
|
39
144
|
|
|
40
145
|
## Is AgentX right for you?
|
|
41
146
|
|
|
42
147
|
**Right for you if:**
|
|
43
148
|
|
|
44
|
-
- your clients or your team already work in WhatsApp, Telegram, GitLab or GitHub;
|
|
149
|
+
- your clients or your team already work in WhatsApp, Telegram, email, GitLab or GitHub;
|
|
45
150
|
- you want the agents, and what they see, on a machine you control ([your data](docs/your-data.md));
|
|
46
151
|
- you have someone who can run one command in a terminal to install it;
|
|
47
152
|
- you already use Claude Code, Codex, OpenCode or a model API key ([what it costs](docs/help/costs.md)).
|
|
@@ -49,23 +154,10 @@
|
|
|
49
154
|
**Not for you yet if:**
|
|
50
155
|
|
|
51
156
|
- you need Slack or Discord as a live channel ([channels](docs/reference/channels.md));
|
|
52
|
-
- you need roles and permissions for many users (
|
|
157
|
+
- you need roles and permissions for many users (not built yet);
|
|
53
158
|
- you want a hosted service with nothing to install: there is none;
|
|
54
159
|
- you run Windows only (untested; WSL may work);
|
|
55
|
-
- you need a
|
|
56
|
-
|
|
57
|
-
## Watch it
|
|
58
|
-
|
|
59
|
-
Short videos show AgentX running, one task each. Click the picture to open the **Learn AgentX** playlist on YouTube.
|
|
60
|
-
|
|
61
|
-
[](https://www.youtube.com/playlist?list=PLWyRWfXkYvlw)
|
|
62
|
-
|
|
63
|
-
- [01: Run AI agents on your own machine, no account](https://youtu.be/J_QC6QCsSBs)
|
|
64
|
-
- [02: Install AgentX and check it with doctor](https://youtu.be/arOqm5bB1Lw)
|
|
65
|
-
- [Phone part 1: Install the AgentX phone app and pair it](https://youtu.be/i4BNYlI9ntA)
|
|
66
|
-
- [Phone part 2: Chat with your AI agents from a phone](https://youtu.be/ofX__nC53ZQ)
|
|
67
|
-
- [Desktop part 1: Install the AgentX desktop widget on a Mac](https://youtu.be/XwTJjaTt5WE)
|
|
68
|
-
- [Desktop part 2: The floating widget, the pill and the orb](https://youtu.be/catRqT5LoyY)
|
|
160
|
+
- you need a 1.0 release: AgentX is still 0.x. The [upgrade promise](docs/reference/releases.md#upgrade-promise) already holds, and 1.0 is tracked in [#1294](https://github.com/anis-marrouchi/agentx/issues/1294).
|
|
69
161
|
|
|
70
162
|
## See it without an account
|
|
71
163
|
|
|
@@ -79,36 +171,22 @@ No clone, account, or API key is needed. The first run downloads the package, wh
|
|
|
79
171
|
|
|
80
172
|
The demo starts three local AgentX daemons and sends a task between them. Routing, network calls, and the event record are real. Model responses are scripted, so the demo makes no billable model calls. The terminal prints the dashboard addresses. [What to expect](docs/see-it-first.md).
|
|
81
173
|
|
|
82
|
-
## What it does
|
|
83
|
-
|
|
84
|
-
- **Clients get an answer where they already write.** Connect WhatsApp or Telegram and an agent replies in the same chat.
|
|
85
|
-
- **Reports arrive without anyone remembering them.** A schedule asks an agent for the daily report or another recurring job.
|
|
86
|
-
- **Issues move toward a fix.** An agent takes an issue from GitLab or GitHub and works on the fix.
|
|
87
|
-
- **You see what was done and what still needs you.** Live shows current work; Activity records completed runs; Monitor shows reviewed work that needs a person and work agents can handle.
|
|
88
|
-
- **You reach your agents the way that suits you.** Use [in-page chat](docs/dashboard/chat.md), the [OpenCode-backed TUI](docs/dashboard/tui.md), or the desktop assistant for voice and computer use.
|
|
89
|
-
- **Work goes to the machine that has the right tools.** Start with one host, then pair another when a job needs its tools or files.
|
|
90
|
-
|
|
91
|
-
Under the hood AgentX is a harness: the program around an AI model that gives it channels, tools, schedules and memory, and records what it did. It runs on Claude Code, Codex, OpenCode or any model API, on a machine you control.
|
|
92
|
-
|
|
93
174
|

|
|
94
175
|
|
|
95
176
|
*The Monitor dashboard in the isolated demo: review tasks that need you, with in-page agent chat. All displayed tasks are fictional.*
|
|
96
177
|
|
|
97
|
-
##
|
|
98
|
-
|
|
99
|
-
AgentX works and can be used today, but it is still an **experimental project, not a stable release**. There is plenty to polish and fix, especially the **Settings experience and configuration flows**. Expect rough edges and changes as people try it in real environments.
|
|
100
|
-
|
|
101
|
-
Releases ship often; see the [changelog](CHANGELOG.md) for what changed. A breaking change is always listed there with what to do, each release is installed on Linux and macOS by the install matrix (its pass rate is the badge at the top), and the [roadmap](docs/roadmap.md) says what comes next. See [Releases, upgrades and security](docs/reference/releases.md). Our priority is to learn from actual use: what works, what breaks, and what is confusing to set up or operate.
|
|
102
|
-
|
|
103
|
-
**Still missing: role-based access control (RBAC) at both mesh and agent levels.** We want to define who can access shared nodes and agents, delegate work, and perform particular actions. This would open up more possibilities for shared teams and multi-user deployments. Existing mesh authentication and tool permissions do not provide this complete role model; RBAC is planned work, not an available feature.
|
|
104
|
-
|
|
105
|
-
[Try the demo](#see-it-without-an-account), [check the requirements](docs/requirements.md), or [help us test](#help-test-and-improve-agentx).
|
|
178
|
+
## Watch it
|
|
106
179
|
|
|
107
|
-
|
|
180
|
+
Short videos show AgentX running, one task each. Click the picture to open the **Learn AgentX** playlist on YouTube.
|
|
108
181
|
|
|
109
|
-
|
|
182
|
+
[](https://www.youtube.com/playlist?list=PLWyRWfXkYvlw)
|
|
110
183
|
|
|
111
|
-
|
|
184
|
+
- [01: Run AI agents on your own machine, no account](https://youtu.be/J_QC6QCsSBs)
|
|
185
|
+
- [02: Install AgentX and check it with doctor](https://youtu.be/arOqm5bB1Lw)
|
|
186
|
+
- [Phone part 1: Install the AgentX phone app and pair it](https://youtu.be/i4BNYlI9ntA)
|
|
187
|
+
- [Phone part 2: Chat with your AI agents from a phone](https://youtu.be/ofX__nC53ZQ)
|
|
188
|
+
- [Desktop part 1: Install the AgentX desktop widget on a Mac](https://youtu.be/XwTJjaTt5WE)
|
|
189
|
+
- [Desktop part 2: The floating widget, the pill and the orb](https://youtu.be/catRqT5LoyY)
|
|
112
190
|
|
|
113
191
|
## Install
|
|
114
192
|
|
|
@@ -118,7 +196,13 @@ One command, on macOS or Linux with **Node.js 22.19 or newer, up to 26**:
|
|
|
118
196
|
npx agentix-cli start
|
|
119
197
|
```
|
|
120
198
|
|
|
121
|
-
It creates `agentx.json` with one agent in the current folder, starts
|
|
199
|
+
It creates `agentx.json` with one agent in the current folder, starts AgentX in the background, and ends with your first agent's chat open in the browser. From typing the command to the first reply took about 23 seconds on Linux and 24 seconds on macOS (median of 3 runs each, model key ready); an automated check times it on Linux and macOS on every change and fails above 5 minutes. If no model is set up yet, the chat asks for an API key, or for the Claude Code login, and then answers. Run it again any time: it reuses what is running and never overwrites your config. Windows is untested; try WSL.
|
|
200
|
+
|
|
201
|
+
Then add the team for the job you want, for example:
|
|
202
|
+
|
|
203
|
+
```sh
|
|
204
|
+
agentx team add sales-follow-up
|
|
205
|
+
```
|
|
122
206
|
|
|
123
207
|
To install the `agentx` command globally first, use the installer, which checks Node.js (and downloads Node 22 into `~/.agentx/node` when it is missing) and then runs the same start:
|
|
124
208
|
|
|
@@ -145,19 +229,31 @@ node dist/cli.js start
|
|
|
145
229
|
|
|
146
230
|
The npm package is `agentix-cli`; the installed executable is `agentx`. Follow the [installation guide](docs/install.md) for details.
|
|
147
231
|
|
|
148
|
-
|
|
232
|
+
## How it works
|
|
149
233
|
|
|
150
|
-
|
|
234
|
+
The rest of this page is for the person who sets AgentX up.
|
|
151
235
|
|
|
152
|
-
|
|
153
|
-
claude plugin install agentx --marketplace anis-marrouchi/agentx
|
|
154
|
-
```
|
|
236
|
+
AgentX is a **harness**: the program around an AI model that gives it channels, tools, schedules and memory, and records what it did. It runs on Claude Code, Codex, OpenCode or any model API, on a machine you control. A background service, the **daemon**, receives messages and runs the agents; the **dashboard** in your browser shows what was done and what still needs you. Both must be running for messages to be handled.
|
|
155
237
|
|
|
156
|
-
|
|
238
|
+
### The dashboard
|
|
239
|
+
|
|
240
|
+
The six top-level tabs are **Live, Operations, Monitor, Activity, Workflows, and Settings**. Live shows current work; Activity records completed runs; Monitor shows reviewed work that needs a person and work agents can handle. You can also reach your agents with [in-page chat](docs/dashboard/chat.md), the [OpenCode-backed TUI](docs/dashboard/tui.md), or the desktop assistant for voice and computer use. [Dashboard guide](docs/dashboard/index.md).
|
|
241
|
+
|
|
242
|
+
### Describe an automation, get an automation
|
|
243
|
+
|
|
244
|
+
The Workflows editor has a chat control. Describe the timing, source, and destination in ordinary language. An authoring agent can propose a workflow and show an **Apply to canvas** action. Read the proposed steps before applying them: this replaces the current graph. Real authoring needs a working model. The demo includes a fixed example for **Build the demo report workflow**. [Walk through it](docs/automations/describe-it.md).
|
|
245
|
+
|
|
246
|
+

|
|
157
247
|
|
|
158
|
-
|
|
248
|
+
### Channels and models
|
|
159
249
|
|
|
160
|
-
|
|
250
|
+
Telegram and WhatsApp have pairing flows. GitLab, GitHub, and generic webhooks can bring in events. **Slack and Discord are not supported as live channel adapters in this build.** [Channel reference](docs/reference/channels.md).
|
|
251
|
+
|
|
252
|
+
Real agents need a configured model. An API provider needs a key; Claude Code, Codex CLI, and OpenCode need their CLI installed and authenticated on the host. Model-provider charges or subscription terms depend on your chosen provider.
|
|
253
|
+
|
|
254
|
+
### One machine is enough to start
|
|
255
|
+
|
|
256
|
+
When an agent needs to work on another machine, pair the nodes with `agentx connect mesh invite` and `agentx connect mesh join <link>`. Paired machines form a **mesh**, and a connected agent can pass work to another node. For example:
|
|
161
257
|
|
|
162
258
|
```text
|
|
163
259
|
You: "@cx CI is red on GitLab — find the cause"
|
|
@@ -166,25 +262,31 @@ Builder: checks the project and reports the result
|
|
|
166
262
|
CX: replies in the original thread
|
|
167
263
|
```
|
|
168
264
|
|
|
169
|
-
The [second-machine guide](docs/jobs/second-machine.md) covers pairing. You do not need mesh for a one-agent setup.
|
|
265
|
+
The [second-machine guide](docs/jobs/second-machine.md) covers pairing. You do not need a mesh for a one-agent setup.
|
|
170
266
|
|
|
171
|
-
|
|
267
|
+
### Integrations
|
|
172
268
|
|
|
173
|
-
|
|
269
|
+
- **Channels:** Telegram, WhatsApp, GitLab, GitHub, and generic webhooks. [Channel reference](docs/reference/channels.md).
|
|
270
|
+
- **Models:** API providers, plus the Claude Code, Codex CLI, and OpenCode CLIs.
|
|
271
|
+
- **Other programs:** the local daemon accepts tasks over HTTP, and `agentx a2a` serves the A2A protocol. [Agent-to-agent reference](docs/reference/a2a.md).
|
|
272
|
+
- **Coding agents:** a [Claude Code plugin](docs/jobs/install-the-plugin.md), and the `agentx serve --stdio` tool server (MCP) for [Cursor, VS Code and Windsurf](docs/jobs/connect-an-editor.md).
|
|
273
|
+
- **Raycast:** ask your agents and list them from Raycast. [Install from this checkout](integrations/raycast/README.md); not in the Raycast Store yet.
|
|
174
274
|
|
|
175
|
-
|
|
275
|
+
### Add AgentX to Claude Code
|
|
176
276
|
|
|
177
|
-
|
|
277
|
+
With AgentX installed and its node running, one command adds the AgentX plugin to Claude Code (version 2.1.275 or later). The plugin brings the AgentX tool server, in look-only mode by default, and two skills:
|
|
178
278
|
|
|
179
|
-
|
|
279
|
+
```sh
|
|
280
|
+
claude plugin install agentx --marketplace anis-marrouchi/agentx
|
|
281
|
+
```
|
|
180
282
|
|
|
181
|
-
|
|
283
|
+
Start a new Claude Code session and ask it to check your AgentX node. [Step-by-step guide and settings](docs/jobs/install-the-plugin.md). For Cursor, VS Code or Windsurf, see [Use AgentX from your code editor](docs/jobs/connect-an-editor.md).
|
|
182
284
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
285
|
+
### Release status
|
|
286
|
+
|
|
287
|
+
AgentX is used every day and releases ship often; see the [changelog](CHANGELOG.md) for what changed. It has no 1.0 release yet. A breaking change is always listed in the changelog with what to do, each release is installed on Linux and macOS by the install matrix (its pass rate is the badge at the top), and the [roadmap](docs/roadmap.md) says what comes next. See [Releases, upgrades and security](docs/reference/releases.md). The 1.0 release is tracked in [#1294](https://github.com/anis-marrouchi/agentx/issues/1294).
|
|
288
|
+
|
|
289
|
+
**Not built yet: roles and permissions (RBAC) for shared machines and agents.** Mesh authentication and tool permissions exist, but there is no full role model for who may use which node or agent. It is planned, not available.
|
|
188
290
|
|
|
189
291
|
## Help test and improve AgentX
|
|
190
292
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{a as F,b as L,c as U,d as N,e as O,f as H,g as j}from"./chunk-U2CKL755.js";import{b as B,c as D,d as A,e as P,g as M}from"./chunk-
|
|
1
|
+
import{a as F,b as L,c as U,d as N,e as O,f as H,g as j}from"./chunk-U2CKL755.js";import{b as B,c as D,d as A,e as P,g as M}from"./chunk-FOTAGQEL.js";import"./chunk-NGGEGY5K.js";import"./chunk-VJ5HC63R.js";import"./chunk-UEEB3UTU.js";import"./chunk-GZIHLADX.js";import"./chunk-QIJLFPWE.js";import{useEffect as R,useReducer as V,useRef as G}from"react";import{Box as i,Text as o,useApp as W,useInput as J}from"ink";import{randomUUID as z}from"crypto";async function*q(e){let r=[];e.type&&r.push(`type=${encodeURIComponent(e.type)}`);let t=`${e.baseUrl.replace(/\/+$/,"")}/events${r.length?`?${r.join("&")}`:""}`,n={Accept:"text/event-stream"};e.token&&(n.Authorization=`Bearer ${e.token}`);let s=await fetch(t,{headers:n,signal:e.signal});if(!s.ok||!s.body)throw new Error(`SSE connect failed: HTTP ${s.status}`);let u=s.body.getReader(),p=new TextDecoder,y="";try{for(;;){let{done:f,value:l}=await u.read();if(f)return;y+=p.decode(l,{stream:!0});let d;for(;(d=y.indexOf(`
|
|
2
2
|
|
|
3
3
|
`))>=0;){let h=y.slice(0,d);y=y.slice(d+2);let m=X(h);m&&(yield m)}}}finally{try{u.releaseLock()}catch{}}}function X(e){let r="message",t="";for(let s of e.split(`
|
|
4
4
|
`))s.startsWith("event: ")?r=s.slice(7):s.startsWith("data: ")&&(t=s.slice(6));if(!t)return null;let n;try{n=JSON.parse(t)}catch{n=t}return{event:r,data:n}}import{jsx as a,jsxs as c}from"react/jsx-runtime";function $(e,r){return r<=0||e<0?0:e>=r?r-1:e}function E(){return`tui:${z().slice(0,12)}`}function k(e,r){let t=[...e,r];return t.length>50&&t.splice(0,t.length-50),t}function Y(e,r){switch(r.type){case"agents":return{...e,agents:r.data,cursor:{...e.cursor,agents:$(e.cursor.agents,r.data.length)}};case"processes":return{...e,processes:r.data,cursor:{...e.cursor,processes:$(e.cursor.processes,r.data.length)}};case"crons":return{...e,crons:r.data};case"event":{let t=[r.row,...e.events];t.length>200&&(t.length=200);let n=e.channels;return r.channelTally&&(n=new Map(e.channels),n.set(r.channelTally.channel,r.channelTally)),{...e,events:t,channels:n}}case"connError":return{...e,connError:r.error};case"tick":return{...e,lastTick:Date.now()};case"focus":return{...e,focus:r.pane};case"cursor":{let t=r.pane==="agents"?e.agents.length:r.pane==="processes"?e.processes.length:e.events.length;return{...e,cursor:{...e.cursor,[r.pane]:$(e.cursor[r.pane]+r.delta,t)}}}case"bottomRight":return{...e,bottomRight:r.pane};case"chatStart":return{...e,chat:{active:!0,agentId:r.agentId,chatId:E(),history:[],text:"",status:"idle",error:null}};case"chatExit":return{...e,chat:{...e.chat,active:!1}};case"chatClear":return{...e,chat:{...e.chat,chatId:E(),history:[],text:"",status:"idle",error:null}};case"chatText":return{...e,chat:{...e.chat,text:r.text}};case"chatSubmitStart":return{...e,chat:{...e.chat,history:k(e.chat.history,r.you),text:"",status:"sending",error:null}};case"chatSubmitDone":return{...e,chat:{...e.chat,history:k(e.chat.history,r.reply),status:"idle",error:null}};case"chatSubmitError":return{...e,chat:{...e.chat,history:k(e.chat.history,{role:"error",text:r.error,at:Date.now()}),status:"idle",error:r.error}};case"chatStreamStart":{let t=k(e.chat.history,r.you),n=k(t,{role:"agent",text:"",at:Date.now(),streaming:!0,tools:[]});return{...e,chat:{...e.chat,history:n,text:"",status:"sending",error:null}}}case"chatStreamDelta":{let t=e.chat.history.slice(),n=t[t.length-1];return n?.role==="agent"&&n.streaming&&(t[t.length-1]={...n,text:n.text+r.text}),{...e,chat:{...e.chat,history:t}}}case"chatStreamThinking":{let t=e.chat.history.slice(),n=t[t.length-1];return n?.role==="agent"&&n.streaming&&(t[t.length-1]={...n,thinking:(n.thinking??"")+r.text}),{...e,chat:{...e.chat,history:t}}}case"chatStreamTool":{let t=e.chat.history.slice(),n=t[t.length-1];return n?.role==="agent"&&n.streaming&&(t[t.length-1]={...n,tools:[...n.tools??[],{name:r.name,arg:r.arg,error:r.error}]}),{...e,chat:{...e.chat,history:t}}}case"chatStreamEnd":{let t=e.chat.history.slice(),n=t[t.length-1];return n?.role==="agent"&&n.streaming&&(t[t.length-1]=r.error?{...n,streaming:!1,role:"error",text:r.error}:{...n,streaming:!1,elapsedMs:r.elapsedMs,outTokens:r.outTokens}),{...e,chat:{...e.chat,history:t,status:"idle",error:r.error??null}}}case"toast":return{...e,toast:{text:r.text,color:r.color,at:Date.now()}};case"clearToast":return{...e,toast:null}}}var _={agents:[],processes:[],crons:[],events:[],channels:new Map,connError:null,lastTick:0,focus:"agents",cursor:{agents:0,processes:0,events:0},bottomRight:"crons",chat:{active:!1,agentId:null,chatId:E(),history:[],text:"",status:"idle",error:null},toast:null};function be({conn:e,pollMs:r=3e3}){let[t,n]=V(Y,_),{exit:s}=W(),u=G(null),p=G(null),y=t.agents.map(l=>l.id),f=t.chat.active?L(t.chat.text,y,process.cwd()):null;return R(()=>{if(!t.toast)return;let l=setTimeout(()=>n({type:"clearToast"}),3500);return()=>clearTimeout(l)},[t.toast]),J((l,d)=>{if(t.chat.active){if(d.escape){n({type:"chatExit"});return}if(d.ctrl&&l==="l"){n({type:"chatClear"});return}if(d.tab){let m=U(t.chat.text,p,y,process.cwd());m!==null&&n({type:"chatText",text:m});return}if(d.backspace||d.delete){p.current=null,n({type:"chatText",text:t.chat.text.slice(0,-1)});return}if(d.ctrl||d.meta)return;let h=N(l??"",d.return,t.chat.text);if(h.kind==="paste"||h.kind==="type"){p.current=null,n({type:"chatText",text:t.chat.text+h.text});return}if(h.kind==="continue"){n({type:"chatText",text:h.buffer});return}if(h.kind==="submit"){let m=h.text.trim(),g=t.chat.agentId;if(!m||!g||t.chat.status==="sending"){n({type:"chatText",text:""});return}p.current=null;let b=Date.now(),w=t.chat.chatId;n({type:"chatStreamStart",you:{role:"you",text:m,at:b}}),(async()=>{try{let C=await M(e,g,m,{channel:"tui",chatId:w,onText:x=>n({type:"chatStreamDelta",text:x}),onThinking:x=>n({type:"chatStreamThinking",text:x}),onTool:x=>{x.status==="start"&&x.name?n({type:"chatStreamTool",name:x.name,arg:x.arg}):x.status==="result"&&x.error&&n({type:"chatStreamTool",name:x.name??"tool",error:!0})}});n({type:"chatStreamEnd",elapsedMs:Date.now()-b,outTokens:C.usage?.outputTokens,error:C.error})}catch(C){n({type:"chatStreamEnd",elapsedMs:Date.now()-b,error:C?.message||String(C)})}})();return}return}if(l==="q"||d.ctrl&&l==="c"){u.current?.abort(),s();return}if(d.tab){let h=["agents","processes","events"],m=h.indexOf(t.focus);n({type:"focus",pane:h[(m+1)%h.length]});return}if(l==="a"){n({type:"focus",pane:"agents"});return}if(l==="p"){n({type:"focus",pane:"processes"});return}if(l==="e"){n({type:"focus",pane:"events"});return}if(l==="c"){n({type:"bottomRight",pane:t.bottomRight==="crons"?"channels":"crons"});return}if(d.upArrow){n({type:"cursor",pane:t.focus,delta:-1});return}if(d.downArrow){n({type:"cursor",pane:t.focus,delta:1});return}if(d.return&&t.focus==="agents"){let h=t.agents[t.cursor.agents];if(!h){n({type:"toast",text:"no agent selected",color:"yellow"});return}n({type:"chatStart",agentId:h.id});return}if(l==="k"&&t.focus==="processes"){let h=t.processes[t.cursor.processes];if(!h){n({type:"toast",text:"no process selected",color:"yellow"});return}(async()=>{try{await P(e,h.key,"tui"),n({type:"toast",text:`killed ${h.key.agentId}/${h.key.channel}/${h.key.chatId}`,color:"green"})}catch(m){n({type:"toast",text:`kill failed: ${m?.message||m}`,color:"red"})}})();return}}),R(()=>{let l=new AbortController;u.current=l;let d=!1,h=async()=>{try{let[g,b,w]=await Promise.all([B(e,l.signal).catch(()=>[]),D(e,l.signal).catch(()=>[]),A(e,l.signal).catch(()=>[])]);if(d)return;n({type:"agents",data:g}),n({type:"processes",data:b}),n({type:"crons",data:w}),n({type:"tick"}),n({type:"connError",error:null})}catch(g){d||n({type:"connError",error:g?.message||String(g)})}};h();let m=setInterval(h,r);return()=>{d=!0,clearInterval(m),l.abort()}},[e.baseUrl,e.token,r]),R(()=>{let l=!1,d=new AbortController,h=new Map;return(async()=>{let m=500;for(;!l;){try{for await(let g of q({baseUrl:e.baseUrl,token:e.token,signal:d.signal})){let b=ae(g),w;if(g.event==="channel"&&typeof g.data?.channel=="string"){let S=h.get(g.data.channel)??{channel:g.data.channel,inbound:0,outbound:0,lastAt:0,lastPreview:""},C=S.inbound+(g.data.direction==="in"?1:0),x=S.outbound+(g.data.direction==="out"?1:0);w={channel:g.data.channel,inbound:C,outbound:x,lastAt:b.at,lastPreview:(g.data.textPreview||"").slice(0,60)},h.set(g.data.channel,w)}n({type:"event",row:b,channelTally:w}),m=500}}catch(g){if(l)return;n({type:"connError",error:`events: ${g?.message||g}`})}await new Promise(g=>setTimeout(g,m)),m=Math.min(m*2,1e4)}})(),()=>{l=!0,d.abort()}},[e.baseUrl,e.token]),c(i,{flexDirection:"column",width:"100%",children:[a(K,{conn:e,lastTick:t.lastTick,connError:t.connError,chat:t.chat}),c(i,{flexDirection:"row",flexGrow:1,children:[c(i,{flexDirection:"column",width:"50%",children:[a(v,{title:"AGENTS",focused:!t.chat.active&&t.focus==="agents",children:a(Z,{rows:t.agents,cursor:t.cursor.agents,focused:!t.chat.active&&t.focus==="agents",talkingTo:t.chat.active?t.chat.agentId:null})}),a(v,{title:"PROCESSES",focused:!t.chat.active&&t.focus==="processes",children:a(ee,{rows:t.processes,cursor:t.cursor.processes,focused:!t.chat.active&&t.focus==="processes"})})]}),t.chat.active?a(oe,{chat:t.chat,suggest:f,agents:t.agents}):c(i,{flexDirection:"column",width:"50%",children:[a(v,{title:"LIVE EVENTS",focused:t.focus==="events",children:a(ne,{rows:t.events,cursor:t.cursor.events,focused:t.focus==="events"})}),a(v,{title:t.bottomRight==="crons"?"CRONS / SCHEDULES":"CHANNELS",focused:!1,children:t.bottomRight==="crons"?a(te,{rows:t.crons}):a(re,{rows:Array.from(t.channels.values())})})]})]}),a(Q,{focus:t.focus,bottomRight:t.bottomRight,chat:t.chat,toast:t.toast})]})}function K({conn:e,lastTick:r,connError:t,chat:n}){let s=t?c(o,{color:"red",children:["\u25CF ",t]}):r===0?a(o,{color:"yellow",children:"\u25CF connecting\u2026"}):a(o,{color:"green",children:"\u25CF live"}),u=n.active?c(o,{color:"green",bold:!0,children:["CHAT @",n.agentId]}):a(o,{bold:!0,children:"agentx tui"});return c(i,{paddingX:1,justifyContent:"space-between",children:[a(i,{children:u}),a(o,{dimColor:!0,children:e.baseUrl}),a(i,{children:s})]})}function Q({focus:e,bottomRight:r,chat:t,toast:n}){let s=t.active?["[Enter] send","[Esc] exit chat","[Ctrl-L] new session"]:[`[Tab/a/p/e] focus (now: ${e})`,e==="agents"?"[Enter] chat":null,e==="processes"?"[k] kill":null,`[c] ${r==="crons"?"\u2192channels":"\u2192crons"}`,"[\u2191/\u2193] move","[q] quit"].filter(Boolean);return c(i,{paddingX:1,borderStyle:"single",borderTop:!0,borderBottom:!1,borderLeft:!1,borderRight:!1,justifyContent:"space-between",children:[a(o,{dimColor:!0,children:s.join(" \xB7 ")}),n?a(o,{color:n.color,children:n.text}):a(o,{children:" "})]})}function v({title:e,focused:r,children:t}){return c(i,{flexDirection:"column",width:"100%",borderStyle:r?"double":"single",borderColor:r?"cyan":void 0,paddingX:1,children:[c(o,{bold:!0,color:r?"cyan":"white",children:[e,r?" \u25CF":""]}),a(i,{flexDirection:"column",marginTop:1,children:t})]})}function I(e,r){return e&&r?{inverse:!0}:{}}function Z({rows:e,cursor:r,focused:t,talkingTo:n}){return e.length===0?a(o,{dimColor:!0,children:"no agents"}):a(i,{flexDirection:"column",children:e.slice(0,12).map((s,u)=>{let p=I(t,u===r),y=s.errors>0?"red":s.active>0?"yellow":"green",f=s.id===n;return c(i,{children:[a(o,{...p,color:y,children:"\u25CF"}),c(o,{...p,children:[" ",T(s.name,14)]}),c(o,{...p,children:[T(s.tier,6)," "]}),c(o,{...p,children:[s.active,"/",s.total]}),s.errors>0?c(o,{...p,color:"red",children:[" err=",s.errors]}):null,f?a(o,{color:"green",children:" \u2194 chatting"}):null]},s.id)})})}function ee({rows:e,cursor:r,focused:t}){if(e.length===0)return a(o,{dimColor:!0,children:"no live processes"});let n=Date.now();return a(i,{flexDirection:"column",children:e.slice(0,12).map((s,u)=>{let p=I(t,u===r),y=Math.max(0,Math.round((n-(s.lastTurnAt||s.spawnedAt))/1e3)),f=s.state==="dead"?"red":s.state==="warm-hot"?"green":"yellow";return c(i,{children:[a(o,{...p,color:f,children:T(s.state,10)}),a(o,{...p,children:T(s.key.agentId,12)}),a(o,{...p,children:T(s.key.channel,10)}),c(o,{...p,children:[s.turnCount,"t ",y,"s"]})]},`${s.key.agentId}-${s.key.channel}-${s.key.chatId}-${u}`)})})}function te({rows:e}){return e.length===0?a(o,{dimColor:!0,children:"no crons"}):a(i,{flexDirection:"column",children:e.slice(0,12).map(r=>{let t=r.enabled?r.consecutiveErrors>0?a(o,{color:"red",children:"err"}):a(o,{color:"green",children:"ok"}):a(o,{dimColor:!0,children:"off"}),n=r.nextRun?new Date(r.nextRun).toLocaleTimeString():"\u2014";return c(i,{children:[a(o,{children:T(r.id,16)}),a(o,{dimColor:!0,children:T(r.schedule,12)}),a(o,{children:T(n,10)}),a(i,{children:t})]},r.id)})})}function re({rows:e}){if(e.length===0)return a(o,{dimColor:!0,children:"(waiting for channel events\u2026)"});let r=[...e].sort((t,n)=>n.lastAt-t.lastAt);return a(i,{flexDirection:"column",children:r.slice(0,12).map(t=>c(i,{children:[a(o,{children:T(t.channel,12)}),c(o,{color:"cyan",children:["\u2190",T(String(t.inbound),4)]}),c(o,{color:"magenta",children:["\u2192",T(String(t.outbound),4)]}),a(o,{dimColor:!0,children:t.lastPreview})]},t.channel))})}function ne({rows:e,cursor:r,focused:t}){return e.length===0?a(o,{dimColor:!0,children:"(waiting for events\u2026)"}):a(i,{flexDirection:"column",children:e.slice(0,18).map((n,s)=>{let u=I(t,s===r);return c(i,{children:[a(o,{...u,dimColor:!0,children:new Date(n.at).toLocaleTimeString().padEnd(10)}),a(o,{...u,color:ce(n.kind),children:T(n.kind,8)}),a(o,{...u,children:n.line})]},`${n.at}-${s}`)})})}function oe({chat:e,suggest:r,agents:t}){let n=e.history.slice(-14),s=t.find(f=>f.id===e.agentId),u=H(s?.tier??"",s?.model),p=e.status==="sending"?[...e.history].reverse().find(f=>f.role==="agent"&&f.streaming):void 0,y=e.status==="sending"?a(O,{startedAt:p?.at??Date.now(),phase:p?.text?"responding":"thinking",indent:""}):e.error?c(o,{color:"red",children:["\u25CF ",e.error]}):a(o,{dimColor:!0,children:"\u25CF ready"});return c(i,{flexDirection:"column",width:"50%",borderStyle:"double",borderColor:"green",paddingX:1,children:[c(i,{justifyContent:"space-between",children:[c(o,{bold:!0,color:"green",children:["CHAT \xB7 @",e.agentId]}),a(i,{children:y})]}),c(o,{children:[c(o,{color:u.color,bold:!0,children:[u.glyph," ",u.label]}),s?.model?c(o,{dimColor:!0,children:[" ",j(s.model)]}):null,c(o,{dimColor:!0,children:[" \xB7 ",e.chatId]})]}),a(i,{flexDirection:"column",flexGrow:1,marginTop:1,children:n.length===0?a(o,{dimColor:!0,children:"(type a message and press Enter \u2014 Esc exits, Ctrl-L starts fresh)"}):n.map((f,l)=>a(se,{turn:f,agentId:e.agentId},`${f.at}-${l}`))}),r?c(o,{dimColor:!0,children:[a(o,{color:"cyan",children:"\u21B9"})," ",r.items.slice(0,5).map((f,l)=>l===0?a(o,{color:"cyan",children:f},l):c(o,{children:[" ",f]},l))]}):null,c(i,{children:[a(o,{color:"cyan",children:"you \u203A "}),a(o,{children:e.text}),a(o,{inverse:!0,children:" "})]})]})}function se({turn:e,agentId:r}){if(e.role==="you")return c(i,{flexDirection:"column",marginBottom:1,children:[a(o,{color:"cyan",children:"you"}),e.text.split(`
|
|
5
5
|
`).map((s,u)=>c(o,{children:[" ",s]},u))]});if(e.role==="error")return c(i,{flexDirection:"column",marginBottom:1,children:[a(o,{color:"red",children:"error"}),c(o,{color:"red",children:[" ",e.text]})]});let t=e.elapsedMs!=null?` \xB7 ${(e.elapsedMs/1e3).toFixed(1)}s${e.outTokens!=null?`, ${e.outTokens} tok`:""}`:e.streaming?" \xB7 \u2026":"",n=F(e.text,58,{balance:e.streaming});return c(i,{flexDirection:"column",marginBottom:1,children:[c(o,{color:"green",children:["@",r??"agent",a(o,{dimColor:!0,children:t})]}),e.thinking?e.thinking.split(`
|
|
6
6
|
`).filter(s=>s.trim()).slice(-2).map((s,u)=>c(o,{dimColor:!0,italic:!0,children:[" ",s]},`th${u}`)):null,(e.tools??[]).map((s,u)=>c(o,{color:s.error?"red":"green",children:[" \u25CF ",c(o,{bold:!s.error,dimColor:s.error,children:[s.name,s.arg?c(o,{dimColor:!0,children:["(",s.arg,")"]}):null,s.error?" failed":""]})]},`tool${u}`)),n.split(`
|
|
7
7
|
`).slice(0,14).map((s,u)=>c(o,{children:[" ",s]},u))]})}function ae(e){let r=e.data??{},t=typeof r.at=="string"||typeof r.at=="number"?new Date(r.at).getTime():Date.now(),n="";switch(e.event){case"run":n=`${r.phase??""} ${r.workflowId??""} ${(r.runId??"").slice(0,8)} ${r.nodeId??""}`.trim();break;case"task":n=`${r.phase??""} ${r.workflowId??""} ${Array.isArray(r.assignedTo)?r.assignedTo.join(","):""} ${r.title?`"${r.title}"`:""}`.trim();break;case"signal":n=`${r.name??""} (${r.scope??""}) ${r.workflowId??""}`.trim();break;case"mesh":n=`${r.peer??""} ${r.healthy?"healthy":"lost"} ${r.delta??""}`.trim();break;case"channel":{n=`${r.direction==="in"?"\u2190":"\u2192"} ${r.channel??""}:${r.chatId??""} ${r.textPreview??""}`.trim();break}case"status":n=`node=${r.node??""} agents=${r.agents??0} active=${(r.active??[]).length}`;break;default:n=typeof r=="string"?r:JSON.stringify(r).slice(0,80)}return{at:Number.isFinite(t)?t:Date.now(),kind:e.event,line:n}}function ce(e){switch(e){case"run":return"cyan";case"task":return"magenta";case"signal":return"green";case"mesh":return"blue";case"channel":return"yellow";default:return"white"}}function T(e,r){let t=(e??"").toString();return t.length>=r?t.slice(0,r-1)+" ":t+" ".repeat(r-t.length)}export{be as App};
|
|
8
|
-
//# sourceMappingURL=App-
|
|
8
|
+
//# sourceMappingURL=App-56QIEQGH.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{a as Y,b as Z,c as _,d as ee,e as te,f as ne,g as re}from"./chunk-U2CKL755.js";import{b as Q,g as X}from"./chunk-
|
|
1
|
+
import{a as Y,b as Z,c as _,d as ee,e as te,f as ne,g as re}from"./chunk-U2CKL755.js";import{b as Q,g as X}from"./chunk-FOTAGQEL.js";import"./chunk-NGGEGY5K.js";import"./chunk-VJ5HC63R.js";import"./chunk-UEEB3UTU.js";import"./chunk-GZIHLADX.js";import"./chunk-QIJLFPWE.js";import{useCallback as oe,useMemo as H,useRef as P,useState as k}from"react";import{Box as g,Text as t,useApp as he,useInput as xe,useStdout as Te}from"ink";import{randomUUID as se}from"crypto";var m={accent:"cyan",agent:"green",working:"magenta",error:"red",muted:"gray"},q="\u25C7 agentx",F="\u258C";import{jsx as c,jsxs as o}from"react/jsx-runtime";var ie="/help /agent <id> /agents /clear /who /exit",be=[{cmd:"/agent",desc:"switch the target agent (/agent <id>)"},{cmd:"/agents",desc:"list registered agents"},{cmd:"/clear",desc:"start a fresh session"},{cmd:"/who",desc:"show agent + chat id"},{cmd:"/help",desc:"list commands"},{cmd:"/exit",desc:"quit the chat"}];function Pe({conn:n,agentId:p,channel:f,chatId:a,agents:h}){let{exit:w}=he(),{stdout:O}=Te(),V=Math.max(40,Math.min((O?.columns||80)-4,100)),[z,U]=k([]),[$,S]=k(null),[T,le]=k(p),[A,ae]=k(h),[E,ue]=k(a),[y,x]=k(""),[J,de]=k(""),W=P([]),u=P(-1),M=P(null),R=P(null),v=$?.live??!1,j=H(()=>Z(y,A.map(s=>s.id),process.cwd()),[y,A]),N=H(()=>{let s=/^\/(\w*)$/.exec(y);if(!s)return null;let e=be.filter(r=>r.cmd.slice(1).startsWith(s[1].toLowerCase()));return e.length?e:null},[y]),b=s=>de(s),K=oe(s=>{let e=se().slice(0,8),r=Date.now(),i=new AbortController;R.current=i;let d={id:e,you:s,agentId:T,segs:[],live:!0,startedAt:r};S({...d});let L=()=>S({...d,segs:d.segs.map(C=>({...C}))});(async()=>{try{let C=await X(n,T,s,{channel:f,chatId:E,signal:i.signal,onText:l=>{let I=d.segs[d.segs.length-1];I&&I.type==="text"?I.content=(I.content??"")+l:d.segs.push({type:"text",content:l}),L()},onThinking:l=>{d.thinking=(d.thinking??"")+l,L()},onTool:l=>{l.status==="start"&&l.name?(d.segs.push({type:"tool",name:l.name,arg:l.arg}),L()):l.status==="result"&&l.error&&(d.segs.push({type:"tool",name:l.name??"tool",error:!0}),L())}});U(l=>[...l,{...d,live:!1,elapsedMs:Date.now()-r,outTokens:C.usage?.outputTokens,error:C.error}]),S(null)}catch(C){let l=i.signal.aborted||C?.name==="AbortError";U(I=>[...I,{...d,live:!1,elapsedMs:Date.now()-r,interrupted:l,error:l?void 0:C?.message||String(C)}]),S(null)}finally{R.current===i&&(R.current=null)}})()},[n,T,f,E]),me=oe(s=>{let e=s.trim();if(e){if(W.current.push(e),u.current=-1,e==="/exit"||e==="/quit"){w();return}if(e==="/help"){b(ie);return}if(e==="/who"){b(`@${T} \xB7 chatId=${E} \xB7 channel=${f}`);return}if(e==="/clear"){let r=`chat-cli:${se().slice(0,12)}`;ue(r),U([]),b(`fresh chatId=${r} (warm process dropped)`);return}if(e==="/agents"){Q(n).then(r=>{ae(r),b(r.map(i=>i.id===T?`[${i.id}]`:i.id).join(" "))}).catch(r=>b(`failed to list agents: ${r?.message||r}`));return}if(e.startsWith("/agent ")){let r=e.slice(7).replace(/^@/,"").trim();if(!r){b("usage: /agent <id>");return}if(!A.find(i=>i.id===r)){b(`unknown agent: @${r}`);return}le(r),b(`now talking to @${r}`);return}if(e.startsWith("/")){b(`unknown command \xB7 ${ie}`);return}K(e)}},[n,T,A,f,E,w,K]);xe((s,e)=>{if(e.ctrl&&s==="c"){w();return}if(e.escape){if(v&&R.current){R.current.abort();return}w();return}if(e.tab){if(N){x(N[0].cmd+" ");return}let i=_(y,M,A.map(d=>d.id),process.cwd());i!==null&&(x(i),u.current=-1);return}if(e.upArrow){let i=W.current;if(!i.length)return;u.current=u.current<0?i.length-1:Math.max(0,u.current-1),x(i[u.current]??"");return}if(e.downArrow){let i=W.current;if(u.current<0)return;if(u.current=u.current+1,u.current>=i.length){u.current=-1,x("");return}x(i[u.current]??"");return}if(e.backspace||e.delete){M.current=null,x(i=>i.slice(0,-1));return}if(e.ctrl||e.meta)return;let r=ee(s??"",e.return,y);switch(r.kind){case"paste":M.current=null,x(i=>i+r.text),u.current=-1;return;case"type":M.current=null,x(i=>i+r.text),u.current=-1;return;case"continue":x(r.buffer);return;case"submit":if(v)return;M.current=null,x(""),me(r.text);return;case"none":return}});let G=v?m.working:m.accent,ge=y.length?y.split(`
|
|
2
2
|
`):[""],B=A.find(s=>s.id===T),D=ne(B?.tier??"",B?.model),pe=O?.rows||24,fe=z.slice(-40);return o(g,{flexDirection:"column",height:pe,children:[o(g,{flexDirection:"column",flexGrow:1,justifyContent:"flex-end",overflow:"hidden",children:[z.length===0&&!$?o(g,{flexDirection:"column",children:[o(t,{children:[c(t,{color:m.accent,bold:!0,children:q}),c(t,{dimColor:!0,children:" \u2014 chat with "}),o(t,{color:m.accent,children:["@",T]}),c(t,{dimColor:!0,children:" via "}),o(t,{color:D.color,bold:!0,children:[D.glyph," ",D.label]}),B?.model?o(t,{dimColor:!0,children:[" (",B.model,")"]}):null]}),c(t,{dimColor:!0,children:"streaming \xB7 markdown \xB7 tools \xB7 type a message, or / for commands"})]}):null,fe.map(s=>c(ce,{turn:s,width:V},s.id)),$?c(ce,{turn:$,width:V}):null]}),N?c(g,{flexDirection:"column",marginTop:1,children:N.map((s,e)=>o(g,{children:[c(t,{color:e===0?m.accent:m.muted,bold:e===0,children:s.cmd.padEnd(10)}),c(t,{dimColor:!0,children:s.desc})]},s.cmd))}):j?o(g,{marginTop:1,children:[c(t,{color:m.accent,children:"\u21B9 "}),j.items.map((s,e)=>o(t,{color:e===0?m.accent:m.muted,children:[s,e<j.items.length-1?" ":""]},e))]}):J?c(g,{marginTop:1,children:c(t,{dimColor:!0,children:J})}):null,c(g,{borderStyle:"single",borderColor:G,borderLeft:!1,borderRight:!1,borderDimColor:!v,width:"100%",children:c(g,{flexDirection:"column",width:"100%",children:ge.map((s,e,r)=>o(g,{children:[c(t,{color:G,bold:!0,children:e===0?"\u203A ":" "}),c(t,{children:s}),e===r.length-1&&!v?c(t,{color:G,children:"\u258F"}):null]},e))})}),o(g,{justifyContent:"space-between",children:[o(t,{children:[c(t,{color:m.accent,bold:!0,children:q}),o(t,{dimColor:!0,children:[" \xB7 @",T," \xB7 "]}),o(t,{color:D.color,bold:!0,children:[D.glyph," ",D.label]}),B?.model?o(t,{dimColor:!0,children:[" ",re(B.model)]}):null]}),o(t,{dimColor:!0,children:["\u21B5 send / cmds @ mention esc ",v?"stop":"exit"]})]})]})}function ce({turn:n,width:p}){let f=H(()=>ye(n,p),[n,p]),a=n.segs.some(h=>h.type==="text"&&h.content);return o(g,{flexDirection:"column",marginBottom:1,children:[o(t,{color:m.accent,bold:!0,children:[F," you"]}),n.you.split(`
|
|
3
3
|
`).map((h,w)=>o(t,{color:"white",children:[" ",h]},`u${w}`)),o(t,{color:m.agent,bold:!0,children:[F," ",n.agentId??"agent"]}),n.thinking?c(g,{flexDirection:"column",children:we(n.thinking,n.live?3:2).map((h,w)=>o(t,{dimColor:!0,italic:!0,children:[" ",h]},`th${w}`))}):null,f,n.live?c(te,{startedAt:n.startedAt,phase:a?"responding":"thinking",hint:"esc to interrupt"}):n.interrupted?o(t,{dimColor:!0,children:[" \u2298 interrupted \xB7 ",(n.elapsedMs/1e3).toFixed(1),"s"]}):n.error?o(t,{color:"red",children:[" \u2717 ",n.error]}):n.elapsedMs!=null?o(t,{dimColor:!0,children:[" \xB7 ",(n.elapsedMs/1e3).toFixed(1),"s",n.outTokens!=null?`, ${n.outTokens} tok`:""]}):null]})}function we(n,p){return n.split(`
|
|
4
4
|
`).filter(a=>a.trim()).slice(-p)}function ye(n,p){let f=[];return n.segs.forEach((a,h)=>{a.type==="tool"?f.push(o(t,{color:a.error?"red":"green",children:[" ","\u25CF ",o(t,{bold:!a.error,dimColor:a.error,children:[a.name,a.arg?o(t,{dimColor:!0,children:["(",a.arg,")"]}):null,a.error?" failed":""]})]},h)):a.content&&f.push(c(t,{children:Ce(Y(a.content,p,{balance:n.live}))},h))}),f}function Ce(n){return n.split(`
|
|
5
5
|
`).map(p=>p.length?" "+p:p).join(`
|
|
6
6
|
`)}export{Pe as ChatApp};
|
|
7
|
-
//# sourceMappingURL=ChatApp-
|
|
7
|
+
//# sourceMappingURL=ChatApp-JNWIXMDN.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=absorb-eval-
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o}from"./chunk-KE3KLMMK.js";import"./chunk-35I76HQS.js";import"./chunk-GALI5ANI.js";import"./chunk-JTFCU5LH.js";import"./chunk-WVPFWUR2.js";import"./chunk-WPNRDEHW.js";import"./chunk-LUOW2YHY.js";import"./chunk-4LWFJ4MZ.js";import"./chunk-BIJHMWXK.js";import"./chunk-ES236GV6.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-QUFIUXMQ.js";import"./chunk-BERWTVG2.js";import"./chunk-QOYAX2FT.js";import"./chunk-DCIYOPJF.js";import"./chunk-7I7IEX4S.js";import"./chunk-NGGEGY5K.js";import"./chunk-VJ5HC63R.js";import"./chunk-UEEB3UTU.js";import"./chunk-GZIHLADX.js";import"./chunk-RGDKHYY2.js";import"./chunk-QIJLFPWE.js";export{i as JUDGE_ENTRY_CHARS,e as WEAK_CITATION,j as buildJudgePrompt,l as buildScorecard,f as checkArticle,n as envelopeUsage,h as findDuplicates,k as parseJudgeReply,b as pickSample,m as renderScorecard,a as seededRandom,o as summariseRuns,d as termOverlap,c as terms,g as uncitedWithFacts};
|
|
2
|
+
//# sourceMappingURL=absorb-eval-BYYFZJCC.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as m,b as d,c as g,d as f,e as h,i as b,j as y}from"./chunk-
|
|
1
|
+
import{a as m,b as d,c as g,d as f,e as h,i as b,j as y}from"./chunk-AQGQLVCD.js";import"./chunk-NGGEGY5K.js";import"./chunk-VJ5HC63R.js";import"./chunk-UEEB3UTU.js";import"./chunk-GZIHLADX.js";import"./chunk-QIJLFPWE.js";import{ImapFlow as P}from"imapflow";import M from"postal-mime";var w=8e3;async function x(n){let e=await M.parse(n),t=e.from&&"address"in e.from?e.from:void 0,r=t?.address?.trim().toLowerCase();if(!r)return null;let i=l=>e.headers.find(u=>u.key===l)?.value??"",s=p(e.references??"");if(e.inReplyTo)for(let l of p(e.inReplyTo))s.includes(l)||s.push(l);let a=i("auto-submitted").toLowerCase(),c=i("precedence").toLowerCase(),o=C(e.text??N(e.html??""));return{from:r,fromName:t?.name||void 0,subject:(e.subject??"").trim(),messageId:e.messageId?p(e.messageId)[0]:void 0,references:s,text:o.length>w?`${o.slice(0,w)}
|
|
2
2
|
[\u2026 the rest of the mail was cut]`:o,automatic:a!==""&&a!=="no"||["bulk","junk","list","auto_reply"].includes(c)||i("list-id")!==""||/^(mailer-daemon|postmaster|no-?reply)@/.test(r)}}function p(n){return n.match(/<[^<>\s]+>/g)??[]}function C(n){let e=n.replace(/\r\n/g,`
|
|
3
3
|
`).split(`
|
|
4
4
|
`),t=[];for(let r=0;r<e.length;r++){let i=e[r];if(/^On .{4,200}wrote:\s*$/.test(i)||/^On .{4,200}$/.test(i)&&/wrote:\s*$/.test(e[r+1]??"")||/^-{2,}\s*Original Message\s*-{2,}/i.test(i))break;/^>/.test(i)||t.push(i)}return t.join(`
|
|
@@ -9,4 +9,4 @@ import{a as m,b as d,c as g,d as f,e as h,i as b,j as y}from"./chunk-OJ2XT27M.js
|
|
|
9
9
|
Subject: ${n.subject||"(none)"}
|
|
10
10
|
|
|
11
11
|
${n.text||"(no text)"}`}var A=class{constructor(e,t=()=>{}){this.opts=e;this.log=t}name="email";handler=null;timers=[];polling=new Set;failures=new Map;onMessage(e){this.handler=e}async start(){for(let[e,t]of Object.entries(this.opts.accounts)){this.poll(e);let r=setInterval(()=>{this.poll(e)},t.pollSeconds*1e3);r.unref?.(),this.timers.push(r)}}async stop(){for(let e of this.timers)clearInterval(e);this.timers=[]}health(){let e=[...this.failures];return e.length?{up:!1,reason:e.map(([t,r])=>`${t}: ${r}`).join("; ")}:{up:!0}}async poll(e){let t=this.opts.accounts[e];if(!t||this.polling.has(e))return 0;this.polling.add(e);let r=0;try{r=await this.pollAccount(e,t),this.failures.delete(e)}catch(i){let s=String(i?.message??i).slice(0,200);this.failures.get(e)!==s&&this.log(`[email] ${e}: ${s}`),this.failures.set(e,s)}finally{this.polling.delete(e)}return r}client(e){if(this.opts.imapClient)return this.opts.imapClient(e);let{imap:t}=b(e);return new P({host:t.host,port:t.port,secure:t.secure,auth:{user:t.user,pass:t.password},logger:!1})}async pollAccount(e,t){let r=this.client(t),i=[],s=g(this.opts.root,e);await r.connect();try{let c=await r.getMailboxLock(t.mailbox);try{let o=r.mailbox;if(!o)throw new Error(`cannot open ${t.mailbox}`);let l=String(o.uidValidity);if(!s||s.uidValidity!==l)return f(this.opts.root,e,{uidValidity:l,lastUid:o.uidNext-1}),0;if(o.uidNext-1>s.lastUid)for await(let u of r.fetch(`${s.lastUid+1}:*`,{uid:!0,source:!0},{uid:!0}))u.uid>s.lastUid&&u.source&&i.push({uid:u.uid,source:u.source})}finally{c.release()}}finally{await r.logout().catch(()=>r.close())}let a=0;for(let{uid:c,source:o}of i.sort((l,u)=>l.uid-u.uid))await this.handle(e,t,c,o)&&a++,s={uidValidity:s.uidValidity,lastUid:c},f(this.opts.root,e,s);return a}async handle(e,t,r,i){let s=await x(i).catch(()=>null);return s?s.from===t.address.toLowerCase()?!1:s.automatic?(this.log(`[email] ${e}: automatic mail from ${s.from} skipped`),!1):v(s.from,t.allowFrom)?(d(this.opts.root,$(e,s,m(this.opts.root,s.from))),this.handler?(await this.handler({id:s.messageId??`${e}:${r}`,channel:"email",accountId:e,sender:{id:s.from,name:s.fromName||s.from,username:s.from},text:T(s),timestamp:new Date,resolvedAgent:t.agent,channelMeta:{channel:"email",facts:[`This is an email to ${t.address}. Your reply is sent as an email${t.send==="auto"?"":" once the owner approves it"}.`]}}),!0):!1):(this.log(`[email] ${e}: ${s.from} is not in allowFrom, dropped`),!1):(this.log(`[email] ${e}: mail ${r} has no sender, skipped`),!1)}async send(e){let t=m(this.opts.root,e.chatId);if(!t)throw new Error(`no email from ${e.chatId} to reply to`);let r=this.opts.accounts[t.account];if(!r)throw new Error(`email account "${t.account}" is not set up`);let i=j(t),s=e.agentId??r.agent;if(r.send==="auto")return y(r,r.name||this.opts.agentName?.(s)||s,{to:t.to,toName:t.toName,subject:i.subject,inReplyTo:i.inReplyTo,references:i.references,text:e.text});let a=h(this.opts.root,{agent:s,account:t.account,to:t.to,to_name:t.toName,subject:i.subject,in_reply_to:i.inReplyTo,references:i.references,text:e.text});return this.log(`[email] reply to ${t.to} waits for approval: email:${a.id}`),this.opts.onDraft?.(a),`draft:${a.id}`}};export{A as EmailAdapter};
|
|
12
|
-
//# sourceMappingURL=adapter-
|
|
12
|
+
//# sourceMappingURL=adapter-YQ37MDPV.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{A as a,B as b,C as c}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=agent-
|
|
1
|
+
import{A as a,B as b,C as c}from"./chunk-I7EO2WXC.js";import"./chunk-SFQUP3BP.js";import"./chunk-QOYAX2FT.js";import"./chunk-DCIYOPJF.js";import"./chunk-7I7IEX4S.js";import"./chunk-JHCI6XCJ.js";import"./chunk-DSYKYZMT.js";import"./chunk-QIJLFPWE.js";export{a as createAgentContext,b as generate,c as generateStream};
|
|
2
|
+
//# sourceMappingURL=agent-4637FJMD.js.map
|