cc-hooks-ts 2.1.34 → 2.1.47
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 +0 -19
- package/dist/index.d.mts +4 -2
- package/dist/index.mjs +5 -2
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -98,25 +98,6 @@ Then, load defined hooks in your Claude Code settings at `~/.claude/settings.jso
|
|
|
98
98
|
}
|
|
99
99
|
```
|
|
100
100
|
|
|
101
|
-
If you are using native install, you can run hooks with Bun via `BUN_BE_BUN=1 claude`.
|
|
102
|
-
|
|
103
|
-
```json
|
|
104
|
-
{
|
|
105
|
-
"hooks": {
|
|
106
|
-
"SessionStart": [
|
|
107
|
-
{
|
|
108
|
-
"hooks": [
|
|
109
|
-
{
|
|
110
|
-
"type": "command",
|
|
111
|
-
"command": "BUN_BE_BUN=1 claude run -i --silent path/to/your/sessionHook.ts"
|
|
112
|
-
}
|
|
113
|
-
]
|
|
114
|
-
}
|
|
115
|
-
]
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
```
|
|
119
|
-
|
|
120
101
|
## Tool Specific Hooks
|
|
121
102
|
|
|
122
103
|
In `PreToolUse`, `PostToolUse`, and `PostToolUseFailure` events, you can define hooks specific to tools by specifying tool names in the trigger configuration.
|
package/dist/index.d.mts
CHANGED
|
@@ -73,6 +73,7 @@ declare const HookInputSchemas: {
|
|
|
73
73
|
readonly transcript_path: v.StringSchema<undefined>;
|
|
74
74
|
readonly hook_event_name: v.LiteralSchema<"Stop", undefined>;
|
|
75
75
|
} & {
|
|
76
|
+
last_assistant_message: v.ExactOptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
76
77
|
stop_hook_active: v.BooleanSchema<undefined>;
|
|
77
78
|
}, undefined>;
|
|
78
79
|
readonly SubagentStart: v.ObjectSchema<{
|
|
@@ -95,6 +96,7 @@ declare const HookInputSchemas: {
|
|
|
95
96
|
agent_id: v.StringSchema<undefined>;
|
|
96
97
|
agent_transcript_path: v.StringSchema<undefined>;
|
|
97
98
|
agent_type: v.StringSchema<undefined>;
|
|
99
|
+
last_assistant_message: v.ExactOptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
98
100
|
stop_hook_active: v.BooleanSchema<undefined>;
|
|
99
101
|
}, undefined>;
|
|
100
102
|
readonly PreCompact: v.ObjectSchema<{
|
|
@@ -160,7 +162,7 @@ declare const HookInputSchemas: {
|
|
|
160
162
|
readonly type: v.LiteralSchema<"removeRules", undefined>;
|
|
161
163
|
}, undefined>, v.ObjectSchema<{
|
|
162
164
|
readonly destination: v.PicklistSchema<["userSettings", "projectSettings", "localSettings", "session", "cliArg"], undefined>;
|
|
163
|
-
readonly mode: v.PicklistSchema<["acceptEdits", "bypassPermissions", "default", "dontAsk", "
|
|
165
|
+
readonly mode: v.PicklistSchema<["acceptEdits", "bypassPermissions", "default", "dontAsk", "plan"], undefined>;
|
|
164
166
|
readonly type: v.LiteralSchema<"setMode", undefined>;
|
|
165
167
|
}, undefined>, v.ObjectSchema<{
|
|
166
168
|
readonly destination: v.PicklistSchema<["userSettings", "projectSettings", "localSettings", "session", "cliArg"], undefined>;
|
|
@@ -325,7 +327,7 @@ declare const permissionUpdateSchema: v.VariantSchema<"type", [v.ObjectSchema<{
|
|
|
325
327
|
readonly type: v.LiteralSchema<"removeRules", undefined>;
|
|
326
328
|
}, undefined>, v.ObjectSchema<{
|
|
327
329
|
readonly destination: v.PicklistSchema<["userSettings", "projectSettings", "localSettings", "session", "cliArg"], undefined>;
|
|
328
|
-
readonly mode: v.PicklistSchema<["acceptEdits", "bypassPermissions", "default", "dontAsk", "
|
|
330
|
+
readonly mode: v.PicklistSchema<["acceptEdits", "bypassPermissions", "default", "dontAsk", "plan"], undefined>;
|
|
329
331
|
readonly type: v.LiteralSchema<"setMode", undefined>;
|
|
330
332
|
}, undefined>, v.ObjectSchema<{
|
|
331
333
|
readonly destination: v.PicklistSchema<["userSettings", "projectSettings", "localSettings", "session", "cliArg"], undefined>;
|
package/dist/index.mjs
CHANGED
|
@@ -75,7 +75,6 @@ const permissionUpdateSchema = v.variant("type", [
|
|
|
75
75
|
"bypassPermissions",
|
|
76
76
|
"default",
|
|
77
77
|
"dontAsk",
|
|
78
|
-
"delegate",
|
|
79
78
|
"plan"
|
|
80
79
|
]),
|
|
81
80
|
type: v.literal("setMode")
|
|
@@ -129,7 +128,10 @@ const HookInputSchemas = {
|
|
|
129
128
|
title: v.exactOptional(v.string())
|
|
130
129
|
}),
|
|
131
130
|
UserPromptSubmit: buildHookInputSchema("UserPromptSubmit", { prompt: v.string() }),
|
|
132
|
-
Stop: buildHookInputSchema("Stop", {
|
|
131
|
+
Stop: buildHookInputSchema("Stop", {
|
|
132
|
+
last_assistant_message: v.exactOptional(v.string()),
|
|
133
|
+
stop_hook_active: v.boolean()
|
|
134
|
+
}),
|
|
133
135
|
SubagentStart: buildHookInputSchema("SubagentStart", {
|
|
134
136
|
agent_id: v.string(),
|
|
135
137
|
agent_type: v.string()
|
|
@@ -138,6 +140,7 @@ const HookInputSchemas = {
|
|
|
138
140
|
agent_id: v.string(),
|
|
139
141
|
agent_transcript_path: v.string(),
|
|
140
142
|
agent_type: v.string(),
|
|
143
|
+
last_assistant_message: v.exactOptional(v.string()),
|
|
141
144
|
stop_hook_active: v.boolean()
|
|
142
145
|
}),
|
|
143
146
|
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.47",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Write claude code hooks with type safety",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@arethetypeswrong/core": "0.18.2",
|
|
46
|
-
"@types/node": "25.2.
|
|
46
|
+
"@types/node": "25.2.1",
|
|
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",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"publint": "0.3.17",
|
|
55
55
|
"release-it": "19.2.4",
|
|
56
56
|
"release-it-pnpm": "4.6.6",
|
|
57
|
-
"tsdown": "0.20.
|
|
57
|
+
"tsdown": "0.20.3",
|
|
58
58
|
"type-fest": "5.4.3",
|
|
59
59
|
"typescript": "5.9.3",
|
|
60
60
|
"typescript-eslint": "8.54.0",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
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.47",
|
|
66
66
|
"valibot": "^1.1.0"
|
|
67
67
|
},
|
|
68
68
|
"scripts": {
|