@lvlup-sw/exarchos 2.6.1 → 2.7.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvlup-sw/exarchos",
3
- "version": "2.6.1",
3
+ "version": "2.7.0",
4
4
  "description": "Structure for agentic development — durable SDLC workflows, convergence gates, agent teams, and audit trails for Claude Code",
5
5
  "type": "module",
6
6
  "bin": {
@@ -0,0 +1,147 @@
1
+ #!/usr/bin/env bash
2
+ # sync-marketplace.sh — Update the lvlup-sw marketplace clone with the current version,
3
+ # commit, push, and prune stale cache entries.
4
+ #
5
+ # Called by the /release command after npm publish and local cache sync.
6
+ # Can also be run standalone to fix drift: `bash scripts/sync-marketplace.sh`
7
+ #
8
+ # Flags:
9
+ # --check Verify marketplace is in sync without modifying anything (exit 1 on drift)
10
+ # --no-push Update locally but don't push to remote
11
+ set -euo pipefail
12
+
13
+ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
14
+ REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
15
+ MARKETPLACE_DIR="${HOME}/.claude/plugins/marketplaces/lvlup-sw"
16
+ MARKETPLACE_JSON="${MARKETPLACE_DIR}/.claude-plugin/marketplace.json"
17
+ CACHE_DIR="${HOME}/.claude/plugins/cache/lvlup-sw/exarchos"
18
+ INSTALLED_JSON="${HOME}/.claude/plugins/installed_plugins.json"
19
+
20
+ CHECK_MODE=false
21
+ NO_PUSH=false
22
+
23
+ while [[ $# -gt 0 ]]; do
24
+ case "$1" in
25
+ --check) CHECK_MODE=true; shift ;;
26
+ --no-push) NO_PUSH=true; shift ;;
27
+ *) echo "Unknown flag: $1" >&2; exit 2 ;;
28
+ esac
29
+ done
30
+
31
+ if ! command -v jq &>/dev/null; then
32
+ echo "Error: jq is required. Install with: sudo apt install jq" >&2
33
+ exit 2
34
+ fi
35
+
36
+ VERSION=$(node -e "console.log(require('${REPO_ROOT}/package.json').version)")
37
+
38
+ if [[ ! -d "$MARKETPLACE_DIR" ]]; then
39
+ echo "Error: marketplace clone not found at ${MARKETPLACE_DIR}" >&2
40
+ exit 2
41
+ fi
42
+
43
+ if [[ ! -f "$MARKETPLACE_JSON" ]]; then
44
+ echo "Error: marketplace.json not found at ${MARKETPLACE_JSON}" >&2
45
+ exit 2
46
+ fi
47
+
48
+ CURRENT_MKT_VERSION=$(jq -r '.plugins[] | select(.name=="exarchos") | .version' "$MARKETPLACE_JSON")
49
+
50
+ if [[ "$CHECK_MODE" == "true" ]]; then
51
+ ERRORS=0
52
+
53
+ if [[ "$CURRENT_MKT_VERSION" != "$VERSION" ]]; then
54
+ echo "DRIFT: marketplace declares exarchos ${CURRENT_MKT_VERSION}, repo is ${VERSION}" >&2
55
+ ((ERRORS++)) || true
56
+ fi
57
+
58
+ # Check installed_plugins.json
59
+ if [[ -f "$INSTALLED_JSON" ]]; then
60
+ INSTALLED_VERSION=$(jq -r '.plugins["exarchos@lvlup-sw"][0].version' "$INSTALLED_JSON")
61
+ if [[ "$INSTALLED_VERSION" != "$VERSION" ]]; then
62
+ echo "DRIFT: installed_plugins.json points to ${INSTALLED_VERSION}, repo is ${VERSION}" >&2
63
+ ((ERRORS++)) || true
64
+ fi
65
+ INSTALLED_PATH=$(jq -r '.plugins["exarchos@lvlup-sw"][0].installPath' "$INSTALLED_JSON")
66
+ if [[ ! -d "$INSTALLED_PATH" ]]; then
67
+ echo "BROKEN: installed_plugins.json points to missing path ${INSTALLED_PATH}" >&2
68
+ ((ERRORS++)) || true
69
+ fi
70
+ fi
71
+
72
+ # Check for stale cache entries
73
+ if [[ -d "$CACHE_DIR" ]]; then
74
+ STALE=$(find "$CACHE_DIR" -maxdepth 1 -mindepth 1 -type d -not -name "$VERSION" 2>/dev/null)
75
+ if [[ -n "$STALE" ]]; then
76
+ echo "STALE: found old cache entries (harmless but wasteful):" >&2
77
+ echo "$STALE" | sed 's/^/ /' >&2
78
+ fi
79
+ fi
80
+
81
+ if [[ $ERRORS -gt 0 ]]; then
82
+ echo "Marketplace check FAILED (${ERRORS} issue(s))" >&2
83
+ exit 1
84
+ fi
85
+ echo "Marketplace in sync: exarchos v${VERSION}"
86
+ exit 0
87
+ fi
88
+
89
+ # --- Update mode ---
90
+
91
+ echo "Syncing marketplace to exarchos v${VERSION}..."
92
+
93
+ # 1. Update marketplace.json — only the exarchos entry
94
+ jq --arg v "$VERSION" '
95
+ .plugins = [.plugins[] |
96
+ if .name == "exarchos" then
97
+ .version = $v | .source.version = $v
98
+ else .
99
+ end
100
+ ]
101
+ ' "$MARKETPLACE_JSON" > "${MARKETPLACE_JSON}.tmp"
102
+ mv "${MARKETPLACE_JSON}.tmp" "$MARKETPLACE_JSON"
103
+
104
+ echo " Updated marketplace.json: exarchos → v${VERSION}"
105
+
106
+ # 2. Commit and push if there are changes
107
+ cd "$MARKETPLACE_DIR"
108
+ if ! git diff --quiet .claude-plugin/marketplace.json 2>/dev/null; then
109
+ git add .claude-plugin/marketplace.json
110
+ git commit -m "chore: bump exarchos to ${VERSION} in marketplace"
111
+
112
+ if [[ "$NO_PUSH" == "false" ]]; then
113
+ git push origin main 2>&1 | tail -3
114
+ echo " Pushed marketplace update to remote"
115
+ else
116
+ echo " Committed locally (--no-push)"
117
+ fi
118
+ else
119
+ echo " marketplace.json already at v${VERSION}, no commit needed"
120
+ fi
121
+
122
+ # 3. Prune stale cache entries
123
+ if [[ -d "$CACHE_DIR" ]]; then
124
+ PRUNED=0
125
+ for entry in "$CACHE_DIR"/*/; do
126
+ entry_name=$(basename "$entry")
127
+ if [[ "$entry_name" != "$VERSION" ]]; then
128
+ rm -rf "$entry"
129
+ echo " Pruned stale cache: ${entry_name}"
130
+ ((PRUNED++)) || true
131
+ fi
132
+ done
133
+ if [[ $PRUNED -eq 0 ]]; then
134
+ echo " No stale cache entries to prune"
135
+ fi
136
+ fi
137
+
138
+ # 4. Verify installed_plugins.json
139
+ if [[ -f "$INSTALLED_JSON" ]]; then
140
+ INSTALLED_VERSION=$(jq -r '.plugins["exarchos@lvlup-sw"][0].version' "$INSTALLED_JSON")
141
+ if [[ "$INSTALLED_VERSION" != "$VERSION" ]]; then
142
+ echo " WARNING: installed_plugins.json still points to v${INSTALLED_VERSION}"
143
+ echo " Run step 5 of /release to update it"
144
+ fi
145
+ fi
146
+
147
+ echo "Done."