cc-hooks-ts 2.1.19 → 2.1.27
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/index.d.mts +6 -5
- package/dist/index.mjs +1 -0
- package/package.json +10 -10
package/dist/index.d.mts
CHANGED
|
@@ -94,6 +94,7 @@ declare const HookInputSchemas: {
|
|
|
94
94
|
} & {
|
|
95
95
|
agent_id: v.StringSchema<undefined>;
|
|
96
96
|
agent_transcript_path: v.StringSchema<undefined>;
|
|
97
|
+
agent_type: v.StringSchema<undefined>;
|
|
97
98
|
stop_hook_active: v.BooleanSchema<undefined>;
|
|
98
99
|
}, undefined>;
|
|
99
100
|
readonly PreCompact: v.ObjectSchema<{
|
|
@@ -230,7 +231,7 @@ type HookInput = { [EventKey in SupportedHookEvent]: EventKey extends "PreToolUs
|
|
|
230
231
|
* ```
|
|
231
232
|
* @package
|
|
232
233
|
*/
|
|
233
|
-
type ExtractAllHookInputsForEvent<TEvent
|
|
234
|
+
type ExtractAllHookInputsForEvent<TEvent extends SupportedHookEvent> = { [K in keyof HookInput[TEvent]]: HookInput[TEvent][K] }[keyof HookInput[TEvent]];
|
|
234
235
|
/**
|
|
235
236
|
* Extracts the hook input type for a specific tool within a given event type.
|
|
236
237
|
* This type utility is used to get strongly-typed inputs for tool-specific hook handlers.
|
|
@@ -251,11 +252,11 @@ type ExtractAllHookInputsForEvent<TEvent$1 extends SupportedHookEvent> = { [K in
|
|
|
251
252
|
* ```
|
|
252
253
|
* @package
|
|
253
254
|
*/
|
|
254
|
-
type ExtractSpecificHookInputForEvent<TEvent
|
|
255
|
+
type ExtractSpecificHookInputForEvent<TEvent extends SupportedHookEvent, TSpecificKey extends ExtractExtendedSpecificKeys<TEvent>> = TSpecificKey extends keyof HookInput[TEvent] ? HookInput[TEvent][TSpecificKey] : never;
|
|
255
256
|
/**
|
|
256
257
|
* @package
|
|
257
258
|
*/
|
|
258
|
-
type ExtractExtendedSpecificKeys<TEvent
|
|
259
|
+
type ExtractExtendedSpecificKeys<TEvent extends SupportedHookEvent> = Exclude<keyof HookInput[TEvent], "default">;
|
|
259
260
|
type BaseHookInputs = { [EventKey in SupportedHookEvent]: v.InferOutput<(typeof HookInputSchemas)[EventKey]> };
|
|
260
261
|
type ToolSpecificPreToolUseInput = { [K in keyof ToolSchema]: Omit<BaseHookInputs["PreToolUse"], "tool_input" | "tool_name"> & {
|
|
261
262
|
tool_input: ToolSchema[K]["input"];
|
|
@@ -336,11 +337,11 @@ type HookOutput = {
|
|
|
336
337
|
/**
|
|
337
338
|
* @package
|
|
338
339
|
*/
|
|
339
|
-
type ExtractSyncHookOutput<TEvent
|
|
340
|
+
type ExtractSyncHookOutput<TEvent extends SupportedHookEvent> = HookOutput extends Record<SupportedHookEvent, unknown> ? HookOutput[TEvent] : never;
|
|
340
341
|
/**
|
|
341
342
|
* @package
|
|
342
343
|
*/
|
|
343
|
-
type ExtractAsyncHookOutput<TEvent
|
|
344
|
+
type ExtractAsyncHookOutput<TEvent extends SupportedHookEvent> = _InternalExtractAsyncHookOutput<ExtractSyncHookOutput<TEvent>>;
|
|
344
345
|
/**
|
|
345
346
|
* Compute ExtractSyncHookOutput<TEvent> only once for better performance.
|
|
346
347
|
*
|
package/dist/index.mjs
CHANGED
|
@@ -137,6 +137,7 @@ const HookInputSchemas = {
|
|
|
137
137
|
SubagentStop: buildHookInputSchema("SubagentStop", {
|
|
138
138
|
agent_id: v.string(),
|
|
139
139
|
agent_transcript_path: v.string(),
|
|
140
|
+
agent_type: v.string(),
|
|
140
141
|
stop_hook_active: v.boolean()
|
|
141
142
|
}),
|
|
142
143
|
PreCompact: buildHookInputSchema("PreCompact", {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cc-hooks-ts",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.27",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Write claude code hooks with type safety",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -43,26 +43,26 @@
|
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@arethetypeswrong/core": "0.18.2",
|
|
46
|
-
"@types/node": "25.0.
|
|
46
|
+
"@types/node": "25.0.10",
|
|
47
47
|
"@typescript/native-preview": "^7.0.0-dev.20251108.1",
|
|
48
48
|
"@virtual-live-lab/eslint-config": "2.3.1",
|
|
49
49
|
"@virtual-live-lab/tsconfig": "2.1.21",
|
|
50
50
|
"eslint": "9.39.2",
|
|
51
51
|
"eslint-plugin-import-access": "3.1.0",
|
|
52
|
-
"oxfmt": "0.
|
|
52
|
+
"oxfmt": "0.27.0",
|
|
53
53
|
"pkg-pr-new": "0.0.62",
|
|
54
|
-
"publint": "0.3.
|
|
54
|
+
"publint": "0.3.17",
|
|
55
55
|
"release-it": "19.2.4",
|
|
56
56
|
"release-it-pnpm": "4.6.6",
|
|
57
|
-
"tsdown": "0.
|
|
58
|
-
"type-fest": "5.4.
|
|
57
|
+
"tsdown": "0.20.1",
|
|
58
|
+
"type-fest": "5.4.2",
|
|
59
59
|
"typescript": "5.9.3",
|
|
60
|
-
"typescript-eslint": "8.
|
|
61
|
-
"unplugin-unused": "0.5.
|
|
62
|
-
"vitest": "4.0.
|
|
60
|
+
"typescript-eslint": "8.54.0",
|
|
61
|
+
"unplugin-unused": "0.5.7",
|
|
62
|
+
"vitest": "4.0.18"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@anthropic-ai/claude-agent-sdk": "0.2.
|
|
65
|
+
"@anthropic-ai/claude-agent-sdk": "0.2.27",
|
|
66
66
|
"valibot": "^1.1.0"
|
|
67
67
|
},
|
|
68
68
|
"scripts": {
|