titan-agent 2026.4.21 → 2026.4.22

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 (40) hide show
  1. package/README.md +255 -192
  2. package/dist/agent/agent.js +16 -1
  3. package/dist/agent/agent.js.map +1 -1
  4. package/dist/agent/generator.js +17 -2
  5. package/dist/agent/generator.js.map +1 -1
  6. package/dist/cli/index.js +265 -24
  7. package/dist/cli/index.js.map +1 -1
  8. package/dist/gateway/server.js +282 -18
  9. package/dist/gateway/server.js.map +1 -1
  10. package/dist/skills/builtin/apply_patch.js +17 -2
  11. package/dist/skills/builtin/apply_patch.js.map +1 -1
  12. package/dist/skills/builtin/auto_generate.js +17 -2
  13. package/dist/skills/builtin/auto_generate.js.map +1 -1
  14. package/dist/skills/builtin/browser.js +17 -2
  15. package/dist/skills/builtin/browser.js.map +1 -1
  16. package/dist/skills/builtin/cron.js +17 -2
  17. package/dist/skills/builtin/cron.js.map +1 -1
  18. package/dist/skills/builtin/filesystem.js +17 -2
  19. package/dist/skills/builtin/filesystem.js.map +1 -1
  20. package/dist/skills/builtin/memory_skill.js +17 -2
  21. package/dist/skills/builtin/memory_skill.js.map +1 -1
  22. package/dist/skills/builtin/process.js +17 -2
  23. package/dist/skills/builtin/process.js.map +1 -1
  24. package/dist/skills/builtin/sessions.js +17 -2
  25. package/dist/skills/builtin/sessions.js.map +1 -1
  26. package/dist/skills/builtin/shell.js +17 -2
  27. package/dist/skills/builtin/shell.js.map +1 -1
  28. package/dist/skills/builtin/vision.js +17 -2
  29. package/dist/skills/builtin/vision.js.map +1 -1
  30. package/dist/skills/builtin/voice.js +17 -2
  31. package/dist/skills/builtin/voice.js.map +1 -1
  32. package/dist/skills/builtin/web_fetch.js +17 -2
  33. package/dist/skills/builtin/web_fetch.js.map +1 -1
  34. package/dist/skills/builtin/web_search.js +17 -2
  35. package/dist/skills/builtin/web_search.js.map +1 -1
  36. package/dist/skills/builtin/webhook.js +17 -2
  37. package/dist/skills/builtin/webhook.js.map +1 -1
  38. package/dist/skills/registry.js +17 -2
  39. package/dist/skills/registry.js.map +1 -1
  40. package/package.json +6 -2
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # TITAN — The Intelligent Task Automation Network
1
+ # TITAN — The Intelligent Task Automation Network
2
2
 
3
3
  <p align="center">
4
4
  <img src="assets/titan-logo.png" alt="TITAN Logo" width="280"/>
@@ -10,9 +10,10 @@
10
10
 
11
11
  <p align="center">
12
12
  <a href="#quick-start">Quick Start</a> •
13
- <a href="#why-titan">Why TITAN?</a> •
14
13
  <a href="#features">Features</a> •
14
+ <a href="#cli-reference">CLI Reference</a> •
15
15
  <a href="#mission-control">Mission Control</a> •
16
+ <a href="#providers">Providers</a> •
16
17
  <a href="#comparison">Comparison</a> •
17
18
  <a href="#roadmap">Roadmap</a>
18
19
  </p>
@@ -21,7 +22,7 @@
21
22
 
22
23
  ## Quick Start
23
24
 
24
- **Requirements:** Node.js 20, npm 9
25
+ **Requirements:** Node.js >= 20, npm >= 9
25
26
 
26
27
  ```bash
27
28
  npm install -g titan-agent
@@ -30,262 +31,324 @@ titan gateway # Start Mission Control at http://localhost:48420
30
31
  titan agent -m "Hello" # Send a direct message
31
32
  ```
32
33
 
33
- ### Run from Source (for developers)
34
+ ### Run from Source
35
+
34
36
  ```bash
35
37
  git clone https://github.com/Djtony707/TITAN.git
36
38
  cd TITAN/titan
37
39
  npm install
38
40
  cp .env.example .env # Add your API keys
39
41
  npm run onboard
40
- npm run gateway
42
+ npm run dev:gateway
41
43
  ```
42
44
 
45
+ ---
43
46
 
44
- ## Why TITAN?
47
+ ## Features
45
48
 
46
- TITAN was built to solve the real problems with every other AI agent framework in 2026:
49
+ ### Prompt Injection Shield
47
50
 
