diff --git a/package.json b/package.json index 0294c8c322..ce32321550 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,6 @@ "access": "public" }, "scripts": { - "postinstall": "npx @electron/rebuild -f -m node_modules/node-pty", "dev": "make dev", "prebuild:main": "./scripts/generate-version.sh", "build": "make build", @@ -73,7 +72,7 @@ "minimist": "^1.2.8", "motion": "^12.23.24", "ollama-ai-provider-v2": "^1.5.4", - "node-pty": "1.1.0-beta39", + "@homebridge/node-pty-prebuilt-multiarch": "^0.11.14", "rehype-harden": "^1.1.5", "shescape": "^2.1.6", "source-map-support": "^0.5.21", @@ -171,6 +170,7 @@ "dist/**/*.json", "dist/**/*.png", "dist/assets/**/*", + "scripts/postinstall.sh", "README.md", "LICENSE" ], diff --git a/src/services/ptyService.ts b/src/services/ptyService.ts index 6a7e915675..bc5273ba8b 100644 --- a/src/services/ptyService.ts +++ b/src/services/ptyService.ts @@ -8,7 +8,7 @@ import { log } from "@/services/log"; import type { Runtime } from "@/runtime/Runtime"; import type { TerminalSession, TerminalCreateParams, TerminalResizeParams } from "@/types/terminal"; -import type { IPty } from "node-pty"; +import type { IPty } from "@homebridge/node-pty-prebuilt-multiarch"; import { SSHRuntime, type SSHRuntimeConfig } from "@/runtime/SSHRuntime"; import { LocalRuntime } from "@/runtime/LocalRuntime"; import { access } from "fs/promises"; @@ -98,10 +98,10 @@ export class PTYService { if (runtime instanceof LocalRuntime) { // Local: Use node-pty (dynamically import to avoid crash if not available) // eslint-disable-next-line @typescript-eslint/consistent-type-imports - let pty: typeof import("node-pty"); + let pty: typeof import("@homebridge/node-pty-prebuilt-multiarch"); try { // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-unsafe-assignment - pty = require("node-pty"); + pty = require("@homebridge/node-pty-prebuilt-multiarch"); } catch (err) { log.error("node-pty not available - local terminals will not work:", err); throw new Error( @@ -206,10 +206,10 @@ export class PTYService { // Load node-pty dynamically // eslint-disable-next-line @typescript-eslint/consistent-type-imports - let pty: typeof import("node-pty"); + let pty: typeof import("@homebridge/node-pty-prebuilt-multiarch"); try { // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-unsafe-assignment - pty = require("node-pty"); + pty = require("@homebridge/node-pty-prebuilt-multiarch"); } catch (err) { log.error("node-pty not available - SSH terminals will not work:", err); throw new Error(