@prism-d1/cli 1.0.14 → 1.0.15
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.
|
@@ -85,7 +85,7 @@ The installer creates `.prism/config.json`:
|
|
|
85
85
|
Set custom bounds at install time:
|
|
86
86
|
|
|
87
87
|
```bash
|
|
88
|
-
|
|
88
|
+
prism-cli bootstrapper install-git-hooks --team-id my-team --max-tokens 500000 --max-cost 50
|
|
89
89
|
```
|
|
90
90
|
|
|
91
91
|
Values exceeding bounds are clamped to the configured maximum. The workflow (`prism-ai-metrics.yml`) applies a second layer of enforcement, discarding values above 1M tokens / $100 to zero.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
# prepare-commit-msg — Detect AI-
|
|
2
|
+
# prepare-commit-msg — Detect AI-generated commits and add origin trailers.
|
|
3
3
|
#
|
|
4
4
|
# This hook detects if the commit was made via Claude Code, Kiro, or other AI tools
|
|
5
5
|
# and adds AI-Origin, AI-Model, AI-Token, and Spec-Ref trailers to the commit message.
|
|
@@ -34,32 +34,21 @@ AI_TOOL=""
|
|
|
34
34
|
# Check for Claude Code session
|
|
35
35
|
# Claude Code sets CLAUDE_CODE environment variable or leaves markers
|
|
36
36
|
if [[ -n "${CLAUDE_CODE:-}" || -n "${CLAUDE_CODE_SESSION_ID:-}" ]]; then
|
|
37
|
-
AI_ORIGIN="ai-
|
|
37
|
+
AI_ORIGIN="ai-generated"
|
|
38
38
|
AI_TOOL="claude-code"
|
|
39
39
|
AI_MODEL="${ANTHROPIC_MODEL:-us.anthropic.claude-sonnet-4-5-20250929-v1:0}"
|
|
40
40
|
fi
|
|
41
41
|
|
|
42
42
|
# Check for Kiro markers
|
|
43
|
-
# Kiro CLI sets KIRO_SESSION_ID
|
|
44
|
-
if [[ -n "${KIRO_SESSION_ID:-}" || -n "${KIRO_SESSION:-}" ]]; then
|
|
45
|
-
AI_ORIGIN="ai-assisted"
|
|
46
|
-
AI_TOOL="kiro"
|
|
47
|
-
fi
|
|
48
|
-
|
|
49
|
-
# Check if the commit message itself contains AI indicators
|
|
50
|
-
if grep -qiE '(generated by|co-authored-by:.*claude|co-authored-by:.*kiro|AI-Origin:)' "${COMMIT_MSG_FILE}" 2>/dev/null; then
|
|
43
|
+
# Kiro CLI sets KIRO_SESSION_ID; Kiro IDE sets TERM_PROGRAM=kiro
|
|
44
|
+
if [[ -n "${KIRO_SESSION_ID:-}" || -n "${KIRO_SESSION:-}" || "${TERM_PROGRAM:-}" == "kiro" ]]; then
|
|
51
45
|
AI_ORIGIN="ai-generated"
|
|
52
|
-
|
|
53
|
-
AI_TOOL="${AI_TOOL:-claude-code}"
|
|
54
|
-
fi
|
|
55
|
-
if grep -qi 'kiro' "${COMMIT_MSG_FILE}" 2>/dev/null; then
|
|
56
|
-
AI_TOOL="${AI_TOOL:-kiro}"
|
|
57
|
-
fi
|
|
46
|
+
AI_TOOL="kiro"
|
|
58
47
|
fi
|
|
59
48
|
|
|
60
49
|
# Check for Amazon Q Developer
|
|
61
50
|
if [[ -n "${Q_DEVELOPER_SESSION:-}" ]]; then
|
|
62
|
-
AI_ORIGIN="ai-
|
|
51
|
+
AI_ORIGIN="ai-generated"
|
|
63
52
|
AI_TOOL="q-developer"
|
|
64
53
|
fi
|
|
65
54
|
|