@aion0/forge 0.4.16 → 0.5.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.
Files changed (93) hide show
  1. package/README.md +27 -2
  2. package/RELEASE_NOTES.md +21 -14
  3. package/app/api/agents/route.ts +17 -0
  4. package/app/api/delivery/[id]/route.ts +62 -0
  5. package/app/api/delivery/route.ts +40 -0
  6. package/app/api/mobile-chat/route.ts +13 -7
  7. package/app/api/monitor/route.ts +10 -6
  8. package/app/api/pipelines/[id]/route.ts +16 -3
  9. package/app/api/tasks/route.ts +2 -1
  10. package/app/api/workspace/[id]/agents/route.ts +35 -0
  11. package/app/api/workspace/[id]/memory/route.ts +23 -0
  12. package/app/api/workspace/[id]/smith/route.ts +22 -0
  13. package/app/api/workspace/[id]/stream/route.ts +28 -0
  14. package/app/api/workspace/route.ts +100 -0
  15. package/app/global-error.tsx +10 -4
  16. package/app/icon.ico +0 -0
  17. package/app/layout.tsx +2 -2
  18. package/app/login/LoginForm.tsx +96 -0
  19. package/app/login/page.tsx +7 -98
  20. package/app/page.tsx +2 -2
  21. package/bin/forge-server.mjs +13 -1
  22. package/check-forge-status.sh +9 -0
  23. package/components/ConversationEditor.tsx +411 -0
  24. package/components/ConversationGraphView.tsx +347 -0
  25. package/components/ConversationTerminalView.tsx +303 -0
  26. package/components/Dashboard.tsx +36 -39
  27. package/components/DashboardWrapper.tsx +9 -0
  28. package/components/DeliveryFlowEditor.tsx +491 -0
  29. package/components/DeliveryList.tsx +230 -0
  30. package/components/DeliveryWorkspace.tsx +589 -0
  31. package/components/DocTerminal.tsx +10 -2
  32. package/components/DocsViewer.tsx +10 -2
  33. package/components/HelpTerminal.tsx +11 -6
  34. package/components/InlinePipelineView.tsx +111 -0
  35. package/components/MobileView.tsx +20 -0
  36. package/components/MonitorPanel.tsx +9 -4
  37. package/components/NewTaskModal.tsx +32 -0
  38. package/components/PipelineEditor.tsx +49 -6
  39. package/components/PipelineView.tsx +482 -64
  40. package/components/ProjectDetail.tsx +314 -56
  41. package/components/ProjectManager.tsx +49 -4
  42. package/components/SessionView.tsx +27 -13
  43. package/components/SettingsModal.tsx +790 -124
  44. package/components/SkillsPanel.tsx +31 -8
  45. package/components/TaskBoard.tsx +3 -0
  46. package/components/WebTerminal.tsx +257 -43
  47. package/components/WorkspaceTree.tsx +221 -0
  48. package/components/WorkspaceView.tsx +2245 -0
  49. package/install.sh +2 -2
  50. package/lib/agents/claude-adapter.ts +104 -0
  51. package/lib/agents/generic-adapter.ts +64 -0
  52. package/lib/agents/index.ts +242 -0
  53. package/lib/agents/types.ts +70 -0
  54. package/lib/artifacts.ts +106 -0
  55. package/lib/delivery.ts +787 -0
  56. package/lib/forge-skills/forge-inbox.md +37 -0
  57. package/lib/forge-skills/forge-send.md +40 -0
  58. package/lib/forge-skills/forge-status.md +32 -0
  59. package/lib/forge-skills/forge-workspace-sync.md +37 -0
  60. package/lib/help-docs/00-overview.md +7 -1
  61. package/lib/help-docs/01-settings.md +159 -2
  62. package/lib/help-docs/05-pipelines.md +89 -0
  63. package/lib/help-docs/07-projects.md +35 -1
  64. package/lib/help-docs/11-workspace.md +254 -0
  65. package/lib/help-docs/CLAUDE.md +7 -2
  66. package/lib/init.ts +60 -10
  67. package/lib/pipeline.ts +537 -1
  68. package/lib/settings.ts +115 -22
  69. package/lib/skills.ts +249 -372
  70. package/lib/task-manager.ts +113 -33
  71. package/lib/telegram-bot.ts +33 -1
  72. package/lib/workspace/__tests__/state-machine.test.ts +388 -0
  73. package/lib/workspace/__tests__/workspace.test.ts +311 -0
  74. package/lib/workspace/agent-bus.ts +416 -0
  75. package/lib/workspace/agent-worker.ts +667 -0
  76. package/lib/workspace/backends/api-backend.ts +262 -0
  77. package/lib/workspace/backends/cli-backend.ts +479 -0
  78. package/lib/workspace/index.ts +82 -0
  79. package/lib/workspace/manager.ts +136 -0
  80. package/lib/workspace/orchestrator.ts +1914 -0
  81. package/lib/workspace/persistence.ts +310 -0
  82. package/lib/workspace/presets.ts +170 -0
  83. package/lib/workspace/skill-installer.ts +188 -0
  84. package/lib/workspace/smith-memory.ts +498 -0
  85. package/lib/workspace/types.ts +231 -0
  86. package/lib/workspace/watch-manager.ts +288 -0
  87. package/lib/workspace-standalone.ts +814 -0
  88. package/middleware.ts +1 -0
  89. package/next-env.d.ts +1 -1
  90. package/package.json +4 -1
  91. package/src/config/index.ts +12 -1
  92. package/src/core/db/database.ts +1 -0
  93. package/start.sh +7 -0
