1.0.18
🎉 1.0.18
中文
✨ 新功能
- Windows 智能 Shell 探测:NativeExecutor 现在能在 Windows 上自动选择最优 Shell,按优先级探测 Git Bash → busybox-w32 → CMD。新增统一的 Shell 解析器(
shell-resolver.ts),让 macOS 和 Windows 共用同一套 Shell 选择逻辑,避免硬编码/bin/bash。
🐛 修复
-
浏览器 evaluate 返回值崩溃:修复了
internal_browser_evaluate工具在 JS 表达式返回undefined时生成无效内容块({"type":"text"}缺少text字段),导致 pi-ai SDK 在 token 估算时崩溃的问题。现在未定义返回值统一输出"(no return value)",并覆盖了所有 JS 值类型的回归测试。 -
Windows 应用图标嵌入:修复了 Windows exe 没有嵌入应用图标的问题。使用纯 JS 的
resedit在after-pack钩子中替换 exe 图标,无需 wine 或 rcedit,同时将icon.ico纳入extraResources以确保运行时窗口图标正确加载。 -
pdfjs-dist 懒加载(Windows 崩溃修复):修复了 Windows 版本在 Electron 启动时因
pdfjs-dist顶层代码调用new DOMMatrix()导致ReferenceError崩溃的问题。@napi-rs/canvas-win32-x64-msvc缺失时 DOMMatrix 未被 polyfill。——将 import 改为动态import(),仅在真正打开 PDF 时才加载 pdfjs-dist。 -
文件预览弹窗被 CSS containment 裁剪:修复了
FilePreviewModal在包含transform或filterCSS 的容器内渲染时,position: fixed被浏览器限定在容器内而非视口的 bug。改为通过createPortal挂载到document.body,与 ArtifactPanel / ArtifactCard 保持一致。
🔧 工程
- Linux .deb 构建支持:electron-builder 新增
deb目标,支持生成 Debian/Ubuntu 安装包。 - busybox.exe 打包:Windows 构建现在自动捆绑
busybox.exe,为无 Git Bash 环境提供基本的 Shell 能力。 - Shell 日志:NativeExecutor 初始化时输出检测到的 Shell 路径,方便排查跨平台 Shell 问题。
English
✨ New Features
- Windows smart shell detection: NativeExecutor now automatically picks the best available shell on Windows, probing in priority order: Git Bash → busybox-w32 → CMD. A unified
shell-resolver.tsis shared across macOS and Windows, replacing hardcoded/bin/bashpaths.
🐛 Bug Fixes
-
Browser evaluate crash on
undefined: Fixed a bug whereinternal_browser_evaluateproduced an invalid content block ({"type":"text"}with notextfield) when the evaluated JS expression returnedundefined, crashing the pi-ai SDK during token estimation. Undefined results now produce"(no return value)"with regression tests covering all JS value types. -
Windows exe icon embedding: Fixed the Windows exe missing its embedded app icon. Uses pure-JS
reseditin theafter-packhook to replace the exe icon resource — no wine or rcedit needed. Also addedicon.icotoextraResourcesso the runtime window icon loads correctly. -
pdfjs-dist lazy loading (Windows crash fix): Fixed a startup crash on Windows where
pdfjs-dist's top-levelnew DOMMatrix()call threwReferenceErrorbecause@napi-rs/canvas-win32-x64-msvcwasn't polyfilling it. Moved the import to a dynamicimport()insidereadPdf(), so pdfjs-dist is only loaded when a PDF is actually opened. -
File preview modal clipping: Fixed
FilePreviewModalbeing clipped when rendered inside a container with CSStransformorfilter, which scopedposition: fixedto the container instead of the viewport. Now renders viacreatePortaltodocument.body, matching the existing pattern in ArtifactPanel and ArtifactCard.
🔧 Engineering
- Linux .deb target: Added
debtarget to electron-builder config for Debian/Ubuntu package generation. - busybox.exe bundled: Windows builds now bundle
busybox.exe, providing basic shell capabilities when Git Bash is unavailable. - Shell logging: NativeExecutor logs the detected shell path on init for easier cross-platform debugging.