kimi-code/scripts
qer 2d855b06a0 fix(terminal): make node-pty load and spawn in packaged + pnpm-dev builds
Two distinct PTY failures:
- 'Failed to load native module: pty.node' (npx/published daemon): node-pty was
  transitively bundled via @moonshot-ai/services (alwaysBundle), inlining its JS
  while its native binary can't be bundled and wasn't shipped. Mark node-pty
  external in tsdown (neverBundle) and declare it as a runtime dependency of
  @moonshot-ai/kimi-code so npm/npx installs it with its prebuilt pty.node.
- 'posix_spawnp failed' (local pnpm dev): node-pty's prebuilds/*/spawn-helper
  loses its +x bit through pnpm's store extraction. Add a root postinstall
  (scripts/fix-node-pty-perms.mjs) that restores the executable bit; verified it
  fixes a reproducible spawn failure.

Also harden defaultShell() to fall back on an empty (not just unset) $SHELL.

Note: the SEA standalone binary still needs node-pty's pty.node + spawn-helper
wired into scripts/native/native-deps.mjs (not addressed here; npx path covers
the reported case).
2026-06-14 01:10:22 +08:00
..
check-nix-workspace.mjs chore(flake): simplify nix build and add ci validation (#257) 2026-06-01 11:47:38 +08:00
check-service-naming.mjs feat(server)!: rename daemon to server with service management 2026-06-11 16:44:41 +08:00
fix-node-pty-perms.mjs fix(terminal): make node-pty load and spawn in packaged + pnpm-dev builds 2026-06-14 01:10:22 +08:00