hablas-ai 2.5.7 → 2.6.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,154 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.6.0-beta.1] — 2026-08-11 · Dual-Channel Release Infrastructure
4
+
5
+ ### Added
6
+ - **Dual-channel release pipeline** — stable and beta versions published independently
7
+ - CI/CD auto-detects channel from git tag (`v*` = stable, `v*-beta*` = beta)
8
+ - Beta releases marked as GitHub pre-releases
9
+ - npm dist-tags: `latest` (stable) and `beta` (beta channel)
10
+ - **Install script** (`scripts/install.sh`) — curl-based installer with `--beta` flag
11
+ - Auto-detects platform and architecture
12
+ - Downloads correct binary from GitHub releases
13
+ - Adds hablas to PATH automatically
14
+ - **Web download page** (`web/index.html`) — landing page with dual download cards
15
+ - Stable (blue) and Beta (amber) channel cards
16
+ - Platform-specific download buttons (Linux, macOS, Windows)
17
+ - Auto-fetches latest versions from GitHub API
18
+ - Copy-paste npm and curl commands
19
+ - Dynamic changelog rendering
20
+
21
+ ### Changed
22
+ - `package.json` version bumped to `2.6.0-beta.1`
23
+ - `.github/workflows/release.yml` — complete rewrite:
24
+ - Auto-detects beta vs stable from tag name
25
+ - Runs type check + build + tests before release
26
+ - Publishes to npm with correct dist-tag (`latest` or `beta`)
27
+ - Generates release notes automatically
28
+ - `docs/ROADMAP_V3.md` — complete rewrite with 5-phase OpenCode-inspired evolution plan
29
+
30
+ ### How to Install
31
+ ```bash
32
+ # Stable (current: v2.5.9)
33
+ npm install -g hablas-ai
34
+ # or
35
+ curl -fsSL https://hablas.ai/install | bash
36
+
37
+ # Beta (current: v2.6.0-beta.1)
38
+ npm install -g hablas-ai@beta
39
+ # or
40
+ curl -fsSL https://hablas.ai/install | bash -s -- --beta
41
+ ```
42
+
43
+ ### Upcoming in Beta Channel
44
+ - v2.7.0-beta.1: LSP integration (go-to-definition, find references, diagnostics)
45
+ - v2.8.0-beta.1: Plugin system with hooks
46
+ - v2.9.0-beta.1: Full-screen TUI
47
+ - v3.0.0-beta.1: Auto-compact, session sharing, plan mode, undo/redo
48
+
49
+ ---
50
+
51
+
52
+ ## [2.5.9] — 2026-07-17 · Type Safety + New Documentation
53
+
54
+ ### Added
55
+ - `docs/TOOLS.md` — complete reference for all 42 tools (parameters, safety levels, usage)
56
+ - `docs/SECURITY.md` — security model: threat model, 9 defense layers, contributor checklist
57
+ - `docs/CONTRIBUTING.md` — contribution guide: setup, code style, testing, PR process, release workflow
58
+ - `errorMessage()` utility in `src/utils/error-classifier.ts` — single source of truth for error message extraction from `unknown` catch values
59
+
60
+ ### Changed
61
+ - Replaced all `catch (err: any)` with `catch (err: unknown)` across 12 files — TypeScript best practice since TS 4.4
62
+ - All `err.message` references replaced with `errorMessage(err)` — safe extraction from unknown
63
+ - `src/llm/custom-client.ts` — `fetchErr` and `outerErr` properly type-narrowed with `instanceof Error` before property access
64
+ - `src/tools/git-tool.ts` — error extraction now uses `"stderr" in err` type guard instead of `any` cast
65
+
66
+ ### Files Changed (code)
67
+ - `src/utils/error-classifier.ts` — added `errorMessage()` helper
68
+ - `src/memory/memory-tool.ts` — 5 catch blocks fixed
69
+ - `src/tools/file-ops.ts` — 11 catch blocks fixed
70
+ - `src/tools/atomic-ops.ts` — 3 catch blocks fixed
71
+ - `src/tools/codebase-graph.ts` — 3 catch blocks fixed
72
+ - `src/tools/image-intelligence.ts` — 5 catch blocks fixed
73
+ - `src/tools/git-tool.ts` — 1 catch block fixed
74
+ - `src/tools/search.ts` — 1 catch block fixed
75
+ - `src/tools/download-asset.ts` — 2 catch blocks fixed
76
+ - `src/tools/checkpoint.ts` — 1 catch block fixed
77
+ - `src/llm/custom-client.ts` — 3 catch blocks fixed
78
+ - `src/app/turn.ts` — 1 catch block fixed
79
+
80
+ ### Verification
81
+ - `tsc --noEmit`: 0 errors
82
+ - `esbuild bundle`: 595.5 KB
83
+ - MCP handshake test: PASSED (42 tools, read_file success, error handling verified)
84
+
85
+
86
+ ## [2.5.8] — 2026-07-17 · MCP Hardening + Documentation
87
+
88
+ ### Added
89
+ - `docs/MCP.md` — comprehensive MCP integration guide (server setup, client config, security model, architecture internals, troubleshooting)
90
+ - `docs/RELEASE_NOTES_2.5.8.md` — detailed release notes
91
+ - `parseMcpToolName()` utility in bridge.ts for decomposing `mcp__<server>__<tool>` names
92
+ - `totalToolCount()` helper in McpClientManager
93
+
94
+ ### Changed
95
+ - MCP client: on connection failure, child process is now properly killed and cleaned up (previously could linger on timeout)
96
+ - MCP client: separate timeouts for each phase — connect (8s), list tools (10s), call tool (30s) — instead of sharing one
97
+ - MCP client: reconnecting to a server with the same name now cleans up the old entry first
98
+ - MCP client: `ConnectedMcpServer` now tracks `transport`, `connectedAt` timestamp
99
+ - MCP bridge: tool names validated against `[a-zA-Z0-9_-]` (max 128 chars) — unsafe names are silently skipped
100
+ - MCP server: SIGINT/SIGTERM now trigger graceful shutdown (clean transport close) instead of hard exit
101
+ - MCP server: individual tool calls time out after 60s with structured error result
102
+ - MCP server: advertises usage instructions in server capabilities
103
+ - MCP server: improved error message for unknown tool calls
104
+ - Updated `docs/ARCHITECTURE.md` — added MCP module, data flow diagrams, updated tool table (42 tools)
105
+ - Updated `docs/CLI.md` — added `mcp-serve`, `mcp`, and `/mcp` command documentation
106
+ - Updated `README.md` — added MCP section, updated CLI flags table, updated architecture diagram
107
+
108
+ ### Verification
109
+ - `tsc --noEmit`: 0 errors
110
+ - `esbuild bundle`: 595.4 KB
111
+ - MCP handshake test: PASSED (init → tools/list → 42 tools → tool call verified)
112
+ - Tool name sanitization: verified
113
+ - Graceful shutdown: verified
114
+
115
+ ## [2.5.7] — 2026-07-17 · MCP Server + Client Integration
116
+
117
+ ### Added
118
+ - `hablas mcp-serve` — exposes all 42 internal tools as a standard MCP server over stdio
119
+ - Compatible with Claude Desktop, Cursor, VS Code, and any MCP-compatible host
120
+ - Uses `@modelcontextprotocol/sdk` Server + StdioServerTransport
121
+ - Thin protocol adapter — zero new tool logic, reuses ToolRegistry as-is
122
+ - MCP client (`src/mcp/client-manager.ts`) — connects to external MCP servers defined in `~/.hablas/mcp.json`
123
+ - Same config shape as Claude Desktop/Cursor — copy-paste compatible
124
+ - Auto-connects on CLI startup (both interactive and single-prompt modes)
125
+ - Fail-isolated: broken servers are silently skipped, never crash the CLI
126
+ - `src/mcp/bridge.ts` — wraps discovered MCP tools as native ToolDefinition objects
127
+ - Namespaced as `mcp__<server>__<tool>` for collision safety
128
+ - Safety: untrusted → `dangerous` (always confirmed, skipped in `--auto`), trusted → `confirm`
129
+ - `src/mcp/schema.ts` — JSON Schema ↔ flat param map conversion (both directions)
130
+ - `src/mcp/mcp-config.ts` — `~/.hablas/mcp.json` config management (load, save, add, remove, trust)
131
+ - `/mcp` slash command — list, trust, untrust, remove, reload servers
132
+ - `hablas mcp` CLI command — show config path and usage instructions
133
+ - `ToolRegistry.register()` and `ToolRegistry.unregisterWhere()` — runtime tool injection/removal
134
+ - `@modelcontextprotocol/sdk` and `zod` added as dependencies
135
+
136
+ ### Changed
137
+ - `src/app/repl.ts` — auto-connects MCP servers on startup, bridges tools into registry
138
+ - `src/app/run.ts` — auto-connects MCP servers for single-prompt mode, clean disconnect on exit
139
+ - `src/app/slash-commands.ts` — added `/mcp` command with subcommands (list, trust, untrust, remove, reload)
140
+ - `src/index.ts` — added `mcp-serve` and `mcp` CLI commands
141
+ - `src/ui/console.ts` — added `/mcp` to help text
142
+
143
+ ### Fixed
144
+ - `src/app/turn.ts` — removed 2 unused variables (`streamActive`, `stepHadStream`) causing TS6133 errors
145
+ - `src/tools/image-intelligence.ts` — removed unused import (`MISTRAL_PROVIDER`) causing TS6133 error
146
+
147
+ ### Verification
148
+ - `tsc --noEmit`: 0 errors
149
+ - `esbuild bundle`: 594.4 KB
150
+ - MCP handshake test: PASSED (initialize → tools/list → 42 tools with valid JSON Schema → tool call read_file verified)
151
+
3
152
  ## [2.2.10] — 2026-06-14 · Image Pipeline Recovery
