claude-flow-novice 2.10.8 → 2.11.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.
Files changed (193) hide show
  1. package/.claude/commands/README.md +157 -0
  2. package/.claude/hooks/cfn-invoke-post-edit.sh +1 -1
  3. package/.claude/hooks/cfn-invoke-pre-edit.sh +88 -0
  4. package/.claude/skills/cfn-agent-spawning/spawn-worker.sh +176 -0
  5. package/.claude/skills/cfn-backlog-management/SKILL.md +199 -0
  6. package/.claude/skills/cfn-backlog-management/add-backlog-item.sh +210 -0
  7. package/claude-assets/agents/cfn-dev-team/architecture/base-template-generator.md +7 -21
  8. package/claude-assets/agents/cfn-dev-team/testing/test-validation-agent.md +312 -0
  9. package/claude-assets/agents/cfn-dev-team/utility/agent-builder.md +480 -115
  10. package/claude-assets/agents/csuite/cto-agent.md +371 -0
  11. package/claude-assets/agents/marketing_hybrid/cost_tracker.md +13 -0
  12. package/claude-assets/agents/marketing_hybrid/docker_deployer.md +13 -0
  13. package/claude-assets/agents/marketing_hybrid/zai_worker_spawner.md +13 -0
  14. package/claude-assets/hooks/cfn-invoke-post-edit.sh +1 -1
  15. package/claude-assets/hooks/cfn-invoke-pre-edit.sh +88 -0
  16. package/claude-assets/skills/cfn-agent-spawning/spawn-worker.sh +176 -0
  17. package/claude-assets/skills/cfn-backlog-management/SKILL.md +199 -0
  18. package/claude-assets/skills/cfn-backlog-management/add-backlog-item.sh +210 -0
  19. package/claude-assets/skills/pre-edit-backup/backup.sh +130 -0
  20. package/claude-assets/skills/pre-edit-backup/cleanup.sh +155 -0
  21. package/claude-assets/skills/pre-edit-backup/restore.sh +128 -0
  22. package/claude-assets/skills/pre-edit-backup/revert-file.sh +168 -0
  23. package/dist/agents/agent-loader.js +315 -0
  24. package/dist/agents/agent-loader.js.map +1 -1
  25. package/package.json +3 -2
  26. package/scripts/init-project.js +38 -3
  27. package/scripts/marketing_hybrid_deployment.sh +45 -0
  28. package/scripts/redis-prometheus-exporter.sh +33 -0
  29. package/scripts/track-zai-costs.sh +19 -0
  30. package/claude-assets/commands/agents/README.md +0 -10
  31. package/claude-assets/commands/agents/agent-capabilities.md +0 -21
  32. package/claude-assets/commands/agents/agent-coordination.md +0 -28
  33. package/claude-assets/commands/agents/agent-spawning.md +0 -28
  34. package/claude-assets/commands/agents/agent-types.md +0 -26
  35. package/claude-assets/commands/analysis/COMMAND_COMPLIANCE_REPORT.md +0 -54
  36. package/claude-assets/commands/analysis/README.md +0 -9
  37. package/claude-assets/commands/analysis/bottleneck-detect.md +0 -162
  38. package/claude-assets/commands/analysis/performance-bottlenecks.md +0 -59
  39. package/claude-assets/commands/analysis/performance-report.md +0 -25
  40. package/claude-assets/commands/analysis/token-efficiency.md +0 -45
  41. package/claude-assets/commands/analysis/token-usage.md +0 -25
  42. package/claude-assets/commands/automation/README.md +0 -9
  43. package/claude-assets/commands/automation/auto-agent.md +0 -122
  44. package/claude-assets/commands/automation/self-healing.md +0 -106
  45. package/claude-assets/commands/automation/session-memory.md +0 -90
  46. package/claude-assets/commands/automation/smart-agents.md +0 -73
  47. package/claude-assets/commands/automation/smart-spawn.md +0 -25
  48. package/claude-assets/commands/automation/workflow-select.md +0 -25
  49. package/claude-assets/commands/claude-md.js +0 -237
  50. package/claude-assets/commands/claude-soul.js +0 -28
  51. package/claude-assets/commands/cli-integration.js +0 -216
  52. package/claude-assets/commands/coordination/README.md +0 -9
  53. package/claude-assets/commands/coordination/agent-spawn.md +0 -25
  54. package/claude-assets/commands/coordination/coordination-system.md +0 -88
  55. package/claude-assets/commands/coordination/init.md +0 -44
  56. package/claude-assets/commands/coordination/orchestrate.md +0 -43
  57. package/claude-assets/commands/coordination/spawn.md +0 -45
  58. package/claude-assets/commands/coordination/swarm-init.md +0 -85
  59. package/claude-assets/commands/coordination/task-orchestrate.md +0 -25
  60. package/claude-assets/commands/github/README.md +0 -11
  61. package/claude-assets/commands/github/code-review-swarm.md +0 -514
  62. package/claude-assets/commands/github/code-review.md +0 -25
  63. package/claude-assets/commands/github/github-modes.md +0 -147
  64. package/claude-assets/commands/github/github-swarm.md +0 -121
  65. package/claude-assets/commands/github/issue-tracker.md +0 -292
  66. package/claude-assets/commands/github/issue-triage.md +0 -25
  67. package/claude-assets/commands/github/multi-repo-swarm.md +0 -519
  68. package/claude-assets/commands/github/pr-enhance.md +0 -26
  69. package/claude-assets/commands/github/pr-manager.md +0 -170
  70. package/claude-assets/commands/github/project-board-sync.md +0 -471
  71. package/claude-assets/commands/github/release-manager.md +0 -338
  72. package/claude-assets/commands/github/release-swarm.md +0 -544
  73. package/claude-assets/commands/github/repo-analyze.md +0 -25
  74. package/claude-assets/commands/github/repo-architect.md +0 -367
  75. package/claude-assets/commands/github/swarm-issue.md +0 -482
  76. package/claude-assets/commands/github/swarm-pr.md +0 -285
  77. package/claude-assets/commands/github/sync-coordinator.md +0 -301
  78. package/claude-assets/commands/github/workflow-automation.md +0 -442
  79. package/claude-assets/commands/github.js +0 -638
  80. package/claude-assets/commands/hive-mind/README.md +0 -17
  81. package/claude-assets/commands/hive-mind/hive-mind-consensus.md +0 -8
  82. package/claude-assets/commands/hive-mind/hive-mind-init.md +0 -18
  83. package/claude-assets/commands/hive-mind/hive-mind-memory.md +0 -8
  84. package/claude-assets/commands/hive-mind/hive-mind-metrics.md +0 -8
  85. package/claude-assets/commands/hive-mind/hive-mind-resume.md +0 -8
  86. package/claude-assets/commands/hive-mind/hive-mind-sessions.md +0 -8
  87. package/claude-assets/commands/hive-mind/hive-mind-spawn.md +0 -21
  88. package/claude-assets/commands/hive-mind/hive-mind-status.md +0 -8
  89. package/claude-assets/commands/hive-mind/hive-mind-stop.md +0 -8
  90. package/claude-assets/commands/hive-mind/hive-mind-wizard.md +0 -8
  91. package/claude-assets/commands/hive-mind/hive-mind.md +0 -27
  92. package/claude-assets/commands/hooks/README.md +0 -11
  93. package/claude-assets/commands/hooks/overview.md +0 -58
  94. package/claude-assets/commands/hooks/post-edit.md +0 -117
  95. package/claude-assets/commands/hooks/post-task.md +0 -112
  96. package/claude-assets/commands/hooks/pre-edit.md +0 -113
  97. package/claude-assets/commands/hooks/pre-task.md +0 -111
  98. package/claude-assets/commands/hooks/session-end.md +0 -118
  99. package/claude-assets/commands/hooks/session-start.md +0 -9
  100. package/claude-assets/commands/hooks/setup.md +0 -103
  101. package/claude-assets/commands/hooks.js +0 -651
  102. package/claude-assets/commands/index.js +0 -119
  103. package/claude-assets/commands/memory/README.md +0 -9
  104. package/claude-assets/commands/memory/memory-bank.md +0 -58
  105. package/claude-assets/commands/memory/memory-persist.md +0 -25
  106. package/claude-assets/commands/memory/memory-search.md +0 -25
  107. package/claude-assets/commands/memory/memory-usage.md +0 -25
  108. package/claude-assets/commands/memory/neural.md +0 -47
  109. package/claude-assets/commands/memory/usage.md +0 -46
  110. package/claude-assets/commands/monitoring/README.md +0 -9
  111. package/claude-assets/commands/monitoring/agent-metrics.md +0 -25
  112. package/claude-assets/commands/monitoring/agents.md +0 -44
  113. package/claude-assets/commands/monitoring/real-time-view.md +0 -25
  114. package/claude-assets/commands/monitoring/status.md +0 -46
  115. package/claude-assets/commands/monitoring/swarm-monitor.md +0 -25
  116. package/claude-assets/commands/neural.js +0 -572
  117. package/claude-assets/commands/optimization/README.md +0 -9
  118. package/claude-assets/commands/optimization/auto-topology.md +0 -62
  119. package/claude-assets/commands/optimization/cache-manage.md +0 -25
  120. package/claude-assets/commands/optimization/parallel-execute.md +0 -25
  121. package/claude-assets/commands/optimization/parallel-execution.md +0 -50
  122. package/claude-assets/commands/optimization/topology-optimize.md +0 -25
  123. package/claude-assets/commands/pair/README.md +0 -261
  124. package/claude-assets/commands/pair/commands.md +0 -546
  125. package/claude-assets/commands/pair/config.md +0 -510
  126. package/claude-assets/commands/pair/examples.md +0 -512
  127. package/claude-assets/commands/pair/modes.md +0 -348
  128. package/claude-assets/commands/pair/session.md +0 -407
  129. package/claude-assets/commands/pair/start.md +0 -209
  130. package/claude-assets/commands/parse-epic.js +0 -180
  131. package/claude-assets/commands/performance.js +0 -582
  132. package/claude-assets/commands/register-all-commands.js +0 -320
  133. package/claude-assets/commands/register-claude-md.js +0 -82
  134. package/claude-assets/commands/register-claude-soul.js +0 -80
  135. package/claude-assets/commands/sparc/analyzer.md +0 -52
  136. package/claude-assets/commands/sparc/architect.md +0 -53
  137. package/claude-assets/commands/sparc/batch-executor.md +0 -54
  138. package/claude-assets/commands/sparc/coder.md +0 -54
  139. package/claude-assets/commands/sparc/debugger.md +0 -54
  140. package/claude-assets/commands/sparc/designer.md +0 -53
  141. package/claude-assets/commands/sparc/documenter.md +0 -54
  142. package/claude-assets/commands/sparc/innovator.md +0 -54
  143. package/claude-assets/commands/sparc/memory-manager.md +0 -54
  144. package/claude-assets/commands/sparc/optimizer.md +0 -54
  145. package/claude-assets/commands/sparc/orchestrator.md +0 -132
  146. package/claude-assets/commands/sparc/researcher.md +0 -54
  147. package/claude-assets/commands/sparc/reviewer.md +0 -54
  148. package/claude-assets/commands/sparc/sparc-modes.md +0 -174
  149. package/claude-assets/commands/sparc/swarm-coordinator.md +0 -54
  150. package/claude-assets/commands/sparc/tdd.md +0 -54
  151. package/claude-assets/commands/sparc/tester.md +0 -54
  152. package/claude-assets/commands/sparc/workflow-manager.md +0 -54
  153. package/claude-assets/commands/sparc.js +0 -110
  154. package/claude-assets/commands/stream-chain/pipeline.md +0 -121
  155. package/claude-assets/commands/stream-chain/run.md +0 -70
  156. package/claude-assets/commands/swarm/README.md +0 -15
  157. package/claude-assets/commands/swarm/analysis.md +0 -95
  158. package/claude-assets/commands/swarm/development.md +0 -96
  159. package/claude-assets/commands/swarm/examples.md +0 -168
  160. package/claude-assets/commands/swarm/maintenance.md +0 -102
  161. package/claude-assets/commands/swarm/optimization.md +0 -117
  162. package/claude-assets/commands/swarm/research.md +0 -136
  163. package/claude-assets/commands/swarm/swarm-analysis.md +0 -8
  164. package/claude-assets/commands/swarm/swarm-background.md +0 -8
  165. package/claude-assets/commands/swarm/swarm-init.md +0 -19
  166. package/claude-assets/commands/swarm/swarm-modes.md +0 -8
  167. package/claude-assets/commands/swarm/swarm-monitor.md +0 -8
  168. package/claude-assets/commands/swarm/swarm-spawn.md +0 -19
  169. package/claude-assets/commands/swarm/swarm-status.md +0 -8
  170. package/claude-assets/commands/swarm/swarm-strategies.md +0 -8
  171. package/claude-assets/commands/swarm/swarm.md +0 -27
  172. package/claude-assets/commands/swarm/testing.md +0 -131
  173. package/claude-assets/commands/swarm.js +0 -423
  174. package/claude-assets/commands/testing/playwright-e2e.md +0 -288
  175. package/claude-assets/commands/training/README.md +0 -9
  176. package/claude-assets/commands/training/model-update.md +0 -25
  177. package/claude-assets/commands/training/neural-patterns.md +0 -74
  178. package/claude-assets/commands/training/neural-train.md +0 -25
  179. package/claude-assets/commands/training/pattern-learn.md +0 -25
  180. package/claude-assets/commands/training/specialization.md +0 -63
  181. package/claude-assets/commands/truth/start.md +0 -143
  182. package/claude-assets/commands/validate-commands.js +0 -223
  183. package/claude-assets/commands/verify/check.md +0 -50
  184. package/claude-assets/commands/verify/start.md +0 -128
  185. package/claude-assets/commands/workflow.js +0 -606
  186. package/claude-assets/commands/workflows/README.md +0 -9
  187. package/claude-assets/commands/workflows/development.md +0 -78
  188. package/claude-assets/commands/workflows/research.md +0 -63
  189. package/claude-assets/commands/workflows/workflow-create.md +0 -25
  190. package/claude-assets/commands/workflows/workflow-execute.md +0 -25
  191. package/claude-assets/commands/workflows/workflow-export.md +0 -25
  192. package/claude-assets/hooks/post-edit.config.json +0 -12
  193. package/claude-assets/skills/team-provider-routing/spawn-worker.sh +0 -91
