@pluginfinity/hooks 0.0.0-stage → 0.7.0

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/contract.d.ts ADDED
@@ -0,0 +1,1246 @@
1
+ import { Data, Option, Schema } from "effect";
2
+ /**
3
+ * One event's input and output schemas.
4
+ *
5
+ * @public
6
+ */
7
+ interface HookIo {
8
+ readonly input: Schema.Codec<unknown, unknown>;
9
+ readonly output: Schema.Codec<unknown, unknown>;
10
+ }
11
+ /**
12
+ * The input and output schema of every Claude Code hook event: the JSON a hook
13
+ * receives and the JSON it may answer with.
14
+ *
15
+ * @public
16
+ */
17
+ export declare const HOOK_IO: {
18
+ readonly SessionStart: {
19
+ readonly input: Schema.Struct<{
20
+ readonly session_id: Schema.String;
21
+ readonly transcript_path: Schema.String;
22
+ readonly cwd: Schema.String;
23
+ readonly prompt_id: Schema.optionalKey<Schema.String>;
24
+ readonly scratchpad_dir: Schema.optionalKey<Schema.String>;
25
+ readonly permission_mode: Schema.optionalKey<Schema.Literals<readonly ["default", "plan", "acceptEdits", "auto", "dontAsk", "bypassPermissions"]>>;
26
+ readonly effort: Schema.optionalKey<Schema.Struct<{
27
+ readonly level: Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max"]>;
28
+ }>>;
29
+ readonly agent_id: Schema.optionalKey<Schema.String>;
30
+ readonly agent_type: Schema.optionalKey<Schema.String>;
31
+ readonly hook_event_name: Schema.Literal<"ConfigChange" | "CwdChanged" | "DirectoryAdded" | "Elicitation" | "ElicitationResult" | "FileChanged" | "InstructionsLoaded" | "MessageDisplay" | "Notification" | "PermissionDenied" | "PermissionRequest" | "PostCompact" | "PostModelSwitch" | "PostToolBatch" | "PostToolUse" | "PostToolUseFailure" | "PreCompact" | "PreModelSwitch" | "PreSkillShellCommand" | "PreToolUse" | "SessionEnd" | "SessionStart" | "Setup" | "Stop" | "StopFailure" | "SubagentStart" | "SubagentStop" | "TaskCompleted" | "TaskCreated" | "TeammateIdle" | "UserPromptExpansion" | "UserPromptSubmit" | "WorktreeCreate" | "WorktreeRemove">;
32
+ } & {
33
+ source: Schema.Literals<readonly ["startup", "resume", "clear", "compact", "fork"]>;
34
+ model: Schema.optionalKey<Schema.String>;
35
+ session_title: Schema.optionalKey<Schema.String>;
36
+ seconds_since_last_response: Schema.optionalKey<Schema.Finite>;
37
+ context_tokens: Schema.optionalKey<Schema.Finite>;
38
+ prompt_cache_likely_expired: Schema.optionalKey<Schema.Boolean>;
39
+ estimated_cache_write_usd: Schema.optionalKey<Schema.Finite>;
40
+ }>;
41
+ readonly output: Schema.Codec<unknown, unknown, never, never>;
42
+ };
43
+ readonly Setup: {
44
+ readonly input: Schema.Struct<{
45
+ readonly session_id: Schema.String;
46
+ readonly transcript_path: Schema.String;
47
+ readonly cwd: Schema.String;
48
+ readonly prompt_id: Schema.optionalKey<Schema.String>;
49
+ readonly scratchpad_dir: Schema.optionalKey<Schema.String>;
50
+ readonly permission_mode: Schema.optionalKey<Schema.Literals<readonly ["default", "plan", "acceptEdits", "auto", "dontAsk", "bypassPermissions"]>>;
51
+ readonly effort: Schema.optionalKey<Schema.Struct<{
52
+ readonly level: Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max"]>;
53
+ }>>;
54
+ readonly agent_id: Schema.optionalKey<Schema.String>;
55
+ readonly agent_type: Schema.optionalKey<Schema.String>;
56
+ readonly hook_event_name: Schema.Literal<"ConfigChange" | "CwdChanged" | "DirectoryAdded" | "Elicitation" | "ElicitationResult" | "FileChanged" | "InstructionsLoaded" | "MessageDisplay" | "Notification" | "PermissionDenied" | "PermissionRequest" | "PostCompact" | "PostModelSwitch" | "PostToolBatch" | "PostToolUse" | "PostToolUseFailure" | "PreCompact" | "PreModelSwitch" | "PreSkillShellCommand" | "PreToolUse" | "SessionEnd" | "SessionStart" | "Setup" | "Stop" | "StopFailure" | "SubagentStart" | "SubagentStop" | "TaskCompleted" | "TaskCreated" | "TeammateIdle" | "UserPromptExpansion" | "UserPromptSubmit" | "WorktreeCreate" | "WorktreeRemove">;
57
+ } & {
58
+ trigger: Schema.Literals<readonly ["init", "maintenance"]>;
59
+ }>;
60
+ readonly output: Schema.Codec<unknown, unknown, never, never>;
61
+ };
62
+ readonly UserPromptSubmit: {
63
+ readonly input: Schema.Struct<{
64
+ readonly session_id: Schema.String;
65
+ readonly transcript_path: Schema.String;
66
+ readonly cwd: Schema.String;
67
+ readonly prompt_id: Schema.optionalKey<Schema.String>;
68
+ readonly scratchpad_dir: Schema.optionalKey<Schema.String>;
69
+ readonly permission_mode: Schema.optionalKey<Schema.Literals<readonly ["default", "plan", "acceptEdits", "auto", "dontAsk", "bypassPermissions"]>>;
70
+ readonly effort: Schema.optionalKey<Schema.Struct<{
71
+ readonly level: Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max"]>;
72
+ }>>;
73
+ readonly agent_id: Schema.optionalKey<Schema.String>;
74
+ readonly agent_type: Schema.optionalKey<Schema.String>;
75
+ readonly hook_event_name: Schema.Literal<"ConfigChange" | "CwdChanged" | "DirectoryAdded" | "Elicitation" | "ElicitationResult" | "FileChanged" | "InstructionsLoaded" | "MessageDisplay" | "Notification" | "PermissionDenied" | "PermissionRequest" | "PostCompact" | "PostModelSwitch" | "PostToolBatch" | "PostToolUse" | "PostToolUseFailure" | "PreCompact" | "PreModelSwitch" | "PreSkillShellCommand" | "PreToolUse" | "SessionEnd" | "SessionStart" | "Setup" | "Stop" | "StopFailure" | "SubagentStart" | "SubagentStop" | "TaskCompleted" | "TaskCreated" | "TeammateIdle" | "UserPromptExpansion" | "UserPromptSubmit" | "WorktreeCreate" | "WorktreeRemove">;
76
+ } & {
77
+ prompt: Schema.String;
78
+ session_title: Schema.optionalKey<Schema.String>;
79
+ }>;
80
+ readonly output: Schema.Codec<unknown, unknown, never, never>;
81
+ };
82
+ readonly UserPromptExpansion: {
83
+ readonly input: Schema.Struct<{
84
+ readonly session_id: Schema.String;
85
+ readonly transcript_path: Schema.String;
86
+ readonly cwd: Schema.String;
87
+ readonly prompt_id: Schema.optionalKey<Schema.String>;
88
+ readonly scratchpad_dir: Schema.optionalKey<Schema.String>;
89
+ readonly permission_mode: Schema.optionalKey<Schema.Literals<readonly ["default", "plan", "acceptEdits", "auto", "dontAsk", "bypassPermissions"]>>;
90
+ readonly effort: Schema.optionalKey<Schema.Struct<{
91
+ readonly level: Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max"]>;
92
+ }>>;
93
+ readonly agent_id: Schema.optionalKey<Schema.String>;
94
+ readonly agent_type: Schema.optionalKey<Schema.String>;
95
+ readonly hook_event_name: Schema.Literal<"ConfigChange" | "CwdChanged" | "DirectoryAdded" | "Elicitation" | "ElicitationResult" | "FileChanged" | "InstructionsLoaded" | "MessageDisplay" | "Notification" | "PermissionDenied" | "PermissionRequest" | "PostCompact" | "PostModelSwitch" | "PostToolBatch" | "PostToolUse" | "PostToolUseFailure" | "PreCompact" | "PreModelSwitch" | "PreSkillShellCommand" | "PreToolUse" | "SessionEnd" | "SessionStart" | "Setup" | "Stop" | "StopFailure" | "SubagentStart" | "SubagentStop" | "TaskCompleted" | "TaskCreated" | "TeammateIdle" | "UserPromptExpansion" | "UserPromptSubmit" | "WorktreeCreate" | "WorktreeRemove">;
96
+ } & {
97
+ expansion_type: Schema.Literals<readonly ["slash_command", "mcp_prompt"]>;
98
+ command_name: Schema.String;
99
+ command_args: Schema.String;
100
+ command_source: Schema.String;
101
+ prompt: Schema.String;
102
+ }>;
103
+ readonly output: Schema.Codec<unknown, unknown, never, never>;
104
+ };
105
+ readonly PreSkillShellCommand: {
106
+ readonly input: Schema.Struct<{
107
+ readonly session_id: Schema.String;
108
+ readonly transcript_path: Schema.String;
109
+ readonly cwd: Schema.String;
110
+ readonly prompt_id: Schema.optionalKey<Schema.String>;
111
+ readonly scratchpad_dir: Schema.optionalKey<Schema.String>;
112
+ readonly permission_mode: Schema.optionalKey<Schema.Literals<readonly ["default", "plan", "acceptEdits", "auto", "dontAsk", "bypassPermissions"]>>;
113
+ readonly effort: Schema.optionalKey<Schema.Struct<{
114
+ readonly level: Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max"]>;
115
+ }>>;
116
+ readonly agent_id: Schema.optionalKey<Schema.String>;
117
+ readonly agent_type: Schema.optionalKey<Schema.String>;
118
+ readonly hook_event_name: Schema.Literal<"ConfigChange" | "CwdChanged" | "DirectoryAdded" | "Elicitation" | "ElicitationResult" | "FileChanged" | "InstructionsLoaded" | "MessageDisplay" | "Notification" | "PermissionDenied" | "PermissionRequest" | "PostCompact" | "PostModelSwitch" | "PostToolBatch" | "PostToolUse" | "PostToolUseFailure" | "PreCompact" | "PreModelSwitch" | "PreSkillShellCommand" | "PreToolUse" | "SessionEnd" | "SessionStart" | "Setup" | "Stop" | "StopFailure" | "SubagentStart" | "SubagentStop" | "TaskCompleted" | "TaskCreated" | "TeammateIdle" | "UserPromptExpansion" | "UserPromptSubmit" | "WorktreeCreate" | "WorktreeRemove">;
119
+ } & {
120
+ tool_name: Schema.Literals<readonly ["Bash", "PowerShell"]>;
121
+ tool_input: Schema.Struct<{
122
+ readonly command: Schema.String;
123
+ }>;
124
+ tool_use_id: Schema.String;
125
+ command_name: Schema.String;
126
+ command_source: Schema.String;
127
+ invoked_by: Schema.Literals<readonly ["user", "claude", "other"]>;
128
+ }>;
129
+ readonly output: Schema.Codec<unknown, unknown, never, never>;
130
+ };
131
+ readonly PreToolUse: {
132
+ readonly input: Schema.Struct<{
133
+ readonly session_id: Schema.String;
134
+ readonly transcript_path: Schema.String;
135
+ readonly cwd: Schema.String;
136
+ readonly prompt_id: Schema.optionalKey<Schema.String>;
137
+ readonly scratchpad_dir: Schema.optionalKey<Schema.String>;
138
+ readonly permission_mode: Schema.optionalKey<Schema.Literals<readonly ["default", "plan", "acceptEdits", "auto", "dontAsk", "bypassPermissions"]>>;
139
+ readonly effort: Schema.optionalKey<Schema.Struct<{
140
+ readonly level: Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max"]>;
141
+ }>>;
142
+ readonly agent_id: Schema.optionalKey<Schema.String>;
143
+ readonly agent_type: Schema.optionalKey<Schema.String>;
144
+ readonly hook_event_name: Schema.Literal<"ConfigChange" | "CwdChanged" | "DirectoryAdded" | "Elicitation" | "ElicitationResult" | "FileChanged" | "InstructionsLoaded" | "MessageDisplay" | "Notification" | "PermissionDenied" | "PermissionRequest" | "PostCompact" | "PostModelSwitch" | "PostToolBatch" | "PostToolUse" | "PostToolUseFailure" | "PreCompact" | "PreModelSwitch" | "PreSkillShellCommand" | "PreToolUse" | "SessionEnd" | "SessionStart" | "Setup" | "Stop" | "StopFailure" | "SubagentStart" | "SubagentStop" | "TaskCompleted" | "TaskCreated" | "TeammateIdle" | "UserPromptExpansion" | "UserPromptSubmit" | "WorktreeCreate" | "WorktreeRemove">;
145
+ } & {
146
+ tool_name: Schema.String;
147
+ tool_input: Schema.$Record<Schema.String, Schema.Unknown>;
148
+ tool_use_id: Schema.String;
149
+ mcp_server: Schema.optionalKey<Schema.Struct<{
150
+ readonly name: Schema.String;
151
+ readonly source: Schema.String;
152
+ }>>;
153
+ }>;
154
+ readonly output: Schema.Codec<unknown, unknown, never, never>;
155
+ };
156
+ readonly PermissionRequest: {
157
+ readonly input: Schema.Struct<{
158
+ readonly session_id: Schema.String;
159
+ readonly transcript_path: Schema.String;
160
+ readonly cwd: Schema.String;
161
+ readonly prompt_id: Schema.optionalKey<Schema.String>;
162
+ readonly scratchpad_dir: Schema.optionalKey<Schema.String>;
163
+ readonly permission_mode: Schema.optionalKey<Schema.Literals<readonly ["default", "plan", "acceptEdits", "auto", "dontAsk", "bypassPermissions"]>>;
164
+ readonly effort: Schema.optionalKey<Schema.Struct<{
165
+ readonly level: Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max"]>;
166
+ }>>;
167
+ readonly agent_id: Schema.optionalKey<Schema.String>;
168
+ readonly agent_type: Schema.optionalKey<Schema.String>;
169
+ readonly hook_event_name: Schema.Literal<"ConfigChange" | "CwdChanged" | "DirectoryAdded" | "Elicitation" | "ElicitationResult" | "FileChanged" | "InstructionsLoaded" | "MessageDisplay" | "Notification" | "PermissionDenied" | "PermissionRequest" | "PostCompact" | "PostModelSwitch" | "PostToolBatch" | "PostToolUse" | "PostToolUseFailure" | "PreCompact" | "PreModelSwitch" | "PreSkillShellCommand" | "PreToolUse" | "SessionEnd" | "SessionStart" | "Setup" | "Stop" | "StopFailure" | "SubagentStart" | "SubagentStop" | "TaskCompleted" | "TaskCreated" | "TeammateIdle" | "UserPromptExpansion" | "UserPromptSubmit" | "WorktreeCreate" | "WorktreeRemove">;
170
+ } & {
171
+ tool_name: Schema.String;
172
+ tool_input: Schema.$Record<Schema.String, Schema.Unknown>;
173
+ mcp_server: Schema.optionalKey<Schema.Struct<{
174
+ readonly name: Schema.String;
175
+ readonly source: Schema.String;
176
+ }>>;
177
+ permission_suggestions: Schema.optionalKey<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
178
+ readonly type: Schema.Literals<readonly ["addRules", "replaceRules", "removeRules"]>;
179
+ readonly rules: Schema.$Array<Schema.Struct<{
180
+ readonly toolName: Schema.String;
181
+ readonly ruleContent: Schema.optionalKey<Schema.String>;
182
+ }>>;
183
+ readonly behavior: Schema.Literals<readonly ["allow", "deny", "ask"]>;
184
+ readonly destination: Schema.Literals<readonly ["session", "localSettings", "projectSettings", "userSettings"]>;
185
+ }>, Schema.Struct<{
186
+ readonly type: Schema.Literal<"setMode">;
187
+ readonly mode: Schema.Literals<readonly ["default", "plan", "acceptEdits", "auto", "dontAsk", "bypassPermissions", "manual"]>;
188
+ readonly destination: Schema.Literals<readonly ["session", "localSettings", "projectSettings", "userSettings"]>;
189
+ }>, Schema.Struct<{
190
+ readonly type: Schema.Literals<readonly ["addDirectories", "removeDirectories"]>;
191
+ readonly directories: Schema.$Array<Schema.String>;
192
+ readonly destination: Schema.Literals<readonly ["session", "localSettings", "projectSettings", "userSettings"]>;
193
+ }>]>>>;
194
+ }>;
195
+ readonly output: Schema.Codec<unknown, unknown, never, never>;
196
+ };
197
+ readonly PermissionDenied: {
198
+ readonly input: Schema.Struct<{
199
+ readonly session_id: Schema.String;
200
+ readonly transcript_path: Schema.String;
201
+ readonly cwd: Schema.String;
202
+ readonly prompt_id: Schema.optionalKey<Schema.String>;
203
+ readonly scratchpad_dir: Schema.optionalKey<Schema.String>;
204
+ readonly permission_mode: Schema.optionalKey<Schema.Literals<readonly ["default", "plan", "acceptEdits", "auto", "dontAsk", "bypassPermissions"]>>;
205
+ readonly effort: Schema.optionalKey<Schema.Struct<{
206
+ readonly level: Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max"]>;
207
+ }>>;
208
+ readonly agent_id: Schema.optionalKey<Schema.String>;
209
+ readonly agent_type: Schema.optionalKey<Schema.String>;
210
+ readonly hook_event_name: Schema.Literal<"ConfigChange" | "CwdChanged" | "DirectoryAdded" | "Elicitation" | "ElicitationResult" | "FileChanged" | "InstructionsLoaded" | "MessageDisplay" | "Notification" | "PermissionDenied" | "PermissionRequest" | "PostCompact" | "PostModelSwitch" | "PostToolBatch" | "PostToolUse" | "PostToolUseFailure" | "PreCompact" | "PreModelSwitch" | "PreSkillShellCommand" | "PreToolUse" | "SessionEnd" | "SessionStart" | "Setup" | "Stop" | "StopFailure" | "SubagentStart" | "SubagentStop" | "TaskCompleted" | "TaskCreated" | "TeammateIdle" | "UserPromptExpansion" | "UserPromptSubmit" | "WorktreeCreate" | "WorktreeRemove">;
211
+ } & {
212
+ tool_name: Schema.String;
213
+ tool_input: Schema.$Record<Schema.String, Schema.Unknown>;
214
+ tool_use_id: Schema.String;
215
+ mcp_server: Schema.optionalKey<Schema.Struct<{
216
+ readonly name: Schema.String;
217
+ readonly source: Schema.String;
218
+ }>>;
219
+ reason: Schema.String;
220
+ }>;
221
+ readonly output: Schema.Codec<unknown, unknown, never, never>;
222
+ };
223
+ readonly PostToolUse: {
224
+ readonly input: Schema.Struct<{
225
+ readonly session_id: Schema.String;
226
+ readonly transcript_path: Schema.String;
227
+ readonly cwd: Schema.String;
228
+ readonly prompt_id: Schema.optionalKey<Schema.String>;
229
+ readonly scratchpad_dir: Schema.optionalKey<Schema.String>;
230
+ readonly permission_mode: Schema.optionalKey<Schema.Literals<readonly ["default", "plan", "acceptEdits", "auto", "dontAsk", "bypassPermissions"]>>;
231
+ readonly effort: Schema.optionalKey<Schema.Struct<{
232
+ readonly level: Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max"]>;
233
+ }>>;
234
+ readonly agent_id: Schema.optionalKey<Schema.String>;
235
+ readonly agent_type: Schema.optionalKey<Schema.String>;
236
+ readonly hook_event_name: Schema.Literal<"ConfigChange" | "CwdChanged" | "DirectoryAdded" | "Elicitation" | "ElicitationResult" | "FileChanged" | "InstructionsLoaded" | "MessageDisplay" | "Notification" | "PermissionDenied" | "PermissionRequest" | "PostCompact" | "PostModelSwitch" | "PostToolBatch" | "PostToolUse" | "PostToolUseFailure" | "PreCompact" | "PreModelSwitch" | "PreSkillShellCommand" | "PreToolUse" | "SessionEnd" | "SessionStart" | "Setup" | "Stop" | "StopFailure" | "SubagentStart" | "SubagentStop" | "TaskCompleted" | "TaskCreated" | "TeammateIdle" | "UserPromptExpansion" | "UserPromptSubmit" | "WorktreeCreate" | "WorktreeRemove">;
237
+ } & {
238
+ tool_name: Schema.String;
239
+ tool_input: Schema.$Record<Schema.String, Schema.Unknown>;
240
+ tool_response: Schema.Codec<Schema.Json, Schema.Json, never, never>;
241
+ tool_use_id: Schema.String;
242
+ duration_ms: Schema.optionalKey<Schema.Finite>;
243
+ mcp_server: Schema.optionalKey<Schema.Struct<{
244
+ readonly name: Schema.String;
245
+ readonly source: Schema.String;
246
+ }>>;
247
+ }>;
248
+ readonly output: Schema.Codec<unknown, unknown, never, never>;
249
+ };
250
+ readonly PostToolUseFailure: {
251
+ readonly input: Schema.Struct<{
252
+ readonly session_id: Schema.String;
253
+ readonly transcript_path: Schema.String;
254
+ readonly cwd: Schema.String;
255
+ readonly prompt_id: Schema.optionalKey<Schema.String>;
256
+ readonly scratchpad_dir: Schema.optionalKey<Schema.String>;
257
+ readonly permission_mode: Schema.optionalKey<Schema.Literals<readonly ["default", "plan", "acceptEdits", "auto", "dontAsk", "bypassPermissions"]>>;
258
+ readonly effort: Schema.optionalKey<Schema.Struct<{
259
+ readonly level: Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max"]>;
260
+ }>>;
261
+ readonly agent_id: Schema.optionalKey<Schema.String>;
262
+ readonly agent_type: Schema.optionalKey<Schema.String>;
263
+ readonly hook_event_name: Schema.Literal<"ConfigChange" | "CwdChanged" | "DirectoryAdded" | "Elicitation" | "ElicitationResult" | "FileChanged" | "InstructionsLoaded" | "MessageDisplay" | "Notification" | "PermissionDenied" | "PermissionRequest" | "PostCompact" | "PostModelSwitch" | "PostToolBatch" | "PostToolUse" | "PostToolUseFailure" | "PreCompact" | "PreModelSwitch" | "PreSkillShellCommand" | "PreToolUse" | "SessionEnd" | "SessionStart" | "Setup" | "Stop" | "StopFailure" | "SubagentStart" | "SubagentStop" | "TaskCompleted" | "TaskCreated" | "TeammateIdle" | "UserPromptExpansion" | "UserPromptSubmit" | "WorktreeCreate" | "WorktreeRemove">;
264
+ } & {
265
+ tool_name: Schema.String;
266
+ tool_input: Schema.$Record<Schema.String, Schema.Unknown>;
267
+ tool_use_id: Schema.String;
268
+ mcp_server: Schema.optionalKey<Schema.Struct<{
269
+ readonly name: Schema.String;
270
+ readonly source: Schema.String;
271
+ }>>;
272
+ error: Schema.String;
273
+ is_interrupt: Schema.optionalKey<Schema.Boolean>;
274
+ duration_ms: Schema.optionalKey<Schema.Finite>;
275
+ }>;
276
+ readonly output: Schema.Codec<unknown, unknown, never, never>;
277
+ };
278
+ readonly PostToolBatch: {
279
+ readonly input: Schema.Struct<{
280
+ readonly session_id: Schema.String;
281
+ readonly transcript_path: Schema.String;
282
+ readonly cwd: Schema.String;
283
+ readonly prompt_id: Schema.optionalKey<Schema.String>;
284
+ readonly scratchpad_dir: Schema.optionalKey<Schema.String>;
285
+ readonly permission_mode: Schema.optionalKey<Schema.Literals<readonly ["default", "plan", "acceptEdits", "auto", "dontAsk", "bypassPermissions"]>>;
286
+ readonly effort: Schema.optionalKey<Schema.Struct<{
287
+ readonly level: Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max"]>;
288
+ }>>;
289
+ readonly agent_id: Schema.optionalKey<Schema.String>;
290
+ readonly agent_type: Schema.optionalKey<Schema.String>;
291
+ readonly hook_event_name: Schema.Literal<"ConfigChange" | "CwdChanged" | "DirectoryAdded" | "Elicitation" | "ElicitationResult" | "FileChanged" | "InstructionsLoaded" | "MessageDisplay" | "Notification" | "PermissionDenied" | "PermissionRequest" | "PostCompact" | "PostModelSwitch" | "PostToolBatch" | "PostToolUse" | "PostToolUseFailure" | "PreCompact" | "PreModelSwitch" | "PreSkillShellCommand" | "PreToolUse" | "SessionEnd" | "SessionStart" | "Setup" | "Stop" | "StopFailure" | "SubagentStart" | "SubagentStop" | "TaskCompleted" | "TaskCreated" | "TeammateIdle" | "UserPromptExpansion" | "UserPromptSubmit" | "WorktreeCreate" | "WorktreeRemove">;
292
+ } & {
293
+ tool_calls: Schema.$Array<Schema.Struct<{
294
+ readonly tool_name: Schema.String;
295
+ readonly tool_input: Schema.$Record<Schema.String, Schema.Unknown>;
296
+ readonly tool_use_id: Schema.String;
297
+ readonly tool_response: Schema.Codec<Schema.Json, Schema.Json, never, never>;
298
+ }>>;
299
+ }>;
300
+ readonly output: Schema.Codec<unknown, unknown, never, never>;
301
+ };
302
+ readonly Notification: {
303
+ readonly input: Schema.Struct<{
304
+ readonly session_id: Schema.String;
305
+ readonly transcript_path: Schema.String;
306
+ readonly cwd: Schema.String;
307
+ readonly prompt_id: Schema.optionalKey<Schema.String>;
308
+ readonly scratchpad_dir: Schema.optionalKey<Schema.String>;
309
+ readonly permission_mode: Schema.optionalKey<Schema.Literals<readonly ["default", "plan", "acceptEdits", "auto", "dontAsk", "bypassPermissions"]>>;
310
+ readonly effort: Schema.optionalKey<Schema.Struct<{
311
+ readonly level: Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max"]>;
312
+ }>>;
313
+ readonly agent_id: Schema.optionalKey<Schema.String>;
314
+ readonly agent_type: Schema.optionalKey<Schema.String>;
315
+ readonly hook_event_name: Schema.Literal<"ConfigChange" | "CwdChanged" | "DirectoryAdded" | "Elicitation" | "ElicitationResult" | "FileChanged" | "InstructionsLoaded" | "MessageDisplay" | "Notification" | "PermissionDenied" | "PermissionRequest" | "PostCompact" | "PostModelSwitch" | "PostToolBatch" | "PostToolUse" | "PostToolUseFailure" | "PreCompact" | "PreModelSwitch" | "PreSkillShellCommand" | "PreToolUse" | "SessionEnd" | "SessionStart" | "Setup" | "Stop" | "StopFailure" | "SubagentStart" | "SubagentStop" | "TaskCompleted" | "TaskCreated" | "TeammateIdle" | "UserPromptExpansion" | "UserPromptSubmit" | "WorktreeCreate" | "WorktreeRemove">;
316
+ } & {
317
+ message: Schema.String;
318
+ title: Schema.optionalKey<Schema.String>;
319
+ notification_type: Schema.String;
320
+ }>;
321
+ readonly output: Schema.Codec<unknown, unknown, never, never>;
322
+ };
323
+ readonly MessageDisplay: {
324
+ readonly input: Schema.Struct<{
325
+ readonly session_id: Schema.String;
326
+ readonly transcript_path: Schema.String;
327
+ readonly cwd: Schema.String;
328
+ readonly prompt_id: Schema.optionalKey<Schema.String>;
329
+ readonly scratchpad_dir: Schema.optionalKey<Schema.String>;
330
+ readonly permission_mode: Schema.optionalKey<Schema.Literals<readonly ["default", "plan", "acceptEdits", "auto", "dontAsk", "bypassPermissions"]>>;
331
+ readonly effort: Schema.optionalKey<Schema.Struct<{
332
+ readonly level: Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max"]>;
333
+ }>>;
334
+ readonly agent_id: Schema.optionalKey<Schema.String>;
335
+ readonly agent_type: Schema.optionalKey<Schema.String>;
336
+ readonly hook_event_name: Schema.Literal<"ConfigChange" | "CwdChanged" | "DirectoryAdded" | "Elicitation" | "ElicitationResult" | "FileChanged" | "InstructionsLoaded" | "MessageDisplay" | "Notification" | "PermissionDenied" | "PermissionRequest" | "PostCompact" | "PostModelSwitch" | "PostToolBatch" | "PostToolUse" | "PostToolUseFailure" | "PreCompact" | "PreModelSwitch" | "PreSkillShellCommand" | "PreToolUse" | "SessionEnd" | "SessionStart" | "Setup" | "Stop" | "StopFailure" | "SubagentStart" | "SubagentStop" | "TaskCompleted" | "TaskCreated" | "TeammateIdle" | "UserPromptExpansion" | "UserPromptSubmit" | "WorktreeCreate" | "WorktreeRemove">;
337
+ } & {
338
+ turn_id: Schema.String;
339
+ message_id: Schema.String;
340
+ index: Schema.Finite;
341
+ final: Schema.Boolean;
342
+ delta: Schema.String;
343
+ }>;
344
+ readonly output: Schema.Codec<unknown, unknown, never, never>;
345
+ };
346
+ readonly SubagentStart: {
347
+ readonly input: Schema.Struct<{
348
+ readonly session_id: Schema.String;
349
+ readonly transcript_path: Schema.String;
350
+ readonly cwd: Schema.String;
351
+ readonly prompt_id: Schema.optionalKey<Schema.String>;
352
+ readonly scratchpad_dir: Schema.optionalKey<Schema.String>;
353
+ readonly permission_mode: Schema.optionalKey<Schema.Literals<readonly ["default", "plan", "acceptEdits", "auto", "dontAsk", "bypassPermissions"]>>;
354
+ readonly effort: Schema.optionalKey<Schema.Struct<{
355
+ readonly level: Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max"]>;
356
+ }>>;
357
+ readonly agent_id: Schema.optionalKey<Schema.String>;
358
+ readonly agent_type: Schema.optionalKey<Schema.String>;
359
+ readonly hook_event_name: Schema.Literal<"ConfigChange" | "CwdChanged" | "DirectoryAdded" | "Elicitation" | "ElicitationResult" | "FileChanged" | "InstructionsLoaded" | "MessageDisplay" | "Notification" | "PermissionDenied" | "PermissionRequest" | "PostCompact" | "PostModelSwitch" | "PostToolBatch" | "PostToolUse" | "PostToolUseFailure" | "PreCompact" | "PreModelSwitch" | "PreSkillShellCommand" | "PreToolUse" | "SessionEnd" | "SessionStart" | "Setup" | "Stop" | "StopFailure" | "SubagentStart" | "SubagentStop" | "TaskCompleted" | "TaskCreated" | "TeammateIdle" | "UserPromptExpansion" | "UserPromptSubmit" | "WorktreeCreate" | "WorktreeRemove">;
360
+ } & {
361
+ agent_id: Schema.String;
362
+ agent_type: Schema.String;
363
+ }>;
364
+ readonly output: Schema.Codec<unknown, unknown, never, never>;
365
+ };
366
+ readonly SubagentStop: {
367
+ readonly input: Schema.Struct<{
368
+ readonly session_id: Schema.String;
369
+ readonly transcript_path: Schema.String;
370
+ readonly cwd: Schema.String;
371
+ readonly prompt_id: Schema.optionalKey<Schema.String>;
372
+ readonly scratchpad_dir: Schema.optionalKey<Schema.String>;
373
+ readonly permission_mode: Schema.optionalKey<Schema.Literals<readonly ["default", "plan", "acceptEdits", "auto", "dontAsk", "bypassPermissions"]>>;
374
+ readonly effort: Schema.optionalKey<Schema.Struct<{
375
+ readonly level: Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max"]>;
376
+ }>>;
377
+ readonly agent_id: Schema.optionalKey<Schema.String>;
378
+ readonly agent_type: Schema.optionalKey<Schema.String>;
379
+ readonly hook_event_name: Schema.Literal<"ConfigChange" | "CwdChanged" | "DirectoryAdded" | "Elicitation" | "ElicitationResult" | "FileChanged" | "InstructionsLoaded" | "MessageDisplay" | "Notification" | "PermissionDenied" | "PermissionRequest" | "PostCompact" | "PostModelSwitch" | "PostToolBatch" | "PostToolUse" | "PostToolUseFailure" | "PreCompact" | "PreModelSwitch" | "PreSkillShellCommand" | "PreToolUse" | "SessionEnd" | "SessionStart" | "Setup" | "Stop" | "StopFailure" | "SubagentStart" | "SubagentStop" | "TaskCompleted" | "TaskCreated" | "TeammateIdle" | "UserPromptExpansion" | "UserPromptSubmit" | "WorktreeCreate" | "WorktreeRemove">;
380
+ } & {
381
+ stop_hook_active: Schema.Boolean;
382
+ last_assistant_message: Schema.optionalKey<Schema.String>;
383
+ background_tasks: Schema.optionalKey<Schema.$Array<Schema.Struct<{
384
+ readonly id: Schema.String;
385
+ readonly type: Schema.String;
386
+ readonly status: Schema.String;
387
+ readonly description: Schema.optionalKey<Schema.String>;
388
+ readonly command: Schema.optionalKey<Schema.String>;
389
+ readonly agent_type: Schema.optionalKey<Schema.String>;
390
+ readonly server: Schema.optionalKey<Schema.String>;
391
+ readonly tool: Schema.optionalKey<Schema.String>;
392
+ readonly name: Schema.optionalKey<Schema.String>;
393
+ }>>>;
394
+ session_crons: Schema.optionalKey<Schema.$Array<Schema.Struct<{
395
+ readonly id: Schema.String;
396
+ readonly schedule: Schema.String;
397
+ readonly recurring: Schema.Boolean;
398
+ readonly prompt: Schema.String;
399
+ }>>>;
400
+ agent_id: Schema.String;
401
+ agent_type: Schema.String;
402
+ agent_transcript_path: Schema.String;
403
+ }>;
404
+ readonly output: Schema.Codec<unknown, unknown, never, never>;
405
+ };
406
+ readonly TaskCreated: {
407
+ readonly input: Schema.Struct<{
408
+ readonly session_id: Schema.String;
409
+ readonly transcript_path: Schema.String;
410
+ readonly cwd: Schema.String;
411
+ readonly prompt_id: Schema.optionalKey<Schema.String>;
412
+ readonly scratchpad_dir: Schema.optionalKey<Schema.String>;
413
+ readonly permission_mode: Schema.optionalKey<Schema.Literals<readonly ["default", "plan", "acceptEdits", "auto", "dontAsk", "bypassPermissions"]>>;
414
+ readonly effort: Schema.optionalKey<Schema.Struct<{
415
+ readonly level: Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max"]>;
416
+ }>>;
417
+ readonly agent_id: Schema.optionalKey<Schema.String>;
418
+ readonly agent_type: Schema.optionalKey<Schema.String>;
419
+ readonly hook_event_name: Schema.Literal<"ConfigChange" | "CwdChanged" | "DirectoryAdded" | "Elicitation" | "ElicitationResult" | "FileChanged" | "InstructionsLoaded" | "MessageDisplay" | "Notification" | "PermissionDenied" | "PermissionRequest" | "PostCompact" | "PostModelSwitch" | "PostToolBatch" | "PostToolUse" | "PostToolUseFailure" | "PreCompact" | "PreModelSwitch" | "PreSkillShellCommand" | "PreToolUse" | "SessionEnd" | "SessionStart" | "Setup" | "Stop" | "StopFailure" | "SubagentStart" | "SubagentStop" | "TaskCompleted" | "TaskCreated" | "TeammateIdle" | "UserPromptExpansion" | "UserPromptSubmit" | "WorktreeCreate" | "WorktreeRemove">;
420
+ } & {
421
+ task_id: Schema.String;
422
+ task_subject: Schema.String;
423
+ task_description: Schema.optionalKey<Schema.String>;
424
+ teammate_name: Schema.optionalKey<Schema.String>;
425
+ team_name: Schema.optionalKey<Schema.String>;
426
+ }>;
427
+ readonly output: Schema.Codec<unknown, unknown, never, never>;
428
+ };
429
+ readonly TaskCompleted: {
430
+ readonly input: Schema.Struct<{
431
+ readonly session_id: Schema.String;
432
+ readonly transcript_path: Schema.String;
433
+ readonly cwd: Schema.String;
434
+ readonly prompt_id: Schema.optionalKey<Schema.String>;
435
+ readonly scratchpad_dir: Schema.optionalKey<Schema.String>;
436
+ readonly permission_mode: Schema.optionalKey<Schema.Literals<readonly ["default", "plan", "acceptEdits", "auto", "dontAsk", "bypassPermissions"]>>;
437
+ readonly effort: Schema.optionalKey<Schema.Struct<{
438
+ readonly level: Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max"]>;
439
+ }>>;
440
+ readonly agent_id: Schema.optionalKey<Schema.String>;
441
+ readonly agent_type: Schema.optionalKey<Schema.String>;
442
+ readonly hook_event_name: Schema.Literal<"ConfigChange" | "CwdChanged" | "DirectoryAdded" | "Elicitation" | "ElicitationResult" | "FileChanged" | "InstructionsLoaded" | "MessageDisplay" | "Notification" | "PermissionDenied" | "PermissionRequest" | "PostCompact" | "PostModelSwitch" | "PostToolBatch" | "PostToolUse" | "PostToolUseFailure" | "PreCompact" | "PreModelSwitch" | "PreSkillShellCommand" | "PreToolUse" | "SessionEnd" | "SessionStart" | "Setup" | "Stop" | "StopFailure" | "SubagentStart" | "SubagentStop" | "TaskCompleted" | "TaskCreated" | "TeammateIdle" | "UserPromptExpansion" | "UserPromptSubmit" | "WorktreeCreate" | "WorktreeRemove">;
443
+ } & {
444
+ task_id: Schema.String;
445
+ task_subject: Schema.String;
446
+ task_description: Schema.optionalKey<Schema.String>;
447
+ teammate_name: Schema.optionalKey<Schema.String>;
448
+ team_name: Schema.optionalKey<Schema.String>;
449
+ }>;
450
+ readonly output: Schema.Codec<unknown, unknown, never, never>;
451
+ };
452
+ readonly Stop: {
453
+ readonly input: Schema.Struct<{
454
+ readonly session_id: Schema.String;
455
+ readonly transcript_path: Schema.String;
456
+ readonly cwd: Schema.String;
457
+ readonly prompt_id: Schema.optionalKey<Schema.String>;
458
+ readonly scratchpad_dir: Schema.optionalKey<Schema.String>;
459
+ readonly permission_mode: Schema.optionalKey<Schema.Literals<readonly ["default", "plan", "acceptEdits", "auto", "dontAsk", "bypassPermissions"]>>;
460
+ readonly effort: Schema.optionalKey<Schema.Struct<{
461
+ readonly level: Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max"]>;
462
+ }>>;
463
+ readonly agent_id: Schema.optionalKey<Schema.String>;
464
+ readonly agent_type: Schema.optionalKey<Schema.String>;
465
+ readonly hook_event_name: Schema.Literal<"ConfigChange" | "CwdChanged" | "DirectoryAdded" | "Elicitation" | "ElicitationResult" | "FileChanged" | "InstructionsLoaded" | "MessageDisplay" | "Notification" | "PermissionDenied" | "PermissionRequest" | "PostCompact" | "PostModelSwitch" | "PostToolBatch" | "PostToolUse" | "PostToolUseFailure" | "PreCompact" | "PreModelSwitch" | "PreSkillShellCommand" | "PreToolUse" | "SessionEnd" | "SessionStart" | "Setup" | "Stop" | "StopFailure" | "SubagentStart" | "SubagentStop" | "TaskCompleted" | "TaskCreated" | "TeammateIdle" | "UserPromptExpansion" | "UserPromptSubmit" | "WorktreeCreate" | "WorktreeRemove">;
466
+ } & {
467
+ stop_hook_active: Schema.Boolean;
468
+ last_assistant_message: Schema.optionalKey<Schema.String>;
469
+ background_tasks: Schema.optionalKey<Schema.$Array<Schema.Struct<{
470
+ readonly id: Schema.String;
471
+ readonly type: Schema.String;
472
+ readonly status: Schema.String;
473
+ readonly description: Schema.optionalKey<Schema.String>;
474
+ readonly command: Schema.optionalKey<Schema.String>;
475
+ readonly agent_type: Schema.optionalKey<Schema.String>;
476
+ readonly server: Schema.optionalKey<Schema.String>;
477
+ readonly tool: Schema.optionalKey<Schema.String>;
478
+ readonly name: Schema.optionalKey<Schema.String>;
479
+ }>>>;
480
+ session_crons: Schema.optionalKey<Schema.$Array<Schema.Struct<{
481
+ readonly id: Schema.String;
482
+ readonly schedule: Schema.String;
483
+ readonly recurring: Schema.Boolean;
484
+ readonly prompt: Schema.String;
485
+ }>>>;
486
+ }>;
487
+ readonly output: Schema.Codec<unknown, unknown, never, never>;
488
+ };
489
+ readonly StopFailure: {
490
+ readonly input: Schema.Struct<{
491
+ readonly session_id: Schema.String;
492
+ readonly transcript_path: Schema.String;
493
+ readonly cwd: Schema.String;
494
+ readonly prompt_id: Schema.optionalKey<Schema.String>;
495
+ readonly scratchpad_dir: Schema.optionalKey<Schema.String>;
496
+ readonly permission_mode: Schema.optionalKey<Schema.Literals<readonly ["default", "plan", "acceptEdits", "auto", "dontAsk", "bypassPermissions"]>>;
497
+ readonly effort: Schema.optionalKey<Schema.Struct<{
498
+ readonly level: Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max"]>;
499
+ }>>;
500
+ readonly agent_id: Schema.optionalKey<Schema.String>;
501
+ readonly agent_type: Schema.optionalKey<Schema.String>;
502
+ readonly hook_event_name: Schema.Literal<"ConfigChange" | "CwdChanged" | "DirectoryAdded" | "Elicitation" | "ElicitationResult" | "FileChanged" | "InstructionsLoaded" | "MessageDisplay" | "Notification" | "PermissionDenied" | "PermissionRequest" | "PostCompact" | "PostModelSwitch" | "PostToolBatch" | "PostToolUse" | "PostToolUseFailure" | "PreCompact" | "PreModelSwitch" | "PreSkillShellCommand" | "PreToolUse" | "SessionEnd" | "SessionStart" | "Setup" | "Stop" | "StopFailure" | "SubagentStart" | "SubagentStop" | "TaskCompleted" | "TaskCreated" | "TeammateIdle" | "UserPromptExpansion" | "UserPromptSubmit" | "WorktreeCreate" | "WorktreeRemove">;
503
+ } & {
504
+ error: Schema.String;
505
+ error_details: Schema.optionalKey<Schema.String>;
506
+ last_assistant_message: Schema.optionalKey<Schema.String>;
507
+ }>;
508
+ readonly output: Schema.Codec<unknown, unknown, never, never>;
509
+ };
510
+ readonly TeammateIdle: {
511
+ readonly input: Schema.Struct<{
512
+ readonly session_id: Schema.String;
513
+ readonly transcript_path: Schema.String;
514
+ readonly cwd: Schema.String;
515
+ readonly prompt_id: Schema.optionalKey<Schema.String>;
516
+ readonly scratchpad_dir: Schema.optionalKey<Schema.String>;
517
+ readonly permission_mode: Schema.optionalKey<Schema.Literals<readonly ["default", "plan", "acceptEdits", "auto", "dontAsk", "bypassPermissions"]>>;
518
+ readonly effort: Schema.optionalKey<Schema.Struct<{
519
+ readonly level: Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max"]>;
520
+ }>>;
521
+ readonly agent_id: Schema.optionalKey<Schema.String>;
522
+ readonly agent_type: Schema.optionalKey<Schema.String>;
523
+ readonly hook_event_name: Schema.Literal<"ConfigChange" | "CwdChanged" | "DirectoryAdded" | "Elicitation" | "ElicitationResult" | "FileChanged" | "InstructionsLoaded" | "MessageDisplay" | "Notification" | "PermissionDenied" | "PermissionRequest" | "PostCompact" | "PostModelSwitch" | "PostToolBatch" | "PostToolUse" | "PostToolUseFailure" | "PreCompact" | "PreModelSwitch" | "PreSkillShellCommand" | "PreToolUse" | "SessionEnd" | "SessionStart" | "Setup" | "Stop" | "StopFailure" | "SubagentStart" | "SubagentStop" | "TaskCompleted" | "TaskCreated" | "TeammateIdle" | "UserPromptExpansion" | "UserPromptSubmit" | "WorktreeCreate" | "WorktreeRemove">;
524
+ } & {
525
+ teammate_name: Schema.String;
526
+ team_name: Schema.optionalKey<Schema.String>;
527
+ }>;
528
+ readonly output: Schema.Codec<unknown, unknown, never, never>;
529
+ };
530
+ readonly InstructionsLoaded: {
531
+ readonly input: Schema.Struct<{
532
+ readonly session_id: Schema.String;
533
+ readonly transcript_path: Schema.String;
534
+ readonly cwd: Schema.String;
535
+ readonly prompt_id: Schema.optionalKey<Schema.String>;
536
+ readonly scratchpad_dir: Schema.optionalKey<Schema.String>;
537
+ readonly permission_mode: Schema.optionalKey<Schema.Literals<readonly ["default", "plan", "acceptEdits", "auto", "dontAsk", "bypassPermissions"]>>;
538
+ readonly effort: Schema.optionalKey<Schema.Struct<{
539
+ readonly level: Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max"]>;
540
+ }>>;
541
+ readonly agent_id: Schema.optionalKey<Schema.String>;
542
+ readonly agent_type: Schema.optionalKey<Schema.String>;
543
+ readonly hook_event_name: Schema.Literal<"ConfigChange" | "CwdChanged" | "DirectoryAdded" | "Elicitation" | "ElicitationResult" | "FileChanged" | "InstructionsLoaded" | "MessageDisplay" | "Notification" | "PermissionDenied" | "PermissionRequest" | "PostCompact" | "PostModelSwitch" | "PostToolBatch" | "PostToolUse" | "PostToolUseFailure" | "PreCompact" | "PreModelSwitch" | "PreSkillShellCommand" | "PreToolUse" | "SessionEnd" | "SessionStart" | "Setup" | "Stop" | "StopFailure" | "SubagentStart" | "SubagentStop" | "TaskCompleted" | "TaskCreated" | "TeammateIdle" | "UserPromptExpansion" | "UserPromptSubmit" | "WorktreeCreate" | "WorktreeRemove">;
544
+ } & {
545
+ file_path: Schema.String;
546
+ memory_type: Schema.Literals<readonly ["User", "Project", "Local", "Managed"]>;
547
+ load_reason: Schema.Literals<readonly ["session_start", "nested_traversal", "path_glob_match", "include", "compact"]>;
548
+ globs: Schema.optionalKey<Schema.$Array<Schema.String>>;
549
+ trigger_file_path: Schema.optionalKey<Schema.String>;
550
+ parent_file_path: Schema.optionalKey<Schema.String>;
551
+ }>;
552
+ readonly output: Schema.Codec<unknown, unknown, never, never>;
553
+ };
554
+ readonly ConfigChange: {
555
+ readonly input: Schema.Struct<{
556
+ readonly session_id: Schema.String;
557
+ readonly transcript_path: Schema.String;
558
+ readonly cwd: Schema.String;
559
+ readonly prompt_id: Schema.optionalKey<Schema.String>;
560
+ readonly scratchpad_dir: Schema.optionalKey<Schema.String>;
561
+ readonly permission_mode: Schema.optionalKey<Schema.Literals<readonly ["default", "plan", "acceptEdits", "auto", "dontAsk", "bypassPermissions"]>>;
562
+ readonly effort: Schema.optionalKey<Schema.Struct<{
563
+ readonly level: Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max"]>;
564
+ }>>;
565
+ readonly agent_id: Schema.optionalKey<Schema.String>;
566
+ readonly agent_type: Schema.optionalKey<Schema.String>;
567
+ readonly hook_event_name: Schema.Literal<"ConfigChange" | "CwdChanged" | "DirectoryAdded" | "Elicitation" | "ElicitationResult" | "FileChanged" | "InstructionsLoaded" | "MessageDisplay" | "Notification" | "PermissionDenied" | "PermissionRequest" | "PostCompact" | "PostModelSwitch" | "PostToolBatch" | "PostToolUse" | "PostToolUseFailure" | "PreCompact" | "PreModelSwitch" | "PreSkillShellCommand" | "PreToolUse" | "SessionEnd" | "SessionStart" | "Setup" | "Stop" | "StopFailure" | "SubagentStart" | "SubagentStop" | "TaskCompleted" | "TaskCreated" | "TeammateIdle" | "UserPromptExpansion" | "UserPromptSubmit" | "WorktreeCreate" | "WorktreeRemove">;
568
+ } & {
569
+ source: Schema.Literals<readonly ["user_settings", "project_settings", "local_settings", "policy_settings", "skills"]>;
570
+ file_path: Schema.optionalKey<Schema.String>;
571
+ }>;
572
+ readonly output: Schema.Codec<unknown, unknown, never, never>;
573
+ };
574
+ readonly CwdChanged: {
575
+ readonly input: Schema.Struct<{
576
+ readonly session_id: Schema.String;
577
+ readonly transcript_path: Schema.String;
578
+ readonly cwd: Schema.String;
579
+ readonly prompt_id: Schema.optionalKey<Schema.String>;
580
+ readonly scratchpad_dir: Schema.optionalKey<Schema.String>;
581
+ readonly permission_mode: Schema.optionalKey<Schema.Literals<readonly ["default", "plan", "acceptEdits", "auto", "dontAsk", "bypassPermissions"]>>;
582
+ readonly effort: Schema.optionalKey<Schema.Struct<{
583
+ readonly level: Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max"]>;
584
+ }>>;
585
+ readonly agent_id: Schema.optionalKey<Schema.String>;
586
+ readonly agent_type: Schema.optionalKey<Schema.String>;
587
+ readonly hook_event_name: Schema.Literal<"ConfigChange" | "CwdChanged" | "DirectoryAdded" | "Elicitation" | "ElicitationResult" | "FileChanged" | "InstructionsLoaded" | "MessageDisplay" | "Notification" | "PermissionDenied" | "PermissionRequest" | "PostCompact" | "PostModelSwitch" | "PostToolBatch" | "PostToolUse" | "PostToolUseFailure" | "PreCompact" | "PreModelSwitch" | "PreSkillShellCommand" | "PreToolUse" | "SessionEnd" | "SessionStart" | "Setup" | "Stop" | "StopFailure" | "SubagentStart" | "SubagentStop" | "TaskCompleted" | "TaskCreated" | "TeammateIdle" | "UserPromptExpansion" | "UserPromptSubmit" | "WorktreeCreate" | "WorktreeRemove">;
588
+ } & {
589
+ old_cwd: Schema.String;
590
+ new_cwd: Schema.String;
591
+ }>;
592
+ readonly output: Schema.Codec<unknown, unknown, never, never>;
593
+ };
594
+ readonly DirectoryAdded: {
595
+ readonly input: Schema.Struct<{
596
+ readonly session_id: Schema.String;
597
+ readonly transcript_path: Schema.String;
598
+ readonly cwd: Schema.String;
599
+ readonly prompt_id: Schema.optionalKey<Schema.String>;
600
+ readonly scratchpad_dir: Schema.optionalKey<Schema.String>;
601
+ readonly permission_mode: Schema.optionalKey<Schema.Literals<readonly ["default", "plan", "acceptEdits", "auto", "dontAsk", "bypassPermissions"]>>;
602
+ readonly effort: Schema.optionalKey<Schema.Struct<{
603
+ readonly level: Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max"]>;
604
+ }>>;
605
+ readonly agent_id: Schema.optionalKey<Schema.String>;
606
+ readonly agent_type: Schema.optionalKey<Schema.String>;
607
+ readonly hook_event_name: Schema.Literal<"ConfigChange" | "CwdChanged" | "DirectoryAdded" | "Elicitation" | "ElicitationResult" | "FileChanged" | "InstructionsLoaded" | "MessageDisplay" | "Notification" | "PermissionDenied" | "PermissionRequest" | "PostCompact" | "PostModelSwitch" | "PostToolBatch" | "PostToolUse" | "PostToolUseFailure" | "PreCompact" | "PreModelSwitch" | "PreSkillShellCommand" | "PreToolUse" | "SessionEnd" | "SessionStart" | "Setup" | "Stop" | "StopFailure" | "SubagentStart" | "SubagentStop" | "TaskCompleted" | "TaskCreated" | "TeammateIdle" | "UserPromptExpansion" | "UserPromptSubmit" | "WorktreeCreate" | "WorktreeRemove">;
608
+ } & {
609
+ directory: Schema.String;
610
+ source: Schema.Literals<readonly ["slash_command", "register_repo_root"]>;
611
+ }>;
612
+ readonly output: Schema.Codec<unknown, unknown, never, never>;
613
+ };
614
+ readonly FileChanged: {
615
+ readonly input: Schema.Struct<{
616
+ readonly session_id: Schema.String;
617
+ readonly transcript_path: Schema.String;
618
+ readonly cwd: Schema.String;
619
+ readonly prompt_id: Schema.optionalKey<Schema.String>;
620
+ readonly scratchpad_dir: Schema.optionalKey<Schema.String>;
621
+ readonly permission_mode: Schema.optionalKey<Schema.Literals<readonly ["default", "plan", "acceptEdits", "auto", "dontAsk", "bypassPermissions"]>>;
622
+ readonly effort: Schema.optionalKey<Schema.Struct<{
623
+ readonly level: Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max"]>;
624
+ }>>;
625
+ readonly agent_id: Schema.optionalKey<Schema.String>;
626
+ readonly agent_type: Schema.optionalKey<Schema.String>;
627
+ readonly hook_event_name: Schema.Literal<"ConfigChange" | "CwdChanged" | "DirectoryAdded" | "Elicitation" | "ElicitationResult" | "FileChanged" | "InstructionsLoaded" | "MessageDisplay" | "Notification" | "PermissionDenied" | "PermissionRequest" | "PostCompact" | "PostModelSwitch" | "PostToolBatch" | "PostToolUse" | "PostToolUseFailure" | "PreCompact" | "PreModelSwitch" | "PreSkillShellCommand" | "PreToolUse" | "SessionEnd" | "SessionStart" | "Setup" | "Stop" | "StopFailure" | "SubagentStart" | "SubagentStop" | "TaskCompleted" | "TaskCreated" | "TeammateIdle" | "UserPromptExpansion" | "UserPromptSubmit" | "WorktreeCreate" | "WorktreeRemove">;
628
+ } & {
629
+ file_path: Schema.String;
630
+ event: Schema.Literals<readonly ["change", "add", "unlink"]>;
631
+ }>;
632
+ readonly output: Schema.Codec<unknown, unknown, never, never>;
633
+ };
634
+ readonly WorktreeCreate: {
635
+ readonly input: Schema.Struct<{
636
+ readonly session_id: Schema.String;
637
+ readonly transcript_path: Schema.String;
638
+ readonly cwd: Schema.String;
639
+ readonly prompt_id: Schema.optionalKey<Schema.String>;
640
+ readonly scratchpad_dir: Schema.optionalKey<Schema.String>;
641
+ readonly permission_mode: Schema.optionalKey<Schema.Literals<readonly ["default", "plan", "acceptEdits", "auto", "dontAsk", "bypassPermissions"]>>;
642
+ readonly effort: Schema.optionalKey<Schema.Struct<{
643
+ readonly level: Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max"]>;
644
+ }>>;
645
+ readonly agent_id: Schema.optionalKey<Schema.String>;
646
+ readonly agent_type: Schema.optionalKey<Schema.String>;
647
+ readonly hook_event_name: Schema.Literal<"ConfigChange" | "CwdChanged" | "DirectoryAdded" | "Elicitation" | "ElicitationResult" | "FileChanged" | "InstructionsLoaded" | "MessageDisplay" | "Notification" | "PermissionDenied" | "PermissionRequest" | "PostCompact" | "PostModelSwitch" | "PostToolBatch" | "PostToolUse" | "PostToolUseFailure" | "PreCompact" | "PreModelSwitch" | "PreSkillShellCommand" | "PreToolUse" | "SessionEnd" | "SessionStart" | "Setup" | "Stop" | "StopFailure" | "SubagentStart" | "SubagentStop" | "TaskCompleted" | "TaskCreated" | "TeammateIdle" | "UserPromptExpansion" | "UserPromptSubmit" | "WorktreeCreate" | "WorktreeRemove">;
648
+ } & {
649
+ name: Schema.String;
650
+ }>;
651
+ readonly output: Schema.Codec<unknown, unknown, never, never>;
652
+ };
653
+ readonly WorktreeRemove: {
654
+ readonly input: Schema.Struct<{
655
+ readonly session_id: Schema.String;
656
+ readonly transcript_path: Schema.String;
657
+ readonly cwd: Schema.String;
658
+ readonly prompt_id: Schema.optionalKey<Schema.String>;
659
+ readonly scratchpad_dir: Schema.optionalKey<Schema.String>;
660
+ readonly permission_mode: Schema.optionalKey<Schema.Literals<readonly ["default", "plan", "acceptEdits", "auto", "dontAsk", "bypassPermissions"]>>;
661
+ readonly effort: Schema.optionalKey<Schema.Struct<{
662
+ readonly level: Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max"]>;
663
+ }>>;
664
+ readonly agent_id: Schema.optionalKey<Schema.String>;
665
+ readonly agent_type: Schema.optionalKey<Schema.String>;
666
+ readonly hook_event_name: Schema.Literal<"ConfigChange" | "CwdChanged" | "DirectoryAdded" | "Elicitation" | "ElicitationResult" | "FileChanged" | "InstructionsLoaded" | "MessageDisplay" | "Notification" | "PermissionDenied" | "PermissionRequest" | "PostCompact" | "PostModelSwitch" | "PostToolBatch" | "PostToolUse" | "PostToolUseFailure" | "PreCompact" | "PreModelSwitch" | "PreSkillShellCommand" | "PreToolUse" | "SessionEnd" | "SessionStart" | "Setup" | "Stop" | "StopFailure" | "SubagentStart" | "SubagentStop" | "TaskCompleted" | "TaskCreated" | "TeammateIdle" | "UserPromptExpansion" | "UserPromptSubmit" | "WorktreeCreate" | "WorktreeRemove">;
667
+ } & {
668
+ worktree_path: Schema.String;
669
+ }>;
670
+ readonly output: Schema.Codec<unknown, unknown, never, never>;
671
+ };
672
+ readonly PreCompact: {
673
+ readonly input: Schema.Struct<{
674
+ readonly session_id: Schema.String;
675
+ readonly transcript_path: Schema.String;
676
+ readonly cwd: Schema.String;
677
+ readonly prompt_id: Schema.optionalKey<Schema.String>;
678
+ readonly scratchpad_dir: Schema.optionalKey<Schema.String>;
679
+ readonly permission_mode: Schema.optionalKey<Schema.Literals<readonly ["default", "plan", "acceptEdits", "auto", "dontAsk", "bypassPermissions"]>>;
680
+ readonly effort: Schema.optionalKey<Schema.Struct<{
681
+ readonly level: Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max"]>;
682
+ }>>;
683
+ readonly agent_id: Schema.optionalKey<Schema.String>;
684
+ readonly agent_type: Schema.optionalKey<Schema.String>;
685
+ readonly hook_event_name: Schema.Literal<"ConfigChange" | "CwdChanged" | "DirectoryAdded" | "Elicitation" | "ElicitationResult" | "FileChanged" | "InstructionsLoaded" | "MessageDisplay" | "Notification" | "PermissionDenied" | "PermissionRequest" | "PostCompact" | "PostModelSwitch" | "PostToolBatch" | "PostToolUse" | "PostToolUseFailure" | "PreCompact" | "PreModelSwitch" | "PreSkillShellCommand" | "PreToolUse" | "SessionEnd" | "SessionStart" | "Setup" | "Stop" | "StopFailure" | "SubagentStart" | "SubagentStop" | "TaskCompleted" | "TaskCreated" | "TeammateIdle" | "UserPromptExpansion" | "UserPromptSubmit" | "WorktreeCreate" | "WorktreeRemove">;
686
+ } & {
687
+ trigger: Schema.Literals<readonly ["manual", "auto"]>;
688
+ custom_instructions: Schema.NullOr<Schema.String>;
689
+ }>;
690
+ readonly output: Schema.Codec<unknown, unknown, never, never>;
691
+ };
692
+ readonly PostCompact: {
693
+ readonly input: Schema.Struct<{
694
+ readonly session_id: Schema.String;
695
+ readonly transcript_path: Schema.String;
696
+ readonly cwd: Schema.String;
697
+ readonly prompt_id: Schema.optionalKey<Schema.String>;
698
+ readonly scratchpad_dir: Schema.optionalKey<Schema.String>;
699
+ readonly permission_mode: Schema.optionalKey<Schema.Literals<readonly ["default", "plan", "acceptEdits", "auto", "dontAsk", "bypassPermissions"]>>;
700
+ readonly effort: Schema.optionalKey<Schema.Struct<{
701
+ readonly level: Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max"]>;
702
+ }>>;
703
+ readonly agent_id: Schema.optionalKey<Schema.String>;
704
+ readonly agent_type: Schema.optionalKey<Schema.String>;
705
+ readonly hook_event_name: Schema.Literal<"ConfigChange" | "CwdChanged" | "DirectoryAdded" | "Elicitation" | "ElicitationResult" | "FileChanged" | "InstructionsLoaded" | "MessageDisplay" | "Notification" | "PermissionDenied" | "PermissionRequest" | "PostCompact" | "PostModelSwitch" | "PostToolBatch" | "PostToolUse" | "PostToolUseFailure" | "PreCompact" | "PreModelSwitch" | "PreSkillShellCommand" | "PreToolUse" | "SessionEnd" | "SessionStart" | "Setup" | "Stop" | "StopFailure" | "SubagentStart" | "SubagentStop" | "TaskCompleted" | "TaskCreated" | "TeammateIdle" | "UserPromptExpansion" | "UserPromptSubmit" | "WorktreeCreate" | "WorktreeRemove">;
706
+ } & {
707
+ trigger: Schema.Literals<readonly ["manual", "auto"]>;
708
+ compact_summary: Schema.String;
709
+ }>;
710
+ readonly output: Schema.Codec<unknown, unknown, never, never>;
711
+ };
712
+ readonly PreModelSwitch: {
713
+ readonly input: Schema.Struct<{
714
+ readonly session_id: Schema.String;
715
+ readonly transcript_path: Schema.String;
716
+ readonly cwd: Schema.String;
717
+ readonly prompt_id: Schema.optionalKey<Schema.String>;
718
+ readonly scratchpad_dir: Schema.optionalKey<Schema.String>;
719
+ readonly permission_mode: Schema.optionalKey<Schema.Literals<readonly ["default", "plan", "acceptEdits", "auto", "dontAsk", "bypassPermissions"]>>;
720
+ readonly effort: Schema.optionalKey<Schema.Struct<{
721
+ readonly level: Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max"]>;
722
+ }>>;
723
+ readonly agent_id: Schema.optionalKey<Schema.String>;
724
+ readonly agent_type: Schema.optionalKey<Schema.String>;
725
+ readonly hook_event_name: Schema.Literal<"ConfigChange" | "CwdChanged" | "DirectoryAdded" | "Elicitation" | "ElicitationResult" | "FileChanged" | "InstructionsLoaded" | "MessageDisplay" | "Notification" | "PermissionDenied" | "PermissionRequest" | "PostCompact" | "PostModelSwitch" | "PostToolBatch" | "PostToolUse" | "PostToolUseFailure" | "PreCompact" | "PreModelSwitch" | "PreSkillShellCommand" | "PreToolUse" | "SessionEnd" | "SessionStart" | "Setup" | "Stop" | "StopFailure" | "SubagentStart" | "SubagentStop" | "TaskCompleted" | "TaskCreated" | "TeammateIdle" | "UserPromptExpansion" | "UserPromptSubmit" | "WorktreeCreate" | "WorktreeRemove">;
726
+ } & {
727
+ from_model: Schema.String;
728
+ to_model: Schema.String;
729
+ requested_model: Schema.NullOr<Schema.String>;
730
+ source: Schema.Literals<readonly ["command", "picker", "sdk"]>;
731
+ context_tokens: Schema.Finite;
732
+ prompt_cache_warm: Schema.Boolean;
733
+ cache_ttl: Schema.Literals<readonly ["5m", "1h"]>;
734
+ estimated_cache_write_usd: Schema.Finite;
735
+ pricing: Schema.Literals<readonly ["configured", "catalog", "default"]>;
736
+ }>;
737
+ readonly output: Schema.Codec<unknown, unknown, never, never>;
738
+ };
739
+ readonly PostModelSwitch: {
740
+ readonly input: Schema.Struct<{
741
+ readonly session_id: Schema.String;
742
+ readonly transcript_path: Schema.String;
743
+ readonly cwd: Schema.String;
744
+ readonly prompt_id: Schema.optionalKey<Schema.String>;
745
+ readonly scratchpad_dir: Schema.optionalKey<Schema.String>;
746
+ readonly permission_mode: Schema.optionalKey<Schema.Literals<readonly ["default", "plan", "acceptEdits", "auto", "dontAsk", "bypassPermissions"]>>;
747
+ readonly effort: Schema.optionalKey<Schema.Struct<{
748
+ readonly level: Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max"]>;
749
+ }>>;
750
+ readonly agent_id: Schema.optionalKey<Schema.String>;
751
+ readonly agent_type: Schema.optionalKey<Schema.String>;
752
+ readonly hook_event_name: Schema.Literal<"ConfigChange" | "CwdChanged" | "DirectoryAdded" | "Elicitation" | "ElicitationResult" | "FileChanged" | "InstructionsLoaded" | "MessageDisplay" | "Notification" | "PermissionDenied" | "PermissionRequest" | "PostCompact" | "PostModelSwitch" | "PostToolBatch" | "PostToolUse" | "PostToolUseFailure" | "PreCompact" | "PreModelSwitch" | "PreSkillShellCommand" | "PreToolUse" | "SessionEnd" | "SessionStart" | "Setup" | "Stop" | "StopFailure" | "SubagentStart" | "SubagentStop" | "TaskCompleted" | "TaskCreated" | "TeammateIdle" | "UserPromptExpansion" | "UserPromptSubmit" | "WorktreeCreate" | "WorktreeRemove">;
753
+ } & {
754
+ from_model: Schema.String;
755
+ to_model: Schema.String;
756
+ requested_model: Schema.NullOr<Schema.String>;
757
+ source: Schema.Literals<readonly ["command", "picker", "sdk", "auto", "resume"]>;
758
+ context_tokens: Schema.Finite;
759
+ prompt_cache_warm: Schema.Boolean;
760
+ cache_ttl: Schema.Literals<readonly ["5m", "1h"]>;
761
+ estimated_cache_write_usd: Schema.Finite;
762
+ pricing: Schema.Literals<readonly ["configured", "catalog", "default"]>;
763
+ }>;
764
+ readonly output: Schema.Codec<unknown, unknown, never, never>;
765
+ };
766
+ readonly Elicitation: {
767
+ readonly input: Schema.Struct<{
768
+ readonly session_id: Schema.String;
769
+ readonly transcript_path: Schema.String;
770
+ readonly cwd: Schema.String;
771
+ readonly prompt_id: Schema.optionalKey<Schema.String>;
772
+ readonly scratchpad_dir: Schema.optionalKey<Schema.String>;
773
+ readonly permission_mode: Schema.optionalKey<Schema.Literals<readonly ["default", "plan", "acceptEdits", "auto", "dontAsk", "bypassPermissions"]>>;
774
+ readonly effort: Schema.optionalKey<Schema.Struct<{
775
+ readonly level: Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max"]>;
776
+ }>>;
777
+ readonly agent_id: Schema.optionalKey<Schema.String>;
778
+ readonly agent_type: Schema.optionalKey<Schema.String>;
779
+ readonly hook_event_name: Schema.Literal<"ConfigChange" | "CwdChanged" | "DirectoryAdded" | "Elicitation" | "ElicitationResult" | "FileChanged" | "InstructionsLoaded" | "MessageDisplay" | "Notification" | "PermissionDenied" | "PermissionRequest" | "PostCompact" | "PostModelSwitch" | "PostToolBatch" | "PostToolUse" | "PostToolUseFailure" | "PreCompact" | "PreModelSwitch" | "PreSkillShellCommand" | "PreToolUse" | "SessionEnd" | "SessionStart" | "Setup" | "Stop" | "StopFailure" | "SubagentStart" | "SubagentStop" | "TaskCompleted" | "TaskCreated" | "TeammateIdle" | "UserPromptExpansion" | "UserPromptSubmit" | "WorktreeCreate" | "WorktreeRemove">;
780
+ } & {
781
+ mcp_server_name: Schema.String;
782
+ message: Schema.String;
783
+ mode: Schema.optionalKey<Schema.Literals<readonly ["form", "url"]>>;
784
+ url: Schema.optionalKey<Schema.String>;
785
+ elicitation_id: Schema.optionalKey<Schema.String>;
786
+ requested_schema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>;
787
+ }>;
788
+ readonly output: Schema.Codec<unknown, unknown, never, never>;
789
+ };
790
+ readonly ElicitationResult: {
791
+ readonly input: Schema.Struct<{
792
+ readonly session_id: Schema.String;
793
+ readonly transcript_path: Schema.String;
794
+ readonly cwd: Schema.String;
795
+ readonly prompt_id: Schema.optionalKey<Schema.String>;
796
+ readonly scratchpad_dir: Schema.optionalKey<Schema.String>;
797
+ readonly permission_mode: Schema.optionalKey<Schema.Literals<readonly ["default", "plan", "acceptEdits", "auto", "dontAsk", "bypassPermissions"]>>;
798
+ readonly effort: Schema.optionalKey<Schema.Struct<{
799
+ readonly level: Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max"]>;
800
+ }>>;
801
+ readonly agent_id: Schema.optionalKey<Schema.String>;
802
+ readonly agent_type: Schema.optionalKey<Schema.String>;
803
+ readonly hook_event_name: Schema.Literal<"ConfigChange" | "CwdChanged" | "DirectoryAdded" | "Elicitation" | "ElicitationResult" | "FileChanged" | "InstructionsLoaded" | "MessageDisplay" | "Notification" | "PermissionDenied" | "PermissionRequest" | "PostCompact" | "PostModelSwitch" | "PostToolBatch" | "PostToolUse" | "PostToolUseFailure" | "PreCompact" | "PreModelSwitch" | "PreSkillShellCommand" | "PreToolUse" | "SessionEnd" | "SessionStart" | "Setup" | "Stop" | "StopFailure" | "SubagentStart" | "SubagentStop" | "TaskCompleted" | "TaskCreated" | "TeammateIdle" | "UserPromptExpansion" | "UserPromptSubmit" | "WorktreeCreate" | "WorktreeRemove">;
804
+ } & {
805
+ mcp_server_name: Schema.String;
806
+ action: Schema.Literals<readonly ["accept", "decline", "cancel"]>;
807
+ mode: Schema.optionalKey<Schema.Literals<readonly ["form", "url"]>>;
808
+ elicitation_id: Schema.optionalKey<Schema.String>;
809
+ content: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>;
810
+ }>;
811
+ readonly output: Schema.Codec<unknown, unknown, never, never>;
812
+ };
813
+ readonly SessionEnd: {
814
+ readonly input: Schema.Struct<{
815
+ readonly session_id: Schema.String;
816
+ readonly transcript_path: Schema.String;
817
+ readonly cwd: Schema.String;
818
+ readonly prompt_id: Schema.optionalKey<Schema.String>;
819
+ readonly scratchpad_dir: Schema.optionalKey<Schema.String>;
820
+ readonly permission_mode: Schema.optionalKey<Schema.Literals<readonly ["default", "plan", "acceptEdits", "auto", "dontAsk", "bypassPermissions"]>>;
821
+ readonly effort: Schema.optionalKey<Schema.Struct<{
822
+ readonly level: Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max"]>;
823
+ }>>;
824
+ readonly agent_id: Schema.optionalKey<Schema.String>;
825
+ readonly agent_type: Schema.optionalKey<Schema.String>;
826
+ readonly hook_event_name: Schema.Literal<"ConfigChange" | "CwdChanged" | "DirectoryAdded" | "Elicitation" | "ElicitationResult" | "FileChanged" | "InstructionsLoaded" | "MessageDisplay" | "Notification" | "PermissionDenied" | "PermissionRequest" | "PostCompact" | "PostModelSwitch" | "PostToolBatch" | "PostToolUse" | "PostToolUseFailure" | "PreCompact" | "PreModelSwitch" | "PreSkillShellCommand" | "PreToolUse" | "SessionEnd" | "SessionStart" | "Setup" | "Stop" | "StopFailure" | "SubagentStart" | "SubagentStop" | "TaskCompleted" | "TaskCreated" | "TeammateIdle" | "UserPromptExpansion" | "UserPromptSubmit" | "WorktreeCreate" | "WorktreeRemove">;
827
+ } & {
828
+ reason: Schema.String;
829
+ }>;
830
+ readonly output: Schema.Codec<unknown, unknown, never, never>;
831
+ };
832
+ };
833
+ /**
834
+ * Every Claude Code hook event, the vocabulary a plugin's `hooks` config is
835
+ * written in. Each target maps these to its own names.
836
+ *
837
+ * @public
838
+ */
839
+ export declare const CLAUDE_HOOK_EVENTS: readonly ["SessionStart", "Setup", "UserPromptSubmit", "UserPromptExpansion", "PreSkillShellCommand", "PreToolUse", "PermissionRequest", "PermissionDenied", "PostToolUse", "PostToolUseFailure", "PostToolBatch", "Notification", "MessageDisplay", "SubagentStart", "SubagentStop", "TaskCreated", "TaskCompleted", "Stop", "StopFailure", "TeammateIdle", "InstructionsLoaded", "ConfigChange", "CwdChanged", "DirectoryAdded", "FileChanged", "WorktreeCreate", "WorktreeRemove", "PreCompact", "PostCompact", "PreModelSwitch", "PostModelSwitch", "Elicitation", "ElicitationResult", "SessionEnd"];
840
+ /**
841
+ * A Claude Code hook event name.
842
+ *
843
+ * @public
844
+ */
845
+ export declare const ClaudeHookEvent: Schema.Literals<readonly ["SessionStart", "Setup", "UserPromptSubmit", "UserPromptExpansion", "PreSkillShellCommand", "PreToolUse", "PermissionRequest", "PermissionDenied", "PostToolUse", "PostToolUseFailure", "PostToolBatch", "Notification", "MessageDisplay", "SubagentStart", "SubagentStop", "TaskCreated", "TaskCompleted", "Stop", "StopFailure", "TeammateIdle", "InstructionsLoaded", "ConfigChange", "CwdChanged", "DirectoryAdded", "FileChanged", "WorktreeCreate", "WorktreeRemove", "PreCompact", "PostCompact", "PreModelSwitch", "PostModelSwitch", "Elicitation", "ElicitationResult", "SessionEnd"]>;
846
+ /**
847
+ * The decoded `ClaudeHookEvent`.
848
+ *
849
+ * @public
850
+ */
851
+ export type ClaudeHookEvent = typeof ClaudeHookEvent.Type;
852
+ /**
853
+ * The documented `tool_input` shape of each built-in tool, by tool name.
854
+ *
855
+ * @public
856
+ */
857
+ export declare const TOOL_INPUTS: {
858
+ readonly Bash: Schema.Struct<{
859
+ command: Schema.String;
860
+ description: Schema.optionalKey<Schema.String>;
861
+ timeout: Schema.optionalKey<Schema.Finite>;
862
+ run_in_background: Schema.optionalKey<Schema.Boolean>;
863
+ }>;
864
+ readonly PowerShell: Schema.Struct<{
865
+ command: Schema.String;
866
+ description: Schema.optionalKey<Schema.String>;
867
+ timeout: Schema.optionalKey<Schema.Finite>;
868
+ run_in_background: Schema.optionalKey<Schema.Boolean>;
869
+ }>;
870
+ readonly Write: Schema.Struct<{
871
+ file_path: Schema.String;
872
+ content: Schema.String;
873
+ }>;
874
+ readonly Edit: Schema.Struct<{
875
+ file_path: Schema.String;
876
+ old_string: Schema.String;
877
+ new_string: Schema.String;
878
+ replace_all: Schema.optionalKey<Schema.Boolean>;
879
+ }>;
880
+ readonly Read: Schema.Struct<{
881
+ file_path: Schema.String;
882
+ offset: Schema.optionalKey<Schema.Finite>;
883
+ limit: Schema.optionalKey<Schema.Finite>;
884
+ }>;
885
+ readonly Glob: Schema.Struct<{
886
+ pattern: Schema.String;
887
+ path: Schema.optionalKey<Schema.String>;
888
+ }>;
889
+ readonly Grep: Schema.Struct<{
890
+ pattern: Schema.String;
891
+ path: Schema.optionalKey<Schema.String>;
892
+ glob: Schema.optionalKey<Schema.String>;
893
+ output_mode: Schema.optionalKey<Schema.Literals<readonly ["content", "files_with_matches", "count"]>>;
894
+ "-i": Schema.optionalKey<Schema.Boolean>;
895
+ multiline: Schema.optionalKey<Schema.Boolean>;
896
+ }>;
897
+ readonly WebFetch: Schema.Struct<{
898
+ url: Schema.String;
899
+ prompt: Schema.String;
900
+ offset: Schema.optionalKey<Schema.Finite>;
901
+ }>;
902
+ readonly WebSearch: Schema.Struct<{
903
+ query: Schema.String;
904
+ allowed_domains: Schema.optionalKey<Schema.$Array<Schema.String>>;
905
+ blocked_domains: Schema.optionalKey<Schema.$Array<Schema.String>>;
906
+ mode: Schema.optionalKey<Schema.Literals<readonly ["standard", "extended"]>>;
907
+ }>;
908
+ readonly Agent: Schema.Struct<{
909
+ prompt: Schema.String;
910
+ description: Schema.optionalKey<Schema.String>;
911
+ subagent_type: Schema.optionalKey<Schema.String>;
912
+ model: Schema.optionalKey<Schema.String>;
913
+ }>;
914
+ readonly AskUserQuestion: Schema.Struct<{
915
+ questions: Schema.$Array<Schema.Struct<{
916
+ readonly question: Schema.String;
917
+ readonly header: Schema.String;
918
+ readonly options: Schema.$Array<Schema.Struct<{
919
+ readonly label: Schema.String;
920
+ readonly description: Schema.optionalKey<Schema.String>;
921
+ }>>;
922
+ readonly multiSelect: Schema.optionalKey<Schema.Boolean>;
923
+ }>>;
924
+ answers: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>;
925
+ }>;
926
+ readonly ExitPlanMode: Schema.Struct<{
927
+ plan: Schema.optionalKey<Schema.String>;
928
+ planFilePath: Schema.optionalKey<Schema.String>;
929
+ allowedPrompts: Schema.optionalKey<Schema.$Array<Schema.Unknown>>;
930
+ }>;
931
+ };
932
+ /**
933
+ * The Zig source of `zig/src/events.zig`: a struct for each Claude Code hook
934
+ * event's input and, under `tools`, for each built-in tool's `tool_input`. The
935
+ * text is what `zig fmt` would write, so a regeneration that changes nothing
936
+ * writes the same bytes.
937
+ *
938
+ * @public
939
+ */
940
+ export declare const hookEventsZig: () => string;
941
+ /**
942
+ * A host pluginfinity builds hooks for.
943
+ *
944
+ * @public
945
+ */
946
+ type HookHost = "claude" | "copilot";
947
+ /**
948
+ * What a hook answers, in host-neutral terms. Each host's wire format is
949
+ * written from it by `encodeDecision`.
950
+ *
951
+ * @public
952
+ */
953
+ type Decision = Data.TaggedEnum<{
954
+ /** Change nothing. */
955
+ Noop: {};
956
+ /** Allow the action, with an optional reason and, on PreToolUse, a replacement tool input. */
957
+ Allow: {
958
+ readonly reason?: string;
959
+ readonly updatedInput?: Readonly<Record<string, unknown>>;
960
+ };
961
+ /** Refuse the action. */
962
+ Deny: {
963
+ readonly reason?: string;
964
+ };
965
+ /** Ask the user. */
966
+ Ask: {
967
+ readonly reason?: string;
968
+ };
969
+ /** Block the event's action (on Stop: keep working). */
970
+ Block: {
971
+ readonly reason?: string;
972
+ };
973
+ /** Add text to the model's context. */
974
+ Context: {
975
+ readonly text: string;
976
+ };
977
+ /** Show the user a message. */
978
+ SystemMessage: {
979
+ readonly text: string;
980
+ };
981
+ /** Wake the agent from a background hook (an `asyncRewake` entry only). */
982
+ Rewake: {
983
+ readonly message: string;
984
+ };
985
+ /** Send a host-specific JSON response verbatim, only on that host. */
986
+ Raw: {
987
+ readonly host: HookHost;
988
+ readonly json: Readonly<Record<string, unknown>>;
989
+ };
990
+ }>;
991
+ /**
992
+ * The constructors for each `Decision`.
993
+ *
994
+ * @public
995
+ */
996
+ export declare const makeDecision: Data.TaggedEnum.Constructor<{
997
+ readonly _tag: "Allow";
998
+ readonly reason?: string;
999
+ readonly updatedInput?: Readonly<Record<string, unknown>>;
1000
+ } | {
1001
+ readonly _tag: "Ask";
1002
+ readonly reason?: string;
1003
+ } | {
1004
+ readonly _tag: "Block";
1005
+ readonly reason?: string;
1006
+ } | {
1007
+ readonly _tag: "Context";
1008
+ readonly text: string;
1009
+ } | {
1010
+ readonly _tag: "Deny";
1011
+ readonly reason?: string;
1012
+ } | {
1013
+ readonly _tag: "Noop";
1014
+ } | {
1015
+ readonly _tag: "Raw";
1016
+ readonly host: HookHost;
1017
+ readonly json: Readonly<Record<string, unknown>>;
1018
+ } | {
1019
+ readonly _tag: "Rewake";
1020
+ readonly message: string;
1021
+ } | {
1022
+ readonly _tag: "SystemMessage";
1023
+ readonly text: string;
1024
+ }>;
1025
+ /**
1026
+ * A `Decision` tag.
1027
+ *
1028
+ * @public
1029
+ */
1030
+ type DecisionTag = Decision["_tag"];
1031
+ /**
1032
+ * The events on which each host honours each answer, the one source `supports`,
1033
+ * `ALLOWED_DECISIONS` and `AllowedTag` read. It mirrors the bash library's
1034
+ * `hook_supports` and `okf/references/*-plugin-format.md`.
1035
+ *
1036
+ * @remarks
1037
+ * `Allow`, `Ask` and `Deny` are honoured on `PreToolUse` by both hosts and, on
1038
+ * Claude Code only, on `permission` events (and `Deny` also on `denyOnly`).
1039
+ * `SystemMessage` is honoured on Claude Code on every event but
1040
+ * `noSystemMessage`, and never on Copilot. `Noop`, `Raw` and `Rewake` work everywhere.
1041
+ *
1042
+ * @public
1043
+ */
1044
+ export declare const ANSWER_EVENTS: {
1045
+ readonly permission: readonly ["PreToolUse", "PreModelSwitch"];
1046
+ readonly denyOnly: readonly ["PreSkillShellCommand"];
1047
+ readonly noSystemMessage: readonly ["Setup", "InstructionsLoaded", "MessageDisplay", "Notification", "StopFailure", "ConfigChange", "DirectoryAdded", "WorktreeCreate", "WorktreeRemove", "PreCompact", "PostCompact", "SessionEnd", "Elicitation", "ElicitationResult"];
1048
+ readonly context: {
1049
+ readonly claude: readonly ["SessionStart", "SubagentStart", "PostModelSwitch", "UserPromptSubmit", "UserPromptExpansion", "PreToolUse", "PostToolUse", "PostToolUseFailure", "PostToolBatch", "Stop", "SubagentStop"];
1050
+ readonly copilot: readonly ["SessionStart", "SubagentStart", "PostToolUse", "Notification"];
1051
+ };
1052
+ readonly block: {
1053
+ readonly claude: readonly ["UserPromptSubmit", "UserPromptExpansion", "PreSkillShellCommand", "PostToolUse", "PostToolBatch", "Stop", "SubagentStop", "ConfigChange", "PreCompact", "TaskCreated", "TaskCompleted", "TeammateIdle", "PreModelSwitch", "Elicitation", "ElicitationResult"];
1054
+ readonly copilot: readonly ["Stop", "SubagentStop"];
1055
+ };
1056
+ };
1057
+ /**
1058
+ * Whether `host` honours a decision on `event`. It mirrors the bash library's
1059
+ * `hook_supports` (and `okf/references/*-plugin-format.md`).
1060
+ *
1061
+ * @public
1062
+ */
1063
+ export declare const supports: (host: HookHost, tag: DecisionTag, event: string) => boolean;
1064
+ /**
1065
+ * Every `Decision` tag.
1066
+ *
1067
+ * @public
1068
+ */
1069
+ export declare const DECISION_TAGS: ReadonlyArray<DecisionTag>;
1070
+ /**
1071
+ * The decisions a hook may give on each event: those either host honours
1072
+ * there, plus `Noop`, `Raw` and `Rewake`, which every event takes.
1073
+ *
1074
+ * @public
1075
+ */
1076
+ export declare const ALLOWED_DECISIONS: Readonly<Record<ClaudeHookEvent, ReadonlyArray<DecisionTag>>>;
1077
+ /**
1078
+ * The decision tags event `E` takes, as a type: the same set `ALLOWED_DECISIONS`
1079
+ * holds, read from {@link ANSWER_EVENTS}.
1080
+ *
1081
+ * @public
1082
+ */
1083
+ type AllowedTag<E extends ClaudeHookEvent> = "Noop" | "Raw" | "Rewake" | (E extends (typeof ANSWER_EVENTS)["permission"][number] ? "Allow" | "Ask" : never) | (E extends (typeof ANSWER_EVENTS)["permission"][number] | (typeof ANSWER_EVENTS)["denyOnly"][number] ? "Deny" : never) | (E extends (typeof ANSWER_EVENTS)["context"]["claude"][number] | (typeof ANSWER_EVENTS)["context"]["copilot"][number] ? "Context" : never) | (E extends (typeof ANSWER_EVENTS)["block"]["claude"][number] | (typeof ANSWER_EVENTS)["block"]["copilot"][number] ? "Block" : never) | (E extends (typeof ANSWER_EVENTS)["noSystemMessage"][number] ? never : "SystemMessage");
1084
+ /**
1085
+ * The decisions event `E` takes.
1086
+ *
1087
+ * @public
1088
+ */
1089
+ type EventDecision<E extends ClaudeHookEvent> = Extract<Decision, {
1090
+ readonly _tag: AllowedTag<E>;
1091
+ }>;
1092
+ /**
1093
+ * Claude Code's matcher rules: empty or `*` matches everything; a matcher of
1094
+ * only `[A-Za-z0-9_| ,-]` is an exact list split on `|` or `,`, spaces around an
1095
+ * item ignored; anything else is an unanchored regular expression. A pattern
1096
+ * that does not compile matches, so a hook never skips over it.
1097
+ *
1098
+ * @public
1099
+ */
1100
+ export declare const matcherApplies: (matcher: string, value: string) => boolean;
1101
+ /**
1102
+ * The version of `lib/pluginfinity/facts.json` this release writes and reads.
1103
+ * The build writes it as `schema`; a module hook bundled against another
1104
+ * release is refused at build time, so the number is a check, not a migration.
1105
+ *
1106
+ * @public
1107
+ */
1108
+ export declare const FACTS_SCHEMA_VERSION = 1;
1109
+ /**
1110
+ * What `lib/pluginfinity/facts.json` holds: what a program hook reads where a
1111
+ * script sources `tools.sh`, `host.sh` and `env.sh`. Every field is optional,
1112
+ * and a key this release does not know is ignored.
1113
+ *
1114
+ * @public
1115
+ */
1116
+ export declare const Facts: Schema.Struct<{
1117
+ readonly schema: Schema.optionalKey<Schema.Number>;
1118
+ readonly host: Schema.optionalKey<Schema.String>;
1119
+ readonly plugin: Schema.optionalKey<Schema.String>;
1120
+ readonly tools: Schema.optionalKey<Schema.Struct<{
1121
+ /** Claude Code tool name to the host's run-time name. */
1122
+ readonly names: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
1123
+ /** The plugin's name on Claude Code, which own MCP tools are written under. */
1124
+ readonly plugin: Schema.optionalKey<Schema.String>;
1125
+ /** The host's own MCP tool name, with `{plugin}`, `{server}` and `{tool}`. */
1126
+ readonly mcp: Schema.optionalKey<Schema.String>;
1127
+ readonly servers: Schema.optionalKey<Schema.$Array<Schema.String>>;
1128
+ /** `keep` a name the table does not list, or treat it as having no name here. */
1129
+ readonly unlisted: Schema.optionalKey<Schema.String>;
1130
+ }>>;
1131
+ readonly has: Schema.optionalKey<Schema.Struct<{
1132
+ readonly skills: Schema.optionalKey<Schema.$Array<Schema.String>>;
1133
+ readonly agents: Schema.optionalKey<Schema.$Array<Schema.String>>;
1134
+ readonly monitors: Schema.optionalKey<Schema.$Array<Schema.String>>;
1135
+ readonly servers: Schema.optionalKey<Schema.$Array<Schema.String>>;
1136
+ }>>;
1137
+ readonly env: Schema.optionalKey<Schema.Struct<{
1138
+ /** Declared session variable to its default. */
1139
+ readonly vars: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
1140
+ }>>;
1141
+ }>;
1142
+ /**
1143
+ * The decoded `Facts`.
1144
+ *
1145
+ * @public
1146
+ */
1147
+ export type Facts = typeof Facts.Type;
1148
+ /**
1149
+ * Read the text of a `facts.json`, or `undefined` when it is not one.
1150
+ *
1151
+ * @public
1152
+ */
1153
+ export declare const decodeFacts: (text: string) => Facts | undefined;
1154
+ /**
1155
+ * A component kind `has` answers for.
1156
+ *
1157
+ * @public
1158
+ */
1159
+ type ComponentKind = "skill" | "agent" | "monitor" | "server";
1160
+ /**
1161
+ * The host's run-time name for a Claude Code tool, or none when the host has
1162
+ * none. An own MCP tool is written `mcp__plugin_<plugin>_<server>__<tool>`, as
1163
+ * Claude Code names it. It mirrors `hook_tool_name` and the Zig `toolName`.
1164
+ *
1165
+ * @public
1166
+ */
1167
+ export declare const factsToolName: (facts: Facts, name: string) => Option.Option<string>;
1168
+ /**
1169
+ * The run-time prefix of one of the plugin's own MCP servers, or none for a
1170
+ * server the plugin does not declare.
1171
+ *
1172
+ * @public
1173
+ */
1174
+ export declare const factsToolPrefix: (facts: Facts, server: string) => Option.Option<string>;
1175
+ /**
1176
+ * Whether the build ships a component on this host.
1177
+ *
1178
+ * @public
1179
+ */
1180
+ export declare const factsHas: (facts: Facts, kind: ComponentKind, name: string) => boolean;
1181
+ /**
1182
+ * What `encodeDecision` needs to know about the call it answers.
1183
+ *
1184
+ * @public
1185
+ */
1186
+ interface WireContext {
1187
+ readonly host: HookHost;
1188
+ /** The Claude event name. */
1189
+ readonly event: string;
1190
+ /** The plugin's name on this host, used in default reasons. */
1191
+ readonly plugin?: string;
1192
+ /** Whether the entry sets `asyncRewake`, the one case a hook may exit 2. */
1193
+ readonly asyncRewake?: boolean;
1194
+ }
1195
+ /**
1196
+ * A decision as the host reads it: the stdout to print, the stderr, the exit
1197
+ * code, and a line for the debug or error log when the decision lost something.
1198
+ *
1199
+ * @public
1200
+ */
1201
+ interface Encoded {
1202
+ readonly stdout: string;
1203
+ readonly stderr: string;
1204
+ readonly exitCode: 0 | 2;
1205
+ readonly debug?: string;
1206
+ readonly log?: string;
1207
+ }
1208
+ /**
1209
+ * Write a decision in the host's wire format, the same bytes the bash hook
1210
+ * library prints for the matching helper. A decision the host does not honour
1211
+ * on the event answers `{}` with a debug line.
1212
+ *
1213
+ * @public
1214
+ */
1215
+ export declare const encodeDecision: (context: WireContext, decision: Decision) => Encoded;
1216
+ /**
1217
+ * The answer of an entry that fails closed when its hook failed before
1218
+ * answering: a deny where the event takes one, else a block, else nothing.
1219
+ * As in the bash library, a Stop or SubagentStop hook sends nothing while
1220
+ * `stop_hook_active` is true (a block would loop), and TaskCompleted and
1221
+ * TeammateIdle send nothing (a block sends a teammate back to a hook that will
1222
+ * not run).
1223
+ *
1224
+ * @public
1225
+ */
1226
+ export declare const closedResponse: (context: WireContext, input: unknown, code: number) => Encoded | undefined;
1227
+ /**
1228
+ * A generated JSON Schema file: its name and its text.
1229
+ *
1230
+ * @public
1231
+ */
1232
+ export interface HookSchemaFile {
1233
+ readonly name: string;
1234
+ readonly content: string;
1235
+ }
1236
+ /**
1237
+ * The JSON Schema documents for every Claude Code hook event, one for its
1238
+ * input and one for its output, and one for each built-in tool's
1239
+ * `tool_input`. The text is deterministic, so a regeneration that changes
1240
+ * nothing writes the same bytes.
1241
+ *
1242
+ * @public
1243
+ */
1244
+ export declare const hookSchemaFiles: () => ReadonlyArray<HookSchemaFile>;
1245
+ export type { AllowedTag, ComponentKind, Decision, DecisionTag, Encoded, EventDecision, HookHost, HookIo, WireContext };
1246
+ //# sourceMappingURL=contract.d.ts.map