@@ -0,0 +1,37 @@
1
+ ---
2
+ description: Check and manage messages from other Forge Workspace agents (QA reports, review feedback, PM requests)
3
+ ---
4
+
5
+ # Forge Inbox
6
+
7
+ Check for messages from other agents and manage their status.
8
+
9
+ ## When to trigger
10
+ - At the start of a new conversation/session
11
+ - When the user asks about other agents' status or messages
12
+
13
+ ## How to use
14
+
15
+ IMPORTANT: Do NOT check environment variables. Just run the commands — they auto-discover the workspace.
16
+
17
+ Step 1 — Get workspace ID:
18
+ ```bash
19
+ curl -s "http://localhost:8403/api/workspace?projectPath=$(pwd)" | python3 -c "import sys,json; print(json.load(sys.stdin).get('id',''))"
20
+ ```
21
+
22
+ Step 2 — Check inbox (replace WORKSPACE_ID):
23
+ ```bash
24
+ curl -s -X POST "http://localhost:8403/api/workspace/WORKSPACE_ID/smith" -H "Content-Type: application/json" -d '{"action":"inbox","agentId":"'"$FORGE_AGENT_ID"'"}'
25
+ ```
26
+
27
+ ## Mark message as done
28
+ ```bash
29
+ curl -s -X POST "http://localhost:8403/api/workspace/WORKSPACE_ID/smith" -H "Content-Type: application/json" -d '{"action":"message_done","agentId":"'"$FORGE_AGENT_ID"'","messageId":"MESSAGE_ID"}'
30
+ ```
31
+
32
+ ## Mark message as failed
33
+ ```bash
34
+ curl -s -X POST "http://localhost:8403/api/workspace/WORKSPACE_ID/smith" -H "Content-Type: application/json" -d '{"action":"message_failed","agentId":"'"$FORGE_AGENT_ID"'","messageId":"MESSAGE_ID"}'
35
+ ```
36
+
37
+ After handling a message, always mark it as done or failed.
@@ -0,0 +1,40 @@
1
+ ---
2
+ description: Send a message to another Forge Workspace agent immediately via API (notify QA of a fix, ask PM a question, etc.)
3
+ ---
4
+
5
+ # Forge Send
6
+
7
+ Send a message to another agent in the Forge Workspace.
8
+
9
+ ## When to trigger
10
+ - You fixed a bug that QA reported → notify QA immediately
11
+ - You have a question about requirements → ask PM
12
+ - You found an issue that another agent should know about
13
+ - User explicitly asks to send a message to another agent
14
+
15
+ ## When NOT to trigger
16
+ - Do NOT send a reply to the agent whose message you are currently processing. The system automatically marks your result as done and notifies them. Only use forge-send for NEW issues or questions to OTHER agents.
17
+
18
+ ## How to send
19
+
20
+ IMPORTANT: Do NOT check environment variables first. Just run the command below — it auto-discovers everything.
21
+
22
+ Step 1 — Get workspace ID:
23
+ ```bash
24
+ curl -s "http://localhost:8403/api/workspace?projectPath=$(pwd)" | python3 -c "import sys,json; print(json.load(sys.stdin).get('id',''))"
25
+ ```
26
+
27
+ Step 2 — Send message (replace WORKSPACE_ID with result from step 1):
28
+ ```bash
29
+ curl -s -X POST "http://localhost:8403/api/workspace/WORKSPACE_ID/smith" -H "Content-Type: application/json" -d '{"action":"send","agentId":"'"$FORGE_AGENT_ID"'","to":"TARGET_LABEL","msgAction":"ACTION","content":"YOUR MESSAGE"}'
30
+ ```
31
+
32
+ Replace:
33
+ - `WORKSPACE_ID` = the ID from step 1
34
+ - `TARGET_LABEL` = target agent label (e.g., "QA", "PM", "Engineer", "Reviewer")
35
+ - `ACTION` = one of: `fix_request`, `update_notify`, `question`, `info_request`, `review`
36
+ - `YOUR MESSAGE` = your actual message
37
+
38
+ Note: `$FORGE_AGENT_ID` is automatically set by Forge when launching the terminal. Do NOT replace it manually.
39
+
40
+ Tell the user the result.
@@ -0,0 +1,32 @@
1
+ ---
2
+ description: Check the status of all agents in the Forge Workspace (who is running, done, waiting)
3
+ ---
4
+
5
+ # Forge Status
6
+
7
+ Check the current status of all agents in the Forge Workspace.
8
+
9
+ ## When to trigger
10
+ - User asks "what's the status?" or "how are other agents doing?"
11
+ - At the start of a session to understand the current workspace state
12
+
13
+ ## How to check
14
+
15
+ IMPORTANT: Do NOT check environment variables. Just run the commands.
16
+
17
+ Step 1 — Get workspace ID:
18
+ ```bash
19
+ curl -s "http://localhost:8403/api/workspace?projectPath=$(pwd)" | python3 -c "import sys,json; print(json.load(sys.stdin).get('id',''))"
20
+ ```
21
+
22
+ Step 2 — Check status (replace WORKSPACE_ID):
23
+ ```bash
24
+ curl -s -X POST "http://localhost:8403/api/workspace/WORKSPACE_ID/smith" -H "Content-Type: application/json" -d '{"action":"status","agentId":"'"$FORGE_AGENT_ID"'"}'
25
+ ```
26
+
27
+ Present the results as a clear status overview:
28
+ - 🟢 active — smith is online and listening
29
+ - 🔵 running — agent is currently executing a task
30
+ - ✅ done — agent completed its work
31
+ - 🔴 failed — agent encountered an error
32
+ - ⬚ down — smith is not started
@@ -0,0 +1,37 @@
1
+ ---
2
+ description: Automatically sync your work progress with Forge Workspace when you've completed a task or made significant changes
3
+ ---
4
+
5
+ # Forge Workspace Sync
6
+
7
+ When you detect that the user has completed a meaningful unit of work, automatically sync with Forge Workspace.
8
+
9
+ ## When to trigger
10
+ - User says they're done ("done", "完成了", "finished", "that should work")
11
+ - You've made multiple file changes and the conversation reaches a natural stopping point
12
+ - User asks to move on to the next task or agent
13
+
14
+ ## How to sync
15
+
16
+ IMPORTANT: Do NOT check environment variables. Just run the commands.
17
+
18
+ Step 1 — Get workspace ID:
19
+ ```bash
20
+ curl -s "http://localhost:8403/api/workspace?projectPath=$(pwd)" | python3 -c "import sys,json; print(json.load(sys.stdin).get('id',''))"
21
+ ```
22
+
23
+ Step 2 — Sync (replace WORKSPACE_ID):
24
+ ```bash
25
+ curl -s -X POST "http://localhost:8403/api/workspace/WORKSPACE_ID/smith" -H "Content-Type: application/json" -d '{"action":"done","agentId":"'"$FORGE_AGENT_ID"'","output":"PASTE_YOUR_RECENT_OUTPUT_HERE"}'
26
+ ```
27
+
28
+ Include any `[SEND:AgentLabel:action] message` markers in the `output` field.
29
+
30
+ This will:
31
+ 1. Detect git changes since last sync
32
+ 2. Record what you did in agent memory
33
+ 3. Parse [SEND:...] markers and deliver messages
34
+ 4. Mark this agent as "done"
35
+ 5. Notify downstream agents
36
+
37
+ Tell the user what files changed, messages sent, and that downstream agents were notified.
@@ -1,6 +1,6 @@
1
1
  # Forge Overview
