cc-hooks-ts 2.1.141 → 2.1.149
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 +76 -2
- package/dist/index.mjs +22 -0
- package/package.json +2 -2
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, EnterWorktreeInput, EnterWorktreeOutput, ExitPlanModeInput, ExitPlanModeOutput, ExitWorktreeInput, ExitWorktreeOutput, FileEditInput, FileEditOutput, FileReadInput, FileReadOutput, FileWriteInput, FileWriteOutput, GlobInput, GlobOutput, GrepInput, GrepOutput, ListMcpResourcesInput, ListMcpResourcesOutput, McpInput, McpOutput, 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, CronCreateInput, CronCreateOutput, CronDeleteInput, CronDeleteOutput, CronListInput, CronListOutput, EnterPlanModeInput, EnterPlanModeOutput, EnterWorktreeInput, EnterWorktreeOutput, ExitPlanModeInput, ExitPlanModeOutput, ExitWorktreeInput, ExitWorktreeOutput, FileEditInput, FileEditOutput, FileReadInput, FileReadOutput, FileWriteInput, FileWriteOutput, GlobInput, GlobOutput, GrepInput, GrepOutput, ListMcpResourcesInput, ListMcpResourcesOutput, McpInput, McpOutput, MonitorInput, MonitorOutput, NotebookEditInput, NotebookEditOutput, PushNotificationInput, PushNotificationOutput, REPLInput, REPLOutput, ReadMcpResourceInput, ReadMcpResourceOutput, RemoteTriggerInput, RemoteTriggerOutput, ScheduleWakeupInput, ScheduleWakeupOutput, TaskOutputInput, TaskStopInput, TaskStopOutput, TodoWriteInput, TodoWriteOutput, WebFetchInput, WebFetchOutput, WebSearchInput, WebSearchOutput, WorkflowInput, WorkflowOutput } 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;
|
|
@@ -143,7 +143,24 @@ declare const HookInputSchemas: {
|
|
|
143
143
|
readonly transcript_path: v.StringSchema<undefined>;
|
|
144
144
|
readonly hook_event_name: v.LiteralSchema<"Stop", undefined>;
|
|
145
145
|
} & {
|
|
146
|
+
background_tasks: v.ExactOptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
147
|
+
readonly agent_type: v.ExactOptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
148
|
+
readonly command: v.ExactOptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
149
|
+
readonly description: v.StringSchema<undefined>;
|
|
150
|
+
readonly id: v.StringSchema<undefined>;
|
|
151
|
+
readonly name: v.ExactOptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
152
|
+
readonly server: v.ExactOptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
153
|
+
readonly status: v.StringSchema<undefined>;
|
|
154
|
+
readonly tool: v.ExactOptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
155
|
+
readonly type: v.StringSchema<undefined>;
|
|
156
|
+
}, undefined>, undefined>, undefined>;
|
|
146
157
|
last_assistant_message: v.ExactOptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
158
|
+
session_crons: v.ExactOptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
159
|
+
readonly id: v.StringSchema<undefined>;
|
|
160
|
+
readonly prompt: v.StringSchema<undefined>;
|
|
161
|
+
readonly recurring: v.BooleanSchema<undefined>;
|
|
162
|
+
readonly schedule: v.StringSchema<undefined>;
|
|
163
|
+
}, undefined>, undefined>, undefined>;
|
|
147
164
|
stop_hook_active: v.BooleanSchema<undefined>;
|
|
148
165
|
}, undefined>;
|
|
149
166
|
readonly StopFailure: v.ObjectSchema<{
|
|
@@ -158,7 +175,7 @@ declare const HookInputSchemas: {
|
|
|
158
175
|
readonly transcript_path: v.StringSchema<undefined>;
|
|
159
176
|
readonly hook_event_name: v.LiteralSchema<"StopFailure", undefined>;
|
|
160
177
|
} & {
|
|
161
|
-
error: v.PicklistSchema<["authentication_failed", "oauth_org_not_allowed", "billing_error", "rate_limit", "invalid_request", "server_error", "unknown", "max_output_tokens"], undefined>;
|
|
178
|
+
error: v.PicklistSchema<["authentication_failed", "oauth_org_not_allowed", "billing_error", "rate_limit", "invalid_request", "model_not_found", "server_error", "unknown", "max_output_tokens"], undefined>;
|
|
162
179
|
error_details: v.ExactOptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
163
180
|
last_assistant_message: v.ExactOptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
164
181
|
}, undefined>;
|
|
@@ -190,7 +207,24 @@ declare const HookInputSchemas: {
|
|
|
190
207
|
readonly hook_event_name: v.LiteralSchema<"SubagentStop", undefined>;
|
|
191
208
|
} & {
|
|
192
209
|
agent_transcript_path: v.StringSchema<undefined>;
|
|
210
|
+
background_tasks: v.ExactOptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
211
|
+
readonly agent_type: v.ExactOptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
212
|
+
readonly command: v.ExactOptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
213
|
+
readonly description: v.StringSchema<undefined>;
|
|
214
|
+
readonly id: v.StringSchema<undefined>;
|
|
215
|
+
readonly name: v.ExactOptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
216
|
+
readonly server: v.ExactOptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
217
|
+
readonly status: v.StringSchema<undefined>;
|
|
218
|
+
readonly tool: v.ExactOptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
219
|
+
readonly type: v.StringSchema<undefined>;
|
|
220
|
+
}, undefined>, undefined>, undefined>;
|
|
193
221
|
last_assistant_message: v.ExactOptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
222
|
+
session_crons: v.ExactOptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
223
|
+
readonly id: v.StringSchema<undefined>;
|
|
224
|
+
readonly prompt: v.StringSchema<undefined>;
|
|
225
|
+
readonly recurring: v.BooleanSchema<undefined>;
|
|
226
|
+
readonly schedule: v.StringSchema<undefined>;
|
|
227
|
+
}, undefined>, undefined>, undefined>;
|
|
194
228
|
stop_hook_active: v.BooleanSchema<undefined>;
|
|
195
229
|
}, "agent_id" | "agent_type"> & {
|
|
196
230
|
readonly agent_id: v.StringSchema<undefined>;
|
|
@@ -1383,10 +1417,26 @@ interface ToolSchema {
|
|
|
1383
1417
|
input: BashInput;
|
|
1384
1418
|
response: BashOutput;
|
|
1385
1419
|
};
|
|
1420
|
+
CronCreate: {
|
|
1421
|
+
input: CronCreateInput;
|
|
1422
|
+
response: CronCreateOutput;
|
|
1423
|
+
};
|
|
1424
|
+
CronDelete: {
|
|
1425
|
+
input: CronDeleteInput;
|
|
1426
|
+
response: CronDeleteOutput;
|
|
1427
|
+
};
|
|
1428
|
+
CronList: {
|
|
1429
|
+
input: CronListInput;
|
|
1430
|
+
response: CronListOutput;
|
|
1431
|
+
};
|
|
1386
1432
|
Edit: {
|
|
1387
1433
|
input: FileEditInput;
|
|
1388
1434
|
response: FileEditOutput;
|
|
1389
1435
|
};
|
|
1436
|
+
EnterPlanMode: {
|
|
1437
|
+
input: EnterPlanModeInput;
|
|
1438
|
+
response: EnterPlanModeOutput;
|
|
1439
|
+
};
|
|
1390
1440
|
EnterWorktree: {
|
|
1391
1441
|
input: EnterWorktreeInput;
|
|
1392
1442
|
response: EnterWorktreeOutput;
|
|
@@ -1415,10 +1465,18 @@ interface ToolSchema {
|
|
|
1415
1465
|
input: McpInput;
|
|
1416
1466
|
response: McpOutput;
|
|
1417
1467
|
};
|
|
1468
|
+
Monitor: {
|
|
1469
|
+
input: MonitorInput;
|
|
1470
|
+
response: MonitorOutput;
|
|
1471
|
+
};
|
|
1418
1472
|
NotebookEdit: {
|
|
1419
1473
|
input: NotebookEditInput;
|
|
1420
1474
|
response: NotebookEditOutput;
|
|
1421
1475
|
};
|
|
1476
|
+
PushNotification: {
|
|
1477
|
+
input: PushNotificationInput;
|
|
1478
|
+
response: PushNotificationOutput;
|
|
1479
|
+
};
|
|
1422
1480
|
Read: {
|
|
1423
1481
|
input: FileReadInput;
|
|
1424
1482
|
response: FileReadOutput;
|
|
@@ -1427,6 +1485,18 @@ interface ToolSchema {
|
|
|
1427
1485
|
input: ReadMcpResourceInput;
|
|
1428
1486
|
response: ReadMcpResourceOutput;
|
|
1429
1487
|
};
|
|
1488
|
+
RemoteTrigger: {
|
|
1489
|
+
input: RemoteTriggerInput;
|
|
1490
|
+
response: RemoteTriggerOutput;
|
|
1491
|
+
};
|
|
1492
|
+
REPL: {
|
|
1493
|
+
input: REPLInput;
|
|
1494
|
+
response: REPLOutput;
|
|
1495
|
+
};
|
|
1496
|
+
ScheduleWakeup: {
|
|
1497
|
+
input: ScheduleWakeupInput;
|
|
1498
|
+
response: ScheduleWakeupOutput;
|
|
1499
|
+
};
|
|
1430
1500
|
Skill: {
|
|
1431
1501
|
input: {
|
|
1432
1502
|
args?: string;
|
|
@@ -1468,6 +1538,10 @@ interface ToolSchema {
|
|
|
1468
1538
|
input: WebSearchInput;
|
|
1469
1539
|
response: WebSearchOutput;
|
|
1470
1540
|
};
|
|
1541
|
+
Workflow: {
|
|
1542
|
+
input: WorkflowInput;
|
|
1543
|
+
response: WorkflowOutput;
|
|
1544
|
+
};
|
|
1471
1545
|
Write: {
|
|
1472
1546
|
input: FileWriteInput;
|
|
1473
1547
|
response: FileWriteOutput;
|
package/dist/index.mjs
CHANGED
|
@@ -176,6 +176,23 @@ function buildSubagentInputSchema(hook_event_name, entries) {
|
|
|
176
176
|
agent_type: v.string()
|
|
177
177
|
});
|
|
178
178
|
}
|
|
179
|
+
const backgroundTaskSummarySchema = v.object({
|
|
180
|
+
agent_type: v.exactOptional(v.string()),
|
|
181
|
+
command: v.exactOptional(v.string()),
|
|
182
|
+
description: v.string(),
|
|
183
|
+
id: v.string(),
|
|
184
|
+
name: v.exactOptional(v.string()),
|
|
185
|
+
server: v.exactOptional(v.string()),
|
|
186
|
+
status: v.string(),
|
|
187
|
+
tool: v.exactOptional(v.string()),
|
|
188
|
+
type: v.string()
|
|
189
|
+
});
|
|
190
|
+
const sessionCronSummarySchema = v.object({
|
|
191
|
+
id: v.string(),
|
|
192
|
+
prompt: v.string(),
|
|
193
|
+
recurring: v.boolean(),
|
|
194
|
+
schedule: v.string()
|
|
195
|
+
});
|
|
179
196
|
/**
|
|
180
197
|
* @package
|
|
181
198
|
*/
|
|
@@ -223,7 +240,9 @@ const HookInputSchemas = {
|
|
|
223
240
|
prompt: v.string()
|
|
224
241
|
}),
|
|
225
242
|
Stop: buildHookInputSchema("Stop", {
|
|
243
|
+
background_tasks: v.exactOptional(v.array(backgroundTaskSummarySchema)),
|
|
226
244
|
last_assistant_message: v.exactOptional(v.string()),
|
|
245
|
+
session_crons: v.exactOptional(v.array(sessionCronSummarySchema)),
|
|
227
246
|
stop_hook_active: v.boolean()
|
|
228
247
|
}),
|
|
229
248
|
StopFailure: buildHookInputSchema("StopFailure", {
|
|
@@ -233,6 +252,7 @@ const HookInputSchemas = {
|
|
|
233
252
|
"billing_error",
|
|
234
253
|
"rate_limit",
|
|
235
254
|
"invalid_request",
|
|
255
|
+
"model_not_found",
|
|
236
256
|
"server_error",
|
|
237
257
|
"unknown",
|
|
238
258
|
"max_output_tokens"
|
|
@@ -243,7 +263,9 @@ const HookInputSchemas = {
|
|
|
243
263
|
SubagentStart: buildSubagentInputSchema("SubagentStart", {}),
|
|
244
264
|
SubagentStop: buildSubagentInputSchema("SubagentStop", {
|
|
245
265
|
agent_transcript_path: v.string(),
|
|
266
|
+
background_tasks: v.exactOptional(v.array(backgroundTaskSummarySchema)),
|
|
246
267
|
last_assistant_message: v.exactOptional(v.string()),
|
|
268
|
+
session_crons: v.exactOptional(v.array(sessionCronSummarySchema)),
|
|
247
269
|
stop_hook_active: v.boolean()
|
|
248
270
|
}),
|
|
249
271
|
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.149",
|
|
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.
|
|
65
|
+
"@anthropic-ai/claude-agent-sdk": "0.3.149",
|
|
66
66
|
"get-stdin": "10.0.0",
|
|
67
67
|
"valibot": "^1.3.0"
|
|
68
68
|
},
|