@aman_asmuei/aman-agent 0.34.0 → 0.40.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,8 +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><br/>
12
- <sub>Learns from every conversation. Recalls what matters. Runs locally. Works with any LLM.</sub>
11
+ <strong>The AI companion that remembers you — and orchestrates your entire dev workflow.</strong><br/>
12
+ <sub>Per-message memory. Multi-agent orchestration. GitHub-native. Runs locally. Any LLM.</sub>
13
13
  </p>
14
14
 
15
15
  <p align="center">
@@ -17,7 +17,7 @@
17
17
  &nbsp;
18
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>
19
19
  &nbsp;
20
- <img src="https://img.shields.io/badge/tests-531_passing-brightgreen?style=for-the-badge&logo=vitest&logoColor=white" alt="531 tests passing" />
20
+ <img src="https://img.shields.io/badge/tests-912_passing-brightgreen?style=for-the-badge&logo=vitest&logoColor=white" alt="912 tests passing" />
21
21
  &nbsp;
22
22
  <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue?style=for-the-badge" alt="MIT License" /></a>
23
23
  </p>
@@ -27,7 +27,7 @@
27
27
  &nbsp;
28
28
  <img src="https://img.shields.io/badge/typescript-strict-3178c6?style=flat-square&logo=typescript&logoColor=white" alt="Strict TypeScript" />
29
29
  &nbsp;
30
- <img src="https://img.shields.io/badge/bundle-384_KB-informational?style=flat-square" alt="Bundle size: 384 KB" />
30
+ <img src="https://img.shields.io/badge/bundle-388_KB-informational?style=flat-square" alt="Bundle size: 388 KB" />
31
31
  &nbsp;
32
32
  <img src="https://img.shields.io/badge/LLMs-6_providers-8a2be2?style=flat-square" alt="6 LLM providers" />
33
33
  &nbsp;
@@ -39,7 +39,7 @@
39
39
  </p>
40
40
 
41
41
  <p align="center">
42
- <a href="#whats-new-in-v0330"><kbd> What's New </kbd></a>
42
+ <a href="#whats-new-in-v0390"><kbd> What's New </kbd></a>
43
43
  <a href="#quick-start"><kbd> Quick Start </kbd></a>
44
44
  <a href="#project-dev-mode-recommended"><kbd> Dev Mode </kbd></a>
45
45
  <a href="#architecture-at-a-glance"><kbd> Architecture </kbd></a>
@@ -61,7 +61,7 @@
61
61
  <details>
62
62
  <summary><strong>Table of Contents</strong></summary>
63
63
 