48
- | The Problem | Who Has It | TITAN's Solution |
49
- |------------|-----------|-----------------|
50
- | **Infinite loop hell** | OpenClaw, NanoClaw, PicoClaw | **Loop Detection + Circuit Breaker** — 3 detectors (repeat, no-progress, ping-pong) with configurable thresholds |
51
- | **Token waste & high cost** | OpenClaw (430K LoC, 1GB+ RAM) | **Smart Context Manager** — auto-summarizes old history, priority-based allocation, token budget tracking |
52
- | **Goal drift / runaway agents** | Most agent frameworks | **Task Planner** — dependency graphs, 3x retry, parallel task execution with progress tracking |
53
- | **No learning from mistakes** | All alternatives | **Continuous Learning Engine** — tracks tool success rates, error patterns, and injects knowledge into every prompt |
54
- | **Basic dashboards** | OpenClaw, NanoClaw, IronClaw | **Mission Control GUI** — premium 11-panel dark-mode dashboard with WebSocket real-time updates |
55
- | **Native dependencies / complex setup** | OpenClaw (native deps), IronClaw (Rust), ZeroClaw (Rust), PicoClaw (Go) | **Pure TypeScript** — `npm install` just works, no compilation required |
51
+ Zero tolerance for unauthorized takeovers (`src/security/shield.ts`):
56
52
 
57
- ---
53
+ - **Heuristic Engine** — Detects and blocks "ignore previous instructions", "developer mode", and system prompt extraction attempts.
54
+ - **Strict Mode** — Scans for keyword density and tail manipulations in large payloads.
55
+ - **DM Pairing System** — Approve or deny access from new senders before they can interact with your agent (`src/security/pairing.ts`).
58
56
 
59
- ## Features
57
+ ### Loop Detection and Circuit Breaker
58
+
59
+ No more infinite tool loops (`src/agent/loopDetection.ts`). Three detection algorithms run in parallel:
60
+
61
+ - **Generic Repeat** — Same tool with identical arguments called repeatedly.
62
+ - **No-Progress Polling** — Tool returns identical output on consecutive calls.
63
+ - **Ping-Pong** — Alternating A/B tool patterns with no forward progress.
64
+ - **Global Circuit Breaker** — Hard stop after a configurable threshold.
65
+
66
+ ### Task Planner with Dependency Graphs
67
+
68
+ `src/agent/planner.ts`:
69
+
70
+ - Automatic goal decomposition into ordered sub-tasks.
71
+ - Dependency tracking — tasks only execute when prerequisites are met.
72
+ - 3x auto-retry on failure with exponential backoff.
73
+ - Parallel execution of independent tasks.
74
+ - Persistent plan state at `~/.titan/plans/`.
75
+
76
+ ### Smart Context Manager
77
+
78
+ `src/agent/contextManager.ts`:
79
+
80
+ - Auto-summarizes old conversation history to stay within token budgets.
81
+ - Priority-based context allocation (recent > relevant > old).
82
+ - Per-model token limit enforcement with smart truncation that preserves tool call context.
83
+
84
+ ### Cost Optimizer
85
+
86
+ `src/agent/costOptimizer.ts`:
87
+
88
+ - Intelligently routes requests to cheaper models when full power is not needed.
89
+ - Tracks real-time cost per session against configurable budgets.
90
+ - Context summarization reduces token usage by 30–90% on long sessions.
91
+
92
+ ### Continuous Learning Engine
60
93
 
