Skip to content

Commit a7109d9

Browse files
committed
Merge branch 'dev' into feat/expand-paste-summary
Fixes anomalyco#8501
2 parents ab59d1b + 4299450 commit a7109d9

273 files changed

Lines changed: 18204 additions & 9221 deletions

File tree

Some content is hidden

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

‎.github/workflows/nix-desktop.yml‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ on:
99
- "nix/**"
1010
- "packages/app/**"
1111
- "packages/desktop/**"
12+
- ".github/workflows/nix-desktop.yml"
1213
pull_request:
1314
paths:
1415
- "flake.nix"
1516
- "flake.lock"
1617
- "nix/**"
1718
- "packages/app/**"
1819
- "packages/desktop/**"
20+
- ".github/workflows/nix-desktop.yml"
1921
workflow_dispatch:
2022

2123
jobs:
@@ -25,6 +27,8 @@ jobs:
2527
matrix:
2628
os:
2729
- blacksmith-4vcpu-ubuntu-2404
30+
- blacksmith-4vcpu-ubuntu-2404-arm
31+
- macos-15-intel
2832
- macos-latest
2933
runs-on: ${{ matrix.os }}
3034
timeout-minutes: 60
@@ -33,7 +37,7 @@ jobs:
3337
uses: actions/checkout@v6
3438

3539
- name: Setup Nix
36-
uses: DeterminateSystems/nix-installer-action@v21
40+
uses: nixbuild/nix-quick-install-action@v34
3741

3842
- name: Build desktop via flake
3943
run: |

‎.github/workflows/update-nix-hashes.yml‎

Lines changed: 52 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -10,147 +10,103 @@ on:
1010
- "bun.lock"
1111
- "package.json"
1212
- "packages/*/package.json"
13+
- "flake.lock"
14+
- ".github/workflows/update-nix-hashes.yml"
1315
pull_request:
1416
paths:
1517
- "bun.lock"
1618
- "package.json"
1719
- "packages/*/package.json"
20+
- "flake.lock"
21+
- ".github/workflows/update-nix-hashes.yml"
1822

1923
jobs:
20-
update-linux:
24+
update-node-modules-hashes:
2125
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
2226
runs-on: blacksmith-4vcpu-ubuntu-2404
2327
env:
24-
SYSTEM: x86_64-linux
28+
TITLE: node_modules hashes
2529

2630
steps:
2731
- name: Checkout repository
28-
uses: actions/checkout@v4
32+
uses: actions/checkout@v6
2933
with:
3034
token: ${{ secrets.GITHUB_TOKEN }}
3135
fetch-depth: 0
3236
ref: ${{ github.head_ref || github.ref_name }}
3337
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
3438

3539
- name: Setup Nix
36-
uses: DeterminateSystems/nix-installer-action@v20
40+
uses: nixbuild/nix-quick-install-action@v34
3741

