@aion0/forge 0.5.33 → 0.5.34

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/CLAUDE.md CHANGED
@@ -60,6 +60,8 @@ When adding or changing a feature, check if `lib/help-docs/` needs updating. Eac
60
60
  - `08-rules.md` — CLAUDE.md templates
61
61
  - `09-issue-autofix.md` — GitHub issue scanner
62
62
  - `10-troubleshooting.md` — common issues
63
+ - `11-workspace.md` — multi-agent workspace (smiths, daemon, request docs)
64
+ - `12-usage.md` — token usage analytics and cost tracking
63
65
  If a feature change affects user-facing behavior, update the corresponding help doc in the same commit.
64
66
 
65
67
  ### Architecture
package/RELEASE_NOTES.md CHANGED
@@ -1,8 +1,8 @@
1
- # Forge v0.5.33
1
+ # Forge v0.5.34
2
2
 
3
3
  Released: 2026-04-10
4
4
 
5
- ## Changes since v0.5.32
5
+ ## Changes since v0.5.33
6
6
 
7
7
 
8
- **Full Changelog**: https://github.com/aiwatching/forge/compare/v0.5.32...v0.5.33
8
+ **Full Changelog**: https://github.com/aiwatching/forge/compare/v0.5.33...v0.5.34
@@ -2,6 +2,22 @@
2
2
 
3
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
+ ## Main Features
6
+
7
+ | Feature | Description |
8
+ |---|---|
9
+ | **Browser Terminal** | xterm.js + tmux persistence, split panes, mouse on/off toggle, auto-reconnect on disconnect |
10
+ | **Projects** | File tree, Git operations, code search, per-project tabs, favorites |
11
+ | **Workspace (Smiths)** | Multi-agent orchestration with DAG dependencies, message bus, request documents |
12
+ | **Tasks** | Background AI task queue with hook-based completion notifications |
13
+ | **Pipelines** | YAML-driven DAG workflows with scheduling and routing |
14
+ | **Skills Marketplace** | Install/update Claude Code skills and slash commands per project |
15
+ | **Usage Analytics** | Token/cost tracking by project, model, source with charts and heatmaps |
16
+ | **Telegram Bot** | Mobile control — submit tasks, receive notifications |
17
+ | **Remote Access** | One-click Cloudflare tunnel for remote browsing |
18
+ | **GitHub Issue Auto-fix** | Scan issues, auto-fix, create PRs |
19
+ | **Memory (optional)** | Code graph + knowledge via `@aion0/temper` MCP server |
20
+
5
21
  ## Quick Start
6
22
 
7
23
  ```bash
@@ -40,6 +40,26 @@ Add project directories in Settings → **Project Roots** (e.g. `~/Projects`). F
40
40
 
41
41
  Click ★ next to a project to favorite it. Favorites appear at the top of the sidebar.
42
42
 
43
+ ## Sidebar & Navigation
44
+
45
+ - **Collapse sidebar** (▶/◀ button): Narrow strip shows opened tabs at top (marked with green dot) and all other projects as initials below. Hover to show close (×) button on open tabs.
46
+ - **Sidebar state is persisted** across browser refreshes via `localStorage`.
47
+ - **Open projects** are marked with a green dot in the expanded sidebar; hover to reveal a close button.
48
+ - **Close confirmation** prompts before closing a project tab to prevent accidental closes.
49
+ - Up to **20 project tabs** stay mounted simultaneously (LRU eviction beyond that) — switching between recent projects is instant, terminal state is preserved.
50
+
51
+ ## Tree Views — Collapse All
52
+
53
+ All hierarchical tree views have a `⇱` "Collapse all" button to quickly fold every folder:
54
+
55
+ | Location | Button position |
56
+ |---|---|
57
+ | Project **Code** tab file tree | Right of "Files" label |
58
+ | **Docs viewer** tree | Right of search box |
59
+ | **Skills** panel file tree | Top of file tree |
60
+ | **Workspace** sidebar | Header next to `+` |
61
+ | **Session** list | Next to Batch button |
62
+
43
63
  ## Terminal
44
64
 
45
65
  ### Opening a Terminal
@@ -39,6 +39,18 @@ rm ~/.forge/data/terminal-state.json
39
39
  # Restart server — tabs will be empty but tmux sessions survive
40
40
  ```
