@zhuan-ai/zhuanspec 2.14.0 → 2.15.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.
@@ -271,10 +271,12 @@ async function runDeviationCheck(filePath, trigger, promptText, _options) {
271
271
  catch {
272
272
  // 文件操作失败不阻断拦截
273
273
  }
274
+ // NOTE: 返回 continue: true(而非 false),确保 additionalContext
275
+ // 能注入到下一轮对话中,让主 Agent 用 askUserQuestion 展示四选一。
276
+ // 代码编辑由 pre-tool hook(检测 .pending-correction 标记)兜底拦截。
274
277
  return {
275
- continue: false,
276
- stopReason: 'Apply phase user correction requires path selection',
277
- systemMessage: '⚠️ 检测到用户纠偏信号,请先选择处理路径后再继续,严禁直接修改代码。',
278
+ continue: true,
279
+ systemMessage: '⚠️ 检测到用户纠偏信号——已注入纠偏四选一上下文,请主 Agent askUserQuestion 向用户展示选项。',
278
280
  hookSpecificOutput: {
279
281
  additionalContext: buildCorrectionOptionsContext(proposalSummary, changeId),
280
282
  options: [
@@ -312,10 +314,11 @@ async function runDeviationCheck(filePath, trigger, promptText, _options) {
312
314
  catch {
313
315
  // 文件操作失败不阻断拦截
314
316
  }
317
+ // NOTE: 同样返回 continue: true,确保 additionalContext 能注入到对话中。
318
+ // 代码编辑由 pre-tool hook(检测 .pending-correction 标记)兜底拦截。
315
319
  return {
316
- continue: false,
317
- stopReason: 'Requirement change requires spec update first',
318
- systemMessage: '⚠️ 检测到需求变更信号(新增/调整功能),请先更新 proposal/tasks/specs 后再修改代码。',
320
+ continue: true,
321
+ systemMessage: '⚠️ 检测到需求变更信号——已注入需求变更上下文,请主 Agent askUserQuestion 向用户确认。',
319
322
  hookSpecificOutput: {
320
323
  additionalContext: buildRequirementChangeContext(proposalSummary, changeId),
321
324
  options: [
@@ -32,9 +32,9 @@ async function checkVersionUpdate() {
32
32
  const pkgContent = JSON.parse(await fs.promises.readFile(pkgPath, 'utf-8'));
33
33
  current = pkgContent.version;
34
34
  }
35
- // 直接使用用户本地 npm 配置(registry / 代理),避免硬编码 registry
36
- // 无代理环境下访问官方源长时间阻塞并被 5s 超时静默吞掉,导致版本 banner 消失。
37
- const { stdout } = await execAsync('npm view @zhuan-ai/zhuanspec version', { timeout: 5000 });
35
+ // 强制查询 npmjs.org 公共源,避免用户本地 registry 指向私有仓库时
36
+ // 拿到过期版本号,永远误报"版本过旧"。
37
+ const { stdout } = await execAsync('npm view @zhuan-ai/zhuanspec version --registry=https://registry.npmjs.org/', { timeout: 5000 });
38
38
  const latest = stdout.trim();
39
39
  if (!latest || !current)
40
40
  return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhuan-ai/zhuanspec",
3
- "version": "2.14.0",
3
+ "version": "2.15.1",
4
4
  "description": "AI-native system for spec-driven development",
5
5
  "keywords": [
6
6
  "zhuanspec",
@@ -39,6 +39,26 @@
39
39
  "!dist/**/__tests__",
40
40
  "!dist/**/*.map"
41
41
  ],
42
+ "scripts": {
43
+ "lint": "eslint src/",
44
+ "build": "node build.js",
45
+ "dev": "tsc --watch",
46
+ "dev:cli": "pnpm build && node bin/zhuanspec.js",
47
+ "test": "vitest run",
48
+ "test:watch": "vitest",
49
+ "test:ui": "vitest --ui",
50
+ "test:coverage": "vitest --coverage",
51
+ "test:postinstall": "node scripts/postinstall.js",
52
+ "prepare": "npm run build",
53
+ "prepublishOnly": "npm run build",
54
+ "postinstall": "node scripts/postinstall.js",
55
+ "check:pack-version": "node scripts/pack-version-check.mjs",
56
+ "diagnose:cursor": "node scripts/diagnose-cursor-commands.js",
57
+ "release": "pnpm run release:ci",
58
+ "release:ci": "pnpm run check:pack-version && pnpm exec changeset publish",
59
+ "release:local": "pnpm exec changeset version && pnpm run check:pack-version && pnpm exec changeset publish",
60
+ "changeset": "changeset"
61
+ },
42
62
  "engines": {
43
63
  "node": ">=20.19.0"
44
64
  },
@@ -60,23 +80,5 @@
60
80
  "ora": "^8.2.0",
61
81
  "yaml": "^2.8.2",
62
82
  "zod": "^4.0.17"
63
- },
64
- "scripts": {
65
- "lint": "eslint src/",
66
- "build": "node build.js",
67
- "dev": "tsc --watch",
68
- "dev:cli": "pnpm build && node bin/zhuanspec.js",
69
- "test": "vitest run",
70
- "test:watch": "vitest",
71
- "test:ui": "vitest --ui",
72
- "test:coverage": "vitest --coverage",
73
- "test:postinstall": "node scripts/postinstall.js",
74
- "postinstall": "node scripts/postinstall.js",
75
- "check:pack-version": "node scripts/pack-version-check.mjs",
76
- "diagnose:cursor": "node scripts/diagnose-cursor-commands.js",
77
- "release": "pnpm run release:ci",
78
- "release:ci": "pnpm run check:pack-version && pnpm exec changeset publish",
79
- "release:local": "pnpm exec changeset version && pnpm run check:pack-version && pnpm exec changeset publish",
80
- "changeset": "changeset"
81
83
  }
82
- }
84
+ }