61
- ### 🛡️ Prompt Injection Shield & RBAC (TITAN-exclusive)
62
- Zero tolerance for unauthorized takeovers:
63
- - **Heuristic Engine** Detects and blocks "ignore previous instructions", "developer mode", and system prompt extraction logic.
64
- - **Strict Mode** Scans for keyword density and tail manipulations in massive payloads.
65
- - **Role-Based Access Control (RBAC)** Unverified / guest users are structurally blocked from executing dangerous tools, even if TITAN is in full autonomous mode.
66
-
67
- ### 🛡️ Loop Detection & Circuit Breaker (TITAN-exclusive)
68
- No more infinite tool loops. Three detection algorithms:
69
- - **Generic Repeat** — same tool + same args called repeatedly
70
- - **No-Progress Polling** — tool returns identical output each time
71
- - **Ping-Pong** — alternating A↔B patterns with no progress
72
- - **Global Circuit Breaker** — hard stop after configurable threshold
73
-
74
- ### 📋 Task Planner with Dependency Graphs (TITAN-exclusive)
75
- - Automatic goal decomposition into sub-tasks
76
- - Dependency tracking — tasks only execute when prerequisites are met
77
- - 3x auto-retry on failure with exponential backoff
78
- - Parallel execution of independent tasks
79
- - Persistent plan tracking (`~/.titan/plans/`)
80
-
81
- ### 🧠 Smart Context Manager (TITAN-exclusive)
82
- - Auto-summarizes old conversation history to save tokens
83
- - Priority-based context allocation (recent > relevant > old)
84
- - Token budget tracking with per-model limits
85
- - Smart truncation that preserves tool call context
86
-
87
- ### 🧠 Continuous Learning Engine
88
- - Tracks tool success/failure rates across all interactions
89
- - Records error patterns and resolutions
90
- - Builds persistent knowledge base (`~/.titan/knowledge.json`)
91
- - Injects learned context into every system prompt
92
- - **TITAN actually gets smarter the more you use it**
93
-
94
- ### 🤖 Multi-Agent System (up to 5 concurrent)
95
- - Independent agent instances with different models/prompts
96
- - Channel-based routing each agent binds to specific channels
97
- - Manage via CLI (`titan agents`) or Mission Control GUI
98
-
99
- ### 🔧 17+ Built-in Tools
100
- | Group | Tools |
101
- |-------|-------|
102
- | **Runtime** | `exec` (background/timeout), `process` (list/poll/kill/log), `shell` |
94
+ `src/memory/learning.ts`:
95
+
96
+ - Tracks tool success and failure rates across all interactions.
97
+ - Records error patterns and successful resolutions.
98
+ - Builds a persistent knowledge base at `~/.titan/knowledge.json`.
99
+ - Injects learned context into every system prompt automatically.
100
+ - TITAN gets more effective the more you use it.
101
+
102
+ ### Relationship Memory
103
+
104
+ `src/memory/relationship.ts`:
105
+
106
+ - Persistent user profile (`~/.titan/profile.json`) that survives restarts.
107
+ - Remembers your name, preferences, work context, and interaction history.
108
+ - Provides JARVIS-like personal continuity across sessions.
109
+
110
+ ### Multi-Agent System
111
+
112
+ `src/agent/multiAgent.ts`:
113
+
114
+ - Up to 5 concurrent independent agent instances.
115
+ - Each agent can run a different model and system prompt.
116
+ - Channel-based routing agents bind to specific channels.
117
+ - Spawn and stop agents from the CLI or Mission Control GUI.
118
+
119
+ ### Kimi Swarm Architecture
120
+
121
+ `src/agent/swarm.ts`:
122
+
123
+ - Specialized routing for Ollama kimi-k2.5 models.
124
+ - Prevents context collapse by splitting the 22-tool set into domain-focused sub-agents (file, web, system, memory).
125
+ - Each sub-agent receives 3–4 tools instead of the full monolith.
126
+
127
+ ### 22 Built-in Skills
128
+
129
+ | Group | Skills |
130
+ |-------|--------|
131
+ | **Runtime** | `shell`, `exec` (background/timeout), `process` (list/poll/kill/log) |
103
132
  | **Filesystem** | `read`, `write`, `edit`, `list_dir`, `apply_patch` |
104
- | **Web** | `web_search`, `web_fetch`, `browser` (CDP) |
133
+ | **Web** | `web_search`, `web_fetch`, `browser` (CDP), `web_browser` (Playwright bulk DOM) |
105
134
  | **Intelligence** | `auto_generate_skill`, `analyze_image` (Vision), `transcribe_audio` (STT), `generate_speech` (TTS) |
106
135
  | **Automation** | `cron`, `webhook` |
107
- | **Memory** | `memory`, `learning` |
136
+ | **Memory** | `memory_skill`, `model_switch` |
108
137
  | **Sessions** | `sessions_list`, `sessions_history`, `sessions_send`, `sessions_close` |
109
138
 
110
- ### 🧬 Skill Auto-Generation & Plugin Marketplace
111
- - **Self-Writing Code** — If TITAN lacks a tool for your request, it uses `auto_generate_skill` to write it in TypeScript, compile it, and hot-load it instantly.
112
- - **Plugin Marketplace** Browse and install community skills via `titan skills install <name>`.
139
+ ### Skill Auto-Generation
140
+
141
+ - If TITAN encounters a task it cannot solve with existing tools, `auto_generate_skill` writes a new TypeScript skill, compiles it, and hot-loads it instantly.
142
+ - Auto-generated skills are saved to `~/.titan/skills/auto/` and persist across restarts.
143
+
144
+ ### Graphiti Temporal Memory
145
+
146
+ - Neo4j + Graphiti MCP server via Docker Compose.
147
+ - Provides graph-based temporal memory for complex, time-aware knowledge retrieval.
148
+ - Start with `titan graphiti --init`, stop with `titan graphiti --down`.
149
+
150
+ ### Recipes
113
151
 
114
- ### 👁️ Multimodal (Vision & Voice)
115
- - **Vision** — TITAN can "see" images via Claude 3.5 Sonnet / GPT-4o using the `analyze_image` tool.
116
- - **Voice** — TITAN handles Speech-to-Text (Whisper) and Text-to-Speech via the `transcribe_audio` and `generate_speech` tools.
152
+ `src/recipes/`:
117
153
 
