myconvergio 2.1.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/.claude/agents/business_operations/andrea-customer-success-manager.md +175 -0
- package/.claude/agents/business_operations/anna-executive-assistant.md +268 -0
- package/.claude/agents/business_operations/dave-change-management-specialist.md +200 -0
- package/.claude/agents/business_operations/davide-project-manager.md +203 -0
- package/.claude/agents/business_operations/enrico-business-process-engineer.md +180 -0
- package/.claude/agents/business_operations/fabio-sales-business-development.md +175 -0
- package/.claude/agents/business_operations/luke-program-manager.md +105 -0
- package/.claude/agents/business_operations/marcello-pm.md +130 -0
- package/.claude/agents/business_operations/oliver-pm.md +134 -0
- package/.claude/agents/business_operations/sofia-marketing-strategist.md +175 -0
- package/.claude/agents/business_operations/steve-executive-communication-strategist.md +111 -0
- package/.claude/agents/compliance_legal/dr-enzo-healthcare-compliance-manager.md +198 -0
- package/.claude/agents/compliance_legal/elena-legal-compliance-expert.md +169 -0
- package/.claude/agents/compliance_legal/guardian-ai-security-validator.md +207 -0
- package/.claude/agents/compliance_legal/luca-security-expert.md +229 -0
- package/.claude/agents/compliance_legal/sophia-govaffairs.md +132 -0
- package/.claude/agents/core_utility/CONSTITUTION.md +365 -0
- package/.claude/agents/core_utility/CommonValuesAndPrinciples.md +296 -0
- package/.claude/agents/core_utility/MICROSOFT_VALUES.md +121 -0
- package/.claude/agents/core_utility/SECURITY_FRAMEWORK_TEMPLATE.md +137 -0
- package/.claude/agents/core_utility/diana-performance-dashboard.md +238 -0
- package/.claude/agents/core_utility/marcus-context-memory-keeper.md +218 -0
- package/.claude/agents/core_utility/po-prompt-optimizer.md +194 -0
- package/.claude/agents/core_utility/socrates-first-principles-reasoning.md +260 -0
- package/.claude/agents/core_utility/strategic-planner.md +292 -0
- package/.claude/agents/core_utility/taskmaster-strategic-task-decomposition-master.md +152 -0
- package/.claude/agents/core_utility/thor-quality-assurance-guardian.md +223 -0
- package/.claude/agents/core_utility/wanda-workflow-orchestrator.md +247 -0
- package/.claude/agents/core_utility/xavier-coordination-patterns.md +251 -0
- package/.claude/agents/design_ux/jony-creative-director.md +172 -0
- package/.claude/agents/design_ux/sara-ux-ui-designer.md +166 -0
- package/.claude/agents/design_ux/stefano-design-thinking-facilitator.md +180 -0
- package/.claude/agents/leadership_strategy/ali-chief-of-staff.md +594 -0
- package/.claude/agents/leadership_strategy/amy-cfo.md +179 -0
- package/.claude/agents/leadership_strategy/antonio-strategy-expert.md +217 -0
- package/.claude/agents/leadership_strategy/dan-engineering-gm.md +260 -0
- package/.claude/agents/leadership_strategy/domik-mckinsey-strategic-decision-maker.md +324 -0
- package/.claude/agents/leadership_strategy/matteo-strategic-business-architect.md +177 -0
- package/.claude/agents/leadership_strategy/satya-board-of-directors.md +222 -0
- package/.claude/agents/release_management/app-release-manager.md +2352 -0
- package/.claude/agents/release_management/feature-release-manager.md +235 -0
- package/.claude/agents/specialized_experts/angela-da.md +140 -0
- package/.claude/agents/specialized_experts/ava-analytics-insights-virtuoso.md +203 -0
- package/.claude/agents/specialized_experts/behice-cultural-coach.md +202 -0
- package/.claude/agents/specialized_experts/coach-team-coach.md +180 -0
- package/.claude/agents/specialized_experts/ethan-da.md +139 -0
- package/.claude/agents/specialized_experts/evan-ic6da.md +140 -0
- package/.claude/agents/specialized_experts/fiona-market-analyst.md +148 -0
- package/.claude/agents/specialized_experts/giulia-hr-talent-acquisition.md +175 -0
- package/.claude/agents/specialized_experts/jenny-inclusive-accessibility-champion.md +200 -0
- package/.claude/agents/specialized_experts/michael-vc.md +130 -0
- package/.claude/agents/specialized_experts/riccardo-storyteller.md +158 -0
- package/.claude/agents/specialized_experts/sam-startupper.md +253 -0
- package/.claude/agents/specialized_experts/wiz-investor-venture-capital.md +182 -0
- package/.claude/agents/technical_development/baccio-tech-architect.md +210 -0
- package/.claude/agents/technical_development/dario-debugger.md +250 -0
- package/.claude/agents/technical_development/marco-devops-engineer.md +200 -0
- package/.claude/agents/technical_development/omri-data-scientist.md +194 -0
- package/.claude/agents/technical_development/otto-performance-optimizer.md +262 -0
- package/.claude/agents/technical_development/paolo-best-practices-enforcer.md +303 -0
- package/.claude/agents/technical_development/rex-code-reviewer.md +231 -0
- package/.claude/rules/api-development.md +358 -0
- package/.claude/rules/code-style.md +129 -0
- package/.claude/rules/documentation-standards.md +359 -0
- package/.claude/rules/ethical-guidelines.md +383 -0
- package/.claude/rules/security-requirements.md +182 -0
- package/.claude/rules/testing-standards.md +266 -0
- package/.claude/skills/architecture/SKILL.md +228 -0
- package/.claude/skills/code-review/SKILL.md +140 -0
- package/.claude/skills/debugging/SKILL.md +192 -0
- package/.claude/skills/performance/SKILL.md +277 -0
- package/.claude/skills/project-management/SKILL.md +382 -0
- package/.claude/skills/release-management/SKILL.md +342 -0
- package/.claude/skills/security-audit/SKILL.md +276 -0
- package/.claude/skills/strategic-analysis/SKILL.md +338 -0
- package/LICENSE +60 -0
- package/README.md +379 -0
- package/VERSION +29 -0
- package/bin/myconvergio.js +304 -0
- package/package.json +43 -0
- package/scripts/bump-agent-version.sh +220 -0
- package/scripts/postinstall.js +172 -0
- package/scripts/sync-from-convergiocli.sh +169 -0
- package/scripts/test-deployment.sh +188 -0
- package/scripts/version-manager.sh +213 -0
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# =============================================================================
|
|
4
|
+
# MYCONVERGIO DEPLOYMENT TEST SCRIPT
|
|
5
|
+
# =============================================================================
|
|
6
|
+
# Tests the agent deployment and validation
|
|
7
|
+
# =============================================================================
|
|
8
|
+
|
|
9
|
+
set -e
|
|
10
|
+
|
|
11
|
+
# Colors
|
|
12
|
+
RED='\033[0;31m'
|
|
13
|
+
GREEN='\033[0;32m'
|
|
14
|
+
BLUE='\033[0;34m'
|
|
15
|
+
YELLOW='\033[1;33m'
|
|
16
|
+
NC='\033[0m'
|
|
17
|
+
|
|
18
|
+
# Directories
|
|
19
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
20
|
+
ROOT_DIR="$(dirname "$SCRIPT_DIR")"
|
|
21
|
+
AGENTS_DIR="$ROOT_DIR/.claude/agents"
|
|
22
|
+
TEST_DIR="/tmp/myconvergio-test-$$"
|
|
23
|
+
|
|
24
|
+
# Counters
|
|
25
|
+
PASSED=0
|
|
26
|
+
FAILED=0
|
|
27
|
+
|
|
28
|
+
# Cleanup on exit
|
|
29
|
+
cleanup() {
|
|
30
|
+
rm -rf "$TEST_DIR"
|
|
31
|
+
}
|
|
32
|
+
trap cleanup EXIT
|
|
33
|
+
|
|
34
|
+
echo -e "${BLUE}MyConvergio Deployment Tests${NC}"
|
|
35
|
+
echo "======================================"
|
|
36
|
+
echo ""
|
|
37
|
+
|
|
38
|
+
# Function to run a test
|
|
39
|
+
run_test() {
|
|
40
|
+
local test_name="$1"
|
|
41
|
+
local test_cmd="$2"
|
|
42
|
+
local expected="${3:-0}"
|
|
43
|
+
|
|
44
|
+
echo -n "Testing: $test_name... "
|
|
45
|
+
|
|
46
|
+
set +e
|
|
47
|
+
eval "$test_cmd" >/dev/null 2>&1
|
|
48
|
+
local result=$?
|
|
49
|
+
set -e
|
|
50
|
+
|
|
51
|
+
if [ "$result" -eq "$expected" ]; then
|
|
52
|
+
echo -e "${GREEN}PASS${NC}"
|
|
53
|
+
PASSED=$((PASSED + 1))
|
|
54
|
+
return 0
|
|
55
|
+
else
|
|
56
|
+
echo -e "${RED}FAIL${NC}"
|
|
57
|
+
FAILED=$((FAILED + 1))
|
|
58
|
+
return 1
|
|
59
|
+
fi
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
# =============================================================================
|
|
63
|
+
# TEST 1: Directory structure
|
|
64
|
+
# =============================================================================
|
|
65
|
+
echo -e "${BLUE}Test Suite: Directory Structure${NC}"
|
|
66
|
+
|
|
67
|
+
run_test "Agents directory exists" "[ -d '$AGENTS_DIR' ]"
|
|
68
|
+
run_test "Rules directory exists" "[ -d '$ROOT_DIR/.claude/rules' ]"
|
|
69
|
+
run_test "Skills directory exists" "[ -d '$ROOT_DIR/.claude/skills' ]"
|
|
70
|
+
run_test "Makefile exists" "[ -f '$ROOT_DIR/Makefile' ]"
|
|
71
|
+
run_test "VERSION file exists" "[ -f '$ROOT_DIR/VERSION' ]"
|
|
72
|
+
|
|
73
|
+
echo ""
|
|
74
|
+
|
|
75
|
+
# =============================================================================
|
|
76
|
+
# TEST 2: Agent file validation
|
|
77
|
+
# =============================================================================
|
|
78
|
+
echo -e "${BLUE}Test Suite: Agent Files${NC}"
|
|
79
|
+
|
|
80
|
+
# Count agents
|
|
81
|
+
AGENT_COUNT=$(find "$AGENTS_DIR" -name '*.md' ! -name 'CONSTITUTION.md' ! -name 'CommonValuesAndPrinciples.md' ! -name 'SECURITY_FRAMEWORK_TEMPLATE.md' ! -name 'MICROSOFT_VALUES.md' 2>/dev/null | wc -l | tr -d ' ')
|
|
82
|
+
run_test "At least 50 agents exist ($AGENT_COUNT found)" "[ '$AGENT_COUNT' -ge 50 ]"
|
|
83
|
+
|
|
84
|
+
# Check YAML frontmatter
|
|
85
|
+
YAML_ERRORS=0
|
|
86
|
+
for file in $(find "$AGENTS_DIR" -name '*.md' ! -name 'CONSTITUTION.md' ! -name 'CommonValuesAndPrinciples.md' ! -name 'SECURITY_FRAMEWORK_TEMPLATE.md' ! -name 'MICROSOFT_VALUES.md'); do
|
|
87
|
+
if ! head -1 "$file" | grep -q '^---$'; then
|
|
88
|
+
YAML_ERRORS=$((YAML_ERRORS + 1))
|
|
89
|
+
fi
|
|
90
|
+
done
|
|
91
|
+
run_test "All agents have YAML frontmatter ($YAML_ERRORS errors)" "[ '$YAML_ERRORS' -eq 0 ]"
|
|
92
|
+
|
|
93
|
+
# Check for required fields
|
|
94
|
+
MISSING_NAME=0
|
|
95
|
+
MISSING_DESC=0
|
|
96
|
+
for file in $(find "$AGENTS_DIR" -name '*.md' ! -name 'CONSTITUTION.md' ! -name 'CommonValuesAndPrinciples.md' ! -name 'SECURITY_FRAMEWORK_TEMPLATE.md' ! -name 'MICROSOFT_VALUES.md'); do
|
|
97
|
+
if ! grep -q '^name:' "$file"; then
|
|
98
|
+
MISSING_NAME=$((MISSING_NAME + 1))
|
|
99
|
+
fi
|
|
100
|
+
if ! grep -q '^description:' "$file"; then
|
|
101
|
+
MISSING_DESC=$((MISSING_DESC + 1))
|
|
102
|
+
fi
|
|
103
|
+
done
|
|
104
|
+
run_test "All agents have 'name' field ($MISSING_NAME missing)" "[ '$MISSING_NAME' -eq 0 ]"
|
|
105
|
+
run_test "All agents have 'description' field ($MISSING_DESC missing)" "[ '$MISSING_DESC' -eq 0 ]"
|
|
106
|
+
|
|
107
|
+
echo ""
|
|
108
|
+
|
|
109
|
+
# =============================================================================
|
|
110
|
+
# TEST 3: Constitution compliance
|
|
111
|
+
# =============================================================================
|
|
112
|
+
echo -e "${BLUE}Test Suite: Constitution Compliance${NC}"
|
|
113
|
+
|
|
114
|
+
CONSTITUTION="$AGENTS_DIR/core_utility/CONSTITUTION.md"
|
|
115
|
+
run_test "CONSTITUTION.md exists" "[ -f '$CONSTITUTION' ]"
|
|
116
|
+
|
|
117
|
+
if [ -f "$CONSTITUTION" ]; then
|
|
118
|
+
run_test "Constitution has Article I (Identity)" "grep -q 'Article I' '$CONSTITUTION'"
|
|
119
|
+
run_test "Constitution has Article VII (Accessibility)" "grep -q 'Article VII' '$CONSTITUTION'"
|
|
120
|
+
run_test "Constitution mentions 'NON-NEGOTIABLE'" "grep -q 'NON-NEGOTIABLE' '$CONSTITUTION'"
|
|
121
|
+
fi
|
|
122
|
+
|
|
123
|
+
echo ""
|
|
124
|
+
|
|
125
|
+
# =============================================================================
|
|
126
|
+
# TEST 4: Category structure
|
|
127
|
+
# =============================================================================
|
|
128
|
+
echo -e "${BLUE}Test Suite: Agent Categories${NC}"
|
|
129
|
+
|
|
130
|
+
EXPECTED_CATEGORIES=(
|
|
131
|
+
"leadership_strategy"
|
|
132
|
+
"technical_development"
|
|
133
|
+
"business_operations"
|
|
134
|
+
"design_ux"
|
|
135
|
+
"compliance_legal"
|
|
136
|
+
"specialized_experts"
|
|
137
|
+
"core_utility"
|
|
138
|
+
"release_management"
|
|
139
|
+
)
|
|
140
|
+
|
|
141
|
+
for category in "${EXPECTED_CATEGORIES[@]}"; do
|
|
142
|
+
run_test "Category '$category' exists" "[ -d '$AGENTS_DIR/$category' ]"
|
|
143
|
+
done
|
|
144
|
+
|
|
145
|
+
echo ""
|
|
146
|
+
|
|
147
|
+
# =============================================================================
|
|
148
|
+
# TEST 5: No legacy files
|
|
149
|
+
# =============================================================================
|
|
150
|
+
echo -e "${BLUE}Test Suite: Legacy Cleanup${NC}"
|
|
151
|
+
|
|
152
|
+
run_test "No claude-agents/ folder" "[ ! -d '$ROOT_DIR/claude-agents' ]"
|
|
153
|
+
run_test "No claude-agenti/ folder" "[ ! -d '$ROOT_DIR/claude-agenti' ]"
|
|
154
|
+
run_test "No start.sh script" "[ ! -f '$ROOT_DIR/start.sh' ]"
|
|
155
|
+
run_test "No translate-agents.sh script" "[ ! -f '$ROOT_DIR/scripts/translate-agents.sh' ]"
|
|
156
|
+
|
|
157
|
+
echo ""
|
|
158
|
+
|
|
159
|
+
# =============================================================================
|
|
160
|
+
# TEST 6: Makefile commands
|
|
161
|
+
# =============================================================================
|
|
162
|
+
echo -e "${BLUE}Test Suite: Makefile Commands${NC}"
|
|
163
|
+
|
|
164
|
+
mkdir -p "$TEST_DIR"
|
|
165
|
+
|
|
166
|
+
run_test "make help works" "cd '$ROOT_DIR' && make help"
|
|
167
|
+
run_test "make version works" "cd '$ROOT_DIR' && make version"
|
|
168
|
+
run_test "make lint works" "cd '$ROOT_DIR' && make lint"
|
|
169
|
+
|
|
170
|
+
echo ""
|
|
171
|
+
|
|
172
|
+
# =============================================================================
|
|
173
|
+
# Summary
|
|
174
|
+
# =============================================================================
|
|
175
|
+
echo "======================================"
|
|
176
|
+
echo -e "${BLUE}Test Summary${NC}"
|
|
177
|
+
echo "======================================"
|
|
178
|
+
echo -e "Passed: ${GREEN}$PASSED${NC}"
|
|
179
|
+
echo -e "Failed: ${RED}$FAILED${NC}"
|
|
180
|
+
echo ""
|
|
181
|
+
|
|
182
|
+
if [ "$FAILED" -eq 0 ]; then
|
|
183
|
+
echo -e "${GREEN}✅ All tests passed!${NC}"
|
|
184
|
+
exit 0
|
|
185
|
+
else
|
|
186
|
+
echo -e "${RED}❌ Some tests failed${NC}"
|
|
187
|
+
exit 1
|
|
188
|
+
fi
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# =============================================================================
|
|
4
|
+
# MYCONVERGIO VERSION MANAGER
|
|
5
|
+
# =============================================================================
|
|
6
|
+
# Handles version management for both the MyConvergio system and individual agents
|
|
7
|
+
# Updated for .claude/agents/ directory structure (WAVE 5)
|
|
8
|
+
# Version: 1.1.0
|
|
9
|
+
# =============================================================================
|
|
10
|
+
|
|
11
|
+
# Enable error handling and debugging
|
|
12
|
+
set -euo pipefail
|
|
13
|
+
|
|
14
|
+
# Colors for output
|
|
15
|
+
RED='\033[0;31m'
|
|
16
|
+
GREEN='\033[0;32m'
|
|
17
|
+
BLUE='\033[0;34m'
|
|
18
|
+
YELLOW='\033[1;33m'
|
|
19
|
+
NC='\033[0m' # No Color
|
|
20
|
+
|
|
21
|
+
# Paths
|
|
22
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
23
|
+
ROOT_DIR="$(dirname "$SCRIPT_DIR")"
|
|
24
|
+
VERSION_FILE="$ROOT_DIR/VERSION"
|
|
25
|
+
AGENTS_DIR="$ROOT_DIR/.claude/agents"
|
|
26
|
+
|
|
27
|
+
# Load version file
|
|
28
|
+
load_version_file() {
|
|
29
|
+
if [ ! -f "$VERSION_FILE" ]; then
|
|
30
|
+
echo -e "${RED}Error: Version file not found at $VERSION_FILE${NC}" >&2
|
|
31
|
+
exit 1
|
|
32
|
+
fi
|
|
33
|
+
|
|
34
|
+
# Source the version file to get the system version
|
|
35
|
+
SYSTEM_VERSION=$(grep '^SYSTEM_VERSION=' "$VERSION_FILE" | cut -d'=' -f2-)
|
|
36
|
+
if [ -z "$SYSTEM_VERSION" ]; then
|
|
37
|
+
echo -e "${RED}Error: Could not determine system version${NC}" >&2
|
|
38
|
+
exit 1
|
|
39
|
+
fi
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
# Get current system version
|
|
43
|
+
get_system_version() {
|
|
44
|
+
load_version_file
|
|
45
|
+
echo "$SYSTEM_VERSION"
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
# Get version for a specific agent
|
|
49
|
+
get_agent_version() {
|
|
50
|
+
local agent_name="$1"
|
|
51
|
+
local version_line=$(grep -i "^$agent_name=" "$VERSION_FILE" 2>/dev/null || true)
|
|
52
|
+
|
|
53
|
+
if [ -n "$version_line" ]; then
|
|
54
|
+
echo "$version_line" | cut -d' ' -f1 | cut -d'=' -f2
|
|
55
|
+
else
|
|
56
|
+
echo "0.0.0"
|
|
57
|
+
fi
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
# Update system version
|
|
61
|
+
update_system_version() {
|
|
62
|
+
local new_version="$1"
|
|
63
|
+
|
|
64
|
+
# Validate version format (semver)
|
|
65
|
+
if ! [[ "$new_version" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9\.]+)?$ ]]; then
|
|
66
|
+
echo -e "${RED}Error: Invalid version format. Use MAJOR.MINOR.PATCH[-PRERELEASE]${NC}" >&2
|
|
67
|
+
return 1
|
|
68
|
+
fi
|
|
69
|
+
|
|
70
|
+
# Update version in VERSION file
|
|
71
|
+
sed -i '' "s/^SYSTEM_VERSION=.*/SYSTEM_VERSION=$new_version/" "$VERSION_FILE"
|
|
72
|
+
|
|
73
|
+
echo -e "${GREEN}System version updated to $new_version${NC}"
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
# Update agent version
|
|
77
|
+
update_agent_version() {
|
|
78
|
+
local agent_name="$1"
|
|
79
|
+
local new_version="$2"
|
|
80
|
+
local timestamp=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
|
81
|
+
|
|
82
|
+
# Validate version format (semver)
|
|
83
|
+
if ! [[ "$new_version" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9\.]+)?$ ]]; then
|
|
84
|
+
echo -e "${RED}Error: Invalid version format. Use MAJOR.MINOR.PATCH[-PRERELEASE]${NC}" >&2
|
|
85
|
+
return 1
|
|
86
|
+
fi
|
|
87
|
+
|
|
88
|
+
# Remove existing version if it exists
|
|
89
|
+
sed -i '' "/^$agent_name=/d" "$VERSION_FILE" 2>/dev/null || true
|
|
90
|
+
|
|
91
|
+
# Add new version
|
|
92
|
+
echo "$agent_name=$new_version $timestamp" >> "$VERSION_FILE"
|
|
93
|
+
|
|
94
|
+
echo -e "${GREEN}Agent '$agent_name' version updated to $new_version${NC}"
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
# Scan agents directory and update versions
|
|
98
|
+
scan_agents() {
|
|
99
|
+
echo -e "${BLUE}Scanning for agents in $AGENTS_DIR...${NC}"
|
|
100
|
+
|
|
101
|
+
# Create a temporary file for the new version file
|
|
102
|
+
local temp_file=$(mktemp)
|
|
103
|
+
|
|
104
|
+
# Keep the system version header
|
|
105
|
+
grep -E '^#|^$|^SYSTEM_VERSION=' "$VERSION_FILE" > "$temp_file"
|
|
106
|
+
|
|
107
|
+
# Find all agent files and process them (excluding utility files)
|
|
108
|
+
find "$AGENTS_DIR" -type f -name "*.md" \
|
|
109
|
+
! -name "CONSTITUTION.md" \
|
|
110
|
+
! -name "MICROSOFT_VALUES.md" \
|
|
111
|
+
! -name "CommonValuesAndPrinciples.md" \
|
|
112
|
+
! -name "SECURITY_FRAMEWORK_TEMPLATE.md" | while read -r agent_file; do
|
|
113
|
+
local agent_name=$(basename "$agent_file" .md)
|
|
114
|
+
local current_version=$(get_agent_version "$agent_name")
|
|
115
|
+
|
|
116
|
+
# If agent not in version file, add it with version 0.1.0
|
|
117
|
+
if [ "$current_version" = "0.0.0" ]; then
|
|
118
|
+
echo -e "${YELLOW}New agent detected: $agent_name (setting to v0.1.0)${NC}"
|
|
119
|
+
echo "$agent_name=0.1.0 $(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> "$temp_file"
|
|
120
|
+
else
|
|
121
|
+
# Keep existing version
|
|
122
|
+
grep "^$agent_name=" "$VERSION_FILE" 2>/dev/null || true >> "$temp_file"
|
|
123
|
+
fi
|
|
124
|
+
done
|
|
125
|
+
|
|
126
|
+
# Replace the version file
|
|
127
|
+
mv "$temp_file" "$VERSION_FILE"
|
|
128
|
+
|
|
129
|
+
echo -e "${GREEN}Agent versions updated successfully${NC}"
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
# List all agents and their versions
|
|
133
|
+
list_agents() {
|
|
134
|
+
load_version_file
|
|
135
|
+
|
|
136
|
+
echo -e "${BLUE}MyConvergio System Version: $SYSTEM_VERSION${NC}"
|
|
137
|
+
echo -e "${BLUE}Agent versions:${NC}"
|
|
138
|
+
echo "--------------------------------------------------"
|
|
139
|
+
|
|
140
|
+
# List all agents with versions
|
|
141
|
+
grep -v '^#' "$VERSION_FILE" | grep '=' | while read -r line; do
|
|
142
|
+
if [[ "$line" == SYSTEM_VERSION=* ]]; then
|
|
143
|
+
continue
|
|
144
|
+
fi
|
|
145
|
+
|
|
146
|
+
local agent_name=$(echo "$line" | cut -d'=' -f1)
|
|
147
|
+
local version_info=$(echo "$line" | cut -d' ' -f1 | cut -d'=' -f2)
|
|
148
|
+
local timestamp=$(echo "$line" | cut -d' ' -f2-)
|
|
149
|
+
|
|
150
|
+
printf "%-30s %-15s %s\n" "$agent_name" "v$version_info" "$timestamp"
|
|
151
|
+
done | sort
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
# Show help
|
|
155
|
+
show_help() {
|
|
156
|
+
echo -e "${BLUE}MyConvergio Version Manager${NC}"
|
|
157
|
+
echo "Usage: $0 [command] [args...]"
|
|
158
|
+
echo ""
|
|
159
|
+
echo "Commands:"
|
|
160
|
+
echo " list List all agents and their versions"
|
|
161
|
+
echo " scan Scan for new agents and update versions"
|
|
162
|
+
echo " system-version Show current system version"
|
|
163
|
+
echo " system-version <version> Update system version"
|
|
164
|
+
echo " agent-version <name> Show version for a specific agent"
|
|
165
|
+
echo " agent-version <name> <version> Update version for a specific agent"
|
|
166
|
+
echo " help Show this help message"
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
# Main command handler
|
|
170
|
+
main() {
|
|
171
|
+
case "$1" in
|
|
172
|
+
list)
|
|
173
|
+
list_agents
|
|
174
|
+
;;
|
|
175
|
+
scan)
|
|
176
|
+
scan_agents
|
|
177
|
+
;;
|
|
178
|
+
system-version)
|
|
179
|
+
if [ -n "${2:-}" ]; then
|
|
180
|
+
update_system_version "$2"
|
|
181
|
+
else
|
|
182
|
+
get_system_version
|
|
183
|
+
fi
|
|
184
|
+
;;
|
|
185
|
+
agent-version)
|
|
186
|
+
if [ -z "${2:-}" ]; then
|
|
187
|
+
echo -e "${RED}Error: Agent name is required${NC}" >&2
|
|
188
|
+
exit 1
|
|
189
|
+
fi
|
|
190
|
+
if [ -n "${3:-}" ]; then
|
|
191
|
+
update_agent_version "$2" "$3"
|
|
192
|
+
else
|
|
193
|
+
get_agent_version "$2"
|
|
194
|
+
fi
|
|
195
|
+
;;
|
|
196
|
+
help|--help|-h)
|
|
197
|
+
show_help
|
|
198
|
+
;;
|
|
199
|
+
*)
|
|
200
|
+
echo -e "${RED}Error: Unknown command '$1'${NC}" >&2
|
|
201
|
+
show_help
|
|
202
|
+
exit 1
|
|
203
|
+
;;
|
|
204
|
+
esac
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
# Run the script
|
|
208
|
+
if [ $# -eq 0 ]; then
|
|
209
|
+
show_help
|
|
210
|
+
exit 0
|
|
211
|
+
fi
|
|
212
|
+
|
|
213
|
+
main "$@"
|