3842
- name: Configure git
3943
run: |
4044
git config --global user.email "[email protected]"
4145
git config --global user.name "Github Action"
4246
43-
- name: Update flake.lock
44-
run: |
45-
set -euo pipefail
46-
echo "📦 Updating flake.lock..."
47-
nix flake update
48-
echo "✅ flake.lock updated successfully"
49-
50-
- name: Update node_modules hash for x86_64-linux
51-
run: |
52-
set -euo pipefail
53-
echo "🔄 Updating node_modules hash for x86_64-linux..."
54-
nix/scripts/update-hashes.sh
55-
echo "✅ node_modules hash for x86_64-linux updated successfully"
56-
57-
- name: Commit Linux hash changes
47+
- name: Pull latest changes
5848
env:
5949
TARGET_BRANCH: ${{ github.head_ref || github.ref_name }}
6050
run: |
61-
set -euo pipefail
51+
BRANCH="${TARGET_BRANCH:-${GITHUB_REF_NAME}}"
52+
git pull --rebase --autostash origin "$BRANCH"
6253
63-
echo "🔍 Checking for changes in tracked Nix files..."
54+
- name: Compute all node_modules hashes
55+
run: |
56+
set -euo pipefail
6457
65-
summarize() {
66-
local status="$1"
67-
{
68-
echo "### Nix Hash Update (x86_64-linux)"
69-
echo ""
70-
echo "- ref: ${GITHUB_REF_NAME}"
71-
echo "- status: ${status}"
72-
} >> "$GITHUB_STEP_SUMMARY"
73-
if [ -n "${GITHUB_SERVER_URL:-}" ] && [ -n "${GITHUB_REPOSITORY:-}" ] && [ -n "${GITHUB_RUN_ID:-}" ]; then
74-
echo "- run: ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" >> "$GITHUB_STEP_SUMMARY"
75-
fi
76-
echo "" >> "$GITHUB_STEP_SUMMARY"
77-
}
58+
HASH_FILE="nix/hashes.json"
59+
SYSTEMS="x86_64-linux aarch64-linux x86_64-darwin aarch64-darwin"
7860
79-
FILES=(flake.lock flake.nix nix/node-modules.nix nix/hashes.json)
80-
STATUS="$(git status --short -- "${FILES[@]}" || true)"
81-
if [ -z "$STATUS" ]; then
82-
echo "✅ No changes detected. Hashes are already up to date."
83-
summarize "no changes"
84-
exit 0
61+
if [ ! -f "$HASH_FILE" ]; then
62+
mkdir -p "$(dirname "$HASH_FILE")"
63+
echo '{"nodeModules":{}}' > "$HASH_FILE"
8564
fi
8665
87-
echo "📝 Changes detected:"
88-
echo "$STATUS"
89-
echo "🔗 Staging files..."
90-
git add "${FILES[@]}"
91-
echo "💾 Committing changes..."
92-
git commit -m "Update Nix flake.lock and x86_64-linux hash"
93-
echo "✅ Changes committed"
94-
95-
BRANCH="${TARGET_BRANCH:-${GITHUB_REF_NAME}}"
96-
echo "🌳 Pulling latest from branch: $BRANCH"
97-
git pull --rebase origin "$BRANCH"
98-
echo "🚀 Pushing changes to branch: $BRANCH"
99-
git push origin HEAD:"$BRANCH"
100-
echo "✅ Changes pushed successfully"
66+
for SYSTEM in $SYSTEMS; do
67+
echo "Computing hash for ${SYSTEM}..."
68+
BUILD_LOG=$(mktemp)
69+
trap 'rm -f "$BUILD_LOG"' EXIT
10170
102-
summarize "committed $(git rev-parse --short HEAD)"
71+
# The updater derivations use fakeHash, so they will fail and reveal the correct hash
72+
UPDATER_ATTR=".#packages.x86_64-linux.${SYSTEM}_node_modules"
10373
104-
update-macos:
105-
needs: update-linux
106-
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
107-
runs-on: macos-latest
108-
env:
109-
SYSTEM: aarch64-darwin
74+
nix build "$UPDATER_ATTR" --no-link 2>&1 | tee "$BUILD_LOG" || true
11075
111-
steps:
112-
- name: Checkout repository
113-
uses: actions/checkout@v4
114-
with:
115-
token: ${{ secrets.GITHUB_TOKEN }}
116-
fetch-depth: 0
117-
ref: ${{ github.head_ref || github.ref_name }}
118-
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
76+
CORRECT_HASH="$(grep -E 'got:\s+sha256-[A-Za-z0-9+/=]+' "$BUILD_LOG" | awk '{print $2}' | head -n1 || true)"
11977
120-
- name: Setup Nix
121-
uses: DeterminateSystems/nix-installer-action@v20
78+
if [ -z "$CORRECT_HASH" ]; then
79+
CORRECT_HASH="$(grep -A2 'hash mismatch' "$BUILD_LOG" | grep 'got:' | awk '{print $2}' | sed 's/sha256:/sha256-/' || true)"
80+
fi
12281
123-
- name: Configure git
124-
run: |
125-
git config --global user.email "[email protected]"
126-
git config --global user.name "Github Action"
82+
if [ -z "$CORRECT_HASH" ]; then
83+
echo "Failed to determine correct node_modules hash for ${SYSTEM}."
84+
cat "$BUILD_LOG"
85+
exit 1
86+
fi
12787
128-
- name: Pull latest changes
129-
env:
130-
TARGET_BRANCH: ${{ github.head_ref || github.ref_name }}
131-
run: |
132-
BRANCH="${TARGET_BRANCH:-${GITHUB_REF_NAME}}"
133-
git pull origin "$BRANCH"
88+
echo " ${SYSTEM}: ${CORRECT_HASH}"
89+
jq --arg sys "$SYSTEM" --arg h "$CORRECT_HASH" \
90+
'.nodeModules[$sys] = $h' "$HASH_FILE" > "${HASH_FILE}.tmp"
91+
mv "${HASH_FILE}.tmp" "$HASH_FILE"
92+
done
13493
135-
- name: Update node_modules hash for aarch64-darwin
136-
run: |
137-
set -euo pipefail
138-
echo "🔄 Updating node_modules hash for aarch64-darwin..."
139-
nix/scripts/update-hashes.sh
140-
echo "✅ node_modules hash for aarch64-darwin updated successfully"
94+
echo "All hashes computed:"
95+
cat "$HASH_FILE"
14196
142-
- name: Commit macOS hash changes
97+
- name: Commit ${{ env.TITLE }} changes
14398
env:
14499
TARGET_BRANCH: ${{ github.head_ref || github.ref_name }}
145100
run: |
146101
set -euo pipefail
147102
148-
echo "🔍 Checking for changes in tracked Nix files..."
103+
HASH_FILE="nix/hashes.json"
104+
echo "Checking for changes..."
149105
150106
summarize() {
151107
local status="$1"
152108
{
153-
echo "### Nix Hash Update (aarch64-darwin)"
109+
echo "### Nix $TITLE"
154110
echo ""
155111
echo "- ref: ${GITHUB_REF_NAME}"
156112
echo "- status: ${status}"
@@ -161,27 +117,22 @@ jobs:
161117
echo "" >> "$GITHUB_STEP_SUMMARY"
162118
}
163119
164-
FILES=(nix/hashes.json)
120+
FILES=("$HASH_FILE")
165121
STATUS="$(git status --short -- "${FILES[@]}" || true)"
166122
if [ -z "$STATUS" ]; then
167-
echo "✅ No changes detected. Hash is already up to date."
123+
echo "No changes detected."
168124
summarize "no changes"
169125
exit 0
170126
fi
171127
172-
echo "📝 Changes detected:"
128+
echo "Changes detected:"
173129
echo "$STATUS"
174-
echo "🔗 Staging files..."
175130
git add "${FILES[@]}"
176-
echo "💾 Committing changes..."
177-
git commit -m "Update aarch64-darwin hash"
178-
echo "✅ Changes committed"
131+
git commit -m "Update $TITLE"
179132
180133
BRANCH="${TARGET_BRANCH:-${GITHUB_REF_NAME}}"
181-
echo "🌳 Pulling latest from branch: $BRANCH"
182-
git pull --rebase origin "$BRANCH"
183-
echo "🚀 Pushing changes to branch: $BRANCH"
134+
git pull --rebase --autostash origin "$BRANCH"
184135
git push origin HEAD:"$BRANCH"
185-
echo "✅ Changes pushed successfully"
136+
echo "Changes pushed successfully"
186137
187138
summarize "committed $(git rev-parse --short HEAD)"

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ opencode.json
2020
a.out
2121
target
2222
.scripts
23+
.direnv/
2324

2425
# Local dev files
2526
opencode-dev

‎.opencode/command/ai-deps.md‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
description: "Bump AI sdk dependencies minor / patch versions only"
3+
---
4+
5+
Please read @package.json and @packages/opencode/package.json.
6+
7+
Your job is to look into AI SDK dependencies, figure out if they have versions that can be upgraded (minor or patch versions ONLY no major ignore major changes).
8+
9+
I want a report of every dependency and the version that can be upgraded to.
10+
What would be even better is if you can give me links to the changelog for each dependency, or at least some reference info so I can see what bugs were fixed or new features were added.
11+
12+
Consider using subagents for each dep to save your context window.
13+
14+
Here is a short list of some deps (please be comprehensive tho):
15+
16+
- "ai"
17+
- "@ai-sdk/openai"
18+
- "@ai-sdk/anthropic"
19+
- "@openrouter/ai-sdk-provider"
20+
- etc, etc
21+
22+
DO NOT upgrade the dependencies yet, just make a list of all dependencies and their versions that can be upgraded to minor or patch versions only.
23+
24+
Write up your findings to ai-sdk-updates.md

‎README.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ curl -fsSL https://opencode.ai/install | bash
2626

2727
# Package managers
2828
npm i -g opencode-ai@latest # or bun/pnpm/yarn
29-
scoop bucket add extras; scoop install extras/opencode # Windows
29+
scoop install opencode # Windows
3030
choco install opencode # Windows
3131
brew install anomalyco/tap/opencode # macOS and Linux (recommended, always up to date)
3232
brew install opencode # macOS and Linux (official brew formula, updated less)
@@ -52,6 +52,8 @@ OpenCode is also available as a desktop application. Download directly from the
5252
```bash
5353
# macOS (Homebrew)
5454
brew install --cask opencode-desktop
55+
# Windows (Scoop)
56+
scoop bucket add extras; scoop install extras/opencode-desktop
5557
```
5658

5759
#### Installation Directory

‎README.zh-CN.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ curl -fsSL https://opencode.ai/install | bash
2626

2727
# 软件包管理器
2828
npm i -g opencode-ai@latest # 也可使用 bun/pnpm/yarn
29-
scoop bucket add extras; scoop install extras/opencode # Windows
29+
scoop install opencode # Windows
3030
choco install opencode # Windows
3131
brew install anomalyco/tap/opencode # macOS 和 Linux(推荐,始终保持最新)
3232
brew install opencode # macOS 和 Linux(官方 brew formula,更新频率较低)
@@ -52,6 +52,8 @@ OpenCode 也提供桌面版应用。可直接从 [发布页 (releases page)](htt
5252
```bash
5353
# macOS (Homebrew Cask)
5454
brew install --cask opencode-desktop
55+
# Windows (Scoop)
56+
scoop bucket add extras; scoop install extras/opencode-desktop
5557
```
5658

5759
#### 安装目录

‎README.zh-TW.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ curl -fsSL https://opencode.ai/install | bash
2626

2727
# 套件管理員
2828
npm i -g opencode-ai@latest # 也可使用 bun/pnpm/yarn
29-
scoop bucket add extras; scoop install extras/opencode # Windows
29+
scoop install opencode # Windows
3030
choco install opencode # Windows
3131
brew install anomalyco/tap/opencode # macOS 與 Linux(推薦,始終保持最新)
3232
brew install opencode # macOS 與 Linux(官方 brew formula,更新頻率較低)
@@ -52,6 +52,8 @@ OpenCode 也提供桌面版應用程式。您可以直接從 [發佈頁面 (rele
5252
```bash
5353
# macOS (Homebrew Cask)
5454
brew install --cask opencode-desktop
55+
# Windows (Scoop)
56+
scoop bucket add extras; scoop install extras/opencode-desktop
5557
```
5658

5759
#### 安裝目錄

‎SECURITY.md‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,32 @@
1+
# Security
2+
3+
## Threat Model
4+
5+
### Overview
6+
7+
OpenCode is an AI-powered coding assistant that runs locally on your machine. It provides an agent system with access to powerful tools including shell execution, file operations, and web access.
8+
9+
### No Sandbox
10+
11+
OpenCode does **not** sandbox the agent. The permission system exists as a UX feature to help users stay aware of what actions the agent is taking - it prompts for confirmation before executing commands, writing files, etc. However, it is not designed to provide security isolation.
12+
13+
If you need true isolation, run OpenCode inside a Docker container or VM.
14+
15+
### Server Mode
16+
17+
Server mode is opt-in only. When enabled, set `OPENCODE_SERVER_PASSWORD` to require HTTP Basic Auth. Without this, the server runs unauthenticated (with a warning). It is the end user's responsibility to secure the server - any functionality it provides is not a vulnerability.
18+
19+
### Out of Scope
20+
21+
| Category | Rationale |
22+
| ------------------------------- | ----------------------------------------------------------------------- |
23+
| **Server access when opted-in** | If you enable server mode, API access is expected behavior |
24+
| **Sandbox escapes** | The permission system is not a sandbox (see above) |
25+
| **LLM provider data handling** | Data sent to your configured LLM provider is governed by their policies |
26+
| **MCP server behavior** | External MCP servers you configure are outside our trust boundary |
27+
28+
---
29+
130
# Reporting Security Issues
231

332
We appreciate your efforts to responsibly disclose your findings, and will make every effort to acknowledge your contributions.

0 commit comments

Comments
 (0)