118
- ### 📡 10+ Channel Adapters
119
- Discord · Telegram · Slack · Google Chat · WebChat · WhatsApp · Matrix · Signal · MS Teams · BlueBubbles
154
+ - Reusable multi-step workflows defined as structured configs.
155
+ - Trigger with slash commands in any connected channel.
156
+ - Parameterized — pass values at invocation time.
120
157
 
121
- ### 🔐 Security
122
- - **E2E Encrypted Sessions** — AES-256-GCM encryption for sensitive conversations (keys held securely in-memory).
123
- - DM pairing (approve/deny new senders)
124
- - Docker sandbox for non-main sessions
125
- - Tool/path/network allowlisting
158
+ ### MCP Support
126
159
 
127
- ### 🤝 Model Agnostic
128
- Anthropic (Claude) · OpenAI (GPT) · Google (Gemini) · Ollama (local) — with automatic failover
160
+ `src/mcp/`:
161
+
162
+ - Connect external tools and services via the Model Context Protocol.
163
+ - Register MCP servers by URL; tools are exposed automatically to the agent.
164
+
165
+ ### E2E Encrypted Sessions
166
+
167
+ `src/security/encryption.ts`:
168
+
169
+ - AES-256-GCM encryption for sensitive conversations.
170
+ - Keys are generated per-session and held in memory only.
171
+
172
+ ### Channel Adapters
173
+
174
+ Discord · Telegram · Slack · Google Chat · WebChat · WhatsApp
175
+
176
+ Each adapter is an independent module in `src/channels/`.
177
+
178
+ ### Model-Agnostic
179
+
180
+ Anthropic · OpenAI · Google · Ollama — with automatic failover between providers.
181
+
182
+ ---
183
+
184
+ ## CLI Reference
185
+
186
+ | Command | Description |
187
+ |---------|-------------|
188
+ | `titan onboard` | Interactive setup wizard — configure provider, API keys, and channels |
189
+ | `titan gateway` | Start Mission Control at `http://localhost:48420` |
190
+ | `titan agent -m "..."` | Send a direct message to your agent |
191
+ | `titan send --to ch:id -m "..."` | Send a message to a specific channel |
192
+ | `titan pairing` | Manage DM access control (approve/deny senders) |
193
+ | `titan agents` | Multi-agent management (spawn, stop, list) |
194
+ | `titan doctor` | System diagnostics — checks config, connectivity, and dependencies |
195
+ | `titan skills` | Skill management (list, install, generate) |
196
+ | `titan config` | View or edit configuration |
197
+ | `titan update` | Update TITAN to the latest version |
198
+ | `titan graphiti --init` | Start Graphiti temporal memory stack (Docker) |
199
+ | `titan graphiti --down` | Stop Graphiti stack and deregister MCP server |
129
200
 
130
201
  ---
131
202
 
132
203
  ## Mission Control
133
204
 
134
- TITAN ships with a premium **Mission Control** web GUI — a dark-mode dashboard served from the gateway at `http://localhost:48420`.
205
+ TITAN ships with a **Mission Control** web GUI — a dark-mode dashboard served from the gateway at `http://localhost:48420`.
206
+
207
+ ### Panels
135
208
 
136
- ### 11 Panels:
137
209
  | Panel | Description |
138
210
  |-------|-------------|
139
- | **📊 Overview** | System health, stats, uptime, memory, version |
140
- | **💬 WebChat** | Built-in chat with real-time WebSocket |
141
- | **🤖 Agents** | Spawn/stop agents, capacity monitor |
142
- | **🧩 Skills** | Installed skills with version and status |
143
- | **⚙️ Processes** | Background process management |
144
- | **📋 Plans** | Task planner visualization and progress |
145
- | **🔗 Sessions** | Active session list with message counts |
146
- | **📡 Channels** | Channel adapter connection status |
147
- | **🔒 Security** | Security audit and pairing management |
148
- | **🧠 Learning** | Learning engine stats and tool success rates |
149
- | **📜 Logs** | Real-time system log viewer |
211
+ | **Overview** | System health, uptime, memory usage, version |
212
+ | **WebChat** | Built-in real-time chat via WebSocket |
213
+ | **Agents** | Spawn and stop agent instances, view capacity |
214
+ | **Settings** | 6-tab configuration: AI and Model, Providers, Channels, Security, Gateway, Profile |
215
+ | **Channels** | Connection status for each channel adapter |
216
+ | **Skills** | Installed skills with status |
217
+ | **Sessions** | Active session list with message counts |
218
+ | **Learning** | Learning engine stats and tool success rates |
219
+ | **Security** | Security audit log and DM pairing management |
220
+ | **Graphiti** | Temporal memory panel (Neo4j/Graphiti integration) |
221
+
222
+ The Settings panel covers provider API keys, model selection, autonomy mode, channel configuration, gateway options, and user profile — all editable live without restarting.
150
223
 
151
224
  ---
152
225
 
153
- ## Comparison
226
+ ## Providers
154
227
 
