← 返回更新日志

Pi v0.43.0

2026-01-12 · GitHub 原文
### 破坏性变更 - 扩展编辑器 (`ctx.ui.editor()`) 现在使用 Enter 键提交,Shift+Enter 换行,与主编辑器保持一致。此前使用 Ctrl+Enter 提交。硬编码了 "ctrl+enter" 提示的扩展需要更新。 ([#642](https://github.com/badlogic/pi-mono/pull/642) by [@mitsuhiko](https://github.com/mitsuhiko)) - 将 `/branch` 命令重命名为 `/fork` ([#641](https://github.com/badlogic/pi-mono/issues/641)) - RPC: `branch` → `fork`, `get_branch_messages` → `get_fork_messages` - SDK: `branch()` → `fork()`, `getBranchMessages()` → `getForkMessages()` - AgentSession: `branch()` → `fork()`, `getUserMessagesForBranching()` → `getUserMessagesForForking()` - 扩展事件: `session_before_branch` → `session_before_fork`, `session_branch` → `session_fork` - 设置: `doubleEscapeAction: "branch" | "tree"` → `"fork" | "tree"` - `SessionManager.list()` 和 `SessionManager.listAll()` 现在变为异步方法,返回 `Promise<SessionInfo[]>`。调用方必须使用 await 等待。 ([#620](https://github.com/badlogic/pi-mono/pull/620) by [@tmustier](https://github.com/tmustier)) ### 新增功能 - `/resume` 选择器现在支持使用 Tab 键在“当前文件夹”和“所有会话”之间切换,在“全部”视图中显示会话工作目录及加载进度。 ([#620](https://github.com/badlogic/pi-mono/pull/620) by [@tmustier](https://github.com/tmustier)) - `SessionManager.list()` 和 `SessionManager.listAll()` 接受可选的 `onProgress` 回调以接收进度更新 - 新增 `SessionInfo.cwd` 字段,包含会话的工作目录(旧会话为空字符串) - 导出 `SessionListProgress` 类型用于进度回调 - 新增 `/scoped-models` 命令,用于启用/禁用 Ctrl+P 循环切换的模型。更改默认仅对当前会话生效;按 Ctrl+S 可持久化到 settings.json。 ([#626](https://github.com/badlogic/pi-mono/pull/626) by [@CarlosGtrz](https://github.com/CarlosGtrz)) - `model_select` 扩展钩子:当通过 `/model` 命令、模型循环切换或会话恢复(带 `source` 字段)导致模型变更时触发,并提供 `previousModel` 参数 ([#628](https://github.com/badlogic/pi-mono/pull/628) by [@marckrenn](https://github.com/marckrenn)) - 新增 `ctx.ui.setWorkingMessage()` 扩展 API,用于自定义流式传输期间的“Working...”提示消息 ([#625](https://github.com/badlogic/pi-mono/pull/625) by [@nicobailon](https://github.com/nicobailon)) - 技能斜杠命令:加载的技能会注册为 `/skill:name` 命令以便快速访问。可通过 `/settings` 命令或 settings.json 中的 `skills.enableSkillCommands` 设置进行切换。 ([#630](https://github.com/badlogic/pi-mono/pull/630) by [@Dwsy](https://github.com/Dwsy)) - 斜杠命令自动补全现在支持模糊匹配(输入 `/skbra` 即可匹配 `/skill:brave-search`) - `/tree` 分支摘要现在提供三个选项:“无摘要”、“生成摘要”和“使用自定义提示词生成摘要”。自定义提示词将作为附加焦点追加到默认摘要指令中。 ([#642](https://github.com/badlogic/pi-mono/pull/642) by [@mitsuhiko](https://github.com/mitsuhiko)) ### 修复 - 使用 `--resume` 时,会话选择器会尊重自定义键位绑定 ([#633](https://github.com/badlogic/pi-mono/pull/633) by [@aos](https://github.com/aos)) - 自定义底部栏扩展现在能感知模型变更:`ctx.model` 现已改为 getter,返回当前模型而非创建上下文时的快照 ([#634](https://github.com/badlogic/pi-mono/pull/634) by [@ogulcancelik](https://github.com/ogulcancelik)) - 修复了外部分支切换后底部栏 Git 分支不更新的问题。Git 使用原子写入(临时文件+重命名),这会改变文件 inode 并破坏 `fs.watch`。现已改为监听目录。 - 扩展加载错误现在会展示给用户,而不是被静默忽略 ([#639](https://github.com/badlogic/pi-mono/pull/639) by [@aliou](https://github.com/aliou))