-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmise.toml
More file actions
169 lines (150 loc) · 4.72 KB
/
mise.toml
File metadata and controls
169 lines (150 loc) · 4.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# CipherPowers mise configuration
# Wrapper scripts for workflow conditionals
[tasks.check-has-changes]
description = "Check if there are changes to commit (exit 0 if changes, 1 if empty)"
run = """
if [[ -n $(git status --porcelain) ]]; then
exit 0 # Has changes - proceed
else
exit 1 # No changes - stop
fi
"""
[tasks.check-tests-exist]
description = "Check if all new/modified functions have tests"
run = """
# Get list of modified files with functions
files=$(git diff --cached --name-only)
has_code_changes=false
for file in $files; do
if [[ "$file" == *.rs ]] || [[ "$file" == *.py ]] || [[ "$file" == *.js ]]; then
if grep -qE '(fn |def |function)' "$file" 2>/dev/null; then
has_code_changes=true
break
fi
fi
done
if [[ "$has_code_changes" == "true" ]]; then
echo "⚠️ WARNING: Code changes detected. Verify tests exist before committing."
echo "This check does not fail - manual verification required."
fi
exit 0
"""
[tasks.check-docs-updated]
description = "Check if documentation is updated for user-facing changes"
run = """
# Check if any src files modified
src_modified=$(git diff --cached --name-only | grep -E '(src/|lib/)' | wc -l)
# Check if any docs modified
docs_modified=$(git diff --cached --name-only | grep -E '(README|docs/|\\.md$)' | wc -l)
# If src modified but no docs, might need docs
if [[ $src_modified -gt 0 ]] && [[ $docs_modified -eq 0 ]]; then
echo "Warning: Source files modified but no documentation updated"
echo "If this change is user-facing, please update docs"
exit 1 # Fail by default, user can override
fi
exit 0
"""
[tasks.check-atomic-commit]
description = "Check if changes serve a single atomic purpose"
run = """
# Check file count
files=$(git diff --cached --name-only | wc -l)
if [[ $files -gt 15 ]]; then
echo "Large commit with $files files - consider splitting"
exit 1
fi
# Check different subsystems modified
subsystems=$(git diff --cached --name-only | cut -d'/' -f1 | sort -u | wc -l)
if [[ $subsystems -gt 3 ]]; then
echo "Commit touches $subsystems different subsystems - consider splitting"
exit 1
fi
exit 0
"""
[tasks.build-workflow]
description = "Compile the Rust workflow executor tool"
run = """
echo "🔧 Building workflow tool..."
cd plugin/tools/workflow
if cargo build --release; then
echo "✅ Workflow tool compiled successfully"
echo " Binary: plugin/tools/workflow/target/release/workflow"
else
echo "❌ Compilation failed"
echo " Ensure Rust toolchain is installed: https://rustup.rs"
exit 1
fi
"""
[tasks.setup]
description = "Complete setup after cloning CipherPowers plugin"
depends = ["build-workflow"]
run = """
echo ""
echo "✅ CipherPowers plugin ready to use"
echo ""
echo "Next steps:"
echo " 1. Add this plugin to Claude Code configuration"
echo " 2. Restart Claude Code to load the plugin"
echo ""
"""
# Hook logging tasks
[tasks.logs]
description = "Tail hook logs (enable with CIPHERPOWERS_LOG=1)"
run = """
LOG_FILE=$(node plugin/hooks/hooks-app/dist/cli.js log-path)
if [[ -f "$LOG_FILE" ]]; then
tail -f "$LOG_FILE"
else
echo "No log file found at: $LOG_FILE"
echo ""
echo "Enable logging by setting: export CIPHERPOWERS_LOG=1"
echo "Then trigger a hook event (e.g., edit a file in Claude Code)"
fi
"""
[tasks."logs:errors"]
description = "Tail hook logs, showing only errors"
run = """
LOG_FILE=$(node plugin/hooks/hooks-app/dist/cli.js log-path)
if [[ -f "$LOG_FILE" ]]; then
tail -f "$LOG_FILE" | jq -c 'select(.level == "error")'
else
echo "No log file found at: $LOG_FILE"
echo "Enable logging by setting: export CIPHERPOWERS_LOG=1"
fi
"""
[tasks."logs:all"]
description = "Tail all recent hook logs (last 7 days)"
run = """
LOG_DIR=$(node plugin/hooks/hooks-app/dist/cli.js log-dir)
if [[ -d "$LOG_DIR" ]]; then
tail -f "$LOG_DIR"/hooks-*.log
else
echo "No log directory found at: $LOG_DIR"
echo "Enable logging by setting: export CIPHERPOWERS_LOG=1"
fi
"""
[tasks."logs:pretty"]
description = "Tail hook logs with pretty formatting"
run = '''
LOG_FILE=$(node plugin/hooks/hooks-app/dist/cli.js log-path)
if [[ -f "$LOG_FILE" ]]; then
tail -f "$LOG_FILE" | jq -r '"\(.ts | split("T")[1] | split(".")[0]) [\(.level | ascii_upcase)] \(.event // .message) \(del(.ts, .level, .event, .message) | to_entries | map("\(.key)=\(.value)") | join(" "))"'
else
echo "No log file found at: $LOG_FILE"
echo "Enable logging by setting: export CIPHERPOWERS_LOG=1"
fi
'''
[tasks."logs:path"]
description = "Show current log file path"
run = "node plugin/hooks/hooks-app/dist/cli.js log-path"
[tasks."logs:clear"]
description = "Clear today's log file"
run = """
LOG_FILE=$(node plugin/hooks/hooks-app/dist/cli.js log-path)
if [[ -f "$LOG_FILE" ]]; then
rm "$LOG_FILE"
echo "Cleared: $LOG_FILE"
else
echo "No log file to clear"
fi
"""