agenshield 0.10.2 → 0.10.3-alpha.34fa4f6.552
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/bin/agenshield +13 -1
- package/package.json +4 -4
package/bin/agenshield
CHANGED
|
@@ -35,7 +35,19 @@ PKG_ROOT=""
|
|
|
35
35
|
WRAPPER_PKG_JSON="$SCRIPT_DIR/../package.json"
|
|
36
36
|
WRAPPER_VERSION=""
|
|
37
37
|
if [ -f "$WRAPPER_PKG_JSON" ]; then
|
|
38
|
-
|
|
38
|
+
# Prefer node — guaranteed present for npx and immune to minified JSON.
|
|
39
|
+
# The earlier awk-only parser silently returned the wrong field when
|
|
40
|
+
# the package.json was on a single line (npm/yarn sometimes reformat
|
|
41
|
+
# before publish), which let `npx agenshield@<v>` boot with an empty
|
|
42
|
+
# WRAPPER_VERSION and silently no-op `upgrade` as "already at <old>".
|
|
43
|
+
if command -v node >/dev/null 2>&1; then
|
|
44
|
+
WRAPPER_VERSION=$(node -e "try{process.stdout.write(String(JSON.parse(require('fs').readFileSync(process.argv[1],'utf8')).version||''))}catch(_){}" "$WRAPPER_PKG_JSON" 2>/dev/null || true)
|
|
45
|
+
fi
|
|
46
|
+
# awk fallback for non-node environments (direct shell invocation,
|
|
47
|
+
# `agenshield` symlink dragged outside npx, etc.). Multi-line JSON only.
|
|
48
|
+
if [ -z "$WRAPPER_VERSION" ]; then
|
|
49
|
+
WRAPPER_VERSION=$(/usr/bin/awk -F'"' '/"version"/ { print $4; exit }' "$WRAPPER_PKG_JSON" 2>/dev/null || true)
|
|
50
|
+
fi
|
|
39
51
|
fi
|
|
40
52
|
|
|
41
53
|
# 1. Local dist layout: dist/npm/agenshield/bin/ → ../../darwin-arm64/
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agenshield",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.3-alpha.34fa4f6.552",
|
|
4
4
|
"description": "AgenShield — AI Agent Security Platform",
|
|
5
5
|
"bin": {
|
|
6
6
|
"agenshield": "bin/agenshield"
|
|
7
7
|
},
|
|
8
8
|
"optionalDependencies": {
|
|
9
|
-
"@agenshield/cli-darwin-arm64": "0.10.
|
|
10
|
-
"@agenshield/cli-darwin-x64": "0.10.
|
|
11
|
-
"@agenshield/cli-linux-x64": "0.10.
|
|
9
|
+
"@agenshield/cli-darwin-arm64": "0.10.3-alpha.34fa4f6.552",
|
|
10
|
+
"@agenshield/cli-darwin-x64": "0.10.3-alpha.34fa4f6.552",
|
|
11
|
+
"@agenshield/cli-linux-x64": "0.10.3-alpha.34fa4f6.552"
|
|
12
12
|
},
|
|
13
13
|
"files": [
|
|
14
14
|
"bin/"
|