Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
0d555f9
feat: implement acp client PoC
Patrick-Erichsen Nov 22, 2025
85d4985
chore: remove`ANTHROPIC_API_KEY` env
Patrick-Erichsen Nov 23, 2025
b8064b9
auth flow
Patrick-Erichsen Nov 23, 2025
fd694b0
`opencode` -> `forge`
Patrick-Erichsen Nov 23, 2025
ea19bb4
type fixes
Patrick-Erichsen Nov 23, 2025
662aadf
remove opencode ACP agent
Patrick-Erichsen Nov 23, 2025
9dd1d63
fix type errors
Patrick-Erichsen Nov 23, 2025
fcda04e
ACP tool integration
Patrick-Erichsen Nov 24, 2025
8c19497
thinking translation
Patrick-Erichsen Nov 24, 2025
8aa5169
ACP unit + integration tests
Patrick-Erichsen Nov 28, 2025
72f1509
fix types
Patrick-Erichsen Nov 28, 2025
a5fd508
add site
Patrick-Erichsen Nov 29, 2025
7429a23
update OG image
Patrick-Erichsen Nov 29, 2025
0230cda
update og image
Patrick-Erichsen Nov 29, 2025
f7000e9
og image updates
Patrick-Erichsen Nov 29, 2025
093bd8a
mode mgmt
Patrick-Erichsen Nov 30, 2025
a7901a9
agent and mode dialogs
Patrick-Erichsen Nov 30, 2025
207419f
add CLAUDE.md
Patrick-Erichsen Dec 2, 2025
a4f07e7
fix mode cycling
Patrick-Erichsen Dec 3, 2025
5d5a91b
agent switching
Patrick-Erichsen Dec 6, 2025
f906e29
type fixes
Patrick-Erichsen Dec 6, 2025
cf3ae52
--agent and --model updates
Patrick-Erichsen Dec 7, 2025
29d0a66
add --plan-agent flag
Patrick-Erichsen Dec 7, 2025
5e51586
plan mode updates
Patrick-Erichsen Dec 7, 2025
e5c3c2a
fix positional prompt arg
Patrick-Erichsen Dec 8, 2025
3287aac
Fix type errors
Patrick-Erichsen Dec 8, 2025
53da98d
increase agent dialog width
Patrick-Erichsen Dec 9, 2025
2655a24
fix: correctly parse tool call updates
Patrick-Erichsen Dec 9, 2025
45af0af
type check fixes
Patrick-Erichsen Dec 9, 2025
0fad999
feat: add `fast-agent` and `mistral-vibe` agents
Patrick-Erichsen Dec 10, 2025
37e9ef1
type fixes
Patrick-Erichsen Dec 10, 2025
d123676
feat: acp plan translator/tui
Patrick-Erichsen Dec 10, 2025
f44b902
feat: mcp <> acp translation
Patrick-Erichsen Dec 10, 2025
3812230
fix: use `<agentName>` for models cmd
Patrick-Erichsen Dec 12, 2025
d0af1c4
chore: update README and agents list
Patrick-Erichsen Dec 12, 2025
64f7476
Update README.md
Patrick-Erichsen Dec 12, 2025
f979b7e
Update README.md
Patrick-Erichsen Dec 12, 2025
0213670
Update README.md
Patrick-Erichsen Dec 12, 2025
b19c6b1
Update README.md
Patrick-Erichsen Dec 12, 2025
a352e22
feat: add `--plan-agent` and update README
Patrick-Erichsen Dec 13, 2025
ed8fb32
fix: type errors
Patrick-Erichsen Dec 13, 2025
b0ed953
feat: add agent colors and cancel msg
Patrick-Erichsen Dec 15, 2025
719a58b
feat: install/uninstall agent support
Patrick-Erichsen Dec 15, 2025
5801dd0
feat: pre-flight agent check from CLI
Patrick-Erichsen Dec 15, 2025
95e1354
feat: remove `claude` default agent
Patrick-Erichsen Dec 15, 2025
033e7c8
chore: update agent text
Patrick-Erichsen Dec 15, 2025
d8f4bb3
feat: add share feedback
Patrick-Erichsen Dec 16, 2025
e56b1cb
Adding toml support
forsythetony Dec 15, 2025
8ad4436
update TOML files and -h text
Patrick-Erichsen Dec 15, 2025
698b1b6
feat: simplify CLI args
Patrick-Erichsen Dec 15, 2025
7f33a8e
fix type errors
Patrick-Erichsen Dec 15, 2025
498e347
feat: revert to TS define agents
Patrick-Erichsen Dec 16, 2025
f0031c4
feat: configure npm token authentication for publishing
Patrick-Erichsen Dec 16, 2025
db5d4d1
feat: update agent defs
Patrick-Erichsen Dec 16, 2025
e2e6a33
fix: auth and `-p` bugs
Patrick-Erichsen Dec 16, 2025
730dd1a
fix: comment out `--plan-agent`
Patrick-Erichsen Dec 16, 2025
7feda30
fix: type errors
Patrick-Erichsen Dec 16, 2025
9501b0c
chore: update README
Patrick-Erichsen Dec 16, 2025
e26cd35
chore: add demo gif
Patrick-Erichsen Dec 16, 2025
d45d780
chore: update README
Patrick-Erichsen Dec 16, 2025
c05c861
feat: workspaces infra
Patrick-Erichsen Jan 25, 2026
b2d3ed0
feat: workspace delete logic
Patrick-Erichsen Jan 25, 2026
83c193b
feat: `workspace` subcmd
Patrick-Erichsen Jan 26, 2026
f4c7b54
feat: workspace sidebar
Patrick-Erichsen Jan 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
209 changes: 209 additions & 0 deletions .forge/command/sync-upstream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@
---
description: Sync visual UI changes from sst/opencode upstream
---