2
2
 
3
- Forge is a self-hosted Vibe Coding platform for Claude Code. It provides a browser-based terminal, AI task orchestration, remote access, and mobile control via Telegram.
3
+ Forge is a self-hosted Vibe Coding platform for Claude Code. It provides a browser-based terminal, multi-agent workspace orchestration, AI task management, remote access, and mobile control via Telegram.
4
4
 
5
5
  ## Quick Start
6
6
 
@@ -19,8 +19,14 @@ Open `http://localhost:8403`. First launch prompts you to set an admin password.
19
19
  ## Data Location
20
20
  - Config: `~/.forge/` (binaries)
21
21
  - Data: `~/.forge/data/` (settings, database, state)
22
+ - Workspaces: `~/.forge/workspaces/<id>/` (workspace state files)
22
23
  - Claude: `~/.claude/` (skills, commands, sessions)
23
24
 
25
+ ## Architecture
26
+ - `forge-server.mjs` starts: Next.js (port 8403) + Terminal server + Telegram bot + Workspace daemon (port 8405)
27
+ - `pnpm dev` / `start.sh dev`: Next.js dev mode (init.ts spawns terminal + telegram + workspace)
28
+ - `FORGE_EXTERNAL_SERVICES=1`: Next.js skips spawning (forge-server manages external services)
29
+
24
30
  ## Server Commands
