@goodfoot/claude-code-hooks 1.2.0 → 1.2.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/README.md +2 -2
- package/dist/hooks.js +1 -1
- package/dist/tool-helpers.js +3 -3
- package/package.json +2 -2
- package/types/hooks.d.ts +1 -1
- package/types/tool-helpers.d.ts +3 -3
- package/types/types.d.ts +2 -2
package/README.md
CHANGED
|
@@ -119,8 +119,8 @@ The `--hooks` argument accepts a comma-separated list of any of these 13 event t
|
|
|
119
119
|
| `SessionStart` | When session begins |
|
|
120
120
|
| `SessionEnd` | When session terminates |
|
|
121
121
|
| `Stop` | After main agent finishes |
|
|
122
|
-
| `SubagentStart` | When
|
|
123
|
-
| `SubagentStop` | When
|
|
122
|
+
| `SubagentStart` | When an Agent tool starts |
|
|
123
|
+
| `SubagentStop` | When an Agent tool completes |
|
|
124
124
|
| `PreCompact` | Before context compaction |
|
|
125
125
|
| `PermissionRequest` | When permission is requested |
|
|
126
126
|
| `Setup` | On init, install, or update events |
|
package/dist/hooks.js
CHANGED
|
@@ -272,7 +272,7 @@ export function stopHook(config, handler) {
|
|
|
272
272
|
/**
|
|
273
273
|
* Creates a SubagentStart hook handler.
|
|
274
274
|
*
|
|
275
|
-
* SubagentStart hooks fire when a subagent (
|
|
275
|
+
* SubagentStart hooks fire when a subagent (Agent tool) starts, allowing you to:
|
|
276
276
|
* - Inject context for the subagent
|
|
277
277
|
* - Log subagent invocations
|
|
278
278
|
* - Configure subagent behavior
|
package/dist/tool-helpers.js
CHANGED
|
@@ -175,11 +175,11 @@ export function isGrepTool(input) {
|
|
|
175
175
|
return input.tool_name === "Grep";
|
|
176
176
|
}
|
|
177
177
|
/**
|
|
178
|
-
* Type guard for
|
|
178
|
+
* Type guard for Agent tool inputs.
|
|
179
179
|
*
|
|
180
180
|
* Narrows the input type to include a typed AgentInput.
|
|
181
181
|
* @param input - The hook input to check
|
|
182
|
-
* @returns True if the input is for
|
|
182
|
+
* @returns True if the input is for an Agent tool
|
|
183
183
|
* @example
|
|
184
184
|
* ```typescript
|
|
185
185
|
* if (isTaskTool(input)) {
|
|
@@ -189,7 +189,7 @@ export function isGrepTool(input) {
|
|
|
189
189
|
* ```
|
|
190
190
|
*/
|
|
191
191
|
export function isTaskTool(input) {
|
|
192
|
-
return input.tool_name === "
|
|
192
|
+
return input.tool_name === "Agent";
|
|
193
193
|
}
|
|
194
194
|
/**
|
|
195
195
|
* Type guard for TaskOutput tool inputs.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@goodfoot/claude-code-hooks",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "Type-safe Claude Code hooks library with camelCase types and output builders",
|
|
5
5
|
"homepage": "https://github.com/goodfoot-io/marketplace/tree/main/packages/claude-code-hooks",
|
|
6
6
|
"repository": {
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"typescript": "^5.9.3"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@anthropic-ai/claude-agent-sdk": "^0.2.
|
|
56
|
+
"@anthropic-ai/claude-agent-sdk": "^0.2.71",
|
|
57
57
|
"@biomejs/biome": "2.4.6",
|
|
58
58
|
"@types/node": "^24",
|
|
59
59
|
"ts-morph": "^25.0.0",
|
package/types/hooks.d.ts
CHANGED
|
@@ -615,7 +615,7 @@ export declare function stopHook(config: HookConfig, handler: HookHandler<StopIn
|
|
|
615
615
|
/**
|
|
616
616
|
* Creates a SubagentStart hook handler.
|
|
617
617
|
*
|
|
618
|
-
* SubagentStart hooks fire when a subagent (
|
|
618
|
+
* SubagentStart hooks fire when a subagent (Agent tool) starts, allowing you to:
|
|
619
619
|
* - Inject context for the subagent
|
|
620
620
|
* - Log subagent invocations
|
|
621
621
|
* - Configure subagent behavior
|
package/types/tool-helpers.d.ts
CHANGED
|
@@ -185,11 +185,11 @@ export declare function isGrepTool<T extends ToolUseInput>(input: T): input is T
|
|
|
185
185
|
tool_input: GrepInput;
|
|
186
186
|
};
|
|
187
187
|
/**
|
|
188
|
-
* Type guard for
|
|
188
|
+
* Type guard for Agent tool inputs.
|
|
189
189
|
*
|
|
190
190
|
* Narrows the input type to include a typed AgentInput.
|
|
191
191
|
* @param input - The hook input to check
|
|
192
|
-
* @returns True if the input is for
|
|
192
|
+
* @returns True if the input is for an Agent tool
|
|
193
193
|
* @example
|
|
194
194
|
* ```typescript
|
|
195
195
|
* if (isTaskTool(input)) {
|
|
@@ -199,7 +199,7 @@ export declare function isGrepTool<T extends ToolUseInput>(input: T): input is T
|
|
|
199
199
|
* ```
|
|
200
200
|
*/
|
|
201
201
|
export declare function isTaskTool<T extends ToolUseInput>(input: T): input is T & {
|
|
202
|
-
tool_name: "
|
|
202
|
+
tool_name: "Agent";
|
|
203
203
|
tool_input: AgentInput;
|
|
204
204
|
};
|
|
205
205
|
/**
|
package/types/types.d.ts
CHANGED
|
@@ -411,7 +411,7 @@ export type KnownToolInput = FileWriteInput | FileEditInput | MultiEditToolInput
|
|
|
411
411
|
/**
|
|
412
412
|
* Tool names for all known tools with typed inputs.
|
|
413
413
|
*/
|
|
414
|
-
export type KnownToolName = "Write" | "Edit" | "MultiEdit" | "Read" | "Bash" | "Glob" | "Grep" | "
|
|
414
|
+
export type KnownToolName = "Write" | "Edit" | "MultiEdit" | "Read" | "Bash" | "Glob" | "Grep" | "Agent" | "TaskOutput" | "ExitPlanMode" | "KillShell" | "NotebookEdit" | "TodoWrite" | "WebFetch" | "WebSearch" | "AskUserQuestion" | "ListMcpResources" | "Mcp" | "ReadMcpResource" | "Config";
|
|
415
415
|
/**
|
|
416
416
|
* Type mapping from tool name to tool input type.
|
|
417
417
|
*
|
|
@@ -429,7 +429,7 @@ export interface ToolInputMap {
|
|
|
429
429
|
Bash: BashInput;
|
|
430
430
|
Glob: GlobInput;
|
|
431
431
|
Grep: GrepInput;
|
|
432
|
-
|
|
432
|
+
Agent: AgentInput;
|
|
433
433
|
TaskOutput: TaskOutputInput;
|
|
434
434
|
ExitPlanMode: ExitPlanModeInput;
|
|
435
435
|
KillShell: KillShellInput;
|