4
153
 
5
154
  ### Added
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Hablas CLI
2
2
 
3
- **Single-agent terminal engineering runtime** — v2.4.0
3
+ **Single-agent terminal engineering runtime** — v2.5.8
4
4
 
5
- > One agent. Full tool access. Plans, codes, tests, commits — without switching tools or losing context.
5
+ > One agent. Full tool access. Plans, codes, tests, commits — without switching tools or losing context. Now MCP-native.
6
6
 
7
7
  ---
8
8
 
@@ -15,7 +15,8 @@
15
15
  5. **TDD built-in** — failing tests first, implementation second
16
16
  6. **Checkpoints** — named snapshots before any risky change
17
17
  7. **Cross-turn reasoning memory** — Hablas never forgets what it learned
18
- 8. **Direct technical tone** — no emojis, no hype, no filler
18
+ 8. **MCP-native** — act as both MCP server and client
19
+ 9. **Direct technical tone** — no emojis, no hype, no filler
19
20
 
20
21
  ---
21
22
 
@@ -50,7 +51,11 @@ hablas # start the agent
50
51
  |---|---|
51
52
  | `hablas` | Start interactive session |
52
53
  | `hablas --setup` | Run the setup wizard |
54
+ | `hablas run <prompt>` | Run a single prompt and exit |
55
+ | `hablas --auto` | Auto mode — skip tool confirmations where allowed |
53
56
  | `hablas --model <name>` | Override the configured model |
