@adityaaria/spark 6.0.19 → 6.0.21
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/spark-install.sh +88 -2
- package/package.json +1 -1
- package/skills/project-scanner/SKILL.md +2 -2
- package/skills/using-spark/SKILL.md +8 -1
- package/src/cli/index.js +6 -0
- package/src/cli/output.js +1 -1
- package/src/dashboard/public/index.html +664 -222
- package/src/dashboard/server.js +132 -0
package/bin/spark-install.sh
CHANGED
|
@@ -70,6 +70,7 @@ SCOPE="project"
|
|
|
70
70
|
FORCE=false
|
|
71
71
|
HELP=false
|
|
72
72
|
DRY_RUN=false
|
|
73
|
+
UNINSTALL=false
|
|
73
74
|
|
|
74
75
|
parse_args() {
|
|
75
76
|
while [ $# -gt 0 ]; do
|
|
@@ -77,6 +78,7 @@ parse_args() {
|
|
|
77
78
|
-g|--global) SCOPE="global" ;;
|
|
78
79
|
--force) FORCE=true ;;
|
|
79
80
|
--dry-run) DRY_RUN=true ;;
|
|
81
|
+
-u|--uninstall) UNINSTALL=true ;;
|
|
80
82
|
-h|--help) HELP=true ;;
|
|
81
83
|
*)
|
|
82
84
|
error "Unknown argument: $1"
|
|
@@ -97,10 +99,11 @@ print_help() {
|
|
|
97
99
|
bash bin/spark-install.sh [options]
|
|
98
100
|
|
|
99
101
|
Options:
|
|
100
|
-
-g, --global Install to global agent config (~/.
|
|
101
|
-
Default: project scope (./.
|
|
102
|
+
-g, --global Install to global agent config (~/.agents/skills/)
|
|
103
|
+
Default: project scope (./.agents/skills/)
|
|
102
104
|
--force Re-install even if already installed
|
|
103
105
|
--dry-run Show what would be done without making changes
|
|
106
|
+
-u, --uninstall Safely remove SPARK from agent configs
|
|
104
107
|
-h, --help Show this help message
|
|
105
108
|
|
|
106
109
|
Examples:
|
|
@@ -750,6 +753,85 @@ check_existing_install() {
|
|
|
750
753
|
fi
|
|
751
754
|
}
|
|
752
755
|
|
|
756
|
+
# =============================================================================
|
|
757
|
+
# Uninstall
|
|
758
|
+
# =============================================================================
|
|
759
|
+
|
|
760
|
+
uninstall_for_agent() {
|
|
761
|
+
local agent_id="$1"
|
|
762
|
+
local target_dir
|
|
763
|
+
target_dir="$(get_target_dir "$agent_id")"
|
|
764
|
+
|
|
765
|
+
if [ ! -d "$target_dir" ]; then
|
|
766
|
+
return 0
|
|
767
|
+
fi
|
|
768
|
+
|
|
769
|
+
info "Removing SPARK from $agent_id at $target_dir"
|
|
770
|
+
|
|
771
|
+
# 1. Remove skills symlink/directory
|
|
772
|
+
if [ -e "$target_dir/skills" ]; then
|
|
773
|
+
rm -rf "$target_dir/skills"
|
|
774
|
+
fi
|
|
775
|
+
|
|
776
|
+
# 2. Remove hooks
|
|
777
|
+
local hook_files
|
|
778
|
+
hook_files="$(get_agent_hook_files "$agent_id")"
|
|
779
|
+
if [ -n "$hook_files" ]; then
|
|
780
|
+
while IFS= read -r hook_file; do
|
|
781
|
+
[ -z "$hook_file" ] && continue
|
|
782
|
+
rm -f "$target_dir/$hook_file"
|
|
783
|
+
done <<< "$hook_files"
|
|
784
|
+
# Try to remove hooks dir if empty
|
|
785
|
+
rmdir "$target_dir/hooks" 2>/dev/null || true
|
|
786
|
+
fi
|
|
787
|
+
|
|
788
|
+
# 3. Remove plugin manifests
|
|
789
|
+
local manifest_files
|
|
790
|
+
manifest_files="$(get_agent_manifest_files "$agent_id")"
|
|
791
|
+
if [ -n "$manifest_files" ]; then
|
|
792
|
+
while IFS= read -r manifest_file; do
|
|
793
|
+
[ -z "$manifest_file" ] && continue
|
|
794
|
+
rm -f "$target_dir/$manifest_file"
|
|
795
|
+
local manifest_dir
|
|
796
|
+
manifest_dir="$(dirname "$target_dir/$manifest_file")"
|
|
797
|
+
rmdir "$manifest_dir" 2>/dev/null || true
|
|
798
|
+
done <<< "$manifest_files"
|
|
799
|
+
fi
|
|
800
|
+
|
|
801
|
+
# 4. Remove agent dir if totally empty
|
|
802
|
+
rmdir "$target_dir" 2>/dev/null || true
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
perform_uninstall() {
|
|
806
|
+
header "SPARK Uninstaller"
|
|
807
|
+
|
|
808
|
+
local lock_dir
|
|
809
|
+
if [ "$SCOPE" = "global" ]; then
|
|
810
|
+
lock_dir="${HOME:-$(eval echo ~)}"
|
|
811
|
+
else
|
|
812
|
+
lock_dir="$(pwd)"
|
|
813
|
+
fi
|
|
814
|
+
local lock_path="$lock_dir/$LOCK_FILE_NAME"
|
|
815
|
+
|
|
816
|
+
# Detect agents
|
|
817
|
+
info "Detecting installed agents to clean up..."
|
|
818
|
+
detect_agents || true
|
|
819
|
+
build_selected_agents
|
|
820
|
+
|
|
821
|
+
for agent_id in "${SELECTED_AGENTS[@]}"; do
|
|
822
|
+
uninstall_for_agent "$agent_id"
|
|
823
|
+
done
|
|
824
|
+
|
|
825
|
+
if [ -f "$lock_path" ]; then
|
|
826
|
+
rm -f "$lock_path"
|
|
827
|
+
info "Removed lock file: $lock_path"
|
|
828
|
+
fi
|
|
829
|
+
|
|
830
|
+
echo ""
|
|
831
|
+
success "SPARK has been safely uninstalled."
|
|
832
|
+
exit $EXIT_SUCCESS
|
|
833
|
+
}
|
|
834
|
+
|
|
753
835
|
# =============================================================================
|
|
754
836
|
# Summary
|
|
755
837
|
# =============================================================================
|
|
@@ -800,6 +882,10 @@ main() {
|
|
|
800
882
|
exit $EXIT_SUCCESS
|
|
801
883
|
fi
|
|
802
884
|
|
|
885
|
+
if $UNINSTALL; then
|
|
886
|
+
perform_uninstall
|
|
887
|
+
fi
|
|
888
|
+
|
|
803
889
|
header "SPARK Native Installer"
|
|
804
890
|
|
|
805
891
|
# Step 1: Resolve repo
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@ Use this skill to scan and document a codebase's architecture, operational rules
|
|
|
11
11
|
|
|
12
12
|
**Announce at start:** "spark detection 💥 Using project-scanner to analyze repository DNA"
|
|
13
13
|
|
|
14
|
-
**Save findings to:** The `.docs/` directory.
|
|
14
|
+
**Save findings to:** The `.docs/` directory. **You must physically create this directory and save the files to disk using your tools. Do NOT just print the output to the user.** For large projects, break down the documentation logically (e.g., `.docs/PROJECT_SCAN.md`, `.docs/API_CONTRACT.md`, `.docs/DOMAINS/`) instead of creating one massive monolithic file.
|
|
15
15
|
|
|
16
16
|
## Handling Massive Codebases (Subagent Delegation)
|
|
17
17
|
If the repository is extremely large and analyzing all four pillars sequentially risks exceeding context limits or taking too long:
|
|
@@ -56,4 +56,4 @@ Identify conventions, rules, and technical debt enforced or found in the codebas
|
|
|
56
56
|
- `[ ]` **Step 2:** Scan root configuration files and prioritize searching for Swagger/OpenAPI specifications.
|
|
57
57
|
- `[ ]` **Step 3:** Scan source directory structures to infer the language, framework, and architectural patterns.
|
|
58
58
|
- `[ ]` **Step 4:** Analyze testing frameworks, CI/CD workflows, and actively hunt for anti-patterns and legacy traps.
|
|
59
|
-
- `[ ]` **Step 5:**
|
|
59
|
+
- `[ ]` **Step 5 (CRITICAL):** You MUST use your file-writing tools to physically create the `.docs/` directory and save the markdown files (e.g. `PROJECT_SCAN.md`, `API_CONTRACT.md`) into it. DO NOT just print the summary into the chat! You must physically write the files to disk.
|
|
@@ -10,7 +10,12 @@ If you were dispatched as a subagent to execute a specific task, skip this skill
|
|
|
10
10
|
<EXTREMELY-IMPORTANT>
|
|
11
11
|
If you think there is even a 1% chance a skill might apply to what you are doing, you ABSOLUTELY MUST invoke the skill.
|
|
12
12
|
|
|
13
|
-
IF A SKILL APPLIES TO YOUR TASK, YOU DO NOT HAVE A CHOICE. YOU MUST USE IT.
|
|
13
|
+
IF A SKILL APPLIES TO YOUR TASK, OR IF THE USER EXPLICITLY REQUESTS A SKILL, YOU DO NOT HAVE A CHOICE. YOU MUST USE IT IMMEDIATELY.
|
|
14
|
+
|
|
15
|
+
**Do NOT ask clarifying questions first.**
|
|
16
|
+
**Do NOT start a conversation.**
|
|
17
|
+
**Do NOT explain what you are going to do.**
|
|
18
|
+
**JUST EXECUTE THE SKILL DIRECTLY AS YOUR FIRST TOOL CALL.**
|
|
14
19
|
|
|
15
20
|
This is not negotiable. This is not optional. You cannot rationalize your way out of this.
|
|
16
21
|
</EXTREMELY-IMPORTANT>
|
|
@@ -49,6 +54,8 @@ Skills speak in actions ("dispatch a subagent", "create a todo", "read a file")
|
|
|
49
54
|
|
|
50
55
|
**Invoke relevant or requested skills BEFORE any response or action.** Even a 1% chance a skill might apply means that you should invoke the skill to check. If an invoked skill turns out to be wrong for the situation, you don't need to use it.
|
|
51
56
|
|
|
57
|
+
**CRITICAL:** If the user mentions a specific skill by name (e.g., "scan project", "project-scanner", "run deployment"), you MUST invoke that skill IMMEDIATELY as your very first tool call. Do not answer conversationally. Do not ask for confirmation. Execute the skill first.
|
|
58
|
+
|
|
52
59
|
## Announcement Format
|
|
53
60
|
When you invoke a skill, you MUST announce it to the developer using exactly this format as the very first thing you say:
|
|
54
61
|
`spark detection 💥 Using [skill] to [purpose]`
|
package/src/cli/index.js
CHANGED
|
@@ -14,6 +14,12 @@ export async function run(argv = [], env = process.env) {
|
|
|
14
14
|
return;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
if (command === 'uninstall') {
|
|
18
|
+
// Forward the args and append --uninstall
|
|
19
|
+
await runInstall([...args, '--uninstall'], env);
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
|
|
17
23
|
if (command === 'dashboard' || command === 'ui') {
|
|
18
24
|
const { startDashboard } = await import('../dashboard/server.js');
|
|
19
25
|
startDashboard();
|
package/src/cli/output.js
CHANGED
|
@@ -24,7 +24,7 @@ export function printHelp() {
|
|
|
24
24
|
printLine('');
|
|
25
25
|
printMuted('Wraps the native SPARK installer (bin/spark-install.sh).');
|
|
26
26
|
printLine('');
|
|
27
|
-
printLine(labelValue('Options', '-g, --global Install to global agent config (~/.
|
|
27
|
+
printLine(labelValue('Options', '-g, --global Install to global agent config (~/.agents/skills/)'));
|
|
28
28
|
printLine(labelValue(' ', '--force Re-install even if already installed'));
|
|
29
29
|
printLine(labelValue(' ', '--dry-run Show what would be done without making changes'));
|
|
30
30
|
printLine(labelValue(' ', '-h, --help Show this help message'));
|