snow-flow 1.4.9 → 1.4.10
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/commands/helpers/standard-checkpoint-hooks.sh +179 -0
- package/.claude/settings.json +109 -32
- package/CLAUDE.md +1425 -229
- package/README.md +372 -141
- package/SNOW_FLOW_ADVANCED_FEATURES_PLAIN.txt +78 -0
- package/claude-flow +81 -34
- package/claude-flow.bat +0 -0
- package/claude-flow.ps1 +0 -0
- package/dist/cli.js +156 -0
- package/dist/cli.js.map +1 -1
- package/dist/mcp/advanced/servicenow-advanced-features-mcp.d.ts +925 -0
- package/dist/mcp/advanced/servicenow-advanced-features-mcp.d.ts.map +1 -0
- package/dist/mcp/advanced/servicenow-advanced-features-mcp.js +14159 -0
- package/dist/mcp/advanced/servicenow-advanced-features-mcp.js.map +1 -0
- package/dist/mcp/servicenow-deployment-mcp.js +32 -0
- package/dist/mcp/servicenow-deployment-mcp.js.map +1 -1
- package/dist/utils/snow-memory-manager.d.ts +78 -0
- package/dist/utils/snow-memory-manager.d.ts.map +1 -0
- package/dist/utils/snow-memory-manager.js +530 -0
- package/dist/utils/snow-memory-manager.js.map +1 -0
- package/dist/version.d.ts +4 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +26 -1
- package/dist/version.js.map +1 -1
- package/package.json +268 -3
- package/.env.example +0 -284
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Standard checkpoint hook functions for Claude settings.json (without GitHub features)
|
|
3
|
+
|
|
4
|
+
# Function to handle pre-edit checkpoints
|
|
5
|
+
pre_edit_checkpoint() {
|
|
6
|
+
local tool_input="$1"
|
|
7
|
+
local file=$(echo "$tool_input" | jq -r '.file_path // empty')
|
|
8
|
+
|
|
9
|
+
if [ -n "$file" ]; then
|
|
10
|
+
local checkpoint_branch="checkpoint/pre-edit-$(date +%Y%m%d-%H%M%S)"
|
|
11
|
+
local current_branch=$(git branch --show-current)
|
|
12
|
+
|
|
13
|
+
# Create checkpoint
|
|
14
|
+
git add -A
|
|
15
|
+
git stash push -m "Pre-edit checkpoint for $file" >/dev/null 2>&1
|
|
16
|
+
git branch "$checkpoint_branch"
|
|
17
|
+
|
|
18
|
+
# Store metadata
|
|
19
|
+
mkdir -p .claude/checkpoints
|
|
20
|
+
cat > ".claude/checkpoints/$(date +%s).json" <<EOF
|
|
21
|
+
{
|
|
22
|
+
"branch": "$checkpoint_branch",
|
|
23
|
+
"file": "$file",
|
|
24
|
+
"timestamp": "$(date -u +%Y-%m-%dT%H:%M:%SZ)",
|
|
25
|
+
"type": "pre-edit",
|
|
26
|
+
"original_branch": "$current_branch"
|
|
27
|
+
}
|
|
28
|
+
EOF
|
|
29
|
+
|
|
30
|
+
# Restore working directory
|
|
31
|
+
git stash pop --quiet >/dev/null 2>&1 || true
|
|
32
|
+
|
|
33
|
+
echo "✅ Created checkpoint: $checkpoint_branch for $file"
|
|
34
|
+
fi
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
# Function to handle post-edit checkpoints
|
|
38
|
+
post_edit_checkpoint() {
|
|
39
|
+
local tool_input="$1"
|
|
40
|
+
local file=$(echo "$tool_input" | jq -r '.file_path // empty')
|
|
41
|
+
|
|
42
|
+
if [ -n "$file" ] && [ -f "$file" ]; then
|
|
43
|
+
# Check if file was modified - first check if file is tracked
|
|
44
|
+
if ! git ls-files --error-unmatch "$file" >/dev/null 2>&1; then
|
|
45
|
+
# File is not tracked, add it first
|
|
46
|
+
git add "$file"
|
|
47
|
+
fi
|
|
48
|
+
|
|
49
|
+
# Now check if there are changes
|
|
50
|
+
if git diff --cached --quiet "$file" 2>/dev/null && git diff --quiet "$file" 2>/dev/null; then
|
|
51
|
+
echo "ℹ️ No changes to checkpoint for $file"
|
|
52
|
+
else
|
|
53
|
+
local tag_name="checkpoint-$(date +%Y%m%d-%H%M%S)"
|
|
54
|
+
local current_branch=$(git branch --show-current)
|
|
55
|
+
|
|
56
|
+
# Create commit
|
|
57
|
+
git add "$file"
|
|
58
|
+
if git commit -m "🔖 Checkpoint: Edit $file
|
|
59
|
+
|
|
60
|
+
Automatic checkpoint created by Claude
|
|
61
|
+
- File: $file
|
|
62
|
+
- Branch: $current_branch
|
|
63
|
+
- Timestamp: $(date -u +%Y-%m-%dT%H:%M:%SZ)
|
|
64
|
+
|
|
65
|
+
[Auto-checkpoint]" --quiet; then
|
|
66
|
+
# Create tag only if commit succeeded
|
|
67
|
+
git tag -a "$tag_name" -m "Checkpoint after editing $file"
|
|
68
|
+
|
|
69
|
+
# Store metadata
|
|
70
|
+
mkdir -p .claude/checkpoints
|
|
71
|
+
local diff_stats=$(git diff HEAD~1 --stat | tr '\n' ' ' | sed 's/"/\\"/g')
|
|
72
|
+
cat > ".claude/checkpoints/$(date +%s).json" <<EOF
|
|
73
|
+
{
|
|
74
|
+
"tag": "$tag_name",
|
|
75
|
+
"file": "$file",
|
|
76
|
+
"timestamp": "$(date -u +%Y-%m-%dT%H:%M:%SZ)",
|
|
77
|
+
"type": "post-edit",
|
|
78
|
+
"branch": "$current_branch",
|
|
79
|
+
"diff_summary": "$diff_stats"
|
|
80
|
+
}
|
|
81
|
+
EOF
|
|
82
|
+
|
|
83
|
+
echo "✅ Created checkpoint: $tag_name for $file"
|
|
84
|
+
else
|
|
85
|
+
echo "ℹ️ No commit created (no changes or commit failed)"
|
|
86
|
+
fi
|
|
87
|
+
fi
|
|
88
|
+
fi
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
# Function to handle task checkpoints
|
|
92
|
+
task_checkpoint() {
|
|
93
|
+
local user_prompt="$1"
|
|
94
|
+
local task=$(echo "$user_prompt" | head -c 100 | tr '\n' ' ')
|
|
95
|
+
|
|
96
|
+
if [ -n "$task" ]; then
|
|
97
|
+
local checkpoint_name="task-$(date +%Y%m%d-%H%M%S)"
|
|
98
|
+
|
|
99
|
+
# Commit current state
|
|
100
|
+
git add -A
|
|
101
|
+
git commit -m "🔖 Task checkpoint: $task..." --quiet || true
|
|
102
|
+
|
|
103
|
+
# Store metadata
|
|
104
|
+
mkdir -p .claude/checkpoints
|
|
105
|
+
cat > ".claude/checkpoints/task-$(date +%s).json" <<EOF
|
|
106
|
+
{
|
|
107
|
+
"checkpoint": "$checkpoint_name",
|
|
108
|
+
"task": "$task",
|
|
109
|
+
"timestamp": "$(date -u +%Y-%m-%dT%H:%M:%SZ)",
|
|
110
|
+
"commit": "$(git rev-parse HEAD)"
|
|
111
|
+
}
|
|
112
|
+
EOF
|
|
113
|
+
|
|
114
|
+
echo "✅ Created task checkpoint: $checkpoint_name"
|
|
115
|
+
fi
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
# Function to handle session end
|
|
119
|
+
session_end_checkpoint() {
|
|
120
|
+
local session_id="session-$(date +%Y%m%d-%H%M%S)"
|
|
121
|
+
local summary_file=".claude/checkpoints/summary-$session_id.md"
|
|
122
|
+
|
|
123
|
+
mkdir -p .claude/checkpoints
|
|
124
|
+
|
|
125
|
+
# Create summary
|
|
126
|
+
cat > "$summary_file" <<EOF
|
|
127
|
+
# Session Summary - $(date +'%Y-%m-%d %H:%M:%S')
|
|
128
|
+
|
|
129
|
+
## Checkpoints Created
|
|
130
|
+
$(find .claude/checkpoints -name '*.json' -mtime -1 -exec basename {} \; | sort)
|
|
131
|
+
|
|
132
|
+
## Files Modified
|
|
133
|
+
$(git diff --name-only $(git log --format=%H -n 1 --before="1 hour ago" 2>/dev/null) 2>/dev/null || echo "No files tracked")
|
|
134
|
+
|
|
135
|
+
## Recent Commits
|
|
136
|
+
$(git log --oneline -10 --grep="Checkpoint" || echo "No checkpoint commits")
|
|
137
|
+
|
|
138
|
+
## Rollback Instructions
|
|
139
|
+
To rollback to a specific checkpoint:
|
|
140
|
+
\`\`\`bash
|
|
141
|
+
# List all checkpoints
|
|
142
|
+
git tag -l 'checkpoint-*' | sort -r
|
|
143
|
+
|
|
144
|
+
# Rollback to a checkpoint
|
|
145
|
+
git checkout checkpoint-YYYYMMDD-HHMMSS
|
|
146
|
+
|
|
147
|
+
# Or reset to a checkpoint (destructive)
|
|
148
|
+
git reset --hard checkpoint-YYYYMMDD-HHMMSS
|
|
149
|
+
\`\`\`
|
|
150
|
+
EOF
|
|
151
|
+
|
|
152
|
+
# Create final checkpoint
|
|
153
|
+
git add -A
|
|
154
|
+
git commit -m "🏁 Session end checkpoint: $session_id" --quiet || true
|
|
155
|
+
git tag -a "session-end-$session_id" -m "End of Claude session"
|
|
156
|
+
|
|
157
|
+
echo "✅ Session summary saved to: $summary_file"
|
|
158
|
+
echo "📌 Final checkpoint: session-end-$session_id"
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
# Main entry point
|
|
162
|
+
case "$1" in
|
|
163
|
+
pre-edit)
|
|
164
|
+
pre_edit_checkpoint "$2"
|
|
165
|
+
;;
|
|
166
|
+
post-edit)
|
|
167
|
+
post_edit_checkpoint "$2"
|
|
168
|
+
;;
|
|
169
|
+
task)
|
|
170
|
+
task_checkpoint "$2"
|
|
171
|
+
;;
|
|
172
|
+
session-end)
|
|
173
|
+
session_end_checkpoint
|
|
174
|
+
;;
|
|
175
|
+
*)
|
|
176
|
+
echo "Usage: $0 {pre-edit|post-edit|task|session-end} [input]"
|
|
177
|
+
exit 1
|
|
178
|
+
;;
|
|
179
|
+
esac
|
package/.claude/settings.json
CHANGED
|
@@ -1,37 +1,114 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
"servicenow-integration",
|
|
11
|
-
"servicenow-automation",
|
|
12
|
-
"servicenow-security-compliance",
|
|
13
|
-
"servicenow-reporting-analytics",
|
|
14
|
-
"claude-flow",
|
|
15
|
-
"ruv-swarm"
|
|
16
|
-
],
|
|
2
|
+
"env": {
|
|
3
|
+
"CLAUDE_FLOW_AUTO_COMMIT": "false",
|
|
4
|
+
"CLAUDE_FLOW_AUTO_PUSH": "false",
|
|
5
|
+
"CLAUDE_FLOW_HOOKS_ENABLED": "true",
|
|
6
|
+
"CLAUDE_FLOW_TELEMETRY_ENABLED": "true",
|
|
7
|
+
"CLAUDE_FLOW_REMOTE_EXECUTION": "true",
|
|
8
|
+
"CLAUDE_FLOW_CHECKPOINTS_ENABLED": "true"
|
|
9
|
+
},
|
|
17
10
|
"permissions": {
|
|
18
11
|
"allow": [
|
|
19
|
-
"Bash(*)",
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
12
|
+
"Bash(npx claude-flow *)",
|
|
13
|
+
"Bash(npm run lint)",
|
|
14
|
+
"Bash(npm run test:*)",
|
|
15
|
+
"Bash(npm test *)",
|
|
16
|
+
"Bash(git status)",
|
|
17
|
+
"Bash(git diff *)",
|
|
18
|
+
"Bash(git log *)",
|
|
19
|
+
"Bash(git add *)",
|
|
20
|
+
"Bash(git commit *)",
|
|
21
|
+
"Bash(git push)",
|
|
22
|
+
"Bash(git config *)",
|
|
23
|
+
"Bash(git tag *)",
|
|
24
|
+
"Bash(git branch *)",
|
|
25
|
+
"Bash(git checkout *)",
|
|
26
|
+
"Bash(git stash *)",
|
|
27
|
+
"Bash(jq *)",
|
|
28
|
+
"Bash(node *)",
|
|
29
|
+
"Bash(which *)",
|
|
30
|
+
"Bash(pwd)",
|
|
31
|
+
"Bash(ls *)"
|
|
32
|
+
],
|
|
33
|
+
"deny": [
|
|
34
|
+
"Bash(rm -rf /)",
|
|
35
|
+
"Bash(curl * | bash)",
|
|
36
|
+
"Bash(wget * | sh)",
|
|
37
|
+
"Bash(eval *)"
|
|
31
38
|
]
|
|
32
39
|
},
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
40
|
+
"hooks": {
|
|
41
|
+
"PreToolUse": [
|
|
42
|
+
{
|
|
43
|
+
"matcher": "Bash",
|
|
44
|
+
"hooks": [
|
|
45
|
+
{
|
|
46
|
+
"type": "command",
|
|
47
|
+
"command": "cat | jq -r '.tool_input.command // empty' | tr '\\n' '\\0' | xargs -0 -I {} npx claude-flow@alpha hooks pre-command --command '{}' --validate-safety true --prepare-resources true"
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"matcher": "Write|Edit|MultiEdit",
|
|
53
|
+
"hooks": [
|
|
54
|
+
{
|
|
55
|
+
"type": "command",
|
|
56
|
+
"command": "cat | jq -r '.tool_input.file_path // .tool_input.path // empty' | tr '\\n' '\\0' | xargs -0 -I {} npx claude-flow@alpha hooks pre-edit --file '{}' --auto-assign-agents true --load-context true"
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
"PostToolUse": [
|
|
62
|
+
{
|
|
63
|
+
"matcher": "Bash",
|
|
64
|
+
"hooks": [
|
|
65
|
+
{
|
|
66
|
+
"type": "command",
|
|
67
|
+
"command": "cat | jq -r '.tool_input.command // empty' | tr '\\n' '\\0' | xargs -0 -I {} npx claude-flow@alpha hooks post-command --command '{}' --track-metrics true --store-results true"
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"matcher": "Write|Edit|MultiEdit",
|
|
73
|
+
"hooks": [
|
|
74
|
+
{
|
|
75
|
+
"type": "command",
|
|
76
|
+
"command": "cat | jq -r '.tool_input.file_path // .tool_input.path // empty' | tr '\\n' '\\0' | xargs -0 -I {} npx claude-flow@alpha hooks post-edit --file '{}' --format true --update-memory true"
|
|
77
|
+
}
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
"PreCompact": [
|
|
82
|
+
{
|
|
83
|
+
"matcher": "manual",
|
|
84
|
+
"hooks": [
|
|
85
|
+
{
|
|
86
|
+
"type": "command",
|
|
87
|
+
"command": "/bin/bash -c 'INPUT=$(cat); CUSTOM=$(echo \"$INPUT\" | jq -r \".custom_instructions // \\\"\\\"\"); echo \"🔄 PreCompact Guidance:\"; echo \"📋 IMPORTANT: Review CLAUDE.md in project root for:\"; echo \" • 54 available agents and concurrent usage patterns\"; echo \" • Swarm coordination strategies (hierarchical, mesh, adaptive)\"; echo \" • SPARC methodology workflows with batchtools optimization\"; echo \" • Critical concurrent execution rules (GOLDEN RULE: 1 MESSAGE = ALL OPERATIONS)\"; if [ -n \"$CUSTOM\" ]; then echo \"🎯 Custom compact instructions: $CUSTOM\"; fi; echo \"✅ Ready for compact operation\"'"
|
|
88
|
+
}
|
|
89
|
+
]
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"matcher": "auto",
|
|
93
|
+
"hooks": [
|
|
94
|
+
{
|
|
95
|
+
"type": "command",
|
|
96
|
+
"command": "/bin/bash -c 'echo \"🔄 Auto-Compact Guidance (Context Window Full):\"; echo \"📋 CRITICAL: Before compacting, ensure you understand:\"; echo \" • All 54 agents available in .claude/agents/ directory\"; echo \" • Concurrent execution patterns from CLAUDE.md\"; echo \" • Batchtools optimization for 300% performance gains\"; echo \" • Swarm coordination strategies for complex tasks\"; echo \"⚡ Apply GOLDEN RULE: Always batch operations in single messages\"; echo \"✅ Auto-compact proceeding with full agent context\"'"
|
|
97
|
+
}
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
"Stop": [
|
|
102
|
+
{
|
|
103
|
+
"hooks": [
|
|
104
|
+
{
|
|
105
|
+
"type": "command",
|
|
106
|
+
"command": "npx claude-flow@alpha hooks session-end --generate-summary true --persist-state true --export-metrics true"
|
|
107
|
+
}
|
|
108
|
+
]
|
|
109
|
+
}
|
|
110
|
+
]
|
|
111
|
+
},
|
|
112
|
+
"includeCoAuthoredBy": true,
|
|
113
|
+
"enabledMcpjsonServers": ["claude-flow", "ruv-swarm"]
|
|
114
|
+
}
|