@grimoire-cc/cli 0.12.2 → 0.13.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/dist/bin.js +2 -2
- package/dist/bin.js.map +1 -1
- package/dist/commands/list.d.ts +1 -1
- package/dist/commands/list.d.ts.map +1 -1
- package/dist/commands/list.js +135 -37
- package/dist/commands/list.js.map +1 -1
- package/dist/static/log-viewer.html +19 -4
- package/dist/static/static/log-viewer.html +19 -4
- package/package.json +1 -1
package/dist/bin.js
CHANGED
package/dist/bin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAE/C,MAAM,UAAU,GAAG,aAAa,CAAC;IAC/B,IAAI,EAAE;QACJ,IAAI,EAAE,KAAK;QACX,WAAW,EAAE,sEAAsE;KACpF;IACD,KAAK,CAAC,GAAG;QACP,MAAM,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IAC9B,CAAC;CACF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2 +1,2 @@
|
|
|
1
|
-
export declare function runList(projectDir: string): void
|
|
1
|
+
export declare function runList(projectDir: string): Promise<void>;
|
|
2
2
|
//# sourceMappingURL=list.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/commands/list.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/commands/list.ts"],"names":[],"mappings":"AAiHA,wBAAsB,OAAO,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAmH/D"}
|
package/dist/commands/list.js
CHANGED
|
@@ -1,17 +1,91 @@
|
|
|
1
|
-
import { existsSync, readdirSync, statSync } from 'fs';
|
|
1
|
+
import { existsSync, readFileSync, readdirSync, statSync } from 'fs';
|
|
2
2
|
import { basename, join } from 'path';
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
-
|
|
3
|
+
import * as clack from '@clack/prompts';
|
|
4
|
+
import { readManifest } from '../enforce.js';
|
|
5
|
+
function readAgentFullMeta(agentPath) {
|
|
6
|
+
let content;
|
|
7
|
+
try {
|
|
8
|
+
content = readFileSync(agentPath, 'utf-8');
|
|
9
|
+
}
|
|
10
|
+
catch {
|
|
11
|
+
return { description: '', model: '', tools: '' };
|
|
12
|
+
}
|
|
13
|
+
const fm = content.match(/^---\r?\n([\s\S]*?)\r?\n---/);
|
|
14
|
+
if (!fm?.[1])
|
|
15
|
+
return { description: '', model: '', tools: '' };
|
|
16
|
+
const block = fm[1];
|
|
17
|
+
const get = (key) => block.match(new RegExp(`^${key}:\\s*(.+)$`, 'm'))?.[1]?.trim().replace(/^["']|["']$/g, '') ??
|
|
18
|
+
'';
|
|
19
|
+
return {
|
|
20
|
+
description: get('description'),
|
|
21
|
+
model: get('model'),
|
|
22
|
+
tools: get('tools'),
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function readSkillDescription(skillMdPath) {
|
|
26
|
+
let content;
|
|
27
|
+
try {
|
|
28
|
+
content = readFileSync(skillMdPath, 'utf-8');
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
return '';
|
|
32
|
+
}
|
|
33
|
+
const fm = content.match(/^---\r?\n([\s\S]*?)\r?\n---/);
|
|
34
|
+
if (!fm?.[1])
|
|
35
|
+
return '';
|
|
36
|
+
const block = fm[1];
|
|
37
|
+
return (block.match(/^description:\s*(.+)$/m)?.[1]?.trim().replace(/^["']|["']$/g, '') ?? '');
|
|
7
38
|
}
|
|
8
|
-
|
|
39
|
+
function formatAgentDetail(meta, enforced, filePatterns, fallbackDesc) {
|
|
40
|
+
const desc = meta.description || fallbackDesc;
|
|
41
|
+
const lines = [];
|
|
42
|
+
lines.push('Description:');
|
|
43
|
+
lines.push(` ${desc}`);
|
|
44
|
+
lines.push('');
|
|
45
|
+
lines.push(`Model: ${meta.model || 'inherit'}`);
|
|
46
|
+
lines.push(`Tools: ${meta.tools || '(not specified)'}`);
|
|
47
|
+
lines.push('');
|
|
48
|
+
if (enforced) {
|
|
49
|
+
const patterns = filePatterns?.length ? filePatterns.join(', ') : '(none)';
|
|
50
|
+
lines.push(`Enforce: yes (file patterns: ${patterns})`);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
lines.push('Enforce: no');
|
|
54
|
+
}
|
|
55
|
+
return lines.join('\n');
|
|
56
|
+
}
|
|
57
|
+
function formatSkillDetail(description, triggers) {
|
|
58
|
+
const lines = [];
|
|
59
|
+
lines.push('Description:');
|
|
60
|
+
lines.push(` ${description || '(no description)'}`);
|
|
61
|
+
lines.push('');
|
|
62
|
+
lines.push('Auto-activation triggers:');
|
|
63
|
+
if (!triggers) {
|
|
64
|
+
lines.push(' (no triggers configured)');
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
const kw = triggers.keywords?.length ? triggers.keywords.join(', ') : '(none)';
|
|
68
|
+
const ext = triggers.file_extensions?.length ? triggers.file_extensions.join(', ') : '(none)';
|
|
69
|
+
const pat = triggers.patterns?.length ? triggers.patterns.join(', ') : '(none)';
|
|
70
|
+
const fp = triggers.file_paths?.length ? triggers.file_paths.join(', ') : '(none)';
|
|
71
|
+
lines.push(` Keywords: ${kw}`);
|
|
72
|
+
lines.push(` File extensions: ${ext}`);
|
|
73
|
+
lines.push(` Patterns: ${pat}`);
|
|
74
|
+
lines.push(` File paths: ${fp}`);
|
|
75
|
+
}
|
|
76
|
+
return lines.join('\n');
|
|
77
|
+
}
|
|
78
|
+
// --- Main command ---
|
|
79
|
+
export async function runList(projectDir) {
|
|
9
80
|
const agentsDir = join(projectDir, '.claude', 'agents');
|
|
10
81
|
const skillsDir = join(projectDir, '.claude', 'skills');
|
|
11
|
-
// Load manifest to determine which items grimoire manages
|
|
12
82
|
let managedAgentNames = null;
|
|
13
83
|
let managedSkillDirNames = null;
|
|
14
|
-
|
|
84
|
+
const enforcedAgents = new Set();
|
|
85
|
+
const agentFilePatterns = new Map();
|
|
86
|
+
// skill triggers keyed by dir name
|
|
87
|
+
const skillTriggers = new Map();
|
|
88
|
+
const skillManifestDescs = new Map();
|
|
15
89
|
try {
|
|
16
90
|
const manifest = readManifest(projectDir);
|
|
17
91
|
managedAgentNames = new Set(Object.keys(manifest.agents));
|
|
@@ -19,19 +93,26 @@ export function runList(projectDir) {
|
|
|
19
93
|
for (const [name, entry] of Object.entries(manifest.agents)) {
|
|
20
94
|
if (entry.enforce)
|
|
21
95
|
enforcedAgents.add(name);
|
|
96
|
+
if (entry.file_patterns?.length)
|
|
97
|
+
agentFilePatterns.set(name, entry.file_patterns);
|
|
98
|
+
}
|
|
99
|
+
for (const skill of manifest.skills) {
|
|
100
|
+
const dirName = basename(skill.path);
|
|
101
|
+
if (skill['triggers'])
|
|
102
|
+
skillTriggers.set(dirName, skill['triggers']);
|
|
103
|
+
if (skill['description'])
|
|
104
|
+
skillManifestDescs.set(dirName, skill['description']);
|
|
22
105
|
}
|
|
23
106
|
}
|
|
24
107
|
catch {
|
|
25
108
|
// manifest absent — nothing was installed by grimoire
|
|
26
109
|
}
|
|
27
|
-
// Collect grimoire-managed agents
|
|
28
110
|
const agentNames = managedAgentNames;
|
|
29
111
|
const agentFiles = existsSync(agentsDir) && agentNames !== null
|
|
30
112
|
? readdirSync(agentsDir)
|
|
31
113
|
.filter((f) => f.endsWith('.md') && agentNames.has(f.replace(/\.md$/, '')))
|
|
32
114
|
.sort()
|
|
33
115
|
: [];
|
|
34
|
-
// Collect grimoire-managed skills (directories containing SKILL.md)
|
|
35
116
|
const skillDirNames = managedSkillDirNames;
|
|
36
117
|
const skillDirs = existsSync(skillsDir) && skillDirNames !== null
|
|
37
118
|
? readdirSync(skillsDir)
|
|
@@ -44,38 +125,55 @@ export function runList(projectDir) {
|
|
|
44
125
|
.sort()
|
|
45
126
|
: [];
|
|
46
127
|
if (agentFiles.length === 0 && skillDirs.length === 0) {
|
|
47
|
-
|
|
128
|
+
clack.log.warn('No grimoire-managed items found. Run `grimoire add` to get started.');
|
|
48
129
|
return;
|
|
49
130
|
}
|
|
50
|
-
|
|
131
|
+
// Build select options
|
|
132
|
+
const options = [];
|
|
133
|
+
for (const f of agentFiles) {
|
|
51
134
|
const name = f.replace(/\.md$/, '');
|
|
52
|
-
const meta =
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
});
|
|
60
|
-
// Determine padding
|
|
61
|
-
const allNames = [...agentRows, ...skillRows].map((r) => r.name);
|
|
62
|
-
const pad = Math.max(...allNames.map((n) => n.length));
|
|
63
|
-
if (agentRows.length > 0) {
|
|
64
|
-
console.log(`Agents (${agentRows.length}):`);
|
|
65
|
-
for (const row of agentRows) {
|
|
66
|
-
const suffix = row.enforced ? ' [enforced]' : '';
|
|
67
|
-
console.log(` ${row.name.padEnd(pad)} ${truncate(row.desc)}${suffix}`);
|
|
68
|
-
}
|
|
135
|
+
const meta = readAgentFullMeta(join(agentsDir, f));
|
|
136
|
+
const desc = meta.description;
|
|
137
|
+
options.push({
|
|
138
|
+
value: { kind: 'agent', name },
|
|
139
|
+
label: `[agent] ${name}`,
|
|
140
|
+
...(desc ? { hint: desc.length > 80 ? desc.slice(0, 79) + '…' : desc } : {}),
|
|
141
|
+
});
|
|
69
142
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
143
|
+
for (const d of skillDirs) {
|
|
144
|
+
const desc = readSkillDescription(join(skillsDir, d, 'SKILL.md')) ||
|
|
145
|
+
skillManifestDescs.get(d) ||
|
|
146
|
+
'';
|
|
147
|
+
options.push({
|
|
148
|
+
value: { kind: 'skill', name: d },
|
|
149
|
+
label: `[skill] ${d}`,
|
|
150
|
+
...(desc ? { hint: desc.length > 80 ? desc.slice(0, 79) + '…' : desc } : {}),
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
clack.intro('Grimoire — Installed Items');
|
|
154
|
+
while (true) {
|
|
155
|
+
const selected = await clack.select({
|
|
156
|
+
message: 'Select an item to view details (Ctrl+C to exit)',
|
|
157
|
+
options,
|
|
158
|
+
});
|
|
159
|
+
if (clack.isCancel(selected))
|
|
160
|
+
break;
|
|
161
|
+
if (selected.kind === 'agent') {
|
|
162
|
+
const meta = readAgentFullMeta(join(agentsDir, `${selected.name}.md`));
|
|
163
|
+
const enforced = enforcedAgents.has(selected.name);
|
|
164
|
+
const patterns = agentFilePatterns.get(selected.name);
|
|
165
|
+
const detail = formatAgentDetail(meta, enforced, patterns, '');
|
|
166
|
+
clack.note(detail, selected.name);
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
const desc = readSkillDescription(join(skillsDir, selected.name, 'SKILL.md')) ||
|
|
170
|
+
skillManifestDescs.get(selected.name) ||
|
|
171
|
+
'';
|
|
172
|
+
const triggers = skillTriggers.get(selected.name);
|
|
173
|
+
const detail = formatSkillDetail(desc, triggers);
|
|
174
|
+
clack.note(detail, selected.name);
|
|
76
175
|
}
|
|
77
176
|
}
|
|
78
|
-
|
|
79
|
-
console.log(`${agentRows.length} agent(s), ${skillRows.length} skill(s) installed.`);
|
|
177
|
+
clack.outro('Done.');
|
|
80
178
|
}
|
|
81
179
|
//# sourceMappingURL=list.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/commands/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/commands/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAU7C,SAAS,iBAAiB,CAAC,SAAiB;IAC1C,IAAI,OAAe,CAAC;IACpB,IAAI,CAAC;QACH,OAAO,GAAG,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAC7C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;IACnD,CAAC;IACD,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC;IACxD,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QAAE,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;IAC/D,MAAM,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;IACpB,MAAM,GAAG,GAAG,CAAC,GAAW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|
|
348
|
+
}
|
|
349
|
+
|
|
345
350
|
.prompt-text {
|
|
346
351
|
max-width: 400px;
|
|
347
352
|
overflow: hidden;
|
|
@@ -583,6 +588,7 @@
|
|
|
583
588
|
<option value="">All</option>
|
|
584
589
|
<option value="activated">Activated</option>
|
|
585
590
|
<option value="no_match">No Match</option>
|
|
591
|
+
<option value="blocked">Blocked</option>
|
|
586
592
|
</select>
|
|
587
593
|
</div>
|
|
588
594
|
<div class="filter-group">
|
|
@@ -801,6 +807,7 @@
|
|
|
801
807
|
const total = entries.length;
|
|
802
808
|
const activated = entries.filter(e => e.outcome === 'activated').length;
|
|
803
809
|
const noMatch = entries.filter(e => e.outcome === 'no_match').length;
|
|
810
|
+
const blocked = entries.filter(e => e.outcome === 'blocked').length;
|
|
804
811
|
const promptHooks = entries.filter(e => !e.hook_event).length;
|
|
805
812
|
const toolHooks = entries.filter(e => e.hook_event === 'PreToolUse').length;
|
|
806
813
|
const avgMs = (entries.reduce((s, e) => s + (e.execution_time_ms ?? 0), 0) / total).toFixed(1);
|
|
@@ -810,6 +817,7 @@
|
|
|
810
817
|
<div class="stat-card"><div class="value">${total}</div><div class="label">Total Events</div></div>
|
|
811
818
|
<div class="stat-card activated"><div class="value">${activated}</div><div class="label">Activated (${(activated / total * 100).toFixed(0)}%)</div></div>
|
|
812
819
|
<div class="stat-card no-match"><div class="value">${noMatch}</div><div class="label">No Match</div></div>
|
|
820
|
+
<div class="stat-card" style="border-color:var(--red)"><div class="value" style="color:var(--red)">${blocked}</div><div class="label">Enforce Blocks</div></div>
|
|
813
821
|
<div class="stat-card"><div class="value">${promptHooks}</div><div class="label">Prompt Hooks</div></div>
|
|
814
822
|
<div class="stat-card"><div class="value">${toolHooks}</div><div class="label">Tool Hooks</div></div>
|
|
815
823
|
<div class="stat-card"><div class="value">${avgMs}ms</div><div class="label">Avg Exec Time</div></div>
|
|
@@ -904,6 +912,8 @@
|
|
|
904
912
|
...(e.skills_matched ?? []).map(s => s.name),
|
|
905
913
|
...(e.skills_matched ?? []).flatMap(s => (s.matched_signals ?? []).map(sig => sig.value)),
|
|
906
914
|
e.tool_name ?? '',
|
|
915
|
+
e.file_basename ?? '',
|
|
916
|
+
...(e.blocking_agents ?? []),
|
|
907
917
|
].join(' ').toLowerCase();
|
|
908
918
|
if (!haystack.includes(search)) return false;
|
|
909
919
|
}
|
|
@@ -939,11 +949,16 @@
|
|
|
939
949
|
? `<span class="badge hook-tool">${e.tool_name ?? 'PreToolUse'}</span>`
|
|
940
950
|
: `<span class="badge hook-prompt">Prompt</span>`;
|
|
941
951
|
|
|
942
|
-
const outcomeBadge = `<span class="badge ${
|
|
952
|
+
const outcomeBadge = `<span class="badge ${
|
|
953
|
+
e.outcome === 'activated' ? 'activated' :
|
|
954
|
+
e.outcome === 'blocked' ? 'blocked' : 'no-match'
|
|
955
|
+
}">${e.outcome}</span>`;
|
|
943
956
|
|
|
944
|
-
const prompt = e.
|
|
945
|
-
?
|
|
946
|
-
:
|
|
957
|
+
const prompt = e.enforce_block
|
|
958
|
+
? `${e.file_basename ?? '?'} \u2192 ${(e.blocking_agents ?? []).join(', ')}`
|
|
959
|
+
: e.hook_event
|
|
960
|
+
? (e.prompt_raw ?? '').replace(/^\[PreToolUse:\w+\]\s*/, '')
|
|
961
|
+
: (e.prompt_raw ?? '');
|
|
947
962
|
|
|
948
963
|
const skillsHtml = (e.skills_matched ?? []).length
|
|
949
964
|
? (e.skills_matched ?? []).map(s => `
|
|
@@ -342,6 +342,11 @@
|
|
|
342
342
|
color: var(--cyan);
|
|
343
343
|
}
|
|
344
344
|
|
|
345
|
+
.badge.blocked {
|
|
346
|
+
background: rgba(248, 81, 73, 0.15);
|
|
347
|
+
color: var(--red);
|
|
348
|
+
}
|
|
349
|
+
|
|
345
350
|
.prompt-text {
|
|
346
351
|
max-width: 400px;
|
|
347
352
|
overflow: hidden;
|
|
@@ -583,6 +588,7 @@
|
|
|
583
588
|
<option value="">All</option>
|
|
584
589
|
<option value="activated">Activated</option>
|
|
585
590
|
<option value="no_match">No Match</option>
|
|
591
|
+
<option value="blocked">Blocked</option>
|
|
586
592
|
</select>
|
|
587
593
|
</div>
|
|
588
594
|
<div class="filter-group">
|
|
@@ -801,6 +807,7 @@
|
|
|
801
807
|
const total = entries.length;
|
|
802
808
|
const activated = entries.filter(e => e.outcome === 'activated').length;
|
|
803
809
|
const noMatch = entries.filter(e => e.outcome === 'no_match').length;
|
|
810
|
+
const blocked = entries.filter(e => e.outcome === 'blocked').length;
|
|
804
811
|
const promptHooks = entries.filter(e => !e.hook_event).length;
|
|
805
812
|
const toolHooks = entries.filter(e => e.hook_event === 'PreToolUse').length;
|
|
806
813
|
const avgMs = (entries.reduce((s, e) => s + (e.execution_time_ms ?? 0), 0) / total).toFixed(1);
|
|
@@ -810,6 +817,7 @@
|
|
|
810
817
|
<div class="stat-card"><div class="value">${total}</div><div class="label">Total Events</div></div>
|
|
811
818
|
<div class="stat-card activated"><div class="value">${activated}</div><div class="label">Activated (${(activated / total * 100).toFixed(0)}%)</div></div>
|
|
812
819
|
<div class="stat-card no-match"><div class="value">${noMatch}</div><div class="label">No Match</div></div>
|
|
820
|
+
<div class="stat-card" style="border-color:var(--red)"><div class="value" style="color:var(--red)">${blocked}</div><div class="label">Enforce Blocks</div></div>
|
|
813
821
|
<div class="stat-card"><div class="value">${promptHooks}</div><div class="label">Prompt Hooks</div></div>
|
|
814
822
|
<div class="stat-card"><div class="value">${toolHooks}</div><div class="label">Tool Hooks</div></div>
|
|
815
823
|
<div class="stat-card"><div class="value">${avgMs}ms</div><div class="label">Avg Exec Time</div></div>
|
|
@@ -904,6 +912,8 @@
|
|
|
904
912
|
...(e.skills_matched ?? []).map(s => s.name),
|
|
905
913
|
...(e.skills_matched ?? []).flatMap(s => (s.matched_signals ?? []).map(sig => sig.value)),
|
|
906
914
|
e.tool_name ?? '',
|
|
915
|
+
e.file_basename ?? '',
|
|
916
|
+
...(e.blocking_agents ?? []),
|
|
907
917
|
].join(' ').toLowerCase();
|
|
908
918
|
if (!haystack.includes(search)) return false;
|
|
909
919
|
}
|
|
@@ -939,11 +949,16 @@
|
|
|
939
949
|
? `<span class="badge hook-tool">${e.tool_name ?? 'PreToolUse'}</span>`
|
|
940
950
|
: `<span class="badge hook-prompt">Prompt</span>`;
|
|
941
951
|
|
|
942
|
-
const outcomeBadge = `<span class="badge ${
|
|
952
|
+
const outcomeBadge = `<span class="badge ${
|
|
953
|
+
e.outcome === 'activated' ? 'activated' :
|
|
954
|
+
e.outcome === 'blocked' ? 'blocked' : 'no-match'
|
|
955
|
+
}">${e.outcome}</span>`;
|
|
943
956
|
|
|
944
|
-
const prompt = e.
|
|
945
|
-
?
|
|
946
|
-
:
|
|
957
|
+
const prompt = e.enforce_block
|
|
958
|
+
? `${e.file_basename ?? '?'} \u2192 ${(e.blocking_agents ?? []).join(', ')}`
|
|
959
|
+
: e.hook_event
|
|
960
|
+
? (e.prompt_raw ?? '').replace(/^\[PreToolUse:\w+\]\s*/, '')
|
|
961
|
+
: (e.prompt_raw ?? '');
|
|
947
962
|
|
|
948
963
|
const skillsHtml = (e.skills_matched ?? []).length
|
|
949
964
|
? (e.skills_matched ?? []).map(s => `
|