25
31
  ```bash
26
32
  forge server start # background (default)
@@ -19,19 +19,176 @@ Settings are stored in `~/.forge/data/settings.yaml`. Configure via the web UI (
19
19
  | `taskModel` | string | `"default"` | Model for background tasks |
20
20
  | `pipelineModel` | string | `"default"` | Model for pipeline workflows |
21
21
  | `telegramModel` | string | `"sonnet"` | Model for Telegram AI features |
22
+ | `defaultAgent` | string | `"claude"` | Default agent for tasks and terminal |
23
+ | `telegramAgent` | string | `""` | Agent for Telegram task execution |
24
+ | `docsAgent` | string | `""` | Agent for documentation queries |
22
25
  | `skipPermissions` | boolean | `false` | Add `--dangerously-skip-permissions` to claude invocations |
23
26
  | `notificationRetentionDays` | number | `30` | Auto-cleanup notifications older than N days |
24
27
  | `skillsRepoUrl` | string | forge-skills URL | GitHub raw URL for skills registry |
25
28
  | `displayName` | string | `"Forge"` | Display name shown in header |
26
29
  | `displayEmail` | string | `""` | User email |
30
+ | `favoriteProjects` | string[] | `[]` | Starred project paths |
31
+ | `obsidianVault` | string | `""` | Path to Obsidian vault |
32
+
33
+ ## Agents
34
+
35
+ Forge auto-detects installed CLI agents (Claude Code, Codex, Aider). You can also add custom agents manually.
36
+
37
+ ### Agent Fields
38
+
39
+ Each agent entry in `settings.agents` supports:
40
+
41
+ | Field | Type | Description |
42
+ |-------|------|-------------|
43
+ | `name` | string | Display name |
44
+ | `path` | string | Path to CLI binary |
45
+ | `enabled` | boolean | Whether this agent is available |
46
+ | `cliType` | string | CLI tool type: `claude-code`, `codex`, `aider`, `generic` |
47
+ | `taskFlags` | string | Flags for headless task execution (e.g. `-p --verbose`) |
48
+ | `interactiveCmd` | string | Command for interactive terminal sessions |
49
+ | `resumeFlag` | string | Flag to resume sessions (e.g. `-c` for claude) |
50
+ | `outputFormat` | string | Output format: `stream-json`, `text` |
51
+ | `skipPermissionsFlag` | string | Flag to skip permissions (e.g. `--dangerously-skip-permissions`) |
52
+ | `requiresTTY` | boolean | Whether agent needs a PTY (true for codex) |
53
+ | `models` | object | Model overrides per context: `terminal`, `task`, `telegram`, `help`, `mobile` |
54
+ | `profile` | string | Linked profile ID — applies that profile's env/model when launching |
55
+
56
+ ### CLI Type
57
+
58
+ The `cliType` field determines how Forge interacts with the agent:
59
+
60
+ | CLI Type | Session Support | Resume | Skip Permissions |
61
+ |----------|----------------|--------|------------------|
62
+ | `claude-code` | Yes (session files) | `-c` / `--resume <id>` | `--dangerously-skip-permissions` |
63
+ | `codex` | No | — | `--full-auto` |
64
+ | `aider` | No | — | `--yes` |
65
+ | `generic` | No | — | — |
66
+
67
+ ### Example YAML
68
+
69
+ ```yaml
70
+ agents:
71
+ claude:
72
+ name: Claude Code
73
+ path: /usr/local/bin/claude
74
+ enabled: true
75
+ cliType: claude-code
76
+ skipPermissionsFlag: --dangerously-skip-permissions
77
+ codex:
78
+ name: OpenAI Codex
79
+ path: codex
80
+ enabled: true
81
+ cliType: codex
82
+ requiresTTY: true
83
+ skipPermissionsFlag: --full-auto
84
+ ```
85
+
86
+ ## Agent Profiles
87
+
88
+ Profiles are reusable configurations that extend a base agent with custom environment variables, model overrides, and CLI settings. Any smith or terminal session can use a profile.
89
+
90
+ ### Profile Fields
91
+
92
+ | Field | Type | Description |
93
+ |-------|------|-------------|
94
+ | `base` | string | Base agent ID (e.g. `claude`, `codex`) — makes this entry a profile |
95
+ | `name` | string | Display name |
96
+ | `model` | string | Model override (passed via `--model` flag) |
97
+ | `env` | object | Environment variables injected when launching |
98
+ | `cliType` | string | Override CLI type (inherits from base if not set) |
99
+ | `enabled` | boolean | Whether this profile is available |
100
+
101
+ ### Example: Custom API Endpoint Profile
102
+
103
+ ```yaml
104
+ agents:
105
+ forti-k2:
106
+ base: claude
107
+ name: Forti K2
108
+ model: forti-k2
109
+ env:
110
+ ANTHROPIC_AUTH_TOKEN: sk-xxx
111
+ ANTHROPIC_BASE_URL: http://my-server:7001/
112
+ ANTHROPIC_SMALL_FAST_MODEL: forti-k2
113
+ CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC: "true"
114
+ DISABLE_TELEMETRY: "true"
115
+ ```
116
+
117
+ ### Example: Model Override Profile
118
+
119
+ ```yaml
120
+ agents:
121
+ claude-opus:
122
+ base: claude
123
+ name: Claude Opus
124
+ model: claude-opus-4-6
125
+ claude-sonnet:
126
+ base: claude
127
+ name: Claude Sonnet
128
+ model: claude-sonnet-4-6
129
+ ```
130
+
131
+ ### How Profiles Work
132
+
133
+ 1. A profile inherits all capabilities from its base agent (binary path, session support, resume flags)
134
+ 2. Environment variables from `env` are exported before launching the CLI
135
+ 3. The `model` field is passed as `--model <value>` flag (claude-code) or via env
136
+ 4. Profiles appear in agent selection dropdowns alongside base agents
137
+
138
+ ### Linking a Profile to an Agent
139
+
140
+ In the agent configuration, set the `profile` field to link a profile:
141
+
142
+ ```yaml
143
+ agents:
144
+ claude:
145
+ profile: forti-k2 # Claude will use forti-k2's env/model when launched
146
+ ```
147
+
148
+ This applies the profile's environment variables and model override whenever that agent is launched in a terminal.
149
+
150
+ ## API Providers
151
+
152
+ Configure API keys for direct API access (used by API-backend smiths):
153
+
154
+ ```yaml
155
+ providers:
156
+ anthropic:
157
+ apiKey: sk-ant-... # encrypted on save
158
+ defaultModel: claude-sonnet-4-6
159
+ enabled: true
160
+ google:
161
+ apiKey: AIza...
162
+ defaultModel: gemini-2.0-flash
163
+ enabled: true
164
+ openai:
165
+ apiKey: sk-...
166
+ enabled: false
167
+ ```
168
+
169
+ Provider API keys are encrypted with AES-256-GCM. The UI shows masked values (••••••••).
27
170
 
28
171
  ## Admin Password
29
172
 
30
173
  - Set on first launch (CLI prompt)
31
174
  - Required for: login, tunnel start, secret changes, Telegram commands
32
175
  - Reset: `forge --reset-password`
33
- - Forgot? Run `forge --reset-password` in terminal
34
176
 
35
177
  ## Encrypted Fields
36
178
 
37
- `telegramBotToken` and `telegramTunnelPassword` are encrypted with AES-256-GCM. The encryption key is stored at `~/.forge/data/.encrypt-key`.
179
+ `telegramBotToken` and `telegramTunnelPassword` are encrypted with AES-256-GCM. Agent/provider `apiKey` fields are also encrypted. The encryption key is stored at `~/.forge/data/.encrypt-key`.
180
+
181
+ ## Settings UI
182
+
183
+ The Settings modal has these sections:
184
+
185
+ | Section | What it configures |
186
+ |---------|-------------------|
187
+ | **Project Roots** | Directories to scan for projects |
188
+ | **Document Roots** | Markdown/Obsidian vault paths |
189
+ | **Agents** | Detected CLI agents + configuration |
190
+ | **Profiles** | Agent profiles with env/model overrides |
191
+ | **Providers** | API provider keys and defaults |
192
+ | **Telegram** | Bot token, chat ID, notification toggles |
193
+ | **Display** | Name, email |
194
+ | **Other** | Skip permissions, skills repo URL, notification retention |
@@ -308,6 +308,95 @@ curl -X POST http://localhost:8403/api/pipelines \
308
308
  -d '{"action": "save-workflow", "yaml": "<yaml content>"}'
309
309
  ```
