agentix-cli 0.218.0 → 0.219.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 (148) hide show
  1. package/README.md +87 -207
  2. package/dist/{App-2IEK5HWX.js → App-ET75JEWK.js} +2 -2
  3. package/dist/{ChatApp-YHC7ASGR.js → ChatApp-F2NT5M2O.js} +2 -2
  4. package/dist/{absorb-eval-GJ47IOFG.js → absorb-eval-EA5ESP4Y.js} +2 -2
  5. package/dist/{adapter-WROHSAHE.js → adapter-7PKOKXO5.js} +2 -2
  6. package/dist/{agent-5MYO4YCO.js → agent-SDNU6MUI.js} +2 -2
  7. package/dist/{board-dashboard-3CSSUGNZ.js → board-dashboard-PI22IXZN.js} +5 -5
  8. package/dist/{board-dashboard-3CSSUGNZ.js.map → board-dashboard-PI22IXZN.js.map} +1 -1
  9. package/dist/{chunk-CHCAPQ6E.js → chunk-34TEBXFP.js} +2 -2
  10. package/dist/{chunk-MSOAI54R.js → chunk-3XUAIA7U.js} +2 -2
  11. package/dist/{chunk-QEGBOPAP.js → chunk-5OEW46QP.js} +2 -2
  12. package/dist/{chunk-HCQX6LVZ.js → chunk-6HCCMU57.js} +2 -2
  13. package/dist/{chunk-EVFQINOQ.js → chunk-6X7SABYJ.js} +2 -2
  14. package/dist/{chunk-GP56ZRAF.js → chunk-7ATCEK7R.js} +2 -2
  15. package/dist/{chunk-B7WQT7GG.js → chunk-CR37IINZ.js} +2 -2
  16. package/dist/{chunk-K5VZS747.js → chunk-DGCYSQAZ.js} +2 -2
  17. package/dist/{chunk-GMQLDXEM.js → chunk-EPOQUX4G.js} +2 -2
  18. package/dist/{chunk-WZIFXZZX.js → chunk-EWXY73XA.js} +2 -2
  19. package/dist/{chunk-JE2EV6NS.js → chunk-EZDHAX4Z.js} +31 -30
  20. package/dist/chunk-EZDHAX4Z.js.map +1 -0
  21. package/dist/{chunk-NJLWS44P.js → chunk-GPX4LDAX.js} +2 -2
  22. package/dist/{chunk-ETMUGFPI.js → chunk-HHSPOS7O.js} +2 -2
  23. package/dist/{chunk-B5JK4MQX.js → chunk-IIJB3OPV.js} +2 -2
  24. package/dist/{chunk-NLMQ7ZAE.js → chunk-IKOJM4GM.js} +2 -2
  25. package/dist/{chunk-IATCZJP7.js → chunk-IQNKEUEL.js} +2 -2
  26. package/dist/{chunk-QAMVAZ67.js → chunk-KCS737RC.js} +2 -2
  27. package/dist/{chunk-D3HNIOZ7.js → chunk-MELXJ5AR.js} +2 -2
  28. package/dist/{chunk-FJJ5PVQK.js → chunk-MUCWUVOW.js} +5 -5
  29. package/dist/{chunk-AKPLNPUY.js → chunk-PTVDVI2U.js} +2 -2
  30. package/dist/{chunk-2REJBHT5.js → chunk-SQJ3IHNL.js} +2 -2
  31. package/dist/{chunk-ZXABOPXF.js → chunk-TCBIAKGS.js} +2 -2
  32. package/dist/chunk-U4AUJ6XI.js +39 -0
  33. package/dist/chunk-U4AUJ6XI.js.map +1 -0
  34. package/dist/{chunk-M75VNIVM.js → chunk-UYDC2YMH.js} +2 -2
  35. package/dist/{chunk-YG5GPPGI.js → chunk-V75JESS5.js} +3 -3
  36. package/dist/{chunk-VFG7GZC6.js → chunk-W2KIJ5LL.js} +2 -2
  37. package/dist/{chunk-PJ2OFOAL.js → chunk-XTXFA5EJ.js} +2 -2
  38. package/dist/{chunk-X23I2U26.js → chunk-Y3TXTZYG.js} +2 -2
  39. package/dist/{chunk-QW5WOBSU.js → chunk-YMMGY7GR.js} +2 -2
  40. package/dist/{chunk-FSEJ2LX5.js → chunk-Z3FJRBTG.js} +337 -336
  41. package/dist/chunk-Z3FJRBTG.js.map +1 -0
  42. package/dist/{chunk-OQEP2Q32.js → chunk-ZT4FCL5B.js} +2 -2
  43. package/dist/cli.js +1 -1
  44. package/dist/{client-2TJ3TOCH.js → client-7PLIDORM.js} +2 -2
  45. package/dist/{config-JHSM6KFT.js → config-3R4EGNUG.js} +2 -2
  46. package/dist/{config-mutate-YERBKGAB.js → config-mutate-3PGEBKJ6.js} +2 -2
  47. package/dist/{config-mutator-WNNU4EDV.js → config-mutator-LQQOOUZR.js} +2 -2
  48. package/dist/{contributions-HAWUHQWM.js → contributions-D4O76KGX.js} +2 -2
  49. package/dist/{doctor-GOMB6LDS.js → doctor-QM4KUMQJ.js} +2 -2
  50. package/dist/{follow-up-tool-5YFJS2JZ.js → follow-up-tool-X3YPYSP2.js} +2 -2
  51. package/dist/{hub-3M4HJMYR.js → hub-PBJHXL2G.js} +2 -2
  52. package/dist/index.d.ts +48 -0
  53. package/dist/index.js +1 -1
  54. package/dist/{org-tool-JS4WKB35.js → org-tool-37GNUUAD.js} +2 -2
  55. package/dist/{program-OFMRVB7N.js → program-243AGBJJ.js} +26 -26
  56. package/dist/program-243AGBJJ.js.map +1 -0
  57. package/dist/{promote-BME3QLM6.js → promote-CFI4HJDJ.js} +2 -2
  58. package/dist/{query-BFZDI667.js → query-J6S3GWPY.js} +2 -2
  59. package/dist/{query-settings-ICYJNA6H.js → query-settings-2NKI7UFN.js} +2 -2
  60. package/dist/{registry-NUO4JEA5.js → registry-R2QIR6GI.js} +2 -2
  61. package/dist/{request-planner-CUAEVQKB.js → request-planner-NKGUSV4N.js} +2 -2
  62. package/dist/{review-candidates-PGF3IRZR.js → review-candidates-43HXKXWD.js} +2 -2
  63. package/dist/{routing-CXGJMM55.js → routing-72F2DJTV.js} +2 -2
  64. package/dist/{schedule-tool-G3RBORJS.js → schedule-tool-V3KMSJHK.js} +2 -2
  65. package/dist/{scheduler-FKCNMUB7.js → scheduler-ZBTMOE3T.js} +2 -2
  66. package/dist/{seat-6TUUPDR6.js → seat-GYYH2IW5.js} +2 -2
  67. package/dist/{select-ARQMXFFV.js → select-JNVP4P5N.js} +2 -2
  68. package/dist/{set-enabled-CYS6NYKQ.js → set-enabled-U26A4RMI.js} +2 -2
  69. package/dist/{sprint-tool-5RNJZDQJ.js → sprint-tool-YCDVAF2Y.js} +2 -2
  70. package/dist/{tool-CHHSFKU2.js → tool-CF7OTKDV.js} +2 -2
  71. package/dist/tool-GHQ2FM4T.js +10 -0
  72. package/dist/tool-GHQ2FM4T.js.map +1 -0
  73. package/dist/{tool-YQFTOJJL.js → tool-JEHJS2SA.js} +2 -2
  74. package/dist/tool-K3RAEZKE.js +2 -0
  75. package/dist/{tool-KY7WN3HV.js → tool-MB3IYEP7.js} +2 -2
  76. package/dist/{wiki-RJKQ6ZLV.js → wiki-6UFGH2OO.js} +2 -2
  77. package/dist/wiki-enrich-7LMT3CFV.js +2 -0
  78. package/package.json +2 -2
  79. package/dist/chunk-FSEJ2LX5.js.map +0 -1
  80. package/dist/chunk-JE2EV6NS.js.map +0 -1
  81. package/dist/chunk-YB2QYUXG.js +0 -38
  82. package/dist/chunk-YB2QYUXG.js.map +0 -1
  83. package/dist/program-OFMRVB7N.js.map +0 -1
  84. package/dist/tool-243ZBIYG.js +0 -2
  85. package/dist/tool-JAVKPEKS.js +0 -10
  86. package/dist/tool-JAVKPEKS.js.map +0 -1
  87. package/dist/wiki-enrich-4ZKID3ZU.js +0 -2
  88. /package/dist/{App-2IEK5HWX.js.map → App-ET75JEWK.js.map} +0 -0
  89. /package/dist/{ChatApp-YHC7ASGR.js.map → ChatApp-F2NT5M2O.js.map} +0 -0
  90. /package/dist/{absorb-eval-GJ47IOFG.js.map → absorb-eval-EA5ESP4Y.js.map} +0 -0
  91. /package/dist/{adapter-WROHSAHE.js.map → adapter-7PKOKXO5.js.map} +0 -0
  92. /package/dist/{agent-5MYO4YCO.js.map → agent-SDNU6MUI.js.map} +0 -0
  93. /package/dist/{chunk-CHCAPQ6E.js.map → chunk-34TEBXFP.js.map} +0 -0
  94. /package/dist/{chunk-MSOAI54R.js.map → chunk-3XUAIA7U.js.map} +0 -0
  95. /package/dist/{chunk-QEGBOPAP.js.map → chunk-5OEW46QP.js.map} +0 -0
  96. /package/dist/{chunk-HCQX6LVZ.js.map → chunk-6HCCMU57.js.map} +0 -0
  97. /package/dist/{chunk-EVFQINOQ.js.map → chunk-6X7SABYJ.js.map} +0 -0
  98. /package/dist/{chunk-GP56ZRAF.js.map → chunk-7ATCEK7R.js.map} +0 -0
  99. /package/dist/{chunk-B7WQT7GG.js.map → chunk-CR37IINZ.js.map} +0 -0
  100. /package/dist/{chunk-K5VZS747.js.map → chunk-DGCYSQAZ.js.map} +0 -0
  101. /package/dist/{chunk-GMQLDXEM.js.map → chunk-EPOQUX4G.js.map} +0 -0
  102. /package/dist/{chunk-WZIFXZZX.js.map → chunk-EWXY73XA.js.map} +0 -0
  103. /package/dist/{chunk-NJLWS44P.js.map → chunk-GPX4LDAX.js.map} +0 -0
  104. /package/dist/{chunk-ETMUGFPI.js.map → chunk-HHSPOS7O.js.map} +0 -0
  105. /package/dist/{chunk-B5JK4MQX.js.map → chunk-IIJB3OPV.js.map} +0 -0
  106. /package/dist/{chunk-NLMQ7ZAE.js.map → chunk-IKOJM4GM.js.map} +0 -0
  107. /package/dist/{chunk-IATCZJP7.js.map → chunk-IQNKEUEL.js.map} +0 -0
  108. /package/dist/{chunk-QAMVAZ67.js.map → chunk-KCS737RC.js.map} +0 -0
  109. /package/dist/{chunk-D3HNIOZ7.js.map → chunk-MELXJ5AR.js.map} +0 -0
  110. /package/dist/{chunk-FJJ5PVQK.js.map → chunk-MUCWUVOW.js.map} +0 -0
  111. /package/dist/{chunk-AKPLNPUY.js.map → chunk-PTVDVI2U.js.map} +0 -0
  112. /package/dist/{chunk-2REJBHT5.js.map → chunk-SQJ3IHNL.js.map} +0 -0
  113. /package/dist/{chunk-ZXABOPXF.js.map → chunk-TCBIAKGS.js.map} +0 -0
  114. /package/dist/{chunk-M75VNIVM.js.map → chunk-UYDC2YMH.js.map} +0 -0
  115. /package/dist/{chunk-YG5GPPGI.js.map → chunk-V75JESS5.js.map} +0 -0
  116. /package/dist/{chunk-VFG7GZC6.js.map → chunk-W2KIJ5LL.js.map} +0 -0
  117. /package/dist/{chunk-PJ2OFOAL.js.map → chunk-XTXFA5EJ.js.map} +0 -0
  118. /package/dist/{chunk-X23I2U26.js.map → chunk-Y3TXTZYG.js.map} +0 -0
  119. /package/dist/{chunk-QW5WOBSU.js.map → chunk-YMMGY7GR.js.map} +0 -0
  120. /package/dist/{chunk-OQEP2Q32.js.map → chunk-ZT4FCL5B.js.map} +0 -0
  121. /package/dist/{client-2TJ3TOCH.js.map → client-7PLIDORM.js.map} +0 -0
  122. /package/dist/{config-JHSM6KFT.js.map → config-3R4EGNUG.js.map} +0 -0
  123. /package/dist/{config-mutate-YERBKGAB.js.map → config-mutate-3PGEBKJ6.js.map} +0 -0
  124. /package/dist/{config-mutator-WNNU4EDV.js.map → config-mutator-LQQOOUZR.js.map} +0 -0
  125. /package/dist/{contributions-HAWUHQWM.js.map → contributions-D4O76KGX.js.map} +0 -0
  126. /package/dist/{doctor-GOMB6LDS.js.map → doctor-QM4KUMQJ.js.map} +0 -0
  127. /package/dist/{follow-up-tool-5YFJS2JZ.js.map → follow-up-tool-X3YPYSP2.js.map} +0 -0
  128. /package/dist/{hub-3M4HJMYR.js.map → hub-PBJHXL2G.js.map} +0 -0
  129. /package/dist/{org-tool-JS4WKB35.js.map → org-tool-37GNUUAD.js.map} +0 -0
  130. /package/dist/{promote-BME3QLM6.js.map → promote-CFI4HJDJ.js.map} +0 -0
  131. /package/dist/{query-BFZDI667.js.map → query-J6S3GWPY.js.map} +0 -0
  132. /package/dist/{query-settings-ICYJNA6H.js.map → query-settings-2NKI7UFN.js.map} +0 -0
  133. /package/dist/{registry-NUO4JEA5.js.map → registry-R2QIR6GI.js.map} +0 -0
  134. /package/dist/{request-planner-CUAEVQKB.js.map → request-planner-NKGUSV4N.js.map} +0 -0
  135. /package/dist/{review-candidates-PGF3IRZR.js.map → review-candidates-43HXKXWD.js.map} +0 -0
  136. /package/dist/{routing-CXGJMM55.js.map → routing-72F2DJTV.js.map} +0 -0
  137. /package/dist/{schedule-tool-G3RBORJS.js.map → schedule-tool-V3KMSJHK.js.map} +0 -0
  138. /package/dist/{scheduler-FKCNMUB7.js.map → scheduler-ZBTMOE3T.js.map} +0 -0
  139. /package/dist/{seat-6TUUPDR6.js.map → seat-GYYH2IW5.js.map} +0 -0
  140. /package/dist/{select-ARQMXFFV.js.map → select-JNVP4P5N.js.map} +0 -0
  141. /package/dist/{set-enabled-CYS6NYKQ.js.map → set-enabled-U26A4RMI.js.map} +0 -0
  142. /package/dist/{sprint-tool-5RNJZDQJ.js.map → sprint-tool-YCDVAF2Y.js.map} +0 -0
  143. /package/dist/{tool-CHHSFKU2.js.map → tool-CF7OTKDV.js.map} +0 -0
  144. /package/dist/{tool-YQFTOJJL.js.map → tool-JEHJS2SA.js.map} +0 -0
  145. /package/dist/{tool-243ZBIYG.js.map → tool-K3RAEZKE.js.map} +0 -0
  146. /package/dist/{tool-KY7WN3HV.js.map → tool-MB3IYEP7.js.map} +0 -0
  147. /package/dist/{wiki-RJKQ6ZLV.js.map → wiki-6UFGH2OO.js.map} +0 -0
  148. /package/dist/{wiki-enrich-4ZKID3ZU.js.map → wiki-enrich-7LMT3CFV.js.map} +0 -0
