cc-hooks-ts 2.1.74 → 2.1.77
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 +44 -3
- package/dist/index.mjs +6 -1
- package/package.json +5 -5
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
|
-
import { AgentInput, AgentOutput, AskUserQuestionInput, AskUserQuestionOutput, BashInput, BashOutput, ExitPlanModeInput, ExitPlanModeOutput, ExitWorktreeInput, ExitWorktreeOutput, FileEditInput, FileEditOutput, FileReadInput, FileReadOutput, FileWriteInput, FileWriteOutput, GlobInput, GlobOutput, GrepInput, GrepOutput, ListMcpResourcesInput, ListMcpResourcesOutput, NotebookEditInput, NotebookEditOutput, ReadMcpResourceInput, ReadMcpResourceOutput, TaskOutputInput, TaskStopInput, TaskStopOutput, TodoWriteInput, TodoWriteOutput, WebFetchInput, WebFetchOutput, WebSearchInput, WebSearchOutput } from "@anthropic-ai/claude-agent-sdk/sdk-tools";
|
|
2
|
+
import { AgentInput, AgentOutput, AskUserQuestionInput, AskUserQuestionOutput, BashInput, BashOutput, ConfigInput, ConfigOutput, EnterWorktreeInput, EnterWorktreeOutput, ExitPlanModeInput, ExitPlanModeOutput, ExitWorktreeInput, ExitWorktreeOutput, FileEditInput, FileEditOutput, FileReadInput, FileReadOutput, FileWriteInput, FileWriteOutput, GlobInput, GlobOutput, GrepInput, GrepOutput, ListMcpResourcesInput, ListMcpResourcesOutput, McpInput, McpOutput, NotebookEditInput, NotebookEditOutput, ReadMcpResourceInput, ReadMcpResourceOutput, SubscribeMcpResourceInput, SubscribeMcpResourceOutput, SubscribePollingInput, SubscribePollingOutput, TaskOutputInput, TaskStopInput, TaskStopOutput, TodoWriteInput, TodoWriteOutput, UnsubscribeMcpResourceInput, UnsubscribeMcpResourceOutput, UnsubscribePollingInput, UnsubscribePollingOutput, WebFetchInput, WebFetchOutput, WebSearchInput, WebSearchOutput } from "@anthropic-ai/claude-agent-sdk/sdk-tools";
|
|
3
3
|
|
|
4
4
|
//#region src/utils/types.d.ts
|
|
5
5
|
type Awaitable<T> = Promise<T> | T;
|
|
@@ -128,6 +128,18 @@ declare const HookInputSchemas: {
|
|
|
128
128
|
custom_instructions: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
129
129
|
trigger: v.PicklistSchema<["manual", "auto"], undefined>;
|
|
130
130
|
}, undefined>;
|
|
131
|
+
readonly PostCompact: v.ObjectSchema<{
|
|
132
|
+
readonly agent_id: v.ExactOptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
133
|
+
readonly agent_type: v.ExactOptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
134
|
+
readonly cwd: v.StringSchema<undefined>;
|
|
135
|
+
readonly permission_mode: v.ExactOptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
136
|
+
readonly session_id: v.StringSchema<undefined>;
|
|
137
|
+
readonly transcript_path: v.StringSchema<undefined>;
|
|
138
|
+
readonly hook_event_name: v.LiteralSchema<"PostCompact", undefined>;
|
|
139
|
+
} & {
|
|
140
|
+
compact_summary: v.StringSchema<undefined>;
|
|
141
|
+
trigger: v.PicklistSchema<["manual", "auto"], undefined>;
|
|
142
|
+
}, undefined>;
|
|
131
143
|
readonly SessionStart: v.ObjectSchema<{
|
|
132
144
|
readonly agent_id: v.ExactOptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
133
145
|
readonly agent_type: v.ExactOptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
@@ -315,7 +327,7 @@ declare const HookInputSchemas: {
|
|
|
315
327
|
} & {
|
|
316
328
|
file_path: v.StringSchema<undefined>;
|
|
317
329
|
globs: v.ExactOptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
318
|
-
load_reason: v.PicklistSchema<["session_start", "nested_traversal", "path_glob_match", "include"], undefined>;
|
|
330
|
+
load_reason: v.PicklistSchema<["session_start", "nested_traversal", "path_glob_match", "include", "compact"], undefined>;
|
|
319
331
|
memory_type: v.PicklistSchema<["User", "Project", "Local", "Managed"], undefined>;
|
|
320
332
|
parent_file_path: v.ExactOptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
321
333
|
trigger_file_path: v.ExactOptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
@@ -328,7 +340,7 @@ declare const HookInputSchemas: {
|
|
|
328
340
|
*
|
|
329
341
|
* @package
|
|
330
342
|
*/
|
|
331
|
-
type SupportedHookEvent = "PreToolUse" | "PostToolUse" | "PostToolUseFailure" | "Notification" | "UserPromptSubmit" | "SessionStart" | "SessionEnd" | "Stop" | "SubagentStart" | "SubagentStop" | "PreCompact" | "PermissionRequest" | "Setup" | "TeammateIdle" | "TaskCompleted" | "ConfigChange" | "WorktreeCreate" | "WorktreeRemove" | "Elicitation" | "ElicitationResult" | "InstructionsLoaded";
|
|
343
|
+
type SupportedHookEvent = "PreToolUse" | "PostToolUse" | "PostToolUseFailure" | "Notification" | "UserPromptSubmit" | "SessionStart" | "SessionEnd" | "Stop" | "SubagentStart" | "SubagentStop" | "PreCompact" | "PostCompact" | "PermissionRequest" | "Setup" | "TeammateIdle" | "TaskCompleted" | "ConfigChange" | "WorktreeCreate" | "WorktreeRemove" | "Elicitation" | "ElicitationResult" | "InstructionsLoaded";
|
|
332
344
|
//#endregion
|
|
333
345
|
//#region src/hooks/input/types.d.ts
|
|
334
346
|
/**
|
|
@@ -472,6 +484,7 @@ type HookOutput = {
|
|
|
472
484
|
ElicitationResult: ElicitationResultHookOutput;
|
|
473
485
|
ConfigChange: CommonHookOutputs;
|
|
474
486
|
InstructionsLoaded: CommonHookOutputs;
|
|
487
|
+
PostCompact: CommonHookOutputs;
|
|
475
488
|
PreCompact: CommonHookOutputs;
|
|
476
489
|
SessionEnd: CommonHookOutputs;
|
|
477
490
|
TaskCompleted: CommonHookOutputs;
|
|
@@ -1088,10 +1101,18 @@ interface ToolSchema {
|
|
|
1088
1101
|
input: BashInput;
|
|
1089
1102
|
response: BashOutput;
|
|
1090
1103
|
};
|
|
1104
|
+
Config: {
|
|
1105
|
+
input: ConfigInput;
|
|
1106
|
+
response: ConfigOutput;
|
|
1107
|
+
};
|
|
1091
1108
|
Edit: {
|
|
1092
1109
|
input: FileEditInput;
|
|
1093
1110
|
response: FileEditOutput;
|
|
1094
1111
|
};
|
|
1112
|
+
EnterWorktree: {
|
|
1113
|
+
input: EnterWorktreeInput;
|
|
1114
|
+
response: EnterWorktreeOutput;
|
|
1115
|
+
};
|
|
1095
1116
|
ExitPlanMode: {
|
|
1096
1117
|
input: ExitPlanModeInput;
|
|
1097
1118
|
response: ExitPlanModeOutput;
|
|
@@ -1112,6 +1133,10 @@ interface ToolSchema {
|
|
|
1112
1133
|
input: ListMcpResourcesInput;
|
|
1113
1134
|
response: ListMcpResourcesOutput;
|
|
1114
1135
|
};
|
|
1136
|
+
Mcp: {
|
|
1137
|
+
input: McpInput;
|
|
1138
|
+
response: McpOutput;
|
|
1139
|
+
};
|
|
1115
1140
|
NotebookEdit: {
|
|
1116
1141
|
input: NotebookEditInput;
|
|
1117
1142
|
response: NotebookEditOutput;
|
|
@@ -1124,6 +1149,14 @@ interface ToolSchema {
|
|
|
1124
1149
|
input: ReadMcpResourceInput;
|
|
1125
1150
|
response: ReadMcpResourceOutput;
|
|
1126
1151
|
};
|
|
1152
|
+
SubscribeMcpResource: {
|
|
1153
|
+
input: SubscribeMcpResourceInput;
|
|
1154
|
+
response: SubscribeMcpResourceOutput;
|
|
1155
|
+
};
|
|
1156
|
+
SubscribePolling: {
|
|
1157
|
+
input: SubscribePollingInput;
|
|
1158
|
+
response: SubscribePollingOutput;
|
|
1159
|
+
};
|
|
1127
1160
|
Task: {
|
|
1128
1161
|
input: AgentInput;
|
|
1129
1162
|
response: AgentOutput;
|
|
@@ -1140,6 +1173,14 @@ interface ToolSchema {
|
|
|
1140
1173
|
input: TodoWriteInput;
|
|
1141
1174
|
response: TodoWriteOutput;
|
|
1142
1175
|
};
|
|
1176
|
+
UnsubscribeMcpResource: {
|
|
1177
|
+
input: UnsubscribeMcpResourceInput;
|
|
1178
|
+
response: UnsubscribeMcpResourceOutput;
|
|
1179
|
+
};
|
|
1180
|
+
UnsubscribePolling: {
|
|
1181
|
+
input: UnsubscribePollingInput;
|
|
1182
|
+
response: UnsubscribePollingOutput;
|
|
1183
|
+
};
|
|
1143
1184
|
WebFetch: {
|
|
1144
1185
|
input: WebFetchInput;
|
|
1145
1186
|
response: WebFetchOutput;
|
package/dist/index.mjs
CHANGED
|
@@ -216,6 +216,10 @@ const HookInputSchemas = {
|
|
|
216
216
|
custom_instructions: v.nullable(v.string()),
|
|
217
217
|
trigger: v.picklist(["manual", "auto"])
|
|
218
218
|
}),
|
|
219
|
+
PostCompact: buildHookInputSchema("PostCompact", {
|
|
220
|
+
compact_summary: v.string(),
|
|
221
|
+
trigger: v.picklist(["manual", "auto"])
|
|
222
|
+
}),
|
|
219
223
|
SessionStart: buildHookInputSchema("SessionStart", {
|
|
220
224
|
agent_type: v.exactOptional(v.string()),
|
|
221
225
|
model: v.exactOptional(v.string()),
|
|
@@ -288,7 +292,8 @@ const HookInputSchemas = {
|
|
|
288
292
|
"session_start",
|
|
289
293
|
"nested_traversal",
|
|
290
294
|
"path_glob_match",
|
|
291
|
-
"include"
|
|
295
|
+
"include",
|
|
296
|
+
"compact"
|
|
292
297
|
]),
|
|
293
298
|
memory_type: v.picklist([
|
|
294
299
|
"User",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cc-hooks-ts",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.77",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Write claude code hooks with type safety",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -43,14 +43,14 @@
|
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@arethetypeswrong/core": "0.18.2",
|
|
46
|
-
"@types/node": "25.
|
|
46
|
+
"@types/node": "25.5.0",
|
|
47
47
|
"@typescript/native-preview": "7.0.0-dev.20260311.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
52
|
"oxfmt": "0.28.0",
|
|
53
|
-
"pkg-pr-new": "0.0.
|
|
53
|
+
"pkg-pr-new": "0.0.66",
|
|
54
54
|
"publint": "0.3.18",
|
|
55
55
|
"release-it": "19.2.4",
|
|
56
56
|
"release-it-pnpm": "4.6.6",
|
|
@@ -59,10 +59,10 @@
|
|
|
59
59
|
"typescript": "5.9.3",
|
|
60
60
|
"typescript-eslint": "8.57.0",
|
|
61
61
|
"unplugin-unused": "0.5.7",
|
|
62
|
-
"vitest": "4.0
|
|
62
|
+
"vitest": "4.1.0"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@anthropic-ai/claude-agent-sdk": "0.2.
|
|
65
|
+
"@anthropic-ai/claude-agent-sdk": "0.2.77",
|
|
66
66
|
"get-stdin": "10.0.0",
|
|
67
67
|
"valibot": "^1.1.0"
|
|
68
68
|
},
|