@wbline/pi-plan-build 0.0.8 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/package.json +1 -1
- package/src/tools/plan-question.ts +17 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
格式基于 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),版本遵循语义化版本。
|
|
6
6
|
|
|
7
|
+
## [0.0.9] - 2026-10-21
|
|
8
|
+
|
|
9
|
+
### 修复
|
|
10
|
+
|
|
11
|
+
**`plan_question` 弹窗中文标点前显示方块(□)**:上游模型(agent-gateway / glm 系)偶发在流式 tool_call 参数里夹带 CR 控制符(`\r`)——会话 JSONL 证实同一模型纯文本/thinking 内容零污染,而 toolCall arguments 里有 130+ 处 CR,插在汉字与标点的 token 边界;JetBrains 侧把 CR 渲染成豆腐块。`plan_question` 现在在入口对 question/header/label/description 统一清洗 CR 与零宽字符(U+200B–U+200D、U+FEFF),弹窗选项、无 UI 回退文本、选择结果回传全链路干净;冒烟补 2 个用例。治本需在上游网关对工具参数做同等清洗(覆盖 edit 等其它工具)
|
|
12
|
+
|
|
7
13
|
## [0.0.8] - 2026-10-21
|
|
8
14
|
|
|
9
15
|
### 新增
|
package/package.json
CHANGED
|
@@ -8,6 +8,10 @@ import { Type } from "typebox";
|
|
|
8
8
|
import type { Lang } from "../core/prompts.ts";
|
|
9
9
|
import { toolTexts } from "./descriptions.ts";
|
|
10
10
|
|
|
11
|
+
/** 上游模型偶发在流式工具参数里夹带控制符(CR 会被 IDE 渲染成方块、零宽字符不可见),UI 文本一律清洗。 */
|
|
12
|
+
const stripControlNoise = (s: string): string =>
|
|
13
|
+
s.replace(/[\r\u200b-\u200d\ufeff]/g, "");
|
|
14
|
+
|
|
11
15
|
export function registerQuestion(pi: ExtensionAPI, lang: Lang): void {
|
|
12
16
|
const T = toolTexts(lang);
|
|
13
17
|
const QuestionT = Type.Object({
|
|
@@ -34,8 +38,19 @@ export function registerQuestion(pi: ExtensionAPI, lang: Lang): void {
|
|
|
34
38
|
description: T.question,
|
|
35
39
|
parameters: Params,
|
|
36
40
|
async execute(_id, params, _signal, _onUpdate, ctx: ExtensionToolContext) {
|
|
41
|
+
const questions = params.questions.map((q) => ({
|
|
42
|
+
question: stripControlNoise(q.question),
|
|
43
|
+
header: stripControlNoise(q.header),
|
|
44
|
+
options: q.options.map((o) => ({
|
|
45
|
+
...o,
|
|
46
|
+
label: stripControlNoise(o.label),
|
|
47
|
+
...(o.description
|
|
48
|
+
? { description: stripControlNoise(o.description) }
|
|
49
|
+
: {}),
|
|
50
|
+
})),
|
|
51
|
+
}));
|
|
37
52
|
if (!ctx.hasUI) {
|
|
38
|
-
const rendered =
|
|
53
|
+
const rendered = questions
|
|
39
54
|
.map(
|
|
40
55
|
(q, i) =>
|
|
41
56
|
`${i + 1}. ${q.question}\n${q.options.map((o) => ` - ${o.label}${o.description ? `:${o.description}` : ""}`).join("\n")}`,
|
|
@@ -52,7 +67,7 @@ export function registerQuestion(pi: ExtensionAPI, lang: Lang): void {
|
|
|
52
67
|
};
|
|
53
68
|
}
|
|
54
69
|
const answers: string[] = [];
|
|
55
|
-
for (const q of
|
|
70
|
+
for (const q of questions) {
|
|
56
71
|
// 自由输入入口追加在选项末尾;AI 选项恰好同名时复用为该入口,不重复追加
|
|
57
72
|
const custom = T.questionCustom;
|
|
58
73
|
const labels = q.options.map((o) => o.label);
|