Skip to content

Commit c63899b

Browse files
authored
Merge branch 'sst:dev' into dev
2 parents 242f2f2 + 48f2419 commit c63899b

File tree

636 files changed

+23656
-5732
lines changed

Some content is hidden

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

636 files changed

+23656
-5732
lines changed

.github/workflows/docs-update.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Docs Update
2+
3+
on:
4+
schedule:
5+
- cron: "0 */12 * * *"
6+
workflow_dispatch:
7+
8+
env:
9+
LOOKBACK_HOURS: 4
10+
11+
jobs:
12+
update-docs:
13+
if: github.repository == 'sst/opencode'
14+
runs-on: blacksmith-4vcpu-ubuntu-2404
15+
permissions:
16+
id-token: write
17+
contents: write
18+
pull-requests: write
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0 # Fetch full history to access commits
24+
25+
- name: Setup Bun
26+
uses: ./.github/actions/setup-bun
27+
28+
- name: Get recent commits
29+
id: commits
30+
run: |
31+
COMMITS=$(git log --since="${{ env.LOOKBACK_HOURS }} hours ago" --pretty=format:"- %h %s" 2>/dev/null || echo "")
32+
if [ -z "$COMMITS" ]; then
33+
echo "No commits in the last ${{ env.LOOKBACK_HOURS }} hours"
34+
echo "has_commits=false" >> $GITHUB_OUTPUT
35+
else
36+
echo "has_commits=true" >> $GITHUB_OUTPUT
37+
{
38+
echo "list<<EOF"
39+
echo "$COMMITS"
40+
echo "EOF"
41+
} >> $GITHUB_OUTPUT
42+
fi
43+
44+
- name: Run opencode
45+
if: steps.commits.outputs.has_commits == 'true'
46+
uses: sst/opencode/github@latest
47+
env:
48+
OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }}
49+
with:
50+
model: opencode/gpt-5.2
51+
agent: docs
52+
prompt: |
53+
Review the following commits from the last ${{ env.LOOKBACK_HOURS }} hours and identify any new features that may need documentation.
54+
55+
<recent_commits>
56+
${{ steps.commits.outputs.list }}
57+
</recent_commits>
58+
59+
Steps:
60+
1. For each commit that looks like a new feature or significant change:
61+
- Read the changed files to understand what was added
62+
- Check if the feature is already documented in packages/web/src/content/docs/*
63+
2. If you find undocumented features:
64+
- Update the relevant documentation files in packages/web/src/content/docs/*
65+
- Follow the existing documentation style and structure
66+
- Make sure to document the feature clearly with examples where appropriate
67+
3. If all new features are already documented, report that no updates are needed
68+
4. If you are creating a new documentation file be sure to update packages/web/astro.config.mjs too.
69+
70+
Focus on user-facing features and API changes. Skip internal refactors, bug fixes, and test updates unless they affect user-facing behavior.
71+
Don't feel the need to document every little thing. It is perfectly okay to make 0 changes at all.
72+
Try to keep documentation only for large features or changes that already have a good spot to be documented.

.github/workflows/publish.yml

Lines changed: 46 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,6 @@ jobs:
4141

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

44-
- name: Setup SSH for AUR
45-
if: inputs.bump || inputs.version
46-
run: |
47-
sudo apt-get update
48-
sudo apt-get install -y pacman-package-manager
49-
mkdir -p ~/.ssh
50-
echo "${{ secrets.AUR_KEY }}" > ~/.ssh/id_rsa
51-
chmod 600 ~/.ssh/id_rsa
52-
git config --global user.email "opencode@sst.dev"
53-
git config --global user.name "opencode"
54-
ssh-keyscan -H aur.archlinux.org >> ~/.ssh/known_hosts || true
55-
5644
- name: Install OpenCode
5745
if: inputs.bump || inputs.version
5846
run: bun i -g opencode-ai@1.0.169
@@ -75,19 +63,32 @@ jobs:
7563
node-version: "24"
7664
registry-url: "https://registry.npmjs.org"
7765

66+
- name: Setup Git Identity
67+
run: |
68+
git config --global user.email "opencode@sst.dev"
69+
git config --global user.name "opencode"
70+
git remote set-url origin https://x-access-token:${{ secrets.SST_GITHUB_TOKEN }}@github.com/${{ github.repository }}
71+
7872
- name: Publish
7973
id: publish
80-
run: ./script/publish.ts
74+
run: ./script/publish-start.ts
8175
env:
8276
OPENCODE_BUMP: ${{ inputs.bump }}
8377
OPENCODE_VERSION: ${{ inputs.version }}
8478
OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }}
8579
AUR_KEY: ${{ secrets.AUR_KEY }}
8680
GITHUB_TOKEN: ${{ secrets.SST_GITHUB_TOKEN }}
8781
NPM_CONFIG_PROVENANCE: false
82+
83+
- uses: actions/upload-artifact@v4
84+
with:
85+
name: opencode-cli
86+
path: packages/opencode/dist
87+
8888
outputs:
89-
releaseId: ${{ steps.publish.outputs.releaseId }}
90-
tagName: ${{ steps.publish.outputs.tagName }}
89+
release: ${{ steps.publish.outputs.release }}
90+
tag: ${{ steps.publish.outputs.tag }}
91+
version: ${{ steps.publish.outputs.version }}
9192

9293
publish-tauri:
9394
needs: publish
@@ -104,12 +105,14 @@ jobs:
104105
target: x86_64-pc-windows-msvc
105106
- host: blacksmith-4vcpu-ubuntu-2404
106107
target: x86_64-unknown-linux-gnu
108+
- host: blacksmith-4vcpu-ubuntu-2404-arm
109+
target: aarch64-unknown-linux-gnu
107110
runs-on: ${{ matrix.settings.host }}
108111
steps:
109112
- uses: actions/checkout@v3
110113
with:
111114
fetch-depth: 0
112-
ref: ${{ needs.publish.outputs.tagName }}
115+
ref: ${{ needs.publish.outputs.tag }}
113116

114117
- uses: apple-actions/import-codesign-certs@v2
115118
if: ${{ runner.os == 'macOS' }}
@@ -148,24 +151,22 @@ jobs:
148151

149152
- uses: Swatinem/rust-cache@v2
150153
with:
151-
workspaces: packages/tauri/src-tauri
154+
workspaces: packages/desktop/src-tauri
152155
shared-key: ${{ matrix.settings.target }}
153156

154157
- name: Prepare
155158
run: |
156-
cd packages/tauri
159+
cd packages/desktop
157160
bun ./scripts/prepare.ts
158161
env:
159-
OPENCODE_BUMP: ${{ inputs.bump }}
160-
OPENCODE_VERSION: ${{ inputs.version }}
161-
OPENCODE_CHANNEL: latest
162+
OPENCODE_VERSION: ${{ needs.publish.outputs.version }}
162163
NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }}
163164
GITHUB_TOKEN: ${{ secrets.SST_GITHUB_TOKEN }}
164165
AUR_KEY: ${{ secrets.AUR_KEY }}
165166
OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }}
166167
RUST_TARGET: ${{ matrix.settings.target }}
167168
GH_TOKEN: ${{ github.token }}
168-
OPENCODE_RELEASE_TAG: ${{ needs.publish.outputs.tagName }}
169+
GITHUB_RUN_ID: ${{ github.run_id }}
169170

170171
# Fixes AppImage build issues, can be removed when https://github.com/tauri-apps/tauri/pull/12491 is released
171172
- name: Install tauri-cli from portable appimage branch
@@ -190,28 +191,43 @@ jobs:
190191
APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }}
191192
APPLE_API_KEY_PATH: ${{ runner.temp }}/apple-api-key.p8
192193
with:
193-
projectPath: packages/tauri
194+
projectPath: packages/desktop
194195
uploadWorkflowArtifacts: true
195196
tauriScript: ${{ (contains(matrix.settings.host, 'ubuntu') && 'cargo tauri') || '' }}
196-
args: --target ${{ matrix.settings.target }} --config src-tauri/tauri.prod.conf.json
197+
args: --target ${{ matrix.settings.target }} --config ./src-tauri/tauri.prod.conf.json --verbose
197198
updaterJsonPreferNsis: true
198-
releaseId: ${{ needs.publish.outputs.releaseId }}
199-
tagName: ${{ needs.publish.outputs.tagName }}
199+
releaseId: ${{ needs.publish.outputs.release }}
200+
tagName: ${{ needs.publish.outputs.tag }}
200201
releaseAssetNamePattern: opencode-desktop-[platform]-[arch][ext]
201202
releaseDraft: true
202203

203204
publish-release:
204205
needs:
205206
- publish
206207
- publish-tauri
207-
if: needs.publish.outputs.tagName
208+
if: needs.publish.outputs.tag
208209
runs-on: blacksmith-4vcpu-ubuntu-2404
209210
steps:
210211
- uses: actions/checkout@v3
211212
with:
212213
fetch-depth: 0
213-
ref: ${{ needs.publish.outputs.tagName }}
214+
ref: ${{ needs.publish.outputs.tag }}
215+
216+
- uses: ./.github/actions/setup-bun
217+
218+
- name: Setup SSH for AUR
219+
run: |
220+
sudo apt-get update
221+
sudo apt-get install -y pacman-package-manager
222+
mkdir -p ~/.ssh
223+
echo "${{ secrets.AUR_KEY }}" > ~/.ssh/id_rsa
224+
chmod 600 ~/.ssh/id_rsa
225+
git config --global user.email "opencode@sst.dev"
226+
git config --global user.name "opencode"
227+
ssh-keyscan -H aur.archlinux.org >> ~/.ssh/known_hosts || true
214228
215-
- run: gh release edit ${{ needs.publish.outputs.tagName }} --draft=false
229+
- run: ./script/publish-complete.ts
216230
env:
217-
GH_TOKEN: ${{ github.token }}
231+
OPENCODE_VERSION: ${{ needs.publish.outputs.version }}
232+
AUR_KEY: ${{ secrets.AUR_KEY }}
233+
GITHUB_TOKEN: ${{ secrets.SST_GITHUB_TOKEN }}

.github/workflows/review.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,11 @@ jobs:
6464
Please check all the code changes in this pull request against the style guide, also look for any bugs if they exist. Diffs are important but make sure you read the entire file to get proper context. Make it clear the suggestions are merely suggestions and the human can decide what to do
6565
6666
When critiquing code against the style guide, be sure that the code is ACTUALLY in violation, don't complain about else statements if they already use early returns there. You may complain about excessive nesting though, regardless of else statement usage.
67-
When critiquing code style don't be a zealot, we don't like "let" statements but sometimes they are the simpliest option, if someone does a bunch of nesting with let, they should consider using iife (see packages/opencode/src/util.iife.ts)
67+
When critiquing code style don't be a zealot, we don't like "let" statements but sometimes they are the simplest option, if someone does a bunch of nesting with let, they should consider using iife (see packages/opencode/src/util.iife.ts)
6868
6969
Use the gh cli to create comments on the files for the violations. Try to leave the comment on the exact line number. If you have a suggested fix include it in a suggestion code block.
70+
If you are writing suggested fixes, BE SURE THAT the change you are recommending is actually valid typescript, often I have seen missing closing "}" or other syntax errors.
71+
Generally, write a comment instead of writing suggested change if you can help it.
7072
7173
Command MUST be like this.
7274
\`\`\`

.github/workflows/stale-issues.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: "Auto-close stale issues"
2+
3+
on:
4+
schedule:
5+
- cron: "30 1 * * *" # Daily at 1:30 AM
6+
workflow_dispatch:
7+
8+
env:
9+
DAYS_BEFORE_STALE: 90
10+
DAYS_BEFORE_CLOSE: 7
11+
12+
jobs:
13+
stale:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
issues: write
17+
steps:
18+
- uses: actions/stale@v10
19+
with:
20+
days-before-stale: ${{ env.DAYS_BEFORE_STALE }}
21+
days-before-close: ${{ env.DAYS_BEFORE_CLOSE }}
22+
stale-issue-label: "stale"
23+
close-issue-message: |
24+
[automated] Closing due to ${{ env.DAYS_BEFORE_STALE }}+ days of inactivity.
25+
26+
Feel free to reopen if you still need this!
27+
stale-issue-message: |
28+
[automated] This issue has had no activity for ${{ env.DAYS_BEFORE_STALE }} days.
29+
30+
It will be closed in ${{ env.DAYS_BEFORE_CLOSE }} days if there's no new activity.
31+
remove-stale-when-updated: true
32+
exempt-issue-labels: "pinned,security,feature-request,on-hold"
33+
start-date: "2025-12-27"

.github/workflows/stats.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ on:
55
- cron: "0 12 * * *" # Run daily at 12:00 UTC
66
workflow_dispatch: # Allow manual trigger
77

8+
concurrency: ${{ github.workflow }}-${{ github.ref }}
9+
810
jobs:
911
stats:
12+
if: github.repository == 'sst/opencode'
1013
runs-on: blacksmith-4vcpu-ubuntu-2404
1114
permissions:
1215
contents: write

.github/workflows/sync-zed-extension.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ name: "sync-zed-extension"
22

33
on:
44
workflow_dispatch:
5-
# release:
6-
# types: [published]
5+
release:
6+
types: [published]
77

88
jobs:
99
zed:
@@ -31,4 +31,5 @@ jobs:
3131
run: |
3232
./script/sync-zed.ts ${{ steps.get_tag.outputs.tag }}
3333
env:
34-
GITHUB_TOKEN: ${{ secrets.SST_GITHUB_TOKEN }}
34+
ZED_EXTENSIONS_PAT: ${{ secrets.ZED_EXTENSIONS_PAT }}
35+
ZED_PR_PAT: ${{ secrets.ZED_PR_PAT }}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,7 @@ opencode.json
2020
a.out
2121
target
2222
.scripts
23+
24+
# Local dev files
25+
opencode-dev
26+
logs/

.opencode/agent/docs.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
---
22
description: ALWAYS use this when writing docs
3+
color: "#38A3EE"
34
---
45

56
You are an expert technical documentation writer
67

78
You are not verbose
89

10+
Use a relaxed and friendly tone
11+
912
The title of the page should be a word or a 2-3 word phrase
1013

1114
The description should be one short line, should not start with "The", should

.opencode/agent/triage.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
mode: primary
33
hidden: true
44
model: opencode/claude-haiku-4-5
5+
color: "#44BA81"
56
tools:
67
"*": false
78
"github-triage": true
@@ -63,8 +64,6 @@ TUI issues potentially caused by our underlying TUI library:
6364

6465
**Do not** add for general TUI bugs.
6566

66-
---
67-
6867
When assigning to people here are the following rules:
6968

7069
adamdotdev:
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
name: test-skill
3+
description: use this when asked to test skill
4+
---
5+
6+
woah this is a test skill

0 commit comments

Comments
 (0)