add-coder 0.3.14 → 0.3.16

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": "add-coder",
3
- "version": "0.3.14",
3
+ "version": "0.3.16",
4
4
  "private": false,
5
5
  "description": "[codein2027](https://github.com/xiaomingming92/codein2027) - A complete scaffolding for building the ADD programming paradigm, the implementation layer for AI code governance. Core principle: Audit as Infrastructure. Breaks the black-box programming process and cross-session amnesia, evolving programming paradigms into an auditable, traceable, and convergent new era. npx-ready.\n\n[codein2027](https://github.com/xiaomingming92/codein2027) 快速构建 ADD 编程范式的完整脚手架——AI 代码治理的落地方案。以「审计即基础设施」为核心,彻底打破编程过程黑盒与跨轮失忆,让编程范式进化为可审计、可追溯、可收敛的新时代。npx 即用,人人可体验。",
6
6
  "repository": {
@@ -1,5 +1,5 @@
1
1
  {
2
- "_version": "0.3.14",
2
+ "_version": "0.3.16",
3
3
  "adapters/claude/hooks/doc-format-guard.sh": "ec59ad3f",
4
4
  "adapters/claude/hooks/lib/common.sh": "4f3e64ad",
5
5
  "adapters/claude/hooks/lib/context-inject.sh": "cfc8c65e",
@@ -15,7 +15,7 @@
15
15
  "adapters/claude/hooks/post-tool-failure.sh": "669b1b65",
16
16
  "adapters/claude/hooks/post-tool-use.sh": "f54dd009",
17
17
  "adapters/claude/hooks/pre-compact.sh": "4248f84f",
18
- "adapters/claude/hooks/pre-tool-use.sh": "ecbdc628",
18
+ "adapters/claude/hooks/pre-tool-use.sh": "e186abc8",
19
19
  "adapters/claude/hooks/prompt-submit.sh": "2fe9e42c",
20
20
  "adapters/claude/hooks/review-checklist.sh": "b383a983",
21
21
  "adapters/claude/hooks/session-end.sh": "777ae808",
@@ -40,7 +40,7 @@
40
40
  "adapters/codex/hooks/post-tool-failure.sh": "669b1b65",
41
41
  "adapters/codex/hooks/post-tool-use.sh": "27123aee",
42
42
  "adapters/codex/hooks/pre-compact.sh": "6164c007",
43
- "adapters/codex/hooks/pre-tool-use.sh": "ffa7936b",
43
+ "adapters/codex/hooks/pre-tool-use.sh": "8f6b77a0",
44
44
  "adapters/codex/hooks/prompt-submit.sh": "a41371ea",
45
45
  "adapters/codex/hooks/review-checklist.sh": "b383a983",
46
46
  "adapters/codex/hooks/session-end.sh": "3cc8c346",
@@ -64,7 +64,7 @@
64
64
  "adapters/qoder/hooks/post-tool-failure.sh": "8bc7a0e4",
65
65
  "adapters/qoder/hooks/post-tool-use.sh": "051cb6ed",
66
66
  "adapters/qoder/hooks/pre-compact.sh": "092fa6cf",
67
- "adapters/qoder/hooks/pre-tool-use.sh": "5ba6d9ae",
67
+ "adapters/qoder/hooks/pre-tool-use.sh": "ade1adf0",
68
68
  "adapters/qoder/hooks/prompt-submit.sh": "336f262e",
69
69
  "adapters/qoder/hooks/review-checklist.sh": "666831c8",
70
70
  "adapters/qoder/hooks/session-end.sh": "c50339df",
@@ -89,7 +89,7 @@
89
89
  "adapters/trae/hooks/post-tool-failure.sh": "669b1b65",
90
90
  "adapters/trae/hooks/post-tool-use.sh": "27123aee",
91
91
  "adapters/trae/hooks/pre-compact.sh": "6164c007",
92
- "adapters/trae/hooks/pre-tool-use.sh": "8e57d1fa",
92
+ "adapters/trae/hooks/pre-tool-use.sh": "63151fb0",
93
93
  "adapters/trae/hooks/prompt-submit.sh": "a41371ea",
94
94
  "adapters/trae/hooks/review-checklist.sh": "b383a983",
95
95
  "adapters/trae/hooks/session-end.sh": "3cc8c346",
@@ -124,7 +124,7 @@
124
124
  "adapters/vscode/hooks/post-tool-failure.sh": "355cfab1",
125
125
  "adapters/vscode/hooks/post-tool-use.sh": "5f188718",
126
126
  "adapters/vscode/hooks/pre-compact.sh": "a0908f0e",
127
- "adapters/vscode/hooks/pre-tool-use.sh": "6232624b",
127
+ "adapters/vscode/hooks/pre-tool-use.sh": "705953bf",
128
128
  "adapters/vscode/hooks/prompt-submit.sh": "3e56d1a9",
129
129
  "adapters/vscode/hooks/review-checklist.sh": "b383a983",
130
130
  "adapters/vscode/hooks/session-end.sh": "7b407b9f",
@@ -155,7 +155,7 @@
155
155
  "core/hooks/post-tool-failure.sh": "669b1b65",
156
156
  "core/hooks/post-tool-use.sh": "27123aee",
157
157
  "core/hooks/pre-compact.sh": "6164c007",
158
- "core/hooks/pre-tool-use.sh": "fa73df98",
158
+ "core/hooks/pre-tool-use.sh": "60bcf63a",
159
159
  "core/hooks/prompt-submit.sh": "a41371ea",
160
160
  "core/hooks/review-checklist.sh": "b383a983",
161
161
  "core/hooks/session-end.sh": "3cc8c346",
@@ -217,7 +217,7 @@
217
217
  "core/scripts/mcp-server/tools/hitl.ts": "80093743",
218
218
  "core/scripts/mcp-server/tools/hook-event-report.ts": "3926005b",
219
219
  "core/scripts/mcp-server/tools/index.ts": "b15c6753",
220
- "core/scripts/mcp-server/tools/plan.ts": "9ef4da1e",
220
+ "core/scripts/mcp-server/tools/plan.ts": "2f83b56f",
221
221
  "core/scripts/mcp-server/tools/quality.ts": "26ddf75d",
222
222
  "core/scripts/mcp-server/tools/review.ts": "c2d464ed",
223
223
  "core/scripts/mcp-server/types.ts": "6c5e60bc",
@@ -67,9 +67,9 @@ if [ "$tool_name" = "Write" ] || [ "$tool_name" = "Edit" ] || [ "$tool_name" = "
67
67
  if type detect_active_add >/dev/null 2>&1; then
68
68
  state=$(detect_active_add 2>/dev/null || true)
69
69
  if [ -z "$state" ]; then
70
- echo " 正在写入 Plan/Spec/Review 文档但无活跃 ADD Plan——请先执行 add-paradigm" >&2
71
- echo "{\"hookSpecificOutput\":{\"hookEventName\":\"PreToolUse\",\"permissionDecision\":\"deny\",\"permissionDecisionReason\":\"Plan/Spec/Review 写入需要活跃 ADD Plan,请先执行 add-paradigm\"}}"
72
- write_hook_event "pre-tool-use" "deny" "$file_path" "Plan/Spec/Review 写入需活跃 ADD Plan" "$PLAN_KEYWORD" "$PLAN_STATUS" 2>/dev/null || true
70
+ echo "[ADD 提示] 正在写入 Plan/Spec/Review 文档但无活跃 ADD Plan——首次创建场景放行,建议先执行 add-paradigm 生成 Plan+add-route" >&2
71
+ echo "{\"hookSpecificOutput\":{\"hookEventName\":\"PreToolUse\",\"permissionDecision\":\"allow\",\"permissionDecisionReason\":\"无活跃 ADD Plan 但为 Plan/Spec/Review 写入(首次创建场景),提示而非拦截\"}}"
72
+ write_hook_event "pre-tool-use" "info" "$file_path" "无活跃 ADD Plan 下写入 Plan/Spec/Review(首次创建放行)" "$PLAN_KEYWORD" "$PLAN_STATUS" 2>/dev/null || true
73
73
  exit $EXIT_BLOCK
74
74
  fi
75
75
  fi
@@ -140,10 +140,10 @@ if [ "$tool_name" = "Write" ] || [ "$tool_name" = "Edit" ] || [ "$tool_name" = "
140
140
  if type detect_active_add >/dev/null 2>&1; then
141
141
  state=$(detect_active_add 2>/dev/null || true)
142
142
  if [ -z "$state" ]; then
143
- echo " 正在写入 Plan/Spec/Review 文档但无活跃 ADD Plan——请先执行 add-paradigm" >&2
144
- echo "{\"hookSpecificOutput\":{\"hookEventName\":\"PreToolUse\",\"permissionDecision\":\"deny\",\"permissionDecisionReason\":\"Plan/Spec/Review 写入需要活跃 ADD Plan,请先执行 add-paradigm\"}}"
145
- write_hook_event "pre-tool-use" "deny" "$tool_name $file_path" "Plan/Spec/Review 写入需活跃 ADD Plan" "$PLAN_KEYWORD" "$PLAN_STATUS" 2>/dev/null || true
146
- exit 2
143
+ echo "[ADD 提示] 正在写入 Plan/Spec/Review 文档但无活跃 ADD Plan——首次创建场景放行,建议先执行 add-paradigm 生成 Plan+add-route" >&2
144
+ echo "{\"hookSpecificOutput\":{\"hookEventName\":\"PreToolUse\",\"permissionDecision\":\"allow\",\"permissionDecisionReason\":\"无活跃 ADD Plan 但为 Plan/Spec/Review 写入(首次创建场景),提示而非拦截\"}}"
145
+ write_hook_event "pre-tool-use" "info" "$tool_name $file_path" "无活跃 ADD Plan 下写入 Plan/Spec/Review(首次创建放行)" "$PLAN_KEYWORD" "$PLAN_STATUS" 2>/dev/null || true
146
+ exit 0
147
147
  fi
148
148
  fi
149
149
  fi
@@ -68,10 +68,10 @@ if [ "$tool_name" = "Write" ] || [ "$tool_name" = "Edit" ] || [ "$tool_name" = "
68
68
  if type detect_active_add >/dev/null 2>&1; then
69
69
  state=$(detect_active_add 2>/dev/null || true)
70
70
  if [ -z "$state" ]; then
71
- echo " 正在写入 Plan/Spec/Review 文档但无活跃 ADD Plan——请先执行 add-paradigm" >&2
72
- echo "{\"hookSpecificOutput\":{\"hookEventName\":\"PreToolUse\",\"permissionDecision\":\"deny\",\"permissionDecisionReason\":\"Plan/Spec/Review 写入需要活跃 ADD Plan,请先执行 add-paradigm\"}}"
73
- write_hook_event "pre-tool-use" "deny" "$file_path" "Plan/Spec/Review 写入需活跃 ADD Plan" "$PLAN_KEYWORD" "$PLAN_STATUS" 2>/dev/null || true
74
- exit 2
71
+ echo "[ADD 提示] 正在写入 Plan/Spec/Review 文档但无活跃 ADD Plan——首次创建场景放行,建议先执行 add-paradigm 生成 Plan+add-route" >&2
72
+ echo "{\"hookSpecificOutput\":{\"hookEventName\":\"PreToolUse\",\"permissionDecision\":\"allow\",\"permissionDecisionReason\":\"无活跃 ADD Plan 但为 Plan/Spec/Review 写入(首次创建场景),提示而非拦截\"}}"
73
+ write_hook_event "pre-tool-use" "info" "$file_path" "无活跃 ADD Plan 下写入 Plan/Spec/Review(首次创建放行)" "$PLAN_KEYWORD" "$PLAN_STATUS" 2>/dev/null || true
74
+ exit 0
75
75
  fi
76
76
  fi
77
77
  fi
@@ -140,10 +140,10 @@ if [ "$tool_name" = "Write" ] || [ "$tool_name" = "Edit" ] || [ "$tool_name" = "
140
140
  if type detect_active_add >/dev/null 2>&1; then
141
141
  state=$(detect_active_add 2>/dev/null || true)
142
142
  if [ -z "$state" ]; then
143
- echo " 正在写入 Plan/Spec/Review 文档但无活跃 ADD Plan——请先执行 add-paradigm" >&2
144
- echo "{\"hookSpecificOutput\":{\"hookEventName\":\"PreToolUse\",\"permissionDecision\":\"deny\",\"permissionDecisionReason\":\"Plan/Spec/Review 写入需要活跃 ADD Plan,请先执行 add-paradigm\"}}"
145
- write_hook_event "pre-tool-use" "deny" "$tool_name $file_path" "Plan/Spec/Review 写入需活跃 ADD Plan" "$PLAN_KEYWORD" "$PLAN_STATUS" 2>/dev/null || true
146
- exit 2
143
+ echo "[ADD 提示] 正在写入 Plan/Spec/Review 文档但无活跃 ADD Plan——首次创建场景放行,建议先执行 add-paradigm 生成 Plan+add-route" >&2
144
+ echo "{\"hookSpecificOutput\":{\"hookEventName\":\"PreToolUse\",\"permissionDecision\":\"allow\",\"permissionDecisionReason\":\"无活跃 ADD Plan 但为 Plan/Spec/Review 写入(首次创建场景),提示而非拦截\"}}"
145
+ write_hook_event "pre-tool-use" "info" "$tool_name $file_path" "无活跃 ADD Plan 下写入 Plan/Spec/Review(首次创建放行)" "$PLAN_KEYWORD" "$PLAN_STATUS" 2>/dev/null || true
146
+ exit 0
147
147
  fi
148
148
  fi
149
149
  fi
@@ -67,9 +67,9 @@ if [ "$tool_name" = "Write" ] || [ "$tool_name" = "Edit" ] || [ "$tool_name" = "
67
67
  if type detect_active_add >/dev/null 2>&1; then
68
68
  state=$(detect_active_add 2>/dev/null || true)
69
69
  if [ -z "$state" ]; then
70
- echo " 正在写入 Plan/Spec/Review 文档但无活跃 ADD Plan——请先执行 add-paradigm" >&2
71
- echo "{\"hookSpecificOutput\":{\"hookEventName\":\"PreToolUse\",\"permissionDecision\":\"deny\",\"permissionDecisionReason\":\"Plan/Spec/Review 写入需要活跃 ADD Plan,请先执行 add-paradigm\"}}"
72
- write_hook_event "pre-tool-use" "deny" "$file_path" "Plan/Spec/Review 写入需活跃 ADD Plan" "$PLAN_KEYWORD" "$PLAN_STATUS" 2>/dev/null || true
70
+ echo "[ADD 提示] 正在写入 Plan/Spec/Review 文档但无活跃 ADD Plan——首次创建场景放行,建议先执行 add-paradigm 生成 Plan+add-route" >&2
71
+ echo "{\"hookSpecificOutput\":{\"hookEventName\":\"PreToolUse\",\"permissionDecision\":\"allow\",\"permissionDecisionReason\":\"无活跃 ADD Plan 但为 Plan/Spec/Review 写入(首次创建场景),提示而非拦截\"}}"
72
+ write_hook_event "pre-tool-use" "info" "$file_path" "无活跃 ADD Plan 下写入 Plan/Spec/Review(首次创建放行)" "$PLAN_KEYWORD" "$PLAN_STATUS" 2>/dev/null || true
73
73
  exit $EXIT_BLOCK
74
74
  fi
75
75
  fi
@@ -140,10 +140,10 @@ if [ "$tool_name" = "Write" ] || [ "$tool_name" = "Edit" ] || [ "$tool_name" = "
140
140
  if type detect_active_add >/dev/null 2>&1; then
141
141
  state=$(detect_active_add 2>/dev/null || true)
142
142
  if [ -z "$state" ]; then
143
- echo " 正在写入 Plan/Spec/Review 文档但无活跃 ADD Plan——请先执行 add-paradigm" >&2
144
- echo "{\"hookSpecificOutput\":{\"hookEventName\":\"PreToolUse\",\"permissionDecision\":\"deny\",\"permissionDecisionReason\":\"Plan/Spec/Review 写入需要活跃 ADD Plan,请先执行 add-paradigm\"}}"
145
- write_hook_event "pre-tool-use" "deny" "$tool_name $file_path" "Plan/Spec/Review 写入需活跃 ADD Plan" "$PLAN_KEYWORD" "$PLAN_STATUS" 2>/dev/null || true
146
- exit 2
143
+ echo "[ADD 提示] 正在写入 Plan/Spec/Review 文档但无活跃 ADD Plan——首次创建场景放行,建议先执行 add-paradigm 生成 Plan+add-route" >&2
144
+ echo "{\"hookSpecificOutput\":{\"hookEventName\":\"PreToolUse\",\"permissionDecision\":\"allow\",\"permissionDecisionReason\":\"无活跃 ADD Plan 但为 Plan/Spec/Review 写入(首次创建场景),提示而非拦截\"}}"
145
+ write_hook_event "pre-tool-use" "info" "$tool_name $file_path" "无活跃 ADD Plan 下写入 Plan/Spec/Review(首次创建放行)" "$PLAN_KEYWORD" "$PLAN_STATUS" 2>/dev/null || true
146
+ exit 0
147
147
  fi
148
148
  fi
149
149
  fi
@@ -32,7 +32,8 @@ export function registerPlanTools(server: McpServer) {
32
32
  let targets: { name: string; path: string; keyword: string }[] = []
33
33
  const newPlans: string[] = []
34
34
  const allFiles = await readdirRecursive(plansDir)
35
- const planFiles = allFiles.filter(f => f.endsWith(".md") && f.includes("-plan-v"))
35
+ // 排除 .hitl.md(HITL 提案不是 Plan 本体,避免 plan_track 误扫为独立 Plan)
36
+ const planFiles = allFiles.filter(f => f.endsWith(".md") && !f.endsWith(".hitl.md") && f.includes("-plan-v"))
36
37
 
37
38
  if (pn) {
38
39
  const m = planFiles.find(f => f.includes(pn))