155
- ### TITAN vs. 2026 OpenClaw Ecosystem
228
+ | Provider | Models | Cost |
229
+ |----------|--------|------|
230
+ | **Anthropic** | Claude Opus 4, Claude Sonnet 4, Claude Haiku 4 | Paid |
231
+ | **OpenAI** | GPT-4o, GPT-4o-mini, o-series | Paid |
232
+ | **Google** | Gemini 2.5 Flash/Pro, Gemini 2.0 Flash, Gemini 1.5 Flash/Pro | Paid |
233
+ | **Ollama** | Any locally installed model (kimi-k2.5, llama, mistral, etc.) | Free |
156
234
 
157
- | Feature | **TITAN** | OpenClaw | NanoClaw | IronClaw | PicoClaw | ZeroClaw | TrustClaw | Nanobot |
158
- |---------|-----------|----------|----------|----------|----------|----------|-----------|---------|
159
- | **Language** | TypeScript | TypeScript | TypeScript | Rust | Go | Rust | Cloud | Python |
160
- | **Codebase** | ~7K LoC | ~430K LoC | ~500 LoC | Medium | Small | Small | Managed | ~4K LoC |
161
- | **Native deps** | ❌ None | ✅ Required | ❌ | ✅ (Rust) | ✅ (Go) | ✅ (Rust) | N/A | ❌ |
162
- | **Loop detection** | ✅ 3 detectors + circuit breaker | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
163
- | **Task planner** | ✅ Dependency graphs | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
164
- | **Smart context** | ✅ Auto-summarize + budget | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
165
- | **Continuous learning** | ✅ Built-in | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
166
- | **Multi-agent** | ✅ Up to 5 | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
167
- | **Mission Control GUI** | ✅ 11 panels, premium | ✅ Basic | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ |
168
- | **Browser control** | ✅ CDP | ✅ CDP | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ |
169
- | **Background processes** | ✅ exec+process | ✅ | ❌ | ✅ | ❌ | ✅ | ✅ | ✅ |
170
- | **Apply patch** | ✅ Unified diffs | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
171
- | **DM pairing** | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
172
- | **Docker sandbox** | ✅ | ✅ | ✅ | Wasm | ❌ | ✅ | ✅ Cloud | ❌ |
173
- | **Channels** | 10+ | 12+ | WhatsApp | Limited | Limited | Multiple | Multiple | Multiple |
174
- | **Memory** | ✅ Persistent + learning | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ |
175
- | **Local models (Ollama)** | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ |
176
- | **RAM usage** | ~50MB | ~1GB+ | ~30MB | ~20MB | <10MB | <5MB | Cloud | ~40MB |
177
- | **Setup complexity** | `npm install` | Complex | Docker | Compile | Single binary | Compile | OAuth | `pip install` |
235
+ Provider selection and failover are configured in `~/.titan/titan.json` or via the Mission Control Settings panel.
178
236
 
179
- ### What Makes TITAN Different
237
+ ---
180
238
 
181
- **vs. OpenClaw** — OpenClaw is powerful but bloated (430K lines, 1GB+ RAM, native deps). TITAN delivers the same capabilities in ~5K lines of pure TypeScript with zero native dependencies, plus exclusive features: loop detection, task planner, smart context management, and continuous learning.
239
+ ## Configuration
182
240
 
183
- **vs. NanoClaw** — NanoClaw prioritizes minimal code (~500 lines) over features. It lacks browser control, multi-agent, background processes, and a dashboard. TITAN offers full-featured operation with a manageable codebase.
241
+ TITAN stores all state in `~/.titan/`:
184
242
 
185
- **vs. IronClaw** IronClaw's Rust + Wasm approach is great for security but requires compilation and has limited channel support. TITAN provides comparable security via Docker sandbox with zero compilation required.
243
+ | Path | Purpose |
244
+ |------|---------|
245
+ | `~/.titan/titan.json` | Main configuration |
246
+ | `~/.titan/titan-data.json` | Runtime data |
247
+ | `~/.titan/knowledge.json` | Learning engine knowledge base |
248
+ | `~/.titan/profile.json` | Relationship memory / user profile |
249
+ | `~/.titan/logs/titan-YYYY-MM-DD.log` | Daily log files |
250
+ | `~/.titan/plans/` | Persistent task planner state |
251
+ | `~/.titan/skills/auto/` | Auto-generated skills |
186
252
 
187
- **vs. PicoClaw** — PicoClaw targets embedded/resource-constrained environments (<10MB RAM). TITAN targets users who want a full-featured agent that still doesn't bloat to 1GB like OpenClaw.
253
+ ---
188
254
 
189
- **vs. ZeroClaw** — ZeroClaw's Rust implementation is fast but requires compilation and has a steeper learning curve. TITAN offers comparable performance with TypeScript's developer-friendliness.
255
+ ## Development
190
256
 
