|
1 | | -# Masters Of AI Harness — Design |
| 1 | +# Masters Of AI Harness -- Design |
2 | 2 |
|
3 | | -A standalone agent runtime with two interfaces. Write a markdown agent definition, run an agent — interactively via terminal TUI for single-user iteration, or as a web service via `--serve` for multi-user remote access. Both share the same agent runtime: IDENTITY.md loading, Claude Agent SDK, in-process MCP tools, sub-agents, sessions, and memory. |
| 3 | +Agent runtime with full system prompt control. Two interfaces, one core. |
4 | 4 |
|
5 | 5 | ``` |
6 | | -Terminal TUI: mastersof-ai [--agent x] → React/Ink, single user, local |
7 | | -Web UI: mastersof-ai --serve [--port 3100] → Fastify + React SPA, multi-user, token auth |
| 6 | +Terminal TUI: mastersof-ai [--agent x] Single user, local, React/Ink |
| 7 | +Web UI: mastersof-ai --serve [--port 3100] Multi-user, token auth, Fastify + React SPA |
8 | 8 | ``` |
9 | 9 |
|
| 10 | +Both share: agent loading, IDENTITY.md parsing, Claude Agent SDK, MCP tools, sub-agents, sessions, memory. |
| 11 | + |
| 12 | +## Architecture at a Glance |
| 13 | + |
| 14 | +``` |
| 15 | +IDENTITY.md --> System prompt assembly --> Claude Agent SDK (query/streaming) |
| 16 | + | | |
| 17 | + MCP tools (9 domains) Sub-agents (researcher, |
| 18 | + External MCP servers deep-thinker, writer) |
| 19 | + | |
| 20 | + +------+------+ |
| 21 | + | | |
| 22 | + TUI mode Serve mode |
| 23 | + React/Ink Fastify + React SPA |
| 24 | + Token auth, rate limits, |
| 25 | + per-user isolation, |
| 26 | + cost caps, hot reload |
| 27 | +``` |
| 28 | + |
| 29 | +## Key Files |
| 30 | + |
| 31 | +| What | Where | |
| 32 | +|------|-------| |
| 33 | +| Entry point | `bin/mastersof-ai.js` --> `src/index.tsx` | |
| 34 | +| Agent loading | `src/agent-context.ts` + `src/manifest.ts` | |
| 35 | +| System prompt + SDK | `src/agent.ts` | |
| 36 | +| MCP tool servers | `src/tools/` (one file per domain) | |
| 37 | +| Sub-agents | `src/agents/` (researcher, deep-thinker, writer) | |
| 38 | +| Serve backend | `src/serve.ts` (Fastify REST + WebSocket) | |
| 39 | +| Web frontend | `web/src/` (React + Vite + Tailwind SPA) | |
| 40 | +| A2A protocol | `src/a2a/` (server, client tools, agent cards) | |
| 41 | +| TUI | `src/components/` (React/Ink -- do not touch unless broken) | |
| 42 | +| Config | `~/.mastersof-ai/config.yaml` | |
| 43 | +| Auth | `~/.mastersof-ai/access.yaml` | |
| 44 | + |
10 | 45 | ## Docs |
11 | 46 |
|
12 | | -- **[Architecture](docs/architecture.md)** — dual-interface model, source layout, tech stack |
13 | | -- **[Agents](docs/agents.md)** — agent loading, identity, frontmatter, sub-agents, scratchpad |
14 | | -- **[Memory](docs/memory.md)** — persistent memory system, auto-loaded context, memory tools |
15 | | -- **[Tools](docs/tools.md)** — tool system, available tools (scratchpad, A2A client), design principles |
16 | | -- **[Configuration](docs/configuration.md)** — config file, CLI, hooks, serve mode, access control, sessions |
17 | | -- **[Secrets](docs/secrets.md)** — per-agent encrypted secrets via dotenvx |
18 | | -- **[Sandbox](docs/sandbox.md)** — bubblewrap isolation, per-agent config |
19 | | -- **[Design Decisions](docs/design-decisions.md)** — rationale for key choices |
20 | | -- **[Changelog](CHANGELOG.md)** — version history and notable changes |
| 47 | +Detailed documentation for each area: |
| 48 | + |
| 49 | +- **[Architecture](docs/architecture.md)** -- Dual-interface model, data flow, source map, tech stack |
| 50 | +- **[Agents](docs/agents.md)** -- Creating agents, IDENTITY.md frontmatter, sub-agents, best practices |
| 51 | +- **[Memory](docs/memory.md)** -- Persistent memory system, auto-loaded context, memory tools |
| 52 | +- **[Tools](docs/tools.md)** -- Tool system, available tools, scratchpad, A2A client, MCP tool search |
| 53 | +- **[Configuration](docs/configuration.md)** -- Config file, serve mode, access control, rate limits, privacy |
| 54 | +- **[Secrets](docs/secrets.md)** -- Per-agent encrypted secrets via dotenvx |
| 55 | +- **[Sandbox](docs/sandbox.md)** -- Bubblewrap isolation, per-agent config |
| 56 | +- **[Design Decisions](docs/design-decisions.md)** -- Rationale for key choices |
| 57 | +- **[Changelog](CHANGELOG.md)** -- Version history and notable changes |
| 58 | + |
| 59 | +## Running Locally |
| 60 | + |
| 61 | +```bash |
| 62 | +npx tsx bin/mastersof-ai.js # TUI with default agent |
| 63 | +npx tsx bin/mastersof-ai.js --agent analyst # TUI with specific agent |
| 64 | +npx tsx bin/mastersof-ai.js --serve # Web server on port 3100 |
| 65 | +npx tsx bin/mastersof-ai.js --serve --port 5000 # Custom port |
| 66 | +npx tsx bin/mastersof-ai.js --agent analyst --sandbox # Bubblewrap sandbox |
| 67 | +npx tsx bin/mastersof-ai.js --card # Output Agent Card JSON |
| 68 | +npx tsx bin/mastersof-ai.js --list-agents # List all agents |
| 69 | +``` |
0 commit comments