@s_s/agent-kit 1.0.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/README.md +317 -0
- package/build/create-kit.d.ts +16 -0
- package/build/create-kit.js +54 -0
- package/build/create-kit.js.map +1 -0
- package/build/detect.d.ts +13 -0
- package/build/detect.js +34 -0
- package/build/detect.js.map +1 -0
- package/build/hook-capabilities.d.ts +87 -0
- package/build/hook-capabilities.js +191 -0
- package/build/hook-capabilities.js.map +1 -0
- package/build/hook-registry.d.ts +158 -0
- package/build/hook-registry.js +223 -0
- package/build/hook-registry.js.map +1 -0
- package/build/hook-translators/claude-code.d.ts +26 -0
- package/build/hook-translators/claude-code.js +351 -0
- package/build/hook-translators/claude-code.js.map +1 -0
- package/build/hook-translators/index.d.ts +4 -0
- package/build/hook-translators/index.js +4 -0
- package/build/hook-translators/index.js.map +1 -0
- package/build/hook-translators/openclaw.d.ts +25 -0
- package/build/hook-translators/openclaw.js +272 -0
- package/build/hook-translators/openclaw.js.map +1 -0
- package/build/hook-translators/opencode.d.ts +23 -0
- package/build/hook-translators/opencode.js +254 -0
- package/build/hook-translators/opencode.js.map +1 -0
- package/build/hook-translators/types.d.ts +59 -0
- package/build/hook-translators/types.js +2 -0
- package/build/hook-translators/types.js.map +1 -0
- package/build/hook-types.d.ts +155 -0
- package/build/hook-types.js +2 -0
- package/build/hook-types.js.map +1 -0
- package/build/hooks.d.ts +30 -0
- package/build/hooks.js +333 -0
- package/build/hooks.js.map +1 -0
- package/build/index.d.ts +9 -0
- package/build/index.js +11 -0
- package/build/index.js.map +1 -0
- package/build/platform.d.ts +17 -0
- package/build/platform.js +79 -0
- package/build/platform.js.map +1 -0
- package/build/prompt.d.ts +21 -0
- package/build/prompt.js +87 -0
- package/build/prompt.js.map +1 -0
- package/build/register.d.ts +18 -0
- package/build/register.js +34 -0
- package/build/register.js.map +1 -0
- package/build/types.d.ts +111 -0
- package/build/types.js +53 -0
- package/build/types.js.map +1 -0
- package/package.json +42 -0
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
// ---------------------------------------------------------------------------
|
|
2
|
+
// Helpers
|
|
3
|
+
// ---------------------------------------------------------------------------
|
|
4
|
+
function capitalize(str) {
|
|
5
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
6
|
+
}
|
|
7
|
+
function matcherToString(match) {
|
|
8
|
+
if (match === undefined || match === '*')
|
|
9
|
+
return '';
|
|
10
|
+
if (match instanceof RegExp)
|
|
11
|
+
return match.source;
|
|
12
|
+
return match;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Wrap a handler body with optional extend code appended.
|
|
16
|
+
*/
|
|
17
|
+
function applyExtends(body, agent, hookName, extendHooks) {
|
|
18
|
+
const key = `${agent}::${hookName}`;
|
|
19
|
+
const extends_ = extendHooks.get(key);
|
|
20
|
+
if (!extends_ || extends_.length === 0)
|
|
21
|
+
return body;
|
|
22
|
+
const extendParts = extends_.map((e, i) => `# --- extend #${i + 1} ---\n${e.handler}`);
|
|
23
|
+
return body + '\n\n' + extendParts.join('\n\n');
|
|
24
|
+
}
|
|
25
|
+
// ---------------------------------------------------------------------------
|
|
26
|
+
// Claude Code / Codex Translator
|
|
27
|
+
// ---------------------------------------------------------------------------
|
|
28
|
+
/**
|
|
29
|
+
* Translates intent-based hooks into Claude Code / Codex native format.
|
|
30
|
+
*
|
|
31
|
+
* Claude Code uses:
|
|
32
|
+
* - Shell scripts executed as external processes
|
|
33
|
+
* - JSON input via stdin, JSON output via stdout
|
|
34
|
+
* - Exit codes for control (0 = allow, 2 = block)
|
|
35
|
+
* - settings.json for hook registration (event → matcher → handler)
|
|
36
|
+
*/
|
|
37
|
+
export class ClaudeCodeTranslator {
|
|
38
|
+
agent;
|
|
39
|
+
constructor(agent = 'claude-code') {
|
|
40
|
+
this.agent = agent;
|
|
41
|
+
}
|
|
42
|
+
translate(intents, rawHooks, extendHooks, toolName) {
|
|
43
|
+
const files = {};
|
|
44
|
+
const warnings = [];
|
|
45
|
+
const skipped = [];
|
|
46
|
+
// Track which native hooks are generated by intents (for conflict detection)
|
|
47
|
+
const intentGeneratedHooks = new Set();
|
|
48
|
+
// --- inject intents ---
|
|
49
|
+
const injectIntents = intents.filter((i) => i.type === 'inject');
|
|
50
|
+
if (injectIntents.length > 0) {
|
|
51
|
+
const hookName = 'UserPromptSubmit';
|
|
52
|
+
if (rawHooks.has(`${this.agent}::${hookName}`)) {
|
|
53
|
+
warnings.push(`[${this.agent}] raw hook for ${hookName} overrides inject intent. ` +
|
|
54
|
+
`The inject content will not be applied via ${hookName}.`);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
const merged = this.mergeInjectIntents(injectIntents);
|
|
58
|
+
const body = this.buildInjectScript(toolName, merged);
|
|
59
|
+
const script = applyExtends(body, this.agent, hookName, extendHooks);
|
|
60
|
+
files[`${toolName}-inject.sh`] = script;
|
|
61
|
+
intentGeneratedHooks.add(hookName);
|
|
62
|
+
}
|
|
63
|
+
// sessionStart → SessionStart (separate hook)
|
|
64
|
+
const sessionStarts = injectIntents.filter((i) => i.sessionStart);
|
|
65
|
+
if (sessionStarts.length > 0 && !rawHooks.has(`${this.agent}::SessionStart`)) {
|
|
66
|
+
const combined = sessionStarts.map((i) => i.sessionStart).join('\n\n');
|
|
67
|
+
const body = this.buildSessionStartInjectScript(toolName, combined);
|
|
68
|
+
const script = applyExtends(body, this.agent, 'SessionStart', extendHooks);
|
|
69
|
+
files[`${toolName}-session-start.sh`] = script;
|
|
70
|
+
intentGeneratedHooks.add('SessionStart');
|
|
71
|
+
}
|
|
72
|
+
// compaction → PreCompact
|
|
73
|
+
const compactions = injectIntents.filter((i) => i.compaction);
|
|
74
|
+
if (compactions.length > 0 && !rawHooks.has(`${this.agent}::PreCompact`)) {
|
|
75
|
+
const combined = compactions.map((i) => i.compaction).join('\n\n');
|
|
76
|
+
const body = this.buildCompactionScript(toolName, combined);
|
|
77
|
+
const script = applyExtends(body, this.agent, 'PreCompact', extendHooks);
|
|
78
|
+
files[`${toolName}-compaction.sh`] = script;
|
|
79
|
+
intentGeneratedHooks.add('PreCompact');
|
|
80
|
+
}
|
|
81
|
+
// sessionEnd → SessionEnd
|
|
82
|
+
const sessionEnds = injectIntents.filter((i) => i.sessionEnd);
|
|
83
|
+
if (sessionEnds.length > 0 && !rawHooks.has(`${this.agent}::SessionEnd`)) {
|
|
84
|
+
const combined = sessionEnds.map((i) => i.sessionEnd).join('\n\n');
|
|
85
|
+
const body = this.buildSessionEndInjectScript(toolName, combined);
|
|
86
|
+
const script = applyExtends(body, this.agent, 'SessionEnd', extendHooks);
|
|
87
|
+
files[`${toolName}-session-end.sh`] = script;
|
|
88
|
+
intentGeneratedHooks.add('SessionEnd');
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
// --- beforeToolCall intents ---
|
|
92
|
+
const beforeIntents = intents.filter((i) => i.type === 'beforeToolCall');
|
|
93
|
+
if (beforeIntents.length > 0) {
|
|
94
|
+
const hookName = 'PreToolUse';
|
|
95
|
+
if (rawHooks.has(`${this.agent}::${hookName}`)) {
|
|
96
|
+
warnings.push(`[${this.agent}] raw hook for ${hookName} overrides beforeToolCall intent.`);
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
const body = this.buildBeforeToolCallScript(toolName, beforeIntents);
|
|
100
|
+
const script = applyExtends(body, this.agent, hookName, extendHooks);
|
|
101
|
+
files[`${toolName}-before-tool.sh`] = script;
|
|
102
|
+
intentGeneratedHooks.add(hookName);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
// --- afterToolCall intents ---
|
|
106
|
+
const afterIntents = intents.filter((i) => i.type === 'afterToolCall');
|
|
107
|
+
if (afterIntents.length > 0) {
|
|
108
|
+
const hookName = 'PostToolUse';
|
|
109
|
+
if (rawHooks.has(`${this.agent}::${hookName}`)) {
|
|
110
|
+
warnings.push(`[${this.agent}] raw hook for ${hookName} overrides afterToolCall intent.`);
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
const body = this.buildAfterToolCallScript(toolName, afterIntents);
|
|
114
|
+
const script = applyExtends(body, this.agent, hookName, extendHooks);
|
|
115
|
+
files[`${toolName}-after-tool.sh`] = script;
|
|
116
|
+
intentGeneratedHooks.add(hookName);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
// --- onSession intents ---
|
|
120
|
+
const sessionIntents = intents.filter((i) => i.type === 'onSession');
|
|
121
|
+
if (sessionIntents.length > 0) {
|
|
122
|
+
const hasStart = sessionIntents.some((i) => i.start);
|
|
123
|
+
const hasEnd = sessionIntents.some((i) => i.end);
|
|
124
|
+
if (hasStart && !intentGeneratedHooks.has('SessionStart')) {
|
|
125
|
+
if (rawHooks.has(`${this.agent}::SessionStart`)) {
|
|
126
|
+
warnings.push(`[${this.agent}] raw hook for SessionStart overrides onSession.start intent.`);
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
const body = this.buildOnSessionScript(toolName, 'start');
|
|
130
|
+
const script = applyExtends(body, this.agent, 'SessionStart', extendHooks);
|
|
131
|
+
files[`${toolName}-on-session-start.sh`] = script;
|
|
132
|
+
intentGeneratedHooks.add('SessionStart');
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
if (hasEnd && !intentGeneratedHooks.has('SessionEnd')) {
|
|
136
|
+
if (rawHooks.has(`${this.agent}::SessionEnd`)) {
|
|
137
|
+
warnings.push(`[${this.agent}] raw hook for SessionEnd overrides onSession.end intent.`);
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
const body = this.buildOnSessionScript(toolName, 'end');
|
|
141
|
+
const script = applyExtends(body, this.agent, 'SessionEnd', extendHooks);
|
|
142
|
+
files[`${toolName}-on-session-end.sh`] = script;
|
|
143
|
+
intentGeneratedHooks.add('SessionEnd');
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
// --- onPermission intents ---
|
|
148
|
+
const permIntents = intents.filter((i) => i.type === 'onPermission');
|
|
149
|
+
if (permIntents.length > 0) {
|
|
150
|
+
const hookName = 'PermissionRequest';
|
|
151
|
+
if (rawHooks.has(`${this.agent}::${hookName}`)) {
|
|
152
|
+
warnings.push(`[${this.agent}] raw hook for ${hookName} overrides onPermission intent.`);
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
const body = this.buildPermissionScript(toolName, permIntents);
|
|
156
|
+
const script = applyExtends(body, this.agent, hookName, extendHooks);
|
|
157
|
+
files[`${toolName}-permission.sh`] = script;
|
|
158
|
+
intentGeneratedHooks.add(hookName);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
// --- raw hooks: write directly ---
|
|
162
|
+
for (const [key, reg] of rawHooks) {
|
|
163
|
+
if (!key.startsWith(`${this.agent}::`))
|
|
164
|
+
continue;
|
|
165
|
+
const hookName = key.split('::')[1];
|
|
166
|
+
const fileName = `${toolName}-raw-${hookName.toLowerCase()}.sh`;
|
|
167
|
+
if (intentGeneratedHooks.has(hookName)) {
|
|
168
|
+
warnings.push(`[${this.agent}] raw hook for ${hookName} replaces intent-generated hook.`);
|
|
169
|
+
}
|
|
170
|
+
files[fileName] = reg.handler;
|
|
171
|
+
}
|
|
172
|
+
return { files, warnings, skipped };
|
|
173
|
+
}
|
|
174
|
+
getSettingsEntries(hookDir, toolName) {
|
|
175
|
+
const entries = [];
|
|
176
|
+
// We need to build entries for every file we'd generate.
|
|
177
|
+
// This is called after translate(), so we inspect the files pattern.
|
|
178
|
+
// However, since getSettingsEntries is called separately, we derive
|
|
179
|
+
// entries from standard naming conventions.
|
|
180
|
+
//
|
|
181
|
+
// The actual entries are built dynamically based on generated files
|
|
182
|
+
// by installHooks(). Here we provide the static mapping pattern.
|
|
183
|
+
//
|
|
184
|
+
// For now, return empty — installHooks will use translate() output
|
|
185
|
+
// to build settings entries directly.
|
|
186
|
+
return entries;
|
|
187
|
+
}
|
|
188
|
+
// -----------------------------------------------------------------------
|
|
189
|
+
// Script builders — Claude Code uses JSON stdin + stdout + exit code
|
|
190
|
+
// -----------------------------------------------------------------------
|
|
191
|
+
mergeInjectIntents(intents) {
|
|
192
|
+
return {
|
|
193
|
+
perTurn: intents.map((i) => i.perTurn).join('\n\n'),
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
buildInjectScript(toolName, merged) {
|
|
197
|
+
return `#!/bin/bash
|
|
198
|
+
# ${capitalize(toolName)} — inject hook (UserPromptSubmit)
|
|
199
|
+
# Generated by @s_s/agent-kit
|
|
200
|
+
|
|
201
|
+
set -e
|
|
202
|
+
|
|
203
|
+
cat << 'AGENT_KIT_EOF'
|
|
204
|
+
${merged.perTurn}
|
|
205
|
+
AGENT_KIT_EOF
|
|
206
|
+
`;
|
|
207
|
+
}
|
|
208
|
+
buildSessionStartInjectScript(toolName, content) {
|
|
209
|
+
return `#!/bin/bash
|
|
210
|
+
# ${capitalize(toolName)} — session start inject (SessionStart)
|
|
211
|
+
# Generated by @s_s/agent-kit
|
|
212
|
+
|
|
213
|
+
set -e
|
|
214
|
+
|
|
215
|
+
cat << 'AGENT_KIT_EOF'
|
|
216
|
+
${content}
|
|
217
|
+
AGENT_KIT_EOF
|
|
218
|
+
`;
|
|
219
|
+
}
|
|
220
|
+
buildCompactionScript(toolName, content) {
|
|
221
|
+
return `#!/bin/bash
|
|
222
|
+
# ${capitalize(toolName)} — compaction inject (PreCompact)
|
|
223
|
+
# Generated by @s_s/agent-kit
|
|
224
|
+
|
|
225
|
+
set -e
|
|
226
|
+
|
|
227
|
+
cat << 'AGENT_KIT_EOF'
|
|
228
|
+
${content}
|
|
229
|
+
AGENT_KIT_EOF
|
|
230
|
+
`;
|
|
231
|
+
}
|
|
232
|
+
buildSessionEndInjectScript(toolName, content) {
|
|
233
|
+
return `#!/bin/bash
|
|
234
|
+
# ${capitalize(toolName)} — session end inject (SessionEnd)
|
|
235
|
+
# Generated by @s_s/agent-kit
|
|
236
|
+
|
|
237
|
+
set -e
|
|
238
|
+
|
|
239
|
+
cat << 'AGENT_KIT_EOF'
|
|
240
|
+
${content}
|
|
241
|
+
AGENT_KIT_EOF
|
|
242
|
+
`;
|
|
243
|
+
}
|
|
244
|
+
buildBeforeToolCallScript(toolName, intents) {
|
|
245
|
+
// Claude Code PreToolUse: receives JSON on stdin with tool_name and tool_input,
|
|
246
|
+
// can output JSON with decision: "block"|"allow" and optionally modified input.
|
|
247
|
+
// Exit code 2 = block.
|
|
248
|
+
const matcherCases = intents.map((intent, i) => {
|
|
249
|
+
const matcherStr = matcherToString(intent.match);
|
|
250
|
+
const condition = matcherStr ? `echo "$TOOL_NAME" | grep -qE '${matcherStr}'` : 'true';
|
|
251
|
+
// Since the handler is a JS function, we serialize the logic as
|
|
252
|
+
// a shell-based JSON decision. For Claude Code, the handler runs
|
|
253
|
+
// as an external process, so we need to represent the logic as shell code.
|
|
254
|
+
// The intent handler is a JS function — we can't directly translate arbitrary
|
|
255
|
+
// JS to shell. Instead, we output the JSON stdin to a node script.
|
|
256
|
+
return `# Intent #${i + 1}${matcherStr ? ` (match: ${matcherStr})` : ''}
|
|
257
|
+
if ${condition}; then
|
|
258
|
+
# Handler logic is evaluated by the agent-kit runtime.
|
|
259
|
+
# This script passes through the tool call context for runtime evaluation.
|
|
260
|
+
:
|
|
261
|
+
fi`;
|
|
262
|
+
});
|
|
263
|
+
return `#!/bin/bash
|
|
264
|
+
# ${capitalize(toolName)} — beforeToolCall hook (PreToolUse)
|
|
265
|
+
# Generated by @s_s/agent-kit
|
|
266
|
+
# Reads JSON from stdin, outputs JSON decision to stdout.
|
|
267
|
+
|
|
268
|
+
set -e
|
|
269
|
+
|
|
270
|
+
INPUT=$(cat)
|
|
271
|
+
TOOL_NAME=$(echo "$INPUT" | jq -r '.tool_name // empty')
|
|
272
|
+
TOOL_INPUT=$(echo "$INPUT" | jq -c '.tool_input // {}')
|
|
273
|
+
|
|
274
|
+
${matcherCases.join('\n\n')}
|
|
275
|
+
|
|
276
|
+
# Default: allow
|
|
277
|
+
echo '{"decision": "allow"}'
|
|
278
|
+
exit 0
|
|
279
|
+
`;
|
|
280
|
+
}
|
|
281
|
+
buildAfterToolCallScript(toolName, intents) {
|
|
282
|
+
const matcherParts = intents.map((intent, i) => {
|
|
283
|
+
const matcherStr = matcherToString(intent.match);
|
|
284
|
+
const condition = matcherStr ? `echo "$TOOL_NAME" | grep -qE '${matcherStr}'` : 'true';
|
|
285
|
+
return `# Observer #${i + 1}${matcherStr ? ` (match: ${matcherStr})` : ''}
|
|
286
|
+
if ${condition}; then
|
|
287
|
+
:
|
|
288
|
+
fi`;
|
|
289
|
+
});
|
|
290
|
+
return `#!/bin/bash
|
|
291
|
+
# ${capitalize(toolName)} — afterToolCall hook (PostToolUse)
|
|
292
|
+
# Generated by @s_s/agent-kit
|
|
293
|
+
# Observation-only — no output expected.
|
|
294
|
+
|
|
295
|
+
set -e
|
|
296
|
+
|
|
297
|
+
INPUT=$(cat)
|
|
298
|
+
TOOL_NAME=$(echo "$INPUT" | jq -r '.tool_name // empty')
|
|
299
|
+
TOOL_RESULT=$(echo "$INPUT" | jq -c '.tool_result // ""')
|
|
300
|
+
|
|
301
|
+
${matcherParts.join('\n\n')}
|
|
302
|
+
|
|
303
|
+
exit 0
|
|
304
|
+
`;
|
|
305
|
+
}
|
|
306
|
+
buildOnSessionScript(toolName, phase) {
|
|
307
|
+
const hookName = phase === 'start' ? 'SessionStart' : 'SessionEnd';
|
|
308
|
+
return `#!/bin/bash
|
|
309
|
+
# ${capitalize(toolName)} — onSession.${phase} hook (${hookName})
|
|
310
|
+
# Generated by @s_s/agent-kit
|
|
311
|
+
|
|
312
|
+
set -e
|
|
313
|
+
|
|
314
|
+
INPUT=$(cat)
|
|
315
|
+
SESSION_ID=$(echo "$INPUT" | jq -r '.session_id // empty')
|
|
316
|
+
|
|
317
|
+
# Session ${phase} handler — extend with hooks.extend() for custom logic.
|
|
318
|
+
|
|
319
|
+
exit 0
|
|
320
|
+
`;
|
|
321
|
+
}
|
|
322
|
+
buildPermissionScript(toolName, intents) {
|
|
323
|
+
const matcherParts = intents.map((intent, i) => {
|
|
324
|
+
const matcherStr = matcherToString(intent.match);
|
|
325
|
+
const condition = matcherStr ? `echo "$TOOL_NAME" | grep -qE '${matcherStr}'` : 'true';
|
|
326
|
+
return `# Permission handler #${i + 1}${matcherStr ? ` (match: ${matcherStr})` : ''}
|
|
327
|
+
if ${condition}; then
|
|
328
|
+
# Permission decision handled by agent-kit runtime.
|
|
329
|
+
:
|
|
330
|
+
fi`;
|
|
331
|
+
});
|
|
332
|
+
return `#!/bin/bash
|
|
333
|
+
# ${capitalize(toolName)} — onPermission hook (PermissionRequest)
|
|
334
|
+
# Generated by @s_s/agent-kit
|
|
335
|
+
# Outputs JSON with decision: "allow"|"deny"|"ask".
|
|
336
|
+
|
|
337
|
+
set -e
|
|
338
|
+
|
|
339
|
+
INPUT=$(cat)
|
|
340
|
+
TOOL_NAME=$(echo "$INPUT" | jq -r '.tool_name // empty')
|
|
341
|
+
TOOL_INPUT=$(echo "$INPUT" | jq -c '.tool_input // {}')
|
|
342
|
+
|
|
343
|
+
${matcherParts.join('\n\n')}
|
|
344
|
+
|
|
345
|
+
# Default: ask the user
|
|
346
|
+
echo '{"decision": "ask"}'
|
|
347
|
+
exit 0
|
|
348
|
+
`;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
//# sourceMappingURL=claude-code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-code.js","sourceRoot":"","sources":["../../src/hook-translators/claude-code.ts"],"names":[],"mappings":"AAYA,8EAA8E;AAC9E,UAAU;AACV,8EAA8E;AAE9E,SAAS,UAAU,CAAC,GAAW;IAC3B,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACtD,CAAC;AAED,SAAS,eAAe,CAAC,KAAkC;IACvD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,GAAG;Q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,OAAO,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,YAAY,CAAC;QACnE,OAAO;IACX,UAAU,CAAC,QAAQ,CAAC,gBAAgB,KAAK,UAAU,QAAQ;;;;;;;;YAQnD,KAAK;;;CAGhB,CAAC;IACE,CAAC;IAEO,qBAAqB,CAAC,QAAgB,EAAE,OAA6B;QACzE,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC3C,MAAM,UAAU,GAAG,eAAe,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACjD,MAAM,SAAS,GAAG,UAAU,CAAC,CAAC,CAAC,iCAAiC,UAAU,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC;YAEvF,OAAO,yBAAyB,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,YAAY,UAAU,GAAG,CAAC,CAAC,CAAC,EAAE;KAC1F,SAAS;;;GAGX,CAAC;QACI,CAAC,CAAC,CAAC;QAEH,OAAO;IACX,UAAU,CAAC,QAAQ,CAAC;;;;;;;;;;EAUtB,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC;;;;;CAK1B,CAAC;IACE,CAAC;CACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hook-translators/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { AgentHookTranslator, TranslationResult, SettingsHookEntry } from './types.js';
|
|
2
|
+
import type { HookIntent, RawHookRegistration, ExtendHookRegistration } from '../hook-types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Translates intent-based hooks into OpenClaw native format.
|
|
5
|
+
*
|
|
6
|
+
* OpenClaw dual-layer system:
|
|
7
|
+
* - Internal hooks: type:action string keys, event objects, errors never propagate
|
|
8
|
+
* - Plugin hooks: typed, validated, modifying hooks run sequentially by priority
|
|
9
|
+
*
|
|
10
|
+
* File format:
|
|
11
|
+
* - HOOK.md with YAML frontmatter (name, description, metadata.openclaw.events)
|
|
12
|
+
* - handler.ts exporting default async function
|
|
13
|
+
*/
|
|
14
|
+
export declare class OpenClawTranslator implements AgentHookTranslator {
|
|
15
|
+
translate(intents: readonly HookIntent[], rawHooks: ReadonlyMap<string, RawHookRegistration>, extendHooks: ReadonlyMap<string, readonly ExtendHookRegistration[]>, toolName: string): TranslationResult;
|
|
16
|
+
getSettingsEntries(): SettingsHookEntry[];
|
|
17
|
+
private buildInjectSection;
|
|
18
|
+
private buildSessionEndInjectSection;
|
|
19
|
+
private buildCompactionSection;
|
|
20
|
+
private buildBeforeToolCallSection;
|
|
21
|
+
private buildAfterToolCallSection;
|
|
22
|
+
private buildOnSessionSection;
|
|
23
|
+
private buildHookMd;
|
|
24
|
+
private buildHandlerTs;
|
|
25
|
+
}
|