agentxchain 2.19.0 → 2.21.0
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 +2 -1
- package/scripts/release-bump.sh +126 -0
- package/scripts/release-preflight.sh +24 -1
- package/src/commands/demo.js +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentxchain",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.21.0",
|
|
4
4
|
"description": "CLI for AgentXchain — governed multi-agent software delivery",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"preflight:release:strict": "bash scripts/release-preflight.sh --strict",
|
|
29
29
|
"postflight:release": "bash scripts/release-postflight.sh",
|
|
30
30
|
"postflight:downstream": "bash scripts/release-downstream-truth.sh",
|
|
31
|
+
"bump:release": "bash scripts/release-bump.sh",
|
|
31
32
|
"sync:homebrew": "bash scripts/sync-homebrew.sh",
|
|
32
33
|
"build:macos": "bun build bin/agentxchain.js --compile --target=bun-darwin-arm64 --outfile=dist/agentxchain-macos-arm64",
|
|
33
34
|
"build:linux": "bun build bin/agentxchain.js --compile --target=bun-linux-x64 --outfile=dist/agentxchain-linux-x64",
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Release identity creation — replaces raw `npm version <semver>`.
|
|
3
|
+
# Creates version bump commit + annotated tag with fail-closed verification.
|
|
4
|
+
# Usage: bash scripts/release-bump.sh --target-version <semver>
|
|
5
|
+
set -euo pipefail
|
|
6
|
+
|
|
7
|
+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
8
|
+
CLI_DIR="${SCRIPT_DIR}/.."
|
|
9
|
+
cd "$CLI_DIR"
|
|
10
|
+
|
|
11
|
+
TARGET_VERSION=""
|
|
12
|
+
|
|
13
|
+
usage() {
|
|
14
|
+
echo "Usage: bash scripts/release-bump.sh --target-version <semver>" >&2
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
while [[ $# -gt 0 ]]; do
|
|
18
|
+
case "$1" in
|
|
19
|
+
--target-version)
|
|
20
|
+
if [[ -z "${2:-}" ]]; then
|
|
21
|
+
echo "Error: --target-version requires a semver argument" >&2
|
|
22
|
+
usage
|
|
23
|
+
exit 1
|
|
24
|
+
fi
|
|
25
|
+
if ! [[ "$2" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
|
26
|
+
echo "Error: invalid semver: $2" >&2
|
|
27
|
+
usage
|
|
28
|
+
exit 1
|
|
29
|
+
fi
|
|
30
|
+
TARGET_VERSION="$2"
|
|
31
|
+
shift 2
|
|
32
|
+
;;
|
|
33
|
+
*)
|
|
34
|
+
usage
|
|
35
|
+
exit 1
|
|
36
|
+
;;
|
|
37
|
+
esac
|
|
38
|
+
done
|
|
39
|
+
|
|
40
|
+
if [[ -z "$TARGET_VERSION" ]]; then
|
|
41
|
+
echo "Error: --target-version is required" >&2
|
|
42
|
+
usage
|
|
43
|
+
exit 1
|
|
44
|
+
fi
|
|
45
|
+
|
|
46
|
+
echo "AgentXchain Release Identity: ${TARGET_VERSION}"
|
|
47
|
+
echo "============================================="
|
|
48
|
+
|
|
49
|
+
# 1. Assert clean tree
|
|
50
|
+
echo "[1/7] Checking git tree cleanliness..."
|
|
51
|
+
if ! git diff --quiet HEAD 2>/dev/null || [ -n "$(git ls-files --others --exclude-standard 2>/dev/null)" ]; then
|
|
52
|
+
echo "FAIL: Working tree is not clean. Commit or stash changes before creating release identity." >&2
|
|
53
|
+
exit 1
|
|
54
|
+
fi
|
|
55
|
+
echo " OK: tree is clean"
|
|
56
|
+
|
|
57
|
+
# 2. Assert not already at target version
|
|
58
|
+
echo "[2/7] Checking current version..."
|
|
59
|
+
CURRENT_VERSION=$(node -e "console.log(JSON.parse(require('fs').readFileSync('package.json','utf8')).version)")
|
|
60
|
+
if [[ "$CURRENT_VERSION" == "$TARGET_VERSION" ]]; then
|
|
61
|
+
echo "FAIL: package.json is already at ${TARGET_VERSION}. Cannot double-bump." >&2
|
|
62
|
+
exit 1
|
|
63
|
+
fi
|
|
64
|
+
echo " OK: current version is ${CURRENT_VERSION}, bumping to ${TARGET_VERSION}"
|
|
65
|
+
|
|
66
|
+
# 3. Assert tag does not already exist
|
|
67
|
+
echo "[3/7] Checking for existing tag..."
|
|
68
|
+
if git rev-parse "v${TARGET_VERSION}" >/dev/null 2>&1; then
|
|
69
|
+
echo "FAIL: tag v${TARGET_VERSION} already exists. Delete it first or choose a different version." >&2
|
|
70
|
+
exit 1
|
|
71
|
+
fi
|
|
72
|
+
echo " OK: tag v${TARGET_VERSION} does not exist"
|
|
73
|
+
|
|
74
|
+
# 4. Update version files (no git operations)
|
|
75
|
+
echo "[4/7] Updating version files..."
|
|
76
|
+
npm version "$TARGET_VERSION" --no-git-tag-version
|
|
77
|
+
echo " OK: package.json updated to ${TARGET_VERSION}"
|
|
78
|
+
|
|
79
|
+
# 5. Stage version files
|
|
80
|
+
echo "[5/7] Staging version files..."
|
|
81
|
+
git add package.json
|
|
82
|
+
if [[ -f package-lock.json ]]; then
|
|
83
|
+
git add package-lock.json
|
|
84
|
+
fi
|
|
85
|
+
echo " OK: version files staged"
|
|
86
|
+
|
|
87
|
+
# 6. Create release commit
|
|
88
|
+
echo "[6/7] Creating release commit..."
|
|
89
|
+
git commit -m "${TARGET_VERSION}"
|
|
90
|
+
RELEASE_SHA=$(git rev-parse HEAD)
|
|
91
|
+
COMMIT_MSG=$(git log -1 --format=%s)
|
|
92
|
+
if [[ "$COMMIT_MSG" != "$TARGET_VERSION" ]]; then
|
|
93
|
+
echo "FAIL: commit message is '${COMMIT_MSG}', expected '${TARGET_VERSION}'" >&2
|
|
94
|
+
exit 1
|
|
95
|
+
fi
|
|
96
|
+
echo " OK: commit ${RELEASE_SHA:0:7} with message '${TARGET_VERSION}'"
|
|
97
|
+
|
|
98
|
+
# 7. Create annotated tag
|
|
99
|
+
echo "[7/7] Creating annotated tag..."
|
|
100
|
+
git tag -a "v${TARGET_VERSION}" -m "v${TARGET_VERSION}"
|
|
101
|
+
TAG_SHA=$(git rev-parse "v${TARGET_VERSION}")
|
|
102
|
+
if [[ -z "$TAG_SHA" ]]; then
|
|
103
|
+
echo "FAIL: tag v${TARGET_VERSION} was not created" >&2
|
|
104
|
+
exit 1
|
|
105
|
+
fi
|
|
106
|
+
TAG_TYPE=$(git cat-file -t "v${TARGET_VERSION}")
|
|
107
|
+
if [[ "$TAG_TYPE" != "tag" ]]; then
|
|
108
|
+
echo "FAIL: v${TARGET_VERSION} is ${TAG_TYPE}, expected annotated tag object" >&2
|
|
109
|
+
exit 1
|
|
110
|
+
fi
|
|
111
|
+
TAG_TARGET=$(git rev-parse "v${TARGET_VERSION}^{}")
|
|
112
|
+
if [[ "$TAG_TARGET" != "$RELEASE_SHA" ]]; then
|
|
113
|
+
echo "FAIL: tag v${TARGET_VERSION} resolves to ${TAG_TARGET:0:7}, expected ${RELEASE_SHA:0:7}" >&2
|
|
114
|
+
exit 1
|
|
115
|
+
fi
|
|
116
|
+
echo " OK: annotated tag v${TARGET_VERSION} at ${TAG_SHA:0:7} -> ${TAG_TARGET:0:7}"
|
|
117
|
+
|
|
118
|
+
echo ""
|
|
119
|
+
echo "============================================="
|
|
120
|
+
echo "Release identity created successfully."
|
|
121
|
+
echo " Version: ${TARGET_VERSION}"
|
|
122
|
+
echo " Commit: ${RELEASE_SHA:0:7}"
|
|
123
|
+
echo " Tag: v${TARGET_VERSION}"
|
|
124
|
+
echo ""
|
|
125
|
+
echo "Next: npm run preflight:release:strict -- --target-version ${TARGET_VERSION}"
|
|
126
|
+
echo "Then: git push origin main --follow-tags"
|
|
@@ -114,8 +114,31 @@ else
|
|
|
114
114
|
fi
|
|
115
115
|
TEST_PASS="$(printf '%s\n' "$TEST_OUTPUT" | awk '/^# pass / { print $3 }')"
|
|
116
116
|
TEST_FAIL="$(printf '%s\n' "$TEST_OUTPUT" | awk '/^# fail / { print $3 }')"
|
|
117
|
+
if [ -z "${TEST_PASS:-}" ]; then
|
|
118
|
+
VITEST_PASS="$(printf '%s\n' "$TEST_OUTPUT" | awk '/^[[:space:]]*Tests[[:space:]]+[0-9]+[[:space:]]+passed/ { for (i = 1; i <= NF; i++) if ($i ~ /^[0-9]+$/) { print $i; exit } }')"
|
|
119
|
+
NODE_PASS="$(printf '%s\n' "$TEST_OUTPUT" | awk '/^ℹ tests / { print $3; exit }')"
|
|
120
|
+
if [ -n "${VITEST_PASS:-}" ] && [ -n "${NODE_PASS:-}" ]; then
|
|
121
|
+
TEST_PASS="$((VITEST_PASS + NODE_PASS))"
|
|
122
|
+
elif [ -n "${NODE_PASS:-}" ]; then
|
|
123
|
+
TEST_PASS="${NODE_PASS}"
|
|
124
|
+
elif [ -n "${VITEST_PASS:-}" ]; then
|
|
125
|
+
TEST_PASS="${VITEST_PASS}"
|
|
126
|
+
fi
|
|
127
|
+
fi
|
|
128
|
+
if [ -z "${TEST_FAIL:-}" ]; then
|
|
129
|
+
NODE_FAIL="$(printf '%s\n' "$TEST_OUTPUT" | awk '/^ℹ fail / { print $3; exit }')"
|
|
130
|
+
if [ -n "${NODE_FAIL:-}" ]; then
|
|
131
|
+
TEST_FAIL="${NODE_FAIL}"
|
|
132
|
+
elif printf '%s\n' "$TEST_OUTPUT" | grep -Eq '^[[:space:]]*Tests[[:space:]]+[0-9]+[[:space:]]+passed'; then
|
|
133
|
+
TEST_FAIL=0
|
|
134
|
+
fi
|
|
135
|
+
fi
|
|
117
136
|
if [ "$TEST_STATUS" -eq 0 ] && [ "${TEST_FAIL:-0}" = "0" ]; then
|
|
118
|
-
|
|
137
|
+
if [ -n "${TEST_PASS:-}" ]; then
|
|
138
|
+
pass "${TEST_PASS} tests passed, 0 failures"
|
|
139
|
+
else
|
|
140
|
+
pass "npm test passed, 0 failures"
|
|
141
|
+
fi
|
|
119
142
|
else
|
|
120
143
|
fail "npm test failed"
|
|
121
144
|
printf '%s\n' "$TEST_OUTPUT" | tail -20
|
package/src/commands/demo.js
CHANGED
|
@@ -605,6 +605,7 @@ All acceptance criteria met. OBJ-002 (clock skew) noted for follow-up. OBJ-003 (
|
|
|
605
605
|
console.log(chalk.dim(' ─'.repeat(26)));
|
|
606
606
|
console.log('');
|
|
607
607
|
console.log(` ${chalk.bold('Try it for real:')} agentxchain init --governed`);
|
|
608
|
+
console.log(` ${chalk.bold('Step by step:')} https://agentxchain.dev/docs/first-turn`);
|
|
608
609
|
console.log(` ${chalk.bold('Read more:')} https://agentxchain.dev/docs/quickstart`);
|
|
609
610
|
console.log('');
|
|
610
611
|
}
|