Skip to content

1.0.18

Choose a tag to compare

@deskwand deskwand released this 17 Jul 12:21

🎉 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 的 reseditafter-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 在包含 transformfilter CSS 的容器内渲染时,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.ts is shared across macOS and Windows, replacing hardcoded /bin/bash paths.

🐛 Bug Fixes

  • Browser evaluate crash on undefined: Fixed a bug where internal_browser_evaluate produced an invalid content block ({"type":"text"} with no text field) when the evaluated JS expression returned undefined, 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 resedit in the after-pack hook to replace the exe icon resource — no wine or rcedit needed. Also added icon.ico to extraResources so the runtime window icon loads correctly.

  • pdfjs-dist lazy loading (Windows crash fix): Fixed a startup crash on Windows where pdfjs-dist's top-level new DOMMatrix() call threw ReferenceError because @napi-rs/canvas-win32-x64-msvc wasn't polyfilling it. Moved the import to a dynamic import() inside readPdf(), so pdfjs-dist is only loaded when a PDF is actually opened.

  • File preview modal clipping: Fixed FilePreviewModal being clipped when rendered inside a container with CSS transform or filter, which scoped position: fixed to the container instead of the viewport. Now renders via createPortal to document.body, matching the existing pattern in ArtifactPanel and ArtifactCard.

🔧 Engineering

  • Linux .deb target: Added deb target 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.