cc-hooks-ts 2.1.149 → 2.1.152
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 +35 -1
- package/dist/index.mjs +8 -0
- package/package.json +16 -16
package/dist/index.d.mts
CHANGED
|
@@ -274,6 +274,7 @@ declare const HookInputSchemas: {
|
|
|
274
274
|
} & {
|
|
275
275
|
agent_type: v.ExactOptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
276
276
|
model: v.ExactOptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
277
|
+
session_title: v.ExactOptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
277
278
|
source: v.PicklistSchema<["startup", "resume", "clear", "compact"], undefined>;
|
|
278
279
|
}, undefined>;
|
|
279
280
|
readonly SessionEnd: v.ObjectSchema<{
|
|
@@ -553,6 +554,24 @@ declare const HookInputSchemas: {
|
|
|
553
554
|
event: v.PicklistSchema<["change", "add", "unlink"], undefined>;
|
|
554
555
|
file_path: v.StringSchema<undefined>;
|
|
555
556
|
}, undefined>;
|
|
557
|
+
readonly MessageDisplay: v.ObjectSchema<{
|
|
558
|
+
readonly agent_id: v.ExactOptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
559
|
+
readonly agent_type: v.ExactOptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
560
|
+
readonly cwd: v.StringSchema<undefined>;
|
|
561
|
+
readonly effort: v.ExactOptionalSchema<v.ObjectSchema<{
|
|
562
|
+
readonly level: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.GuardAction<string, (s: string) => s is AutoComplete<"low" | "medium" | "high" | "xhigh" | "max">, undefined>]>;
|
|
563
|
+
}, undefined>, undefined>;
|
|
564
|
+
readonly permission_mode: v.ExactOptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
565
|
+
readonly session_id: v.StringSchema<undefined>;
|
|
566
|
+
readonly transcript_path: v.StringSchema<undefined>;
|
|
567
|
+
readonly hook_event_name: v.LiteralSchema<"MessageDisplay", undefined>;
|
|
568
|
+
} & {
|
|
569
|
+
delta: v.StringSchema<undefined>;
|
|
570
|
+
final: v.BooleanSchema<undefined>;
|
|
571
|
+
index: v.NumberSchema<undefined>;
|
|
572
|
+
message_id: v.StringSchema<undefined>;
|
|
573
|
+
turn_id: v.StringSchema<undefined>;
|
|
574
|
+
}, undefined>;
|
|
556
575
|
};
|
|
557
576
|
//#endregion
|
|
558
577
|
//#region src/hooks/event.d.ts
|
|
@@ -561,7 +580,7 @@ declare const HookInputSchemas: {
|
|
|
561
580
|
*
|
|
562
581
|
* @package
|
|
563
582
|
*/
|
|
564
|
-
type SupportedHookEvent = "PreToolUse" | "PostToolUse" | "PostToolUseFailure" | "PostToolBatch" | "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";
|
|
583
|
+
type SupportedHookEvent = "PreToolUse" | "PostToolUse" | "PostToolUseFailure" | "PostToolBatch" | "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" | "MessageDisplay";
|
|
565
584
|
//#endregion
|
|
566
585
|
//#region src/hooks/input/types.d.ts
|
|
567
586
|
/**
|
|
@@ -732,6 +751,7 @@ type HookOutput = {
|
|
|
732
751
|
ElicitationResult: ElicitationResultHookOutput;
|
|
733
752
|
CwdChanged: CwdChangedHookOutput;
|
|
734
753
|
FileChanged: FileChangedHookOutput;
|
|
754
|
+
MessageDisplay: MessageDisplayHookOutput;
|
|
735
755
|
ConfigChange: CommonHookOutputs;
|
|
736
756
|
InstructionsLoaded: CommonHookOutputs;
|
|
737
757
|
PostCompact: CommonHookOutputs;
|
|
@@ -972,6 +992,11 @@ interface SessionStartHookOutput extends CommonHookOutputs {
|
|
|
972
992
|
*/
|
|
973
993
|
additionalContext?: string;
|
|
974
994
|
initialUserMessage?: string;
|
|
995
|
+
/**
|
|
996
|
+
* Re-scan skill and command directories after SessionStart hooks complete, so skills installed by the hook are available in the same session.
|
|
997
|
+
*/
|
|
998
|
+
reloadSkills?: boolean;
|
|
999
|
+
sessionTitle?: string;
|
|
975
1000
|
watchPaths?: string[];
|
|
976
1001
|
};
|
|
977
1002
|
}
|
|
@@ -1038,6 +1063,15 @@ interface FileChangedHookOutput extends CommonHookOutputs {
|
|
|
1038
1063
|
watchPaths?: string[];
|
|
1039
1064
|
};
|
|
1040
1065
|
}
|
|
1066
|
+
interface MessageDisplayHookOutput extends CommonHookOutputs {
|
|
1067
|
+
hookSpecificOutput?: {
|
|
1068
|
+
hookEventName: "MessageDisplay";
|
|
1069
|
+
/**
|
|
1070
|
+
* Text displayed in place of the delta. Omit (or return the delta unchanged) to display the original.
|
|
1071
|
+
*/
|
|
1072
|
+
displayContent?: string;
|
|
1073
|
+
};
|
|
1074
|
+
}
|
|
1041
1075
|
//#endregion
|
|
1042
1076
|
//#region src/types.d.ts
|
|
1043
1077
|
type HookTrigger = Partial<{ [TEvent in SupportedHookEvent]: true | Partial<{ [SchemaKey in ExtractExtendedSpecificKeys<TEvent>]?: true }> }>;
|
package/dist/index.mjs
CHANGED
|
@@ -279,6 +279,7 @@ const HookInputSchemas = {
|
|
|
279
279
|
SessionStart: buildHookInputSchema("SessionStart", {
|
|
280
280
|
agent_type: v.exactOptional(v.string()),
|
|
281
281
|
model: v.exactOptional(v.string()),
|
|
282
|
+
session_title: v.exactOptional(v.string()),
|
|
282
283
|
source: v.picklist([
|
|
283
284
|
"startup",
|
|
284
285
|
"resume",
|
|
@@ -385,6 +386,13 @@ const HookInputSchemas = {
|
|
|
385
386
|
"unlink"
|
|
386
387
|
]),
|
|
387
388
|
file_path: v.string()
|
|
389
|
+
}),
|
|
390
|
+
MessageDisplay: buildHookInputSchema("MessageDisplay", {
|
|
391
|
+
delta: v.string(),
|
|
392
|
+
final: v.boolean(),
|
|
393
|
+
index: v.number(),
|
|
394
|
+
message_id: v.string(),
|
|
395
|
+
turn_id: v.string()
|
|
388
396
|
})
|
|
389
397
|
};
|
|
390
398
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cc-hooks-ts",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.152",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Write claude code hooks with type safety",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -43,26 +43,26 @@
|
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@arethetypeswrong/core": "0.18.2",
|
|
46
|
-
"@types/node": "25.
|
|
47
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
48
|
-
"@virtual-live-lab/eslint-config": "2.
|
|
49
|
-
"@virtual-live-lab/tsconfig": "2.1.
|
|
50
|
-
"eslint": "
|
|
46
|
+
"@types/node": "25.9.1",
|
|
47
|
+
"@typescript/native-preview": "7.0.0-dev.20260523.1",
|
|
48
|
+
"@virtual-live-lab/eslint-config": "2.4.4",
|
|
49
|
+
"@virtual-live-lab/tsconfig": "2.1.23",
|
|
50
|
+
"eslint": "10.4.0",
|
|
51
51
|
"eslint-plugin-import-access": "3.1.0",
|
|
52
|
-
"oxfmt": "0.
|
|
53
|
-
"pkg-pr-new": "0.0.
|
|
54
|
-
"publint": "0.3.
|
|
55
|
-
"release-it": "
|
|
52
|
+
"oxfmt": "0.51.0",
|
|
53
|
+
"pkg-pr-new": "0.0.75",
|
|
54
|
+
"publint": "0.3.21",
|
|
55
|
+
"release-it": "20.0.1",
|
|
56
56
|
"release-it-pnpm": "4.6.6",
|
|
57
|
-
"tsdown": "0.
|
|
58
|
-
"type-fest": "5.
|
|
59
|
-
"typescript": "6.0.
|
|
60
|
-
"typescript-eslint": "8.
|
|
57
|
+
"tsdown": "0.22.0",
|
|
58
|
+
"type-fest": "5.6.0",
|
|
59
|
+
"typescript": "6.0.3",
|
|
60
|
+
"typescript-eslint": "8.59.4",
|
|
61
61
|
"unplugin-unused": "0.5.7",
|
|
62
|
-
"vitest": "4.1.
|
|
62
|
+
"vitest": "4.1.7"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@anthropic-ai/claude-agent-sdk": "0.3.
|
|
65
|
+
"@anthropic-ai/claude-agent-sdk": "0.3.152",
|
|
66
66
|
"get-stdin": "10.0.0",
|
|
67
67
|
"valibot": "^1.3.0"
|
|
68
68
|
},
|