cc-hooks-ts 2.1.74 → 2.1.76

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 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>;
@@ -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()),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc-hooks-ts",
3
- "version": "2.1.74",
3
+ "version": "2.1.76",
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.0.18"
63
63
  },
64
64
  "dependencies": {
65
- "@anthropic-ai/claude-agent-sdk": "0.2.74",
65
+ "@anthropic-ai/claude-agent-sdk": "0.2.76",
66
66
  "get-stdin": "10.0.0",
67
67
  "valibot": "^1.1.0"
68
68
  },