dsh-codearts 1.1.3 → 1.2.0

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 CHANGED
@@ -3,6 +3,35 @@
3
3
  本文件记录本插件的重要改动。格式参考 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),
4
4
  版本号遵循 [语义化版本](https://semver.org/lang/zh-CN/)。
5
5
 
6
+ ## [1.2.0] - 2026-10-27
7
+
8
+ ### 新增
9
+
10
+ - **对话底部那行积分可以点开看明细了**:以前只有一行聚合数字(多账号把所有号加在
11
+ 一起),看不出是哪个号还剩多少。现在那一行是个按钮,点开是逐号明细——账号名、各自
12
+ 剩余积分、哪个号有积分将在本周期结束时作废、最近刷新时间,右上角一个「刷新积分」。
13
+ 它是唯一绕开 60 秒积分缓存的出口(`GET /api/codearts/status?force=1`):点了必定打
14
+ 上游,不会拿旧数字糊弄。弹层用 fixed 定位挂在按钮上方(放不下就翻到下方),不撑宽
15
+ 宿主那条共享的 composer dock 行。
16
+ - **两个显隐开关**:设置卡片新增「显示」页,分别管输入框下方那一行的**剩余积分**与
17
+ **上游排队位置**(`showCreditDock` / `showQueueDock`)。默认都开,老配置行为不变。
18
+ 开关值随 `/status` 一起下发,底部条每 60 秒读一次,所以关掉最多要等一分钟才见效——
19
+ 这句写在设置页上,不让人自己猜。
20
+
21
+ ## [1.1.4] - 2026-10-26
22
+
23
+ ### 修复
24
+
25
+ - **升级到 1.1.3 报「更新失败:`ERR_PNPM_IGNORED_BUILDS`」**:1.1.3 为修 issue #2 把
26
+ `@earendil-works/pi-ai` 移进 `dependencies`,连带拉入 `@google/genai` / `protobufjs`
27
+ (都带安装期脚本);pnpm 11 默认拦截未批准的依赖脚本并以非零码退出,DSH 更新器据此
28
+ 判失败(包其实已装上)。现在 pi-ai 改为**构建期打包进 `lib/`**:它的厂商 SDK 全是
29
+ 懒加载 lane,插件只用 OpenAI 一路,tree-shaking 后 `@google/genai` / `protobufjs`
30
+ 不进产物也不进依赖树 —— 安装时零新增 npm 包,脚本拦截绝根;pi-ai 版本漂移(issue #2
31
+ 的根因)在结构上一并不可能了。1.1.3 用户侧的临时处理见 INSTALL「八」。
32
+ - 产物体积随之涨到约 1.1 MB(含 pi-ai 核心 + openai SDK 的 openai-completions 懒加载
33
+ chunk),功能与接口不变。
34
+
6
35
  ## [1.1.3] - 2026-10-26
7
36
 
8
37
  ### 修复
package/INSTALL.en.md CHANGED
@@ -133,3 +133,27 @@ console.log(b[0]===0xEF&&b[1]===0xBB&&b[2]===0xBF?'BOM!':'no-BOM');
133
133
  > PS 5.1, which crashed startup repeatedly. It was fixed by rewriting the file with Node
134
134
  > (backup `package.json.bak-bomfix-*`). A scan of the whole `~/.dsh` tree found that one
135
135
  > file only.
136
+
137
+ ## 8. Update to 1.1.3+ fails with `ERR_PNPM_IGNORED_BUILDS`
138
+
139
+ It is not actually a failed install — the `+ dsh-codearts 1.1.3` line means the package
140
+ already landed. What fails is pnpm 11's post-install check: since 1.1.3 the plugin bundles
141
+ its own copy of `@earendil-works/pi-ai`, which transitively pulls `@google/genai` and
142
+ `protobufjs`; both carry install-time scripts, pnpm 11 blocks unapproved dependency scripts
143
+ by default (`strictDepBuilds`) and exits non-zero, which the DSH updater reports as failure.
144
+ Neither script does anything needed at runtime (one is a no-op echo, the other a package
145
+ integrity self-check), so skipping them is safe.
146
+
147
+ One-time fix: append to the profile's `pnpm-workspace.yaml`
148
+ (e.g. `~/.dsh/profiles/desktop/pnpm-workspace.yaml`):
149
+
150
+ ```yaml
151
+ allowBuilds:
152
+ '@google/genai': false
153
+ protobufjs: false
154
+ ```
155
+
156
+ `false` means "deliberately never run their install scripts". Then retry the update. If the
157
+ file already contains placeholder lines like `'@google/genai': set this to true or false`
158
+ (auto-added by pnpm), replace the value with `false` — placeholders count as undecided and
159
+ keep failing. `pnpm approve-builds` in the profile directory works too.
package/INSTALL.md CHANGED
@@ -104,6 +104,28 @@ node scripts/deploy.mjs [profileDir] # profileDir 默认 <用户目录>/.dsh
104
104
  2. **用 Node `fs.writeFileSync`**(默认无 BOM)。
105
105
  3. **用 PowerShell 7 的 `-Encoding utf8NoBOM`**(PS5.1 没有该选项)。
106
106
 
107
+ ## 八、更新到 1.1.3+ 报「更新失败:`ERR_PNPM_IGNORED_BUILDS`」
108
+
109
+ 不是安装失败 —— 看输出里的 `+ dsh-codearts 1.1.3`,包其实已经装好了。报错的是
110
+ pnpm 11 的收尾检查:1.1.3 起插件自带一份 `@earendil-works/pi-ai`,它间接依赖
111
+ `@google/genai` 和 `protobufjs`,这两个包带安装期脚本;pnpm 11 默认拦截未批准的依赖
112
+ 脚本(`strictDepBuilds`)并以**非零码退出**,DSH 更新器据此判为失败。这两个脚本一个
113
+ 是 no-op echo、一个是包完整性自检,**不跑没有任何功能影响**。
114
+
115
+ 修法(一次性):在 profile 的 `pnpm-workspace.yaml`(如
116
+ `~/.dsh/profiles/desktop/pnpm-workspace.yaml`)里追加:
117
+
118
+ ```yaml
119
+ allowBuilds:
120
+ '@google/genai': false
121
+ protobufjs: false
122
+ ```
123
+
124
+ `false` 表示「明确不跑它们的安装脚本」。然后重新更新即可。注意:如果该文件里已有
125
+ `'@google/genai': set this to true or false` 这样的占位行(pnpm 自动加的),必须把值
126
+ 改成 `false` —— 占位符不算决定,会一直报错。也可以在 profile 目录跑
127
+ `pnpm approve-builds` 交互式处理。
128
+
107
129
  写入后务必用 Node 校验前 3 字节是否为 BOM:
108
130
  ```js
109
131
  const fs=require('fs');const b=fs.readFileSync(p);
package/lib/bin.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import { I as codeartsAccountsPath, M as isBenefitModel, N as CodeArtsAccountStore, d as fetchCallerIdentity, n as codeartsUsagePath, r as discoverModels, t as CodeArtsUsageTracker } from "./usage-5YK7bW-e.mjs";
2
+ import { I as codeartsAccountsPath, M as isBenefitModel, N as CodeArtsAccountStore, d as fetchCallerIdentity, n as codeartsUsagePath, r as discoverModels, t as CodeArtsUsageTracker } from "./usage-B0NfG8vZ.mjs";
3
3
  import { existsSync, statSync } from "node:fs";
4
4
  //#region src/version.ts
5
- const CODEARTS_VERSION = "1.1.3";
5
+ const CODEARTS_VERSION = "1.2.0";
6
6
  //#endregion
7
7
  //#region src/bin.ts
8
8
  /**
@@ -85,6 +85,22 @@ interface CodeArtsSettingsKey {
85
85
  creditsNeedSignIn: string;
86
86
  creditsDock: string;
87
87
  creditsDockTitle: string;
88
+ creditsDockExpand: string;
89
+ creditsDockPanelTitle: string;
90
+ creditsDockRefresh: string;
91
+ creditsDockRefreshing: string;
92
+ creditsDockColAccount: string;
93
+ creditsDockColBalance: string;
94
+ creditsDockEmpty: string;
95
+ creditsDockExpiring: string;
96
+ creditsDockUpdated: string;
97
+ tabDisplay: string;
98
+ displayTitle: string;
99
+ displayHint: string;
100
+ displayCreditsToggle: string;
101
+ displayQueueToggle: string;
102
+ displayNotWritable: string;
103
+ displayFailed: string;
88
104
  queueDock: string;
89
105
  queueDockTitle: string;
90
106
  claimButton: string;