57
+ | `hablas mcp-serve` | Expose Hablas' tools as an MCP server over stdio |
58
+ | `hablas mcp` | Show MCP config path and server status |
54
59
  | `hablas --verbose` | Enable verbose logging |
55
60
  | `hablas --no-color` | Disable ANSI output |
56
61
  | `hablas --version` | Print version and exit |
@@ -58,14 +63,64 @@ hablas # start the agent
58
63
 
59
64
  ---
60
65
 
66
+ ## MCP integration
67
+
68
+ Hablas is both an **MCP server** and **MCP client**:
69
+
70
+ ### As a server — `hablas mcp-serve`
71
+
72
+ Expose all 42 Hablas tools to any MCP-compatible host (Claude Desktop, Cursor, VS Code):
73
+
74
+ ```json
75
+ // Claude Desktop config
76
+ {
77
+ "mcpServers": {
78
+ "hablas": {
79
+ "command": "hablas",
80
+ "args": ["mcp-serve", "-p", "/your/project"]
81
+ }
82
+ }
83
+ }
84
+ ```
85
+
86
+ ### As a client — consume external MCP servers
87
+
88
+ Connect to external MCP servers (GitHub, Playwright, databases, anything) by adding them to `~/.hablas/mcp.json` (same format as Claude Desktop/Cursor):
89
+
90
+ ```json
91
+ {
92
+ "mcpServers": {
93
+ "github": {
94
+ "command": "npx",
95
+ "args": ["-y", "@modelcontextprotocol/server-github"],
96
+ "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_xxx" }
97
+ }
98
+ }
99
+ }
100
+ ```
101
+
102
+ External tools are bridged into the agent loop as first-class native tools (`mcp__github__create_issue`, etc.), with safety gating based on trust level.
103
+
104
+ Manage live connections with the `/mcp` slash command:
105
+ ```
106
+ /mcp — list connected servers
107
+ /mcp trust <name> — trust a server (confirm-level access)
108
+ /mcp reload — reconnect after editing config
109
+ /mcp remove <name> — remove a server
110
+ ```
111
+
112
+ See [docs/MCP.md](docs/MCP.md) for the complete guide.
113
+
114
+ ---
115
+
61
116
  ## In-session commands
