← 返回更新日志

Pi v0.39.0

2026-01-08 · GitHub 原文
### 破坏性变更 - `before_agent_start` 事件现在在事件对象中接收 `systemPrompt`,并返回 `systemPrompt`(完全替换)而非 `systemPromptAppend`。之前采用追加模式的扩展现在必须使用 `event.systemPrompt + extra` 模式。 ([#575](https://github.com/badlogic/pi-mono/issues/575)) - `discoverSkills()` 现在返回 `{ skills: Skill[], warnings: SkillWarning[] }` 而非 `Skill[]`。这使得调用方能够处理技能加载警告。 ([#577](https://github.com/badlogic/pi-mono/pull/577) by [@cv](https://github.com/cv)) ### 新增 - `ctx.ui.getAllThemes()`、`ctx.ui.getTheme(name)` 和 `ctx.ui.setTheme(name | Theme)` 方法,供扩展在运行时列出、加载和切换主题 ([#576](https://github.com/badlogic/pi-mono/pull/576)) - `--no-tools` 标志,用于禁用所有内置工具,允许仅使用扩展提供的工具 ([#557](https://github.com/badlogic/pi-mono/pull/557) by [@cv](https://github.com/cv)) - 内置工具的插件化操作,支持通过 SSH 或其他传输协议进行远程执行 ([#564](https://github.com/badlogic/pi-mono/issues/564))。接口:`ReadOperations`、`WriteOperations`、`EditOperations`、`BashOperations`、`LsOperations`、`GrepOperations`、`FindOperations` - `user_bash` 事件,用于拦截用户 `!`/`!!` 命令,允许扩展将其重定向到远程系统 ([#528](https://github.com/badlogic/pi-mono/issues/528)) - ExtensionAPI 中的 `setActiveTools()` 方法,用于动态管理工具 - 工具覆盖时自动使用内置渲染器,无需自定义 `renderCall`/`renderResult` - `ssh.ts` 示例:通过 `--ssh user@host:/path` 实现远程工具执行 - `interactive-shell.ts` 示例:通过 `!i` 前缀或自动检测,以完整终端访问权限运行交互式命令(vim、git rebase、htop) - `/copy` 命令的 Wayland 剪贴板支持,使用 wl-copy 并回退到 xclip/xsel ([#570](https://github.com/badlogic/pi-mono/pull/570) by [@OgulcanCelik](https://github.com/OgulcanCelik)) - **实验性功能:** `ctx.ui.custom()` 现在接受 `{ overlay: true }` 选项,用于创建浮动模态组件,这些组件会叠加在现有内容之上而不会清屏 ([#558](https://github.com/badlogic/pi-mono/pull/558) by [@nicobailon](https://github.com/nicobailon)) - `AgentSession.skills` 和 `AgentSession.skillWarnings` 属性,用于无需重新发现即可访问已加载的技能 ([#577](https://github.com/badlogic/pi-mono/pull/577) by [@cv](https://github.com/cv)) ### 修复 - `createAgentSession()` 中的字符串 `systemPrompt` 现在作为完全替换生效,而不再追加上下文文件和技能,与文档描述的行为一致 ([#543](https://github.com/badlogic/pi-mono/issues/543)) - bun 二进制安装的更新通知现在显示发布下载链接,而非 npm 命令 ([#567](https://github.com/badlogic/pi-mono/pull/567) by [@ferologics](https://github.com/ferologics)) - 自动重试后,在“Working...”状态下 ESC 键现在可以正常工作 ([#568](https://github.com/badlogic/pi-mono/pull/568) by [@tmustier](https://github.com/tmustier)) - 中止消息现在显示正确的重试次数(例如,“在 2 次重试尝试后中止”) ([#568](https://github.com/badlogic/pi-mono/pull/568) by [@tmustier](https://github.com/tmustier)) - 修复了 Antigravity 提供商在配额充足的情况下仍返回 429 错误的问题 ([#571](https://github.com/badlogic/pi-mono/pull/571) by [@ben-vargas](https://github.com/ben-vargas)) - 修复了 Gemini/Antigravity 响应中思考文本格式错误的问题,其中思考内容显示为普通文本或反之。跨模型对话现在能正确将思考块转换为纯文本。 ([#561](https://github.com/badlogic/pi-mono/issues/561)) - `--no-skills` 标志现在能正确阻止在交互模式下加载技能 ([#577](https://github.com/badlogic/pi-mono/pull/577) by [@cv](https://github.com/cv))