package/README.md CHANGED
@@ -6,9 +6,7 @@
6
6
 
7
7
  # AgentX
8
8
 
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
-
11
- <a href="https://www.producthunt.com/products/agentx-4?embed=true&amp;utm_source=badge-featured&amp;utm_medium=badge&amp;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&amp;theme=light&amp;t=1790073592268" /></a>
9
+ **Put the coding agent you already use on call: it answers in chat and on issues, runs on a schedule, and asks you before anything that matters, on a machine you own.**
12
10
 
13
11
  [![npm](https://img.shields.io/npm/v/agentix-cli?label=npm%20%C2%B7%20agentix-cli)](https://www.npmjs.com/package/agentix-cli)
14
12
  [![CI](https://github.com/anis-marrouchi/agentx/actions/workflows/ci.yml/badge.svg)](https://github.com/anis-marrouchi/agentx/actions/workflows/ci.yml)
@@ -16,140 +14,111 @@
16
14
  [![Node](https://img.shields.io/badge/node-22.19%E2%80%9326-brightgreen)](package.json)
17
15
  [![Install matrix](https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fanis-marrouchi%2Fagentx%2Finstall-matrix-status%2Fbadge.json)](https://github.com/anis-marrouchi/agentx/actions/workflows/install-matrix.yml)
18
16
 
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)
17
+ [Why](#why-this-exists) · [See the demo](#see-it-without-an-account) · [What we measured](#what-we-measured) · [The jobs](#the-jobs-agentx-does) · [Install](#install) · [How it works](#how-it-works)
20
18
 
21
19
  </div>
22
20
 
21
+ Claude Code, Codex and OpenCode do real work, but only while you sit at the terminal. AgentX keeps them working when you are away:
22
+
23
23
  1. **Give each agent a job.** Answer clients, send the daily report, or work on an issue.
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
- ## What you get
28
-
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.
27
+ Try it now. No account, no API key, no paid model calls:
40
28
 
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).
29
+ ```sh
30
+ npx agentix-cli demo
31
+ ```
42
32
 
43
- ### Sales
33
+ ## Why this exists
44
34
 
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.
35
+ A coding agent in a terminal has four limits. AgentX removes each one and adds nothing else you have to learn first.
46
36
 
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.
37
+ | The limit | What AgentX adds |
38
+ |---|---|
39
+ | It works only when you type to it. | **Channels.** A message on WhatsApp or Telegram, or an issue on GitLab or GitHub, starts the work. The answer goes back to the same place. |
40
+ | It does nothing by itself. | **Schedules.** A task runs at a set time: a morning brief, a daily report, a check that stays quiet unless it finds a problem. |
41
+ | It acts, or it stops and waits at a prompt nobody sees. | **Approvals.** Work that reaches a person or changes something waits in one list until you say yes. [What always waits for you](docs/jobs/keep-it-safe.md#what-always-waits-for-you). |
42
+ | You see the bill at the end of the month. | **Budgets.** A monthly dollar cap per agent, per project and for all agents. You get a notice at 80% and new work pauses at 100%. [Costs and caps](docs/help/costs.md). |
48
43
 
49
- **What you approve.** Everything that reaches a person. The agent cannot send anything: you read each draft and send it yourself.
44
+ Everything an agent did is recorded and shown in the dashboard. It runs on your machine, with the model account you already have. Nothing is sent to the makers of AgentX. [Your data](docs/your-data.md).
50
45
 
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.
46
+ ## See it without an account
52
47
 
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.
48
+ With Node.js 22.19 or newer, up to 26 (tested on 22, 24, 25 and 26), run:
54
49
 
55
- [Find and follow up sales leads](docs/jobs/sales.md)
50
+ ```sh
51
+ npx agentix-cli demo
52
+ ```
56
53
 
57
- ### Content
54
+ The demo starts three local AgentX daemons (the background service that runs the agents) 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. The first run downloads the package, which takes a minute or two. [What to expect](docs/see-it-first.md).
58
55
 
59
- **The problem.** Posts go out late or not at all, and when someone else writes them they do not sound like you.
56
+ ![AgentX Monitor showing tasks that need your attention in the current dashboard](docs/public/screenshots/monitor-only-you.png)
60
57
 
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.
58
+ *The Monitor dashboard in the isolated demo. All displayed tasks are fictional.*
62
59
 
63
- **What you approve.** Every post. Nothing is published until you say yes in **Approvals**.
60
+ Short videos show one task each: [the **Learn AgentX** playlist on YouTube](https://www.youtube.com/playlist?list=PLWyRWfXkYvlw).
64
61
 
65
- **What it costs.** Two runs a week, plus the drafts you ask for.
62
+ ## What we measured
66
63
 
67
- **First result you can see.** **Terminal:** `agentx content drafts` lists one draft per planned post, each with the past posts it followed.
64
+ We publish the numbers, including the ones that do not flatter us.
68
65
 
69
- ![A drafted post waiting in Needs you on the Hub, under the Drafts chip](docs/public/screenshots/wall/needs-you-drafts.png)
66
+ | Question | Result | Source |
67
+ |---|---|---|
68
+ | How long from the install command to the first reply? | About 23 seconds on Linux and 24 seconds on macOS (median of 3 runs each, model key ready). An automated check times it on every change and fails above 5 minutes. | [First-reply check](https://github.com/anis-marrouchi/agentx/actions/workflows/first-reply.yml) |
69
+ | What does AgentX cost on top of the same agent alone? | On Sonnet 5.5, three coding tasks, ten runs each way: **2% more** with the lean profile and **22% more** with the full profile. On Haiku 4.5: no clear difference. Every run was correct on both sides. | [The comparison](bench/results/claude-code-comparison-455.md) |
70
+ | How much context does AgentX add before the model starts? | Count it yourself from a source checkout, with no model call: `pnpm bench:context`. | [Benchmarks](bench/README.md) |
70
71
 
71
- [Draft posts in your voice](docs/jobs/content.md)
72
+ AgentX is used every day. The [changelog](CHANGELOG.md) records each release.
72
73
 
73
- ### Clients and support
74
+ ## The jobs AgentX does
74
75
 
75
- **The problem.** Clients write after hours and wait until morning, then ask again where their request stands.
76
+ Each job comes as a **ready-made team**: agents with their instructions and their schedules, added in one command. [Start from a ready-made team](docs/jobs/ready-made-teams.md).
76
77
 
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
+ ### Dev
78
79
 
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
+ An issue you assign on GitLab comes back as 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. **You approve:** the merge. Neither agent merges.
80
81
 
81
- **What it costs.** One run per client message, plus one summary each weekday evening.
82
+ [Watch GitLab work](docs/jobs/watch-gitlab.md) · [Review gate](docs/jobs/review-gate.md) · [One folder per task](docs/jobs/task-worktrees.md)
82
83
 
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
+ ### Clients and support
84
85
 
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
+ A client who writes on WhatsApp after hours gets an answer from your business notes within a minute. Prices, refunds, complaints and dates come to you. **You approve:** nothing by default, so use a separate number. To approve every reply, [watch a WhatsApp chat](docs/jobs/watch-whatsapp.md) instead.
86
87
 
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
+ [Answer customers on WhatsApp](docs/jobs/answer-whatsapp.md) · [Answer customer email](docs/jobs/answer-email.md)
88
89
 
89
90
  ### Operations
90
91
 
91
- **The problem.** Reports depend on someone remembering them, and automated checks that say "all fine" every day soon get ignored.
92
+ A schedule asks an agent for the daily report at a set time. The exceptions digest sends one message a day that lists what failed, what is stuck and what is paused, and nothing when all is well. It uses no model, so it costs nothing. **You approve:** a new or removed schedule that an agent proposes.
92
93
 
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
+ [Send a daily report](docs/jobs/daily-report.md) · [Get a daily list of what is wrong](docs/jobs/exceptions-digest.md)
94
95
 
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
- ![A schedule drawer on the Operations page, with its latest result and one finished run](docs/public/screenshots/operations/schedule-drawer.png)
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)
96
+ ### Sales
104
97
 
105
- ### Money
98
+ Up to 10 new leads a week that match the customers you describe, a brief every weekday morning, and a drafted follow-up for each lead that went quiet. Every fact links to the page it came from. **You approve:** everything. The agent cannot send; you send each draft yourself.
106
99
 
107
- **The problem.** AI spend can grow without anyone noticing until the bill arrives.
100
+ [Find and follow up sales leads](docs/jobs/sales.md)
108
101
 
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.
102
+ ### Content
110
103
 
111
- **What you approve.** You set the caps and raise them. Nothing raises a cap by itself.
104
+ Next week's posts are planned on Friday and drafted in your voice on Monday, from a folder of your past posts. **You approve:** every post. Nothing is published until you say yes.
112
105
 
113
- **What it costs.** Nothing: counting and caps run on your machine.
106
+ [Draft posts in your voice](docs/jobs/content.md)
114
107
 
115
- **First result you can see.** **Browser:** open your dashboard and select **Cost** in the Hub's nav. Each agent's row shows its spend against its cap, and **Monthly budgets** shows all agents, each project and each capped agent.
108
+ ### Money
116
109
 
117
- ![Monthly budgets on the Hub's Cost page](docs/public/screenshots/costs/budgets.png)
110
+ A monthly dollar budget for an agent, a project, or all agents together. At 100% new work pauses and waits; it runs on the first day of the next month, or when you raise the budget. **You approve:** every cap. Nothing raises a cap by itself.
118
111
 
119
112
  [Set a monthly budget](docs/help/costs.md#set-a-monthly-budget-for-an-agent)
120
113
 
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).
144
-
145
114
  ## Is AgentX right for you?
146
115
 
147
116
  **Right for you if:**
148
117
 
118
+ - you already use Claude Code, Codex, OpenCode or a model API key ([what it costs](docs/help/costs.md));
119
+ - you can run one command in a terminal;
149
120
  - your clients or your team already work in WhatsApp, Telegram, email, GitLab or GitHub;
150
- - you want the agents, and what they see, on a machine you control ([your data](docs/your-data.md));
151
- - you have someone who can run one command in a terminal to install it;
152
- - you already use Claude Code, Codex, OpenCode or a model API key ([what it costs](docs/help/costs.md)).
121
+ - you want the agents, and what they see, on a machine you control ([your data](docs/your-data.md)).
153
122
 
154
123
  **Not for you yet if:**
155
124
 
@@ -157,36 +126,7 @@ What it costs depends on your model account (a Claude subscription, or an API ke
157
126
  - you need roles and permissions for many users (not built yet);
158
127
  - you want a hosted service with nothing to install: there is none;
159
128
  - you run Windows only (untested; WSL may work);
160
- - you need a 1.0 release: AgentX is still 0.x because there is still work to do. The [upgrade promise](docs/reference/releases.md#upgrade-promise) already holds.
161
-
162
- ## See it without an account
163
-
164
- With Node.js 22.19 or newer, up to 26 (tested on 22, 24, 25 and 26), run:
165
-
166
- ```sh
167
- npx agentix-cli demo
168
- ```
169
-
170
- No clone, account, or API key is needed. The first run downloads the package, which takes a minute or two; `npm warn deprecated` lines during the download are harmless. From a built source checkout, `node dist/cli.js demo` does the same.
171
-
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).
173
-
174
- ![AgentX Monitor showing tasks that need your attention in the current dashboard](docs/public/screenshots/monitor-only-you.png)
175
-
176
- *The Monitor dashboard in the isolated demo: review tasks that need you, with in-page agent chat. All displayed tasks are fictional.*
177
-
178
- ## Watch it
179
-
180
- Short videos show AgentX running, one task each. Click the picture to open the **Learn AgentX** playlist on YouTube.
181
-
182
- [![Learn AgentX playlist on YouTube](https://img.youtube.com/vi/J_QC6QCsSBs/hqdefault.jpg)](https://www.youtube.com/playlist?list=PLWyRWfXkYvlw)
183
-
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)
129
+ - you need a 1.0 release: AgentX is still 0.x. The [upgrade promise](docs/reference/releases.md#upgrade-promise) already holds.
190
130
 
191
131
  ## Install
192
132
 
@@ -196,113 +136,65 @@ One command, on macOS or Linux with **Node.js 22.19 or newer, up to 26**:
196
136
  npx agentix-cli start
197
137
  ```
198
138
 
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.
139
+ 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. 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.
200
140
 
201
141
  Then add the team for the job you want, for example:
202
142
 
203
143
  ```sh
204
- agentx team add sales-follow-up
205
- ```
206
-
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:
208
-
209
- ```sh
210
- curl -fsSL https://raw.githubusercontent.com/anis-marrouchi/agentx/main/install.sh | bash
144
+ agentx team add dev-team
211
145
  ```
212
146
 
213
- With Docker instead (its default image uses an API model rather than a preinstalled model CLI):
214
-
215
- ```sh
216
- git clone https://github.com/anis-marrouchi/agentx.git
217
- cd agentx
218
- cp .env.example .env
219
- docker compose up --build -d
220
- ```
147
+ The npm package is `agentix-cli`; the installed command is `agentx`. Other ways to install:
221
148
 
222
- Then open **http://127.0.0.1:4202/setup**. From a source checkout, with pnpm 10:
223
-
224
- ```sh
225
- pnpm install
226
- pnpm build
227
- node dist/cli.js start
228
- ```
229
-
230
- The npm package is `agentix-cli`; the installed executable is `agentx`. Follow the [installation guide](docs/install.md) for details.
149
+ - **Installer**, which also checks Node.js: `curl -fsSL https://raw.githubusercontent.com/anis-marrouchi/agentx/main/install.sh | bash`
150
+ - **Docker** and **from source**: see the [installation guide](docs/install.md).
231
151
 
232
152
  ## How it works
233
153
 
234
- The rest of this page is for the person who sets AgentX up.
235
-
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.
237
-
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
- ![The demo workflow assistant proposing a report](docs/public/screenshots/editor-chat-reply.png)
247
-
248
- ### Channels and models
249
-
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.
154
+ AgentX is a **harness**: the program around an AI model that gives it channels, tools, schedules and memory, and records what it did. Two parts run side by side:
253
155
 
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:
156
+ - The **daemon** is the background service that receives messages, runs agents and runs schedules.
157
+ - The **dashboard** is the website you open in your browser to set things up, approve work and see what happened.
257
158
 
258
159
  ```text
259
- You: "@cx CI is red on GitLab — find the cause"
260
- CX: sends the build investigation to @builder on another node
261
- Builder: checks the project and reports the result
262
- CX: replies in the original thread
160
+ WhatsApp · Telegram · GitLab · GitHub · schedule · webhook
161
+ │
162
+ daemon ──► Claude Code · Codex · OpenCode · model API
163
+ │
164
+ approvals · budgets · event record ──► dashboard
263
165
  ```
264
166
 
265
- The [second-machine guide](docs/jobs/second-machine.md) covers pairing. You do not need a mesh for a one-agent setup.
266
-
267
- ### Integrations
167
+ ### Models and channels
268
168
 
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.
169
+ Real agents need a configured model. An API provider needs a key; Claude Code, Codex CLI and OpenCode need their CLI installed and signed in on the host. Telegram and WhatsApp have pairing flows. GitLab, GitHub and generic webhooks bring in events. Slack and Discord are not supported. [Channel reference](docs/reference/channels.md).
274
170
 
275
- ### Add AgentX to Claude Code
171
+ ### More than one machine
276
172
 
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:
173
+ One machine is enough to start. When an agent needs to work on another machine, pair the two with `agentx connect mesh invite` and `agentx connect mesh join <link>`. Paired machines form a **mesh**, and an agent on one can pass work to an agent on another. [Second-machine guide](docs/jobs/second-machine.md).
278
174
 
279
- ```sh
280
- claude plugin install agentx --marketplace anis-marrouchi/agentx
281
- ```
175
+ ### Use it from other tools
282
176
 
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).
177
+ - **Claude Code:** `claude plugin install agentx --marketplace anis-marrouchi/agentx` adds the AgentX tool server, in look-only mode by default. [Guide](docs/jobs/install-the-plugin.md).
178
+ - **Cursor, VS Code, Windsurf:** `agentx serve --stdio` is a tool server (MCP). [Guide](docs/jobs/connect-an-editor.md).
179
+ - **Other programs:** the daemon accepts tasks over HTTP, and `agentx a2a` serves the A2A protocol. [Agent-to-agent reference](docs/reference/a2a.md).
284
180
 
285
181
  ### Release status
286
182
 
287
- AgentX is used every day and releases ship often; see the [changelog](CHANGELOG.md) for what changed. It works, but it stays on 0.x for now because there is still work to do; there is no date for 1.0 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).
183
+ AgentX is on 0.x and releases ship often. A breaking change is always listed in the [changelog](CHANGELOG.md) with what to do, and each release is installed on Linux and macOS by the install matrix (its pass rate is the badge at the top).
288
184
 
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.
185
+ **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.
290
186
 
291
187
  ## Help test and improve AgentX
292
188
 
293
- The most valuable contribution right now is **trying AgentX and reporting what happens**. You do not need to write code to help.
294
-
295
- 1. **Test and report issues.** Try installation, Settings, model setup, chat, the desktop assistant, the TUI, or a task across nodes. Report failures and confusing steps, including what you expected and what actually happened.
296
- 2. **Help with triage and workflow/pipeline management.** Reproduce reports, identify duplicates, clarify priorities, and help follow issues through fixes, CI, and releases.
297
- 3. **Contribute code and documentation.** Fix bugs, improve setup and Settings, clarify instructions, or help design the missing mesh-level and agent-level RBAC. Discuss larger changes in an issue first.
298
-
299
- [Report an issue](https://github.com/anis-marrouchi/agentx/issues/new/choose) yourself, or let your own agent help you draft it with [`agentx contribute`](docs/guides/contribute.md). Include your version, operating system, steps to reproduce, and relevant logs or screenshots. Remove secrets and private data before sharing. Report security vulnerabilities through the [security policy](SECURITY.md).
189
+ The most useful thing you can do is **try AgentX and tell us what happened**, good or bad. You do not need to write code.
300
190
 
301
- See [Contributing](CONTRIBUTING.md) for testing, issue triage, and development instructions.
191
+ 1. Run the demo or the install above.
192
+ 2. [Report an issue](https://github.com/anis-marrouchi/agentx/issues/new/choose) with your version, your operating system and what you expected. `agentx contribute` lets your own agent help you draft it. [How](docs/guides/contribute.md).
193
+ 3. For code and documentation changes, see [Contributing](CONTRIBUTING.md). Report security problems through the [security policy](SECURITY.md).
302
194
 
303
195
  ### Most requested
304
196
 
305
- Give a 👍 to the open requests you care about; the community decides together what matters most. This list is updated every day.
197
+ Give a 👍 to the open requests you care about. This list is updated every day.
306
198
 
307
199
  <!-- most-requested:start -->
308
200
  No request has 5 votes yet. Yours could be the first: give a 👍 to the issues you care about.
@@ -310,20 +202,8 @@ No request has 5 votes yet. Yours could be the first: give a 👍 to the issues
310
202
  [Full ranked list](https://agentx-docs.pages.dev/community/most-requested) · [How voting works](https://agentx-docs.pages.dev/guides/contribute)
311
203
  <!-- most-requested:end -->
312
204
 
313
- ## Sponsors
314
-
315
- We are grateful for the support of our sponsors, who help make AgentX possible.
316
-
317
- <p align="center">
318
- <a href="https://noqta.tn"><img src="docs/public/sponsors/noqta.svg" alt="Noqta" height="48" /></a>
319
- </p>
320
-
321
- Want to sponsor AgentX? [Start a discussion](https://github.com/anis-marrouchi/agentx/discussions) and we will add you here.
322
-
323
- ## Help and development
205
+ ## Help
324
206
 
325
207
  - [Start here](docs/index.md) · [Troubleshooting](docs/help/its-not-answering.md) · [CLI reference](docs/reference/cli.md)
326
- - [Support and supported environments](.github/SUPPORT.md) · [Ask a question](https://github.com/anis-marrouchi/agentx/discussions)
327
- - [Contributing](CONTRIBUTING.md) · [Security policy](SECURITY.md) · [Changelog](CHANGELOG.md)
328
-
329
- AgentX is released under the [MIT License](LICENSE).
208
+ - [Ask a question](https://github.com/anis-marrouchi/agentx/discussions) · [Support and supported environments](.github/SUPPORT.md)
209
+ - Sponsored by [Noqta](https://noqta.tn). AgentX is released under the [MIT License](LICENSE).
@@ -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-GP56ZRAF.js";import"./chunk-JE2EV6NS.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-VQRY4IDI.js";import"./chunk-YSCT6DPR.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(`
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-7ATCEK7R.js";import"./chunk-EZDHAX4Z.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-VQRY4IDI.js";import"./chunk-YSCT6DPR.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-2IEK5HWX.js.map
8
+ //# sourceMappingURL=App-ET75JEWK.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-GP56ZRAF.js";import"./chunk-JE2EV6NS.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-VQRY4IDI.js";import"./chunk-YSCT6DPR.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(`
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-7ATCEK7R.js";import"./chunk-EZDHAX4Z.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-VQRY4IDI.js";import"./chunk-YSCT6DPR.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-YHC7ASGR.js.map
7
+ //# sourceMappingURL=ChatApp-F2NT5M2O.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-NJLWS44P.js";import"./chunk-EVFQINOQ.js";import"./chunk-YG5GPPGI.js";import"./chunk-JTFCU5LH.js";import"./chunk-LUOW2YHY.js";import"./chunk-4LWFJ4MZ.js";import"./chunk-BIJHMWXK.js";import"./chunk-BERWTVG2.js";import"./chunk-AKPLNPUY.js";import"./chunk-WPNRDEHW.js";import"./chunk-AHWWJ7AF.js";import"./chunk-QW5WOBSU.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-QUFIUXMQ.js";import"./chunk-DCIYOPJF.js";import"./chunk-7I7IEX4S.js";import"./chunk-JE2EV6NS.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-VQRY4IDI.js";import"./chunk-YSCT6DPR.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-GJ47IOFG.js.map
1
+ import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o}from"./chunk-GPX4LDAX.js";import"./chunk-6X7SABYJ.js";import"./chunk-V75JESS5.js";import"./chunk-JTFCU5LH.js";import"./chunk-LUOW2YHY.js";import"./chunk-4LWFJ4MZ.js";import"./chunk-BIJHMWXK.js";import"./chunk-BERWTVG2.js";import"./chunk-PTVDVI2U.js";import"./chunk-WPNRDEHW.js";import"./chunk-AHWWJ7AF.js";import"./chunk-YMMGY7GR.js";import"./chunk-72SZI2UW.js";import"./chunk-FCPTN6NF.js";import"./chunk-MCI3DIWW.js";import"./chunk-QUFIUXMQ.js";import"./chunk-DCIYOPJF.js";import"./chunk-7I7IEX4S.js";import"./chunk-EZDHAX4Z.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-VQRY4IDI.js";import"./chunk-YSCT6DPR.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-EA5ESP4Y.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-WZIFXZZX.js";import"./chunk-JE2EV6NS.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-VQRY4IDI.js";import"./chunk-YSCT6DPR.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)}
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-EWXY73XA.js";import"./chunk-EZDHAX4Z.js";import"./chunk-KEUW6YLL.js";import"./chunk-N47Y5ADQ.js";import"./chunk-VQRY4IDI.js";import"./chunk-YSCT6DPR.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-WZIFXZZX.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-WROHSAHE.js.map
12
+ //# sourceMappingURL=adapter-7PKOKXO5.js.map
@@ -1,2 +1,2 @@
1
- import{A as a,B as b,C as c}from"./chunk-ETMUGFPI.js";import"./chunk-SFQUP3BP.js";import"./chunk-LY4G7PCW.js";import"./chunk-AHWWJ7AF.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-5MYO4YCO.js.map
1
+ import{A as a,B as b,C as c}from"./chunk-HHSPOS7O.js";import"./chunk-SFQUP3BP.js";import"./chunk-LY4G7PCW.js";import"./chunk-AHWWJ7AF.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-SDNU6MUI.js.map