@qqq123456789/codex-doctor 0.3.0 → 0.3.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qqq123456789/codex-doctor",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Codex CLI 维护与排障工具:环境自检、会话/日志归档、配置与凭据备份恢复、版本追踪(零依赖)",
5
5
  "type": "module",
6
6
  "bin": {
package/tool/cli.mjs CHANGED
@@ -4,7 +4,7 @@ import { collectChecks, summarize, renderHuman } from './checks.mjs';
4
4
  import { cleanTarget } from './clean.mjs';
5
5
  import { backupConfig, restoreBackup, resetAuth, listVersions, listArchives, deleteArchive, checkUpdate } from './ops.mjs';
6
6
 
7
- const VERSION = '0.3.0';
7
+ const VERSION = '0.3.1';
8
8
 
9
9
  const HELP = `codex-doctor v${VERSION} — Codex CLI 维护与排障工具(零依赖)
10
10
 
package/tool/ops.mjs CHANGED
@@ -160,12 +160,13 @@ function compareSemver(a, b) {
160
160
 
161
161
  export async function checkUpdate(currentVersion) {
162
162
  // 与 npm registry 上的包版本对比(仓库 GitHub release 版本号与本工具版本号不同步)
163
- const res = await fetch('https://registry.npmjs.org/@qqq123456789%2Fcodex-doctor/latest', {
163
+ // 注意:缩略 Accept 头配 /latest 端点会返回 406,故请求完整 packument 读 dist-tags
164
+ const res = await fetch('https://registry.npmjs.org/@qqq123456789%2Fcodex-doctor', {
164
165
  headers: { Accept: 'application/vnd.npm.install-v1+json', 'User-Agent': 'codex-doctor-cli' },
165
166
  });
166
167
  if (!res.ok) throw new Error(`npm registry HTTP ${res.status}`);
167
168
  const r = await res.json();
168
- const latest = r.version || '';
169
+ const latest = r['dist-tags']?.latest || '';
169
170
  const newer = latest ? compareSemver(currentVersion, latest) < 0 : false;
170
171
  return {
171
172
  lines: [