ironcode-ai 1.17.2 โ†’ 1.17.4

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 (2) hide show
  1. package/README.md +69 -971
  2. package/package.json +6 -6
package/README.md CHANGED
@@ -22,742 +22,106 @@
22
22
 
23
23
  ---
24
24
 
25
- ## ๐ŸŽ‰ What's New
26
-
27
- ### Mar 2, 2026 - AI SDK v6 Upgrade
28
-
29
- **Upgraded to Vercel AI SDK v6 with agent loop compatibility:**
30
-
31
- - **Root cause**: AI SDK v6 changed behavior โ€” after tools execute, it emits `finishReason: "stop"` (or `undefined`) instead of `"tool-calls"` like v5. IronCode's custom loop control depends on `finishReason === "tool-calls"` to continue the agent loop.
32
- - **Solution**: Added `hasToolCalls` tracking variable in `processor.ts` that monitors tool execution per turn. When tools are called but SDK returns `finishReason: "stop"`, we override it to `"tool-calls"` to maintain proper loop continuation.
33
- - **Impact**: Multi-turn agent conversations now work correctly with AI SDK v6. The agent properly continues after tool calls instead of stopping prematurely.
34
-
35
- **Technical details:**
36
- - Track tool execution with `hasToolCalls` boolean flag
37
- - Override `finishReason` from "stop" โ†’ "tool-calls" when tools were called
38
- - Reset tracking at start of each turn
39
- - Zero breaking changes to existing functionality
40
-
41
- ### Mar 2, 2026 - Fix TUI crash when MCP servers are configured
42
-
43
- Fixed a fatal crash (`TextNodeRenderable only accepts strings...`) that occurred ~5โ€“10 seconds after startup whenever MCP servers were defined in `~/.config/ironcode/ironcode.json`.
44
-
45
- - **Root cause 1** (`prompt/index.tsx`): `{props.hint}` was placed inside a `<text>` node. The MCP hint in `home.tsx` renders a `<box>`, which is not a valid child of `TextNodeRenderable`. When MCP status loaded after bootstrap, the reactive update tried to insert a `BoxRenderable` into a `TextNodeRenderable`, crashing the TUI.
46
- - **Root cause 2** (`dialog-select.tsx`): The `footer` prop was always wrapped in `<text>`, but `DialogMcp` passes a JSX element (`<Status>` component) as footer โ€” also not text-compatible.
47
-
48
- **Fix:** Moved `{props.hint}` outside the `<text>` tag in prompt; added type-branching for footer rendering in dialog-select.
49
-
50
- ### Mar 1, 2026 - Telegram Integration
51
-
52
- **Control IronCode remotely from your phone via Telegram:**
53
-
54
- - **`@ironcode-ai/telegram`** โ€” new standalone package; install globally and run from any project directory
55
- - **Live streaming output** โ€” agent responses stream in real time to your Telegram chat (throttled edits every 1.2s)
56
- - **Session management** โ€” each conversation is a separate IronCode session; switch between sessions with inline keyboard buttons
57
- - **One-command setup** โ€” `ironcode-telegram setup` walks you through token + allowed-user config, saved to `~/.config/ironcode/telegram.json`
58
- - **Server deployment** โ€” run 24/7 on a VPS with PM2 or systemd; send tasks from your phone while the server does the work
59
-
60
- **Setup:**
61
- ```bash
62
- npm install -g @ironcode-ai/telegram
63
-
64
- ironcode-telegram setup
65
- # โ†’ Enter your Telegram bot token (from @BotFather)
66
- # โ†’ Enter your Telegram user ID (from @userinfobot)
67
-
68
- cd your-project
69
- ironcode-telegram # starts the bot, connects to IronCode
70
- ```
71
-
72
- **Bot commands:**
73
- | Command | Description |
74
- |---------|-------------|
75
- | `/start` | Start a new IronCode session |
76
- | `/sessions` | List and switch between active sessions |
77
- | `/clear` | Clear current session history |
78
- | `/stop` | Stop current session |
79
- | _(any message)_ | Send task to IronCode, stream the response |
80
-
81
- ### Feb 26, 2026 - Multi-Account Providers & Round-Robin Load Balancing
82
-
83
- **Connect multiple API keys per provider and distribute load automatically:**
84
-
85
- - **Any provider supported** โ€” Anthropic, OpenAI, Google, GitHub Copilot, MiniMax, Qwen, and any other API-key provider
86
- - **Automatic round-robin** โ€” every message rotates to the next account; no configuration needed
87
- - **Preserves your model choice** โ€” only the account rotates, the model you selected stays the same
88
- - **Per-message indicator** โ€” message header shows which account was used: `Build ยท claude-sonnet-4 ยท Anthropic (Account 2) ยท 1.2s`
89
- - **TUI add/replace flow** โ€” clicking a connected provider shows "Add another account" or "Replace existing"; once 2+ accounts exist, the dialog shows individual rows per account
90
- - **CLI support** โ€” `ironcode auth login` prompts "Add another account" or "Replace existing" when credentials already exist
91
-
92
- **Setup:**
93
- ```bash
94
- # First account (normal flow)
95
- ironcode auth login โ†’ Select "Anthropic" โ†’ Enter API key
96
-
97
- # Second account
98
- ironcode auth login โ†’ Select "Anthropic" โ†’ "Add another account" โ†’ Enter key
99
- # Saved as "anthropic-2" in auth.json โ€” auto-discovered at startup, no config needed
100
- ```
101
-
102
- ### Feb 26, 2026 - Native Bash Permissions Layer
103
-
104
- **Shell permission checks are now fully native โ€” faster and more accurate:**
105
-
106
- - **Wildcard matching** โ€” Ported from JS to native Rust (`rexile`). Handles `*`/`?` glob patterns including the tricky `"ls *"` form that matches both `"ls"` and `"ls -la"`. Zero JS overhead on every permission check.
107
-
108
- - **Bash command parser** โ€” `shell.rs` replaces the old WASM tree-sitter path with a native tree-sitter-bash parser. Extracts filesystem arguments, full command patterns, and `always`-allow prefixes (`"npm run *"`) used by the permission system. **50-100x faster** than WASM.
109
-
110
- - **Smart command prefix (RETE rule engine)** โ€” 137 GRL rules loaded into a RETE `IncrementalEngine` classify every command to its correct prefix length. `npm run dev` โ†’ `"npm run *"`, `docker compose up` โ†’ `"docker compose *"`, `git config --global` โ†’ `"git config *"`. Longest-match always wins regardless of rule firing order.
111
-
112
- ### Feb 23, 2026 - Local Code Search (BM25 + tree-sitter)
113
-
114
- **Offline semantic code search โ€” no embeddings, no ML model download required:**
115
-
116
- - **`search_codebase` tool** - New AI tool that finds functions, classes, and symbols by concept rather than exact text
117
- - BM25 full-text ranking (same algorithm used by Elasticsearch/Lucene)
118
- - tree-sitter AST parsing โ€” extracts named symbols (functions, classes, interfaces, enums, methods, etc.) per language
119
- - Understands camelCase/snake_case: `getUserById` โ†’ tokens `[get, user, by, id]`
120
- - Auto-indexes on first use, incremental updates via file watcher
121
- - ~400ms initial indexing, <1ms search on indexed data
122
- - Zero binary size overhead (no ML model bundled)
123
-
124
- - **Languages supported:** TypeScript, JavaScript, Python, Rust, Go, Java, C#
125
-
126
- - **AI behavior improved:** Model now prefers `search_codebase` for conceptual queries and reserves grep for exact text matching โ€” no more `\b(auth|login|token|...)\b` mega-patterns
127
-
128
- - **Grep tool guidance updated:** Explicit instruction to use `search_codebase` instead of complex OR-patterns
129
-
130
- **Performance (tested on IronCode src, ~1638 symbols):**
131
-
132
- | Metric | Value |
133
- | ------------------ | ----------------------------- |
134
- | Initial index time | ~450ms |
135
- | Search time | <1ms |
136
- | Memory overhead | ~0 (BM25 inverted index only) |
137
- | Binary size added | 0 MB (no ML model) |
138
-
139
- ### Feb 18, 2026 - Editor & Terminal Improvements
140
-
141
- **External editor with auto-install + redesigned built-in terminal:**
142
-
143
- - **`/editor` - External Editor Integration**
144
- - Opens `$VISUAL` or `$EDITOR` or `nvim` by default
145
- - Auto-detects if editor is installed via `which`
146
- - Shows install popup if Neovim not found (cross-platform: brew, apt, dnf, pacman, apk, winget, choco, scoop)
147
- - One-click install button directly from the popup
148
-
149
- - **`/terminal` - Redesigned Built-in Terminal**
150
- - Clean terminal-like UI with no header/footer chrome
151
- - Prompt at bottom with `~/path $ ` prefix (like real shell)
152
- - Block cursor with left/right movement
153
- - Streaming output (stdout/stderr appear in real-time)
154
- - Syntax highlighting for file output (`cat file.ts`, `head file.py`, etc.)
155
- - Fish-style history autosuggest (dim text, accept with Right/End)
156
- - Tab completion for file/directory paths (single match auto-completes, multiple shows common prefix + options)
157
- - Shell keybindings: Ctrl+A/E (home/end), Ctrl+U/K (clear line), Ctrl+W (delete word), Ctrl+L (clear screen)
158
- - `cd` with directory validation, `clear`, `exit` commands
159
- - Color-coded output: commands (primary+bold), errors (red), info (dim)
160
-
161
- ### Feb 15, 2026 - Code Changes Panel
162
-
163
- **Code changes viewer with inline comments and hunk revert:**
164
-
165
- - ๐Ÿ” **Code Changes Panel** - View git diffs in a side panel without leaving your session. Open via command palette or `<leader>r` keybind
166
- - โ†ฉ๏ธ **Revert Diff Hunk** - Press `r` to revert individual diff hunks. Supports both uncommitted and staged changes
167
- - ๐Ÿ’ฌ **Inline Comments** - Press `c` to add comments on specific diff lines. Navigate with `n/p`, dismiss with `d`, send to chat with `f`
168
- - ๐Ÿ”„ **Mode Cycling** - Press `m` to cycle between Uncommitted, Staged, and vs-Main diff views
169
- - ๐Ÿ“Š **Change Counts in Hint Bar** - The prompt hint bar now shows `<leader>r changes +N -N` with live addition/deletion counts
170
- - ๐Ÿค– **Auto-open on `/review`** - The code changes panel automatically opens alongside when the `/review` command runs as a subtask
171
- - ๐ŸŽจ **Hunk Highlighting** - The current hunk is subtly highlighted in the diff view for easy identification
172
-
173
- **Keybinds:**
174
-
175
- - `j/k`: Navigate files
176
- - `โ†‘โ†“`: Navigate diff lines
177
- - `r`: Revert current hunk
178
- - `c`: Add comment on current line
179
- - `n/p`: Navigate between comments
180
- - `d`: Dismiss selected comment
181
- - `f`: Send comment to chat
182
- - `m`: Cycle mode (uncommitted/staged/vs-main)
183
- - `g`: Refresh diffs
184
- - `Esc`: Close panel
185
-
186
- ### Feb 15, 2026 - AI SDK v6 Integration
187
-
188
- **Leveraging new AI SDK v6 features for better debugging and token efficiency:**
189
-
190
- - ๐Ÿ”ง **DevTools Middleware** - Full debugging visibility for LLM calls via `@ai-sdk/devtools`. Enable with `"experimental": { "devtools": true }` in config, then run `npx @ai-sdk/devtools` to launch viewer at `localhost:4983`. Inspect input/output, token usage, timing, and raw provider data.
191
- - ๐Ÿ’ฐ **`toModelOutput` Optimization** - Tool results now send only the essential `output` text back to the model, stripping `title`, `metadata`, and `attachments` (including base64-encoded images). Reduces token usage on every tool call, especially impactful for large file reads and MCP tools.
192
- - ๐Ÿ”Œ **Provider-Specific Tools** - Native server-side tools from AI providers (lazy-loaded, zero memory overhead when unused). Enable via `"experimental": { "provider_tools": ["anthropic:web_search", "openai:*"] }`. Available tools:
193
- - **Anthropic**: `web_search`, `web_fetch`, `code_execution`
194
- - **OpenAI**: `web_search`, `code_interpreter`, `image_generation`
195
- - **Google**: `google_search`, `code_execution`, `url_context`
196
- - **xAI**: `web_search`, `x_search`, `code_execution`
197
- - **GitHub Copilot**: `web_search`, `local_shell`, `code_interpreter`, `file_search`, `image_generation`
198
-
199
- ### Feb 15, 2026 - Memory Optimizations
200
-
201
- **TypeScript:**
202
-
203
- - ๐Ÿš€ **Lazy Provider SDK Loading** - Provider SDKs (`@ai-sdk/anthropic`, `@ai-sdk/openai`, etc.) are now dynamically imported only when their tools are requested, saving ~20-100MB of unused memory.
204
- - ๐Ÿ“ฆ **Streaming Message Processing** - Compaction pruning now streams messages instead of loading entire session history into memory. Combined with O(n) `filterCompacted()` (replacing O(nยฒ) `unshift`), long sessions use significantly less peak RAM.
205
-
206
- **Rust Native:**
207
-
208
- - ๐Ÿ”ง **edit.rs** - Split content lines once and share across all 9 replacer strategies (was splitting 7x redundantly). `normalize_whitespace` builds string directly without intermediate Vec.
209
- - ๐Ÿ“‚ **archive.rs** - Iterate ZIP entries by index instead of cloning all entry names upfront.
210
- - ๐Ÿ” **grep.rs** - Pre-allocate match buffer with `Vec::with_capacity(128)`. Avoid intermediate clone in line truncation formatting.
211
- - ๐Ÿ—‚๏ธ **glob.rs** - Partial sort with `select_nth_unstable_by` for top-N results instead of full sort on entire file list.
212
- - ๐Ÿ“– **read.rs** - Build output string directly instead of collecting into intermediate formatted Vec then joining.
213
- - ๐ŸŒ **webfetch.rs** - Stream-join text nodes without intermediate Vec allocation.
214
-
215
- ### Feb 12, 2026 - Git Source Control UI
216
-
217
- **Built-in Git UI for seamless version control within TUI:**
218
-
219
- - ๐ŸŽฏ **Full Git Integration** - Stage, commit, push without leaving IronCode
220
- - ๐Ÿ“Š **Visual Status View** - See staged/unstaged changes with color-coded icons
221
- - ๐ŸŒฟ **Branch Management** - Quick checkout between branches
222
- - ๐Ÿ“ **Inline Commit** - Type commit messages directly in TUI
223
- - ๐Ÿ” **Syntax-Highlighted Diffs** - Review changes with color-coded diffs
224
- - โšก **Multi-Auth Push** - Supports SSH keys, SSH agent, and HTTPS with credential helper
225
- - ๐ŸŽจ **Intuitive UI** - Keyboard shortcuts (p: push, a: stage all, Space: stage/unstage)
226
-
227
- **Open Git panel with `Ctrl+X` then `I` or `/git` command**
228
-
229
- ### Feb 10, 2026 - Streaming Optimizations
230
-
231
- **Massive performance and memory improvements through streaming patterns:**
232
-
233
- #### File Read Optimization
234
-
235
- - โšก **1.17-1.56x faster** across all file sizes
236
- - ๐Ÿ’พ **99.7% memory savings** on large files (39MB โ†’ 0.13MB for 100K lines)
237
- - ๐Ÿ“– 64KB buffer with pre-allocated capacity eliminates reallocation
238
- - โœ… **100% identical results** - zero breaking changes
239
-
240
- #### Grep Search Optimization
241
-
242
- - ๐Ÿ’พ **90-99% memory reduction** when searching large files
243
- - ๐Ÿ” Stream lines instead of loading entire files
244
- - โšก Early exit after 1000 matches for efficiency
245
- - ๐ŸŽฏ Can search **GB-sized files** without running out of memory
246
- - โœ… **100% identical results** - verified with comprehensive tests
247
-
248
- **Why streaming matters:**
249
-
250
- - Search 100 files ร— 1MB each: **100MB โ†’ 10MB memory** usage
251
- - No data loss - regex matches on full line content before display truncation
252
- - Scales to much larger codebases on memory-constrained systems
253
-
254
- ### Previous Updates
255
-
256
- - **Memory optimization** - 97.6% faster message processing (254ms โ†’ 6ms) - Feb 8, 2026
257
- - **Resource monitoring** - Automatic throttling with 300MB default limit - Feb 7, 2026
258
- - **PTY/Terminal native** - 15.29x speedup, powers Bash tool - Feb 5, 2026
259
- - **Edit tool optimization** - 2-6x faster with 9 smart strategies - Feb 3, 2026
260
- - **Archive extraction** - 3-5x faster with s-zip native - Feb 1, 2026
261
-
262
- ---
263
-
264
25
  ## What is IronCode?
