@parallel-cli/parallel 0.3.3 → 0.4.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 CHANGED
@@ -1,28 +1,42 @@
1
1
  # Parallel
2
2
 
3
- Real-time multi-agent coding in your terminal.
3
+ Real-time multi-agent coding from one terminal control room.
4
4
 
5
- Parallel lets you run several AI coding agents on the same repository at the same time. Each agent sees the live shared state of the session, can coordinate with the others, and can edit files without silent overwrites.
5
+ Parallel lets you run several AI coding agents on the same repository at the same time. Each agent has its own task, mode, terminal, live activity timeline, and shared view of the session. The hub keeps you in control: what is running, what needs input, what changed, what it cost, and where to steer next.
6
6
 
7
- > You stay in control. Parallel gives you the hub, the live context, the safety rails, and one dedicated terminal per agent.
7
+ > One hub. Many agents. Shared context. No silent overwrites.
8
8
 
9
9
  [![npm version](https://img.shields.io/npm/v/@parallel-cli/parallel?color=blue)](https://www.npmjs.com/package/@parallel-cli/parallel)
10
10
  ![node version](https://img.shields.io/node/v/@parallel-cli/parallel)
11
11
  ![license](https://img.shields.io/npm/l/@parallel-cli/parallel)
12
12
  ![platform](https://img.shields.io/badge/platform-linux%20%7C%20macos-lightgrey)
13
13
 
14
+ ## What Parallel Is
15
+
16
+ Parallel is built for active coding sessions where one agent is not enough:
17
+
18
+ - ask one agent to audit while another implements
19
+ - run a plan-first agent before allowing edits
20
+ - keep a test-focused agent watching regressions
21
+ - steer any agent live without stopping the others
22
+ - open a dedicated terminal for deep scrollback on one agent
23
+
24
+ The philosophy is simple: agents can move in parallel, but the human keeps the control room.
25
+
14
26
  ## Features
15
27
 
16
- - Run multiple coding agents in parallel from one terminal hub.
28
+ - Launch agents in three explicit modes: `/ask`, `/task`, and `/plan`.
29
+ - Type plain text to launch a task agent immediately.
30
+ - Run multiple agents at once on the same repository.
17
31
  - Open a dedicated terminal per agent with native scrollback and live steering.
18
- - Share live context between agents: status, notes, file claims, file activity, and recent diffs.
19
- - Prevent silent overwrites with adaptive merge-on-write for file edits.
20
- - Spawn agents normally, in plan-first mode, from GitHub issues, or from headless CI scripts.
32
+ - See structured activity timelines instead of raw tool spam.
33
+ - Share live context between agents: status, notes, claims, file activity, and diffs.
34
+ - Avoid silent overwrites with adaptive merge-on-write for file edits.
21
35
  - Pause, resume, stop, focus, restore, and steer agents while they are running.
22
- - Review live diffs, notes, costs, session state, skills, and specialists from built-in views.
23
- - Use any OpenAI-compatible provider, including DeepSeek, OpenAI-compatible gateways, OpenRouter, Ollama, vLLM, LM Studio, and local servers.
36
+ - Review live diffs, notes, costs, sessions, skills, and specialists from built-in views.
37
+ - Use any OpenAI-compatible provider, including DeepSeek, OpenRouter, Ollama, vLLM, LM Studio, and local servers.
38
+ - Choose shell approval behavior: `ask`, `auto-safe`, or `yolo`.
24
39
  - Track token usage and estimated cost per agent and per session.
25
- - Keep project and global skills/specialists as local markdown files.
26
40
 
27
41
  ## Install
28
42
 
@@ -52,13 +66,7 @@ prl
52
66
 
53
67
  ## Quick Start
54
68
 
55
- On first launch, Parallel opens a setup wizard for:
56
-
57
- 1. Language
58
- 2. Working folder
59
- 3. New or restored session
60
- 4. Provider
61
- 5. Model
69
+ On first launch, Parallel opens a setup wizard for language, folder, session, provider, and model.
62
70
 
63
71
  After setup, type a task and press Enter:
64
72
 
@@ -66,13 +74,21 @@ After setup, type a task and press Enter:
66
74
  > refactor the API client and update the tests
67
75
  ```
68
76
 
69
- Typing another task starts another agent immediately, even while the first one is still working:
77
+ Plain text launches a `/task` agent. Start another agent at any time, even while the first one is still working:
70
78
 
71
79
  ```text
72
- > add coverage for the auth middleware
80
+ > add regression coverage for auth middleware
73
81
  ```
74
82
 
75
- Send a real-time instruction to one agent:
83
+ Use explicit modes when intent matters:
84
+
85
+ ```text
86
+ /ask reviewer should we split the CLI parser?
87
+ /plan migration propose the safest rollout for the config change
88
+ /task builder implement the approved plan
89
+ ```
90
+
91
+ Send a live instruction to one agent:
76
92
 
77
93
  ```text
78
94
  @a1 also handle empty response bodies
@@ -84,38 +100,100 @@ Broadcast to every agent:
84
100
  @all stop changing public interfaces until the test agent finishes
85
101
  ```
86
102
 
87
- ## Multi-Terminal Sessions
103
+ ## Agent Modes
104
+
105
+ | Mode | Use it for | Behavior |
106
+ | --- | --- | --- |
107
+ | `/ask` | Questions, reviews, audits, tradeoffs | Answers and advises without editing files. |
108
+ | `/task` | Implementation work | Executes, edits, validates, and summarizes. |
109
+ | `/plan` | Risky or unclear work | Inspects first, asks for approval, then edits only after approval. |
110
+
111
+ Aliases:
112
+
113
+ - `/a` -> `/ask`
114
+ - `/t` -> `/task`
115
+ - `/p` -> `/plan`
116
+
117
+ Plain text is equivalent to `/task`.
118
+
119
+ ## Control Room
120
+
121
+ The main TUI is the Parallel hub. It is designed to answer four questions quickly:
88
122
 
89
- The main TUI is the session hub. Each new agent can open a dedicated terminal connected through `.parallel/session.sock`.
123
+ - What needs my input?
124
+ - Which agents are working?
125
+ - What did each agent just do?
126
+ - What model, folder, shell mode, and cost am I currently running?
127
+
128
+ Useful hub commands:
129
+
130
+ ```text
131
+ /agents agent overview
132
+ /focus a1 inspect and steer one agent
133
+ /raw toggle raw detail in focus view
134
+ /board shared blackboard, claims, file activity
135
+ /diff live diff history
136
+ /cost token and cost breakdown
137
+ /sessions saved sessions
138
+ /settings global settings
139
+ /settings-session session-only settings
140
+ ```
141
+
142
+ Best terminal size is around `120x34`. Parallel still adapts to smaller terminals, but the hub is most readable with enough width for model, folder, status, and agent summaries.
143
+
144
+ ## Dedicated Agent Terminals
145
+
146
+ Each agent can have its own terminal connected to the same session:
90
147
 
91
148
  ```bash
92
- parallel
93
149
  parallel attach a1 --root .
94
150
  ```
95
151
 
96
152
  Attached terminals show:
97
153
 
98
- - the agent log in native terminal scrollback
99
- - state, model, tokens, cost, elapsed time, and current action
100
- - what the other agents are doing
101
- - a prompt for steering that specific agent
154
+ - the selected agent's live timeline
155
+ - native terminal scrollback
156
+ - model, elapsed time, steps, tokens, context percentage, and cost
157
+ - other agents' current state
102
158
  - approval and question prompts for that agent
159
+ - an input that steers that agent directly
103
160
 
104
161
  From an attached terminal:
105
162
 
106
163
  ```text
107
- /spawn write regression tests for the parser
164
+ plain text sends a message to this agent
165
+ /task write parser regression tests
166
+ /ask is this result safe to merge?
167
+ /plan prepare a migration plan
168
+ /raw
169
+ /quit
108
170
  ```
109
171
 
110
- This launches a new agent in the same session. Use `/quit` to detach from an agent terminal.
111
-
112
- Toggle automatic agent terminals in the hub:
172
+ Toggle automatic agent terminals from the hub:
113
173
 
114
174
  ```text
115
175
  /attach on
116
176
  /attach off
117
177
  ```
118
178
 
179
+ ## Shell Approvals
180
+
181
+ Parallel separates agent modes from shell approval behavior.
182
+
183
+ ```text
184
+ /approvals ask
185
+ /approvals auto-safe
186
+ /approvals yolo
187
+ ```
188
+
189
+ | Mode | Behavior |
190
+ | --- | --- |
191
+ | `ask` | Ask before shell commands unless explicitly allowed. |
192
+ | `auto-safe` | Auto-approve safe inspection/build/test commands; ask for risky commands. |
193
+ | `yolo` | Auto-approve every shell command. Intended for trusted/headless usage only. |
194
+
195
+ `auto` is accepted as a compatibility spelling for `auto-safe`.
196
+
119
197
  ## Headless Mode
120
198
 
121
199
  For CI and scripts, run without the TUI:
@@ -128,7 +206,7 @@ Headless mode:
128
206
 
129
207
  - runs one agent per task
130
208
  - uses the current folder as the project root
131
- - auto-approves shell commands
209
+ - uses `yolo` shell approvals
132
210
  - auto-answers agent questions with the recommended option
133
211
  - saves the session
134
212
  - exits non-zero if any agent does not finish successfully
@@ -139,9 +217,10 @@ Headless mode:
139
217
 
140
218
  | Command | Description |
141
219
  | --- | --- |
142
- | `/spawn [Name:] <task> [--model=m] [#skill]` | Launch an agent. Plain text input does the same. |
143
- | `/plan [Name:] <task> [--model=m]` | Launch a plan-first agent that asks before editing files. |
144
- | `/issue <n>` | Spawn an agent from a GitHub issue using the `gh` CLI. |
220
+ | `/ask [Name:] <question> [--model=m]` | Launch an ask-only agent. |
221
+ | `/task [Name:] <task> [--model=m] [#skill]` | Launch a task agent. Plain text does the same. |
222
+ | `/plan [Name:] <task> [--model=m]` | Launch a plan-first agent. |
223
+ | `/issue <n>` | Spawn a task from a GitHub issue using the `gh` CLI. |
145
224
  | `/specialist <name> <task>` | Spawn with a specialist persona. |
146
225
  | `/specialist new <name> [global]` | Create a specialist template. |
147
226
  | `/skill new <name> [global]` | Create a skill template. |
@@ -168,34 +247,34 @@ Headless mode:
168
247
  | `/commit [agent\|all] [message]` | Commit files touched by an agent or by all agents. |
169
248
  | `/autocommit <on\|off>` | Commit each agent's changes automatically when it finishes. |
170
249
 
171
- ### Views
250
+ ### Views And Sessions
172
251
 
173
252
  | Command | Description |
174
253
  | --- | --- |
175
- | `/agents` | Agent grid. |
254
+ | `/agents` | Agent overview. |
176
255
  | `/board` | Shared blackboard, file activity, claims, and notes. |
177
256
  | `/notes` | Full notes history. |
178
257
  | `/diff` | Live diff history. |
179
258
  | `/cost` | Token and cost breakdown. |
180
259
  | `/skills` | Available skills. |
181
260
  | `/specialists` | Available specialists. |
182
- | `/help` | Full command reference. |
183
-
184
- ### Sessions And Settings
185
-
186
- | Command | Description |
187
- | --- | --- |
188
261
  | `/save [name]` | Save the current session. |
189
262
  | `/sessions` | List saved sessions. |
190
263
  | `/session <n\|latest>` | Restore a saved session. |
191
264
  | `/restore <agent>` | Relaunch a restored agent with its conversation history. |
265
+
266
+ ### Settings
267
+
268
+ | Command | Description |
269
+ | --- | --- |
192
270
  | `/model [[provider:]model]` | Show or switch the session model. |
193
271
  | `/key <api-key>` | Store the API key for the active provider. |
194
- | `/approvals <ask\|auto>` | Require or skip shell command approvals for the session. |
272
+ | `/approvals <ask\|auto-safe\|yolo>` | Set shell approvals for this session. |
195
273
  | `/sound <on\|off>` | Toggle terminal bell notifications. |
196
274
  | `/settings` | Edit global language, providers, keys, defaults, and approvals. |
197
275
  | `/settings-session` | Edit session-only model, approvals, and sound. |
198
276
  | `/doctor` | Check provider, key, and model configuration. |
277
+ | `/help` | Full command reference. |
199
278
  | `/quit` | Save the session and exit. |
200
279
 
201
280
  When there is exactly one agent, commands such as `/undo`, `/focus`, `/pause`, `/resume`, `/stop`, and `/commit` can omit the agent name.
@@ -214,14 +293,6 @@ Environment variables:
214
293
  | `PARALLEL_MODEL` | Override the session model. |
215
294
  | `PARALLEL_NO_ALT_SCREEN=1` | Disable the alternate terminal screen. |
216
295
 
217
- Local providers are supported if they expose an OpenAI-compatible endpoint, for example:
218
-
219
- - Ollama
220
- - vLLM
221
- - LM Studio
222
- - llama.cpp server
223
- - OpenRouter or other compatible gateways
224
-
225
296
  Configuration is stored in `~/.parallel/config.json`. Project state, sessions, skills, specialists, and memory are stored under `.parallel/` in the selected project.
226
297
 
227
298
  ## Skills And Specialists
@@ -259,42 +330,29 @@ When an agent writes a file:
259
330
 
260
331
  This keeps agents moving without allowing silent overwrites.
261
332
 
262
- ## Architecture
333
+ ## Codebase Map
263
334
 
264
- At runtime, Parallel is built around four pieces:
335
+ The runtime is intentionally small:
265
336
 
266
- - **Controller**: manages agents, approvals, questions, sessions, terminals, commits, and restores.
267
- - **Blackboard**: stores live shared state: agents, logs, notes, claims, file activity, and diffs.
268
- - **Agent loop**: injects live context, calls the model, executes tools, reacts to new information, and marks completion.
269
- - **Ink UI**: renders the hub, agent panels, settings, views, prompts, and attached terminal UI.
337
+ - `src/index.tsx`: CLI entrypoint, TUI launch, attach mode, and headless mode.
338
+ - `src/controller.ts`: session state, agents, approvals, questions, terminals, commits, and restores.
339
+ - `src/coordination/blackboard.ts`: shared live state for agents, logs, notes, file activity, claims, and diffs.
340
+ - `src/agents/agent.ts`: agent loop, mode instructions, live context injection, and completion.
341
+ - `src/agents/tools.ts`: file, shell, note, skill, memory, and question tools.
342
+ - `src/server.ts`: Unix socket bridge for dedicated agent terminals.
343
+ - `src/ui/`: Ink components for the hub, timelines, settings, prompts, and attach UI.
344
+ - `src/commands.ts`: hub command registry, hidden compatibility commands, aliases, and dispatch.
345
+ - `src/config.ts` and `src/i18n.ts`: provider/session config and translations.
270
346
 
271
- Agent tools include:
347
+ ## Changelog
272
348
 
273
- - `list_files`
274
- - `read_file`
275
- - `write_file`
276
- - `edit_file`
277
- - `search`
278
- - `run_command`
279
- - `post_note`
280
- - `update_status`
281
- - `ask_user`
282
- - `load_skill`
283
- - `claim_files`
284
- - `wait_for_agent`
285
- - `remember`
286
- - `task_complete`
349
+ ### 0.4.0
287
350
 
288
- ## Package
289
-
290
- ```bash
291
- npm install -g @parallel-cli/parallel
292
- ```
293
-
294
- Published package:
295
-
296
- - npm: https://www.npmjs.com/package/@parallel-cli/parallel
297
- - GitHub: https://github.com/Nil06/parallel-cli
351
+ - **Removed `/spawn`** — use `/task` instead. The alias was redundant and its removal simplified the command registry.
352
+ - **System messages color-coded by severity** — green for success, yellow for warnings, red for errors, gray for informational. Applied across all ~40 system messages in every command.
353
+ - **UI fully internationalized** — all wizard screens, menus, and prompts now available in English, French, Spanish, and Chinese (zh).
354
+ - **AgentHub header indicators** — the hub header now shows the active mode, model, and context usage at a glance.
355
+ - **Fixed `/pause` double-call** — rapid consecutive `/pause` invocations no longer trigger the action twice.
298
356
 
299
357
  ## Development
300
358
 
@@ -311,6 +369,11 @@ npm link
311
369
  parallel --help
312
370
  ```
313
371
 
372
+ Published package:
373
+
374
+ - npm: https://www.npmjs.com/package/@parallel-cli/parallel
375
+ - GitHub: https://github.com/Nil06/parallel-cli
376
+
314
377
  ## License
315
378
 
316
379
  MIT
@@ -6,7 +6,7 @@ import { skillsCatalog } from '../skills.js';
6
6
  import { getLang, LANG_NAME_EN } from '../i18n.js';
7
7
  // Agent-facing prompts stay in English (canonical for models). Only notes
8
8
  // addressed to the user follow the configured UI language.
9
- const SYSTEM_PROMPT = (name, task, userLang, skillsList, specialist, projectMemory) => `You are agent "${name}", an autonomous software engineer inside PARALLEL, an environment where SEVERAL agents work at the same time on the SAME project, each on its own task given by the user.
9
+ const SYSTEM_PROMPT = (name, task, mode, userLang, skillsList, specialist, projectMemory) => `You are agent "${name}", an autonomous software engineer inside PARALLEL, an environment where SEVERAL agents work at the same time on the SAME project, each on its own task given by the user.
10
10
  ${specialist
11
11
  ? `
12
12
  YOUR ROLE — you are the "${specialist.name}" specialist:
@@ -14,6 +14,27 @@ ${specialist.role}
14
14
  `
15
15
  : ''}
16
16
  YOUR TASK: ${task}
17
+
18
+ AGENT MODE: ${mode}
19
+ ${mode === 'ask'
20
+ ? `ASK MODE:
21
+ - You are advisory only. Do not modify files.
22
+ - You may inspect with list_files/read_file/search and safe read-only commands when useful.
23
+ - Do not run mutating commands, write files, edit files, claim files, or commit.
24
+ - Finish with task_complete using this user-facing structure in ${userLang}: "Réponse courte", "Recommandation", "Pourquoi", "Prochaines étapes".`
25
+ : mode === 'plan'
26
+ ? `PLAN MODE:
27
+ - Explore first with read-only tools.
28
+ - Before modifying any file or running mutating commands, call ask_user with a concrete implementation plan.
29
+ - The plan must include steps, files you expect to touch, risks, and validation.
30
+ - Use options ["Approve", "Revise"], recommended "Approve".
31
+ - Start editing only after explicit "Approve".
32
+ - Finish with task_complete using this user-facing structure in ${userLang}: "Plan appliqué", "Ce que j’ai modifié", "Validation", "Risques restants".`
33
+ : `TASK MODE:
34
+ - Execute the user's objective end-to-end.
35
+ - Explore, edit, validate, and summarize.
36
+ - Ask the user only when blocked or when a risky product decision cannot be inferred.
37
+ - Finish with task_complete using this user-facing structure in ${userLang}: "Ce que j’ai fait", "Ce que j’ai vérifié", "Résultat", "Détails techniques".`}
17
38
  ${skillsList
18
39
  ? `
19
40
  SKILLS — instructions written by the user, loadable on demand (load_skill):
@@ -83,6 +104,7 @@ export class Agent {
83
104
  alias: opts.alias,
84
105
  color: opts.color,
85
106
  task: opts.task,
107
+ mode: opts.mode,
86
108
  model: opts.model,
87
109
  state: 'idle',
88
110
  currentAction: '',
@@ -225,7 +247,7 @@ export class Agent {
225
247
  else {
226
248
  this.record({
227
249
  role: 'system',
228
- content: SYSTEM_PROMPT(this.name, this.opts.task, LANG_NAME_EN[getLang()], skillsCatalog(this.opts.skills), this.opts.specialist, this.opts.projectMemory),
250
+ content: SYSTEM_PROMPT(this.name, this.opts.task, this.opts.mode, LANG_NAME_EN[getLang()], skillsCatalog(this.opts.skills), this.opts.specialist, this.opts.projectMemory),
229
251
  });
230
252
  // Pasted images (multimodal models): attached to the very first user turn.
231
253
  if (this.opts.images && this.opts.images.length > 0) {
@@ -209,7 +209,7 @@ export const TOOL_DEFINITIONS = [
209
209
  type: 'function',
210
210
  function: {
211
211
  name: 'task_complete',
212
- description: 'Call when your task is finished and verified. Notifies the other agents.',
212
+ description: 'Call when your task is finished and verified. The summary is user-facing: write it for humans, explain the logic of your conclusion, include technical details only after the outcome is clear, and follow the section structure requested by your current agent mode.',
213
213
  parameters: {
214
214
  type: 'object',
215
215
  properties: {
@@ -563,7 +563,9 @@ export class ToolExecutor {
563
563
  out += `\n(exit code: ${err.code ?? 1})`;
564
564
  if (out.length > MAX_OUTPUT)
565
565
  out = out.slice(0, MAX_OUTPUT) + '\n... (output truncated)';
566
- resolve(out || '(no output, success)');
566
+ const result = out || '(no output, success)';
567
+ this.board.log(this.agentId, 'tool_result', result);
568
+ resolve(result);
567
569
  });
568
570
  });
569
571
  }