You are helping sync VISUAL UI improvements from upstream `sst/opencode` into Forge.

## Context

Forge has architecturally diverged from OpenCode:
- **OpenCode**: Uses provider system (`@/provider/provider`) with bundled AI SDKs
- **Forge**: Uses ACP protocol (`@/acp/`) with agent subprocesses

We care about VISUAL improvements (UI, UX, themes, layouts) in `packages/opencode/`.

## Key Principle: Visual Structure vs Data Source

When syncing visual changes that use backend logic:
- ✅ **Keep**: Visual structure, layout, styling, JSX components
- 🔄 **Adapt**: Data-fetching calls (swap OpenCode APIs for Forge/ACP equivalents)

**Example:**
```typescript
// OpenCode version
const sync = useSync()
const tokenUsage = sync.tokenUsage()

// Adapt to Forge - keep the display, swap the data source
const session = useSession() // or wherever Forge stores this
const tokenUsage = session.usage()
```

## Workflow

### Step 1: Fetch and Analyze

```bash
git fetch upstream
git log --oneline --reverse origin/dev..upstream/dev -- packages/opencode/
```

Identify commits that improve visual/UI layer:
- New UI components or improvements
- Theme additions/updates
- Layout/styling changes
- UX improvements (animations, indicators)
- Bug fixes in rendering

### Step 2: Create Summary Report

For EACH relevant visual commit, provide:

1. **Commit hash and title**
2. **PR link** - Extract `(#1234)` → `https://github.com/sst/opencode/pull/1234`
- If no PR: `https://github.com/sst/opencode/commit/<hash>`
3. **Type**: Pure visual OR Visual + backend
4. **Files changed** (TUI/UI focus)
5. **Brief description**

Group commits into **batches of 10** for incremental syncing.

**Format:**
```markdown
## Visual Changes Available from Upstream

Found 27 visual commits. Grouped into 3 batches for incremental syncing.

### Batch 1 (Commits 1-10)

#### 1. [abc123] Add permission indicator to footer
- **PR**: https://github.com/sst/opencode/pull/4813
- **Type**: Pure visual
- **Files**: routes/session/footer.tsx
- **Description**: Visual indicator for permission state

#### 2. [def456] Improve model selection dialog
- **PR**: https://github.com/sst/opencode/pull/5100
- **Type**: Visual + backend
- **Files**: component/dialog-model.tsx
- **Description**: Better filtering UX (uses useSync() - needs adaptation)

... (8 more)

### Batch 2 (Commits 11-20)
...
```

### Step 3: STOP and Wait for Approval

Present the summary and ask: **"Ready to sync Batch 1?"**

DO NOT proceed until user approves.

### Step 4: Sync One Batch at a Time

For the approved batch:

```bash
# Create branch if first batch
git checkout -b sync-upstream-$(date +%Y%m%d)

# Cherry-pick each commit in batch
git cherry-pick <commit-1>
git cherry-pick <commit-2>
...
```

**If conflicts or errors occur:**
- Check for OpenCode-specific imports (`@/provider/provider`)
- Adapt data-fetching to use Forge equivalents
- Keep visual structure, swap data source

### Step 5: Inspect Changes

After cherry-picking the batch, show the user how to inspect:

```bash
# See what files changed in this batch
git diff origin/dev --stat

# See actual changes in specific file
git diff origin/dev -- packages/forge/src/cli/cmd/tui/routes/session/footer.tsx

# See all commits in current branch
git log origin/dev..HEAD --oneline
```