@@ -0,0 +1,128 @@
1
+ #!/bin/bash
2
+
3
+ # Pre-Edit Restore Script
4
+ # Restores file from backup and updates metadata
5
+ #
6
+ # Usage: restore.sh BACKUP_DIR [--list FILE_PATH AGENT_ID]
7
+ #
8
+ # Arguments:
9
+ # BACKUP_DIR - Path to backup directory containing backup_metadata.json
10
+ # --list - List available backups for a file (requires FILE_PATH and AGENT_ID)
11
+ #
12
+ # Returns:
13
+ # Exit code 0 on success
14
+ # Exit code 1 on failure
15
+ #
16
+ # Example:
17
+ # ./.claude/skills/pre-edit-backup/restore.sh ".backups/backend-dev-1/1698764800000_abc123"
18
+ # ./.claude/skills/pre-edit-backup/restore.sh --list "/path/to/file.txt" "backend-dev-1"
19
+
20
+ set -euo pipefail
21
+
22
+ # === Handle --list Mode ===
23
+
24
+ if [[ "${1:-}" == "--list" ]]; then
25
+ FILE_PATH="$2"
26
+ AGENT_ID="$3"
27
+
28
+ if [[ -z "$FILE_PATH" ]] || [[ -z "$AGENT_ID" ]]; then
29
+ echo "Error: --list requires FILE_PATH and AGENT_ID" >&2
30
+ exit 1
31
+ fi
32
+
33
+ BACKUP_BASE_DIR=".backups"
34
+ AGENT_BACKUP_DIR="${BACKUP_BASE_DIR}/${AGENT_ID}"
35
+
36
+ if [[ ! -d "$AGENT_BACKUP_DIR" ]]; then
37
+ echo "No backups found for agent: $AGENT_ID" >&2
38
+ exit 1
39
+ fi
40
+
41
+ echo "Available backups for $FILE_PATH (agent: $AGENT_ID):"
42
+ echo "---"
43
+
44
+ FOUND_BACKUPS=0
45
+ for backup_dir in "$AGENT_BACKUP_DIR"/*; do
46
+ if [[ -f "${backup_dir}/backup_metadata.json" ]]; then
47
+ ORIGINAL=$(jq -r '.original_path' "${backup_dir}/backup_metadata.json" 2>/dev/null || echo "")
48
+ if [[ "$ORIGINAL" == "$FILE_PATH" ]]; then
49
+ TIMESTAMP=$(jq -r '.backup_timestamp' "${backup_dir}/backup_metadata.json" 2>/dev/null || echo "unknown")
50
+ STATUS=$(jq -r '.backup_status' "${backup_dir}/backup_metadata.json" 2>/dev/null || echo "unknown")
51
+ echo "Backup: $(basename "$backup_dir")"
52
+ echo " Timestamp: $TIMESTAMP"
53
+ echo " Status: $STATUS"
54
+ echo " Path: $backup_dir"
55
+ echo "---"
56
+ FOUND_BACKUPS=$((FOUND_BACKUPS + 1))
57
+ fi
58
+ fi
59
+ done
60
+
61
+ if [[ $FOUND_BACKUPS -eq 0 ]]; then
62
+ echo "No backups found for this file."
63
+ exit 1
64
+ fi
65
+
66
+ exit 0
67
+ fi
68
+
69
+ # === Restore Mode ===
70
+
71
+ BACKUP_DIR="$1"
72
+
73
+ if [[ -z "$BACKUP_DIR" ]]; then
74
+ echo "Error: No backup directory provided" >&2
75
+ echo "Usage: restore.sh BACKUP_DIR" >&2
76
+ exit 1
77
+ fi
78
+
79
+ if [[ ! -d "$BACKUP_DIR" ]]; then
80
+ echo "Error: Backup directory does not exist: $BACKUP_DIR" >&2
81
+ exit 1
82
+ fi
83
+
84
+ METADATA_FILE="${BACKUP_DIR}/backup_metadata.json"
85
+ BACKUP_FILE="${BACKUP_DIR}/original_file"
86
+
87
+ if [[ ! -f "$METADATA_FILE" ]]; then
88
+ echo "Error: Backup metadata not found: $METADATA_FILE" >&2
89
+ exit 1
90
+ fi
91
+
92
+ if [[ ! -f "$BACKUP_FILE" ]]; then
93
+ echo "Error: Backup file not found: $BACKUP_FILE" >&2
94
+ exit 1
95
+ fi
96
+
97
+ # Check for jq availability
98
+ if ! command -v jq &>/dev/null; then
99
+ echo "Error: jq is required for restore operations" >&2
100
+ exit 1
101
+ fi
102
+
103
+ # Extract original path
104
+ ORIGINAL_PATH=$(jq -r '.original_path' "$METADATA_FILE" 2>/dev/null)
105
+
106
+ if [[ -z "$ORIGINAL_PATH" ]] || [[ "$ORIGINAL_PATH" == "null" ]]; then
107
+ echo "Error: Failed to read original path from metadata" >&2
108
+ exit 1
109
+ fi
110
+
111
+ # Restore file
112
+ if ! cp "$BACKUP_FILE" "$ORIGINAL_PATH" 2>/dev/null; then
113
+ echo "Error: Failed to restore file to: $ORIGINAL_PATH" >&2
114
+ exit 1
115
+ fi
116
+
117
+ # Update backup status
118
+ TEMP_FILE=$(mktemp)
119
+ if jq '.backup_status = "restored"' "$METADATA_FILE" > "$TEMP_FILE" 2>/dev/null; then
120
+ mv "$TEMP_FILE" "$METADATA_FILE"
121
+ else
122
+ echo "Warning: Failed to update backup status in metadata" >&2
123
+ rm -f "$TEMP_FILE"
124
+ fi
125
+
126
+ echo "File restored from backup: ${BACKUP_DIR}"
127
+ echo "Restored to: ${ORIGINAL_PATH}"
128
+ exit 0
@@ -0,0 +1,168 @@
1
+ #!/bin/bash
2
+ #
3
+ # Revert File Utility
4
+ # High-level revert interface for agents to use instead of git operations
5
+ #
6
+ # Usage:
7
+ # ./.claude/skills/pre-edit-backup/revert-file.sh <file_path> [--agent-id <id>] [--interactive]
8
+ #
9
+ # Examples:
10
+ # # Revert to most recent backup (auto-select)
11
+ # ./.claude/skills/pre-edit-backup/revert-file.sh src/file.ts --agent-id "coder-1"
12
+ #
13
+ # # Interactive mode (shows list of backups)
14
+ # ./.claude/skills/pre-edit-backup/revert-file.sh src/file.ts --agent-id "coder-1" --interactive
15
+ #
16
+ # # List available backups without reverting
17
+ # ./.claude/skills/pre-edit-backup/revert-file.sh src/file.ts --agent-id "coder-1" --list-only
18
+
19
+ set -euo pipefail
20
+
21
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
22
+ BACKUP_BASE_DIR=".backups"
23
+
24
+ # Parse arguments
25
+ FILE_PATH=""
26
+ AGENT_ID="${AGENT_ID:-unknown}"
27
+ INTERACTIVE=false
28
+ LIST_ONLY=false
29
+
30
+ while [[ $# -gt 0 ]]; do
31
+ case $1 in
32
+ --agent-id)
33
+ AGENT_ID="$2"
34
+ shift 2
35
+ ;;
36
+ --interactive)
37
+ INTERACTIVE=true
38
+ shift
39
+ ;;
40
+ --list-only)
41
+ LIST_ONLY=true
42
+ shift
43
+ ;;
44
+ *)
45
+ FILE_PATH="$1"
46
+ shift
47
+ ;;
48
+ esac
49
+ done
50
+
51
+ # Validate inputs
52
+ if [ -z "$FILE_PATH" ]; then
53
+ echo "Error: File path required"
54
+ echo "Usage: $0 <file_path> [--agent-id <id>] [--interactive] [--list-only]"
55
+ exit 1
56
+ fi
57
+
58
+ # Normalize file path
59
+ FILE_PATH=$(realpath "$FILE_PATH" 2>/dev/null || echo "$FILE_PATH")
60
+
61
+ # Find backups for this file
62
+ AGENT_BACKUP_DIR="$BACKUP_BASE_DIR/$AGENT_ID"
63
+
64
+ if [ ! -d "$AGENT_BACKUP_DIR" ]; then
65
+ echo "❌ No backups found for agent: $AGENT_ID"
66
+ exit 1
67
+ fi
68
+
69
+ # Search for backups matching this file
70
+ MATCHING_BACKUPS=()
71
+ while IFS= read -r backup_dir; do
72
+ metadata_file="$backup_dir/backup_metadata.json"
73
+
74
+ if [ -f "$metadata_file" ]; then
75
+ original_path=$(jq -r '.original_path' "$metadata_file" 2>/dev/null || echo "")
76
+
77
+ # Normalize original path for comparison
78
+ original_path=$(realpath "$original_path" 2>/dev/null || echo "$original_path")
79
+
80
+ if [ "$original_path" = "$FILE_PATH" ]; then
81
+ MATCHING_BACKUPS+=("$backup_dir")
82
+ fi
83
+ fi
84
+ done < <(find "$AGENT_BACKUP_DIR" -mindepth 1 -maxdepth 1 -type d | sort -r)
85
+
86
+ # Check if any backups found
87
+ if [ ${#MATCHING_BACKUPS[@]} -eq 0 ]; then
88
+ echo "❌ No backups found for file: $FILE_PATH"
89
+ exit 1
90
+ fi
91
+
92
+ # List backups function
93
+ list_backups() {
94
+ echo "Available backups for: $FILE_PATH"
95
+ echo "----------------------------------------"
96
+
97
+ local index=1
98
+ for backup_dir in "${MATCHING_BACKUPS[@]}"; do
99
+ metadata_file="$backup_dir/backup_metadata.json"
100
+
101
+ timestamp=$(jq -r '.backup_timestamp' "$metadata_file")
102
+ status=$(jq -r '.backup_status' "$metadata_file")
103
+
104
+ # Convert timestamp to readable date
105
+ if command -v date >/dev/null 2>&1; then
106
+ # Handle millisecond timestamps
107
+ timestamp_seconds=$((timestamp / 1000))
108
+ date_str=$(date -d "@$timestamp_seconds" '+%Y-%m-%d %H:%M:%S' 2>/dev/null || date -r "$timestamp_seconds" '+%Y-%m-%d %H:%M:%S' 2>/dev/null || echo "Unknown")
109
+ else
110
+ date_str="$timestamp"
111
+ fi
112
+
113
+ echo "[$index] $date_str (Status: $status)"
114
+ echo " Path: $backup_dir"
115
+
116
+ ((index++))
117
+ done
118
+ echo "----------------------------------------"
119
+ }
120
+
121
+ # List-only mode
122
+ if [ "$LIST_ONLY" = true ]; then
123
+ list_backups
124
+ exit 0
125
+ fi
126
+
127
+ # Interactive mode
128
+ if [ "$INTERACTIVE" = true ]; then
129
+ list_backups
130
+ echo ""
131
+ echo -n "Select backup to restore [1-${#MATCHING_BACKUPS[@]}] (or 0 to cancel): "
132
+ read -r selection
133
+
134
+ if [ "$selection" = "0" ]; then
135
+ echo "❌ Revert cancelled"
136
+ exit 0
137
+ fi
138
+
139
+ if ! [[ "$selection" =~ ^[0-9]+$ ]] || [ "$selection" -lt 1 ] || [ "$selection" -gt ${#MATCHING_BACKUPS[@]} ]; then
140
+ echo "❌ Invalid selection: $selection"
141
+ exit 1
142
+ fi
143
+
144
+ SELECTED_BACKUP="${MATCHING_BACKUPS[$((selection - 1))]}"
145
+ else
146
+ # Auto-select most recent backup (first in sorted list)
147
+ SELECTED_BACKUP="${MATCHING_BACKUPS[0]}"
148
+
149
+ metadata_file="$SELECTED_BACKUP/backup_metadata.json"
150
+ timestamp=$(jq -r '.backup_timestamp' "$metadata_file")
151
+ timestamp_seconds=$((timestamp / 1000))
152
+ date_str=$(date -d "@$timestamp_seconds" '+%Y-%m-%d %H:%M:%S' 2>/dev/null || date -r "$timestamp_seconds" '+%Y-%m-%d %H:%M:%S' 2>/dev/null || echo "timestamp: $timestamp")
153
+
154
+ echo "🔄 Auto-selecting most recent backup: $date_str"
155
+ fi
156
+
157
+ # Restore using restore.sh
158
+ echo "🔄 Restoring file from backup..."
159
+ "$SCRIPT_DIR/restore.sh" "$SELECTED_BACKUP"
160
+
161
+ if [ $? -eq 0 ]; then
162
+ echo "✅ File successfully reverted to backup"
163
+ echo " Backup: $SELECTED_BACKUP"
164
+ exit 0
165
+ else
166
+ echo "❌ Failed to revert file"
167
+ exit 1
168
+ fi
@@ -191,4 +191,319 @@ export const isValidAgentType = (name)=>agentLoader.isValidAgentType(name);
191
191
  export const getAgentsByCategory = (category)=>agentLoader.getAgentsByCategory(category);
192
192
  export const refreshAgents = ()=>agentLoader.refresh();
193
193
 
194
+ //# sourceMappingURL=agent-loader.js.map.isArray(input)) return input.map(String);
195
+ if (typeof input === 'string') {
196
+ return input.split(/[,\s]+/).map(function(t) {
197
+ return t.trim();
198
+ }).filter(function(t) {
199
+ return t.length > 0;
200
+ });
201
+ }
202
+ return [];
203
+ };
204
+ // Safely handle tools and capabilities.tools
205
+ var toolsFromFrontmatter = frontmatter.tools ? extractTools(frontmatter.tools) : [];
206
+ var toolsFromCapabilities = frontmatter.capabilities && typeof frontmatter.capabilities === 'object' ? extractTools(Object(frontmatter.capabilities).tools) : [];
207
+ return __spreadArray(__spreadArray([], toolsFromFrontmatter, true), toolsFromCapabilities, true);
208
+ };
209
+ AgentLoader.prototype.loadAgents = function() {
210
+ return __awaiter(this, void 0, void 0, function() {
211
+ var agentsDir, agentFiles, categoryMap, _i, agentFiles_1, filePath, agent, relativePath, pathParts, category;
212
+ return __generator(this, function(_a) {
213
+ switch(_a.label){
214
+ case 0:
215
+ agentsDir = this.getAgentsDirectory();
216
+ if (!(0, node_fs_1.existsSync)(agentsDir)) {
217
+ console.warn("Agents directory not found: ".concat(agentsDir));
218
+ return [
219
+ 2 /*return*/
220
+ ];
221
+ }
222
+ return [
223
+ 4 /*yield*/ ,
224
+ new Promise(function(resolve, reject) {
225
+ (0, glob_1.glob)('**/*.md', {
226
+ cwd: agentsDir,
227
+ ignore: [
228
+ '**/README.md',
229
+ '**/MIGRATION_SUMMARY.md'
230
+ ],
231
+ absolute: true
232
+ }, function(err, matches) {
233
+ if (err) reject(err);
234
+ else resolve(matches);
235
+ });
236
+ })
237
+ ];
238
+ case 1:
239
+ agentFiles = _a.sent();
240
+ this.agentCache.clear();
241
+ this.categoriesCache = [];
242
+ categoryMap = new Map();
243
+ for(_i = 0, agentFiles_1 = agentFiles; _i < agentFiles_1.length; _i++){
244
+ filePath = agentFiles_1[_i];
245
+ agent = this.parseAgentFile(filePath);
246
+ if (agent) {
247
+ this.agentCache.set(agent.name, agent);
248
+ relativePath = filePath.replace(agentsDir, '');
249
+ pathParts = relativePath.split('/');
250
+ category = pathParts[1] || 'uncategorized';
251
+ if (!categoryMap.has(category)) {
252
+ categoryMap.set(category, []);
253
+ }
254
+ categoryMap.get(category).push(agent);
255
+ }
256
+ }
257
+ this.categoriesCache = Array.from(categoryMap.entries()).map(function(_a) {
258
+ var name = _a[0], agents = _a[1];
259
+ return {
260
+ name: name,
261
+ agents: agents.sort(function(a, b) {
262
+ return a.name.localeCompare(b.name);
263
+ })
264
+ };
265
+ });
266
+ this.lastLoadTime = Date.now();
267
+ return [
268
+ 2 /*return*/
269
+ ];
270
+ }
271
+ });
272
+ });
273
+ };
274
+ // Rest of the methods remain similar to the original implementation
275
+ AgentLoader.prototype.needsRefresh = function() {
276
+ return Date.now() - this.lastLoadTime > this.CACHE_EXPIRY;
277
+ };
278
+ AgentLoader.prototype.ensureLoaded = function() {
279
+ return __awaiter(this, void 0, void 0, function() {
280
+ return __generator(this, function(_a) {
281
+ switch(_a.label){
282
+ case 0:
283
+ if (!(this.agentCache.size === 0 || this.needsRefresh())) return [
284
+ 3 /*break*/ ,
285
+ 2
286
+ ];
287
+ return [
288
+ 4 /*yield*/ ,
289
+ this.loadAgents()
290
+ ];
291
+ case 1:
292
+ _a.sent();
293
+ _a.label = 2;
294
+ case 2:
295
+ return [
296
+ 2 /*return*/
297
+ ];
298
+ }
299
+ });
300
+ });
301
+ };
302
+ AgentLoader.prototype.getAvailableAgentTypes = function() {
303
+ return __awaiter(this, void 0, void 0, function() {
304
+ var currentTypes, legacyTypes;
305
+ return __generator(this, function(_a) {
306
+ switch(_a.label){
307
+ case 0:
308
+ return [
309
+ 4 /*yield*/ ,
310
+ this.ensureLoaded()
311
+ ];
312
+ case 1:
313
+ _a.sent();
314
+ currentTypes = Array.from(this.agentCache.keys());
315
+ legacyTypes = Object.keys(LEGACY_AGENT_MAPPING);
316
+ return [
317
+ 2 /*return*/ ,
318
+ Array.from(new Set(__spreadArray(__spreadArray([], currentTypes, true), legacyTypes, true))).sort()
319
+ ];
320
+ }
321
+ });
322
+ });
323
+ };
324
+ AgentLoader.prototype.getAgent = function(name) {
325
+ return __awaiter(this, void 0, void 0, function() {
326
+ return __generator(this, function(_a) {
327
+ switch(_a.label){
328
+ case 0:
329
+ return [
330
+ 4 /*yield*/ ,
331
+ this.ensureLoaded()
332
+ ];
333
+ case 1:
334
+ _a.sent();
335
+ return [
336
+ 2 /*return*/ ,
337
+ this.agentCache.get(name) || this.agentCache.get(resolveLegacyAgentType(name)) || null
338
+ ];
339
+ }
340
+ });
341
+ });
342
+ };
343
+ AgentLoader.prototype.getAllAgents = function() {
344
+ return __awaiter(this, void 0, void 0, function() {
345
+ return __generator(this, function(_a) {
346
+ switch(_a.label){
347
+ case 0:
348
+ return [
349
+ 4 /*yield*/ ,
350
+ this.ensureLoaded()
351
+ ];
352
+ case 1:
353
+ _a.sent();
354
+ return [
355
+ 2 /*return*/ ,
356
+ Array.from(this.agentCache.values()).sort(function(a, b) {
357
+ return a.name.localeCompare(b.name);
358
+ })
359
+ ];
360
+ }
361
+ });
362
+ });
363
+ };
364
+ AgentLoader.prototype.getAgentCategories = function() {
365
+ return __awaiter(this, void 0, void 0, function() {
366
+ return __generator(this, function(_a) {
367
+ switch(_a.label){
368
+ case 0:
369
+ return [
370
+ 4 /*yield*/ ,
371
+ this.ensureLoaded()
372
+ ];
373
+ case 1:
374
+ _a.sent();
375
+ return [
376
+ 2 /*return*/ ,
377
+ this.categoriesCache
378
+ ];
379
+ }
380
+ });
381
+ });
382
+ };
383
+ AgentLoader.prototype.searchAgents = function(query) {
384
+ return __awaiter(this, void 0, void 0, function() {
385
+ var lowerQuery;
386
+ return __generator(this, function(_a) {
387
+ switch(_a.label){
388
+ case 0:
389
+ return [
390
+ 4 /*yield*/ ,
391
+ this.ensureLoaded()
392
+ ];
393
+ case 1:
394
+ _a.sent();
395
+ lowerQuery = query.toLowerCase();
396
+ return [
397
+ 2 /*return*/ ,
398
+ Array.from(this.agentCache.values()).filter(function(agent) {
399
+ var _a;
400
+ return agent.name.toLowerCase().includes(lowerQuery) || agent.description.toLowerCase().includes(lowerQuery) || ((_a = agent.capabilities) === null || _a === void 0 ? void 0 : _a.some(function(cap) {
401
+ return cap.toLowerCase().includes(lowerQuery);
402
+ }));
403
+ })
404
+ ];
405
+ }
406
+ });
407
+ });
408
+ };
409
+ AgentLoader.prototype.isValidAgentType = function(name) {
410
+ return __awaiter(this, void 0, void 0, function() {
411
+ return __generator(this, function(_a) {
412
+ switch(_a.label){
413
+ case 0:
414
+ return [
415
+ 4 /*yield*/ ,
416
+ this.ensureLoaded()
417
+ ];
418
+ case 1:
419
+ _a.sent();
420
+ return [
421
+ 2 /*return*/ ,
422
+ this.agentCache.has(name) || this.agentCache.has(resolveLegacyAgentType(name))
423
+ ];
424
+ }
425
+ });
426
+ });
427
+ };
428
+ AgentLoader.prototype.getAgentsByCategory = function(category) {
429
+ return __awaiter(this, void 0, void 0, function() {
430
+ var categories, found;
431
+ return __generator(this, function(_a) {
432
+ switch(_a.label){
433
+ case 0:
434
+ return [
435
+ 4 /*yield*/ ,
436
+ this.getAgentCategories()
437
+ ];
438
+ case 1:
439
+ categories = _a.sent();
440
+ found = categories.find(function(cat) {
441
+ return cat.name === category;
442
+ });
443
+ return [
444
+ 2 /*return*/ ,
445
+ (found === null || found === void 0 ? void 0 : found.agents) || []
446
+ ];
447
+ }
448
+ });
449
+ });
450
+ };
451
+ AgentLoader.prototype.refresh = function() {
452
+ return __awaiter(this, void 0, void 0, function() {
453
+ return __generator(this, function(_a) {
454
+ switch(_a.label){
455
+ case 0:
456
+ this.lastLoadTime = 0;
457
+ return [
458
+ 4 /*yield*/ ,
459
+ this.loadAgents()
460
+ ];
461
+ case 1:
462
+ _a.sent();
463
+ return [
464
+ 2 /*return*/
465
+ ];
466
+ }
467
+ });
468
+ });
469
+ };
470
+ return AgentLoader;
471
+ }();
472
+ exports.AgentLoader = AgentLoader;
473
+ // Singleton instance
474
+ exports.agentLoader = new AgentLoader();
475
+ // Convenience exports for use in other modules
476
+ var getAvailableAgentTypes = function() {
477
+ return exports.agentLoader.getAvailableAgentTypes();
478
+ };
479
+ exports.getAvailableAgentTypes = getAvailableAgentTypes;
480
+ var getAgent = function(name) {
481
+ return exports.agentLoader.getAgent(name);
482
+ };
483
+ exports.getAgent = getAgent;
484
+ var getAllAgents = function() {
485
+ return exports.agentLoader.getAllAgents();
486
+ };
487
+ exports.getAllAgents = getAllAgents;
488
+ var getAgentCategories = function() {
489
+ return exports.agentLoader.getAgentCategories();
490
+ };
491
+ exports.getAgentCategories = getAgentCategories;
492
+ var searchAgents = function(query) {
493
+ return exports.agentLoader.searchAgents(query);
494
+ };
495
+ exports.searchAgents = searchAgents;
496
+ var isValidAgentType = function(name) {
497
+ return exports.agentLoader.isValidAgentType(name);
498
+ };
499
+ exports.isValidAgentType = isValidAgentType;
500
+ var getAgentsByCategory = function(category) {
501
+ return exports.agentLoader.getAgentsByCategory(category);
502
+ };
503
+ exports.getAgentsByCategory = getAgentsByCategory;
504
+ var refreshAgents = function() {
505
+ return exports.agentLoader.refresh();
506
+ };
507
+ exports.refreshAgents = refreshAgents;
508
+
194
509
  //# sourceMappingURL=agent-loader.js.map