add-coder 0.2.4 → 0.2.5

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.2.4",
3
+ "version": "0.2.5",
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": {
@@ -35,6 +35,8 @@ fi
35
35
  CONTENT=$(echo "$input" | jq -r '
36
36
  if .tool_input.file_content then .tool_input.file_content
37
37
  elif .tool_input.content then .tool_input.content
38
+ elif .tool_input.new_string then .tool_input.new_string
39
+ elif .tool_input.new_string then .tool_input.new_string
38
40
  elif .tool_input.replacements then .tool_input.replacements[0].new_text
39
41
  else "" end')
40
42
  # L24: PostToolUse 不可阻断(仅反馈),PreToolUse exit 2 + ask 可拦截
@@ -124,7 +126,7 @@ if [ ! -f "$SCHEMA_FILE" ]; then
124
126
  fi
125
127
 
126
128
  # SearchReplace 只传 patch(replacements[].new_text),不传全文件 → 跳过章节校验
127
- IS_SEARCH_REPLACE=$(echo "$input" | jq -r '.tool_input.replacements | length > 0 // false')
129
+ IS_SEARCH_REPLACE=$(echo "$input" | jq -r '(.tool_input.replacements | length > 0) or (.tool_input.new_string != null) // false')
128
130
 
129
131
  ISSUES=""
130
132
 
@@ -32,6 +32,8 @@ fi
32
32
  CONTENT=$(echo "$input" | jq -r '
33
33
  if .tool_input.file_content then .tool_input.file_content
34
34
  elif .tool_input.content then .tool_input.content
35
+ elif .tool_input.new_string then .tool_input.new_string
36
+ elif .tool_input.new_string then .tool_input.new_string
35
37
  elif .tool_input.replacements then .tool_input.replacements[0].new_text
36
38
  else "" end')
37
39
  # L24: PostToolUse 不可阻断(仅反馈),PreToolUse exit 2 + ask 可拦截
@@ -123,7 +125,7 @@ if [ ! -f "$SCHEMA_FILE" ]; then
123
125
  fi
124
126
 
125
127
  # SearchReplace 只传 patch(replacements[].new_text),不传全文件 → 跳过章节校验
126
- IS_SEARCH_REPLACE=$(echo "$input" | jq -r '.tool_input.replacements | length > 0 // false')
128
+ IS_SEARCH_REPLACE=$(echo "$input" | jq -r '(.tool_input.replacements | length > 0) or (.tool_input.new_string != null) // false')
127
129
 
128
130
  ISSUES=""
129
131
 
@@ -35,6 +35,8 @@ fi
35
35
  CONTENT=$(echo "$input" | jq -r '
36
36
  if .tool_input.file_content then .tool_input.file_content
37
37
  elif .tool_input.content then .tool_input.content
38
+ elif .tool_input.new_string then .tool_input.new_string
39
+ elif .tool_input.new_string then .tool_input.new_string
38
40
  elif .tool_input.replacements then .tool_input.replacements[0].new_text
39
41
  else "" end')
40
42
  # L24: PostToolUse 不可阻断(仅反馈),PreToolUse exit 2 + ask 可拦截
@@ -126,7 +128,7 @@ if [ ! -f "$SCHEMA_FILE" ]; then
126
128
  fi
127
129
 
128
130
  # SearchReplace 只传 patch(replacements[].new_text),不传全文件 → 跳过章节校验
129
- IS_SEARCH_REPLACE=$(echo "$input" | jq -r '.tool_input.replacements | length > 0 // false')
131
+ IS_SEARCH_REPLACE=$(echo "$input" | jq -r '(.tool_input.replacements | length > 0) or (.tool_input.new_string != null) // false')
130
132
 
131
133
  ISSUES=""
132
134
 
@@ -32,6 +32,8 @@ fi
32
32
  CONTENT=$(echo "$input" | jq -r '
33
33
  if .tool_input.file_content then .tool_input.file_content
34
34
  elif .tool_input.content then .tool_input.content
35
+ elif .tool_input.new_string then .tool_input.new_string
36
+ elif .tool_input.new_string then .tool_input.new_string
35
37
  elif .tool_input.replacements then .tool_input.replacements[0].new_text
36
38
  else "" end')
37
39
  # L24: PostToolUse 不可阻断(仅反馈),PreToolUse exit 2 + ask 可拦截
@@ -123,7 +125,7 @@ if [ ! -f "$SCHEMA_FILE" ]; then
123
125
  fi
124
126
 
125
127
  # SearchReplace 只传 patch(replacements[].new_text),不传全文件 → 跳过章节校验
126
- IS_SEARCH_REPLACE=$(echo "$input" | jq -r '.tool_input.replacements | length > 0 // false')
128
+ IS_SEARCH_REPLACE=$(echo "$input" | jq -r '(.tool_input.replacements | length > 0) or (.tool_input.new_string != null) // false')
127
129
 
128
130
  ISSUES=""
129
131
 
@@ -35,6 +35,8 @@ fi
35
35
  CONTENT=$(echo "$input" | jq -r '
36
36
  if .tool_input.file_content then .tool_input.file_content
37
37
  elif .tool_input.content then .tool_input.content
38
+ elif .tool_input.new_string then .tool_input.new_string
39
+ elif .tool_input.new_string then .tool_input.new_string
38
40
  elif .tool_input.replacements then .tool_input.replacements[0].new_text
39
41
  else "" end')
40
42
  # L24: PostToolUse 不可阻断(仅反馈),PreToolUse exit 2 + ask 可拦截
@@ -124,7 +126,7 @@ if [ ! -f "$SCHEMA_FILE" ]; then
124
126
  fi
125
127
 
126
128
  # SearchReplace 只传 patch(replacements[].new_text),不传全文件 → 跳过章节校验
127
- IS_SEARCH_REPLACE=$(echo "$input" | jq -r '.tool_input.replacements | length > 0 // false')
129
+ IS_SEARCH_REPLACE=$(echo "$input" | jq -r '(.tool_input.replacements | length > 0) or (.tool_input.new_string != null) // false')
128
130
 
129
131
  ISSUES=""
130
132
 
@@ -35,6 +35,8 @@ fi
35
35
  CONTENT=$(echo "$input" | jq -r '
36
36
  if .tool_input.file_content then .tool_input.file_content
37
37
  elif .tool_input.content then .tool_input.content
38
+ elif .tool_input.new_string then .tool_input.new_string
39
+ elif .tool_input.new_string then .tool_input.new_string
38
40
  elif .tool_input.replacements then .tool_input.replacements[0].new_text
39
41
  else "" end')
40
42
  # L24: PostToolUse 不可阻断(仅反馈),PreToolUse exit 2 + ask 可拦截
@@ -126,7 +128,7 @@ if [ ! -f "$SCHEMA_FILE" ]; then
126
128
  fi
127
129
 
128
130
  # SearchReplace 只传 patch(replacements[].new_text),不传全文件 → 跳过章节校验
129
- IS_SEARCH_REPLACE=$(echo "$input" | jq -r '.tool_input.replacements | length > 0 // false')
131
+ IS_SEARCH_REPLACE=$(echo "$input" | jq -r '(.tool_input.replacements | length > 0) or (.tool_input.new_string != null) // false')
130
132
 
131
133
  ISSUES=""
132
134