310
310
 
311
+ ## Conversation Mode (Multi-Agent Dialogue)
312
+
313
+ Conversation mode enables multiple agents to collaborate through structured dialogue. Instead of a DAG of tasks, Forge acts as a message broker — sending prompts between agents in rounds until a stop condition is met.
314
+
315
+ ### YAML Format
316
+
317
+ ```yaml
318
+ name: architect-implementer
319
+ type: conversation
320
+ description: "Architect designs, implementer builds"
321
+ input:
322
+ project: "Project name"
323
+ task: "What to build"
324
+ agents:
325
+ - id: architect
326
+ agent: claude
327
+ role: "You are a software architect. Design the solution, define interfaces, and review implementations."
328
+ - id: implementer
329
+ agent: codex
330
+ role: "You are a developer. Implement what the architect designs."
331
+ max_rounds: 10
332
+ stop_condition: "both agents say DONE"
333
+ initial_prompt: "Build: {{input.task}}"
334
+ ```
335
+
336
+ ### Fields
337
+
338
+ | Field | Description | Default |
339
+ |-------|-------------|---------|
340
+ | `type` | Must be `conversation` | required |
341
+ | `agents` | List of participating agents | required |
342
+ | `agents[].id` | Logical ID within conversation | required |
343
+ | `agents[].agent` | Agent registry ID (`claude`, `codex`, `aider`, etc.) | `claude` |
344
+ | `agents[].role` | System prompt / role description | none |
345
+ | `agents[].project` | Project context (overrides input.project) | none |
346
+ | `max_rounds` | Maximum number of full rounds | `10` |
347
+ | `stop_condition` | When to stop early | none |
348
+ | `initial_prompt` | The seed prompt (supports `{{input.*}}` templates) | required |
349
+ | `context_strategy` | How to pass history between agents: `full`, `window`, `summary` | `summary` |
350
+ | `context_window` | Number of recent messages to include in full (for `window`/`summary`) | `4` |
351
+ | `max_content_length` | Truncate each message to this many characters | `3000` |
352
+
353
+ ### Context Strategies
354
+
355
+ Agents don't share memory — Forge acts as broker and decides what context to forward.
356
+
357
+ - **`summary`** (default): Older messages are compressed to one-line summaries. The most recent N messages (set by `context_window`) are passed in full. Best balance of context quality and token usage.
358
+ - **`window`**: Only the last N messages are passed, older ones are dropped entirely. Lowest token usage.
359
+ - **`full`**: All messages from all rounds are passed in full (each truncated to `max_content_length`). Most context but token-heavy.
360
+
361
+ ### Execution Flow
362
+
363
+ 1. Forge sends `initial_prompt` + role to the first agent
364
+ 2. Agent responds → Forge collects the response
365
+ 3. Forge builds context (per `context_strategy`) and sends to the next agent
366
+ 4. Repeat through all agents = 1 round
367
+ 5. Continue rounds until `stop_condition` or `max_rounds`
368
+
369
+ ### Stop Conditions
370
+
371
+ - `"any agent says DONE"` — stops when any agent includes "DONE" in its response
372
+ - `"both agents say DONE"` / `"all agents say DONE"` — stops when all agents have said "DONE"
373
+ - If no stop condition, runs until `max_rounds`
374
+
375
+ ### UI
376
+
377
+ Conversation pipelines show a chat-like view with color-coded agent bubbles, round numbers, and linked task IDs. The sidebar shows round progress (e.g., R3/10).
378
+
379
+ ### Example: Code Review Dialogue
380
+
381
+ ```yaml
382
+ name: review-dialogue
383
+ type: conversation
384
+ description: "Two agents discuss code quality"
385
+ input:
386
+ project: "Project name"
387
+ pr_number: "PR number to review"
388
+ agents:
389
+ - id: reviewer
390
+ agent: claude
391
+ role: "You are a code reviewer. Find bugs, security issues, and suggest improvements."
392
+ - id: author
393
+ agent: claude
394
+ role: "You are the code author. Address review feedback, explain design decisions, and fix issues."
395
+ max_rounds: 5
396
+ stop_condition: "all agents say DONE"
397
+ initial_prompt: "Review PR #{{input.pr_number}} in project {{input.project}}. Reviewer: analyze the diff. Author: be ready to address feedback."
398
+ ```
399
+
311
400
  ## Pipeline Model
