skilltally 1.0.0 → 1.0.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.
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/CHANGELOG.md +6 -0
- package/bin/cli.mjs +1 -1
- package/gemini-extension.json +1 -1
- package/package.json +1 -1
- package/plugin.json +1 -1
- package/src/install/antigravity.mjs +1 -1
- package/src/install/codex.mjs +25 -9
- package/src/install/doctor.mjs +26 -19
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.0.1] - 2026-11-19
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- Ignore third-party hooks in `skilltally doctor` when inspecting `~/.codex/hooks.json`, `~/.claude/settings.json`, `~/.gemini/settings.json`, and `~/.gemini/config/hooks.json` instead of flagging unrelated commands as broken paths.
|
|
12
|
+
- Match the exact `[hooks.state."...hooks.json:post_tool_use:<group>:<handler>"]` index in `~/.codex/config.toml` when checking Codex hook trust so third-party hooks at index `0:0` do not produce false positives.
|
|
13
|
+
|
|
8
14
|
## [1.0.0] - 2026-11-19
|
|
9
15
|
|
|
10
16
|
### Added
|
package/bin/cli.mjs
CHANGED
package/gemini-extension.json
CHANGED
package/package.json
CHANGED
package/plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "skilltally",
|
|
3
3
|
"displayName": "SkillTally",
|
|
4
4
|
"description": "Real-time skill usage tracking via hooks for Antigravity, Claude Code, Codex & Gemini CLI. See which skills you actually use and which eat context.",
|
|
5
|
-
"version": "1.0.
|
|
5
|
+
"version": "1.0.1",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "112516101106",
|
|
8
8
|
"url": "https://github.com/112516101106"
|
|
@@ -88,7 +88,7 @@ export function installAntigravity({
|
|
|
88
88
|
|
|
89
89
|
writeJsonAtomic(join(target, 'hooks.json'), buildAntigravityHooksJson(), 0o644);
|
|
90
90
|
|
|
91
|
-
let version = '1.0.
|
|
91
|
+
let version = '1.0.1';
|
|
92
92
|
try {
|
|
93
93
|
version = JSON.parse(readFileSync(join(pkgRoot, 'package.json'), 'utf8')).version || version;
|
|
94
94
|
} catch {}
|
package/src/install/codex.mjs
CHANGED
|
@@ -56,20 +56,32 @@ export function hasCodexPluginInstalled(homeDir = homedir()) {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
export function checkCodexHookTrust(homeDir = homedir()) {
|
|
59
|
-
const raw = readCodexToml(homeDir);
|
|
60
59
|
const hooksPath = join(homeDir, '.codex', 'hooks.json');
|
|
61
|
-
let
|
|
60
|
+
let userHookPos = null;
|
|
62
61
|
try {
|
|
63
62
|
const doc = readJsonObject(hooksPath);
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
63
|
+
const groups = doc?.hooks?.PostToolUse || [];
|
|
64
|
+
for (let gi = 0; gi < groups.length && !userHookPos; gi++) {
|
|
65
|
+
const handlers = groups[gi]?.hooks;
|
|
66
|
+
if (!Array.isArray(handlers)) continue;
|
|
67
|
+
for (let hi = 0; hi < handlers.length; hi++) {
|
|
68
|
+
if (isSkilltallyHandler(handlers[hi])) {
|
|
69
|
+
userHookPos = { groupIdx: gi, handlerIdx: hi };
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
68
72
|
}
|
|
69
73
|
}
|
|
70
74
|
} catch {}
|
|
71
75
|
|
|
72
|
-
|
|
76
|
+
const hasPlugin = hasCodexPluginInstalled(homeDir);
|
|
77
|
+
if (!userHookPos && !hasPlugin) return 'unknown';
|
|
78
|
+
|
|
79
|
+
const raw = readCodexToml(homeDir);
|
|
80
|
+
if (!raw) return userHookPos ? 'untrusted' : 'unknown';
|
|
81
|
+
|
|
82
|
+
const exactHookKey = userHookPos
|
|
83
|
+
? `hooks.json:post_tool_use:${userHookPos.groupIdx}:${userHookPos.handlerIdx}`
|
|
84
|
+
: null;
|
|
73
85
|
|
|
74
86
|
let inRelevantState = false;
|
|
75
87
|
let sawSection = false;
|
|
@@ -79,7 +91,11 @@ export function checkCodexHookTrust(homeDir = homedir()) {
|
|
|
79
91
|
const trimmed = line.replace(/#.*$/, '').trim();
|
|
80
92
|
if (!trimmed) continue;
|
|
81
93
|
if (trimmed.startsWith('[')) {
|
|
82
|
-
|
|
94
|
+
const matchesSkilltally = trimmed.includes('skilltally');
|
|
95
|
+
const matchesUserHook =
|
|
96
|
+
exactHookKey !== null &&
|
|
97
|
+
(trimmed.includes(exactHookKey) || /:hooks\.json:post_tool_use(?:"|'|])/.test(trimmed));
|
|
98
|
+
if (/^\[hooks\.state\./.test(trimmed) && (matchesSkilltally || matchesUserHook)) {
|
|
83
99
|
inRelevantState = true;
|
|
84
100
|
sawSection = true;
|
|
85
101
|
} else {
|
|
@@ -93,7 +109,7 @@ export function checkCodexHookTrust(homeDir = homedir()) {
|
|
|
93
109
|
}
|
|
94
110
|
|
|
95
111
|
if (sawSection) return sawTrustedHash ? 'trusted' : 'untrusted';
|
|
96
|
-
return
|
|
112
|
+
return userHookPos ? 'untrusted' : 'unknown';
|
|
97
113
|
}
|
|
98
114
|
|
|
99
115
|
export function installCodex({
|
package/src/install/doctor.mjs
CHANGED
|
@@ -11,29 +11,36 @@ import { checkCodexHookTrust, detectCodex, hasCodexPluginInstalled } from './cod
|
|
|
11
11
|
import { detectGemini } from './gemini.mjs';
|
|
12
12
|
import { extractHookCommandPath, getPackageRoot, isSkilltallyHandler, readJsonObject } from './runtime.mjs';
|
|
13
13
|
|
|
14
|
-
function
|
|
14
|
+
function collectAntigravityHookCommands(hooksJsonObj) {
|
|
15
15
|
const commands = [];
|
|
16
16
|
if (!hooksJsonObj || typeof hooksJsonObj !== 'object') return commands;
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
if (
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
for (const [key, val] of Object.entries(hooksJsonObj)) {
|
|
19
|
+
if (key === 'hooks' || !val || typeof val !== 'object') continue;
|
|
20
|
+
if (!Array.isArray(val.PostToolUse)) continue;
|
|
21
|
+
for (const group of val.PostToolUse) {
|
|
22
|
+
for (const h of group?.hooks || []) {
|
|
23
|
+
if ((key === 'skilltally' || isSkilltallyHandler(h)) && typeof h?.command === 'string') {
|
|
24
|
+
commands.push(h.command);
|
|
24
25
|
}
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
|
|
29
|
-
|
|
30
|
+
return commands;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function collectNestedHookCommands(hooksJsonObj) {
|
|
34
|
+
const commands = [];
|
|
35
|
+
if (!hooksJsonObj || typeof hooksJsonObj !== 'object') return commands;
|
|
36
|
+
|
|
30
37
|
for (const eventName of ['PostToolUse', 'AfterTool']) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
38
|
+
const groups = hooksJsonObj?.hooks?.[eventName];
|
|
39
|
+
if (!Array.isArray(groups)) continue;
|
|
40
|
+
for (const group of groups) {
|
|
41
|
+
for (const h of group?.hooks || []) {
|
|
42
|
+
if (isSkilltallyHandler(h) && typeof h?.command === 'string') {
|
|
43
|
+
commands.push(h.command);
|
|
37
44
|
}
|
|
38
45
|
}
|
|
39
46
|
}
|
|
@@ -146,14 +153,14 @@ export function runDoctor({
|
|
|
146
153
|
let agyPluginCmds = [];
|
|
147
154
|
if (agyPluginExists && existsSync(join(agyPluginDir, 'hooks.json'))) {
|
|
148
155
|
try {
|
|
149
|
-
agyPluginCmds =
|
|
156
|
+
agyPluginCmds = collectAntigravityHookCommands(readJsonObject(join(agyPluginDir, 'hooks.json')));
|
|
150
157
|
} catch {}
|
|
151
158
|
}
|
|
152
159
|
let agyGlobalCmds = [];
|
|
153
160
|
const agyGlobalHooksPath = join(homeDir, '.gemini', 'config', 'hooks.json');
|
|
154
161
|
if (existsSync(agyGlobalHooksPath)) {
|
|
155
162
|
try {
|
|
156
|
-
agyGlobalCmds =
|
|
163
|
+
agyGlobalCmds = collectAntigravityHookCommands(readJsonObject(agyGlobalHooksPath));
|
|
157
164
|
} catch {}
|
|
158
165
|
}
|
|
159
166
|
|
|
@@ -183,7 +190,7 @@ export function runDoctor({
|
|
|
183
190
|
let claudeCmds = [];
|
|
184
191
|
if (existsSync(claudeSettingsPath)) {
|
|
185
192
|
try {
|
|
186
|
-
claudeCmds =
|
|
193
|
+
claudeCmds = collectNestedHookCommands(readJsonObject(claudeSettingsPath));
|
|
187
194
|
} catch {}
|
|
188
195
|
}
|
|
189
196
|
const claudeSettingsInstalled = claudeCmds.length > 0;
|
|
@@ -204,7 +211,7 @@ export function runDoctor({
|
|
|
204
211
|
let codexCmds = [];
|
|
205
212
|
if (existsSync(codexHooksPath)) {
|
|
206
213
|
try {
|
|
207
|
-
codexCmds =
|
|
214
|
+
codexCmds = collectNestedHookCommands(readJsonObject(codexHooksPath));
|
|
208
215
|
} catch {}
|
|
209
216
|
}
|
|
210
217
|
const codexHooksInstalled = codexCmds.length > 0;
|
|
@@ -227,7 +234,7 @@ export function runDoctor({
|
|
|
227
234
|
if (existsSync(geminiSettingsPath)) {
|
|
228
235
|
try {
|
|
229
236
|
const geminiDoc = readJsonObject(geminiSettingsPath);
|
|
230
|
-
geminiCmds =
|
|
237
|
+
geminiCmds = collectNestedHookCommands(geminiDoc);
|
|
231
238
|
geminiHooksDisabled = geminiDoc?.hooksConfig?.enabled === false;
|
|
232
239
|
} catch {}
|
|
233
240
|
}
|