191
- **vs. TrustClaw** — TrustClaw is cloud-managed (no self-hosting). TITAN gives you full control on your own hardware with local model support.
257
+ ```bash
258
+ npm run build # tsup production build
259
+ npm run test # vitest run (52 tests across 7 files)
260
+ npm run ci # typecheck + full test suite
261
+ npm run typecheck # tsc --noEmit (0 errors)
262
+ npm run dev:gateway # Run gateway directly via tsx
263
+ ```
192
264
 
193
- **vs. Nanobot** Nanobot is Python-based with good transparency, but lacks browser control, multi-agent, task planning, and a GUI. TITAN covers all bases.
265
+ The test suite covers core agent behavior, multi-agent routing, server endpoints, updater, and integration scenarios.
194
266
 
195
267
  ---
196
268
 
197
- ## Roadmap
269
+ ## Comparison
198
270
 
199
- ### v2026.2.26 Foundation Release
200
- - [x] Multi-agent system (up to 5)
201
- - [x] 17+ built-in tools (shell, filesystem, browser, process, web, cron, webhooks, sessions, memory, patch)
202
- - [x] Continuous learning engine
203
- - [x] Loop detection & circuit breaker
204
- - [x] Task planner with dependency graphs
205
- - [x] Smart context manager
206
- - [x] Mission Control GUI (11 panels)
207
- - [x] 10+ channel adapters
208
- - [x] 4 LLM providers with failover
209
- - [x] DM pairing security
210
- - [x] Docker support
211
-
212
- ### ✅ v2026.4 — Intelligence Update
213
- - [x] **Skill auto-generation** — TITAN writes its own new skills when it encounters tasks it can't solve
214
- - [x] **Image analysis tool** — Vision capabilities for screenshots, diagrams, photos
215
- - [x] **Voice channel support** — Discord/Telegram voice with speech-to-text and text-to-speech
216
- - [x] **Plugin marketplace** — Community-contributed skills with one-click install
217
- - [x] **E2E encrypted sessions** — End-to-end encryption for sensitive conversations
218
-
219
- ### ✅ v2026.4.9 — Stability & Bug-Fix Release (Current)
220
- - [x] **19 crash/runtime/silent-failure fixes** across 15 source files — full end-to-end audit
221
- - [x] **6 critical crash fixes** — unguarded `writeFileSync` calls, unhandled async rejections in `stallDetector`, `costOptimizer` undefined fallback, `Math.max` on empty array
222
- - [x] **12 high-priority runtime fixes** — `executeTools` error handling, Google provider tool role mapping, `monitor.ts` fire-and-forget async, Discord null guard, `doctor.ts` `parseInt` on undefined, top-level IIFE unhandled rejection, shell injection in `web_fetch` and `marketplace`
223
- - [x] **4 medium fixes** — usage stats ID collision, `|| 0` vs `?? 0` timeout bugs in `shell` and `process`, `responseCache` missing Array guard
224
-
225
- ### 🔮 v2026.6 — Autonomy Update
226
- - [ ] **Proactive agent mode** — TITAN monitors your system and takes action without being asked
227
- - [ ] **Multi-model reasoning** — Chain multiple models for complex tasks (fast model for planning, powerful model for execution)
228
- - [ ] **Git workflow integration** — PR reviews, automated commits, branch management
229
- - [ ] **OAuth tool marketplace** — Connect to 500+ SaaS apps (Google, GitHub, Notion, Jira, etc.)
230
- - [ ] **Mobile app** — iOS/Android companion app for on-the-go TITAN access
231
-
232
- ### 🚀 v2026.9 — Enterprise Update
233
- - [ ] **Team mode** — Multiple users, role-based access, shared agents
234
- - [ ] **Audit logging** — Full compliance audit trail
235
- - [ ] **SSO integration** — SAML/OIDC authentication
236
- - [ ] **Custom model fine-tuning** — Train models on your organization's data
237
- - [ ] **On-premise deployment** — Kubernetes-ready with Helm charts
238
-
239
- ### 🌟 v2027+ — Next Generation
240
- - [ ] **Agent-to-agent marketplace** — TITAN agents can discover and collaborate with other TITAN instances
241
- - [ ] **Natural language programming** — Describe apps in plain English, TITAN builds them
242
- - [ ] **Predictive task execution** — AI predicts what you need before you ask
243
- - [ ] **Hardware integration** — IoT, smart home, robotics control
271
+ > Note: The frameworks below are fictional analogs used here for feature positioning purposes. They represent common archetypes in the AI agent framework space (bloated monolith, minimal implementation, Rust-compiled, cloud-managed, Python-based) rather than specific real projects.
244
272
 
