pi-zh-cn 0.2.5 → 0.2.7

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/README.md CHANGED
@@ -20,7 +20,7 @@
20
20
  - 八个内置工具的执行结果:读取、执行(bash)、编辑、写入、搜索内容、查找文件、列出目录、PowerShell——状态行都是中文,比如「完成」「退出码 N」「输出过长已截断」
21
21
  - 编辑与写入的改动展示沿用 pi 内置渲染器(只有标题和展开提示是中文):`edit` 显示行号 + 红绿 diff,`write` 预览文件内容(折叠 10 行,`ctrl+o` 展开全量)
22
22
  - 项目信任弹窗:信任/不信任选择,含「信任父文件夹」变体
23
- - 内置斜杠命令描述:core 全部 23 个命令
23
+ - 内置斜杠命令描述:core 全部 24 个命令
24
24
 
25
25
  ## 安装
26
26
 
@@ -48,6 +48,16 @@ pi remove npm:pi-zh-cn
48
48
  /footer
49
49
  ```
50
50
 
51
+ ## 兼容性
52
+
53
+ `peerDependencies` 只设下限(`>=0.84.0`)不设上限,pi 出新版也不会被拦住。兼容性靠测试保证,不靠钉版本:
54
+
55
+ - push/PR:对着 lockfile 钉住的基线跑契约测试
56
+ - 每两天:上游金丝雀忽略 lockfile、拉最新版 pi 跑同一套测试
57
+ - 基线本身由 Dependabot 自动开 PR 跟进,它的 PR 就是一次新版兼容性验证,绿了合并即完成升级
58
+
59
+ Node 版本要求跟随 pi,由 pi 自己声明和检查。
60
+
51
61
  ## 已知局限
52
62
 
53
63
  - 内置菜单和其他硬编码在 pi 源码里的英文保持原样——扩展 API 够不到,除非 fork 上游重编译,不值得
@@ -76,15 +86,21 @@ footer 的 dist 源码,任一结构变化都会失败并指明该核对哪个
76
86
  npm test # tsc 类型检查 + 全部测试
77
87
  ```
78
88
 
79
- CI 在每次 push/PR 时运行,并每两天定时跑一次「上游金丝雀」:因为 peer
80
- 依赖是 `*`,定时任务会拉到最新版 pi,上游发布后两天内即可自动暴露兼容
81
- 性问题,不用等用户反馈。
89
+ CI 在每次 push/PR 时运行,并每两天定时跑一次「上游金丝雀」:本地开发
90
+ 基线由 `package-lock.json` 钉住,而金丝雀那趟会忽略 lockfile、拉到最新
91
+ 版 pi,所以上游发布后两天内即可自动暴露兼容性问题,不用等用户反馈。
92
+
93
+ ### 发布
94
+
95
+ 推 tag 即发布:流水线会核对版本号、跑测试、发到 npm 并生成 provenance,认证走
96
+ npm Trusted Publishing(OIDC),仓库里没有 `NPM_TOKEN`。完整流程、发完怎么核对、
97
+ 报 `ENEEDAUTH` 怎么查,见 **[RELEASING.md](RELEASING.md)**。
82
98
 
83
99
  ## 反馈
84
100
 
85
101
  pi 大版本升级后如果出现错位或残留英文,欢迎[提 issue](https://github.com/GoetheDady/pi-zh-cn/issues)。
86
102
 
87
- 改动记录见 [CHANGELOG.md](CHANGELOG.md)。
103
+ 改动记录见 [GitHub Releases](https://github.com/GoetheDady/pi-zh-cn/releases)。
88
104
 
89
105
  ## License
90
106
 
@@ -40,8 +40,8 @@ export const withExpanded = (raw: string, summary: string, theme: any): string =
40
40
  *
41
41
  * 内置 bash 工具不返回结构化退出码,只能从输出文本推断:匹配
42
42
  * 「exit code: N」/「command exited with code N」即失败;以 Error 开头、
43
- * 或含超时/中止提示也视为失败。powershell 在 Windows 上额外追加平台
44
- * 提示,通过 extraRe 补充识别。
43
+ * 或含超时/中止/无退出码提示也视为失败。powershell 在 Windows 上额外
44
+ * 追加平台提示,通过 extraRe 补充识别。
45
45
  *
46
46
  * @param output 工具输出的完整文本
47
47
  * @param extraRe 额外的失败特征正则(默认无)
@@ -57,7 +57,9 @@ function failureState(output: string, extraRe: RegExp[] = []) {
57
57
  failed:
58
58
  exitCode !== null ||
59
59
  /^error\b/i.test(output) ||
60
- /\n\ncommand (?:timed out|was aborted|failed)/i.test(output) ||
60
+ // 状态串由 appendStatus 拼在输出后(输出为空时位于文本开头,0.86.0
61
+ // 起新增的「Command terminated without an exit code」就是这个形态)。
62
+ /(?:^|\n\n)command (?:timed out|was aborted|terminated|failed)/i.test(output) ||
61
63
  extraRe.some((re) => re.test(output)),
62
64
  };
63
65
  }
package/extensions/zh.ts CHANGED
@@ -161,6 +161,7 @@ export const zh = {
161
161
  export: "导出会话(默认 HTML,可指定 .html/.jsonl 路径)",
162
162
  import: "从 JSONL 文件导入并恢复会话",
163
163
  share: "通过 GitHub 私密 gist 分享会话",
164
+ bug: "<description> — 向 Pi 开发者报告问题",
164
165
  copy: "复制最后一条助手消息到剪贴板",
165
166
  name: "设置会话显示名称",
166
167
  session: "显示会话信息与统计",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-zh-cn",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
4
4
  "description": "pi 编码代理的简体中文界面汉化插件",
5
5
  "repository": {
6
6
  "type": "git",
@@ -26,11 +26,14 @@
26
26
  },
27
27
  "peerDependencies": {
28
28
  "@earendil-works/pi-ai": "*",
29
- "@earendil-works/pi-coding-agent": "*",
30
- "@earendil-works/pi-tui": "*"
29
+ "@earendil-works/pi-coding-agent": ">=0.84.0",
30
+ "@earendil-works/pi-tui": ">=0.84.0"
31
31
  },
32
32
  "devDependencies": {
33
- "@types/node": "^26.3.0",
34
- "typescript": "^5.9.3"
33
+ "@earendil-works/pi-ai": ">=0.85.1",
34
+ "@earendil-works/pi-coding-agent": ">=0.85.1",
35
+ "@earendil-works/pi-tui": ">=0.85.1",
36
+ "@types/node": "^26.6.1",
37
+ "typescript": "^7.0.2"
35
38
  }
36
39
  }