62
117
 
63
118
  ### Planning & execution
64
119
  | Command | Description |
65
120
  |---|---|
66
- | `/plan <task>` | Break a task into steps, confirm before execution |
67
121
  | `/files <query>` | Rank and preview the most relevant files for a task |
68
- | `/git` | Show git status, staged changes, recent commits |
122
+ | `/git [status\|log]` | Show git status, staged changes, recent commits |
123
+ | `/diff [file]` | Show git diff |
69
124
 
70
125
  ### Checkpoints
71
126
  | Command | Description |
@@ -79,16 +134,24 @@ hablas # start the agent
79
134
  | Command | Description |
80
135
  |---|---|
81
136
  | `/tests` | Run project test suite, show parsed results |
82
- | `/tests coverage` | Full coverage report with per-file breakdown |
83
137
  | `/tdd <description>` | Scaffold failing tests first, then implement |
84
138
 
85
139
  ### Context & memory
86
140
  | Command | Description |
87
141
  |---|---|
88
142
  | `/memory` | Show project memory + cross-turn reasoning accumulator |
89
- | `/compact` | Compress current context to free token budget |
143
+ | `/workspace` | Inspect project structure |
90
144
  | `/help` | List all available commands |
91
145
 
146
+ ### MCP
147
+ | Command | Description |
148
+ |---|---|
149
+ | `/mcp` | List connected MCP servers, tool count, trust status |
150
+ | `/mcp trust <name>` | Trust a server (tools get confirm-level safety) |
151
+ | `/mcp untrust <name>` | Untrust a server (tools get dangerous-level safety) |
152
+ | `/mcp remove <name>` | Remove a server from config |
153
+ | `/mcp reload` | Reconnect all servers after config changes |
154
+
92
155
  ---
93
156
 
94
157
  ## Example workflows
@@ -120,13 +183,13 @@ Modified: prisma/schema.prisma (+12 / -3)
120
183
  Added: prisma/migrations/20260615_uuid.sql
121
184
  ```
122
185
 
123
- ### Smart file discovery
186
+ ### MCP — use GitHub tools inside Hablas
124
187
 
125
188
  ```
