@nomad-e/bluma-cli 0.11.1 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +94 -504
- package/dist/config/skills/factorai-sh/SKILL.md +5 -4
- package/dist/main.js +1997 -1166
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,573 +1,163 @@
|
|
|
1
|
-
# BluMa CLI
|
|
1
|
+
# BluMa CLI
|
|
2
2
|
|
|
3
|
-

|
|
4
4
|
|
|
5
|
-
[](https://github.com/Nomad-e/bluma-cli/actions)
|
|
9
|
-
[](https://jestjs.io/)
|
|
10
|
-
[](https://www.typescriptlang.org/)
|
|
11
|
-
[](https://prettier.io/)
|
|
12
|
-
[](https://www.npmjs.com/package/@nomad-e/bluma-cli)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
[](https://nodejs.org/)
|
|
7
|
+
[](https://www.npmjs.com/package/@nomad-e/bluma-cli)
|
|
13
8
|
|
|
14
|
-
**BluMa**
|
|
15
|
-
|
|
16
|
-
**Latest Version:** v0.6.4 (2026-05-10) — Circular dependency resolution, enhanced native tool metadata, improved multi-agent coordination, and professional release engineering.
|
|
9
|
+
**BluMa** é o agente de linha de comando da Nomad-e para engenharia de software: interface terminal, ferramentas nativas, sessões persistentes, memória em disco e integração com o **Factor Router** para modelos. Em modo sandbox, o BluMa cria e faz deploy de apps **FactorAI.sh** dentro de um workspace isolado.
|
|
17
10
|
|
|
18
11
|
---
|
|
19
12
|
|
|
20
|
-
##
|
|
13
|
+
## Início rápido
|
|
21
14
|
|
|
22
15
|
```bash
|
|
23
|
-
# Install globally
|
|
24
16
|
npm install -g @nomad-e/bluma-cli
|
|
25
17
|
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
export FACTOR_ROUTER_URL=https://seu-factor-router/v1
|
|
19
|
+
export FACTOR_ROUTER_KEY=sua-chave
|
|
20
|
+
|
|
21
|
+
bluma # nova sessão
|
|
22
|
+
bluma resume # retomar (menu)
|
|
23
|
+
bluma resume <session_id>
|
|
24
|
+
```
|
|
28
25
|
|
|
29
|
-
|
|
30
|
-
bluma resume {session_id}
|
|
26
|
+
**Desenvolvimento local:**
|
|
31
27
|
|
|
32
|
-
|
|
28
|
+
```bash
|
|
29
|
+
git clone https://github.com/Nomad-e/bluma-cli.git
|
|
30
|
+
cd bluma-cli
|
|
33
31
|
npm install
|
|
32
|
+
cp .env.example .env
|
|
34
33
|
npm run build
|
|
35
34
|
npm start
|
|
36
35
|
```
|
|
37
36
|
|
|
38
37
|
---
|
|
39
38
|
|
|
40
|
-
##
|
|
41
|
-
|
|
42
|
-
### 🤖 **Native Tools** (45+ tools)
|
|
43
|
-
Comprehensive toolset organized by category with risk levels and auto-approve policies.
|
|
44
|
-
Tools are now modularly structured in `src/app/agent/tools/` with separate UI components:
|
|
45
|
-
|
|
46
|
-
**Filesystem** (10 tools):
|
|
47
|
-
- `ls_tool`, `read_file_lines`, `count_file_lines`, `find_by_name`, `grep_search`
|
|
48
|
-
- `view_file_outline`, `edit_tool`, `file_write`, `notebook_edit`, `lsp_query`
|
|
49
|
-
|
|
50
|
-
**Execution** (6 tools):
|
|
51
|
-
- `shell_command`, `command_status`, `send_command_input`, `kill_command`
|
|
52
|
-
- `repl` (interactive code execution for Python/Node/Bash)
|
|
53
|
-
- `task_output` (real-time output following)
|
|
54
|
-
|
|
55
|
-
**Communication** (7 tools):
|
|
56
|
-
- `message`, `ask_user_question`, `brief`, `send_message`
|
|
57
|
-
- `list_mailbox_messages`, `poll_mailbox`, `signal_mailbox`
|
|
58
|
-
|
|
59
|
-
**Planning** (11 tools):
|
|
60
|
-
- `todo`, `task_boundary`, `task_create`, `task_update`, `task_stop`
|
|
61
|
-
- `task_list`, `task_get`, `enter_plan_mode`, `exit_plan_mode`
|
|
62
|
-
- `cron_create`, `cron_list`, `cron_delete`
|
|
63
|
-
|
|
64
|
-
**Knowledge** (10 tools):
|
|
65
|
-
- `search_web`, `web_fetch`, `load_skill`, `coding_memory`
|
|
66
|
-
- `ctx_inspect`, `dream`, `context_collapse`, `snip`
|
|
67
|
-
- `list_mcp_resources`, `read_mcp_resource`
|
|
68
|
-
|
|
69
|
-
**Agent Coordination** (4 tools):
|
|
70
|
-
- `spawn_agent`, `wait_agent`, `list_agents`, `kill_agent`
|
|
71
|
-
|
|
72
|
-
**FactorAI Sandbox** (5 tools):
|
|
73
|
-
- `factorai.sh.create_next_app`, `factorai.sh.deploy_app`
|
|
74
|
-
- `factorai.sh.get_app_status`, `factorai.sh.apply_app_changes`
|
|
75
|
-
- `factorai.sh.redeploy_app`
|
|
76
|
-
|
|
77
|
-
### 🧠 **Multi-Agent Orchestration**
|
|
78
|
-
- **Coordinator Mode**: Product Owner + Engineering Manager hybrid that delegates to specialist workers
|
|
79
|
-
- **Parallel Execution**: Launch multiple workers concurrently for research, implementation, and verification
|
|
80
|
-
- **Mailbox IPC**: **Bidirectional file-based communication** between coordinator and workers
|
|
81
|
-
- **list_mailbox_messages**: Read progress updates, permission requests, and results
|
|
82
|
-
- **poll_mailbox**: Poll for new messages from workers
|
|
83
|
-
- **signal_mailbox**: Send ack/nack/progress/heartbeat signals
|
|
84
|
-
- **File-based storage**: `~/.bluma/mailboxes/{session_id}.in/out/sig` (JSONL format)
|
|
85
|
-
- **Worker Types**: Researchers, implementers, verifiers with specialized roles
|
|
86
|
-
- **Session Registry**: Track and manage agent sessions with lifecycle events
|
|
87
|
-
- **Task Boundary Tracking**: Use `task_boundary` to track orchestration phases (PLANNING, EXECUTION, VERIFICATION)
|
|
88
|
-
|
|
89
|
-
### 📝 **Slash Commands** (80+ commands)
|
|
90
|
-
Quick access to common operations across 5 categories:
|
|
91
|
-
|
|
92
|
-
**Session Commands** (25+):
|
|
93
|
-
- `/clear` - Clear current session
|
|
94
|
-
- `/sessions` - List all sessions
|
|
95
|
-
- `/attach` - Attach to existing session
|
|
96
|
-
- `/follow` - Follow session output
|
|
97
|
-
- `/bridge` - Bridge multiple sessions
|
|
98
|
-
- `/status` - Show session status
|
|
99
|
-
- `/logs` - View session logs
|
|
100
|
-
- `/resume` - Resume previous session
|
|
101
|
-
- `/kill` - Terminate session
|
|
102
|
-
- `/compact` - Compress context
|
|
103
|
-
- `/export` - Export session
|
|
104
|
-
- `/summarize` - Summarize conversation
|
|
105
|
-
- `/history` - Command history
|
|
106
|
-
- `/share` - Share session
|
|
107
|
-
- `/copy` - Copy output to clipboard
|
|
108
|
-
- `/commit` - Create git commit
|
|
109
|
-
- `/pr` - Create pull request
|
|
110
|
-
- `/release` - Professional release engineering
|
|
111
|
-
- `/snip` - Extract conversation snippets
|
|
112
|
-
- `/collapse` - Collapse context
|
|
113
|
-
- `/brief` - Generate brief
|
|
114
|
-
- `/undo` - Undo last action
|
|
115
|
-
- `/redo` - Redo undone action
|
|
116
|
-
- `/thread` - Thread management (list/new/resume/fork/rename/archive/delete)
|
|
117
|
-
|
|
118
|
-
**Inspect Commands** (30+):
|
|
119
|
-
- `/plugins` - List plugins
|
|
120
|
-
- `/plugin` - Plugin details
|
|
121
|
-
- `/diagnostics` - Run diagnostics
|
|
122
|
-
- `/permissions` - Show permissions
|
|
123
|
-
- `/features` - List features
|
|
124
|
-
- `/hooks` - Hook registry
|
|
125
|
-
- `/model` - Model info
|
|
126
|
-
- `/effort` - Effort estimation
|
|
127
|
-
- `/style` - Code style
|
|
128
|
-
- `/sandbox` - Sandbox status
|
|
129
|
-
- `/worktree` - Worktree info
|
|
130
|
-
- `/statusline` - Status line config
|
|
131
|
-
- `/skills` - List skills
|
|
132
|
-
- `/tools` - List tools
|
|
133
|
-
- `/mcp` - MCP resources
|
|
134
|
-
- `/debug-workers` - Worker debug
|
|
135
|
-
- `/cost` - Cost tracking
|
|
136
|
-
- `/memory` - Memory usage
|
|
137
|
-
- `/stats` - Session stats
|
|
138
|
-
- `/theme` - Theme config
|
|
139
|
-
- `/keybindings` - Key bindings
|
|
140
|
-
- `/vim` - Vim mode
|
|
141
|
-
- `/ctx` - Context inspector
|
|
142
|
-
- `/dream` - Dream engine status
|
|
143
|
-
- `/diff` - Show recent changes
|
|
144
|
-
- `/editor` - Open in editor
|
|
145
|
-
- `/config` - Runtime config
|
|
146
|
-
- `/file` - File operations
|
|
147
|
-
- `/search` - Search codebase
|
|
148
|
-
- `/context` - Context management
|
|
149
|
-
- `/token` - Token usage
|
|
150
|
-
- `/settings` - Runtime settings
|
|
151
|
-
- `/alias` - Manage aliases
|
|
152
|
-
- `/macro` - Execute macros
|
|
153
|
-
- `/thread stats` - Thread statistics
|
|
154
|
-
|
|
155
|
-
**Agent Commands** (15+):
|
|
156
|
-
- `/agent` - Agent info
|
|
157
|
-
- `/agents` - List agents
|
|
158
|
-
- `/img` / `/image` - Image handling
|
|
159
|
-
- `/init` - Initialize project
|
|
160
|
-
- `/review` - Code review
|
|
161
|
-
- `/explain` - Explain code
|
|
162
|
-
- `/fix` - Fix errors
|
|
163
|
-
- `/debug` - Debug issues
|
|
164
|
-
- `/bug` - Report bug
|
|
165
|
-
- `/test` - Run tests
|
|
166
|
-
- `/optimize` - Optimize code
|
|
167
|
-
- `/refactor` - Refactor code
|
|
168
|
-
- `/document` - Generate docs
|
|
169
|
-
- `/chat` - Chat mode
|
|
170
|
-
- `/code` - Code mode
|
|
171
|
-
- `/terminal` - Terminal placeholder
|
|
172
|
-
- `/template` - Create from template
|
|
173
|
-
|
|
174
|
-
**Input Methods**:
|
|
175
|
-
- `Ctrl+V` / `Cmd+V` - Paste image/text/file
|
|
176
|
-
- `Ctrl+Shift+I` - Same as Ctrl+V
|
|
177
|
-
|
|
178
|
-
### 🎯 **Intelligent Context Management**
|
|
179
|
-
- **Auto Memory**: Persistent coding notes across sessions (`coding_memory`)
|
|
180
|
-
- **Context Collapse**: Advanced history compaction with multiple strategies (aggressive, moderate, minimal, target token budget)
|
|
181
|
-
- **Snip Tool**: Extract and remove old conversation snippets (extract/remove/auto modes)
|
|
182
|
-
- **Dream Engine**: Background memory consolidation — deduplicates, merges, prunes, and enriches coding memory entries
|
|
183
|
-
- **Token Tracking**: Real-time token usage monitoring with `ctx_inspect`
|
|
184
|
-
- **Thread Management**: Full thread lifecycle with create, resume, fork, rename, archive, delete operations
|
|
185
|
-
|
|
186
|
-
### 🛠️ **Plan Mode**
|
|
187
|
-
Structured problem-solving workflow with 3 phases:
|
|
188
|
-
1. **PLANNING**: Research and design
|
|
189
|
-
2. **EXECUTION**: Implementation
|
|
190
|
-
3. **VERIFICATION**: Testing and validation
|
|
191
|
-
|
|
192
|
-
### 🔧 **Skills System** (6 skills)
|
|
193
|
-
Extendable expertise modules with **progressive disclosure** — load only when needed:
|
|
194
|
-
|
|
195
|
-
**Available Skills:**
|
|
196
|
-
- **git-commit**: Conventional commits automation with BluMa watermark
|
|
197
|
-
- **git-pr**: Pull request creation and management (descriptions, reviewers, draft mode)
|
|
198
|
-
- **git-release**: Full release engineering (version bumps, changelog, tags, npm publish, GitHub releases)
|
|
199
|
-
- **pdf**: PDF generation and manipulation (reports, merge, forms, OCR)
|
|
200
|
-
- **xlsx**: Spreadsheet processing (create, edit, formulas, charting, cleaning)
|
|
201
|
-
- **skill-creator**: Create custom skills
|
|
202
|
-
|
|
203
|
-
**How Skills Work:**
|
|
204
|
-
1. **Discovery**: Skills loaded from `dist/config/skills/`, `{cwd}/.bluma/skills/`, `~/.bluma/skills/`
|
|
205
|
-
2. **Progressive Disclosure**:
|
|
206
|
-
- Level 1: One-line description (always visible)
|
|
207
|
-
- Level 2: Full instructions (loaded on activation)
|
|
208
|
-
- Level 3: References and scripts (loaded on demand)
|
|
209
|
-
3. **Triggering**: Agent auto-detects when to load skills based on task context
|
|
210
|
-
4. **Priority**: Native > Project > Global (native skills cannot be overridden)
|
|
211
|
-
|
|
212
|
-
**Create Custom Skills:**
|
|
213
|
-
See [docs/SKILLS.md](docs/SKILLS.md) for complete guide on authoring skills.
|
|
214
|
-
|
|
215
|
-
### 🎨 **Modern UI**
|
|
216
|
-
- Built with **Ink** (React for CLI)
|
|
217
|
-
- **Shimmer effects** for working states (WorkingShimmerText, Spinner with ShimmerChar/FlashingChar)
|
|
218
|
-
- **Streamlined transcript** with syntax highlighting (HighlightedCode, MarkdownRenderer)
|
|
219
|
-
- **Bottom dock** for status and controls (BlumaBottomDock, StatusBar)
|
|
220
|
-
- **Worker overlay** for multi-agent visualization (WorkerOverlay, WorkerStatusList)
|
|
221
|
-
- **Real-time streaming** (StreamingMarkdown, StreamingText, TypewriterText)
|
|
222
|
-
- **Animated indicators** (Spinner, ProgressBar)
|
|
223
|
-
- **Theme system** with configurable themes (blumaTerminal theme)
|
|
224
|
-
|
|
225
|
-
### 🔒 **Sandbox Security**
|
|
226
|
-
- **Permission modes**: Local (auto-approve) vs Sandbox (confirmation required)
|
|
227
|
-
- **Policy enforcement**: `rm -rf` protection, sudo blocking, dangerous command detection
|
|
228
|
-
- **Tool risk levels**: safe, write, execute, network — with per-mode auto-approve settings
|
|
229
|
-
- **FactorAI integration**: Optional sandbox backend for isolated execution with workspace manifest persistence
|
|
230
|
-
|
|
231
|
-
### 📦 **Performance**
|
|
232
|
-
- **TypeScript**: Full type safety with strict mode
|
|
233
|
-
- **ES Modules**: Modern module system with bundler resolution
|
|
234
|
-
- **React 19**: Latest React with concurrent features
|
|
235
|
-
- **Optimized rendering**: Memoized message blocks, offscreen freeze, expandable previews
|
|
236
|
-
- **Parallel tests**: Up to 8 workers for faster test execution
|
|
237
|
-
- **Native modules**: Rust-based clipboard and layout engine for critical paths
|
|
238
|
-
|
|
239
|
-
### 🔌 **Hooks & Plugins**
|
|
240
|
-
Extensible architecture with hook registry and plugin system:
|
|
241
|
-
|
|
242
|
-
- **Hook Registry**: Execute custom scripts on events (pre-commit, post-build, etc.)
|
|
243
|
-
- **Plugin System**: Extend BluMa with custom plugins
|
|
244
|
-
- **Event-driven**: Hooks triggered by tool execution, session events, and lifecycle hooks
|
|
245
|
-
|
|
246
|
-
See [docs/BLUMA_DEVELOPER_GUIDE.md](docs/BLUMA_DEVELOPER_GUIDE.md) for plugin development.
|
|
247
|
-
|
|
248
|
-
### 🔌 **MCP Support**
|
|
249
|
-
- **Model Context Protocol**: Connect to external MCP servers
|
|
250
|
-
- **Resource listing**: Discover and read MCP resources
|
|
251
|
-
- **SSE transport**: Server-Sent Events for real-time communication
|
|
252
|
-
|
|
253
|
-
### 🧵 **Thread Management**
|
|
254
|
-
- **Thread lifecycle**: Create, resume, fork, rename, archive, delete threads
|
|
255
|
-
- **Thread stats**: View thread metadata and statistics
|
|
256
|
-
- **Codex-style interface**: Familiar thread management commands
|
|
257
|
-
|
|
258
|
-
### 🦀 **Native Modules** (Rust)
|
|
259
|
-
High-performance native extensions for critical operations:
|
|
260
|
-
|
|
261
|
-
- **bluma-clipboard**: Cross-platform clipboard with image support
|
|
262
|
-
- Built with Rust (arboard crate)
|
|
263
|
-
- No dependencies on wl-paste/xclip
|
|
264
|
-
- Native image reading for terminal paste
|
|
265
|
-
- **yoga-layout**: High-performance layout engine for Ink
|
|
266
|
-
- Facebook's Yoga layout library
|
|
267
|
-
- Optimized for terminal UI rendering
|
|
268
|
-
|
|
269
|
-
### 📦 **VS Code Extension**
|
|
270
|
-
Full BluMa capabilities integrated into VS Code:
|
|
271
|
-
|
|
272
|
-
- **Chat Panel**: Interactive chat interface with full BluMa capabilities
|
|
273
|
-
- **Session Sync**: Real-time synchronization with terminal sessions
|
|
274
|
-
- **Image Support**: Paste and view images directly in VS Code
|
|
275
|
-
- **File Integration**: Open and edit files from within the chat
|
|
276
|
-
- **Streaming**: Real-time response streaming with markdown rendering
|
|
277
|
-
|
|
278
|
-
See [vscode-extension/README.md](vscode-extension/README.md) for setup instructions.
|
|
39
|
+
## Funcionalidades
|
|
279
40
|
|
|
280
|
-
|
|
41
|
+
### Interface terminal
|
|
281
42
|
|
|
282
|
-
|
|
43
|
+
- Chat com streaming, raciocínio do modelo e execução de ferramentas
|
|
44
|
+
- Histórico e retoma de sessões
|
|
45
|
+
- Comandos `/` para sessão, git, memória, sandbox, inspeção e mais
|
|
46
|
+
- Modos **local** e **sandbox** (permissões e workspace)
|
|
283
47
|
|
|
284
|
-
|
|
285
|
-
┌─────────────────────────────────────────────────────────────┐
|
|
286
|
-
│ BluMa CLI (Ink UI) │
|
|
287
|
-
├─────────────────────────────────────────────────────────────┤
|
|
288
|
-
│ BlumaShell │ BlumaViewport │ BlumaTranscript │
|
|
289
|
-
│ BlumaBottomDock │ BlumaWorkersOverlay │ PlanPopup │
|
|
290
|
-
├─────────────────────────────────────────────────────────────┤
|
|
291
|
-
│ useBlumaSessionRuntime (Hook) │
|
|
292
|
-
├─────────────────────────────────────────────────────────────┤
|
|
293
|
-
│ Session Registry │ Agent Core │ Tool Invoker │
|
|
294
|
-
│ Thread Manager │ Prompt Builder │ Mailbox IPC │
|
|
295
|
-
├─────────────────────────────────────────────────────────────┤
|
|
296
|
-
│ Native Tools (45+) │ Skills (6) │ MCP Clients │
|
|
297
|
-
│ FactorAI Sandbox │ Hook Registry │ Feature Flags │
|
|
298
|
-
└─────────────────────────────────────────────────────────────┘
|
|
299
|
-
```
|
|
48
|
+
### Modelos (Factor Router)
|
|
300
49
|
|
|
301
|
-
|
|
50
|
+
O BluMa fala com o Factor Router via API OpenAI-compatible. Configuração:
|
|
302
51
|
|
|
303
|
-
|
|
52
|
+
| Variável | Descrição |
|
|
53
|
+
|----------|-----------|
|
|
54
|
+
| `FACTOR_ROUTER_URL` | URL base do router (ex. `https://…/v1`) |
|
|
55
|
+
| `FACTOR_ROUTER_KEY` | Chave de autenticação |
|
|
304
56
|
|
|
305
|
-
|
|
306
|
-
ToolName/
|
|
307
|
-
├── index.ts # Public API exports
|
|
308
|
-
├── ToolName.ts # Core implementation logic
|
|
309
|
-
├── UI.tsx # React/Ink UI component
|
|
310
|
-
└── types.ts # Type definitions
|
|
311
|
-
```
|
|
57
|
+
O router escolhe o modelo; não precisas de configurar endpoints de LLM no BluMa além destas duas variáveis.
|
|
312
58
|
|
|
313
|
-
|
|
314
|
-
- **Independent testing** of each tool
|
|
315
|
-
- **Clear separation** of logic and presentation
|
|
316
|
-
- **Easy discovery** and maintenance
|
|
317
|
-
- **Consistent patterns** across the codebase
|
|
318
|
-
|
|
319
|
-
### Core Components
|
|
320
|
-
|
|
321
|
-
- **`src/main.ts`**: Entry point with CLI mode, agent mode, session management
|
|
322
|
-
- **`src/app/ui/`**: React/Ink UI components
|
|
323
|
-
- `App.tsx`: Main orchestrator
|
|
324
|
-
- `BlumaSession.tsx`: Session management and UI lifecycle
|
|
325
|
-
- `components/`: Reusable UI elements (40+ components)
|
|
326
|
-
- `hooks/`: React hooks for state management
|
|
327
|
-
- `theme/`: Theme system and terminal styling
|
|
328
|
-
- `utils/`: Utility functions and slash command registry
|
|
329
|
-
- **`src/app/agent/`**: AI agent core
|
|
330
|
-
- `core/`: Prompt building, context management, LLM integration, thread management
|
|
331
|
-
- `tools/`: **Modular tool architecture** — 43+ tool directories, each with:
|
|
332
|
-
- Implementation logic (`*.ts`)
|
|
333
|
-
- UI components (`UI.tsx`)
|
|
334
|
-
- Type definitions (`types.ts`)
|
|
335
|
-
- Index exports (`index.ts`)
|
|
336
|
-
- `runtime/`: Session runtime, sandbox policy, plugin system, hook registry
|
|
337
|
-
- `session_manager/`: Multi-session orchestration
|
|
338
|
-
- `subagents/`: Worker system with base LLM subagent and coordinator tools
|
|
339
|
-
- `bluma/`: BluMa-specific core logic and turn start payload
|
|
340
|
-
- **`src/app/agent/config/`**: Configuration files and skill definitions
|
|
341
|
-
- **`src/ink/`**: Ink renderer shims and compatibility layer
|
|
342
|
-
- **`src/shims/`**: Build-time shims for react-compiler-runtime and bidi-js
|
|
343
|
-
- **`native/`**: Rust-based native modules (clipboard, yoga-layout)
|
|
344
|
-
- **bluma-clipboard**: Cross-platform clipboard with image support
|
|
345
|
-
- **yoga-layout**: High-performance layout engine for Ink
|
|
346
|
-
- **`vscode-extension/`**: VS Code extension for chat integration
|
|
347
|
-
- Chat panel with full BluMa capabilities
|
|
348
|
-
- Real-time session sync
|
|
349
|
-
- Image and file support
|
|
350
|
-
|
|
351
|
-
---
|
|
59
|
+
### Memória
|
|
352
60
|
|
|
353
|
-
|
|
61
|
+
O BluMa guarda contexto persistente em ficheiros sob `~/.bluma`:
|
|
354
62
|
|
|
355
|
-
|
|
63
|
+
| Tipo | Onde | Para quê |
|
|
64
|
+
|------|------|----------|
|
|
65
|
+
| **Auto-memory** | `projects/<projeto>/memory/` (`MEMORY.md` e tópicos `.md`) | Preferências e factos do projeto; entra no prompt; o agente atualiza com as tools de ficheiro |
|
|
66
|
+
| **Extração automática** | Mesma pasta | Após cada turno, um subagente pode consolidar notas (`BLUMA_DISABLE_EXTRACT_MEMORIES=1` desliga) |
|
|
67
|
+
| **Session memory** | `<sessionId>/session-memory/summary.md` | Resumo da conversa atual |
|
|
68
|
+
| **BLUMA.md** | Raiz do projeto ou `~/.bluma` | Instruções e regras do projeto |
|
|
69
|
+
| **Coding memory** | Ficheiro dedicado | Notas de código via tool `coding_memory` |
|
|
70
|
+
| **Agent memory** | `.bluma/agent-memory/` | Memória por perfil de agente (user / project / local) |
|
|
356
71
|
|
|
357
|
-
|
|
72
|
+
Flags úteis: `BLUMA_DISABLE_AUTO_MEMORY`, `BLUMA_DISABLE_SESSION_MEMORY`, `BLUMA_HOME`.
|
|
358
73
|
|
|
359
|
-
|
|
360
|
-
# Required for AI features
|
|
361
|
-
FACTOR_ROUTER_KEY=your_key
|
|
362
|
-
FACTOR_ROUTER_URL=https://api.factorai.sh
|
|
74
|
+
### Sandbox e FactorAI.sh
|
|
363
75
|
|
|
364
|
-
|
|
365
|
-
MCP_SSE_URL=http://localhost:3000/sse
|
|
76
|
+
Com sandbox ativo (`BLUMA_SANDBOX`), o BluMa corre no workspace isolado com tools dedicadas:
|
|
366
77
|
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
78
|
+
- Scaffold Next.js, deploy, edição incremental (`apply_app_changes`), estado e redeploy
|
|
79
|
+
- Deploy empacota o projeto em ZIP no próprio Node (sem depender de `zip` no sistema)
|
|
80
|
+
- Cada `session_id` mantém o seu workspace — uma app por sessão de chat
|
|
81
|
+
- Evento `factor-sh-url-app` com o URL da app publicada
|
|
371
82
|
|
|
372
|
-
|
|
83
|
+
O orchestrator (ex. sandbox-api) injeta `SEVERINO_URL`, `FACTORAI_BASE_URL`, chaves de API e `BLUMA_SANDBOX_WORKSPACE`.
|
|
373
84
|
|
|
374
|
-
|
|
85
|
+
### Modo agente (headless)
|
|
375
86
|
|
|
376
|
-
|
|
377
|
-
- **Sandbox Mode**: Require confirmation for write/execute operations
|
|
87
|
+
Para automação ou gateway (JSON in / JSONL out):
|
|
378
88
|
|
|
379
|
-
Set via environment or runtime config:
|
|
380
89
|
```bash
|
|
381
|
-
|
|
90
|
+
bluma agent --input-file request.json
|
|
382
91
|
```
|
|
383
92
|
|
|
384
|
-
|
|
93
|
+
Eventos: `log`, `backend_message`, `result` (inclui URL da app quando há deploy). Scripts de teste em `scripts/`.
|
|
385
94
|
|
|
386
|
-
|
|
95
|
+
### Ferramentas e skills
|
|
387
96
|
|
|
388
|
-
|
|
97
|
+
- **Tools nativas**: ficheiros, shell, planeamento, pesquisa, MCP, multi-agente, FactorAI em sandbox — ver `src/app/agent/tools/`
|
|
98
|
+
- **Skills embutidas**: `factorai-sh`, `git-commit`, `git-pr`, `git-release`, `pdf`, `xlsx`, `skill-creator`
|
|
99
|
+
- Skills extra: `.bluma/skills/`, `~/.bluma/skills/`
|
|
389
100
|
|
|
390
|
-
-
|
|
391
|
-
- npm >= 9
|
|
101
|
+
### Multi-agente
|
|
392
102
|
|
|
393
|
-
|
|
103
|
+
Coordenador, workers e mailbox em `~/.bluma/mailboxes/` (`spawn_agent`, `wait_agent`, `send_message`, …).
|
|
394
104
|
|
|
395
|
-
|
|
396
|
-
# Clone the repository
|
|
397
|
-
git clone https://github.com/Nomad-e/bluma-cli.git
|
|
398
|
-
cd bluma-cli
|
|
399
|
-
|
|
400
|
-
# Install dependencies
|
|
401
|
-
npm install
|
|
402
|
-
|
|
403
|
-
# Build the project
|
|
404
|
-
npm run build
|
|
405
|
-
|
|
406
|
-
# Start BluMa
|
|
407
|
-
npm start
|
|
408
|
-
```
|
|
409
|
-
|
|
410
|
-
### Scripts
|
|
411
|
-
|
|
412
|
-
| Script | Description |
|
|
413
|
-
|--------|-------------|
|
|
414
|
-
| `npm run build` | TypeScript check + bundle |
|
|
415
|
-
| `npm run build:native` | Build native modules |
|
|
416
|
-
| `npm run build:all` | Build native + TypeScript |
|
|
417
|
-
| `npm run precommit` | Run pre-commit validation |
|
|
418
|
-
| `npm start` | Build + run BluMa |
|
|
419
|
-
| `npm test` | Run Jest tests |
|
|
420
|
-
| `npm run test:watch` | Watch mode for tests |
|
|
421
|
-
| `npm run test:parallel` | Parallel test execution |
|
|
422
|
-
| `npm run test:parallel:fast` | Fast parallel tests with 8 workers |
|
|
423
|
-
| `npm run lint` | ESLint check |
|
|
424
|
-
| `npm run lint:fix` | Auto-fix lint errors |
|
|
425
|
-
|
|
426
|
-
### Testing
|
|
105
|
+
### Integrações
|
|
427
106
|
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
# Run specific test file
|
|
433
|
-
npm test -- tests/tool_invocation.spec.ts
|
|
434
|
-
|
|
435
|
-
# Watch mode
|
|
436
|
-
npm run test:watch
|
|
437
|
-
|
|
438
|
-
# Parallel tests (faster)
|
|
439
|
-
npm run test:parallel:fast
|
|
440
|
-
```
|
|
441
|
-
|
|
442
|
-
### Contributing
|
|
443
|
-
|
|
444
|
-
See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed contribution guidelines.
|
|
445
|
-
|
|
446
|
-
---
|
|
447
|
-
|
|
448
|
-
## 📚 Documentation
|
|
449
|
-
|
|
450
|
-
- **[Developer Guide](docs/BLUMA_DEVELOPER_GUIDE.md)**: Complete technical reference
|
|
451
|
-
- **[Skills Guide](docs/SKILLS.md)**: How to create and use skills
|
|
452
|
-
- **[Mailbox IPC](docs/MAILBOX_IPC.md)**: Multi-agent communication
|
|
453
|
-
- **[CI/CD](docs/CI-TEST.md)**: Continuous integration setup
|
|
454
|
-
- **[Message Queue](docs/message-queue-design.md)**: IPC system design
|
|
455
|
-
- **[Parallel Tests](docs/parallel-tests.md)**: Test parallelization guide
|
|
107
|
+
- **MCP** — `~/.bluma/bluma-mcp.json`
|
|
108
|
+
- **VS Code** — extensão em `vscode-extension/`
|
|
109
|
+
- **Native** — clipboard e layout (`native/`)
|
|
456
110
|
|
|
457
111
|
---
|
|
458
112
|
|
|
459
|
-
##
|
|
460
|
-
|
|
461
|
-
### 1. **Code Analysis & Refactoring**
|
|
462
|
-
```bash
|
|
463
|
-
# Ask BluMa to analyze your codebase
|
|
464
|
-
bluma
|
|
465
|
-
|
|
466
|
-
# Then use slash commands
|
|
467
|
-
/explain src/app/agent/core/prompt_builder.ts
|
|
468
|
-
/refactor src/utils/helpers.ts
|
|
469
|
-
/fix src/components/Button.tsx
|
|
470
|
-
```
|
|
471
|
-
|
|
472
|
-
### 2. **Multi-Agent Development**
|
|
473
|
-
```bash
|
|
474
|
-
# Coordinator mode: delegate to workers
|
|
475
|
-
"Build a new feature with research, implementation, and verification"
|
|
476
|
-
|
|
477
|
-
# BluMa automatically spawns:
|
|
478
|
-
# - Researcher: Investigate codebase structure
|
|
479
|
-
# - Implementer: Write the code
|
|
480
|
-
# - Verifier: Run tests and validate
|
|
481
|
-
```
|
|
113
|
+
## Configuração
|
|
482
114
|
|
|
483
|
-
|
|
484
|
-
```bash
|
|
485
|
-
/release patch # Auto-detect version bump
|
|
486
|
-
/release minor --dry-run # Preview release
|
|
487
|
-
```
|
|
115
|
+
Exemplo mínimo (`.env`):
|
|
488
116
|
|
|
489
|
-
### 4. **Pull Request Creation**
|
|
490
117
|
```bash
|
|
491
|
-
/
|
|
118
|
+
FACTOR_ROUTER_URL=https://your-factor-router.example/v1
|
|
119
|
+
FACTOR_ROUTER_KEY=your-key
|
|
492
120
|
```
|
|
493
121
|
|
|
494
|
-
|
|
495
|
-
```bash
|
|
496
|
-
# Use the embeddable React chat widget
|
|
497
|
-
import { useChatWidget } from '@nomad-e/bluma-cli/chat-widget';
|
|
122
|
+
Opcionais comuns: `BLUMA_PERMISSION_MODE`, `BLUMA_HOME`, flags de memória, URLs FactorAI para testes de deploy local, `MCP_SSE_URL`. Ver [`.env.example`](.env.example).
|
|
498
123
|
|
|
499
|
-
|
|
500
|
-
const { messages, streamResponse } = useChatWidget();
|
|
501
|
-
```
|
|
124
|
+
### Sessões
|
|
502
125
|
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
# Access full BluMa capabilities from within VS Code
|
|
507
|
-
- Chat panel with session sync
|
|
508
|
-
- Image and file support
|
|
509
|
-
- Real-time streaming
|
|
510
|
-
```
|
|
126
|
+
- Índice em SQLite + histórico em disco (`~/.bluma`)
|
|
127
|
+
- `bluma resume` — menu ou ID
|
|
128
|
+
- `bluma sessions` / `bluma logs <id>` — agentes em background
|
|
511
129
|
|
|
512
130
|
---
|
|
513
131
|
|
|
514
|
-
##
|
|
515
|
-
|
|
516
|
-
Apache 2.0 — see [LICENSE](LICENSE) for details.
|
|
517
|
-
|
|
518
|
-
---
|
|
132
|
+
## Desenvolvimento
|
|
519
133
|
|
|
520
|
-
|
|
134
|
+
| Comando | Descrição |
|
|
135
|
+
|---------|-----------|
|
|
136
|
+
| `npm run build` | Compila para `dist/` |
|
|
137
|
+
| `npm run build:all` | Native (Rust) + build |
|
|
138
|
+
| `npm start` | Build e UI |
|
|
139
|
+
| `npm test` | Testes |
|
|
140
|
+
| `npm run lint` | ESLint |
|
|
521
141
|
|
|
522
|
-
**
|
|
142
|
+
**Requisitos:** Node.js ≥ 20.
|
|
523
143
|
|
|
524
144
|
---
|
|
525
145
|
|
|
526
|
-
##
|
|
146
|
+
## Documentação
|
|
527
147
|
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
- **Permission Mode Enhancement**: Full mode enabled for auto-approve of all tools
|
|
537
|
-
|
|
538
|
-
**Improvements:**
|
|
539
|
-
- Streamlined tool guidance in prompts
|
|
540
|
-
- Better error handling and user-friendly error messages
|
|
541
|
-
- Enhanced session persistence on LLM errors
|
|
542
|
-
- Improved worker registration for UI visibility
|
|
543
|
-
|
|
544
|
-
**Fixes:**
|
|
545
|
-
- Resolved circular dependency in tool metadata (prompt → tools → prompt cycle)
|
|
546
|
-
- Fixed worker registration for UI visibility in task_boundary tracking
|
|
547
|
-
- Improved session persistence on LLM errors
|
|
148
|
+
| Documento | Conteúdo |
|
|
149
|
+
|-----------|----------|
|
|
150
|
+
| [CHANGELOG.md](CHANGELOG.md) | Versões |
|
|
151
|
+
| [CONTRIBUTING.md](CONTRIBUTING.md) | Como contribuir |
|
|
152
|
+
| [docs/BLUMA_DEVELOPER_GUIDE.md](docs/BLUMA_DEVELOPER_GUIDE.md) | Guia de desenvolvimento |
|
|
153
|
+
| [docs/SKILLS.md](docs/SKILLS.md) | Skills |
|
|
154
|
+
| [docs/FACTOR_ROUTER_TURNS.md](docs/FACTOR_ROUTER_TURNS.md) | Turnos no router |
|
|
155
|
+
| [docs/MAILBOX_IPC.md](docs/MAILBOX_IPC.md) | Mailbox |
|
|
548
156
|
|
|
549
157
|
---
|
|
550
158
|
|
|
551
|
-
|
|
159
|
+
## Licença
|
|
552
160
|
|
|
553
|
-
|
|
554
|
-
- **Modular Tool Architecture**: All 45+ tools now have dedicated directories with separate logic, UI, and types
|
|
555
|
-
- **Native Clipboard Support**: Rust-based clipboard implementation for cross-platform image handling
|
|
556
|
-
- **Thread Management**: Full thread lifecycle with create, resume, fork, rename, archive, delete operations
|
|
557
|
-
- **Enhanced Multi-Agent Orchestration**: Improved coordinator-worker communication with bidirectional mailbox IPC
|
|
558
|
-
- **Chat Widget**: Embeddable React chat component for web integration
|
|
559
|
-
|
|
560
|
-
**Improvements:**
|
|
561
|
-
- 27 new slash commands for session management, inspection, and agent control
|
|
562
|
-
- Performance optimizations in UI rendering and context management
|
|
563
|
-
- Enhanced sandbox security with improved policy enforcement
|
|
564
|
-
- Better error handling and user-friendly error messages
|
|
565
|
-
|
|
566
|
-
**Fixes:**
|
|
567
|
-
- Resolved circular dependency in tool metadata
|
|
568
|
-
- Fixed worker registration for UI visibility
|
|
569
|
-
- Improved session persistence on LLM errors
|
|
570
|
-
|
|
571
|
-
---
|
|
161
|
+
Apache 2.0 — [LICENSE](LICENSE)
|
|
572
162
|
|
|
573
|
-
|
|
163
|
+
**Alex Fonseca** · [Nomad-e](https://github.com/Nomad-e)
|