odd-studio 2.4.0 → 2.4.1
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.
|
@@ -5,7 +5,10 @@
|
|
|
5
5
|
# Blocks or warns on shell commands that could cause irreversible damage:
|
|
6
6
|
# rm -rf, overwriting critical files, dropping databases, etc.
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
INPUT=$(cat)
|
|
9
|
+
TOOL_NAME=$(echo "$INPUT" | jq -r '.tool_name // empty')
|
|
10
|
+
if [ "$TOOL_NAME" != "Bash" ]; then exit 0; fi
|
|
11
|
+
COMMAND=$(echo "$INPUT" | jq -r '.tool_input.command // empty')
|
|
9
12
|
|
|
10
13
|
block() {
|
|
11
14
|
echo "🛡️ ODD DESTRUCTIVE GUARD: $1" >&2
|
package/hooks/odd-git-safety.sh
CHANGED
|
@@ -10,7 +10,10 @@
|
|
|
10
10
|
# Exit 2 → block the command (Claude will not execute it)
|
|
11
11
|
# Stderr → message shown to the user
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
INPUT=$(cat)
|
|
14
|
+
TOOL_NAME=$(echo "$INPUT" | jq -r '.tool_name // empty')
|
|
15
|
+
if [ "$TOOL_NAME" != "Bash" ]; then exit 0; fi
|
|
16
|
+
COMMAND=$(echo "$INPUT" | jq -r '.tool_input.command // empty')
|
|
14
17
|
|
|
15
18
|
# ── Helper ────────────────────────────────────────────────────────────────────
|
|
16
19
|
block() {
|
|
@@ -5,7 +5,10 @@
|
|
|
5
5
|
# Runs after a file is written. If the file is in docs/outcomes/ or docs/personas/,
|
|
6
6
|
# checks for completeness. Provides coaching — does not block.
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
INPUT=$(cat)
|
|
9
|
+
TOOL_NAME=$(echo "$INPUT" | jq -r '.tool_name // empty')
|
|
10
|
+
if [ "$TOOL_NAME" != "Write" ]; then exit 0; fi
|
|
11
|
+
FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // empty')
|
|
9
12
|
|
|
10
13
|
# ── Only check ODD docs ───────────────────────────────────────────────────────
|
|
11
14
|
if ! echo "$FILE_PATH" | grep -qE 'docs/(outcomes|personas)/'; then
|
package/hooks/odd-pre-build.sh
CHANGED
|
@@ -5,7 +5,10 @@
|
|
|
5
5
|
# Runs before npm run build, npm test, and deployment commands.
|
|
6
6
|
# Checks that ODD project state is sane before the build proceeds.
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
INPUT=$(cat)
|
|
9
|
+
TOOL_NAME=$(echo "$INPUT" | jq -r '.tool_name // empty')
|
|
10
|
+
if [ "$TOOL_NAME" != "Bash" ]; then exit 0; fi
|
|
11
|
+
COMMAND=$(echo "$INPUT" | jq -r '.tool_input.command // empty')
|
|
9
12
|
|
|
10
13
|
# ── Only intercept build/deploy commands ─────────────────────────────────────
|
|
11
14
|
if ! echo "$COMMAND" | grep -qE '(npm\s+run\s+(build|deploy|start:prod)|yarn\s+(build|deploy)|pnpm\s+(build|deploy))'; then
|
|
@@ -6,7 +6,10 @@
|
|
|
6
6
|
# so that the next /odd session can resume from exactly this point.
|
|
7
7
|
# Falls back to local .odd/state.json if ruflo is unavailable.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
INPUT=$(cat)
|
|
10
|
+
TOOL_NAME=$(echo "$INPUT" | jq -r '.tool_name // empty')
|
|
11
|
+
if [ "$TOOL_NAME" != "Bash" ]; then exit 0; fi
|
|
12
|
+
COMMAND=$(echo "$INPUT" | jq -r '.tool_input.command // empty')
|
|
10
13
|
|
|
11
14
|
# ── Only trigger on git commit ────────────────────────────────────────────────
|
|
12
15
|
if ! echo "$COMMAND" | grep -qE 'git\s+commit'; then
|
package/package.json
CHANGED