245
- ---
273
+ | Feature | **TITAN** | Bloated TS | Minimal TS | Rust-based | Cloud-managed | Python-based |
274
+ |---------|-----------|------------|------------|------------|---------------|--------------|
275
+ | **Language** | TypeScript | TypeScript | TypeScript | Rust | Cloud | Python |
276
+ | **Native deps** | None | Required | None | Required | N/A | None |
277
+ | **Loop detection** | 3 detectors + circuit breaker | None | None | None | None | None |
278
+ | **Task planner** | Dependency graphs + retry | None | None | None | None | None |
279
+ | **Smart context** | Auto-summarize + budget | None | None | None | None | None |
280
+ | **Continuous learning** | Built-in | None | None | None | None | None |
281
+ | **Multi-agent** | Up to 5 | Yes | None | None | None | None |
282
+ | **Mission Control GUI** | 10+ panels, premium | Basic | None | None | Yes | None |
283
+ | **Browser control** | CDP + Playwright | CDP | None | None | Yes | None |
284
+ | **Skill auto-generation** | Yes | None | None | None | None | None |
285
+ | **Graphiti memory** | Yes (Docker) | None | None | None | None | None |
286
+ | **Local models (Ollama)** | Yes | Yes | Yes | Yes | None | Yes |
287
+ | **RAM usage** | ~50 MB | ~1 GB+ | ~30 MB | ~20 MB | Cloud | ~40 MB |
288
+ | **Setup** | `npm install -g titan-agent` | Complex | Simple | Compile | OAuth | `pip install` |
246
289
 
247
- ## 💡 Feature Requests
290
+ ### Where TITAN sits in the landscape
248
291
 
249
- **Have an idea for TITAN?** We want to hear it!
292
+ **vs. bloated monolith frameworks** Comparable capabilities in ~10K lines of pure TypeScript with zero native dependencies, plus exclusive features: loop detection, task planner, smart context, continuous learning, and skill auto-generation that larger frameworks lack.
250
293
 
251
- Open an issue on GitHub or reach out directly:
294
+ **vs. minimal implementations** Minimal agents prioritize small codebases over features. They typically lack browser control, multi-agent, background processes, task planning, and a GUI. TITAN provides all of these without reaching monolith size.
252
295
 