**Verify visually:**
```bash
bun run typecheck # Check for type errors
bun run dev # Launch TUI and inspect visual changes
```

**What to check in the TUI:**
- Do the visual improvements appear?
- Are there any import errors or crashes?
- If backend was adapted, does the data display correctly?

### Step 6: Report Results and Wait

After inspecting, report:
- ✅ Commits successfully cherry-picked
- 🔄 Commits that needed adaptation (and what was changed)
- ❌ Commits that failed (and why)

Then ask: **"Batch 1 complete. Ready for Batch 2?"**

Repeat Steps 3-6 for each batch.

### Step 7: Final Verification

After all batches:
```bash
bun test # Run full test suite
bun run typecheck # Final type check
bun run dev # Full TUI test
```

## Common Adaptations Needed

**Provider/Model APIs:**
```typescript
// OpenCode
import { Provider } from "@/provider/provider"
const sync = useSync()
const providers = sync.providers()

// Forge
import { getAllAgents } from "@/acp/agents"
const agents = getAllAgents()
```

**Dialog Components:**
```typescript
// OpenCode
import { DialogModel } from "@tui/component/dialog-model"

// Forge
import { DialogModels } from "@tui/component/dialog-models"
```

**Session/State:**
```typescript
// OpenCode
const sync = useSync()
const currentModel = sync.currentModel()

// Forge
const local = useLocal()
const currentAgent = local.agent.current()
```

## Instructions

When user runs `/sync-upstream`:

1. Fetch and identify visual commits in `packages/opencode/`
2. Categorize and group into batches of 10
3. Present summary with PR links
4. For each batch:
- Wait for approval
- Cherry-pick commits
- Adapt backend calls if needed
- Show inspection commands
- Verify visually
- Report results
- Wait for next batch approval
5. Final verification after all batches complete

Focus on incremental syncing with verification at each step.
File renamed without changes.
File renamed without changes.
36 changes: 9 additions & 27 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ concurrency: ${{ github.workflow }}-${{ github.ref }}
permissions:
contents: write
packages: write
id-token: write # Required for npm provenance and OIDC authentication

jobs:
publish:
Expand All @@ -33,42 +34,23 @@ jobs:

- run: git fetch --force --tags

- uses: actions/setup-go@v5
with:
go-version: ">=1.24.0"
cache: true
cache-dependency-path: go.sum

- uses: ./.github/actions/setup-bun

- name: Install makepkg
- name: Setup git config
run: |
sudo apt-get update
sudo apt-get install -y pacman-package-manager
- name: Setup SSH for AUR
run: |
mkdir -p ~/.ssh
echo "${{ secrets.AUR_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
git config --global user.email "opencode@sst.dev"
git config --global user.name "opencode"
ssh-keyscan -H aur.archlinux.org >> ~/.ssh/known_hosts || true

- name: Install OpenCode
run: curl -fsSL https://opencode.ai/install | bash
git config --global user.email "forge@forge-agents.dev"
git config --global user.name "forge-bot"

- name: Setup npm auth
- name: Setup npm authentication
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc

- name: Publish
run: |
./script/publish.ts
env:
OPENCODE_BUMP: ${{ inputs.bump }}
OPENCODE_VERSION: ${{ inputs.version }}
OPENCODE_CHANNEL: latest
FORGE_BUMP: ${{ inputs.bump }}
FORGE_VERSION: ${{ inputs.version }}
FORGE_CHANNEL: latest
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.SST_GITHUB_TOKEN }}
AUR_KEY: ${{ secrets.AUR_KEY }}
OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ refs
Session.vim
opencode.json
a.out
packages/sdk/js/.xdg

# Stakpak session files
.stakpak/session*
8 changes: 0 additions & 8 deletions .opencode/command/hello.md

This file was deleted.

11 changes: 11 additions & 0 deletions .vercel/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
> Why do I have a folder named ".vercel" in my project?
The ".vercel" folder is created when you link a directory to a Vercel project.

> What does the "project.json" file contain?
The "project.json" file contains:
- The ID of the Vercel project that you linked ("projectId")
- The ID of the user or team your Vercel project is owned by ("orgId")

> Should I commit the ".vercel" folder?
No, you should not share the ".vercel" folder with anyone.
Upon creation, it will be automatically added to your ".gitignore" file.
1 change: 1 addition & 0 deletions .vercel/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"projectId":"prj_OCAu3jK7Utl4WospfUJXN1Ve6s3F","orgId":"team_3zwZyCiXNxItoSaj4059T8id","projectName":"agate-site"}
47 changes: 0 additions & 47 deletions AGENTS.md

This file was deleted.

1 change: 1 addition & 0 deletions AGENTS.md
Loading