Skip to content

Commit a5ee264

Browse files
committed
feat: add VS Code extension with sidebar, dashboard webview, status bar, and deep linking
- Introduce `vscode-extension/` package with activity-bar sidebar, status bar integration, and dashboard webview - Implement commands for REPL, run task, run selection/file, dashboard lifecycle, doctor, settings, and task deep linking - Read stats and recent tasks directly from local SQLite index for offline support - Update docs, README, ARCHITECTURE.md, and index.html to document and showcase the new extension - Add .vscodeignore, tsconfig, tasks, and supporting files for extension build and packaging
1 parent ea48608 commit a5ee264

41 files changed

Lines changed: 2013 additions & 54 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
node_modules/
22
dist/
33
coverage/
4+
vscode-extension/node_modules/
5+
vscode-extension/out/
46
*.log
57
.env
68
.env.local

.vscode/extensions.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
{
2-
// Recommended extensions for contributors. VS Code prompts to install
3-
// these the first time the workspace is opened.
42
"recommendations": [
53
"dbaeumer.vscode-eslint",
64
"esbenp.prettier-vscode",

.vscode/launch.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
{
2-
// Debug configurations for Forge. Each one uses an isolated FORGE_HOME
3-
// so debugging never touches the developer's real ~/.forge state.
42
"version": "0.2.0",
53
"configurations": [
64
{

.vscode/settings.json

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
{
2-
// -------------------------------------------------------------------------
3-
// Editor — match the prettier + eslint contract enforced in CI.
4-
// -------------------------------------------------------------------------
52
"editor.formatOnSave": true,
63
"editor.defaultFormatter": "esbenp.prettier-vscode",
74
"editor.codeActionsOnSave": {
@@ -18,28 +15,15 @@
1815
"files.trimTrailingWhitespace": true,
1916
"files.trimFinalNewlines": true,
2017
"files.eol": "\n",
21-
22-
// -------------------------------------------------------------------------
23-
// TypeScript — use the workspace's own tsc, not the one bundled with VS Code.
24-
// Keeps error messages aligned with `npm run typecheck` in CI.
25-
// -------------------------------------------------------------------------
2618
"typescript.tsdk": "node_modules/typescript/lib",
2719
"typescript.enablePromptUseWorkspaceTsdk": true,
2820
"typescript.preferences.importModuleSpecifier": "relative",
2921
"typescript.updateImportsOnFileMove.enabled": "always",
3022
"typescript.inlayHints.parameterNames.enabled": "literals",
3123
"typescript.inlayHints.functionLikeReturnTypes.enabled": false,
3224
"javascript.preferences.importModuleSpecifier": "relative",
33-
34-
// -------------------------------------------------------------------------
35-
// ESLint — run on .ts files; flat config is not used here.
36-
// -------------------------------------------------------------------------
3725
"eslint.validate": ["typescript", "typescriptreact", "javascript"],
3826
"eslint.workingDirectories": [{ "mode": "auto" }],
39-
40-
// -------------------------------------------------------------------------
41-
// Per-language overrides
42-
// -------------------------------------------------------------------------
4327
"[typescript]": {
4428
"editor.defaultFormatter": "esbenp.prettier-vscode"
4529
},
@@ -66,10 +50,6 @@
6650
"[github-actions-workflow]": {
6751
"editor.defaultFormatter": "esbenp.prettier-vscode"
6852
},
69-
70-
// -------------------------------------------------------------------------
71-
// Search + explorer — hide build and native-module churn from the tree.
72-
// -------------------------------------------------------------------------
7353
"files.exclude": {
7454
"**/.DS_Store": true,
7555
"**/Thumbs.db": true,
@@ -97,24 +77,12 @@
9777
".gitignore": ".gitattributes, .editorconfig, .prettierrc*, .eslintrc*, .prettierignore, .eslintignore",
9878
"vitest.config.ts": "vitest.config.*.ts"
9979
},
100-
101-
// -------------------------------------------------------------------------
102-
// Testing — Vitest extension integration (auto-detects vitest.config.ts).
103-
// -------------------------------------------------------------------------
10480
"vitest.commandLine": "npx vitest",
10581
"vitest.enable": true,
106-
107-
// -------------------------------------------------------------------------
108-
// Terminal + Git
109-
// -------------------------------------------------------------------------
11082
"terminal.integrated.scrollback": 10000,
11183
"git.autofetch": true,
11284
"git.confirmSync": false,
11385
"git.openRepositoryInParentFolders": "never",
114-
115-
// -------------------------------------------------------------------------
116-
// Telemetry + UI noise
117-
// -------------------------------------------------------------------------
11886
"npm.packageManager": "npm",
11987
"npm.enableRunFromFolder": true,
12088
"editor.minimap.enabled": false

CHANGELOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,35 @@
22

33
All notable changes to Forge are tracked here. Follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
44

5+
## [1.0.0] - 2026-04-27
6+
7+
First stable release. The runtime, agentic loop, persistence model, permission system, sandbox, and provider abstractions are now considered stable surface area. Breaking changes from here on bump MAJOR.
8+
9+
### Added
10+
- **VS Code extension** (`vscode-extension/`, published as `hoangsonw.forge-agentic-coding-cli`). First-class editor surface with an activity-bar webview, status-bar pill, command palette integration, deep-linking from any task into the dashboard's conversation view, integrated terminals for REPL / `forge run` / `forge ui start` / `forge doctor`, and an embedded dashboard webview. Reads stats directly from `~/.forge/global/index.db` so token, call, and task counts stay accurate even with no Forge process running. Onboarding flow when the runtime is missing: install via npm, custom-path override, docs link.
11+
- **Dashboard URL deep-linking**`?task=<id>` (or `#task=<id>`) opens the task detail view on load; `?view=<name>` jumps directly to a named view. Used by the VS Code extension's "view all" and per-task click-through, but available to any caller.
12+
- **Plan-edit modal** in the dashboard — JSON editor pops up when you choose Edit on a plan approval; edited plans flow back through the same `interactive-host` channel as terminal edits.
13+
- **Live markdown streaming in the dashboard**`model.delta` events render via `requestAnimationFrame`-coalesced markdown reflow so headings, fences, and lists form up as tokens arrive instead of dumping at the end.
14+
- **Per-task delta replay buffer** so a WebSocket client that connects mid-stream sees the tokens that were already emitted, not just future ones.
15+
- **Cross-project task detail lookup**`/api/tasks/:id` resolves the project automatically via the global index, with a fallback chain (explicit `?projectPath=``getTask().project_id``findProjectRoot()``process.cwd()`). 404 responses now include the list of paths that were tried.
16+
- **Demos page** in the docs site (`#demos`) and a dedicated **VS Code section** (`#vscode`) on the landing page.
17+
- **Demo recordings** for REPL, CLI, and dashboard surfaces, plus a screenshot of the VS Code extension. Drive overlay buttons on every video for users who can't load embedded MP4s.
18+
19+
### Changed
20+
- Tightened dashboard markdown renderer: inline triple-backtick fences now normalised to multi-line; ordered lists honor source numbering via `<ol start="N">` and tolerate blank lines between items; per-line borders inside `<pre><code>` removed; chat-bubble whitespace tightened.
21+
- REPL launch banner and completion block now render with the same divider/breadcrumb/summary treatment as `forge run`, so REPL turns and one-shot CLI runs look identical.
22+
- Status-bar dashboard reachability indicator now probes `/api/status` over HTTP before flipping to "offline", eliminating false-offline blips during heavy task streams.
23+
- Plan auto-approval bug: plans now wait for the user's decision in the UI before execution. Previously some plans were silently approved.
24+
- Conversation rendering: TASK_COMPLETED events carry a short message; the streamed reply is no longer duplicated in the DONE block.
25+
26+
### Fixed
27+
- Streaming dropping deltas due to a task-id mismatch between the UI runner and the orchestrator. Both sides now agree on the canonical `task_<hex>` id.
28+
- "Spend $0.000" stat tile removed for local providers (Ollama / llama.cpp), where cost is always zero by design. Token totals still shown.
29+
- Tokens stat now reflects the real lifetime sum from `model_cost_ledger` instead of the in-memory delta.
30+
- Recent-task rows weren't clickable / showed every task as `pending` because the API field is `status` (not `state`) and `title` (not `prompt`). Field names corrected and the entire row is now the click target.
31+
- Sidebar layout overflowed on narrow widths. Action grid uses `repeat(auto-fit, minmax(96px, 1fr))`; stats grid uses `minmax(78px, 1fr)`. Workspace card uses RTL truncation so long paths show their tail.
32+
- VS Code "view all" button now opens the dashboard's Tasks page, not the home view.
33+
534
## [0.1.0] - 2026-04-18
635

736
Initial public release. Includes the full planning spec surface area.

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ See [`docs/INSTALL.md`](docs/INSTALL.md) for per-OS notes and [`docs/SETUP.md`](
256256

257257
### See it running
258258

259-
Three surfaces, one runtime.
259+
Four surfaces, one runtime.
260260

261261
**REPL (Interactive Terminal) Mode**
262262

@@ -270,6 +270,14 @@ https://github.com/user-attachments/assets/bc3b3204-fd87-436f-9467-604535edb4e2
270270

271271
https://github.com/user-attachments/assets/218cd64f-40fe-4836-9c62-c7a08538056b
272272

273+
**VS Code Extension**
274+
275+
The same workflow, embedded in your editor. A live activity-bar sidebar with status, stats, recent tasks, and quick actions; deep-linking from any task into its conversation view; one-click dashboard webview; selection-as-task and file-as-task commands. Stats read straight from `~/.forge/global/index.db` so they stay accurate even when no server is running.
276+
277+
![Forge for VS Code](vscode-extension/vscode.png)
278+
279+
Install: `code --install-extension hoangsonw.forge-agentic-coding-cli` or [open it on the Marketplace](https://marketplace.visualstudio.com/items?itemName=hoangsonw.forge-agentic-coding-cli). See [`vscode-extension/README.md`](vscode-extension/README.md) for the full command reference.
280+
273281
---
274282

275283
## The agentic loop

RELEASES.md

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,10 +443,10 @@ FROM ghcr.io/hoangsonw/forge-agentic-coding-cli:0.2.0
443443

444444
```bash
445445
# npm — downgrade explicitly.
446-
npm install -g @hoangsonw/forge@0.1.1
446+
npm install -g @hoangsonw/forge@1.0.0
447447

448448
# Docker — swap the tag.
449-
docker pull ghcr.io/hoangsonw/forge-agentic-coding-cli:0.1.1
449+
docker pull ghcr.io/hoangsonw/forge-agentic-coding-cli:1.0.0
450450

451451
# Tell the built-in updater to stop nagging about a broken version.
452452
forge update ignore 0.2.0
@@ -644,6 +644,32 @@ Stable within a MAJOR. Migrations under [`src/migrations/runner.ts`](src/migrati
644644
<!-- Newest at the top. Keep the template from
645645
"Release-notes template" above. -->
646646

647+
### v1.0.0 — 2026-04-27
648+
649+
#### Highlights
650+
- First stable release. Runtime, agentic loop, persistence, permissions, sandbox, and provider abstractions are now stable surface area; future breaking changes bump MAJOR.
651+
- New first-class **VS Code extension** (`hoangsonw.forge-agentic-coding-cli`) with activity-bar webview, stats grid, recent tasks, and deep-linking from any task into the dashboard's conversation view.
652+
- **Dashboard URL deep-linking**`?task=<id>` opens task detail; `?view=<name>` jumps to a named view. Used by the VS Code extension and any other surface that links into the dashboard.
653+
- Cross-project task detail lookup via `/api/tasks/:id` — resolves the project automatically from the global index.
654+
655+
#### Added
656+
- VS Code extension surface (separate npm package + Marketplace listing).
657+
- `?task=` / `?view=` deep-link routing in the dashboard SPA.
658+
- Plan-edit modal in the dashboard (JSON editor for plan approval).
659+
- Per-task delta replay buffer so late-connecting WebSocket clients see prior tokens.
660+
- Demo recordings + VS Code screenshot on the landing page.
661+
662+
#### Changed
663+
- Live markdown streaming uses rAF-coalesced reflow instead of dump-at-end.
664+
- REPL completion summary now matches `forge run` formatting.
665+
- Status-bar reachability indicator HTTP-probes before flipping to offline.
666+
- Plans wait for explicit user decision in the UI; no silent auto-approval.
667+
668+
#### Fixed
669+
- Streaming previously dropped deltas due to a task-id mismatch between the UI runner and the orchestrator.
670+
- Recent-task rows in the VS Code sidebar are now clickable and show the right status.
671+
- Cross-project task detail lookups no longer 404.
672+
647673
### v0.1.1 — 2026-04-20
648674

649675
#### Highlights

docs/ARCHITECTURE.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- [7. Permission + sandbox model](#7-permission--sandbox-model)
1919
- [8. Conversation & persistence](#8-conversation--persistence)
2020
- [9. UI topology](#9-ui-topology)
21+
- [9.1 VS Code extension](#91-vs-code-extension)
2122
- [10. CI/CD pipeline](#10-cicd-pipeline)
2223
- [11. Deployment topologies](#11-deployment-topologies)
2324
- [12. Runtime metrics at a glance](#12-runtime-metrics-at-a-glance)
@@ -42,6 +43,7 @@ flowchart TB
4243
CLI["CLI (commander)"]:::surface
4344
REPL["REPL (raw-mode editor)"]:::surface
4445
UI["Dashboard (HTTP + WS)"]:::surface
46+
VSCX["VS Code extension<br/>(vscode-extension/)"]:::surface
4547
end
4648
4749
ORCH["Orchestrator<br/>src/core/orchestrator.ts"]:::core
@@ -105,6 +107,7 @@ Code it maps to:
105107
| CLI surface | `src/cli/` (24 commands) |
106108
| REPL | `src/cli/repl.ts` + `src/cli/repl-input.ts` |
107109
| UI | `src/ui/server.ts` + `src/ui/public/` |
110+
| VS Code extension | `vscode-extension/` (separate npm package, ships to the VS Code Marketplace) |
108111
| Orchestrator | `src/core/orchestrator.ts` |
109112
| Agentic loop | `src/core/loop.ts` |
110113
| Agents | `src/agents/{planner,architect,executor,reviewer,debugger,memory}.ts` |
@@ -494,6 +497,57 @@ flowchart LR
494497
for path-traversal safety.
495498
- Healthcheck endpoint `/api/status` used by the Docker HEALTHCHECK.
496499

500+
### 9.1 VS Code extension
501+
502+
The extension at `vscode-extension/` is a sibling surface — its own npm package, its own version, its own publish pipeline. It does not import any runtime code from `src/`; instead it talks to a Forge install the user already has on `PATH` and reads from the same persisted state.
503+
504+
```mermaid
505+
flowchart LR
506+
classDef b fill:#0f172a,stroke:#38bdf8,color:#f1f5f9,rx:4,ry:4
507+
classDef s fill:#082f49,stroke:#38bdf8,color:#e0f2fe,rx:4,ry:4
508+
classDef d fill:#18181b,stroke:#f59e0b,color:#fef3c7,rx:4,ry:4
509+
510+
EDITOR[VS Code editor]:::b
511+
EXT["forge-agentic-coding-cli<br/>extension host"]:::s
512+
TERM[integrated terminals]:::s
513+
WV["webview (iframe)"]:::s
514+
SIDEBAR["activity-bar webview<br/>(stats / tasks / actions)"]:::s
515+
FORGE[forge binary on $PATH]:::s
516+
UISERVER[forge ui server]:::s
517+
DB[(~/.forge/global/index.db)]:::d
518+
519+
EDITOR --> EXT
520+
EXT -->|spawn forge / forge run / forge ui start| TERM
521+
EXT -->|sqlite3 read-only| DB
522+
EXT --> SIDEBAR
523+
EXT --> WV
524+
WV -->|iframe src + ?task=id| UISERVER
525+
TERM --> FORGE
526+
UISERVER --> DB
527+
```
528+
529+
What the extension owns:
530+
531+
- **Activity-bar webview** with status pill, workspace meta, live stats grid, action buttons, recent tasks, and providers. Polls every 4 s when visible.
532+
- **Status-bar item** that flips between *live* and *idle* based on `/api/status` reachability.
533+
- **Commands** for REPL, run-task / run-selection / run-file, dashboard lifecycle, doctor, settings, copy URL, change cwd, kill all.
534+
- **Deep linking** — clicking a recent task opens the dashboard webview with `?task=<id>`, which the SPA picks up at boot and routes straight to the conversation view.
535+
536+
Data sources, in order of preference:
537+
538+
1. The dashboard REST API (`/api/status`, `/api/tasks`, `/api/models`) when `forge ui` is running.
539+
2. The local SQLite index (`$FORGE_HOME/global/index.db`) read in read-only mode via the system `sqlite3` CLI. This is what makes lifetime stats (tokens, calls, task counts) work even with no Forge process running.
540+
541+
The runtime exposes one piece of code specifically for this surface: `src/ui/server.ts → /api/tasks/:id` resolves the task's project automatically (index → projects → cwd fallback chain) so cross-project task detail lookups from the extension don't 404.
542+
543+
Build and publish:
544+
545+
```bash
546+
cd vscode-extension && npm install && npm run build
547+
npx @vscode/vsce package --no-dependencies # produces .vsix
548+
npx @vscode/vsce publish --no-dependencies # marketplace
549+
```
550+
497551
---
498552

499553
## 10. CI/CD pipeline

docs/CLI-REFERENCE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# CLI reference
22

3-
Full surface as of v0.1.0. `forge help <command>` for any sub-command.
3+
Full surface as of v1.0.0. `forge help <command>` for any sub-command.
44

55
## Root
66

hoangsonw-forge-1.0.0.tgz

468 KB
Binary file not shown.

0 commit comments

Comments
 (0)