265
26
 
266
- IronCode is a **high-performance CLI fork** of [OpenCode](https://github.com/anomalyco/opencode) - an AI coding agent that runs entirely on your machine. This fork focuses on the command-line experience, removes cloud dependencies, and **rewrites performance-critical components in Rust** for dramatically improved speed and efficiency.
27
+ IronCode is a **high-performance CLI AI coding agent** โ€” a fork of [OpenCode](https://github.com/anomalyco/opencode) that runs entirely on your machine. It rewrites performance-critical components in Rust for dramatically improved speed and memory efficiency.
267
28
 
268
29
  ### Key Features
269
30
 
270
- - โŒจ๏ธ **CLI-First**: Powerful terminal UI optimized for command-line workflows
271
- - ๐Ÿ”€ **Multi-Account Round-Robin**: Connect multiple API keys per provider for automatic load balancing โ€” Anthropic, OpenAI, Google, Copilot, and more
272
- - ๐ŸŽฏ **Git Source Control**: Full Git integration - stage, commit, diff, push without leaving TUI
273
- - ๐Ÿ” **Code Changes Panel**: Diff viewer with inline comments, hunk revert, and live change counts
274
- - ๐Ÿ“ **External Editor**: Opens `$EDITOR`/nvim with auto-install popup if not found
275
- - ๐Ÿ’ป **Built-in Terminal**: Real terminal feel with syntax highlighting, fish-style autosuggest, and tab completion
276
- - ๐Ÿ”Ž **Local Code Search**: BM25 + tree-sitter semantic search across your codebase โ€” offline, zero latency, no ML model required
277
- - ๐Ÿ“ฑ **Telegram Integration**: Control IronCode remotely via Telegram โ€” send tasks from your phone and get live streaming output
278
- - ๐Ÿ  **100% Local**: No cloud services, works completely offline
279
- - ๐Ÿ”’ **Privacy First**: Your code never leaves your machine
280
- - ๐ŸŽฏ **Lightweight**: Stripped down to core functionality - CLI only
281
- - โšก **Blazing Fast**: Native Rust implementation for performance-critical operations
282
- - ๐Ÿ“ฆ **Easy Installation**: Available via npm, Homebrew, or direct download
283
-
284
- ### ๐Ÿš€ Performance Improvements
285
-
286
- IronCode delivers exceptional performance through **native Rust components** and **intelligent memory management**:
287
-
288
- #### Memory Efficiency & Resource Monitoring
289
-
290
- IronCode includes an **automatic resource monitoring system** that keeps memory usage under control:
291
-
292
- - ๐ŸŽฏ **Default 300MB limit** - Prevents excessive memory consumption
293
- - ๐Ÿ“Š **Real-time monitoring** - Checks every 5 seconds with three levels (normal/warning/critical)
294
- - ๐Ÿšฆ **Auto-throttling** - Automatically slows down at 95% memory to prevent crashes
295
- - โšก **Optimized processing** - 98% faster message handling with selective cloning
296
- - ๐Ÿ”ง **Configurable** - Adjust limits with `--max-memory` flag or disable with `--no-enable-resource-monitor`
297
-
298
- **Memory Optimizations:**
299
-
300
- | Optimization | Impact | Speedup |
301
- | -------------------------------- | ---------------------- | ------------------------------- |
302
- | **Selective Message Cloning** | 4.1MB saved per step | 97.6% faster (254ms โ†’ 6ms) |
303
- | **Array Operation Improvements** | Reduced GC pressure | 7 optimizations across codebase |
304
- | **Automatic Throttling** | Prevents memory spikes | Active at 285MB (95% threshold) |
305
-
306
- **Example Usage:**
307
-
308
- ```bash
309
- # Default (300MB limit, monitoring enabled)
310
- ironcode
311
-
312
- # Custom memory limit
313
- ironcode --max-memory 500
314
-
315
- # Disable resource monitoring
316
- ironcode --no-enable-resource-monitor
317
-
318
- # Both options
319
- ironcode --max-memory 400 --enable-resource-monitor
320
- ```
321
-
322
- See [RESOURCE-MONITORING.md](./RESOURCE-MONITORING.md) for full documentation.
323
-
324
- #### Native Rust Performance
325
-
326
- IronCode rewrites key operations in native Rust with **measured real-world performance gains**:
327
-
328
- | Operation | TypeScript/Node | Rust Native | **Speedup** | Notes |
329
- | ------------------------- | --------------- | ----------- | ------------------ | ---------------------- |
330
- | **PTY I/O (full)** | 58.15 ms | 3.80 ms | **15.29x faster** | โœ… 93.5% reduction |
331
- | **PTY Create** | ~50 ms | 1.66 ms | **30x faster** | Setup session |
332
- | **PTY Write** | ~1 ms | 0.06 ms | **16.7x faster** | Send data |
333
- | **PTY Read** | ~5 ms | 0.03 ms | **166x faster** | Non-blocking I/O |
334
- | **PTY Close** | ~2 ms | 0.02 ms | **100x faster** | Cleanup |
335
- | **Edit Tool (10 lines)** | 61.57 ยตs | 30.06 ยตs | **2.05x faster** | All 9 strategies |
336
- | **Edit Tool (100 lines)** | 419.84 ยตs | 250.86 ยตs | **1.67x faster** | Consistent performance |
337
- | **Edit Tool (1K lines)** | 6.17 ms | 2.78 ms | **2.22x faster** | Scales well |
338
- | **Edit Tool (5K lines)** | 126.06 ms | 29.67 ms | **4.25x faster** | 76.5% reduction |
339
- | **Edit Tool (10K lines)** | 451.59 ms | 74.88 ms | **6.03x faster** | 83.4% reduction |
340
- | **Bash Parser** | ~1-2 ms (WASM) | 0.020 ms | **50-100x faster** | Native tree-sitter |
341
- | **File Listing** | 15.80 ms | 11.50 ms | **1.37x faster** | Native ignore crate |
342
- | **File Glob (100 files)** | 9.74 ms | 3.55 ms | **2.74x faster** | Zero spawn overhead |
343
- | **Grep Search** | 34.84 ms | 19.35 ms | **1.80x faster** | Pattern: "function" |
344
- | **Grep (streaming)** | N/A | Similar | **90-99% memory** | Can search GB files |
345
- | **VCS Info (git)** | 17.25 ms | 9.43 ms | **1.83x faster** | libgit2, no spawning |
346
- | **Archive (small, 10)** | 5.48 ms | 1.93 ms | **2.8x faster** | s-zip vs unzip |
347
- | **Archive (medium, 100)** | 90.43 ms | 18.07 ms | **5.0x faster** | s-zip vs unzip |
348
- | **Archive (large, 500)** | 740.29 ms | 142.88 ms | **5.2x faster** | s-zip vs unzip |
349
- | **Read (1K lines)** | 0.06 ms | 0.04 ms | **1.50x faster** | 64KB buffer + capacity |
350
- | **Read (10K lines)** | 0.34 ms | 0.29 ms | **1.17x faster** | Pre-allocation |
351
- | **Read (50K lines)** | 1.45 ms | 0.97 ms | **1.49x faster** | Streaming optimized |
352
- | **Read (100K lines)** | 3.71 ms | 2.38 ms | **1.56x faster** | 99.7% memory savings |
353
- | **Read (500K lines)** | 31.50 ms | 21.55 ms | **1.46x faster** | 30MB file |
354
- | **Git Status** | ~15-20 ms | 9.43 ms | **1.83x faster** | libgit2, no spawn |
355
- | **Git Stage/Unstage** | ~10-15 ms | <5 ms | **2-3x faster** | Native operations |
356
- | **Git Commit** | ~15-20 ms | <10 ms | **2x faster** | Direct libgit2 |
357
- | **Git Branch List** | ~10 ms | <5 ms | **2x faster** | No process spawn |
358
- | **Git Diff** | ~20-30 ms | ~15 ms | **1.5x faster** | Streaming diff |
359
-
360
- **Key Insights:**
361
-
362
- - ๐ŸŽฏ **PTY/Terminal**: **15.29x faster** (exceeded 10x target!) - Native ring buffer, zero-copy reads
363
- - โœ… **File Read**: **1.17-1.56x faster** with **99.7% memory savings** (39MB โ†’ 0.13MB for 100K lines) - 64KB buffer + pre-allocation
364
- - โœ… **Grep Search**: **90-99% memory reduction** with streaming - Can search GB-sized files without OOM
365
- - โœ… **Edit Tool**: 2-6x faster across all file sizes with all 9 smart replacement strategies
366
- - โœ… **Bash Parser**: 50-100x faster using native tree-sitter vs WASM (0.020ms per command, no initialization overhead)
367
- - โœ… **Glob/Grep**: 1.8-2.7x faster by eliminating process spawn overhead
368
- - โœ… **VCS Info**: 1.83x faster using libgit2 directly (no process spawning, 45% latency reduction)
369
- - โœ… **Archive Extraction**: 3-5x faster using s-zip vs shell commands (unzip/PowerShell)
370
- - ๐Ÿ“Š **Memory**: Streaming patterns use only 64KB buffer regardless of file size
371
- - ๐ŸŽฏ **Lesson**: Pre-allocation + streaming + larger buffers = faster I/O with dramatically less memory
372
-
373
- **Native Rust Components:**
374
-
375
- - โœ… **PTY/Terminal**: Full terminal session management with 2MB ring buffer, zero-copy streaming (15.29x faster) - Powers all Bash tool operations
376
- - โœ… **Git Source Control**: Complete Git operations via libgit2 (status, stage, commit, push, branch, diff) - 1.5-3x faster than subprocess
377
- - โœ… **File Reading**: Streaming read with 64KB buffer and pre-allocation (1.2-1.6x faster, 99.7% memory savings)
378
- - โœ… **Grep Search**: Streaming line-by-line search (90-99% memory reduction, scales to GB files)
379
- - โœ… **Edit Tool**: 9 smart replacement strategies with fuzzy matching (complex compute justifies FFI)
380
- - โœ… **File Listing**: Native ignore crate for fast directory traversal (eliminates process spawn)
381
- - โœ… **File Search (Glob)**: Pattern matching with gitignore support (eliminates process spawn)
382
- - โœ… **Archive Extraction**: ZIP file extraction using s-zip streaming reader (3-5x faster, cross-platform)
383
- - โœ… **Bash Parser**: Native tree-sitter bash command parsing (50-100x faster than WASM, 0.020ms per command)
384
- - โœ… **Directory Listing**: Fast recursive directory traversal
385
- - โœ… **VCS Info**: Lightning-fast git repository information (libgit2 vs subprocess)
386
- - โœ… **Code Search (BM25)**: Local semantic code search with tree-sitter symbol extraction โ€” finds functions by concept, not just exact text
387
- - โœ… **Wildcard Matching**: `*`/`?` glob patterns via `rexile`, including trailing `" *"` form โ€” replaces JS impl
388
- - โœ… **Command Prefix (RETE)**: GRL rule engine (137 rules) maps commands โ†’ arity for permission `always`-allow prefixes
389
- - โœ… **System Stats**: CPU and memory monitoring
390
-
391
- **Benefits:**
392
-
393
- - ๐Ÿš€ **1.2-1.6x faster** file reading with 64KB buffer and pre-allocation
394
- - ๐Ÿ’พ **99.7% memory savings** on large files (39MB โ†’ 0.13MB for 100K lines)
395
- - ๐Ÿ” **90-99% memory reduction** for grep search - can search GB-sized files
396
- - ๐Ÿš€ **Up to 6x faster** text editing with 9 smart replacement strategies (Levenshtein, fuzzy matching)
397
- - ๐Ÿš€ **Up to 5x faster** archive extraction (ZIP files) with cross-platform native code
398
- - ๐Ÿ’š **83% less time** on large file edits (10K lines: 451ms โ†’ 75ms)
399
- - โšก **1.83x faster** git operations using libgit2 (no process spawning)
400
- - ๐ŸŽฏ **2-3x faster** glob/grep by eliminating process spawn overhead
401
- - ๐Ÿ“Š **Optimized I/O**: Streaming patterns with single-allocation for minimal memory footprint
402
- - ๐Ÿ”ง **Consistent tooling**: Native Rust across all file operations for predictable performance
403
- - ๐ŸŒ **Cross-platform**: No external dependencies (unzip/PowerShell) for archive extraction
404
-
405
- ### What Changed from OpenCode?
406
-
407
- **Removed:**
408
-
409
- - โŒ Cloud infrastructure (Cloudflare Workers, R2 storage)
410
- - โŒ Web-based deployment
411
- - โŒ Desktop application (Tauri/GUI)
412
- - โŒ GitHub Action integration
413
- - โŒ Billing/subscription system
414
- - โŒ Authentication services
415
- - โŒ Session sharing features
416
-
417
- **Kept:**
418
-
419
- - โœ… Complete CLI experience
420
- - โœ… All AI agent capabilities
421
- - โœ… Local session management
422
- - โœ… Plugin system
423
- - โœ… Multiple AI model support
424
-
425
- **Enhanced:**
426
-
427
- - ๐Ÿš€ **Native Rust performance** for compute-heavy operations (2-6x faster)
428
- - ๐Ÿ’พ **Streaming file reads** with 99.7% memory savings (1.2-1.6x faster)
429
- - โšก **Eliminated process spawns** for glob/grep (2-3x speedup)
430
- - ๐Ÿ—œ๏ธ **Fast archive extraction** with s-zip (3-5x faster, cross-platform native)
431
- - ๐Ÿ’š **Faster edits** (2-6x improvement, scales with file size)
432
- - ๐Ÿ”ฅ **Smart edit strategies** with fuzzy matching and Levenshtein similarity
433
- - ๐Ÿ“Š **Optimized I/O**: Streaming read with 64KB buffer and pre-allocation
434
- - ๐Ÿ”ง **Consistent native tooling**: All file operations use Rust for predictable performance
435
- - ๐ŸŽฏ **Memory efficiency**: Automatic resource monitoring with 300MB default limit
436
- - ๐Ÿšฆ **Auto-throttling**: Prevents memory spikes and system crashes
437
- - โšก **98% faster message processing**: Selective cloning optimization (254ms โ†’ 6ms)
31
+ - โŒจ๏ธ **CLI-First** โ€” Powerful terminal UI optimized for keyboard-driven workflows
32
+ - ๐Ÿ”€ **Multi-Account Round-Robin** โ€” Connect multiple API keys per provider for automatic load balancing
33
+ - ๐ŸŽฏ **Git Source Control** โ€” Stage, commit, diff, push without leaving the TUI
34
+ - ๐Ÿ” **Code Changes Panel** โ€” Diff viewer with inline comments and hunk revert
35
+ - ๐Ÿ”Ž **Local Code Search** โ€” BM25 + tree-sitter semantic search, offline, zero latency
36
+ - ๐Ÿ“ฑ **Telegram Integration** โ€” Control IronCode remotely from your phone
37
+ - ๐Ÿ’ป **Built-in Terminal** โ€” Fish-style autosuggest, tab completion, syntax highlighting
38
+ - ๐Ÿ“ **External Editor** โ€” Opens `$EDITOR`/nvim with auto-install if missing
39
+ - ๐Ÿ  **100% Local** โ€” No cloud services, works completely offline
40
+ - โšก **Blazing Fast** โ€” Native Rust for all performance-critical operations
41
+
42
+ ### Performance (Native Rust Components)
43
+
44
+ | Operation | Speedup | Notes |
45
+ |---|---|---|
46
+ | PTY/Terminal | **15x faster** | Zero-copy ring buffer |
47
+ | Edit Tool | **2โ€“6x faster** | 9 smart replacement strategies |
48
+ | Bash Parser | **50โ€“100x faster** | Native tree-sitter vs WASM |
49
+ | Archive extraction | **3โ€“5x faster** | s-zip streaming reader |
50
+ | Grep search | **90โ€“99% less memory** | Streams GB-sized files |
51
+ | File read | **1.5x faster, 99.7% less memory** | 64KB buffer + pre-allocation |
52
+ | Git operations | **1.8x faster** | libgit2, no process spawning |
438
53
 
439
54
  ---
440
55
 
441
56
  ## Installation
442
57
 
443
- IronCode is distributed as a CLI tool available through multiple package managers:
444
-
445
58
  ### NPM (Recommended)
446
59
 
447
60
  ```bash
448
- # Install globally
449
61
  npm install -g ironcode-ai
450
-
451
- # Or use with npx (no installation)
452
- npx ironcode-ai
453
62
  ```
454
63
 
455
64
  ### Homebrew (macOS/Linux)
456
65
 
457
- IronCode is available through a Homebrew tap. The formula automatically installs the appropriate binary for your platform.
458
-
459
66
  ```bash
460
- # Add the tap
461
67
  brew tap KSD-CO/tap https://github.com/KSD-CO/homebrew-tap
462
-
463
- # Install IronCode
464
68
  brew install ironcode
465
-
466
- # Verify installation
467
- ironcode --version
468
-
469
- # Update to latest version
470
- brew upgrade ironcode
471
- ```
472
-
473
- **Supported Platforms:**
474
-
475
- - macOS (Intel x64)
476
- - macOS (Apple Silicon arm64)
477
- - Linux (x64)
478
- - Linux (arm64)
479
-
480
- The Homebrew formula is auto-generated from releases and maintained at [github.com/KSD-CO/homebrew-tap](https://github.com/KSD-CO/homebrew-tap/blob/main/ironcode.rb).
481
-
482
- ### Direct Download (Standalone Binary)
483
-
484
- For users who prefer not to use package managers, download the pre-built CLI binary directly from [GitHub Releases](https://github.com/KSD-CO/IronCode/releases).
485
-
486
- These are **standalone executables** that require no additional installation - just download, extract, and run:
487
-
488
- **Linux (x64):**
489
-
490
- ```bash
491
- # Download and extract
492
- curl -L https://github.com/KSD-CO/IronCode/releases/latest/download/ironcode-linux-x64.tar.gz | tar xz
493
-
494
- # Move to PATH
495
- sudo mv ironcode /usr/local/bin/
496
-
497
- # Verify installation
498
- ironcode --version
499
- ```
500
-
501
- **macOS (Apple Silicon):**
502
-
503
- ```bash
504
- # Download and extract
505
- curl -L https://github.com/KSD-CO/IronCode/releases/latest/download/ironcode-darwin-arm64.tar.gz | tar xz
506
-
507
- # Move to PATH
508
- sudo mv ironcode /usr/local/bin/
509
-
510
- # Verify installation
511
- ironcode --version
512
- ```
513
-
514
- **macOS (Intel):**
515
-
516
- ```bash
517
- # Download and extract
518
- curl -L https://github.com/KSD-CO/IronCode/releases/latest/download/ironcode-darwin-x64.tar.gz | tar xz
519
-
520
- # Move to PATH
521
- sudo mv ironcode /usr/local/bin/
522
-
523
- # Verify installation
524
- ironcode --version
525
69
  ```
526
70
 
527
- **Windows:**
528
-
529
- ```powershell
530
- # Download from releases page
531
- # https://github.com/KSD-CO/IronCode/releases/latest
532
-
533
- # Extract ironcode.exe and add to PATH
534
- # Or run directly from download location
535
- ```
71
+ ### Direct Download
536
72
 
537
- **Note for Windows users:** IronCode uses native Rust libraries for performance. The Windows build is statically linked and should work out of the box. If you encounter DLL loading errors, please [report the issue](https://github.com/KSD-CO/IronCode/issues) with the error message.
538
-
539
- ### Arch Linux (AUR)
540
-
541
- _Coming soon - AUR package will be available in the future_
73
+ Pre-built binaries for macOS (x64/arm64), Linux (x64/arm64), and Windows are available on [GitHub Releases](https://github.com/KSD-CO/IronCode/releases).
542
74
 
543
75
  ---
544
76
 
545
77
  ## Usage
546
78
 
547
- ### Quick Start
548
-
549
79
  ```bash
550
- # Start interactive session in current directory
80
+ # Start in current directory
551
81
  ironcode
552
82
 
553
- # Run with custom memory limit (default: 300MB)
554
- ironcode --max-memory 500
555
-
556
- # Run without resource monitoring
557
- ironcode --no-enable-resource-monitor
558
-
559
- # Run with specific model
83
+ # With a specific model
560
84
  ironcode --model anthropic/claude-sonnet-4
561
85
 
562
- # Show version
563
- ironcode --version
564
-
565
- # Show help
566
- ironcode --help
86
+ # Custom memory limit (default: 300MB)
87
+ ironcode --max-memory 500
567
88
  ```
568
89
 
569
- ### Configuration
570
-
571
- IronCode requires API keys for the AI models you want to use. Set them as environment variables:
90
+ Set your API key:
572
91
 
573
92
  ```bash
574
- # Anthropic Claude (recommended)
575
93
  export ANTHROPIC_API_KEY="your-key-here"
576
-
577
- # OpenAI
578
- export OPENAI_API_KEY="your-key-here"
579
-
580
- # Add to your shell profile (~/.bashrc, ~/.zshrc, etc.)
581
- echo 'export ANTHROPIC_API_KEY="your-key-here"' >> ~/.bashrc
582
- ```
583
-
584
- ### Interactive Mode
585
-
586
- Once started, IronCode provides an interactive terminal UI:
587
-
588
- - Type your requests naturally in English
589
- - Switch between agents with `Tab` key
590
- - Use `Ctrl+C` to cancel operations
591
- - Use `Ctrl+D` or type `exit` to quit
592
-
593
- ### Git Source Control
594
-
595
- IronCode includes a built-in Git UI accessible within the TUI:
596
-
597
- **Open Git Panel:**
598
-
599
- - Press `Ctrl+X` then `I` (keybinding)
600
- - Or type `/git` or `/source-control` command
601
-
602
- **Features:**
603
-
604
- - **Status View** - See all file changes (staged/unstaged)
605
- - `โ†‘โ†“` or `j/k`: Navigate files
606
- - `Space`: Stage/unstage selected file
607
- - `Enter`: View diff
608
- - `a`: Stage all files
609
- - `u`: Unstage all files
610
- - `r`: Refresh status
611
- - `p`: Push to remote
612
- - **Branches View** - Switch between branches
613
- - `โ†‘โ†“` or `j/k`: Navigate branches
614
- - `Enter`: Checkout branch
615
- - Current branch marked with `*`
616
- - **Commit View** - Create commits
617
- - Type your commit message
618
- - `Enter`: Commit staged changes
619
- - `Esc`: Cancel
620
- - **Diff View** - Review changes
621
- - Syntax-highlighted diffs (green +, red -, blue line numbers)
622
- - `h` or `Backspace`: Return to status view
623
-
624
- **Push Authentication:**
625
-
626
- IronCode supports multiple authentication methods:
627
-
628
- - SSH keys (id_rsa, id_ed25519) from `~/.ssh/`
629
- - SSH agent
630
- - HTTPS with credential helper (GitHub CLI recommended)
631
-
632
- For HTTPS authentication with GitHub:
633
-
634
- ```bash
635
- # Install GitHub CLI if not already installed
636
- brew install gh # macOS
637
- # or: sudo apt install gh # Linux
638
-
639
- # Authenticate
640
- gh auth login
641
-
642
- # Configure git to use gh for credentials
643
- git config --global credential.helper '!gh auth git-credential'
644
- ```
645
-
646
- ### Code Changes Panel
647
-
648
- IronCode includes a code changes viewer for reviewing diffs with inline comments:
649
-
650
- **Open Code Changes Panel:**
651
-
652
- - Press `<leader>r` (default: `Ctrl+X` then `R`)
653
- - Or use command palette (`Ctrl+P`) โ†’ "View code changes"
654
- - Auto-opens when `/review` command runs
655
-
656
- **Features:**
657
-
658
- - **Diff Viewer** - Color-coded diffs with hunk highlighting
659
- - `j/k`: Navigate between files
660
- - `โ†‘โ†“`: Navigate diff lines
661
- - `m`: Cycle mode (Uncommitted โ†’ Staged โ†’ vs Main)
662
- - `g`: Refresh diffs
663
- - **Revert Hunk** - Undo individual changes
664
- - `r`: Revert the current diff hunk (works for both uncommitted and staged)
665
- - Active hunk is highlighted for easy identification
666
- - **Inline Comments** - Add notes to specific diff lines
667
- - `c`: Add a comment on the current line
668
- - `n/p`: Navigate between comments
669
- - `d`: Dismiss selected comment
670
- - `f`: Send comment to chat for AI to address
671
- - **Change Counts** - The hint bar shows live `+N -N` counts of total additions/deletions
672
-
673
- ### Provider-Specific Tools
674
-
675
- Enable native server-side tools from AI providers. These tools run on the provider's infrastructure (not locally), giving the model direct access to web search, code execution, and more.
676
-
677
- **Configuration** โ€” Add `provider_tools` to the `experimental` section in your `ironcode.json`:
678
-
679
- ```jsonc
680
- {
681
- "experimental": {
682
- // Enable specific tools
683
- "provider_tools": ["anthropic:web_search"],
684
- },
685
- }
686
- ```
687
-
688
- **Format**: `"provider:tool_name"` or `"provider:*"` (wildcard for all tools).
689
-
690
- **Examples:**
691
-
692
- ```jsonc
693
- {
694
- "experimental": {
695
- // Single tool
696
- "provider_tools": ["anthropic:web_search"]
697
-
698
- // Multiple tools from one provider
699
- "provider_tools": ["anthropic:web_search", "anthropic:code_execution"]
700
-
701
- // All tools from a provider (wildcard)
702
- "provider_tools": ["openai:*"]
703
-
704
- // Mix providers โ€” only matching tools activate
705
- "provider_tools": [
706
- "anthropic:web_search",
707
- "anthropic:web_fetch",
708
- "openai:web_search",
709
- "google:google_search",
710
- "xai:x_search"
711
- ]
712
- }
713
- }
94
+ # or authenticate interactively:
95
+ ironcode auth login
714
96
  ```
715
97
 
716
- **Available tools by provider:**
717
-
718
- | Provider | Tool | Description |
719
- | ------------------ | ------------------ | --------------------------------------- |
720
- | **Anthropic** | `web_search` | Search the web for current information |
721
- | | `web_fetch` | Fetch and read web page content |
722
- | | `code_execution` | Execute code in a sandboxed environment |
723
- | **OpenAI** | `web_search` | Search the web using Bing |
724
- | | `code_interpreter` | Execute Python code with file I/O |
725
- | | `image_generation` | Generate images with DALL-E |
726
- | **Google** | `google_search` | Search with Google Search |
727
- | | `code_execution` | Execute code server-side |
728
- | | `url_context` | Fetch and analyze URL content |
729
- | **xAI** | `web_search` | Search the web |
730
- | | `x_search` | Search X (Twitter) posts |
731
- | | `code_execution` | Execute code server-side |
732
- | **GitHub Copilot** | `web_search` | Search the web via Bing |
733
- | | `local_shell` | Execute shell commands |
734
- | | `code_interpreter` | Execute code in sandbox |
735
- | | `file_search` | Search files in vector stores |
736
- | | `image_generation` | Generate images |
98
+ ### Key Commands
737
99
 
738
- > **Note**: Tools only activate when the current model matches the provider. For example, `anthropic:web_search` only works when using an Anthropic model (Claude). If you configure tools for multiple providers, only the relevant ones activate per session.
100
+ | Command | Description |
101
+ |---|---|
102
+ | `/git` | Open Git source control panel |
103
+ | `/terminal` | Open built-in terminal |
104
+ | `/editor` | Open file in `$EDITOR` |
105
+ | `/review` | Open code changes panel |
106
+ | `/init` | Create `AGENTS.md` for the project |
107
+ | `Tab` | Switch between agents (build / plan) |
108
+ | `Ctrl+X I` | Git panel shortcut |
109
+ | `Ctrl+X R` | Code changes panel shortcut |
739
110
 
740
- ### Telegram Integration
111
+ ---
741
112
 
742
- Control IronCode remotely via a Telegram bot โ€” send tasks from your phone and get real-time streaming output, just like the TUI.
113
+ ## Telegram Integration
743
114
 
744
- **Setup:**
115
+ Control IronCode remotely via Telegram โ€” send tasks from your phone, get live streaming output.
745
116
 
746
117
  ```bash
747
- # 1. Install IronCode and authenticate
748
- npm install -g ironcode-ai
749
- ironcode auth login
750
-
751
- # 2. Create a bot via @BotFather in Telegram, get the token
752
-
753
- # 3. Install the Telegram package
118
+ # Install
754
119
  bun install -g @ironcode-ai/telegram
755
120
 
756
- # 4. Configure your bot token
121
+ # Configure (enter bot token from @BotFather)
757
122
  ironcode-telegram setup
758
- # Saved to ~/.config/ironcode/telegram.json
759
123
 
760
- # 5. Start the bot from your project directory
124
+ # Run from your project directory
761
125
  cd your-project
762
126
  ironcode-telegram
763
127
  ```
@@ -765,328 +129,62 @@ ironcode-telegram
765
129
  **Bot commands:**
766
130
 
767
131
  | Command | Description |
768
- | ------- | ----------- |
769
- | `/start` | Welcome message and quick reference |
132
+ |---|---|
770
133
  | `/new` | Start a new session |
771
- | `/sessions` | List all sessions with inline buttons to switch |
772
- | `/info` | Show current session ID and working directory |
773
- | _(any text)_ | Send a prompt โ€” streams output live as the agent works |
774
-
775
- **How it works:**
776
-
777
- - The bot spawns an IronCode server in the current directory (same as running `ironcode`)
778
- - Responses stream in real-time as the agent generates text โ€” messages update every ~1.2s
779
- - Tool calls (file edits, searches, bash commands) are reported as they complete
780
- - Sessions persist across messages; switch between them with `/sessions`
781
-
782
- **Running on a server (24/7):**
783
-
784
- Deploy on a VPS or cloud instance so the bot is always available:
785
-
786
- ```bash
787
- # 1. Install on the server
788
- npm install -g ironcode-ai
789
- bun install -g @ironcode-ai/telegram
134
+ | `/sessions` | List sessions with inline switch buttons |
135
+ | `/info` | Current session details and file change stats |
136
+ | `/init` | Analyze project and create `AGENTS.md` |
137
+ | `/diff` | Show all file changes in the current session |
138
+ | _(any message)_ | Send a prompt โ€” streams the response live |
790
139
 
791
- # 2. Authenticate with your AI provider
792
- ironcode auth login
793
-
794
- # 3. Clone your project
795
- git clone your-repo /app/my-project
796
-
797
- # 4. Setup bot token
798
- ironcode-telegram setup
799
-
800
- # 5. Run with PM2 (auto-restart, survives reboots)
801
- npm install -g pm2
802
- cd /app/my-project
803
- pm2 start --name ironcode-telegram -- ironcode-telegram
804
- pm2 save # persist process list
805
- pm2 startup # enable auto-start on reboot
806
- ```
807
-
808
- Or with **systemd** (Linux):
809
-
810
- ```ini
811
- # /etc/systemd/system/ironcode-telegram.service
812
- [Unit]
813
- Description=IronCode Telegram Bot
814
- After=network.target
815
-
816
- [Service]
817
- Type=simple
818
- User=ubuntu
819
- WorkingDirectory=/app/my-project
820
- ExecStart=/usr/local/bin/ironcode-telegram
821
- Restart=on-failure
822
- RestartSec=5
823
-
824
- [Install]
825
- WantedBy=multi-user.target
826
- ```
827
-
828
- ```bash
829
- sudo systemctl enable --now ironcode-telegram
830
- ```
831
-
832
- > **Note:** `WorkingDirectory` is the project directory the bot will work with. For multiple projects, run a separate instance for each.
140
+ See [`packages/telegram/README.md`](./packages/telegram/README.md) for full setup docs including PM2/systemd server deployment.
833
141
 
834
142
  ---
835
143
 
836
144
  ## Agents
837
145
 
838
- IronCode includes built-in agents you can switch between with the `Tab` key:
146
+ Switch between agents with the `Tab` key:
839
147
 
840
- - **build** - Full-access agent for development work (default)
841
- - **plan** - Read-only agent for analysis and code exploration
842
- - Denies file edits by default
843
- - Asks permission before running bash commands
844
- - Ideal for exploring unfamiliar codebases
845
-
846
- Also included is a **general** subagent for complex searches and multistep tasks.
847
- Invoke it with `@general` in your messages.
148
+ - **build** โ€” Full-access agent for development (default)
149
+ - **plan** โ€” Read-only agent for analysis and code exploration
848
150
 
849
151
  ---
850
152
 
851
153
  ## Development
852
154
 
853
- ### Prerequisites
854
-
855
- - **Bun 1.3.8** (exact version required)
856
- - **Rust** (latest stable)
857
- - **Git**
858
-
859
- ### Building From Source
155
+ **Requirements:** Bun 1.3.8, Rust (stable), Git
860
156
 
861
157
  ```bash
862
- # Clone the repository
863
158
  git clone https://github.com/KSD-CO/IronCode.git
864
159
  cd IronCode
865
-
866
- # Install dependencies
867
160
  bun install
868
161
 
869
- # Build Rust native components
870
- cd packages/ironcode/native/tool
871
- cargo build --release
872
- cd ../../../..
162
+ # Build native Rust components
163
+ cd packages/ironcode/native/tool && cargo build --release && cd ../../../..
873
164
 
874
- # Run CLI locally (development mode)
165
+ # Run in development mode
875
166
  bun dev
876
-
877
- # Build standalone executable
878
- cd packages/ironcode
879
- bun run build
880
- ```
881
-
882
- The compiled binary will be in `packages/ironcode/dist/ironcode/bin/ironcode`
883
-
884
- ### Development Commands
885
-
886
- ```bash
887
- # Run tests
888
- bun test
889
-
890
- # Type checking
891
- bun run typecheck
892
-
893
- # Format code (using prettier)
894
- bun run format
895
-
896
- # Resource monitoring tests
897
- cd packages/ironcode
898
- bun test test/resource.test.ts # Unit tests
899
- bun test test/resource-monitor.test.ts # Allocation test
900
- bun test test/resource-integration.test.ts # Server integration
901
- bun --expose-gc test/clone-optimization.test.ts # Clone comparison
902
- bun test test/stress-test.ts # Light load test
903
- bun test test/heavy-test.ts # Heavy file ops
904
- bun test test/extreme-test.ts # Conversation simulation
905
-
906
- # Benchmark native Rust components
907
- cd packages/ironcode/native/tool
908
- cargo bench
909
-
910
- # Edit tool performance comparison (TS vs Rust)
911
- bun ./script/bench-edit.ts
912
-
913
- # Bash parser performance (Native Rust tree-sitter)
914
- bun --expose-gc ./script/bench-bash-parse-simple.ts
915
-
916
- # VCS performance comparison (TS vs Rust)
917
- bun ./script/bench-vcs.ts
918
-
919
- # Test edit correctness (TS vs Rust)
920
- bun ./script/test-edit-correctness.ts
921
-
922
- # Memory benchmarks
923
- bun --expose-gc ./script/bench-edit-memory.ts
924
167
  ```
925
168
 
926
169
  ---
927
170
 
928
171
  ## Architecture
929
172
 
930
- IronCode is built with:
931
-
932
- - **CLI/TUI**: TypeScript + Bun runtime
933
- - **Plugins**: TypeScript plugin system
934
- - **Native Performance Layer**: Rust (via FFI) for critical operations
935
- - PTY/Terminal management with 15x speedup
936
- - Edit operations with 9 smart replacement strategies
937
- - Archive extraction with s-zip streaming reader
938
- - File I/O with zero-copy optimization
939
- - Pattern matching and regex search
940
- - Git repository information
941
- - Code search with BM25 + tree-sitter symbol extraction
942
- - System resource monitoring
943
-
944
- ### Native Rust Architecture
945
-
946
- ```
947
- โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
948
- โ”‚ TypeScript Layer (Bun) โ”‚
949
- โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
950
- โ”‚ โ”‚ Edit Tool / File Operations โ”‚ โ”‚
951
- โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
952
- โ”‚ โ”‚ FFI Bindings โ”‚
953
- โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
954
- โ”‚ โ”‚ Native Rust Library โ”‚ โ”‚
955
- โ”‚ โ”‚ โ€ข Edit strategies (9 types) โ”‚ โ”‚
956
- โ”‚ โ”‚ โ€ข Bash parser (tree-sitter) โ”‚ โ”‚
957
- โ”‚ โ”‚ โ€ข Archive extraction (s-zip) โ”‚ โ”‚
958
- โ”‚ โ”‚ โ€ข File I/O (zero-copy) โ”‚ โ”‚
959
- โ”‚ โ”‚ โ€ข Glob/Grep (optimized) โ”‚ โ”‚
960
- โ”‚ โ”‚ โ€ข Git operations (libgit2) โ”‚ โ”‚
961
- โ”‚ โ”‚ โ€ข BM25 + tree-sitter search โ”‚ โ”‚
962
- โ”‚ โ”‚ โ€ข Wildcard matching (rexile) โ”‚ โ”‚
963
- โ”‚ โ”‚ โ€ข Command prefix (RETE) โ”‚ โ”‚
964
- โ”‚ โ”‚ โ€ข System stats (sysinfo) โ”‚ โ”‚
965
- โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
966
- โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
967
- ```
968
-
969
- **Performance Characteristics:**
970
-
971
- - **Levenshtein Distance**: O(nร—m) optimized with 2-row matrix (memory efficient)
972
- - **Block Anchor Matching**: Similarity-based with configurable thresholds
973
- - **Whitespace Normalization**: Smart indentation-preserving replacements
974
- - **Context-Aware Matching**: Multi-line block matching with fuzzy tolerance
975
- - **Memory Allocation**: Minimal heap usage, prefer stack allocation
976
- - **Concurrency**: Ready for parallel processing (currently single-threaded)
173
+ - **CLI/TUI**: TypeScript + Bun
174
+ - **Native Performance Layer**: Rust via FFI โ€” PTY, edit, grep, glob, git, archive, bash parser, BM25 search, wildcard matching, RETE command prefix, system stats
175
+ - **Telegram Bot**: `@ironcode-ai/telegram` โ€” grammy + `@ironcode-ai/sdk`
977
176
 
978
177
  ---
979
178
 
980
179
  ## Contributing
981
180
 
982
- Contributions are welcome! Please read [CONTRIBUTING.md](./CONTRIBUTING.md) before submitting pull requests.
983
-
984
- **Areas we're looking for help:**
985
-
986
- - Performance optimizations (more Rust rewrites!)
987
- - Bug fixes and testing
988
- - Documentation improvements
989
- - New plugin development
990
- - Benchmark improvements
991
- - Additional native Rust components
992
-
993
- **Recent Contributions:**
994
-
995
- - โœ… **Telegram Integration** (`@ironcode-ai/telegram` โ€” remote control via bot with live streaming output - Mar 2026)
996
- - โœ… **Multi-Account Providers + Round-Robin** (Anthropic, OpenAI, Google, Copilot, any API-key provider - Feb 2026)
997
- - โœ… **Native Wildcard + Bash Parser + Command Prefix (RETE)** (wildcard matching, tree-sitter bash, RETE rule engine - Feb 2026)
998
- - โœ… **Local Code Search** (BM25 + tree-sitter semantic search, 7 languages, offline - Feb 2026)
999
- - โœ… **Editor & Terminal** (External editor with auto-install + redesigned terminal with autosuggest - Feb 2026)
1000
- - โœ… **Code Changes Panel** (Diff viewer with hunk revert & inline comments - Feb 2026)
1001
- - โœ… **Git Source Control UI** (Full TUI integration with libgit2 - Feb 2026)
1002
- - โœ… **Streaming read optimization** (1.2-1.6x faster, 99.7% memory savings - Feb 2026)
1003
- - โœ… **Grep streaming optimization** (90-99% memory reduction, GB-file capability - Feb 2026)
1004
- - โœ… **Memory optimization deployed to production** (97.6% faster message processing - Feb 2026)
1005
- - โœ… **Resource monitoring system** (automatic throttling, 300MB default limit - Feb 2026)
1006
- - โœ… **Native PTY/Terminal deployed to production** (15.29x speedup, powers Bash tool - Feb 2026)
1007
- - โœ… Native Rust edit tool with 9 strategies (3-4x speedup)
1008
- - โœ… File Watcher Rust infrastructure (ready but not integrated - @parcel/watcher already native)
1009
- - โœ… Comprehensive benchmarking suite
1010
- - โœ… Memory profiling and optimization
1011
- - โœ… Correctness testing framework (32 test cases)
1012
-
1013
- ---
1014
-
1015
- ## Performance Testing
1016
-
1017
- We maintain rigorous performance testing to ensure all optimizations deliver real-world benefits:
1018
-
1019
- ### Correctness Tests
1020
-
1021
- ```bash
1022
- # Run all correctness tests (TS vs Rust comparison)
1023
- bun ./script/test-edit-correctness.ts # 18 unit tests
1024
- bun ./script/test-edit-real-files.ts # 4 real file tests
1025
- bun ./script/test-edit-stress.ts # 10 stress tests
1026
- bun ./script/test-integration.ts # Integration tests
1027
- ```
1028
-
1029
- **Test Coverage:**
1030
-
1031
- - โœ… 32/32 tests passing (100% correctness)
1032
- - โœ… All 9 replacer strategies validated
1033
- - โœ… Edge cases: Unicode, regex chars, large files, mixed encodings
1034
- - โœ… Real-world file testing on actual codebase
1035
-
1036
- ### Performance Benchmarks
1037
-
1038
- ```bash
1039
- # PTY/Terminal benchmark (15.29x speedup)
1040
- bun script/bench-pty.ts
1041
-
1042
- # File read benchmark (1.2-1.6x speedup, 99.7% memory savings)
1043
- # See STREAMING-READ-OPTIMIZATION.md for details
1044
-
1045
- # Rust micro-benchmarks
1046
- cd packages/ironcode/native/tool
1047
- cargo bench --bench edit_bench
1048
-
1049
- # VCS operations benchmark (git spawning vs libgit2)
1050
- bun ./script/bench-vcs.ts
1051
-
1052
- # Memory benchmarks (with GC profiling)
1053
- bun --expose-gc ./script/bench-edit-memory.ts
1054
-
1055
- # Rust memory profile
1056
- cd packages/ironcode/native/tool
1057
- cargo run --release --bin memory_bench
1058
- ```
1059
-
1060
- **Edit Tool Benchmark Results:**
1061
-
1062
- | Metric | TypeScript | Rust | Improvement |
1063
- | ---------------- | -------------- | ------------- | ------------- |
1064
- | **10 lines** | 103 ยตs | 73 ยตs | 1.4x faster |
1065
- | **100 lines** | 1.32 ms | 1.09 ms | 1.2x faster |
1066
- | **1000 lines** | 16.9 ms | 7.7 ms | 2.2x faster |
1067
- | **5000 lines** | 205 ms | 65 ms | 3.1x faster |
1068
- | **10000 lines** | 758 ms | 171 ms | 4.4x faster |
1069
- | **Memory (1K)** | 2.42 MB alloc | 0.17 MB alloc | 93% reduction |
1070
- | **Memory (10K)** | 31.05 MB alloc | 1.91 MB alloc | 94% reduction |
1071
-
1072
- **VCS Operations Benchmark Results:**
1073
-
1074
- | Metric | Git Spawning (Old) | Native FFI (New) | Improvement |
1075
- | ------------------- | ------------------ | ---------------- | --------------- |
1076
- | **Average latency** | 17.25 ms | 9.43 ms | 1.83x faster |
1077
- | **Min latency** | 7.40 ms | 8.05 ms | Consistent |
1078
- | **Max latency** | 24.97 ms | 18.63 ms | 26% better |
1079
- | **p50 (median)** | 17.71 ms | 9.06 ms | 1.95x faster |
1080
- | **p90** | 21.31 ms | 10.10 ms | 2.11x faster |
1081
- | **p95** | 22.58 ms | 12.34 ms | 1.83x faster |
1082
- | **p99** | 24.36 ms | 17.71 ms | 1.38x faster |
1083
- | **Time saved** | - | 7.82 ms/call | 45.3% reduction |
181
+ Contributions welcome! See [CONTRIBUTING.md](./CONTRIBUTING.md).
1084
182
 
1085
- _Benchmarked on IronCode repository (dev branch, 100 iterations)_
183
+ Areas to help with: performance optimizations, bug fixes, documentation, new plugins, additional Rust components.
1086
184
 
1087
185
  ---
1088
186
 
1089
187
  ## Acknowledgments
1090
188
 
1091
- - **IronCode Team**: For creating the original open-source AI coding agent
189
+ - **IronCode Team** โ€” original open-source AI coding agent
1092
190
  - All contributors to this fork
package/package.json CHANGED
@@ -6,13 +6,13 @@
6
6
  "scripts": {
7
7
  "postinstall": "bun ./postinstall.mjs || node ./postinstall.mjs"
8
8
  },
9
- "version": "1.17.2",
9
+ "version": "1.17.4",
10
10
  "license": "MIT",
11
11
  "optionalDependencies": {
12
- "ironcode-linux-x64-baseline": "1.17.2",
13
- "ironcode-linux-x64-modern": "1.17.2",
14
- "ironcode-linux-x64-baseline-musl": "1.17.2",
15
- "ironcode-windows-x64-modern": "1.17.2",
16
- "ironcode-darwin-arm64": "1.17.2"
12
+ "ironcode-linux-x64-baseline": "1.17.4",
13
+ "ironcode-linux-x64-modern": "1.17.4",
14
+ "ironcode-linux-x64-baseline-musl": "1.17.4",
15
+ "ironcode-windows-x64-modern": "1.17.4",
16
+ "ironcode-darwin-arm64": "1.17.4"
17
17
  }
18
18
  }