Skip to content

Commit 148b3cf

Browse files
committed
Merge remote-tracking branch 'upstream/dev' into desktop-wsl-onboarding
2 parents de69c5a + 2d0a757 commit 148b3cf

108 files changed

Lines changed: 4464 additions & 1880 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.

bun.lock

Lines changed: 16 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@opencode-ai/app",
3-
"version": "1.14.33",
3+
"version": "1.14.35",
44
"description": "",
55
"type": "module",
66
"exports": {

packages/app/src/components/terminal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ export const Terminal = (props: TerminalProps) => {
482482
const connectToken = async () => {
483483
const result = await client.pty
484484
.connectToken(
485-
{ ptyID: id },
485+
{ ptyID: id, directory },
486486
{
487487
throwOnError: false,
488488
headers: { "x-opencode-ticket": "1" },

packages/app/src/context/terminal.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ describe("getTerminalServerScope", () => {
6262
),
6363
).toBe("wsl:Debian" as ServerKey)
6464
expect(
65-
getTerminalServerScope({ type: "http", http: { url: "https://example.com" } }, "https://example.com" as ServerKey),
65+
getTerminalServerScope(
66+
{ type: "http", http: { url: "https://example.com" } },
67+
"https://example.com" as ServerKey,
68+
),
6669
).toBe("https://example.com" as ServerKey)
6770
})
6871
})

packages/app/src/context/terminal.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,12 @@ export function getTerminalServerScope(conn: ServerConnection.Any | undefined, k
9494
if (conn.type === "http") {
9595
try {
9696
const url = new URL(conn.http.url)
97-
if (url.hostname === "localhost" || url.hostname === "127.0.0.1" || url.hostname === "::1" || url.hostname === "[::1]")
97+
if (
98+
url.hostname === "localhost" ||
99+
url.hostname === "127.0.0.1" ||
100+
url.hostname === "::1" ||
101+
url.hostname === "[::1]"
102+
)
98103
return
99104
} catch {
100105
return key
@@ -127,12 +132,7 @@ const trimTerminal = (pty: LocalPTY) => {
127132
}
128133
}
129134

130-
export function clearWorkspaceTerminals(
131-
dir: string,
132-
sessionIDs?: string[],
133-
platform?: Platform,
134-
scope?: string,
135-
) {
135+
export function clearWorkspaceTerminals(dir: string, sessionIDs?: string[], platform?: Platform, scope?: string) {
136136
const key = getWorkspaceTerminalCacheKey(dir, scope)
137137
for (const cache of caches) {
138138
const entry = cache.get(key)

packages/console/app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@opencode-ai/console-app",
3-
"version": "1.14.33",
3+
"version": "1.14.35",
44
"type": "module",
55
"license": "MIT",
66
"scripts": {

packages/console/app/src/routes/download/[channel]/[platform].ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import type { APIEvent } from "@solidjs/start"
22
import type { DownloadPlatform } from "../types"
33

44
const prodAssetNames: Record<string, string> = {
5-
"darwin-aarch64-dmg": "opencode-desktop-darwin-aarch64.dmg",
6-
"darwin-x64-dmg": "opencode-desktop-darwin-x64.dmg",
7-
"windows-x64-nsis": "opencode-desktop-windows-x64.exe",
5+
"darwin-aarch64-dmg": "opencode-desktop-mac-arm64.dmg",
6+
"darwin-x64-dmg": "opencode-desktop-mac-x64.dmg",
7+
"windows-x64-nsis": "opencode-desktop-win-x64.exe",
88
"linux-x64-deb": "opencode-desktop-linux-amd64.deb",
9-
"linux-x64-appimage": "opencode-desktop-linux-amd64.AppImage",
9+
"linux-x64-appimage": "opencode-desktop-linux-x86_64.AppImage",
1010
"linux-x64-rpm": "opencode-desktop-linux-x86_64.rpm",
1111
} satisfies Record<DownloadPlatform, string>
1212

@@ -32,13 +32,6 @@ export async function GET({ params: { platform, channel } }: APIEvent) {
3232

3333
const resp = await fetch(
3434
`https://github.com/anomalyco/${channel === "stable" ? "opencode" : "opencode-beta"}/releases/latest/download/${assetName}`,
35-
{
36-
cf: {
37-
// in case gh releases has rate limits
38-
cacheTtl: 60 * 5,
39-
cacheEverything: true,
40-
},
41-
} as any,
4235
)
4336

4437
const downloadName = downloadNames[platform]

packages/console/app/src/routes/zen/util/handler.ts

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,13 @@ export async function handler(
158158
Object.entries(obj).flatMap(([k, v]) => {
159159
if (Array.isArray(v)) return [[k, v]]
160160
if (typeof v === "object") return [[k, replacer(v)]]
161-
if (v === "$ip") return [[k, ip]]
162-
if (v === "$workspace") return authInfo?.workspaceID ? [[k, authInfo?.workspaceID]] : []
163-
if (v.startsWith("$header.")) {
164-
const headerValue = input.request.headers.get(v.slice(8))
165-
return headerValue ? [[k, headerValue]] : []
161+
if (typeof v === "string") {
162+
if (v === "$ip") return [[k, ip]]
163+
if (v === "$workspace") return authInfo?.workspaceID ? [[k, authInfo?.workspaceID]] : []
164+
if (v.startsWith("$header.")) {
165+
const headerValue = input.request.headers.get(v.slice(8))
166+
return headerValue ? [[k, headerValue]] : []
167+
}
166168
}
167169
return [[k, v]]
168170
}),
@@ -917,6 +919,13 @@ export async function handler(
917919
"tokens.cache_read": cacheReadTokens,
918920
"tokens.cache_write_5m": cacheWrite5mTokens,
919921
"tokens.cache_write_1h": cacheWrite1hTokens,
922+
"cost.input.microcents": centsToMicroCents(inputCost),
923+
"cost.output.microcents": centsToMicroCents(outputCost),
924+
"cost.reasoning.microcents": reasoningCost ? centsToMicroCents(reasoningCost) : undefined,
925+
"cost.cache_read.microcents": cacheReadCost ? centsToMicroCents(cacheReadCost) : undefined,
926+
"cost.cache_write.microcents": cacheWrite5mCost ? centsToMicroCents(cacheWrite5mCost) : undefined,
927+
"cost.total.microcents": centsToMicroCents(totalCostInCent),
928+
// deprecated - remove after May 20, 2026
920929
"cost.input": Math.round(inputCost),
921930
"cost.output": Math.round(outputCost),
922931
"cost.reasoning": reasoningCost ? Math.round(reasoningCost) : undefined,

packages/console/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://json.schemastore.org/package.json",
33
"name": "@opencode-ai/console-core",
4-
"version": "1.14.33",
4+
"version": "1.14.35",
55
"private": true,
66
"type": "module",
77
"license": "MIT",

packages/console/function/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@opencode-ai/console-function",
3-
"version": "1.14.33",
3+
"version": "1.14.35",
44
"$schema": "https://json.schemastore.org/package.json",
55
"private": true,
66
"type": "module",

0 commit comments

Comments
 (0)