From e3f3da4cb4dfb461b30cc1bc6fd2735af00e3529 Mon Sep 17 00:00:00 2001 From: Bohdan Triapitsyn Date: Wed, 10 Jun 2026 17:05:10 +0300 Subject: [PATCH] fix: restore dependency update compatibility Fix VS Code webview type-check with TypeScript 5.9 Align ghostty-web to 0.4.0 across the workspace Refresh ghostty-web patch for the updated package --- bun.lock | 8 ++------ package.json | 2 +- packages/vscode/webview/main.tsx | 9 +++++---- patches/ghostty-web+0.3.0.patch | 33 -------------------------------- patches/ghostty-web+0.4.0.patch | 30 +++++++++++++++++++++++++++++ 5 files changed, 38 insertions(+), 44 deletions(-) delete mode 100644 patches/ghostty-web+0.3.0.patch create mode 100644 patches/ghostty-web+0.4.0.patch diff --git a/bun.lock b/bun.lock index 11e2dab1..9c80e0ab 100644 --- a/bun.lock +++ b/bun.lock @@ -51,7 +51,7 @@ "clsx": "^2.1.1", "cmdk": "^1.1.1", "express": "^5.1.0", - "ghostty-web": "0.3.0", + "ghostty-web": "0.4.0", "http-proxy-middleware": "^3.0.5", "next-themes": "^0.4.6", "node-pty": "1.2.0-beta.12", @@ -2017,7 +2017,7 @@ "get-tsconfig": ["get-tsconfig@4.13.6", "", { "dependencies": { "resolve-pkg-maps": "^1.0.0" } }, "sha512-shZT/QMiSHc/YBLxxOkMtgSid5HFoauqCE3/exfsEcwg1WkeqjG+V40yBbBrsD+jW2HDXcs28xOfcbm2jI8Ddw=="], - "ghostty-web": ["ghostty-web@0.3.0", "", {}, "sha512-SAdSHWYF20GMZUB0n8kh1N6Z4ljMnuUqT8iTB2n5FAPswEV10MejEpLlhW/769GL5+BQa1NYwEg9y/XCckV5+A=="], + "ghostty-web": ["ghostty-web@0.4.0", "", {}, "sha512-0puDBik2qapbD/QQBW9o5ZHfXnZBqZWx/ctBiVtKZ6ZLds4NYb+wZuw1cRLXZk9zYovIQ908z3rvFhexAvc5Hg=="], "github-from-package": ["github-from-package@0.0.0", "", {}, "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw=="], @@ -3383,10 +3383,6 @@ "@npmcli/agent/socks-proxy-agent": ["socks-proxy-agent@8.0.5", "", { "dependencies": { "agent-base": "^7.1.2", "debug": "^4.3.4", "socks": "^2.8.3" } }, "sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw=="], - "@openchamber/ui/ghostty-web": ["ghostty-web@0.4.0", "", {}, "sha512-0puDBik2qapbD/QQBW9o5ZHfXnZBqZWx/ctBiVtKZ6ZLds4NYb+wZuw1cRLXZk9zYovIQ908z3rvFhexAvc5Hg=="], - - "@openchamber/web/ghostty-web": ["ghostty-web@0.4.0", "", {}, "sha512-0puDBik2qapbD/QQBW9o5ZHfXnZBqZWx/ctBiVtKZ6ZLds4NYb+wZuw1cRLXZk9zYovIQ908z3rvFhexAvc5Hg=="], - "@radix-ui/react-collection/@radix-ui/react-slot": ["@radix-ui/react-slot@1.2.3", "", { "dependencies": { "@radix-ui/react-compose-refs": "1.1.2" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-aeNmHnBxbi2St0au6VBVC7JXFlhLlOnvIIlePNniyUNAClzmtAUEY8/pBiK3iHjufOlwA+c20/8jngo7xcrg8A=="], "@radix-ui/react-dialog/@radix-ui/react-slot": ["@radix-ui/react-slot@1.2.3", "", { "dependencies": { "@radix-ui/react-compose-refs": "1.1.2" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-aeNmHnBxbi2St0au6VBVC7JXFlhLlOnvIIlePNniyUNAClzmtAUEY8/pBiK3iHjufOlwA+c20/8jngo7xcrg8A=="], diff --git a/package.json b/package.json index 1832f30b..a3930e49 100644 --- a/package.json +++ b/package.json @@ -108,7 +108,7 @@ "clsx": "^2.1.1", "cmdk": "^1.1.1", "express": "^5.1.0", - "ghostty-web": "0.3.0", + "ghostty-web": "0.4.0", "http-proxy-middleware": "^3.0.5", "next-themes": "^0.4.6", "node-pty": "1.2.0-beta.12", diff --git a/packages/vscode/webview/main.tsx b/packages/vscode/webview/main.tsx index 8434d7f6..474c1c0b 100644 --- a/packages/vscode/webview/main.tsx +++ b/packages/vscode/webview/main.tsx @@ -333,13 +333,14 @@ const getRequestDirectoryHint = (url: URL, input?: RequestInfo | URL, init?: Req return undefined; }; -const decodeBase64 = (value: string): Uint8Array => { +const decodeBase64 = (value: string): ArrayBuffer => { const binary = atob(value); - const bytes = new Uint8Array(binary.length); + const buffer = new ArrayBuffer(binary.length); + const bytes = new Uint8Array(buffer); for (let i = 0; i < binary.length; i += 1) { bytes[i] = binary.charCodeAt(i); } - return bytes; + return buffer; }; const jsonResponse = (body: unknown, status = 200): Response => { @@ -371,7 +372,7 @@ const buildProxiedResponse = ( return new Response(proxied.bodyText, { status: proxied.status, headers: proxied.headers }); } - const body = proxied.bodyBase64 ? decodeBase64(proxied.bodyBase64) : new Uint8Array(); + const body = proxied.bodyBase64 ? decodeBase64(proxied.bodyBase64) : new ArrayBuffer(0); return new Response(body, { status: proxied.status, headers: proxied.headers }); }; diff --git a/patches/ghostty-web+0.3.0.patch b/patches/ghostty-web+0.3.0.patch deleted file mode 100644 index 651eebde..00000000 --- a/patches/ghostty-web+0.3.0.patch +++ /dev/null @@ -1,33 +0,0 @@ -diff --git a/node_modules/ghostty-web/dist/ghostty-web.js b/node_modules/ghostty-web/dist/ghostty-web.js -index 0000000000000000000000000000000000000000..1111111111111111111111111111111111111111 100644 ---- a/node_modules/ghostty-web/dist/ghostty-web.js -+++ b/node_modules/ghostty-web/dist/ghostty-web.js -@@ -1285,1 +1285,1 @@ -- C === 0 || C < 32 ? B.push(" ") : B.push(String.fromCodePoint(C)); -+ C === 0 || C < 32 || C > 1114111 || (C >= 55296 && C <= 57343) ? B.push(" ") : B.push(String.fromCodePoint(C)); -@@ -1328,1 +1328,1 @@ -- this.ctx = Q, this.fontSize = B.fontSize ?? 15, this.fontFamily = B.fontFamily ?? "monospace", this.cursorStyle = B.cursorStyle ?? "block", this.cursorBlink = B.cursorBlink ?? !1, this.theme = { ...r, ...B.theme }, this.devicePixelRatio = B.devicePixelRatio ?? window.devicePixelRatio ?? 1, this.palette = [ -+ this.ctx = Q, this.fontSize = B.fontSize ?? 15, this.fontFamily = B.fontFamily ?? "monospace", this.lineHeight = B.lineHeight ?? 1, this.cursorStyle = B.cursorStyle ?? "block", this.cursorBlink = B.cursorBlink ?? !1, this.theme = { ...r, ...B.theme }, this.devicePixelRatio = B.devicePixelRatio ?? window.devicePixelRatio ?? 1, this.palette = [ -@@ -1353,1 +1353,1 @@ -- const Q = B.measureText("M"), g = Math.ceil(Q.width), C = Q.actualBoundingBoxAscent || this.fontSize * 0.8, I = Q.actualBoundingBoxDescent || this.fontSize * 0.2, w = Math.ceil(C + I) + 2, o = Math.ceil(C) + 1; -+ const Q = B.measureText("M"), g = Math.ceil(Q.width), C = Q.actualBoundingBoxAscent || this.fontSize * 0.8, I = Q.actualBoundingBoxDescent || this.fontSize * 0.2, w0 = Math.ceil(C + I), extra = Math.max(0, Math.round((this.lineHeight - 1) * w0)), w = w0 + 2 + extra, o = Math.ceil(C) + 1; -@@ -1484,1 +1484,1 @@ -- const s = g, F = C + this.metrics.baseline, a = String.fromCodePoint(A.codepoint || 32); -+ const s = g, F = C + this.metrics.baseline, a = (A.codepoint === 0 || A.codepoint == null || A.codepoint < 0 || A.codepoint > 1114111 || (A.codepoint >= 55296 && A.codepoint <= 57343)) ? " " : String.fromCodePoint(A.codepoint); -@@ -1730,1 +1730,1 @@ -- if (s && s.codepoint !== 0) { -+ if (s && s.codepoint !== 0 && s.codepoint <= 1114111 && !(s.codepoint >= 55296 && s.codepoint <= 57343)) { -@@ -1995,1 +1995,1 @@ -- if (!w || w.codepoint === 0) -+ if (!w || w.codepoint === 0 || w.codepoint > 1114111 || (w.codepoint >= 55296 && w.codepoint <= 57343)) -@@ -2147,4 +2147,5 @@ - scrollback: A.scrollback ?? 1e3, - fontSize: A.fontSize ?? 15, - fontFamily: A.fontFamily ?? "monospace", -+ lineHeight: A.lineHeight ?? 1, - allowTransparency: A.allowTransparency ?? !1, -@@ -2267,3 +2267,4 @@ - fontSize: this.options.fontSize, - fontFamily: this.options.fontFamily, -+ lineHeight: this.options.lineHeight, - cursorStyle: this.options.cursorStyle, diff --git a/patches/ghostty-web+0.4.0.patch b/patches/ghostty-web+0.4.0.patch new file mode 100644 index 00000000..ceed5f29 --- /dev/null +++ b/patches/ghostty-web+0.4.0.patch @@ -0,0 +1,30 @@ +diff --git a/node_modules/ghostty-web/dist/ghostty-web.js b/node_modules/ghostty-web/dist/ghostty-web.js +index 0000000000000000000000000000000000000000..1111111111111111111111111111111111111111 100644 +--- a/node_modules/ghostty-web/dist/ghostty-web.js ++++ b/node_modules/ghostty-web/dist/ghostty-web.js +@@ -1299,1 +1299,1 @@ +- C === 0 || C < 32 ? B.push(" ") : B.push(String.fromCodePoint(C)); ++ C === 0 || C < 32 || C > 1114111 || C >= 55296 && C <= 57343 ? B.push(" ") : B.push(String.fromCodePoint(C)); +@@ -1341,1 +1341,1 @@ +- this.ctx = g, this.fontSize = B.fontSize ?? 15, this.fontFamily = B.fontFamily ?? "monospace", this.cursorStyle = B.cursorStyle ?? "block", this.cursorBlink = B.cursorBlink ?? !1, this.theme = { ...f, ...B.theme }, this.devicePixelRatio = B.devicePixelRatio ?? window.devicePixelRatio ?? 1, this.palette = [ ++ this.ctx = g, this.fontSize = B.fontSize ?? 15, this.fontFamily = B.fontFamily ?? "monospace", this.lineHeight = B.lineHeight ?? 1, this.cursorStyle = B.cursorStyle ?? "block", this.cursorBlink = B.cursorBlink ?? !1, this.theme = { ...f, ...B.theme }, this.devicePixelRatio = B.devicePixelRatio ?? window.devicePixelRatio ?? 1, this.palette = [ +@@ -1366,1 +1366,1 @@ +- const g = B.measureText("M"), E = Math.ceil(g.width), C = g.actualBoundingBoxAscent || this.fontSize * 0.8, I = g.actualBoundingBoxDescent || this.fontSize * 0.2, D = Math.ceil(C + I) + 2, i = Math.ceil(C) + 1; ++ const g = B.measureText("M"), E = Math.ceil(g.width), C = g.actualBoundingBoxAscent || this.fontSize * 0.8, I = g.actualBoundingBoxDescent || this.fontSize * 0.2, D0 = Math.ceil(C + I), extra = Math.max(0, Math.round((this.lineHeight - 1) * D0)), D = D0 + 2 + extra, i = Math.ceil(C) + 1; +@@ -1538,1 +1538,1 @@ +- if (A.grapheme_len > 0 && ((k = this.currentBuffer) != null && k.getGraphemeString) ? N = this.currentBuffer.getGraphemeString(g, B) : N = String.fromCodePoint(A.codepoint || 32), this.ctx.fillText(N, w, s), A.flags & e.FAINT && (this.ctx.globalAlpha = 1), A.flags & e.UNDERLINE) { ++ if (A.grapheme_len > 0 && ((k = this.currentBuffer) != null && k.getGraphemeString) ? N = this.currentBuffer.getGraphemeString(g, B) : N = A.codepoint == null || A.codepoint <= 0 || A.codepoint > 1114111 || A.codepoint >= 55296 && A.codepoint <= 57343 ? " " : String.fromCodePoint(A.codepoint), this.ctx.fillText(N, w, s), A.flags & e.FAINT && (this.ctx.globalAlpha = 1), A.flags & e.UNDERLINE) { +@@ -1780,1 +1780,1 @@ +- if (a && a.codepoint !== 0) { ++ if (a && a.codepoint !== 0 && a.codepoint <= 1114111 && !(a.codepoint >= 55296 && a.codepoint <= 57343)) { +@@ -2054,1 +2054,1 @@ +- if (!D || D.codepoint === 0) ++ if (!D || D.codepoint === 0 || D.codepoint > 1114111 || D.codepoint >= 55296 && D.codepoint <= 57343) +@@ -2205,1 +2205,2 @@ +- fontFamily: A.fontFamily ?? "monospace", ++ fontFamily: A.fontFamily ?? "monospace", ++ lineHeight: A.lineHeight ?? 1, +@@ -2340,1 +2341,2 @@ +- fontFamily: this.options.fontFamily, ++ fontFamily: this.options.fontFamily, ++ lineHeight: this.options.lineHeight,