126
- > /files payment processing logic
127
- 1. src/services/payment.ts (score: 0.94)
128
- 2. src/routes/checkout.ts (score: 0.87)
129
- 3. src/models/transaction.ts (score: 0.81)
189
+ > /mcp trust github
190
+ > /mcp reload
191
+ > create an issue in my repo titled "fix login bug" with body "the login form crashes on Safari"
192
+ ✓ Called mcp__github__create_issue — created issue #42
130
193
  ```
131
194
 
132
195
  ---
@@ -139,13 +202,15 @@ User input
139
202
  → Fast path (trivial turns — no tools)
140
203
  → Full path: plan → tool execution → verification
141
204
  ├─ file-ops (read, write, atomic patch, rollback)
142
- ├─ shell (unrestricted terminal)
143
- ├─ git-ops (commit, PR, changelog, merge)
144
- ├─ checkpoint (save, list, diff, restore)
145
- ├─ run_tests (Jest, Vitest, Pytest, Go test)
146
- ├─ tdd-engine (scaffold failing tests → implement)
147
- ├─ search (web, DuckDuckGo)
148
- ├─ image-intel (vision for screenshots/diagrams)
205
+ ├─ shell (unrestricted terminal)
206
+ ├─ git-ops (status, diff, log, commit, stash)
207
+ ├─ checkpoint (save, list, diff, restore)
208
+ ├─ run_tests (Jest, Vitest, Pytest, Go test)
209
+ ├─ tdd-engine (scaffold failing tests → implement)
210
+ ├─ codebase-graph (analyze_project, find_references, impact_analysis)
211
+ ├─ web (search, scrape, extract_links, read_pdf)
212
+ ├─ image-intel (search candidates, inspect, download)
213
+ ├─ mcp tools (mcp__<server>__<tool> — external MCP servers)
149
214
  └─ suggest_relevant_files (5-signal ranking)
150
215
  → LongContextAccumulator (cross-turn reasoning memory)
151
216
  → SmartContext (auto-inject top-K files for complex tasks)
@@ -156,20 +221,28 @@ See [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md) for full detail.
156
221
 
157
222
  ---
158
223
 
159
- ## What's new in v2.4.0
224
+ ## What's new
225
+
226
+ ### v2.5.8 — MCP Hardening + Documentation
227
+
228
+ - MCP client: process cleanup on failure, separate timeouts, reconnect safety
229
+ - MCP bridge: tool name sanitization against injection
230
+ - MCP server: graceful shutdown (SIGINT/SIGTERM), tool call timeout (60s)
231
+ - New: `docs/MCP.md` — comprehensive MCP integration guide
232
+ - Updated: ARCHITECTURE.md, CLI.md, README.md with MCP sections
233
+
234
+ ### v2.5.7 — MCP Server + Client Integration
235
+
236
+ - `hablas mcp-serve` — expose all 42 tools as an MCP server over stdio
237
+ - MCP client — connect to external servers via `~/.hablas/mcp.json`
238
+ - `/mcp` slash command — list, trust, untrust, remove, reload
239
+ - `@modelcontextprotocol/sdk` + `zod` dependencies added
240
+ - Fixed 2 pre-existing type errors (turn.ts, image-intelligence.ts)
160
241
 
161
- **Phase 3 — Professional Intelligence**
242
+ ### v2.4.0 — Professional Intelligence
162
243
 
163
- - `checkpoint_save` / `list` / `restore` / `diff` — named workspace snapshots
164
- - `run_tests` — auto-detect Jest/Vitest/Pytest/Go, parse structured results
165
- - `test_coverage` — full coverage report with per-file breakdown
166
- - `tdd_scaffold` — red-green-refactor TDD workflow in the terminal
167
- - `suggest_relevant_files` — 5-signal smart file ranking
168
- - `LongContextAccumulator` — cross-turn reasoning memory with cosine dedup
169
- - `SmartContext` — auto-inject top-K relevant files for L/XL tasks
170
- - `/memory` upgraded — shows project memory + reasoning accumulator
171
- - `/checkpoint`, `/tests`, `/tdd` slash commands
172
- - TypeScript: 0 errors, clean build, 324KB bundle
244
+ - Checkpoints, TDD engine, smart file discovery, reasoning memory
245
+ - 42 tools total
173
246
 
174
247
  See [`CHANGELOG.md`](CHANGELOG.md) for the full history.
175
248
 
@@ -0,0 +1,5 @@
1
+ {
2
+ "hablas-win-x64.exe": "2a2dfde0f09300da2fef41ffe2749a1511e8ad18949ba520f606105a505112cb",
3
+ "hablas-linux-x64": "b211c930c58c5be614ac38db579079cd2919e670f4e60ec7cc31c5c9315ff62e",
4
+ "hablas-macos-x64": "bf47889c57a62c3777ee35a0faef1a3b7b42b617e3d0c3f5358b24cc7a69e82a"
5
+ }