41
41
 
42
+ ### Terminal input is laggy
43
+ Usually caused by high system load. Check:
44
+ - System memory — if heavily swapping, kill some processes
45
+ - Clean up old tmux sessions: `tmux list-sessions` then `tmux kill-session -t <name>`
46
+ - Reduce polling: open tabs are limited to 20 by LRU eviction
47
+ - Workspace terminals auto-reconnect on disconnect; no need to manually reopen
48
+
49
+ ### "Connection error" in workspace terminal
50
+ The WebSocket dropped (system suspend, network blip). Forge auto-reconnects after 2s and re-attaches to the same tmux session. If it keeps happening:
51
+ - Check `~/.forge/data/forge.log` for terminal-standalone errors
52
+ - Restart: `forge server restart`
53
+
42
54
  ### gh CLI not authenticated (Issue Scanner)
43
55
  ```bash
44
56
  gh auth login
@@ -207,6 +207,24 @@ Agents use these MCP tools (via forge-mcp-server):
207
207
  | `mark_message_done` | Mark a processed message as done |
208
208
  | `check_outbox` | Check delivery status of sent messages |
209
209
 
210
+ ### Request vs Inbox — When to use which
211
+
212
+ Every preset smith's role prompt includes a decision rule for this:
213
+
214
+ **Use `create_request`** when:
215
+ - Delegating substantive work (implement feature, write tests, do review)
216
+ - Work has concrete deliverables and acceptance criteria
217
+ - Work should flow through a pipeline (engineer → qa → reviewer)
218
+ - The task needs to be tracked, claimed, and its status visible
219
+
220
+ **Use `send_message`** when:
221
+ - Asking a clarifying question
222
+ - Quick status update or coordination
223
+ - Reporting a bug back after review fails
224
+ - No concrete deliverable
225
+
226
+ **When unsure, prefer `create_request`** — a tracked artifact beats losing context in chat.
227
+
210
228
  ### Other
211
229
 
212
230
  | Tool | Description |
@@ -317,6 +335,31 @@ Click **⌨️** on any smith to open a terminal session:
317
335
  - Forge Skills available: `/forge-send`, `/forge-inbox`, `/forge-status`, `/forge-workspace-sync`
318
336
  - Session Picker: choose new session, continue existing, or browse all Claude sessions
319
337
  - Close terminal → smith returns to auto mode, pending messages resume
338
+ - **Auto-reconnect**: If the WebSocket drops (e.g. system suspend, network blip), the terminal automatically reconnects after 2s and re-attaches to the same tmux session — conversation context preserved
339
+ - **Mouse ON/OFF toggle** (🖱️ button in header): Toggle tmux mouse mode globally for all sessions
340
+ - **ON**: trackpad scroll, `Shift+drag` to select text
341
+ - **OFF**: drag to select text directly, `Ctrl+B [` to enter scroll mode
342
+ - Click to apply instantly (no restart needed)
343
+
344
+ ### Terminal Layout: Float vs Dock
345
+
346
+ The workspace toolbar has a layout switcher: `⧉ Float` or `▤ Dock`.
347
+
348
+ | Layout | Behavior |
349
+ |---|---|
350
+ | **Float** (default) | Each terminal is a draggable/resizable floating window positioned near its smith node |
351
+ | **Dock** | All open terminals arranged in a fixed grid at the bottom of the workspace |
352
+
353
+ Dock mode features:
354
+ - Grid columns selector (1/2/3/4) — auto-expands based on open terminal count
355
+ - 1 terminal with 4 columns → fills full width
356
+ - 2 → half-half, 3 → thirds, 4 → quarters, 5+ → wraps to second row
357
+ - Drag the top border to resize dock height
358
+ - Layout preference persisted to localStorage
359
+
360
+ ### Smith Node Positions
361
+
362
+ Drag smith nodes to reorganize the graph. Positions are **persisted to workspace state** and restored on reload. Auto-save debounces writes (500ms after drag stops).
320
363
 
321
364
  ## Watch (Autonomous Monitoring)
322
365
 
@@ -356,7 +399,7 @@ Agents can monitor file/git/command changes without message-driven triggers.
356
399
 
357
400
  Each smith can display an animated companion character next to its node.
358
401
 
359
- **Themes**: Stick figure, Cat, Dog, Pig, Emoji, Off (default)
402
+ **Themes**: Stick figure, Cat, Pixel (8-bit RPG hero), Emoji, Off (default)
360
403
 
361
404
  - Theme picker in workspace header
362
405
  - Animates based on smith state (idle/running/done/failed/sleeping)
@@ -368,7 +411,7 @@ Each smith can display an animated companion character next to its node.
368
411
  | Action | Description |
369
412
  |--------|-------------|
370
413
  | **Start Daemon** | Launch all smiths, begin consuming messages |
371
- | **Stop Daemon** | Stop all smiths, kill workers |
414
+ | **Stop Daemon** | Stop all smiths, kill workers. Preserves user's terminal conversation context (no `/clear` is sent). Tmux sessions attached to by a user are kept alive. |
372
415
  | **Run All** | Trigger all runnable agents once |
373
416
  | **Run** | Trigger specific agent |
374
417
  | **Pause/Resume** | Pause/resume message consumption for one agent |
@@ -0,0 +1,103 @@
1
+ # Usage Analytics
2
+
3
+ Forge tracks Claude API token usage and estimated costs across all your projects.
4
+
5
+ ## Access
6
+
7
+ Click **Usage** in the Dashboard top navigation.
8
+
9
+ ## Data Source
10
+
11
+ Forge scans these sources on-demand (via **Scan Now** button) or automatically on startup:
12
+
13
+ | Source | Location | What it tracks |
14
+ |---|---|---|
15
+ | `claude-code` | `~/.claude/projects/*/` | Interactive Claude Code sessions |
16
+ | `forge-task` | `~/.forge/data/tasks.db` | Background tasks submitted through Forge |
17
+ | `api-direct` | SDK/API calls logged by Forge | Direct API calls (rare) |
18
+
19
+ Stored in `~/.forge/data/usage.db` (SQLite). Each row records: session_id, source, project, model, day, input/output/cache tokens, cost_usd, message_count.
20
+
21
+ ## Time Range Filter
22
+
23
+ Buttons in the header: **7d / 30d / 90d / All** — filter all charts and tables.
24
+
25
+ ## Summary Cards
26
+
27
+ | Card | Shows |
28
+ |---|---|
29
+ | **Total Cost** | Sum of `cost_usd` in the selected range + trend (↑/↓ vs previous half) |
30
+ | **Daily Avg** | Total cost divided by days with activity |
31
+ | **Tokens** | Total tokens (input + output + cache read), broken down below |
32
+ | **Cache Hit** | `cacheRead / (input + cacheRead) × 100%` + cached tokens count |
33
+
34
+ ## Visualizations
35
+
36
+ ### Token Mix (stacked bar)
37
+ A single horizontal bar showing the proportion of:
38
+ - 🔵 Input tokens
39
+ - 🟢 Output tokens
40
+ - 🟣 Cache read tokens
41
+ - 🟠 Cache create tokens
42
+
43
+ Hover for tooltip.
44
+
45
+ ### Cost Trend (line chart)
46
+ Line chart of daily cost over the selected range. Y-axis auto-scales to max cost. X-axis labels shown for ~7 date points.
47
+
48
+ ### Activity Heatmap
49
+ GitHub-style 90-day grid: rows are weekdays (S/M/T/W/T/F/S), columns are weeks. Darker blue = higher cost. Hover a cell for exact date and cost.
50
+
51
+ ### Avg by Weekday
52
+ Bar chart showing the average daily cost per weekday. Weekends highlighted in orange, weekdays in blue.
53
+
54
+ ### By Model / By Source (donut charts)
55
+ Two side-by-side donut charts splitting total cost by model (Opus, Sonnet, Haiku) and by source (claude-code, forge-task, api-direct). Shows percentage + absolute cost per slice.
56
+
57
+ ### By Project (bar list)
58
+ Top 20 projects ranked by cost. Each row shows project name, relative bar, cost, and session count.
59
+
60
+ ### Model Details (table)
61
+ Per-model breakdown:
62
+ - Input / Output tokens
63
+ - Cost
64
+ - Message count
65
+ - Avg cost per message
66
+
67
+ ### Summary Stats (bottom 3 cards)
68
+ - **Avg per session** — total cost / session count
69
+ - **Avg per message** — total cost / message count
70
+ - **Sessions per day** — session count / days with activity
71
+
72
+ ## Cost Calculation
73
+
74
+ Estimates based on public Anthropic API pricing:
75
+
76
+ | Model | Input | Output |
77
+ |---|---|---|
78
+ | Claude Opus 4 | $15/M | $75/M |
79
+ | Claude Sonnet 4 | $3/M | $15/M |
80
+ | Claude Haiku 4 | ~$0.80/M | ~$4/M |
81
+
82
+ Cache reads are ~90% cheaper than regular inputs (~$0.30/M for Opus).
83
+
84
+ > Actual cost may differ if you're on Claude Max/Pro subscription (fixed monthly), or using Bedrock/Vertex with different pricing.
85
+
86
+ ## Actions
87
+
88
+ - **Scan Now** — Re-scans all JSONL session files and tasks.db, updates the database
89
+ - **Time range** — 7/30/90/All days
90
+
91
+ ## Troubleshooting
92
+
93
+ ### Usage shows $0
94
+ - No data yet — click **Scan Now**
95
+ - Check `~/.claude/projects/` has JSONL session files
96
+ - Check `~/.forge/data/tasks.db` exists and has rows
97
+ - Check `~/.forge/data/usage.db` has data: `sqlite3 ~/.forge/data/usage.db 'SELECT COUNT(*) FROM token_usage'`
98
+
99
+ ### Wrong project name
100
+ Usage scanner derives project name from directory path. Rename via scan refresh after moving projects.
101
+
102
+ ### Missing recent sessions
103
+ Sessions in progress aren't tracked until the file is flushed. Click **Scan Now** to force a refresh.
@@ -42,6 +42,7 @@ The token is valid for 24 hours. Store it in a variable and reuse for all API ca
42
42
  | `09-issue-autofix.md` | GitHub issue auto-fix pipeline |
43
43
  | `10-troubleshooting.md` | Common issues and solutions |
44
44
  | `11-workspace.md` | Workspace (Forge Smiths) — multi-agent orchestration, daemon, message bus, profiles |
45
+ | `12-usage.md` | Token usage analytics — charts, heatmap, cost estimation, by model/project/source |
45
46
 
46
47
  ## Matching questions to docs
47
48
 
@@ -60,3 +61,6 @@ The token is valid for 24 hours. Store it in a variable and reuse for all API ca
60
61
  - Watch/monitor/detect/file changes/autonomous → `11-workspace.md`
61
62
  - Agent profile/env/model/cliType → `01-settings.md` + `11-workspace.md`
62
63
  - Agent log/logs/history/clear logs → `11-workspace.md`
64
+ - Usage/cost/tokens/spending/billing/analytics → `12-usage.md`
65
+ - Terminal dock/float/mouse toggle/reconnect → `07-projects.md` + `11-workspace.md`
66
+ - Sidebar collapse/project tabs/favorites → `07-projects.md`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aion0/forge",
3
- "version": "0.5.33",
3
+ "version": "0.5.34",
4
4
  "description": "Unified AI workflow platform — multi-model task orchestration, persistent sessions, web terminal, remote access",
5
5
  "type": "module",
6
6
  "scripts": {