cc-hooks-ts 2.1.91 → 2.1.116
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 +31 -1
- package/dist/index.mjs +11 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -75,6 +75,22 @@ declare const HookInputSchemas: {
|
|
|
75
75
|
readonly hook_event_name: v.LiteralSchema<"UserPromptSubmit", undefined>;
|
|
76
76
|
} & {
|
|
77
77
|
prompt: v.StringSchema<undefined>;
|
|
78
|
+
session_title: v.ExactOptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
79
|
+
}, undefined>;
|
|
80
|
+
readonly UserPromptExpansion: v.ObjectSchema<{
|
|
81
|
+
readonly agent_id: v.ExactOptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
82
|
+
readonly agent_type: v.ExactOptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
83
|
+
readonly cwd: v.StringSchema<undefined>;
|
|
84
|
+
readonly permission_mode: v.ExactOptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
85
|
+
readonly session_id: v.StringSchema<undefined>;
|
|
86
|
+
readonly transcript_path: v.StringSchema<undefined>;
|
|
87
|
+
readonly hook_event_name: v.LiteralSchema<"UserPromptExpansion", undefined>;
|
|
88
|
+
} & {
|
|
89
|
+
command_args: v.StringSchema<undefined>;
|
|
90
|
+
command_name: v.StringSchema<undefined>;
|
|
91
|
+
command_source: v.ExactOptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
92
|
+
expansion_type: v.PicklistSchema<["slash_command", "mcp_prompt"], undefined>;
|
|
93
|
+
prompt: v.StringSchema<undefined>;
|
|
78
94
|
}, undefined>;
|
|
79
95
|
readonly Stop: v.ObjectSchema<{
|
|
80
96
|
readonly agent_id: v.ExactOptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
@@ -406,7 +422,7 @@ declare const HookInputSchemas: {
|
|
|
406
422
|
*
|
|
407
423
|
* @package
|
|
408
424
|
*/
|
|
409
|
-
type SupportedHookEvent = "PreToolUse" | "PostToolUse" | "PostToolUseFailure" | "Notification" | "UserPromptSubmit" | "SessionStart" | "SessionEnd" | "Stop" | "StopFailure" | "SubagentStart" | "SubagentStop" | "PreCompact" | "PostCompact" | "PermissionRequest" | "PermissionDenied" | "Setup" | "TeammateIdle" | "TaskCreated" | "TaskCompleted" | "ConfigChange" | "WorktreeCreate" | "WorktreeRemove" | "Elicitation" | "ElicitationResult" | "InstructionsLoaded" | "CwdChanged" | "FileChanged";
|
|
425
|
+
type SupportedHookEvent = "PreToolUse" | "PostToolUse" | "PostToolUseFailure" | "Notification" | "UserPromptSubmit" | "UserPromptExpansion" | "SessionStart" | "SessionEnd" | "Stop" | "StopFailure" | "SubagentStart" | "SubagentStop" | "PreCompact" | "PostCompact" | "PermissionRequest" | "PermissionDenied" | "Setup" | "TeammateIdle" | "TaskCreated" | "TaskCompleted" | "ConfigChange" | "WorktreeCreate" | "WorktreeRemove" | "Elicitation" | "ElicitationResult" | "InstructionsLoaded" | "CwdChanged" | "FileChanged";
|
|
410
426
|
//#endregion
|
|
411
427
|
//#region src/hooks/input/types.d.ts
|
|
412
428
|
/**
|
|
@@ -550,6 +566,7 @@ type HookOutput = {
|
|
|
550
566
|
PreToolUse: PreToolUseHookOutput;
|
|
551
567
|
PostToolUse: PostToolUseHookOutput;
|
|
552
568
|
PostToolUseFailure: PostToolUseFailureHookOutput;
|
|
569
|
+
UserPromptExpansion: UserPromptExpansionHookOutput;
|
|
553
570
|
UserPromptSubmit: UserPromptSubmitHookOutput;
|
|
554
571
|
Stop: StopHookOutput;
|
|
555
572
|
StopFailure: CommonHookOutputs;
|
|
@@ -688,6 +705,18 @@ interface PostToolUseFailureHookOutput extends CommonHookOutputs {
|
|
|
688
705
|
additionalContext?: string;
|
|
689
706
|
};
|
|
690
707
|
}
|
|
708
|
+
/**
|
|
709
|
+
* @see {@link https://docs.anthropic.com/en/docs/claude-code/hooks#userpromptsubmit-decision-control}
|
|
710
|
+
*/
|
|
711
|
+
interface UserPromptExpansionHookOutput extends CommonHookOutputs {
|
|
712
|
+
hookSpecificOutput?: {
|
|
713
|
+
hookEventName: "UserPromptExpansion";
|
|
714
|
+
/**
|
|
715
|
+
* Adds the string to the context.
|
|
716
|
+
*/
|
|
717
|
+
additionalContext?: string;
|
|
718
|
+
};
|
|
719
|
+
}
|
|
691
720
|
/**
|
|
692
721
|
* @see {@link https://docs.anthropic.com/en/docs/claude-code/hooks#userpromptsubmit-decision-control}
|
|
693
722
|
*/
|
|
@@ -704,6 +733,7 @@ interface UserPromptSubmitHookOutput extends CommonHookOutputs {
|
|
|
704
733
|
* Adds the string to the context if not blocked.
|
|
705
734
|
*/
|
|
706
735
|
additionalContext?: string;
|
|
736
|
+
sessionTitle?: string;
|
|
707
737
|
};
|
|
708
738
|
reason?: string;
|
|
709
739
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -202,7 +202,17 @@ const HookInputSchemas = {
|
|
|
202
202
|
notification_type: v.string(),
|
|
203
203
|
title: v.exactOptional(v.string())
|
|
204
204
|
}),
|
|
205
|
-
UserPromptSubmit: buildHookInputSchema("UserPromptSubmit", {
|
|
205
|
+
UserPromptSubmit: buildHookInputSchema("UserPromptSubmit", {
|
|
206
|
+
prompt: v.string(),
|
|
207
|
+
session_title: v.exactOptional(v.string())
|
|
208
|
+
}),
|
|
209
|
+
UserPromptExpansion: buildHookInputSchema("UserPromptExpansion", {
|
|
210
|
+
command_args: v.string(),
|
|
211
|
+
command_name: v.string(),
|
|
212
|
+
command_source: v.exactOptional(v.string()),
|
|
213
|
+
expansion_type: v.picklist(["slash_command", "mcp_prompt"]),
|
|
214
|
+
prompt: v.string()
|
|
215
|
+
}),
|
|
206
216
|
Stop: buildHookInputSchema("Stop", {
|
|
207
217
|
last_assistant_message: v.exactOptional(v.string()),
|
|
208
218
|
stop_hook_active: v.boolean()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cc-hooks-ts",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.116",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Write claude code hooks with type safety",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"vitest": "4.1.2"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@anthropic-ai/claude-agent-sdk": "0.2.
|
|
65
|
+
"@anthropic-ai/claude-agent-sdk": "0.2.116",
|
|
66
66
|
"get-stdin": "10.0.0",
|
|
67
67
|
"valibot": "^1.1.0"
|
|
68
68
|
},
|