cc-hooks-ts 2.1.94 → 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 +29 -1
- package/dist/index.mjs +7 -0
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -77,6 +77,21 @@ declare const HookInputSchemas: {
|
|
|
77
77
|
prompt: v.StringSchema<undefined>;
|
|
78
78
|
session_title: v.ExactOptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
79
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>;
|
|
94
|
+
}, undefined>;
|
|
80
95
|
readonly Stop: v.ObjectSchema<{
|
|
81
96
|
readonly agent_id: v.ExactOptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
82
97
|
readonly agent_type: v.ExactOptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
@@ -407,7 +422,7 @@ declare const HookInputSchemas: {
|
|
|
407
422
|
*
|
|
408
423
|
* @package
|
|
409
424
|
*/
|
|
410
|
-
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";
|
|
411
426
|
//#endregion
|
|
412
427
|
//#region src/hooks/input/types.d.ts
|
|
413
428
|
/**
|
|
@@ -551,6 +566,7 @@ type HookOutput = {
|
|
|
551
566
|
PreToolUse: PreToolUseHookOutput;
|
|
552
567
|
PostToolUse: PostToolUseHookOutput;
|
|
553
568
|
PostToolUseFailure: PostToolUseFailureHookOutput;
|
|
569
|
+
UserPromptExpansion: UserPromptExpansionHookOutput;
|
|
554
570
|
UserPromptSubmit: UserPromptSubmitHookOutput;
|
|
555
571
|
Stop: StopHookOutput;
|
|
556
572
|
StopFailure: CommonHookOutputs;
|
|
@@ -689,6 +705,18 @@ interface PostToolUseFailureHookOutput extends CommonHookOutputs {
|
|
|
689
705
|
additionalContext?: string;
|
|
690
706
|
};
|
|
691
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
|
+
}
|
|
692
720
|
/**
|
|
693
721
|
* @see {@link https://docs.anthropic.com/en/docs/claude-code/hooks#userpromptsubmit-decision-control}
|
|
694
722
|
*/
|
package/dist/index.mjs
CHANGED
|
@@ -206,6 +206,13 @@ const HookInputSchemas = {
|
|
|
206
206
|
prompt: v.string(),
|
|
207
207
|
session_title: v.exactOptional(v.string())
|
|
208
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
|
+
}),
|
|
209
216
|
Stop: buildHookInputSchema("Stop", {
|
|
210
217
|
last_assistant_message: v.exactOptional(v.string()),
|
|
211
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
|
},
|