tokengolf 0.3.0 → 0.4.0
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/.husky/pre-commit +4 -0
- package/.prettierignore +2 -0
- package/.prettierrc +6 -0
- package/.vscode/settings.json +15 -0
- package/CHANGELOG.md +254 -0
- package/CLAUDE.md +136 -10
- package/README.md +89 -47
- package/assets/demo-hud.png +0 -0
- package/assets/scorecard.png +0 -0
- package/dist/cli.js +790 -103
- package/docs/assets/demo-hud.png +0 -0
- package/docs/assets/scorecard.png +0 -0
- package/docs/assets/tokengolf-bg-min.jpg +0 -0
- package/docs/index.html +1080 -0
- package/eslint.config.js +39 -0
- package/hooks/post-tool-use-failure.js +27 -0
- package/hooks/post-tool-use.js +11 -7
- package/hooks/pre-compact.js +9 -3
- package/hooks/session-end.js +168 -42
- package/hooks/session-start.js +31 -11
- package/hooks/session-stop.js +6 -2
- package/hooks/statusline.sh +16 -7
- package/hooks/stop.js +27 -0
- package/hooks/subagent-start.js +27 -0
- package/hooks/user-prompt-submit.js +8 -6
- package/package.json +16 -3
- package/src/cli.js +23 -6
- package/src/components/ActiveRun.js +76 -24
- package/src/components/ScoreCard.js +132 -37
- package/src/components/StartRun.js +156 -53
- package/src/components/StatsView.js +89 -37
- package/src/lib/__tests__/score.test.js +596 -0
- package/src/lib/cost.js +84 -21
- package/src/lib/demo.js +186 -0
- package/src/lib/install.js +92 -62
- package/src/lib/score.js +433 -136
- package/src/lib/store.js +11 -11
- package/.claude/settings.local.json +0 -36
package/src/lib/store.js
CHANGED
|
@@ -45,23 +45,23 @@ export function getAllRuns() {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
export function getStats() {
|
|
48
|
-
const runs = readRuns().filter(r => r.status !== 'active');
|
|
49
|
-
const wins = runs.filter(r => r.status === 'won');
|
|
50
|
-
const deaths = runs.filter(r => r.status === 'died');
|
|
48
|
+
const runs = readRuns().filter((r) => r.status !== 'active');
|
|
49
|
+
const wins = runs.filter((r) => r.status === 'won');
|
|
50
|
+
const deaths = runs.filter((r) => r.status === 'died');
|
|
51
51
|
|
|
52
|
-
const avgSpend = wins.length
|
|
53
|
-
? wins.reduce((sum, r) => sum + (r.spent || 0), 0) / wins.length
|
|
54
|
-
: 0;
|
|
52
|
+
const avgSpend = wins.length ? wins.reduce((sum, r) => sum + (r.spent || 0), 0) / wins.length : 0;
|
|
55
53
|
|
|
56
54
|
const bestRun = wins.length
|
|
57
55
|
? wins.reduce((best, r) => (!best || r.spent < best.spent ? r : best), null)
|
|
58
56
|
: null;
|
|
59
57
|
|
|
60
|
-
const allAchievements = runs.flatMap(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
58
|
+
const allAchievements = runs.flatMap((r) =>
|
|
59
|
+
(r.achievements || []).map((a) => ({
|
|
60
|
+
...a,
|
|
61
|
+
quest: r.quest,
|
|
62
|
+
earnedAt: r.endedAt,
|
|
63
|
+
}))
|
|
64
|
+
);
|
|
65
65
|
|
|
66
66
|
return {
|
|
67
67
|
total: runs.length,
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"permissions": {
|
|
3
|
-
"allow": [
|
|
4
|
-
"Bash(grep:*)",
|
|
5
|
-
"Bash(npm install:*)",
|
|
6
|
-
"Bash(npm run:*)",
|
|
7
|
-
"Bash(npm link:*)",
|
|
8
|
-
"Bash(timeout 3 tokengolf status:*)",
|
|
9
|
-
"Bash(tokengolf stats:*)",
|
|
10
|
-
"Bash(ls:*)",
|
|
11
|
-
"Bash(tokengolf win:*)",
|
|
12
|
-
"Bash(node:*)",
|
|
13
|
-
"Bash(python3:*)",
|
|
14
|
-
"Bash(~/.tokengolf/current-run.json:*)",
|
|
15
|
-
"Bash(git add:*)",
|
|
16
|
-
"WebFetch(domain:github.com)",
|
|
17
|
-
"Bash(for f in a20dac9210b555390 ae511fa601e30efb2 aa25fad39a7781f65)",
|
|
18
|
-
"Bash(do echo \"=== $f ===\")",
|
|
19
|
-
"Read(//private/tmp/claude-501/-Users-josheche-projects-tokengolf/tasks/**)",
|
|
20
|
-
"Bash(done)",
|
|
21
|
-
"Bash(chmod 755:*)",
|
|
22
|
-
"Bash(bash:*)",
|
|
23
|
-
"Bash(tokengolf install:*)",
|
|
24
|
-
"Bash(head:*)",
|
|
25
|
-
"Bash(claude hooks:*)",
|
|
26
|
-
"Bash(git checkout:*)",
|
|
27
|
-
"Bash(git commit:*)",
|
|
28
|
-
"Bash(oh-my-posh claude:*)",
|
|
29
|
-
"Bash(git push:*)",
|
|
30
|
-
"Bash(gh pr:*)",
|
|
31
|
-
"Bash(gh api:*)",
|
|
32
|
-
"Bash(git:*)",
|
|
33
|
-
"Bash(npm whoami:*)"
|
|
34
|
-
]
|
|
35
|
-
}
|
|
36
|
-
}
|