253
- 👉 **[Open a Feature Request](https://github.com/Djtony707/TITAN/issues/new?labels=feature-request&template=feature_request.md&title=%5BFeature%5D+)**
296
+ **vs. Rust/compiled frameworks** Strong security and performance but require compilation, have steeper setup, and limited ecosystem. TITAN provides comparable security via sandboxing and encryption with a `npm install` setup.
254
297
 
255
- 👉 **Contact:** [Tony Elliott on GitHub](https://github.com/Djtony707)
298
+ **vs. cloud-managed agents** Cloud agents remove self-hosting control. TITAN runs entirely on your own hardware with full local model support and no external service dependency.
256
299
 
257
- Every feature request is reviewed. The best ideas make it into the roadmap. Let's build the future of AI agents together.
300
+ **vs. Python agents** Python agents have a large ML ecosystem but typically lack browser integration, multi-agent coordination, task planning, and a built-in GUI. TITAN covers all of these.
258
301
 
259
302
  ---
260
303
 
261
- ## CLI Reference
304
+ ## Roadmap
262
305
 
263
- | Command | Description |
264
- |---------|-------------|
265
- | `titan onboard` | Interactive setup wizard |
266
- | `titan gateway` | Start Mission Control (port 48420) |
267
- | `titan agent -m "..."` | Direct message |
268
- | `titan send --to ch:id -m "..."` | Send to channel |
269
- | `titan pairing` | DM access control |
270
- | `titan agents` | Multi-agent management |
271
- | `titan doctor` | Diagnostics |
272
- | `titan skills` | Skill management |
273
- | `titan config` | Configuration |
274
- | `titan update` | Update TITAN |
306
+ ### Completed
307
+
308
+ - Multi-agent system (up to 5 concurrent)
309
+ - 22 built-in skills (shell, filesystem, browser, process, web, cron, webhooks, sessions, memory, patch, vision, voice)
310
+ - Continuous learning engine
311
+ - Loop detection and circuit breaker (3 algorithms)
312
+ - Task planner with dependency graphs
313
+ - Smart context manager and cost optimizer
314
+ - Mission Control GUI (10+ panels, dark mode)
315
+ - Channel adapters: Discord, Telegram, Slack, Google Chat, WebChat, WhatsApp
316
+ - 4 LLM provider families with failover
317
+ - DM pairing security
318
+ - E2E AES-256-GCM encryption
319
+ - Skill auto-generation and hot-loading
320
+ - Recipes (reusable multi-step workflows)
321
+ - MCP (Model Context Protocol) support
322
+ - Kimi Swarm Architecture for local models
323
+ - Graphiti temporal memory (Neo4j + Docker Compose)
324
+ - Mission Control Settings: 6-tab live configuration panel
325
+ - 52-test suite across 7 test files
326
+
327
+ ### Planned
328
+
329
+ - **Proactive agent mode** — TITAN monitors your environment and initiates actions without being prompted.
330
+ - **Multi-model reasoning chains** — Route sub-tasks to specialized models (fast model for planning, powerful model for execution).
331
+ - **Git workflow integration** — PR review, automated commits, branch management tools.
332
+ - **Expanded channel adapters** — Matrix, Signal, MS Teams, and others.
333
+ - **Team mode** — Multiple users with role-based access and shared agent pools.
334
+ - **OAuth integrations** — Direct connections to SaaS tools (GitHub, Google, Notion, Jira, etc.).
275
335
 
276
336
  ---
277
337
 
278
- ## Credits
338
+ ## Feature Requests
339
+
340
+ Open an issue on GitHub or contact the author directly:
279
341
 
280
- **Project Creator / Owner:** [Tony Elliott](https://github.com/Djtony707)
342
+ - [Open a Feature Request](https://github.com/Djtony707/TITAN/issues/new?labels=feature-request&template=feature_request.md&title=%5BFeature%5D+)
343
+ - [Tony Elliott on GitHub](https://github.com/Djtony707)
281
344
 
282
- ### Acknowledgments
345
+ ---
283
346
 
284
- TITAN's architecture is inspired by patterns from the open-source AI agent community:
347
+ ## Credits
285
348
 
286
- - **[OpenClaw](https://github.com/openclaw/openclaw)** — The original personal AI assistant framework. TITAN's gateway, skills system, session model, and security patterns are inspired by OpenClaw's design. MIT License.
349
+ **Project Creator:** [Tony Elliott (Djtony707)](https://github.com/Djtony707)
287
350
 
288
- Dependencies: Anthropic SDK, OpenAI SDK, Google Generative AI, discord.js, grammY, Bolt (Slack), Zod, Commander.js, Express, ws, chalk, uuid, Vitest.
351
+ **Dependencies:** Anthropic SDK, OpenAI SDK, Google Generative AI SDK, discord.js, grammY, Bolt (Slack), Zod, Commander.js, Express, ws, Playwright, chalk, uuid, tsup, Vitest.
289
352
 
290
353
  ---
291
354
 
@@ -21,7 +21,7 @@ import { existsSync as existsSync2 } from "fs";
21
21
  // src/utils/constants.ts
22
22
  import { homedir } from "os";
23
23
  import { join } from "path";
24
- var TITAN_VERSION = "2026.4.20";
24
+ var TITAN_VERSION = "2026.4.22";
25
25
  var TITAN_NAME = "TITAN";
26
26
  var TITAN_ASCII_LOGO = `
27
27
  \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
@@ -188,6 +188,7 @@ var TitanConfigSchema = z.object({
188
188
 
189
189
  // src/utils/logger.ts
190
190
  import chalk from "chalk";
191
+ var fileStream = null;
191
192
  var LEVEL_LABELS = {
192
193
  [0 /* DEBUG */]: chalk.gray("DEBUG"),
193
194
  [1 /* INFO */]: chalk.cyan("INFO "),
@@ -195,6 +196,14 @@ var LEVEL_LABELS = {
195
196
  [3 /* ERROR */]: chalk.red("ERROR"),
196
197
  [4 /* SILENT */]: ""
197
198
  };
199
+ var LEVEL_NAMES = {
200
+ [0 /* DEBUG */]: "DEBUG",
201
+ [1 /* INFO */]: "INFO ",
202
+ [2 /* WARN */]: "WARN ",
203
+ [3 /* ERROR */]: "ERROR",
204
+ [4 /* SILENT */]: " "
205
+ };
206
+ var ansiStrip = (s) => s.replace(/\x1b\[[0-9;]*m/g, "");
198
207
  var currentLevel = 1 /* INFO */;
199
208
  function formatTimestamp() {
200
209
  return chalk.gray((/* @__PURE__ */ new Date()).toISOString().replace("T", " ").slice(0, 19));
@@ -203,6 +212,12 @@ function log(level, component, message, ...args) {
203
212
  if (level < currentLevel) return;
204
213
  const prefix = `${formatTimestamp()} ${LEVEL_LABELS[level]} ${chalk.blue(`[${component}]`)}`;
205
214
  console.log(`${prefix} ${message}`, ...args);
215
+ if (fileStream) {
216
+ const ts = (/* @__PURE__ */ new Date()).toISOString().replace("T", " ").slice(0, 19);
217
+ const extra = args.length ? " " + args.map((a) => typeof a === "object" ? JSON.stringify(a) : String(a)).join(" ") : "";
218
+ fileStream.write(`${ts} ${LEVEL_NAMES[level]} [${component}] ${ansiStrip(message)}${extra}
219
+ `);
220
+ }
206
221
  }
207
222
  var logger = {
208
223
  debug: (component, msg, ...args) => log(0 /* DEBUG */, component, msg, ...args),