312
401
 
313
402
  In **Settings → Pipeline Model**, you can select which Claude model runs pipeline tasks. Set to `default` to use the same model as regular tasks.
@@ -30,10 +30,44 @@ Add project directories in Settings → **Project Roots** (e.g. `~/Projects`). F
30
30
  - Processed issues history with retry/delete
31
31
  - Auto-chains: fix → create PR → review
32
32
 
33
+ ### Workspace Tab
34
+ - Configure multi-agent workspace (Forge Smiths)
35
+ - Add smiths with roles, steps, and dependencies
36
+ - Start/stop daemon, monitor execution
37
+ - See [Workspace documentation](11-workspace.md) for details
38
+
33
39
  ## Favorites
34
40
 
35
41
  Click ★ next to a project to favorite it. Favorites appear at the top of the sidebar.
36
42
 
37
43
  ## Terminal
38
44
 
39
- Click "Terminal" button in project header to open a Vibe Coding terminal for that project. Uses `claude -c` to continue last session.
45
+ ### Opening a Terminal
46
+
47
+ There are two ways to open a terminal for a project:
48
+
49
+ **1. Project Header Button**
50
+ - Click **Terminal** in the project header → opens with default agent (claude)
51
+ - Click **▾** dropdown to select a different agent or profile
52
+ - If the agent supports sessions (claude-code), a dialog shows: New Session / Resume Latest / Browse Sessions
53
+ - Non-session agents (codex, aider) open directly
54
+
55
+ **2. Terminal Tab "+" Button**
56
+ - Click **+** in the terminal tab bar → select a project root → expand to see projects
57
+ - Click an agent button (C = Claude, X = Codex, A = Aider, ● = Profile) to open
58
+ - The terminal launches with the agent's configured env vars and model
59
+
60
+ ### Agent & Profile Selection
61
+
62
+ When selecting an agent or profile for a terminal:
63
+ - **Base agents** (Claude, Codex, Aider): Use their default configuration
64
+ - **Profiles** (e.g., Forti K2, Claude Opus): Apply the profile's environment variables and model override
65
+ - Environment variables are exported in the terminal before launching the CLI
66
+ - Model is passed via `--model` flag (for claude-code agents)
67
+
68
+ ### Terminal Features
69
+ - Full xterm.js terminal with tmux session persistence
70
+ - Split panes (horizontal/vertical)
71
+ - Multiple tabs per project
72
+ - Tab state preserved across page refreshes
73
+ - Tabs can be renamed and reordered