@aman_asmuei/aman-agent 0.29.0 → 0.31.0-next.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 CHANGED
@@ -8,7 +8,8 @@
8
8
  <h1 align="center">aman-agent</h1>
9
9
 
10
10
  <p align="center">
11
- <strong>The AI companion that actually remembers you.</strong>
11
+ <strong>The AI companion that actually remembers you.</strong><br/>
12
+ <sub>Learns from every conversation. Recalls what matters. Runs locally. Works with any LLM.</sub>
12
13
  </p>
13
14
 
14
15
  <p align="center">
@@ -16,30 +17,41 @@
16
17
  &nbsp;
17
18
  <a href="https://github.com/amanasmuei/aman-agent/actions"><img src="https://img.shields.io/github/actions/workflow/status/amanasmuei/aman-agent/ci.yml?style=for-the-badge&logo=github&label=CI" alt="CI status" /></a>
18
19
  &nbsp;
20
+ <img src="https://img.shields.io/badge/tests-429_passing-brightgreen?style=for-the-badge&logo=vitest&logoColor=white" alt="429 tests passing" />
21
+ &nbsp;
19
22
  <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue?style=for-the-badge" alt="MIT License" /></a>
23
+ </p>
24
+
25
+ <p align="center">
26
+ <img src="https://img.shields.io/badge/node-%E2%89%A520-brightgreen?style=flat-square&logo=node.js&logoColor=white" alt="Node.js 20+" />
27
+ &nbsp;
28
+ <img src="https://img.shields.io/badge/typescript-strict-3178c6?style=flat-square&logo=typescript&logoColor=white" alt="Strict TypeScript" />
20
29
  &nbsp;
21
- <img src="https://img.shields.io/badge/node-%E2%89%A520-brightgreen?style=for-the-badge&logo=node.js&logoColor=white" alt="Node.js 20+" />
30
+ <img src="https://img.shields.io/badge/bundle-340_KB-informational?style=flat-square" alt="Bundle size: 340 KB" />
22
31
  &nbsp;
23
- <a href="https://github.com/amanasmuei/aman"><img src="https://img.shields.io/badge/part_of-aman_ecosystem-ff6b35?style=for-the-badge" alt="aman ecosystem" /></a>
32
+ <img src="https://img.shields.io/badge/LLMs-6_providers-8a2be2?style=flat-square" alt="6 LLM providers" />
33
+ &nbsp;
34
+ <a href="https://github.com/amanasmuei/aman"><img src="https://img.shields.io/badge/part_of-aman_ecosystem-ff6b35?style=flat-square" alt="aman ecosystem" /></a>
24
35
  </p>
25
36
 
26
37
  <p align="center">
27
- An AI companion that learns from every conversation, recalls relevant memories per message,<br/>
28
- extracts knowledge silently, and adapts to your time of day — all running locally.
38
+ <img src="https://raw.githubusercontent.com/amanasmuei/aman-agent/main/docs/demo/demo.gif" alt="aman-agent demo" width="760" />
29
39
  </p>
30
40
 
31
41
  <p align="center">
32
- <img src="https://raw.githubusercontent.com/amanasmuei/aman-agent/main/docs/demo/demo.gif" alt="aman-agent demo" width="720" />
42
+ <a href="#quick-start"><kbd> Quick Start </kbd></a>
43
+ <a href="#architecture-at-a-glance"><kbd> Architecture </kbd></a>
44
+ <a href="#features"><kbd> Features </kbd></a>
45
+ <a href="#commands"><kbd> Commands </kbd></a>
46
+ <a href="#supported-llms"><kbd> LLMs </kbd></a>
47
+ <a href="#the-ecosystem"><kbd> Ecosystem </kbd></a>
48
+ <a href="#faq"><kbd> FAQ </kbd></a>
33
49
  </p>
34
50
 
35
51
  <p align="center">
