Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
220 commits
Select commit Hold shift + click to select a range
86e04d4
revert(tui): downgrade opentui to 0.4.3 (#37582)
opencode-agent[bot] Jul 18, 2026
3476e6b
chore: update nix node_modules hashes
opencode-agent[bot] Jul 18, 2026
901c9e7
fix(app): disable unavailable file navigation (#37595)
opencode-agent[bot] Jul 18, 2026
fab2133
chore: configure trust center domain (#36910)
opencode-agent[bot] Jul 18, 2026
9da9ed9
fix(nix): relax Bun version check for desktop build (#36767)
jerome-benoit Jul 18, 2026
b95fe7b
fix(nix): restore desktop integration (#37197)
jerome-benoit Jul 18, 2026
ba3f966
build: bump opentui to 0.4.5 (#37616)
simonklee Jul 18, 2026
b8142c7
chore: update nix node_modules hashes
opencode-agent[bot] Jul 18, 2026
cc34084
feat(desktop): prevent overlapping composer borders (#37490)
usrnk1 Jul 19, 2026
6bea0f4
zen: grok 4.5 adjusted price
fwang Jul 19, 2026
1221bbb
Merge branch 'dev' of github.com:anomalyco/opencode into dev
fwang Jul 19, 2026
573ac85
feat(desktop): align new session project picker (#37461)
usrnk1 Jul 19, 2026
6a28842
go: support openai route
fwang Jul 19, 2026
5a5117b
Merge branch 'dev' of github.com:anomalyco/opencode into dev
fwang Jul 19, 2026
4817228
docs(go): update Kimi K3 request estimates (#37725)
opencode-agent[bot] Jul 19, 2026
f557328
chore: generate
opencode-agent[bot] Jul 19, 2026
78587c1
fix(app): restore question pager segments (#37575)
opencode-agent[bot] Jul 19, 2026
67caf89
fix(opencode): increase OpenAI header timeout (#37770)
opencode-agent[bot] Jul 19, 2026
7985c20
fix(app): show keybind tooltips on prompt input controls (#37824)
ProdigyRahul Jul 20, 2026
ba4b8e2
feat(app): toggle debug tools from dev badge (#36689)
iamdavidhill Jul 20, 2026
2a097f3
fix(llm): expand context overflow patterns (#37840)
opencode-agent[bot] Jul 20, 2026
61653a2
sync
fwang Jul 20, 2026
cfa134f
Merge branch 'dev' of github.com:anomalyco/opencode into dev
fwang Jul 20, 2026
cd46f22
sync
fwang Jul 20, 2026
20a3a21
feat(opencode): use adaptive thinking effort for kimi family on anthr…
chouqin Jul 20, 2026
3b719ab
chore: generate
opencode-agent[bot] Jul 20, 2026
5586f96
fix(app): restore model variant accessibility (#37857)
opencode-agent[bot] Jul 20, 2026
3fc5af6
feat(app): update settings description line height (#37759)
arvsrn Jul 20, 2026
3ba3954
feat(app): review panel improvements (#36716)
arvsrn Jul 20, 2026
9105f35
chore: generate
opencode-agent[bot] Jul 20, 2026
a19b52e
fix(app): omit empty prompt text parts (#37577)
opencode-agent[bot] Jul 20, 2026
4a81e83
fix(app): gate notification server selection (#37890)
opencode-agent[bot] Jul 20, 2026
8bec40a
fix(app): align Windows upgrade drawer (#37895)
Hona Jul 20, 2026
5542415
fix(app): shrink Windows drawer close button (#37909)
Hona Jul 20, 2026
cc3615b
fix(app): tolerate missing message parents (#37918)
opencode-agent[bot] Jul 20, 2026
e2531df
chore(app): bump ghostty-web (#37923)
Hona Jul 20, 2026
b67fda1
chore: update nix node_modules hashes
opencode-agent[bot] Jul 20, 2026
43e472b
feat(app): sync embedded terminal theme (#37931)
Hona Jul 20, 2026
70535a1
chore: update nix node_modules hashes
opencode-agent[bot] Jul 20, 2026
da312b0
fix(app): preserve command menu drafts (#37942)
opencode-agent[bot] Jul 20, 2026
47fc6f2
fix(app): preserve mentions during paste (#37940)
opencode-agent[bot] Jul 20, 2026
4872c48
fix(app): complete mentions at cursor (#37941)
opencode-agent[bot] Jul 20, 2026
96ff82a
fix(console): remove desktop promo overlay
opencode-agent[bot] Jul 20, 2026
d36a2d8
sync release versions for v1.18.4
Jul 20, 2026
4cc0224
fix(opencode): display proper session import errors (#36258)
OpeOginni Jul 20, 2026
5a8ee27
fix(provider): update muse-spark reasoning default and system prompt …
mreso Jul 20, 2026
3033afb
fix(provider): normalize Mistral family tool call IDs (#37982)
rekram1-node Jul 20, 2026
849c259
docs: generalize session title model description (#37986)
rekram1-node Jul 20, 2026
2d2339d
feat(app): draggable project rows (#38055)
arvsrn Jul 21, 2026
cb562b2
chore: generate
opencode-agent[bot] Jul 21, 2026
abc4b83
Zen: gemini 3.6 flash and 3.5 flash lite
fwang Jul 21, 2026
21c4c93
fix(ui): improve progress circle contrast (#38101)
dbpolito Jul 21, 2026
b513faf
fix(app): support nested slash command autocomplete (#38097)
dbpolito Jul 21, 2026
5f241f1
chore: generate
opencode-agent[bot] Jul 21, 2026
0317531
zen: add laguna-2-2.1
fwang Jul 21, 2026
c40e3e7
zen: add security check
fwang Jul 21, 2026
76ced54
chore: generate
opencode-agent[bot] Jul 21, 2026
4438f69
zen: add security check
fwang Jul 21, 2026
130038e
fix(app): defer unavailable notification state (#38186)
opencode-agent[bot] Jul 22, 2026
c9db6e9
fix(app): show running shell command (#38080)
opencode-agent[bot] Jul 22, 2026
0a601cf
fix(docs): correct Kimi K2.7 Code request limits (#38248)
MrMushrooooom Jul 22, 2026
50eee1f
fix(provider): correct MiniMax M3 thinking variants (#38330)
rekram1-node Jul 22, 2026
411eff7
feat(go): add Hy3 to Go model lineup (#38349)
MrMushrooooom Jul 22, 2026
542ba88
fix(provider): select prompt cache keys by SDK (#38424)
rekram1-node Jul 23, 2026
fada1a5
fix(provider): serialize Mistral prompt cache keys (#38448)
rekram1-node Jul 23, 2026
92cede0
chore: update nix node_modules hashes
opencode-agent[bot] Jul 23, 2026
e45210c
chore(app): vendor v2 promise client (#38467)
Brendonovich Jul 23, 2026
84c79c1
chore: update nix node_modules hashes
opencode-agent[bot] Jul 23, 2026
d03e0c5
feat(app): add dual-server compatibility (#38462)
Brendonovich Jul 23, 2026
347510a
chore: generate
opencode-agent[bot] Jul 23, 2026
e59ba24
feat(app): support current event transport (#38464)
Brendonovich Jul 23, 2026
62e4641
chore: generate
opencode-agent[bot] Jul 23, 2026
20589d6
fix(provider): preserve Mistral reasoning history (#38453)
rekram1-node Jul 23, 2026
743f641
chore: update nix node_modules hashes
opencode-agent[bot] Jul 23, 2026
204f48d
docs(zen): add Ling 3.0 Flash free model (#38503)
MrMushrooooom Jul 24, 2026
37c263e
feat(app): project current server state (#38459)
Brendonovich Jul 24, 2026
adba484
chore: generate
opencode-agent[bot] Jul 24, 2026
db88c42
fix(app): hydrate v1 session progress (#38606)
Brendonovich Jul 24, 2026
ce9a875
feat(app): render current session timeline (#38466)
Brendonovich Jul 24, 2026
090a26a
chore: generate
opencode-agent[bot] Jul 24, 2026
29af2e3
feat(app): migrate session interactions (#38461)
Brendonovich Jul 24, 2026
386afb7
chore: generate
opencode-agent[bot] Jul 24, 2026
589ef16
refactor(app): split home view controllers (#38607)
Brendonovich Jul 24, 2026
5ce89dc
chore: generate
opencode-agent[bot] Jul 24, 2026
d07323e
feat(app): migrate discovery workflows (#38465)
Brendonovich Jul 24, 2026
2ea4bb7
chore: generate
opencode-agent[bot] Jul 24, 2026
a48912c
fix(app): restore directory-scoped session status for v1 servers (#38…
Brendonovich Jul 24, 2026
55f4a26
fix(app): preserve paginated timeline order (#38641)
Brendonovich Jul 24, 2026
3819848
feat(app): support current review data (#38460)
Brendonovich Jul 24, 2026
bce2992
chore: generate
opencode-agent[bot] Jul 24, 2026
ce7f54d
fix(app): make prompt input agent toggle reactive (#38653)
Brendonovich Jul 24, 2026
57ddfeb
fix(app): classify existing web profiles for layout transition (#38117)
dleopold Jul 24, 2026
c4545ab
chore: generate
opencode-agent[bot] Jul 24, 2026
91ed256
refactor(app): resolve server protocol state (#38648)
Brendonovich Jul 24, 2026
80a4fe8
fix(app): remove diff rendering from file-specific tabs (#38662)
Brendonovich Jul 24, 2026
3337495
chore: generate
opencode-agent[bot] Jul 24, 2026
aaa42fe
fix(app): isolate v2 servers from legacy layout (#38649)
Brendonovich Jul 24, 2026
67a0478
fix(app): gate config permission auto-accept (#38650)
Brendonovich Jul 24, 2026
ad78ef5
feat(app): support current pty transport (#38463)
Brendonovich Jul 24, 2026
ae4be98
chore: generate
opencode-agent[bot] Jul 24, 2026
b628066
fix(app): preserve inline file mentions (#38663)
Brendonovich Jul 24, 2026
9ba82a1
fix(app): gate legacy server features (#38651)
Brendonovich Jul 24, 2026
66495a2
chore: generate
opencode-agent[bot] Jul 24, 2026
909db63
fix(app): restore optimistic timeline state (#38693)
Brendonovich Jul 24, 2026
e639969
fix(opencode): preserve grep symlink paths (#38581)
remixz Jul 24, 2026
f516651
fix(opencode): preserve grep symlink paths (#38581)
remixz Jul 24, 2026
e62b09e
zen: opus 5
fwang Jul 24, 2026
553b42f
Merge branch 'dev' of github.com:anomalyco/opencode into dev
fwang Jul 24, 2026
4b19ea2
fix(llm): preserve response message phases (#38452)
rekram1-node Jul 24, 2026
53669ca
chore: generate
opencode-agent[bot] Jul 24, 2026
7840562
fix(llm): revert response message phases (#38761)
rekram1-node Jul 24, 2026
2b2aacc
fix(provider): generalize Claude adaptive thinking (#38757)
rekram1-node Jul 24, 2026
a85d8d2
sync release versions for v1.18.5
Jul 24, 2026
065dc27
fix(core): branch-keyed repository cache with gated reference readine…
kitlangton Jul 25, 2026
5e2a625
chore: generate
opencode-agent[bot] Jul 25, 2026
9e8b217
fix(app): refresh V1 providers after auth (#38786)
opencode-agent[bot] Jul 25, 2026
2b2b69d
fix(app): refresh V1 MCP state (#38816)
Brendonovich Jul 25, 2026
0a6637e
chore(app): vendor v2 client snapshot (#38818)
Brendonovich Jul 25, 2026
7534d23
chore: update nix node_modules hashes
opencode-agent[bot] Jul 25, 2026
7d8195e
fix(ui): keep mutable selects open (#39027)
ProdigyRahul Jul 27, 2026
1ad63cf
sync release versions for v1.18.6
Jul 27, 2026
759f6af
fix(app): add scroll to project selector dropdown (#39016)
david1gp Jul 27, 2026
7ffc22c
chore: generate
opencode-agent[bot] Jul 27, 2026
9ca2b44
Connect provider e2e test (#39039)
Brendonovich Jul 27, 2026
de78da8
chore: generate
opencode-agent[bot] Jul 27, 2026
09afffe
fix(app): preserve shadowed command owners (#39044)
Brendonovich Jul 27, 2026
a9afed0
fix(desktop): remove titlebar inset in fullscreen (#38793)
Hona Jul 27, 2026
35075bb
fix(desktop): install Electron before development (#39052)
Hona Jul 27, 2026
bc2d3df
sync release versions for v1.18.7
Jul 27, 2026
b06768a
feat(app): add project selector shortcut (#39074)
Brendonovich Jul 27, 2026
4469cec
refactor(app): move prompt effects into controller (#39073)
Brendonovich Jul 27, 2026
0b4edfc
chore: generate
opencode-agent[bot] Jul 27, 2026
e1c4194
refactor(app): extract tab rename adapter (#39079)
Brendonovich Jul 27, 2026
4f62295
fix(app): contain right panel suspense (#39080)
Brendonovich Jul 27, 2026
55b0211
feat(desktop): use bg layer 4 for v2 switch (#39085)
usrnk1 Jul 27, 2026
78f5764
fix(console): stabilize brand download icons in Safari (#39151)
opencode-agent[bot] Jul 27, 2026
a9bebd3
docs(zen): add Kimi K3 (#39152)
MrMushrooooom Jul 27, 2026
8e8d38c
fix(app): prevent freeze when closing projects (#39158)
Brendonovich Jul 27, 2026
8dc539b
fix(core): correct MCP environment field in built-in skill (#39175)
OpeOginni Jul 27, 2026
40e4d73
fix(console): avoid Safari brand icon repaint (#39154)
opencode-agent[bot] Jul 27, 2026
7ae1be5
fix(desktop): use channel database in local runs (#39209)
Hona Jul 28, 2026
1274408
fix(desktop): install AppStream metainfo in Linux packages (#36872)
develop7 Jul 28, 2026
91508f6
chore: generate
opencode-agent[bot] Jul 28, 2026
c39ad38
fix(app): refresh global provider state (#39220)
Brendonovich Jul 28, 2026
970c382
chore: generate
opencode-agent[bot] Jul 28, 2026
284e970
fix(app): use blue for server status attention (#39217)
Brendonovich Jul 28, 2026
029f5aa
chore: bump gitlab-ai-provider to 6.12.0 (#39096)
vglafirov Jul 28, 2026
b72d7b6
refactor(app): separate model selector controller and view (#39084)
Brendonovich Jul 28, 2026
3cc7016
chore: generate
opencode-agent[bot] Jul 28, 2026
3f9dad3
chore: update nix node_modules hashes
opencode-agent[bot] Jul 28, 2026
237e694
fix(app): expand Windows file tree folders (#39249)
opencode-agent[bot] Jul 28, 2026
87db7a7
fix(app): follow visual tab order (#39241)
Brendonovich Jul 28, 2026
9c8060d
refactor(app): extract keybind settings controller (#39226)
Brendonovich Jul 28, 2026
921b1c6
feat(mcp): upgrade client SDK to v2 (#39247)
rekram1-node Jul 28, 2026
d50b9e8
chore: generate
opencode-agent[bot] Jul 28, 2026
5e39051
fix(provider): omit deprecated Gemini sampling defaults (#38924)
opencode-agent[bot] Jul 28, 2026
172d08c
chore: update nix node_modules hashes
opencode-agent[bot] Jul 28, 2026
c3be6c4
fix(mcp): honor callback port in debug (#39259)
rekram1-node Jul 28, 2026
484f00e
fix(mcp): recover expired SDK sessions (#39265)
rekram1-node Jul 28, 2026
c8487ba
chore: update nix node_modules hashes
opencode-agent[bot] Jul 28, 2026
8021dbd
sync release versions for v1.18.8
Jul 28, 2026
d46be56
refactor(app): thin new session composition (#39227)
Brendonovich Jul 28, 2026
7dae9a1
chore: generate
opencode-agent[bot] Jul 28, 2026
95636bd
feat(desktop): collapse model provider sections (#39283)
usrnk1 Jul 28, 2026
8c81f9a
refactor(app): extract v2 settings controllers (#39228)
Brendonovich Jul 28, 2026
1ead8d8
fix(app): localize home session suspense (#39285)
Brendonovich Jul 28, 2026
9e432a6
feat(desktop): add opt-in v2 sidecar (#39286)
Brendonovich Jul 28, 2026
7c89824
fix(desktop): patch @dnd-kit/solid to preserve core scroll plugins (#…
roborew Jul 28, 2026
be93cec
fix(app): guard reentrant Solid cleanup (#39261)
opencode-agent[bot] Jul 28, 2026
e158758
chore: generate
opencode-agent[bot] Jul 28, 2026
7336cc5
chore: update nix node_modules hashes
opencode-agent[bot] Jul 28, 2026
017a597
feat(desktop): remove v2 vertical menu borders (#39317)
usrnk1 Jul 28, 2026
7edefb3
chore(mcp): upgrade client to 2.0.0 (#39369)
opencode-agent[bot] Jul 28, 2026
982a904
fix(mcp): restore legacy SDK compatibility (#39373)
rekram1-node Jul 28, 2026
d8a9d8a
chore: generate
opencode-agent[bot] Jul 28, 2026
f28d72d
chore: update nix node_modules hashes
opencode-agent[bot] Jul 28, 2026
a45c2b9
sync release versions for v1.18.9
Jul 28, 2026
f256a4c
fix(app): preserve agent picker for existing users (#39300)
Brendonovich Jul 29, 2026
8cbea4f
chore: generate
opencode-agent[bot] Jul 29, 2026
e8b0992
fix(app): defer model variant selector (#39445)
Brendonovich Jul 29, 2026
035a5a1
feat(desktop): refine tab states (#39472)
usrnk1 Jul 29, 2026
7565e03
chore: generate
opencode-agent[bot] Jul 29, 2026
02f50a6
chore: bump gitlab-ai-provider to 6.12.1 (#39490)
vglafirov Jul 29, 2026
a6f7fe7
docs(ecosystem): add opencode-tavily plugin (#38709)
lakshyaag-tavily Jul 29, 2026
1e17856
chore: update nix node_modules hashes
opencode-agent[bot] Jul 29, 2026
341c64c
feat: discover Modal models (#39066)
devennavani Jul 30, 2026
f720490
fix(console): add public fetch compatibility flag
fwang Jul 30, 2026
73009f0
feat(app): update arrow buttons in review tab top bar (#39469)
arvsrn Jul 30, 2026
a9eda2e
feat(app): migrate to solid-sonner (#39519)
arvsrn Jul 30, 2026
5b11635
feat(app): always show new session button (#39520)
arvsrn Jul 30, 2026
eca5e68
feat(app): disallow duplicate attachments (#39464)
arvsrn Jul 30, 2026
005bf08
feat(app): fix file tree button bg (#38629)
arvsrn Jul 30, 2026
a277557
chore: generate
opencode-agent[bot] Jul 30, 2026
3dbce3d
feat(app): adds fades to file tree (#38549)
arvsrn Jul 30, 2026
c5cf416
feat(app): fix composer attachment fades (#38547)
arvsrn Jul 30, 2026
c08350b
chore: update nix node_modules hashes
opencode-agent[bot] Jul 30, 2026
ac53806
fix(app): repair malformed persisted tabs (#39645)
OpeOginni Jul 30, 2026
ff0382e
chore: generate
opencode-agent[bot] Jul 30, 2026
a4f25a9
fix: use OpenCode model catalog URL (#39672)
opencode-agent[bot] Jul 30, 2026
8c38d26
sync release versions for v1.18.10
Jul 30, 2026
a1ab489
fix(provider): widen interleaved reasoning fields (#39556)
opencode-agent[bot] Jul 30, 2026
c1ee3c6
fix(opencode): stop MCP SSE error reconnect loops (#39697)
rekram1-node Jul 30, 2026
3f239b3
chore: update nix node_modules hashes
opencode-agent[bot] Jul 30, 2026
ceb4890
docs: add Modal provider setup (#39710)
devennavani Jul 30, 2026
e024e2e
fix(app): align debug gutter text (#39782)
Hona Jul 31, 2026
7ea343c
fix(app): prevent file tree tab clipping (#39770)
OpeOginni Jul 31, 2026
d3f30df
fix(app): open legacy picker at home (#39804)
opencode-agent[bot] Jul 31, 2026
db4dbaa
fix(app): prevent stale session tab reads (#39767)
OpeOginni Jul 31, 2026
da59457
feat(go): add GPT 5.6 Luna content (#39812)
MrMushrooooom Jul 31, 2026
2039c90
fix(desktop): open external links in system browser (#39820)
Hona Jul 31, 2026
d4ad650
chore: generate
opencode-agent[bot] Jul 31, 2026
ad82616
chore: update nix node_modules hashes
opencode-agent[bot] Jul 31, 2026
2df47ee
deepseek v4 flash
fwang Jul 31, 2026
14f0bf6
chore: generate
opencode-agent[bot] Jul 31, 2026
4087cf1
fix(go): restore limits graph axis (#39870)
MrMushrooooom Jul 31, 2026
e4bd975
chore: generate
opencode-agent[bot] Jul 31, 2026
d80e86b
go: document data policy per model
fwang Jul 31, 2026
d0a7ca6
go: document data policy per model
fwang Jul 31, 2026
19231fc
chore: generate
opencode-agent[bot] Jul 31, 2026
8e265ee
Merge remote-tracking branch 'upstream/dev' into sync/upstream-2026-0…
Aug 1, 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
  •  
  •  
  •  
100 changes: 58 additions & 42 deletions bun.lock

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions infra/console.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,12 @@ new sst.cloudflare.x.SolidStart("Console", {
server: {
placement: { region: "aws:us-east-2" },
transform: {
worker: {
tailConsumers: [{ service: logProcessor.nodes.worker.scriptName }],
worker: (args) => {
args.compatibilityFlags = $resolve(args.compatibilityFlags).apply((flags) => [
...(flags ?? []),
"global_fetch_strictly_public",
])
args.tailConsumers = [{ service: logProcessor.nodes.worker.scriptName }]
},
},
},
Expand Down
19 changes: 19 additions & 0 deletions infra/stage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,25 @@ export const zoneID = "430ba34c138cfb5360826c4909f99be8"
export const awsStage = $app.stage === "production" ? "production" : "dev"
export const deployAws = $app.stage === awsStage

if ($app.stage === "production") {
new cloudflare.DnsRecord("TrustCenter", {
zoneId: zoneID,
name: "trust.opencode.ai",
type: "CNAME",
content: "3a69a5bb27875189.vercel-dns-016.com",
proxied: false,
ttl: 60,
})

new cloudflare.DnsRecord("TrustCenterVerification", {
zoneId: zoneID,
name: "opencode.ai",
type: "TXT",
content: "compai-domain-verification=org_6993a99c6200a2d642bb115d",
ttl: 60,
})
}

new cloudflare.RegionalHostname("RegionalHostname", {
hostname: domain,
regionKey: "us",
Expand Down
99 changes: 66 additions & 33 deletions nix/desktop.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
makeWrapper,
writableTmpDirAsHomeHook,
autoPatchelfHook,
copyDesktopItems,
makeDesktopItem,
opencode,
}:
let
Expand All @@ -27,9 +29,12 @@ stdenv.mkDerivation (finalAttrs: {
nodejs
makeWrapper
writableTmpDirAsHomeHook
] ++ lib.optionals stdenv.hostPlatform.isLinux [
]
++ lib.optionals stdenv.hostPlatform.isLinux [
autoPatchelfHook
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
copyDesktopItems
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
# Ad-hoc sign the .app: --config.mac.identity=null below skips signing.
darwin.autoSignDarwinBinariesHook
];
Expand All @@ -38,20 +43,37 @@ stdenv.mkDerivation (finalAttrs: {
(lib.getLib stdenv.cc.cc)
];

desktopItems = lib.optional stdenv.hostPlatform.isLinux (makeDesktopItem {
name = "ai.opencode.desktop";
desktopName = "OpenCode";
exec = "opencode-desktop %U";
icon = "ai.opencode.desktop";
# Electron 41 derives X11 WM_CLASS from app.name.
startupWMClass = "OpenCode";
categories = [ "Development" ];
});

env = opencode.env // {
ELECTRON_SKIP_BINARY_DOWNLOAD = "1";
};

# https://github.com/electron/electron/issues/31121
# mac builds use a .app bundle which doesnt have this issue
postPatch = lib.optionalString stdenv.isLinux ''
BASE_PATH=packages/desktop
FILES=(src/main/windows.ts)
for file in "''${FILES[@]}"; do
substituteInPlace $BASE_PATH/$file \
--replace-fail "process.resourcesPath" "'$out/opt/opencode-desktop/resources'"
done
'';
postPatch =
# NOTE: Relax Bun version check to be a warning instead of an error
''
substituteInPlace packages/script/src/index.ts \
--replace-fail 'throw new Error(`This script requires bun@''${expectedBunVersionRange}' \
'console.warn(`Warning: This script requires bun@''${expectedBunVersionRange}'
''
# https://github.com/electron/electron/issues/31121
# mac builds use a .app bundle which doesnt have this issue
+ lib.optionalString stdenv.isLinux ''
BASE_PATH=packages/desktop
FILES=(src/main/windows.ts)
for file in "''${FILES[@]}"; do
substituteInPlace $BASE_PATH/$file \
--replace-fail "process.resourcesPath" "'$out/opt/opencode-desktop/resources'"
done
'';

preBuild = ''
cp -r "${electron.dist}" $HOME/.electron-dist
Expand All @@ -76,27 +98,38 @@ stdenv.mkDerivation (finalAttrs: {
runHook postBuild
'';

installPhase =
''
runHook preInstall
''
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
mkdir -p $out/Applications
mv dist/mac*/*.app $out/Applications
makeWrapper "$out/Applications/OpenCode.app/Contents/MacOS/OpenCode" $out/bin/opencode-desktop
''
+ lib.optionalString stdenv.hostPlatform.isLinux ''
mkdir -p $out/opt/opencode-desktop
cp -r dist/linux*-unpacked/{resources,LICENSE*} $out/opt/opencode-desktop
makeWrapper ${lib.getExe electron} $out/bin/opencode-desktop \
--inherit-argv0 \
--set ELECTRON_FORCE_IS_PACKAGED 1 \
--add-flags $out/opt/opencode-desktop/resources/app.asar \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}"
''
+ ''
runHook postInstall
'';
installPhase = ''
runHook preInstall
''
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
mkdir -p $out/Applications
mv dist/mac*/*.app $out/Applications
makeWrapper "$out/Applications/OpenCode.app/Contents/MacOS/OpenCode" $out/bin/opencode-desktop
''
+ lib.optionalString stdenv.hostPlatform.isLinux ''
mkdir -p $out/opt/opencode-desktop
cp -r dist/linux*-unpacked/{resources,LICENSE*} $out/opt/opencode-desktop
install -Dm644 resources/icons/32x32.png \
"$out/share/icons/hicolor/32x32/apps/ai.opencode.desktop.png"
install -Dm644 resources/icons/64x64.png \
"$out/share/icons/hicolor/64x64/apps/ai.opencode.desktop.png"
install -Dm644 resources/icons/128x128.png \
"$out/share/icons/hicolor/128x128/apps/ai.opencode.desktop.png"
install -Dm644 resources/icons/128x128@2x.png \
"$out/share/icons/hicolor/256x256/apps/ai.opencode.desktop.png"
install -Dm644 resources/icons/icon.png \
"$out/share/icons/hicolor/512x512/apps/ai.opencode.desktop.png"
install -Dm644 resources/ai.opencode.desktop.metainfo.xml \
"$out/share/metainfo/ai.opencode.desktop.metainfo.xml"
makeWrapper ${lib.getExe electron} $out/bin/opencode-desktop \
--inherit-argv0 \
--set ELECTRON_FORCE_IS_PACKAGED 1 \
--add-flags $out/opt/opencode-desktop/resources/app.asar \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}"
''
+ ''
runHook postInstall
'';

autoPatchelfIgnoreMissingDeps = [
"libc.musl-x86_64.so.1"
Expand Down
8 changes: 4 additions & 4 deletions nix/hashes.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"nodeModules": {
"x86_64-linux": "sha256-zAftZieWR0hWQQVkhEa826iueHaRnKxtyRodhNb+Apc=",
"aarch64-linux": "sha256-cTG+gB7CuiFgaYHSFbzXaXUI1C2kiugV3B9rUDRUwlg=",
"aarch64-darwin": "sha256-ap4Xv5ZliourkI4mcD0ktbzSI88jb4oVBv5mMK3WdUs=",
"x86_64-darwin": "sha256-NGRJMMnaMNrf3FkcYwr5PcfVm5thhlNLGIeMmAK0MeE="
"x86_64-linux": "sha256-SiJd6uXrL/MqqFGN/uUcHh0Wzdlafnpx++VZa5gUCoE=",
"aarch64-linux": "sha256-pKcT34NYIHVasraRTx0ASTzyuFuIzBTxXg6+KSKvTps=",
"aarch64-darwin": "sha256-hzrym0KpiyYAv80eT/DjcSIJWYBUq4QDgDf6Wtot7jU=",
"x86_64-darwin": "sha256-Or5dSTdajUwij0XpovXSXjJ0LmRUcpcW5TJ4q4B0k0A="
}
}
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
"@sentry/solid": "10.36.0",
"@sentry/vite-plugin": "4.6.0",
"solid-js": "1.9.10",
"solid-sonner": "0.3.1",
"vite-plugin-solid": "2.11.10",
"@lydell/node-pty": "1.2.0-beta.12"
}
Expand Down Expand Up @@ -143,12 +144,14 @@
"@types/node": "catalog:"
},
"patchedDependencies": {
"@dnd-kit/dom@0.5.0": "patches/@dnd-kit%2Fdom@0.5.0.patch",
"@ff-labs/fff-bun@0.9.3": "patches/@ff-labs%2Ffff-bun@0.9.3.patch",
"@npmcli/agent@4.0.2": "patches/@npmcli%2Fagent@4.0.2.patch",
"@silvia-odwyer/photon-node@0.3.4": "patches/@silvia-odwyer%2Fphoton-node@0.3.4.patch",
"@standard-community/standard-openapi@0.2.9": "patches/@standard-community%2Fstandard-openapi@0.2.9.patch",
"solid-js@1.9.10": "patches/solid-js@1.9.10.patch",
"@ai-sdk/xai@3.0.102": "patches/@ai-sdk%2Fxai@3.0.102.patch",
"@ai-sdk/mistral@3.0.51": "patches/@ai-sdk%2Fmistral@3.0.51.patch",
"gcp-metadata@8.1.2": "patches/gcp-metadata@8.1.2.patch",
"pacote@21.5.0": "patches/pacote@21.5.0.patch",
"@ai-sdk/google@3.0.73": "patches/@ai-sdk%2Fgoogle@3.0.73.patch",
Expand Down
Loading
Loading