64
- - [What's New](#whats-new-in-v0330)
64
+ - [What's New](#whats-new-in-v0390)
65
65
  - [The Problem](#the-problem)
66
66
  - [The Solution](#the-solution)
67
67
  - [Architecture at a Glance](#architecture-at-a-glance)
@@ -78,6 +78,8 @@
78
78
  - [Customization](#customization)
79
79
  - [Showcase Templates](#showcase-templates)
80
80
  - [Profiles](#your-profile-vs-agent-profiles)
81
+ - [Task Orchestration](#task-orchestration)
82
+ - [GitHub Automation](#github-automation)
81
83
  - [Delegation](#agent-delegation)
82
84
  - [Teams](#agent-teams)
83
85
  - [Multi-agent (A2A)](#multi-agent-a2a)
@@ -97,11 +99,70 @@
97
99
 
98
100
  ---
99
101
 
100
- ## What's New in v0.33.0
102
+ ## What's New in v0.39.0
101
103
 
102
- > **One command. Full context. Zero setup.**
104
+ > **From companion to orchestrator.** Describe what you want to build — aman-agent decomposes it, delegates to specialized agents, and delivers reviewed results.
103
105
 
104
- ### `aman-agent dev` — Your New Way to Start Coding
106
+ ```bash
107
+ /orchestrate Build a REST API with auth, CRUD endpoints, input validation, and tests
108
+ ```
109
+
110
+ ```
111
+ ## REST API with Auth
112
+ **Tasks:** 5 | **Gates:** 1
113
+
114
+ - **Design API schema** → architect [advanced] (root)
115
+ - **Implement auth middleware** → coder [standard] (after: design)
116
+ - **Implement CRUD endpoints** → coder [standard] (after: design)
117
+ - **Write test suite** → tester [standard] (after: auth, crud)
118
+ - **Security review** → security [standard] (after: tests)
119
+ - 🔒 **Human approval before deploy** [approval]
120
+ ```
121
+
122
+ Five new modules shipped as the Universal Master Orchestrator:
123
+
124
+ | Phase | What it adds |
125
+ |:---|:---|
126
+ | **1. Orchestrator Engine** | DAG scheduler, multi-tier LLM routing (fast/standard/advanced), approval gates, audit trails |
127
+ | **2. GitHub-Native** | `/github plan 42` turns issues into DAGs, auto PRs, CI gate polling, safe `gh` CLI wrapper |
128
+ | **3. Agent Factory** | 4 profiles (architect, security, tester, reviewer), 3 workflow templates, self-review loop |
129
+ | **4. Project Manager** | Auto-classifies project type, maps module boundaries for parallel agents, orchestration monitoring |
130
+ | **5. Enterprise** | Circuit breakers, checkpoint/resume, cost tracking with budget enforcement, 7-rule policy engine |
131
+
132
+ **+334 tests** (867 total) across 25 new source files. [Full release notes →](https://github.com/amanasmuei/aman-agent/releases/tag/v0.39.0)
133
+
134
+ <details>
135
+ <summary><strong>Phase-by-phase details</strong></summary>
136
+
137
+ **Orchestrator Engine** — Decomposes requirements into a validated DAG (directed acyclic graph) via your LLM. Scheduler runs parallel branches respecting dependencies, pauses at human approval gates, routes each task to the right LLM tier. Immutable state machine prevents invalid transitions. Structured audit trail logs every event.
138
+
139
+ **GitHub-Native Automation** — `/github plan <issue#>` fetches an issue and decomposes it. `/github ci <branch>` polls workflow status. PR manager creates branches, opens PRs, and posts review comments. All commands use `execFile` (no shell injection).
140
+
141
+ **Agent Factory** — Four specialized profiles: **Architect** (system design, tier: advanced), **Security** (OWASP, CVE audit), **Tester** (test generation, edge cases), **Reviewer** (confidence-scored findings). Three DAG templates: `fullFeatureTemplate` (architect → coders → review + test → finalize), `bugFixTemplate`, `securityAuditTemplate`. Self-review loop runs reviewer + tester on completed output.
142
+
143
+ **Project Manager** — Classifies projects as web-frontend, api-backend, mobile, ml-data, monorepo, etc. Maps project type to recommended template and profiles. Module boundary mapper assigns non-overlapping file regions for parallel agents. Monitoring tracks phase timing, per-agent performance, and approval gates.
144
+
145
+ **Enterprise Hardening** — Circuit breaker per agent (closed/open/half-open with auto-recovery). Checkpoint/resume serializes orchestration state to disk. Cost tracker counts tokens per tier with budget enforcement. Policy engine enforces 7 built-in rules (max tasks, requires review/testing, approval before deploy, etc.) with custom rule support.
146
+
147
+ </details>
148
+
149
+ ---
150
+
151
+ <details>
152
+ <summary><strong>v0.34.0 — Multi-editor dev mode</strong></summary>
153
+
154
+ - `aman-agent dev --copilot` targets GitHub Copilot (writes `.github/copilot-instructions.md`)
155
+ - `aman-agent dev --cursor` targets Cursor (writes `.cursorrules`)
156
+ - Multi-project simultaneous sessions sharing the same memory database
157
+
158
+ </details>
159
+
160
+ <details>
161
+ <summary><strong>v0.33.0 — Project Dev Mode</strong></summary>
162
+
163
+ **One command. Full context. Zero setup.**
164
+
165
+ **`aman-agent dev` — Your New Way to Start Coding**
105
166
 
106
167
  ```bash
107
168
  cd ~/projects/amantrade && aman-agent dev
@@ -131,7 +192,7 @@ $ aman-agent dev ~/projects/amantrade
131
192
 
132
193
  Works with **multiple projects** simultaneously — each terminal gets its own `aman-agent dev`, all sharing the same memory database. Decisions from one project flow into the next.
133
194
 
134
- ---
195
+ </details>
135
196
 
136
197
  <details>
137
198
  <summary><strong>v0.32.0 — Install anywhere, zero prerequisites</strong></summary>
@@ -225,7 +286,7 @@ Other "memory" solutions are just markdown files the AI reads on startup — the
225
286
 
226
287
  ## The Solution
227
288
 
228
- **aman-agent** is the first open-source AI companion that genuinely learns from conversation. It doesn't just store memories — it recalls them per-message, extracts new knowledge automatically, and uses your LLM to intelligently compress context instead of truncating it.
289
+ **aman-agent** is the first open-source AI companion that genuinely learns from conversation and orchestrates multi-agent workflows. It recalls memories per-message, extracts new knowledge automatically, decomposes complex requirements into parallel task graphs, and delegates to specialized agents all running locally with any LLM.
229
290
 
230
291
  ```bash
231
292
  npx @aman_asmuei/aman-agent
@@ -237,35 +298,76 @@ npx @aman_asmuei/aman-agent
237
298
 
238
299
  ## Architecture at a Glance
239
300
 
240
- 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.
301
+ aman-agent is the **runtime** at the center of the aman ecosystem — 78 TypeScript modules that stitch together memory, identity, orchestration, and any LLM into one coherent system.
241
302
 
242
303
  ```mermaid
243
- flowchart LR
244
- User([You]) <--> CLI[aman-agent CLI<br/>chat loop]
304
+ flowchart TB
305
+ User([You]) <--> CLI[aman-agent CLI]
306
+
307
+ subgraph core [" Agent Core "]
308
+ Agent[agent.ts<br/>message loop]
309
+ Hooks[hooks.ts<br/>lifecycle]
310
+ Skills[skill-engine<br/>+ crystallization]
311
+ Obs[observation<br/>+ postmortem]
312
+ Personality[user-model<br/>+ personality]
313
+ end
314
+
315
+ subgraph orchestrator [" Orchestrator Engine "]
316
+ DAG[DAG scheduler<br/>parallel execution]
317
+ Decompose[LLM decompose<br/>requirement → DAG]
318
+ Templates[workflow templates<br/>feature · bugfix · audit]
319
+ ReviewLoop[self-review loop<br/>reviewer + tester]
320
+ Gate[approval gates<br/>+ CI gates]
321
+ CB[circuit breaker<br/>+ checkpoint]
322
+ Policy[policy engine<br/>+ cost tracker]
323
+ end
245
324
 
246
- CLI --> Agent[agent.ts<br/>message orchestration]
247
- Agent --> Hooks[hooks.ts<br/>lifecycle events]
325
+ subgraph github [" GitHub-Native "]
326
+ GH[gh CLI wrapper]
327
+ Issues[issue → DAG<br/>planner]
328
+ PRs[PR manager<br/>+ CI polling]
329
+ end
330
+
331
+ subgraph project [" Project Manager "]
332
+ Detect[project classifier<br/>stack → type]
333
+ ModMap[module boundary<br/>mapper]
334
+ Monitor[orchestration<br/>monitoring]
335
+ end
248
336
 
337
+ CLI --> Agent
338
+ Agent --> Hooks
339
+ Agent --> orchestrator
249
340
  Agent -->|recall &amp; extract| Memory[(amem-core<br/>SQLite + vectors)]
250
- Agent -->|who &amp; prefs| Identity[(acore-core<br/>identity)]
251
- Agent -->|boundaries| Rules[(arules-core<br/>guardrails)]
252
- Agent -->|auto-trigger| Skills[skill-engine<br/>+ crystallization]
253
- Agent -->|telemetry| Obs[observation<br/>+ postmortem]
341
+ Agent -->|identity| Identity[(acore-core)]
342
+ Agent -->|guardrails| Rules[(arules-core)]
343
+
344
+ orchestrator --> Delegate[delegate.ts<br/>+ teams.ts]
345
+ orchestrator --> Profiles[agent profiles<br/>architect · security<br/>tester · reviewer]
346
+ orchestrator --> github
347
+ orchestrator --> project
254
348
 
255
349
  Agent --> LLM{LLM Router}
256
350
  LLM --> Claude[Anthropic]
257
351
  LLM --> GPT[OpenAI]
258
352
  LLM --> Copilot[GH Copilot]
259
- LLM --> Ollama[Ollama local]
353
+ LLM --> Ollama[Ollama]
260
354
 
261
- Agent <--> MCP[MCP tools<br/>aman-mcp · amem]
355
+ Agent <-->|MCP| MCP[aman-mcp · amem]
262
356
 
263
- classDef core fill:#58a6ff22,stroke:#58a6ff,color:#e6edf3,stroke-width:2px;
264
- classDef store fill:#3fb95022,stroke:#3fb950,color:#e6edf3,stroke-width:2px;
357
+ classDef core fill:#58a6ff15,stroke:#58a6ff,color:#e6edf3,stroke-width:2px;
358
+ classDef orch fill:#a371f715,stroke:#a371f7,color:#e6edf3,stroke-width:2px;
359
+ classDef gh fill:#3fb95015,stroke:#3fb950,color:#e6edf3,stroke-width:2px;
360
+ classDef proj fill:#d29f2215,stroke:#d29f22,color:#e6edf3,stroke-width:2px;
361
+ classDef store fill:#3fb95022,stroke:#3fb950,color:#e6edf3,stroke-width:1px;
265
362
  classDef llm fill:#d29f2222,stroke:#d29f22,color:#e6edf3,stroke-width:1px;
266
- class CLI,Agent,Hooks,Skills,Obs core
363
+
364
+ class Agent,Hooks,Skills,Obs,Personality core
365
+ class DAG,Decompose,Templates,ReviewLoop,Gate,CB,Policy orch
366
+ class GH,Issues,PRs gh
367
+ class Detect,ModMap,Monitor proj
267
368
  class Memory,Identity,Rules store
268
369
  class Claude,GPT,Copilot,Ollama,LLM llm
370
+ class Delegate,Profiles,MCP core
269
371
  ```
270
372
 
271
373
  <details>
@@ -274,7 +376,11 @@ flowchart LR
274
376
  | Piece | What it does | Where it lives |
275
377
  |:---|:---|:---|
276
378
  | `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) |
277
- | `commands.ts` | 58+ slash commands (`/memory`, `/skills`, `/plan`, `/delegate`, `/eval`, `/observe`, `/postmortem`, …) | `src/commands.ts` (98 KB) |
379
+ | `commands.ts` | 60+ slash commands (`/memory`, `/skills`, `/plan`, `/delegate`, `/orchestrate`, `/eval`, `/observe`, `/postmortem`, …) | `src/commands.ts` (100 KB) |
380
+ | `orchestrator/` | DAG-based task decomposition, parallel scheduling, multi-tier model routing, approval gates, audit trails | `src/orchestrator/` (8 files) |
381
+ | `github/` | GitHub-native automation — issue planning, PR management, CI gates, safe `gh` CLI wrapper | `src/github/` (6 files) |
382
+ | `profiles/` | Specialized agent profiles for orchestrator delegation (architect, security, tester, reviewer) | `src/profiles/` |
383
+ | `orchestrator/templates/` | Pre-built DAG templates for common workflows (full-feature, bug-fix, security-audit) | `src/orchestrator/templates/` |
278
384
  | `hooks.ts` | 5 lifecycle hooks that fire at startup, before/after tools, on workflow match, on session end | `src/hooks.ts` (26 KB) |
279
385
  | `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` |
280
386
  | `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` |
@@ -836,6 +942,99 @@ Each agent profile has its own identity, rules, and skills — but shares the sa
836
942
 
837
943
  </details>
838
944
 
945
+ <details>
946
+ <summary><strong>Task Orchestration</strong> (new in v0.39)</summary>
947
+
948
+ ### Task Orchestration
949
+
950
+ Describe what you want to build — aman-agent decomposes it into a DAG of tasks, assigns each to the right specialist agent, and executes them in parallel:
951
+
952
+ ```
953
+ You > /orchestrate Add user authentication with JWT, password hashing, and rate limiting
954
+
955
+ Decomposing requirement into task DAG...
956
+
957
+ ## User Authentication
958
+ **Goal:** JWT auth with security hardening
959
+ **Tasks:** 5 | **Gates:** 1
960
+
961
+ - **Design auth architecture** → architect [advanced] (root)
962
+ - **Implement JWT middleware** → coder [standard] (after: design)
963
+ - **Add rate limiting** → coder [standard] (after: design)
964
+ - **Write test suite** → tester [standard] (after: jwt, rate-limit)
965
+ - **Security review** → security [standard] (after: tests)
966
+ - 🔒 **Human approval** [approval]
967
+ ```
968
+
969
+ **How it works:**
970
+ 1. Your LLM decomposes the requirement into a validated DAG (no cycles, valid refs)
971
+ 2. The scheduler runs independent tasks in parallel (configurable concurrency)
972
+ 3. Each task is routed to the right LLM tier — Haiku for simple, Sonnet for coding, Opus for architecture
973
+ 4. Approval gates pause execution for human review at critical points
974
+ 5. After completion, the self-review loop runs reviewer + tester agents on the output
975
+ 6. Circuit breakers prevent cascade failures; checkpoints enable crash recovery
976
+
977
+ **Pre-built templates:**
978
+
979
+ ```
980
+ /orchestrate --template full-feature # architect → coders → review + test
981
+ /orchestrate --template bug-fix # reproduce → fix → test → review
982
+ /orchestrate --template security-audit # scan → triage → fix → rescan
983
+ ```
984
+
985
+ **Cost awareness:** The cost tracker monitors token usage per tier. Set a budget limit in config to prevent runaway costs.
986
+
987
+ </details>
988
+
989
+ <details>
990
+ <summary><strong>GitHub Automation</strong> (new in v0.39)</summary>
991
+
992
+ ### GitHub Automation
993
+
994
+ aman-agent speaks GitHub natively via the `gh` CLI:
995
+
996
+ ```
997
+ You > /github
998
+
999
+ Repo: amanasmuei/aman-agent (authenticated)
1000
+ Branch: main
1001
+
1002
+ You > /github issues --limit 5
1003
+
1004
+ #42 Add user auth feature, security alice
1005
+ #41 Fix login redirect bug bob
1006
+ #40 Update dependencies chore unassigned
1007
+ ...
1008
+
1009
+ You > /github plan 42
1010
+
1011
+ Fetching issue #42: "Add user auth"...
1012
+ Decomposing into task DAG...
1013
+
1014
+ ## Add user auth
1015
+ **Tasks:** 4 | **Gates:** 1
1016
+ - **Design auth flow** → architect [advanced] (root)
1017
+ - **Implement JWT** → coder [standard] (after: design)
1018
+ - **Write tests** → tester [standard] (after: implement)
1019
+ - **Security review** → security [standard] (after: tests)
1020
+
1021
+ You > /github ci main
1022
+
1023
+ CI Status: ✓ passing (workflow: ci.yml, 2m ago)
1024
+ ```
1025
+
1026
+ **Available commands:**
1027
+
1028
+ | Command | Description |
1029
+ |:---|:---|
1030
+ | `/github` | Show current repo info and auth status |
1031
+ | `/github issues` | List open issues |
1032
+ | `/github prs` | List open pull requests |
1033
+ | `/github plan <number>` | Decompose issue into orchestrator task DAG |
1034
+ | `/github ci <branch>` | Check CI status for a branch |
1035
+
1036
+ </details>
1037
+
839
1038
  <details>
840
1039
  <summary><strong>Agent Delegation</strong></summary>
841
1040
 
@@ -1391,6 +1590,8 @@ sequenceDiagram
1391
1590
  | `/help` | Show available commands |
1392
1591
  | `/plan` | Show active plan `[create\|done\|undo\|list\|switch\|show]` |
1393
1592
  | `/profile` | Your profile + agent profiles `[me\|edit\|setup\|create\|list\|show\|delete]` |
1593
+ | `/orchestrate` | Decompose requirement into task DAG and execute with parallel agents `[<requirement>]` |
1594
+ | `/github` | GitHub operations `[issues\|prs\|plan <number>\|ci <branch>]` |
1394
1595
  | `/delegate` | Delegate task to a profile `[<profile> <task>\|pipeline]` |
1395
1596
  | `/agents` | Multi-agent A2A `[list\|info <name>\|ping <name>]` |
1396
1597
  | `/team` | Manage agent teams `[create\|run\|list\|show\|delete]` |