36
- <a href="#quick-start">Quick Start</a> &bull;
37
- <a href="#features">Features</a> &bull;
38
- <a href="#how-it-works">How It Works</a> &bull;
39
- <a href="#commands">Commands</a> &bull;
40
- <a href="#supported-llms">LLMs</a> &bull;
41
- <a href="#the-ecosystem">Ecosystem</a> &bull;
42
- <a href="#faq">FAQ</a>
52
+ <sub>
53
+ <b>Try it in 10 seconds →</b>&nbsp;&nbsp;<code>npx @aman_asmuei/aman-agent</code>
54
+ </sub>
43
55
  </p>
44
56
 
45
57
  ---
@@ -47,9 +59,10 @@
47
59
  <details>
48
60
  <summary><strong>Table of Contents</strong></summary>
49
61
 
50
- - [What's New](#whats-new-in-v0290)
62
+ - [What's New](#whats-new-in-v0300)
51
63
  - [The Problem](#the-problem)
52
64
  - [The Solution](#the-solution)
65
+ - [Architecture at a Glance](#architecture-at-a-glance)
53
66
  - [Quick Start](#quick-start)
54
67
  - [Usage Guide](#usage-guide)
55
68
  - [Your First Conversation](#your-first-conversation)
@@ -64,6 +77,7 @@
64
77
  - [Profiles](#your-profile-vs-agent-profiles)
65
78
  - [Delegation](#agent-delegation)
66
79
  - [Teams](#agent-teams)
80
+ - [Multi-agent (A2A)](#multi-agent-a2a)
67
81
  - [Daily Workflow](#daily-workflow-summary)
68
82
  - [Features](#features)
69
83
  - [How It Works](#how-it-works)
@@ -80,20 +94,44 @@
80
94
 
81
95
  ---
82
96
 
83
- ## What's New in v0.29.0
97
+ ## What's New in v0.30.0
84
98
 
85
- > **Ecosystem paritythe knowledge graph wires up.**
99
+ > **Agent hardeningtrust, durability, insight.**<br/>
100
+ > The agent now asks before delegating, persists background tasks across crashes, and ships a real analytics dashboard in `/eval report`.
86
101
 
87
- Memories now auto-relate after extraction, building a knowledge graph of connected insights across sessions. Admin tools for memory health diagnostics, repair, config, and reflection are fully wired. Stale references cleaned up.
102
+ <table>
103
+ <tr>
104
+ <td width="33%" valign="top">
88
105
 
89
- | Feature | What it does |
90
- |:---|:---|
91
- | **Auto-relate memories** | After each successful extraction, `autoRelateMemory` finds and links semantically similar memoriesbuilds a knowledge graph automatically |
92
- | **Stale reference cleanup** | `aman-claude-code` → `aman-plugin` across all docs |
106
+ **Delegation confirmation**
107
+
108
+ The agent now prompts you before executing `delegate_task` or `team_run`. No more silent autonomous sub-agents you stay in the loop on every hand-off.
109
+
110
+ </td>
111
+ <td width="33%" valign="top">
112
+
113
+ **Persistent background tasks**
114
+
115
+ Background task state is written to `~/.aman-agent/bg-tasks.json` on every transition — survives crashes, terminal closures, and reboots. Visible in `/eval report`.
116
+
117
+ </td>
118
+ <td width="33%" valign="top">
119
+
120
+ **Rich `/eval report`**
121
+
122
+ Trust score, sentiment trend, energy distribution, burnout risk, frustration correlations, and background-task stats — all in one dashboard.
123
+
124
+ </td>
125
+ </tr>
126
+ </table>
93
127
 
94
128
  <details>
95
129
  <summary><strong>Highlights from earlier releases</strong></summary>
96
130
 
131
+ **v0.29 — Ecosystem parity**
132
+ - Auto-relate memories after extraction (knowledge graph edges)
133
+ - Stale reference cleanup
134
+
97
135
  **v0.28 — Learning loop completion**
98
136
  - Rejection feedback, cross-session reinforcement, skill merging + versioning
99
137
  - Adaptive nudge learning, semantic trigger matching, feed-forward v2
@@ -157,6 +195,60 @@ npx @aman_asmuei/aman-agent
157
195
 
158
196
  ---
159
197
 
198
+ ## Architecture at a Glance
199
+
200
+ aman-agent is the **runtime** at the center of the aman ecosystem — 38 focused TypeScript modules that stitch together 7 portable memory/identity/skill layers with any LLM you want.
201
+
202
+ ```mermaid
203
+ flowchart LR
204
+ User([You]) <--> CLI[aman-agent CLI<br/>chat loop]
205
+
206
+ CLI --> Agent[agent.ts<br/>message orchestration]
207
+ Agent --> Hooks[hooks.ts<br/>lifecycle events]
208
+
209
+ Agent -->|recall &amp; extract| Memory[(amem-core<br/>SQLite + vectors)]
210
+ Agent -->|who &amp; prefs| Identity[(acore-core<br/>identity)]
211
+ Agent -->|boundaries| Rules[(arules-core<br/>guardrails)]
212
+ Agent -->|auto-trigger| Skills[skill-engine<br/>+ crystallization]
213
+ Agent -->|telemetry| Obs[observation<br/>+ postmortem]
214
+
215
+ Agent --> LLM{LLM Router}
216
+ LLM --> Claude[Anthropic]
217
+ LLM --> GPT[OpenAI]
218
+ LLM --> Copilot[GH Copilot]
219
+ LLM --> Ollama[Ollama local]
220
+
221
+ Agent <--> MCP[MCP tools<br/>aman-mcp · amem]
222
+
223
+ classDef core fill:#58a6ff22,stroke:#58a6ff,color:#e6edf3,stroke-width:2px;
224
+ classDef store fill:#3fb95022,stroke:#3fb950,color:#e6edf3,stroke-width:2px;
225
+ classDef llm fill:#d29f2222,stroke:#d29f22,color:#e6edf3,stroke-width:1px;
226
+ class CLI,Agent,Hooks,Skills,Obs core
227
+ class Memory,Identity,Rules store
228
+ class Claude,GPT,Copilot,Ollama,LLM llm
229
+ ```
230
+
231
+ <details>
232
+ <summary><strong>How the pieces work together</strong></summary>
233
+
234
+ | Piece | What it does | Where it lives |
235
+ |:---|:---|:---|
236
+ | `agent.ts` | The main event loop — reads your message, recalls memories, streams the LLM response, executes tools, extracts new memories | `src/agent.ts` (40 KB) |
237
+ | `commands.ts` | 58+ slash commands (`/memory`, `/skills`, `/plan`, `/delegate`, `/eval`, `/observe`, `/postmortem`, …) | `src/commands.ts` (98 KB) |
238
+ | `hooks.ts` | 5 lifecycle hooks that fire at startup, before/after tools, on workflow match, on session end | `src/hooks.ts` (26 KB) |
239
+ | `memory.ts` + `memory-extractor.ts` | Per-message recall and silent, non-blocking extraction of preferences, decisions, patterns, corrections | delegates to `@aman_asmuei/amem-core@0.5` |
240
+ | `skill-engine.ts` + `crystallization.ts` | Auto-triggers domain skills from context; promotes post-mortem lessons into reusable, versioned skills | `src/skill-engine.ts`, `src/crystallization.ts` |
241
+ | `user-model.ts` + `personality.ts` | Cross-session trust (EMA), sentiment baseline, burnout risk, time-of-day tone shifts, wellbeing nudges | `src/user-model.ts`, `src/personality.ts` |
242
+ | `observation.ts` + `postmortem.ts` | Passive session telemetry + LLM-generated structured post-mortems on session end | `src/observation.ts`, `src/postmortem.ts` |
243
+ | `llm/` | 6 pluggable providers — Anthropic, OpenAI, Ollama, GitHub Copilot, OpenAI-compatible, Claude Code CLI | `src/llm/` |
244
+ | `mcp/` | MCP v1.27 client with stdio transport and auto-reconnect | `src/mcp/` |
245
+
246
+ **Stateless by default.** All state lives in `~/.acore`, `~/.arules`, `~/.aflow`, `~/.askill`, `~/.aeval`, and `~/.amem` — portable, inspectable markdown + a local SQLite file. Nothing leaves your machine except what you send to your chosen LLM.
247
+
248
+ </details>
249
+
250
+ ---
251
+
160
252
  ## Quick Start
161
253
 
162
254
  ### 1. Run
@@ -686,6 +778,62 @@ The AI auto-suggests teams when appropriate — always asks permission first.
686
778
 
687
779
  </details>
688
780
 
781
+ <details>
782
+ <summary><strong>Multi-agent (A2A)</strong> (new in v0.31)</summary>
783
+
784
+ ### Multi-agent (A2A)
785
+
786
+ Run aman-agent as a local MCP server so other aman-agent instances — on the same machine — can delegate tasks to it via the `@name` syntax. No new protocol, no new daemon, no broker — just MCP over localhost using the existing `@modelcontextprotocol/sdk` bits.
787
+
788
+ **Start a specialist agent in server mode:**
789
+
790
+ ```bash
791
+ aman-agent serve --name coder --profile coder
792
+ ✓ Ecosystem loaded
793
+ ✓ registered as @coder
794
+ ✓ port 52341 (127.0.0.1) — token is in ~/.aman-agent/registry.json
795
+ ```
796
+
797
+ Leave it running. The process binds an ephemeral localhost port and writes its `{name, pid, port, token}` into `~/.aman-agent/registry.json` (mode `0600`). On `SIGINT`/`SIGTERM` it cleans up the registry entry.
798
+
799
+ **From another aman-agent instance, delegate to it:**
800
+
801
+ ```
802
+ You > /agents list
803
+
804
+ Running agents:
805
+ @coder coder pid=4512 port=52341 up 34s
806
+
807
+ You > /delegate @coder Refactor src/auth.ts to use async/await
808
+
809
+ [delegating to @coder...]
810
+ ✓ @coder completed in 12.4s
811
+ ...
812
+ ```
813
+
814
+ **Commands:**
815
+
816
+ | Command | What it does |
817
+ |:---|:---|
818
+ | `aman-agent serve --name X --profile Y` | Run as a local A2A server |
819
+ | `/agents list` | Show running agents on this machine |
820
+ | `/agents info <name>` | Call `agent.info` MCP tool on the named agent |
821
+ | `/agents ping <name>` | Bearer-authed `/health` latency check |
822
+ | `/delegate @<name> <task>` | Delegate via MCP to another running agent |
823
+
824
+ **How it works:** Each `serve` process binds an ephemeral localhost port, mounts an MCP `StreamableHTTPServerTransport`, and writes its `{name, profile, pid, port, token}` into `~/.aman-agent/registry.json` (mode `0600`). The calling agent looks up the target in the registry, dials via `StreamableHTTPClientTransport` with the bearer token, and invokes the `agent.delegate` MCP tool. Three tools are exposed on every `serve` instance: `agent.info`, `agent.delegate`, `agent.send`.
825
+
826
+ **Trust model:** Same-user, same-machine. OS file permissions on `~/.aman-agent/registry.json` are the trust boundary — if you can read the registry, you know the tokens. Cross-machine A2A is a future addition; it will need explicit auth and is out of scope for v0.31.
827
+
828
+ **Known limitations (v0.31):**
829
+
830
+ - **Event-loop leak on `delegateRemote`** — the MCP SDK's `StreamableHTTPClientTransport` keeps an internal resource alive after `close()` / `terminateSession()`, so a Node script that calls `delegateTask("@name", ...)` and expects clean exit must call `process.exit(0)` explicitly. The interactive REPL is unaffected (it exits via `/quit`). Follow-up investigation planned.
831
+ - **No cross-machine A2A** — registry is a local JSON file; LAN/remote agents not supported yet.
832
+ - **`agent.send` is in-memory only** — messages are lost if the target agent crashes before draining them.
833
+ - **No proactive push to humans** — delivering a message to Telegram/Discord/etc. is `achannel`'s job, not aman-agent's.
834
+
835
+ </details>
836
+
689
837
  <details>
690
838
  <summary><strong>Session Telemetry & Post-Mortems</strong> (new in v0.24)</summary>
691
839
 
@@ -982,59 +1130,92 @@ On session end, if any smart trigger fires (≥3 tool errors, ≥2 blockers, &gt
982
1130
 
983
1131
  ## How It Works
984
1132
 
1133
+ ### Per-message flow
1134
+
1135
+ ```mermaid
1136
+ sequenceDiagram
1137
+ autonumber
1138
+ participant U as You
1139
+ participant A as aman-agent
1140
+ participant M as amem (memory)
1141
+ participant L as LLM
1142
+ participant T as MCP tools
1143
+
1144
+ U->>A: your message
1145
+ A->>M: semantic recall (top 5)
1146
+ M-->>A: compact index (~50–100 tok)
1147
+ A->>A: build prompt: identity + rules + skills + memories
1148
+ A->>L: stream request
1149
+ L-->>A: response + tool calls
1150
+ par parallel execution
1151
+ A->>T: tool call 1 (guardrail-checked)
1152
+ and
1153
+ A->>T: tool call 2 (guardrail-checked)
1154
+ end
1155
+ T-->>A: results
1156
+ A-->>U: streamed response
1157
+ A->>M: extract memories (non-blocking)
1158
+ A->>A: update user model + sentiment + skills
1159
+ ```
1160
+
1161
+ <details>
1162
+ <summary><strong>ASCII version (for terminals / no-Mermaid viewers)</strong></summary>
1163
+
985
1164
  ```
986
1165
  ┌───────────────────────────────────────────────────────────┐
987
1166
  │ Your Terminal │
988
-
989
- │ You > tell me about our auth decisions
990
-
991
- │ [recalling memories...]
992
- │ Agent > Based on your previous decisions:
993
- │ - OAuth2 with PKCE (decided 2 weeks ago)
994
- │ - JWT for API tokens...
995
-
996
- │ [1 memory stored]
1167
+
1168
+ │ You > tell me about our auth decisions
1169
+
1170
+ │ [recalling memories...]
1171
+ │ Agent > Based on your previous decisions:
1172
+ │ - OAuth2 with PKCE (decided 2 weeks ago)
1173
+ │ - JWT for API tokens...
1174
+
1175
+ │ [1 memory stored]
997
1176
  └──────────────────────┬────────────────────────────────────┘
998
1177
 
999
1178
  ┌──────────────────────▼────────────────────────────────────┐
1000
- │ aman-agent runtime
1001
-
1002
- │ On Startup
1003
- │ ┌────────────────────────────────────────────────┐
1004
- │ │ 1. Load ecosystem (identity, tools, rules...) │
1005
- │ │ 2. Connect MCP servers (aman-mcp + amem) │
1006
- │ │ 3. Consolidate memory (merge/prune/promote) │
1007
- │ │ 4. Check reminders (overdue/today/upcoming) │
1008
- │ │ 5. Inject time context (morning/evening/...) │
1009
- │ │ 6. Recall session context from memory │
1010
- │ └────────────────────────────────────────────────┘
1011
-
1012
- │ Per Message
1013
- │ ┌────────────────────────────────────────────────┐
1014
- │ │ 1. Semantic memory recall (top 5 relevant) │
1015
- │ │ 2. Augment system prompt with memories │
1016
- │ │ 3. Stream LLM response (with retry) │
1017
- │ │ 4. Execute tools in parallel (with guardrails) │
1018
- │ │ 5. Extract memories from response │
1019
- │ │ - Auto-store: preferences, facts, patterns │
1020
- │ │ - All types auto-stored silently
1021
- │ └────────────────────────────────────────────────┘
1022
-
1023
- │ Context Management
1024
- │ ┌────────────────────────────────────────────────┐
1025
- │ │ Auto-trim at 80K tokens │
1026
- │ │ LLM-powered summarization (not truncation) │
1027
- │ │ Fallback to text preview if LLM call fails │
1028
- │ └────────────────────────────────────────────────┘
1029
-
1030
- │ MCP Integration
1031
- │ ┌────────────────────────────────────────────────┐
1032
- │ │ aman-mcp → identity, tools, workflows, eval │
1033
- │ │ amem → memory, knowledge graph, reminders
1034
- │ └────────────────────────────────────────────────┘
1179
+ │ aman-agent runtime
1180
+
1181
+ │ On Startup
1182
+ │ ┌────────────────────────────────────────────────┐
1183
+ │ │ 1. Load ecosystem (identity, tools, rules...) │
1184
+ │ │ 2. Connect MCP servers (aman-mcp + amem) │
1185
+ │ │ 3. Consolidate memory (merge/prune/promote) │
1186
+ │ │ 4. Check reminders (overdue/today/upcoming) │
1187
+ │ │ 5. Inject time context (morning/evening/...) │
1188
+ │ │ 6. Recall session context from memory │
1189
+ │ └────────────────────────────────────────────────┘
1190
+
1191
+ │ Per Message
1192
+ │ ┌────────────────────────────────────────────────┐
1193
+ │ │ 1. Semantic memory recall (top 5 relevant) │
1194
+ │ │ 2. Augment system prompt with memories │
1195
+ │ │ 3. Stream LLM response (with retry) │
1196
+ │ │ 4. Execute tools in parallel (with guardrails) │
1197
+ │ │ 5. Extract memories from response │
1198
+ │ │ - Auto-store: preferences, facts, patterns │
1199
+ │ │ - All types auto-stored silently
1200
+ │ └────────────────────────────────────────────────┘
1201
+
1202
+ │ Context Management
1203
+ │ ┌────────────────────────────────────────────────┐
1204
+ │ │ Auto-trim at 80K tokens │
1205
+ │ │ LLM-powered summarization (not truncation) │
1206
+ │ │ Fallback to text preview if LLM call fails │
1207
+ │ └────────────────────────────────────────────────┘
1208
+
1209
+ │ MCP Integration
1210
+ │ ┌────────────────────────────────────────────────┐
1211
+ │ │ aman-mcp → identity, tools, workflows, eval │
1212
+ │ │ amem → memory, knowledge graph, reminders│
1213
+ │ └────────────────────────────────────────────────┘
1035
1214
  └───────────────────────────────────────────────────────────┘
1036
1215
  ```
1037
1216
 
1217
+ </details>
1218
+
1038
1219
  ### Session Lifecycle
1039
1220
 
1040
1221
  | Phase | What happens |
@@ -1055,6 +1236,7 @@ On session end, if any smart trigger fires (≥3 tool errors, ≥2 blockers, &gt
1055
1236
  | `/plan` | Show active plan `[create\|done\|undo\|list\|switch\|show]` |
1056
1237
  | `/profile` | Your profile + agent profiles `[me\|edit\|setup\|create\|list\|show\|delete]` |
1057
1238
  | `/delegate` | Delegate task to a profile `[<profile> <task>\|pipeline]` |
1239
+ | `/agents` | Multi-agent A2A `[list\|info <name>\|ping <name>]` |
1058
1240
  | `/team` | Manage agent teams `[create\|run\|list\|show\|delete]` |
1059
1241
  | `/identity` | View identity `[update <section>]` `[dynamics [--json\|--reset]]` |
1060
1242
  | `/rules` | View guardrails `[add\|remove\|toggle ...]` |
@@ -1334,16 +1516,47 @@ This usually means an MCP server crashed on startup. Run `npx @aman_asmuei/aman-
1334
1516
  ```bash
1335
1517
  git clone https://github.com/amanasmuei/aman-agent.git
1336
1518
  cd aman-agent && npm install
1337
- npm run build # zero errors
1338
- npm test # 304 tests pass
1519
+
1520
+ npm run lint # tsc --noEmit — strict TypeScript, zero errors
1521
+ npm run build # tsup → 340 KB ESM bundle
1522
+ npm test # vitest run — 429 tests across 21 files
1339
1523
  ```
1340
1524
 
1341
1525
  PRs welcome. See [Issues](https://github.com/amanasmuei/aman-agent/issues).
1342
1526
 
1343
1527
  **Project standards:**
1344
- - All new modules ship with tests (TDD encouraged)
1345
- - Type errors block merge — `npm run build` must be clean
1346
- - Commits follow conventional format (`feat:`, `fix:`, `chore:`, `docs:`)
1528
+
1529
+ | Standard | Enforced by |
1530
+ |:---|:---|
1531
+ | All new modules ship with tests (TDD encouraged) | code review |
1532
+ | Type errors block merge | `npm run lint` in CI |
1533
+ | Build must be clean | `npm run build` in CI |
1534
+ | Commits follow conventional format (`feat:`, `fix:`, `chore:`, `docs:`) | commit history |
1535
+ | No MCP round-trips for read paths — use `@aman_asmuei/*-core` libraries directly | Engine v1 convention |
1536
+
1537
+ <details>
1538
+ <summary><strong>Repo layout</strong></summary>
1539
+
1540
+ ```
1541
+ aman-agent/
1542
+ ├── src/
1543
+ │ ├── agent.ts main event loop (40 KB)
1544
+ │ ├── commands.ts 58+ slash commands (98 KB)
1545
+ │ ├── hooks.ts lifecycle hooks (26 KB)
1546
+ │ ├── memory.ts / memory-extractor.ts
1547
+ │ ├── skill-engine.ts / crystallization.ts
1548
+ │ ├── user-model.ts / personality.ts / postmortem.ts
1549
+ │ ├── observation.ts / onboarding.ts / background.ts
1550
+ │ ├── delegate.ts / teams.ts / plans.ts
1551
+ │ ├── llm/ 6 provider implementations
1552
+ │ ├── mcp/ MCP client (stdio + auto-reconnect)
1553
+ │ └── layers/ ecosystem parsers
1554
+ ├── test/ 21 test files, 429 tests
1555
+ ├── bin/aman-agent.js CLI entry point
1556
+ └── dist/ built bundle (tsup)
1557
+ ```
1558
+
1559
+ </details>
1347
1560
 
1348
1561
  ---
1349
1562
 
@@ -0,0 +1,18 @@
1
+ import { DelegationResult } from './delegate.js';
2
+
3
+ interface RemoteDelegateOptions {
4
+ context?: string;
5
+ timeoutMs?: number;
6
+ }
7
+ /**
8
+ * Dial another aman-agent running as an A2A server on the same machine
9
+ * and run a task through its `agent.delegate` MCP tool. Returns a
10
+ * DelegationResult matching the shape of the local `delegateTask` so
11
+ * callers can treat local and remote delegation uniformly.
12
+ *
13
+ * Trust model: same user, same machine — bearer comes from the local
14
+ * registry file (mode 0600). See plan docs for the broader discussion.
15
+ */
16
+ declare function delegateRemote(task: string, agentName: string, options?: RemoteDelegateOptions): Promise<DelegationResult>;
17
+
18
+ export { type RemoteDelegateOptions, delegateRemote };