@r_masseater/cc-effect-hooks 0.0.0-stage → 0.2.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/LICENSE +87 -0
- package/README.md +68 -2
- package/dist/index.d.mts +1217 -0
- package/dist/index.mjs +823 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +61 -3
- package/skills/write-plugin-hooks/SKILL.md +45 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,1217 @@
|
|
|
1
|
+
import { Platform, blockHook } from "@r_masseater/masseater-utils/plugin-kit";
|
|
2
|
+
import { Effect, Layer, Schema } from "effect";
|
|
3
|
+
import { AgentInput, ArtifactInput, AskUserQuestionInput, BashInput, ClaudeDesignInput, CronCreateInput, CronDeleteInput, CronListInput, EnterPlanModeInput, EnterWorktreeInput, ExitPlanModeInput, ExitWorktreeInput, FileEditInput, FileReadInput, FileWriteInput, GlobInput, GrepInput, ListMcpResourcesInput, MonitorInput, NotebookEditInput, OfferChromeSetupInput, ProjectsInput, ProposeSkillsInput, PushNotificationInput, ReadMcpResourceDirInput, ReadMcpResourceInput, ReadNotificationsInput, RemoteTriggerInput, ReportFindingsInput, ScheduleWakeupInput, SendFeedbackInput, ShowOnboardingRolePickerInput, TaskCreateInput, TaskGetInput, TaskListInput, TaskStopInput, TaskUpdateInput, TodoWriteInput, WebFetchInput, WebSearchInput, WorkflowInput } from "@anthropic-ai/claude-agent-sdk/sdk-tools";
|
|
4
|
+
declare const baseFields: {
|
|
5
|
+
session_id: Schema.String;
|
|
6
|
+
transcript_path: Schema.String;
|
|
7
|
+
cwd: Schema.String;
|
|
8
|
+
prompt_id: Schema.optionalKey<Schema.String>;
|
|
9
|
+
permission_mode: Schema.optionalKey<Schema.String>;
|
|
10
|
+
agent_id: Schema.optionalKey<Schema.String>;
|
|
11
|
+
agent_type: Schema.optionalKey<Schema.String>;
|
|
12
|
+
effort: Schema.optionalKey<Schema.Struct<{
|
|
13
|
+
readonly level: Schema.String;
|
|
14
|
+
}>>;
|
|
15
|
+
};
|
|
16
|
+
type BaseFields = typeof baseFields;
|
|
17
|
+
export declare const PermissionUpdate: Schema.Union<readonly [Schema.Struct<{
|
|
18
|
+
readonly rules: Schema.$Array<Schema.Struct<{
|
|
19
|
+
readonly toolName: Schema.String;
|
|
20
|
+
readonly ruleContent: Schema.optionalKey<Schema.String>;
|
|
21
|
+
}>>;
|
|
22
|
+
readonly behavior: Schema.Literals<readonly ["allow", "deny", "ask"]>;
|
|
23
|
+
readonly destination: Schema.Literals<readonly ["userSettings", "projectSettings", "localSettings", "session", "cliArg"]>;
|
|
24
|
+
readonly type: Schema.Literal<"addRules">;
|
|
25
|
+
}>, Schema.Struct<{
|
|
26
|
+
readonly rules: Schema.$Array<Schema.Struct<{
|
|
27
|
+
readonly toolName: Schema.String;
|
|
28
|
+
readonly ruleContent: Schema.optionalKey<Schema.String>;
|
|
29
|
+
}>>;
|
|
30
|
+
readonly behavior: Schema.Literals<readonly ["allow", "deny", "ask"]>;
|
|
31
|
+
readonly destination: Schema.Literals<readonly ["userSettings", "projectSettings", "localSettings", "session", "cliArg"]>;
|
|
32
|
+
readonly type: Schema.Literal<"replaceRules">;
|
|
33
|
+
}>, Schema.Struct<{
|
|
34
|
+
readonly rules: Schema.$Array<Schema.Struct<{
|
|
35
|
+
readonly toolName: Schema.String;
|
|
36
|
+
readonly ruleContent: Schema.optionalKey<Schema.String>;
|
|
37
|
+
}>>;
|
|
38
|
+
readonly behavior: Schema.Literals<readonly ["allow", "deny", "ask"]>;
|
|
39
|
+
readonly destination: Schema.Literals<readonly ["userSettings", "projectSettings", "localSettings", "session", "cliArg"]>;
|
|
40
|
+
readonly type: Schema.Literal<"removeRules">;
|
|
41
|
+
}>, Schema.Struct<{
|
|
42
|
+
readonly type: Schema.Literal<"setMode">;
|
|
43
|
+
readonly mode: Schema.Literals<readonly ["default", "acceptEdits", "bypassPermissions", "plan", "dontAsk", "auto"]>;
|
|
44
|
+
readonly destination: Schema.Literals<readonly ["userSettings", "projectSettings", "localSettings", "session", "cliArg"]>;
|
|
45
|
+
}>, Schema.Struct<{
|
|
46
|
+
readonly directories: Schema.$Array<Schema.String>;
|
|
47
|
+
readonly destination: Schema.Literals<readonly ["userSettings", "projectSettings", "localSettings", "session", "cliArg"]>;
|
|
48
|
+
readonly type: Schema.Literal<"addDirectories">;
|
|
49
|
+
}>, Schema.Struct<{
|
|
50
|
+
readonly directories: Schema.$Array<Schema.String>;
|
|
51
|
+
readonly destination: Schema.Literals<readonly ["userSettings", "projectSettings", "localSettings", "session", "cliArg"]>;
|
|
52
|
+
readonly type: Schema.Literal<"removeDirectories">;
|
|
53
|
+
}>]>;
|
|
54
|
+
type EventFields<Name extends string, Fields extends Schema.Struct.Fields> = BaseFields & {
|
|
55
|
+
readonly hook_event_name: Schema.Literal<Name>;
|
|
56
|
+
} & Fields;
|
|
57
|
+
export declare const HookInputs: {
|
|
58
|
+
PreToolUse: Schema.Struct<EventFields<"PreToolUse", {
|
|
59
|
+
tool_name: Schema.String;
|
|
60
|
+
tool_input: Schema.Unknown;
|
|
61
|
+
tool_use_id: Schema.String;
|
|
62
|
+
mcp_server: Schema.optionalKey<Schema.Struct<{
|
|
63
|
+
readonly name: Schema.String;
|
|
64
|
+
readonly source: Schema.String;
|
|
65
|
+
}>>;
|
|
66
|
+
}>>;
|
|
67
|
+
PostToolUse: Schema.Struct<EventFields<"PostToolUse", {
|
|
68
|
+
tool_name: Schema.String;
|
|
69
|
+
tool_input: Schema.Unknown;
|
|
70
|
+
tool_use_id: Schema.String;
|
|
71
|
+
mcp_server: Schema.optionalKey<Schema.Struct<{
|
|
72
|
+
readonly name: Schema.String;
|
|
73
|
+
readonly source: Schema.String;
|
|
74
|
+
}>>;
|
|
75
|
+
tool_response: Schema.Unknown;
|
|
76
|
+
duration_ms: Schema.optionalKey<Schema.Finite>;
|
|
77
|
+
}>>;
|
|
78
|
+
PostToolUseFailure: Schema.Struct<EventFields<"PostToolUseFailure", {
|
|
79
|
+
tool_name: Schema.String;
|
|
80
|
+
tool_input: Schema.Unknown;
|
|
81
|
+
tool_use_id: Schema.String;
|
|
82
|
+
mcp_server: Schema.optionalKey<Schema.Struct<{
|
|
83
|
+
readonly name: Schema.String;
|
|
84
|
+
readonly source: Schema.String;
|
|
85
|
+
}>>;
|
|
86
|
+
error: Schema.String;
|
|
87
|
+
is_interrupt: Schema.optionalKey<Schema.Boolean>;
|
|
88
|
+
duration_ms: Schema.optionalKey<Schema.Finite>;
|
|
89
|
+
}>>;
|
|
90
|
+
PostToolBatch: Schema.Struct<EventFields<"PostToolBatch", {
|
|
91
|
+
tool_calls: Schema.$Array<Schema.Struct<{
|
|
92
|
+
readonly tool_name: Schema.String;
|
|
93
|
+
readonly tool_input: Schema.Unknown;
|
|
94
|
+
readonly tool_use_id: Schema.String;
|
|
95
|
+
readonly tool_response: Schema.optionalKey<Schema.Unknown>;
|
|
96
|
+
}>>;
|
|
97
|
+
}>>;
|
|
98
|
+
Notification: Schema.Struct<EventFields<"Notification", {
|
|
99
|
+
message: Schema.String;
|
|
100
|
+
title: Schema.optionalKey<Schema.String>;
|
|
101
|
+
notification_type: Schema.String;
|
|
102
|
+
}>>;
|
|
103
|
+
UserPromptSubmit: Schema.Struct<EventFields<"UserPromptSubmit", {
|
|
104
|
+
prompt: Schema.String;
|
|
105
|
+
source: Schema.optionalKey<Schema.Literals<readonly ["user", "sdk", "system", "loop_wakeup", "schedule_wakeup", "poll_event"]>>;
|
|
106
|
+
session_title: Schema.optionalKey<Schema.String>;
|
|
107
|
+
}>>;
|
|
108
|
+
UserPromptExpansion: Schema.Struct<EventFields<"UserPromptExpansion", {
|
|
109
|
+
expansion_type: Schema.Literals<readonly ["slash_command", "mcp_prompt"]>;
|
|
110
|
+
command_name: Schema.String;
|
|
111
|
+
command_args: Schema.String;
|
|
112
|
+
command_source: Schema.optionalKey<Schema.String>;
|
|
113
|
+
prompt: Schema.String;
|
|
114
|
+
}>>;
|
|
115
|
+
SessionStart: Schema.Struct<EventFields<"SessionStart", {
|
|
116
|
+
source: Schema.Literals<readonly ["startup", "resume", "clear", "compact", "fork"]>;
|
|
117
|
+
model: Schema.optionalKey<Schema.String>;
|
|
118
|
+
session_title: Schema.optionalKey<Schema.String>;
|
|
119
|
+
seconds_since_last_response: Schema.optionalKey<Schema.Finite>;
|
|
120
|
+
context_tokens: Schema.optionalKey<Schema.Finite>;
|
|
121
|
+
prompt_cache_likely_expired: Schema.optionalKey<Schema.Boolean>;
|
|
122
|
+
estimated_cache_write_usd: Schema.optionalKey<Schema.Finite>;
|
|
123
|
+
}>>;
|
|
124
|
+
SessionEnd: Schema.Struct<EventFields<"SessionEnd", {
|
|
125
|
+
reason: Schema.Literals<readonly ["clear", "resume", "logout", "prompt_input_exit", "other"]>;
|
|
126
|
+
}>>;
|
|
127
|
+
Stop: Schema.Struct<EventFields<"Stop", {
|
|
128
|
+
stop_hook_active: Schema.Boolean;
|
|
129
|
+
last_assistant_message: Schema.optionalKey<Schema.String>;
|
|
130
|
+
background_tasks: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
131
|
+
readonly id: Schema.String;
|
|
132
|
+
readonly type: Schema.String;
|
|
133
|
+
readonly status: Schema.String;
|
|
134
|
+
readonly description: Schema.String;
|
|
135
|
+
readonly command: Schema.optionalKey<Schema.String>;
|
|
136
|
+
readonly agent_type: Schema.optionalKey<Schema.String>;
|
|
137
|
+
readonly server: Schema.optionalKey<Schema.String>;
|
|
138
|
+
readonly tool: Schema.optionalKey<Schema.String>;
|
|
139
|
+
readonly name: Schema.optionalKey<Schema.String>;
|
|
140
|
+
}>>>;
|
|
141
|
+
session_crons: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
142
|
+
readonly id: Schema.String;
|
|
143
|
+
readonly schedule: Schema.String;
|
|
144
|
+
readonly recurring: Schema.Boolean;
|
|
145
|
+
readonly prompt: Schema.String;
|
|
146
|
+
}>>>;
|
|
147
|
+
}>>;
|
|
148
|
+
StopFailure: Schema.Struct<EventFields<"StopFailure", {
|
|
149
|
+
error: Schema.Literals<readonly ["authentication_failed", "oauth_org_not_allowed", "account_on_hold", "verification_required", "billing_error", "rate_limit", "overloaded", "invalid_request", "model_not_found", "server_error", "unknown", "max_output_tokens", "cloud_credential_error"]>;
|
|
150
|
+
error_details: Schema.optionalKey<Schema.String>;
|
|
151
|
+
last_assistant_message: Schema.optionalKey<Schema.String>;
|
|
152
|
+
}>>;
|
|
153
|
+
SubagentStart: Schema.Struct<{
|
|
154
|
+
readonly session_id: Schema.String;
|
|
155
|
+
readonly transcript_path: Schema.String;
|
|
156
|
+
readonly cwd: Schema.String;
|
|
157
|
+
readonly prompt_id: Schema.optionalKey<Schema.String>;
|
|
158
|
+
readonly permission_mode: Schema.optionalKey<Schema.String>;
|
|
159
|
+
readonly effort: Schema.optionalKey<Schema.Struct<{
|
|
160
|
+
readonly level: Schema.String;
|
|
161
|
+
}>>;
|
|
162
|
+
readonly agent_id: Schema.String;
|
|
163
|
+
readonly agent_type: Schema.String;
|
|
164
|
+
readonly hook_event_name: Schema.Literal<"SubagentStart">;
|
|
165
|
+
}>;
|
|
166
|
+
SubagentStop: Schema.Struct<{
|
|
167
|
+
readonly session_id: Schema.String;
|
|
168
|
+
readonly transcript_path: Schema.String;
|
|
169
|
+
readonly cwd: Schema.String;
|
|
170
|
+
readonly prompt_id: Schema.optionalKey<Schema.String>;
|
|
171
|
+
readonly permission_mode: Schema.optionalKey<Schema.String>;
|
|
172
|
+
readonly effort: Schema.optionalKey<Schema.Struct<{
|
|
173
|
+
readonly level: Schema.String;
|
|
174
|
+
}>>;
|
|
175
|
+
readonly stop_hook_active: Schema.Boolean;
|
|
176
|
+
readonly last_assistant_message: Schema.optionalKey<Schema.String>;
|
|
177
|
+
readonly background_tasks: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
178
|
+
readonly id: Schema.String;
|
|
179
|
+
readonly type: Schema.String;
|
|
180
|
+
readonly status: Schema.String;
|
|
181
|
+
readonly description: Schema.String;
|
|
182
|
+
readonly command: Schema.optionalKey<Schema.String>;
|
|
183
|
+
readonly agent_type: Schema.optionalKey<Schema.String>;
|
|
184
|
+
readonly server: Schema.optionalKey<Schema.String>;
|
|
185
|
+
readonly tool: Schema.optionalKey<Schema.String>;
|
|
186
|
+
readonly name: Schema.optionalKey<Schema.String>;
|
|
187
|
+
}>>>;
|
|
188
|
+
readonly session_crons: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
189
|
+
readonly id: Schema.String;
|
|
190
|
+
readonly schedule: Schema.String;
|
|
191
|
+
readonly recurring: Schema.Boolean;
|
|
192
|
+
readonly prompt: Schema.String;
|
|
193
|
+
}>>>;
|
|
194
|
+
readonly agent_id: Schema.String;
|
|
195
|
+
readonly agent_type: Schema.String;
|
|
196
|
+
readonly hook_event_name: Schema.Literal<"SubagentStop">;
|
|
197
|
+
readonly agent_transcript_path: Schema.String;
|
|
198
|
+
}>;
|
|
199
|
+
PreCompact: Schema.Struct<EventFields<"PreCompact", {
|
|
200
|
+
trigger: Schema.Literals<readonly ["manual", "auto"]>;
|
|
201
|
+
custom_instructions: Schema.NullOr<Schema.String>;
|
|
202
|
+
}>>;
|
|
203
|
+
PostCompact: Schema.Struct<EventFields<"PostCompact", {
|
|
204
|
+
trigger: Schema.Literals<readonly ["manual", "auto"]>;
|
|
205
|
+
compact_summary: Schema.String;
|
|
206
|
+
}>>;
|
|
207
|
+
PreModelSwitch: Schema.Struct<EventFields<"PreModelSwitch", {
|
|
208
|
+
from_model: Schema.String;
|
|
209
|
+
to_model: Schema.String;
|
|
210
|
+
requested_model: Schema.NullOr<Schema.String>;
|
|
211
|
+
context_tokens: Schema.Finite;
|
|
212
|
+
prompt_cache_warm: Schema.Boolean;
|
|
213
|
+
cache_ttl: Schema.Literals<readonly ["5m", "1h"]>;
|
|
214
|
+
estimated_cache_write_usd: Schema.Finite;
|
|
215
|
+
pricing: Schema.Literals<readonly ["configured", "catalog", "default"]>;
|
|
216
|
+
source: Schema.Literals<readonly ["command", "picker", "sdk"]>;
|
|
217
|
+
}>>;
|
|
218
|
+
PostModelSwitch: Schema.Struct<EventFields<"PostModelSwitch", {
|
|
219
|
+
from_model: Schema.String;
|
|
220
|
+
to_model: Schema.String;
|
|
221
|
+
requested_model: Schema.NullOr<Schema.String>;
|
|
222
|
+
context_tokens: Schema.Finite;
|
|
223
|
+
prompt_cache_warm: Schema.Boolean;
|
|
224
|
+
cache_ttl: Schema.Literals<readonly ["5m", "1h"]>;
|
|
225
|
+
estimated_cache_write_usd: Schema.Finite;
|
|
226
|
+
pricing: Schema.Literals<readonly ["configured", "catalog", "default"]>;
|
|
227
|
+
source: Schema.Literals<readonly ["command", "picker", "sdk", "auto", "resume"]>;
|
|
228
|
+
}>>;
|
|
229
|
+
PermissionRequest: Schema.Struct<EventFields<"PermissionRequest", {
|
|
230
|
+
tool_name: Schema.String;
|
|
231
|
+
tool_input: Schema.Unknown;
|
|
232
|
+
permission_suggestions: Schema.optionalKey<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
233
|
+
readonly rules: Schema.$Array<Schema.Struct<{
|
|
234
|
+
readonly toolName: Schema.String;
|
|
235
|
+
readonly ruleContent: Schema.optionalKey<Schema.String>;
|
|
236
|
+
}>>;
|
|
237
|
+
readonly behavior: Schema.Literals<readonly ["allow", "deny", "ask"]>;
|
|
238
|
+
readonly destination: Schema.Literals<readonly ["userSettings", "projectSettings", "localSettings", "session", "cliArg"]>;
|
|
239
|
+
readonly type: Schema.Literal<"addRules">;
|
|
240
|
+
}>, Schema.Struct<{
|
|
241
|
+
readonly rules: Schema.$Array<Schema.Struct<{
|
|
242
|
+
readonly toolName: Schema.String;
|
|
243
|
+
readonly ruleContent: Schema.optionalKey<Schema.String>;
|
|
244
|
+
}>>;
|
|
245
|
+
readonly behavior: Schema.Literals<readonly ["allow", "deny", "ask"]>;
|
|
246
|
+
readonly destination: Schema.Literals<readonly ["userSettings", "projectSettings", "localSettings", "session", "cliArg"]>;
|
|
247
|
+
readonly type: Schema.Literal<"replaceRules">;
|
|
248
|
+
}>, Schema.Struct<{
|
|
249
|
+
readonly rules: Schema.$Array<Schema.Struct<{
|
|
250
|
+
readonly toolName: Schema.String;
|
|
251
|
+
readonly ruleContent: Schema.optionalKey<Schema.String>;
|
|
252
|
+
}>>;
|
|
253
|
+
readonly behavior: Schema.Literals<readonly ["allow", "deny", "ask"]>;
|
|
254
|
+
readonly destination: Schema.Literals<readonly ["userSettings", "projectSettings", "localSettings", "session", "cliArg"]>;
|
|
255
|
+
readonly type: Schema.Literal<"removeRules">;
|
|
256
|
+
}>, Schema.Struct<{
|
|
257
|
+
readonly type: Schema.Literal<"setMode">;
|
|
258
|
+
readonly mode: Schema.Literals<readonly ["default", "acceptEdits", "bypassPermissions", "plan", "dontAsk", "auto"]>;
|
|
259
|
+
readonly destination: Schema.Literals<readonly ["userSettings", "projectSettings", "localSettings", "session", "cliArg"]>;
|
|
260
|
+
}>, Schema.Struct<{
|
|
261
|
+
readonly directories: Schema.$Array<Schema.String>;
|
|
262
|
+
readonly destination: Schema.Literals<readonly ["userSettings", "projectSettings", "localSettings", "session", "cliArg"]>;
|
|
263
|
+
readonly type: Schema.Literal<"addDirectories">;
|
|
264
|
+
}>, Schema.Struct<{
|
|
265
|
+
readonly directories: Schema.$Array<Schema.String>;
|
|
266
|
+
readonly destination: Schema.Literals<readonly ["userSettings", "projectSettings", "localSettings", "session", "cliArg"]>;
|
|
267
|
+
readonly type: Schema.Literal<"removeDirectories">;
|
|
268
|
+
}>]>>>;
|
|
269
|
+
mcp_server: Schema.optionalKey<Schema.Struct<{
|
|
270
|
+
readonly name: Schema.String;
|
|
271
|
+
readonly source: Schema.String;
|
|
272
|
+
}>>;
|
|
273
|
+
}>>;
|
|
274
|
+
PermissionDenied: Schema.Struct<EventFields<"PermissionDenied", {
|
|
275
|
+
tool_name: Schema.String;
|
|
276
|
+
tool_input: Schema.Unknown;
|
|
277
|
+
tool_use_id: Schema.String;
|
|
278
|
+
mcp_server: Schema.optionalKey<Schema.Struct<{
|
|
279
|
+
readonly name: Schema.String;
|
|
280
|
+
readonly source: Schema.String;
|
|
281
|
+
}>>;
|
|
282
|
+
reason: Schema.String;
|
|
283
|
+
}>>;
|
|
284
|
+
Setup: Schema.Struct<EventFields<"Setup", {
|
|
285
|
+
trigger: Schema.Literals<readonly ["init", "maintenance"]>;
|
|
286
|
+
}>>;
|
|
287
|
+
TeammateIdle: Schema.Struct<EventFields<"TeammateIdle", {
|
|
288
|
+
teammate_name: Schema.String;
|
|
289
|
+
team_name: Schema.String;
|
|
290
|
+
}>>;
|
|
291
|
+
TaskCreated: Schema.Struct<EventFields<"TaskCreated", {
|
|
292
|
+
task_id: Schema.String;
|
|
293
|
+
task_subject: Schema.String;
|
|
294
|
+
task_description: Schema.optionalKey<Schema.String>;
|
|
295
|
+
teammate_name: Schema.optionalKey<Schema.String>;
|
|
296
|
+
team_name: Schema.optionalKey<Schema.String>;
|
|
297
|
+
}>>;
|
|
298
|
+
TaskCompleted: Schema.Struct<EventFields<"TaskCompleted", {
|
|
299
|
+
task_id: Schema.String;
|
|
300
|
+
task_subject: Schema.String;
|
|
301
|
+
task_description: Schema.optionalKey<Schema.String>;
|
|
302
|
+
teammate_name: Schema.optionalKey<Schema.String>;
|
|
303
|
+
team_name: Schema.optionalKey<Schema.String>;
|
|
304
|
+
}>>;
|
|
305
|
+
Elicitation: Schema.Struct<EventFields<"Elicitation", {
|
|
306
|
+
mcp_server_name: Schema.String;
|
|
307
|
+
message: Schema.String;
|
|
308
|
+
mode: Schema.optionalKey<Schema.Literals<readonly ["form", "url"]>>;
|
|
309
|
+
url: Schema.optionalKey<Schema.String>;
|
|
310
|
+
elicitation_id: Schema.optionalKey<Schema.String>;
|
|
311
|
+
requested_schema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
312
|
+
}>>;
|
|
313
|
+
ElicitationResult: Schema.Struct<EventFields<"ElicitationResult", {
|
|
314
|
+
mcp_server_name: Schema.String;
|
|
315
|
+
elicitation_id: Schema.optionalKey<Schema.String>;
|
|
316
|
+
mode: Schema.optionalKey<Schema.Literals<readonly ["form", "url"]>>;
|
|
317
|
+
action: Schema.Literals<readonly ["accept", "decline", "cancel"]>;
|
|
318
|
+
content: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
319
|
+
}>>;
|
|
320
|
+
ConfigChange: Schema.Struct<EventFields<"ConfigChange", {
|
|
321
|
+
source: Schema.Literals<readonly ["user_settings", "project_settings", "local_settings", "policy_settings", "skills"]>;
|
|
322
|
+
file_path: Schema.optionalKey<Schema.String>;
|
|
323
|
+
}>>;
|
|
324
|
+
WorktreeCreate: Schema.Struct<EventFields<"WorktreeCreate", {
|
|
325
|
+
name: Schema.String;
|
|
326
|
+
}>>;
|
|
327
|
+
WorktreeRemove: Schema.Struct<EventFields<"WorktreeRemove", {
|
|
328
|
+
worktree_path: Schema.String;
|
|
329
|
+
}>>;
|
|
330
|
+
InstructionsLoaded: Schema.Struct<EventFields<"InstructionsLoaded", {
|
|
331
|
+
file_path: Schema.String;
|
|
332
|
+
memory_type: Schema.Literals<readonly ["User", "Project", "Local", "Managed"]>;
|
|
333
|
+
load_reason: Schema.Literals<readonly ["session_start", "nested_traversal", "path_glob_match", "include", "compact"]>;
|
|
334
|
+
globs: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
335
|
+
trigger_file_path: Schema.optionalKey<Schema.String>;
|
|
336
|
+
parent_file_path: Schema.optionalKey<Schema.String>;
|
|
337
|
+
}>>;
|
|
338
|
+
CwdChanged: Schema.Struct<EventFields<"CwdChanged", {
|
|
339
|
+
old_cwd: Schema.String;
|
|
340
|
+
new_cwd: Schema.String;
|
|
341
|
+
}>>;
|
|
342
|
+
FileChanged: Schema.Struct<EventFields<"FileChanged", {
|
|
343
|
+
file_path: Schema.String;
|
|
344
|
+
event: Schema.Literals<readonly ["change", "add", "unlink"]>;
|
|
345
|
+
}>>;
|
|
346
|
+
DirectoryAdded: Schema.Struct<EventFields<"DirectoryAdded", {
|
|
347
|
+
directory: Schema.String;
|
|
348
|
+
source: Schema.Literals<readonly ["slash_command", "register_repo_root"]>;
|
|
349
|
+
}>>;
|
|
350
|
+
MessageDisplay: Schema.Struct<EventFields<"MessageDisplay", {
|
|
351
|
+
turn_id: Schema.String;
|
|
352
|
+
message_id: Schema.String;
|
|
353
|
+
index: Schema.Finite;
|
|
354
|
+
final: Schema.Boolean;
|
|
355
|
+
delta: Schema.String;
|
|
356
|
+
}>>;
|
|
357
|
+
PreSkillShellCommand: Schema.Struct<EventFields<"PreSkillShellCommand", {
|
|
358
|
+
tool_name: Schema.String;
|
|
359
|
+
tool_input: Schema.Struct<{
|
|
360
|
+
readonly command: Schema.String;
|
|
361
|
+
}>;
|
|
362
|
+
tool_use_id: Schema.String;
|
|
363
|
+
command_name: Schema.String;
|
|
364
|
+
command_source: Schema.optionalKey<Schema.String>;
|
|
365
|
+
invoked_by: Schema.Literals<readonly ["user", "claude", "other"]>;
|
|
366
|
+
}>>;
|
|
367
|
+
};
|
|
368
|
+
type HookEvent = keyof typeof HookInputs;
|
|
369
|
+
type HookInput<Event extends HookEvent> = (typeof HookInputs)[Event]["Type"];
|
|
370
|
+
type ToolEvent = "PreToolUse" | "PostToolUse" | "PostToolUseFailure" | "PermissionRequest" | "PermissionDenied";
|
|
371
|
+
declare const HookSpecificOutputs: {
|
|
372
|
+
PreToolUse: Schema.Struct<{
|
|
373
|
+
readonly hookEventName: Schema.Literal<"PreToolUse">;
|
|
374
|
+
} & {
|
|
375
|
+
additionalContext: Schema.optionalKey<Schema.String>;
|
|
376
|
+
permissionDecision: Schema.optionalKey<Schema.Literals<readonly ["allow", "deny", "ask", "defer"]>>;
|
|
377
|
+
permissionDecisionReason: Schema.optionalKey<Schema.String>;
|
|
378
|
+
updatedInput: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
379
|
+
}>;
|
|
380
|
+
PostToolUse: Schema.Struct<{
|
|
381
|
+
readonly hookEventName: Schema.Literal<"PostToolUse">;
|
|
382
|
+
} & {
|
|
383
|
+
additionalContext: Schema.optionalKey<Schema.String>;
|
|
384
|
+
classifierContext: Schema.optionalKey<Schema.String>;
|
|
385
|
+
updatedToolOutput: Schema.optionalKey<Schema.Unknown>;
|
|
386
|
+
updatedMCPToolOutput: Schema.optionalKey<Schema.Unknown>;
|
|
387
|
+
}>;
|
|
388
|
+
PostToolUseFailure: Schema.Struct<{
|
|
389
|
+
readonly hookEventName: Schema.Literal<"PostToolUseFailure">;
|
|
390
|
+
} & {
|
|
391
|
+
additionalContext: Schema.optionalKey<Schema.String>;
|
|
392
|
+
}>;
|
|
393
|
+
PostToolBatch: Schema.Struct<{
|
|
394
|
+
readonly hookEventName: Schema.Literal<"PostToolBatch">;
|
|
395
|
+
} & {
|
|
396
|
+
additionalContext: Schema.optionalKey<Schema.String>;
|
|
397
|
+
}>;
|
|
398
|
+
Notification: Schema.Struct<{
|
|
399
|
+
readonly hookEventName: Schema.Literal<"Notification">;
|
|
400
|
+
} & {
|
|
401
|
+
additionalContext: Schema.optionalKey<Schema.String>;
|
|
402
|
+
}>;
|
|
403
|
+
UserPromptSubmit: Schema.Struct<{
|
|
404
|
+
readonly hookEventName: Schema.Literal<"UserPromptSubmit">;
|
|
405
|
+
} & {
|
|
406
|
+
additionalContext: Schema.optionalKey<Schema.String>;
|
|
407
|
+
sessionTitle: Schema.optionalKey<Schema.String>;
|
|
408
|
+
suppressOriginalPrompt: Schema.optionalKey<Schema.Boolean>;
|
|
409
|
+
}>;
|
|
410
|
+
UserPromptExpansion: Schema.Struct<{
|
|
411
|
+
readonly hookEventName: Schema.Literal<"UserPromptExpansion">;
|
|
412
|
+
} & {
|
|
413
|
+
additionalContext: Schema.optionalKey<Schema.String>;
|
|
414
|
+
suppressOriginalPrompt: Schema.optionalKey<Schema.Boolean>;
|
|
415
|
+
}>;
|
|
416
|
+
SessionStart: Schema.Struct<{
|
|
417
|
+
readonly hookEventName: Schema.Literal<"SessionStart">;
|
|
418
|
+
} & {
|
|
419
|
+
additionalContext: Schema.optionalKey<Schema.String>;
|
|
420
|
+
watchPaths: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
421
|
+
initialUserMessage: Schema.optionalKey<Schema.String>;
|
|
422
|
+
sessionTitle: Schema.optionalKey<Schema.String>;
|
|
423
|
+
reloadSkills: Schema.optionalKey<Schema.Boolean>;
|
|
424
|
+
}>;
|
|
425
|
+
Setup: Schema.Struct<{
|
|
426
|
+
readonly hookEventName: Schema.Literal<"Setup">;
|
|
427
|
+
} & {
|
|
428
|
+
additionalContext: Schema.optionalKey<Schema.String>;
|
|
429
|
+
}>;
|
|
430
|
+
Stop: Schema.Struct<{
|
|
431
|
+
readonly hookEventName: Schema.Literal<"Stop">;
|
|
432
|
+
} & {
|
|
433
|
+
additionalContext: Schema.optionalKey<Schema.String>;
|
|
434
|
+
}>;
|
|
435
|
+
SubagentStart: Schema.Struct<{
|
|
436
|
+
readonly hookEventName: Schema.Literal<"SubagentStart">;
|
|
437
|
+
} & {
|
|
438
|
+
additionalContext: Schema.optionalKey<Schema.String>;
|
|
439
|
+
}>;
|
|
440
|
+
SubagentStop: Schema.Struct<{
|
|
441
|
+
readonly hookEventName: Schema.Literal<"SubagentStop">;
|
|
442
|
+
} & {
|
|
443
|
+
additionalContext: Schema.optionalKey<Schema.String>;
|
|
444
|
+
}>;
|
|
445
|
+
PreModelSwitch: Schema.Struct<{
|
|
446
|
+
readonly hookEventName: Schema.Literal<"PreModelSwitch">;
|
|
447
|
+
} & {
|
|
448
|
+
permissionDecision: Schema.optionalKey<Schema.Literals<readonly ["allow", "deny", "ask"]>>;
|
|
449
|
+
permissionDecisionReason: Schema.optionalKey<Schema.String>;
|
|
450
|
+
}>;
|
|
451
|
+
PostModelSwitch: Schema.Struct<{
|
|
452
|
+
readonly hookEventName: Schema.Literal<"PostModelSwitch">;
|
|
453
|
+
} & {
|
|
454
|
+
additionalContext: Schema.optionalKey<Schema.String>;
|
|
455
|
+
}>;
|
|
456
|
+
PermissionRequest: Schema.Struct<{
|
|
457
|
+
readonly hookEventName: Schema.Literal<"PermissionRequest">;
|
|
458
|
+
} & {
|
|
459
|
+
decision: Schema.Union<readonly [Schema.Struct<{
|
|
460
|
+
readonly behavior: Schema.Literal<"allow">;
|
|
461
|
+
readonly updatedInput: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
462
|
+
readonly updatedPermissions: Schema.optionalKey<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
463
|
+
readonly rules: Schema.$Array<Schema.Struct<{
|
|
464
|
+
readonly toolName: Schema.String;
|
|
465
|
+
readonly ruleContent: Schema.optionalKey<Schema.String>;
|
|
466
|
+
}>>;
|
|
467
|
+
readonly behavior: Schema.Literals<readonly ["allow", "deny", "ask"]>;
|
|
468
|
+
readonly destination: Schema.Literals<readonly ["userSettings", "projectSettings", "localSettings", "session", "cliArg"]>;
|
|
469
|
+
readonly type: Schema.Literal<"addRules">;
|
|
470
|
+
}>, Schema.Struct<{
|
|
471
|
+
readonly rules: Schema.$Array<Schema.Struct<{
|
|
472
|
+
readonly toolName: Schema.String;
|
|
473
|
+
readonly ruleContent: Schema.optionalKey<Schema.String>;
|
|
474
|
+
}>>;
|
|
475
|
+
readonly behavior: Schema.Literals<readonly ["allow", "deny", "ask"]>;
|
|
476
|
+
readonly destination: Schema.Literals<readonly ["userSettings", "projectSettings", "localSettings", "session", "cliArg"]>;
|
|
477
|
+
readonly type: Schema.Literal<"replaceRules">;
|
|
478
|
+
}>, Schema.Struct<{
|
|
479
|
+
readonly rules: Schema.$Array<Schema.Struct<{
|
|
480
|
+
readonly toolName: Schema.String;
|
|
481
|
+
readonly ruleContent: Schema.optionalKey<Schema.String>;
|
|
482
|
+
}>>;
|
|
483
|
+
readonly behavior: Schema.Literals<readonly ["allow", "deny", "ask"]>;
|
|
484
|
+
readonly destination: Schema.Literals<readonly ["userSettings", "projectSettings", "localSettings", "session", "cliArg"]>;
|
|
485
|
+
readonly type: Schema.Literal<"removeRules">;
|
|
486
|
+
}>, Schema.Struct<{
|
|
487
|
+
readonly type: Schema.Literal<"setMode">;
|
|
488
|
+
readonly mode: Schema.Literals<readonly ["default", "acceptEdits", "bypassPermissions", "plan", "dontAsk", "auto"]>;
|
|
489
|
+
readonly destination: Schema.Literals<readonly ["userSettings", "projectSettings", "localSettings", "session", "cliArg"]>;
|
|
490
|
+
}>, Schema.Struct<{
|
|
491
|
+
readonly directories: Schema.$Array<Schema.String>;
|
|
492
|
+
readonly destination: Schema.Literals<readonly ["userSettings", "projectSettings", "localSettings", "session", "cliArg"]>;
|
|
493
|
+
readonly type: Schema.Literal<"addDirectories">;
|
|
494
|
+
}>, Schema.Struct<{
|
|
495
|
+
readonly directories: Schema.$Array<Schema.String>;
|
|
496
|
+
readonly destination: Schema.Literals<readonly ["userSettings", "projectSettings", "localSettings", "session", "cliArg"]>;
|
|
497
|
+
readonly type: Schema.Literal<"removeDirectories">;
|
|
498
|
+
}>]>>>;
|
|
499
|
+
}>, Schema.Struct<{
|
|
500
|
+
readonly behavior: Schema.Literal<"deny">;
|
|
501
|
+
readonly message: Schema.optionalKey<Schema.String>;
|
|
502
|
+
readonly interrupt: Schema.optionalKey<Schema.Boolean>;
|
|
503
|
+
}>]>;
|
|
504
|
+
}>;
|
|
505
|
+
PermissionDenied: Schema.Struct<{
|
|
506
|
+
readonly hookEventName: Schema.Literal<"PermissionDenied">;
|
|
507
|
+
} & {
|
|
508
|
+
retry: Schema.optionalKey<Schema.Boolean>;
|
|
509
|
+
}>;
|
|
510
|
+
Elicitation: Schema.Struct<{
|
|
511
|
+
readonly hookEventName: Schema.Literal<"Elicitation">;
|
|
512
|
+
} & {
|
|
513
|
+
action: Schema.optionalKey<Schema.Literals<readonly ["accept", "decline", "cancel"]>>;
|
|
514
|
+
content: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
515
|
+
}>;
|
|
516
|
+
ElicitationResult: Schema.Struct<{
|
|
517
|
+
readonly hookEventName: Schema.Literal<"ElicitationResult">;
|
|
518
|
+
} & {
|
|
519
|
+
action: Schema.optionalKey<Schema.Literals<readonly ["accept", "decline", "cancel"]>>;
|
|
520
|
+
content: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
521
|
+
}>;
|
|
522
|
+
CwdChanged: Schema.Struct<{
|
|
523
|
+
readonly hookEventName: Schema.Literal<"CwdChanged">;
|
|
524
|
+
} & {
|
|
525
|
+
watchPaths: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
526
|
+
}>;
|
|
527
|
+
FileChanged: Schema.Struct<{
|
|
528
|
+
readonly hookEventName: Schema.Literal<"FileChanged">;
|
|
529
|
+
} & {
|
|
530
|
+
watchPaths: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
531
|
+
}>;
|
|
532
|
+
WorktreeCreate: Schema.Struct<{
|
|
533
|
+
readonly hookEventName: Schema.Literal<"WorktreeCreate">;
|
|
534
|
+
} & {
|
|
535
|
+
worktreePath: Schema.String;
|
|
536
|
+
}>;
|
|
537
|
+
MessageDisplay: Schema.Struct<{
|
|
538
|
+
readonly hookEventName: Schema.Literal<"MessageDisplay">;
|
|
539
|
+
} & {
|
|
540
|
+
displayContent: Schema.optionalKey<Schema.String>;
|
|
541
|
+
}>;
|
|
542
|
+
PreSkillShellCommand: Schema.Struct<{
|
|
543
|
+
readonly hookEventName: Schema.Literal<"PreSkillShellCommand">;
|
|
544
|
+
} & {
|
|
545
|
+
permissionDecision: Schema.optionalKey<Schema.Literals<readonly ["allow", "deny", "ask", "defer"]>>;
|
|
546
|
+
permissionDecisionReason: Schema.optionalKey<Schema.String>;
|
|
547
|
+
updatedInput: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
548
|
+
}>;
|
|
549
|
+
};
|
|
550
|
+
type SpecificEvent = keyof typeof HookSpecificOutputs;
|
|
551
|
+
declare const commonFields: {
|
|
552
|
+
continue: Schema.optionalKey<Schema.Boolean>;
|
|
553
|
+
suppressOutput: Schema.optionalKey<Schema.Boolean>;
|
|
554
|
+
stopReason: Schema.optionalKey<Schema.String>;
|
|
555
|
+
decision: Schema.optionalKey<Schema.Literals<readonly ["approve", "block"]>>;
|
|
556
|
+
systemMessage: Schema.optionalKey<Schema.String>;
|
|
557
|
+
terminalSequence: Schema.optionalKey<Schema.String>;
|
|
558
|
+
reason: Schema.optionalKey<Schema.String>;
|
|
559
|
+
};
|
|
560
|
+
export declare const HookOutputSchema: Schema.Struct<{
|
|
561
|
+
readonly continue: Schema.optionalKey<Schema.Boolean>;
|
|
562
|
+
readonly suppressOutput: Schema.optionalKey<Schema.Boolean>;
|
|
563
|
+
readonly stopReason: Schema.optionalKey<Schema.String>;
|
|
564
|
+
readonly decision: Schema.optionalKey<Schema.Literals<readonly ["approve", "block"]>>;
|
|
565
|
+
readonly systemMessage: Schema.optionalKey<Schema.String>;
|
|
566
|
+
readonly terminalSequence: Schema.optionalKey<Schema.String>;
|
|
567
|
+
readonly reason: Schema.optionalKey<Schema.String>;
|
|
568
|
+
readonly hookSpecificOutput: Schema.optionalKey<Schema.Union<(Schema.Struct<{
|
|
569
|
+
readonly hookEventName: Schema.Literal<"CwdChanged">;
|
|
570
|
+
} & {
|
|
571
|
+
watchPaths: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
572
|
+
}> | Schema.Struct<{
|
|
573
|
+
readonly hookEventName: Schema.Literal<"Elicitation">;
|
|
574
|
+
} & {
|
|
575
|
+
action: Schema.optionalKey<Schema.Literals<readonly ["accept", "decline", "cancel"]>>;
|
|
576
|
+
content: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
577
|
+
}> | Schema.Struct<{
|
|
578
|
+
readonly hookEventName: Schema.Literal<"ElicitationResult">;
|
|
579
|
+
} & {
|
|
580
|
+
action: Schema.optionalKey<Schema.Literals<readonly ["accept", "decline", "cancel"]>>;
|
|
581
|
+
content: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
582
|
+
}> | Schema.Struct<{
|
|
583
|
+
readonly hookEventName: Schema.Literal<"FileChanged">;
|
|
584
|
+
} & {
|
|
585
|
+
watchPaths: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
586
|
+
}> | Schema.Struct<{
|
|
587
|
+
readonly hookEventName: Schema.Literal<"MessageDisplay">;
|
|
588
|
+
} & {
|
|
589
|
+
displayContent: Schema.optionalKey<Schema.String>;
|
|
590
|
+
}> | Schema.Struct<{
|
|
591
|
+
readonly hookEventName: Schema.Literal<"Notification">;
|
|
592
|
+
} & {
|
|
593
|
+
additionalContext: Schema.optionalKey<Schema.String>;
|
|
594
|
+
}> | Schema.Struct<{
|
|
595
|
+
readonly hookEventName: Schema.Literal<"PermissionDenied">;
|
|
596
|
+
} & {
|
|
597
|
+
retry: Schema.optionalKey<Schema.Boolean>;
|
|
598
|
+
}> | Schema.Struct<{
|
|
599
|
+
readonly hookEventName: Schema.Literal<"PermissionRequest">;
|
|
600
|
+
} & {
|
|
601
|
+
decision: Schema.Union<readonly [Schema.Struct<{
|
|
602
|
+
readonly behavior: Schema.Literal<"allow">;
|
|
603
|
+
readonly updatedInput: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
604
|
+
readonly updatedPermissions: Schema.optionalKey<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
605
|
+
readonly rules: Schema.$Array<Schema.Struct<{
|
|
606
|
+
readonly toolName: Schema.String;
|
|
607
|
+
readonly ruleContent: Schema.optionalKey<Schema.String>;
|
|
608
|
+
}>>;
|
|
609
|
+
readonly behavior: Schema.Literals<readonly ["allow", "deny", "ask"]>;
|
|
610
|
+
readonly destination: Schema.Literals<readonly ["userSettings", "projectSettings", "localSettings", "session", "cliArg"]>;
|
|
611
|
+
readonly type: Schema.Literal<"addRules">;
|
|
612
|
+
}>, Schema.Struct<{
|
|
613
|
+
readonly rules: Schema.$Array<Schema.Struct<{
|
|
614
|
+
readonly toolName: Schema.String;
|
|
615
|
+
readonly ruleContent: Schema.optionalKey<Schema.String>;
|
|
616
|
+
}>>;
|
|
617
|
+
readonly behavior: Schema.Literals<readonly ["allow", "deny", "ask"]>;
|
|
618
|
+
readonly destination: Schema.Literals<readonly ["userSettings", "projectSettings", "localSettings", "session", "cliArg"]>;
|
|
619
|
+
readonly type: Schema.Literal<"replaceRules">;
|
|
620
|
+
}>, Schema.Struct<{
|
|
621
|
+
readonly rules: Schema.$Array<Schema.Struct<{
|
|
622
|
+
readonly toolName: Schema.String;
|
|
623
|
+
readonly ruleContent: Schema.optionalKey<Schema.String>;
|
|
624
|
+
}>>;
|
|
625
|
+
readonly behavior: Schema.Literals<readonly ["allow", "deny", "ask"]>;
|
|
626
|
+
readonly destination: Schema.Literals<readonly ["userSettings", "projectSettings", "localSettings", "session", "cliArg"]>;
|
|
627
|
+
readonly type: Schema.Literal<"removeRules">;
|
|
628
|
+
}>, Schema.Struct<{
|
|
629
|
+
readonly type: Schema.Literal<"setMode">;
|
|
630
|
+
readonly mode: Schema.Literals<readonly ["default", "acceptEdits", "bypassPermissions", "plan", "dontAsk", "auto"]>;
|
|
631
|
+
readonly destination: Schema.Literals<readonly ["userSettings", "projectSettings", "localSettings", "session", "cliArg"]>;
|
|
632
|
+
}>, Schema.Struct<{
|
|
633
|
+
readonly directories: Schema.$Array<Schema.String>;
|
|
634
|
+
readonly destination: Schema.Literals<readonly ["userSettings", "projectSettings", "localSettings", "session", "cliArg"]>;
|
|
635
|
+
readonly type: Schema.Literal<"addDirectories">;
|
|
636
|
+
}>, Schema.Struct<{
|
|
637
|
+
readonly directories: Schema.$Array<Schema.String>;
|
|
638
|
+
readonly destination: Schema.Literals<readonly ["userSettings", "projectSettings", "localSettings", "session", "cliArg"]>;
|
|
639
|
+
readonly type: Schema.Literal<"removeDirectories">;
|
|
640
|
+
}>]>>>;
|
|
641
|
+
}>, Schema.Struct<{
|
|
642
|
+
readonly behavior: Schema.Literal<"deny">;
|
|
643
|
+
readonly message: Schema.optionalKey<Schema.String>;
|
|
644
|
+
readonly interrupt: Schema.optionalKey<Schema.Boolean>;
|
|
645
|
+
}>]>;
|
|
646
|
+
}> | Schema.Struct<{
|
|
647
|
+
readonly hookEventName: Schema.Literal<"PostModelSwitch">;
|
|
648
|
+
} & {
|
|
649
|
+
additionalContext: Schema.optionalKey<Schema.String>;
|
|
650
|
+
}> | Schema.Struct<{
|
|
651
|
+
readonly hookEventName: Schema.Literal<"PostToolBatch">;
|
|
652
|
+
} & {
|
|
653
|
+
additionalContext: Schema.optionalKey<Schema.String>;
|
|
654
|
+
}> | Schema.Struct<{
|
|
655
|
+
readonly hookEventName: Schema.Literal<"PostToolUse">;
|
|
656
|
+
} & {
|
|
657
|
+
additionalContext: Schema.optionalKey<Schema.String>;
|
|
658
|
+
classifierContext: Schema.optionalKey<Schema.String>;
|
|
659
|
+
updatedToolOutput: Schema.optionalKey<Schema.Unknown>;
|
|
660
|
+
updatedMCPToolOutput: Schema.optionalKey<Schema.Unknown>;
|
|
661
|
+
}> | Schema.Struct<{
|
|
662
|
+
readonly hookEventName: Schema.Literal<"PostToolUseFailure">;
|
|
663
|
+
} & {
|
|
664
|
+
additionalContext: Schema.optionalKey<Schema.String>;
|
|
665
|
+
}> | Schema.Struct<{
|
|
666
|
+
readonly hookEventName: Schema.Literal<"PreModelSwitch">;
|
|
667
|
+
} & {
|
|
668
|
+
permissionDecision: Schema.optionalKey<Schema.Literals<readonly ["allow", "deny", "ask"]>>;
|
|
669
|
+
permissionDecisionReason: Schema.optionalKey<Schema.String>;
|
|
670
|
+
}> | Schema.Struct<{
|
|
671
|
+
readonly hookEventName: Schema.Literal<"PreSkillShellCommand">;
|
|
672
|
+
} & {
|
|
673
|
+
permissionDecision: Schema.optionalKey<Schema.Literals<readonly ["allow", "deny", "ask", "defer"]>>;
|
|
674
|
+
permissionDecisionReason: Schema.optionalKey<Schema.String>;
|
|
675
|
+
updatedInput: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
676
|
+
}> | Schema.Struct<{
|
|
677
|
+
readonly hookEventName: Schema.Literal<"PreToolUse">;
|
|
678
|
+
} & {
|
|
679
|
+
additionalContext: Schema.optionalKey<Schema.String>;
|
|
680
|
+
permissionDecision: Schema.optionalKey<Schema.Literals<readonly ["allow", "deny", "ask", "defer"]>>;
|
|
681
|
+
permissionDecisionReason: Schema.optionalKey<Schema.String>;
|
|
682
|
+
updatedInput: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
683
|
+
}> | Schema.Struct<{
|
|
684
|
+
readonly hookEventName: Schema.Literal<"SessionStart">;
|
|
685
|
+
} & {
|
|
686
|
+
additionalContext: Schema.optionalKey<Schema.String>;
|
|
687
|
+
watchPaths: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
688
|
+
initialUserMessage: Schema.optionalKey<Schema.String>;
|
|
689
|
+
sessionTitle: Schema.optionalKey<Schema.String>;
|
|
690
|
+
reloadSkills: Schema.optionalKey<Schema.Boolean>;
|
|
691
|
+
}> | Schema.Struct<{
|
|
692
|
+
readonly hookEventName: Schema.Literal<"Setup">;
|
|
693
|
+
} & {
|
|
694
|
+
additionalContext: Schema.optionalKey<Schema.String>;
|
|
695
|
+
}> | Schema.Struct<{
|
|
696
|
+
readonly hookEventName: Schema.Literal<"Stop">;
|
|
697
|
+
} & {
|
|
698
|
+
additionalContext: Schema.optionalKey<Schema.String>;
|
|
699
|
+
}> | Schema.Struct<{
|
|
700
|
+
readonly hookEventName: Schema.Literal<"SubagentStart">;
|
|
701
|
+
} & {
|
|
702
|
+
additionalContext: Schema.optionalKey<Schema.String>;
|
|
703
|
+
}> | Schema.Struct<{
|
|
704
|
+
readonly hookEventName: Schema.Literal<"SubagentStop">;
|
|
705
|
+
} & {
|
|
706
|
+
additionalContext: Schema.optionalKey<Schema.String>;
|
|
707
|
+
}> | Schema.Struct<{
|
|
708
|
+
readonly hookEventName: Schema.Literal<"UserPromptExpansion">;
|
|
709
|
+
} & {
|
|
710
|
+
additionalContext: Schema.optionalKey<Schema.String>;
|
|
711
|
+
suppressOriginalPrompt: Schema.optionalKey<Schema.Boolean>;
|
|
712
|
+
}> | Schema.Struct<{
|
|
713
|
+
readonly hookEventName: Schema.Literal<"UserPromptSubmit">;
|
|
714
|
+
} & {
|
|
715
|
+
additionalContext: Schema.optionalKey<Schema.String>;
|
|
716
|
+
sessionTitle: Schema.optionalKey<Schema.String>;
|
|
717
|
+
suppressOriginalPrompt: Schema.optionalKey<Schema.Boolean>;
|
|
718
|
+
}> | Schema.Struct<{
|
|
719
|
+
readonly hookEventName: Schema.Literal<"WorktreeCreate">;
|
|
720
|
+
} & {
|
|
721
|
+
worktreePath: Schema.String;
|
|
722
|
+
}>)[]>>;
|
|
723
|
+
}>;
|
|
724
|
+
type CommonOutput = Schema.Struct<typeof commonFields>["Type"];
|
|
725
|
+
type AnySpecificOutput = (typeof HookSpecificOutputs)[SpecificEvent]["Type"];
|
|
726
|
+
type HookSpecificOutput<Event extends HookEvent> = Extract<AnySpecificOutput, {
|
|
727
|
+
readonly hookEventName: Event;
|
|
728
|
+
}>;
|
|
729
|
+
type HookOutput<Event extends HookEvent> = CommonOutput & {
|
|
730
|
+
readonly hookSpecificOutput?: HookSpecificOutput<Event>;
|
|
731
|
+
};
|
|
732
|
+
type ContextEvent = "PreToolUse" | "PostToolUse" | "PostToolUseFailure" | "PostToolBatch" | "Notification" | "UserPromptSubmit" | "UserPromptExpansion" | "SessionStart" | "Setup" | "Stop" | "SubagentStart" | "SubagentStop" | "PostModelSwitch";
|
|
733
|
+
type ContextAnswer<Event extends ContextEvent> = Readonly<{
|
|
734
|
+
hookSpecificOutput: Readonly<{
|
|
735
|
+
hookEventName: Event;
|
|
736
|
+
additionalContext: string;
|
|
737
|
+
}>;
|
|
738
|
+
}>;
|
|
739
|
+
export declare const allow: (reason: string) => HookOutput<"PreToolUse">;
|
|
740
|
+
export declare const deny: (reason: string) => HookOutput<"PreToolUse">;
|
|
741
|
+
export declare const addContext: <Event extends ContextEvent>(event: Event, text: string) => ContextAnswer<Event>;
|
|
742
|
+
interface ToolInputs {
|
|
743
|
+
Agent: AgentInput;
|
|
744
|
+
Artifact: ArtifactInput;
|
|
745
|
+
AskUserQuestion: AskUserQuestionInput;
|
|
746
|
+
Bash: BashInput;
|
|
747
|
+
ClaudeDesign: ClaudeDesignInput;
|
|
748
|
+
CronCreate: CronCreateInput;
|
|
749
|
+
CronDelete: CronDeleteInput;
|
|
750
|
+
CronList: CronListInput;
|
|
751
|
+
Edit: FileEditInput;
|
|
752
|
+
EnterPlanMode: EnterPlanModeInput;
|
|
753
|
+
EnterWorktree: EnterWorktreeInput;
|
|
754
|
+
ExitPlanMode: ExitPlanModeInput;
|
|
755
|
+
ExitWorktree: ExitWorktreeInput;
|
|
756
|
+
Glob: GlobInput;
|
|
757
|
+
Grep: GrepInput;
|
|
758
|
+
ListMcpResourcesTool: ListMcpResourcesInput;
|
|
759
|
+
Monitor: MonitorInput;
|
|
760
|
+
NotebookEdit: NotebookEditInput;
|
|
761
|
+
OfferChromeSetup: OfferChromeSetupInput;
|
|
762
|
+
Projects: ProjectsInput;
|
|
763
|
+
PushNotification: PushNotificationInput;
|
|
764
|
+
Read: FileReadInput;
|
|
765
|
+
ReadMcpResourceDirTool: ReadMcpResourceDirInput;
|
|
766
|
+
ReadMcpResourceTool: ReadMcpResourceInput;
|
|
767
|
+
ReadNotifications: ReadNotificationsInput;
|
|
768
|
+
RemoteTrigger: RemoteTriggerInput;
|
|
769
|
+
ReportFindings: ReportFindingsInput;
|
|
770
|
+
ScheduleWakeup: ScheduleWakeupInput;
|
|
771
|
+
SendFeedback: SendFeedbackInput;
|
|
772
|
+
ShowOnboardingRolePicker: ShowOnboardingRolePickerInput;
|
|
773
|
+
TaskCreate: TaskCreateInput;
|
|
774
|
+
TaskGet: TaskGetInput;
|
|
775
|
+
TaskList: TaskListInput;
|
|
776
|
+
TaskStop: TaskStopInput;
|
|
777
|
+
TaskUpdate: TaskUpdateInput;
|
|
778
|
+
TodoWrite: TodoWriteInput;
|
|
779
|
+
WebFetch: WebFetchInput;
|
|
780
|
+
WebSearch: WebSearchInput;
|
|
781
|
+
Workflow: WorkflowInput;
|
|
782
|
+
Write: FileWriteInput;
|
|
783
|
+
propose_skills: ProposeSkillsInput;
|
|
784
|
+
}
|
|
785
|
+
type ToolName = keyof ToolInputs | `mcp__${string}`;
|
|
786
|
+
type ToolInput<Name extends ToolName> = Name extends keyof ToolInputs ? ToolInputs[Name] : Readonly<Record<string, unknown>>;
|
|
787
|
+
type Trigger<Event extends HookEvent> = Readonly<{
|
|
788
|
+
timeout?: number;
|
|
789
|
+
}> & (Event extends ToolEvent ? Readonly<{
|
|
790
|
+
tools: readonly [ToolName, ...ToolName[]];
|
|
791
|
+
matcher?: never;
|
|
792
|
+
} | {
|
|
793
|
+
matcher?: string;
|
|
794
|
+
tools?: never;
|
|
795
|
+
}> : Readonly<{
|
|
796
|
+
matcher?: string;
|
|
797
|
+
tools?: never;
|
|
798
|
+
}>);
|
|
799
|
+
type Triggers = Readonly<{ [Event in HookEvent]?: Trigger<Event>; }>;
|
|
800
|
+
type Named<Event extends ToolEvent, Name extends ToolName> = Name extends ToolName ? Omit<HookInput<Event>, "tool_name" | "tool_input"> & Readonly<{
|
|
801
|
+
tool_name: Name;
|
|
802
|
+
tool_input: ToolInput<Name>;
|
|
803
|
+
}> : never;
|
|
804
|
+
type InputFor<Event extends HookEvent, Of> = Event extends ToolEvent ? Of extends Readonly<{
|
|
805
|
+
tools: readonly (infer Name extends ToolName)[];
|
|
806
|
+
}> ? Named<Event, Name> : HookInput<Event> : HookInput<Event>;
|
|
807
|
+
type EventsOf<On extends Triggers> = keyof On & HookEvent;
|
|
808
|
+
type InputOf<On extends Triggers> = { [Event in EventsOf<On>]: InputFor<Event, On[Event]>; }[EventsOf<On>];
|
|
809
|
+
type OutputOf<On extends Triggers> = HookOutput<EventsOf<On>>;
|
|
810
|
+
type Hook<On extends Triggers, Failure, Requirements> = Readonly<{
|
|
811
|
+
entry: string;
|
|
812
|
+
on: On;
|
|
813
|
+
timeout?: number;
|
|
814
|
+
node?: readonly string[];
|
|
815
|
+
run: (input: InputOf<On>) => Effect.Effect<OutputOf<On>, Failure, Requirements>;
|
|
816
|
+
}>;
|
|
817
|
+
type AnyHook = Readonly<{
|
|
818
|
+
entry: string;
|
|
819
|
+
on: Triggers;
|
|
820
|
+
timeout?: number;
|
|
821
|
+
node?: readonly string[];
|
|
822
|
+
}>;
|
|
823
|
+
export declare const defineHook: <const On extends Triggers, Failure = never, Requirements = never>(hook: Hook<On, Failure, Requirements>) => Hook<On, Failure, Requirements>;
|
|
824
|
+
declare const ToolNotListed_base: Schema.Class<ToolNotListed, Schema.TaggedStruct<"ToolNotListed", {
|
|
825
|
+
readonly event: Schema.String;
|
|
826
|
+
readonly tool: Schema.String;
|
|
827
|
+
}>, import("effect/Cause").YieldableError & {
|
|
828
|
+
readonly brand: unique symbol;
|
|
829
|
+
}>;
|
|
830
|
+
export declare class ToolNotListed extends ToolNotListed_base {}
|
|
831
|
+
/** @stability unstable */
|
|
832
|
+
export declare const runHook: <On extends Triggers, Failure>(hook: Hook<On, Failure, Platform>, serviceName: string) => void;
|
|
833
|
+
/** @stability unstable */
|
|
834
|
+
export declare const runHookWithServices: <On extends Triggers, Failure, Provided, LayerFailure>(hook: Hook<On, Failure, Platform | Provided>, options: Readonly<{
|
|
835
|
+
serviceName: string;
|
|
836
|
+
services: Layer.Layer<Provided, LayerFailure, Platform>;
|
|
837
|
+
}>) => void;
|
|
838
|
+
declare const UserConfigOptionSchema: Schema.Struct<{
|
|
839
|
+
readonly type: Schema.Literals<readonly ["string", "number", "boolean", "directory", "file"]>;
|
|
840
|
+
readonly title: Schema.String;
|
|
841
|
+
readonly description: Schema.String;
|
|
842
|
+
readonly required: Schema.optionalKey<Schema.Boolean>;
|
|
843
|
+
readonly default: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean, Schema.$Array<Schema.String>]>>;
|
|
844
|
+
readonly options: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
845
|
+
readonly multiple: Schema.optionalKey<Schema.Boolean>;
|
|
846
|
+
readonly sensitive: Schema.optionalKey<Schema.Boolean>;
|
|
847
|
+
readonly min: Schema.optionalKey<Schema.Finite>;
|
|
848
|
+
readonly max: Schema.optionalKey<Schema.Finite>;
|
|
849
|
+
}>;
|
|
850
|
+
type UserConfigOption = typeof UserConfigOptionSchema.Type;
|
|
851
|
+
export declare const ManifestFieldsSchema: Schema.Struct<{
|
|
852
|
+
author: Schema.optionalKey<Schema.Struct<{
|
|
853
|
+
readonly name: Schema.String;
|
|
854
|
+
readonly email: Schema.optionalKey<Schema.String>;
|
|
855
|
+
readonly url: Schema.optionalKey<Schema.String>;
|
|
856
|
+
}>>;
|
|
857
|
+
homepage: Schema.optionalKey<Schema.String>;
|
|
858
|
+
repository: Schema.optionalKey<Schema.String>;
|
|
859
|
+
license: Schema.optionalKey<Schema.String>;
|
|
860
|
+
keywords: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
861
|
+
types: Schema.optionalKey<Schema.String>;
|
|
862
|
+
userConfig: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
|
|
863
|
+
readonly type: Schema.Literals<readonly ["string", "number", "boolean", "directory", "file"]>;
|
|
864
|
+
readonly title: Schema.String;
|
|
865
|
+
readonly description: Schema.String;
|
|
866
|
+
readonly required: Schema.optionalKey<Schema.Boolean>;
|
|
867
|
+
readonly default: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean, Schema.$Array<Schema.String>]>>;
|
|
868
|
+
readonly options: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
869
|
+
readonly multiple: Schema.optionalKey<Schema.Boolean>;
|
|
870
|
+
readonly sensitive: Schema.optionalKey<Schema.Boolean>;
|
|
871
|
+
readonly min: Schema.optionalKey<Schema.Finite>;
|
|
872
|
+
readonly max: Schema.optionalKey<Schema.Finite>;
|
|
873
|
+
}>>>;
|
|
874
|
+
mcpServers: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
875
|
+
}>;
|
|
876
|
+
type ManifestFields = typeof ManifestFieldsSchema.Type;
|
|
877
|
+
export declare const PluginManifestSchema: Schema.Struct<{
|
|
878
|
+
readonly author: Schema.optionalKey<Schema.Struct<{
|
|
879
|
+
readonly name: Schema.String;
|
|
880
|
+
readonly email: Schema.optionalKey<Schema.String>;
|
|
881
|
+
readonly url: Schema.optionalKey<Schema.String>;
|
|
882
|
+
}>>;
|
|
883
|
+
readonly homepage: Schema.optionalKey<Schema.String>;
|
|
884
|
+
readonly repository: Schema.optionalKey<Schema.String>;
|
|
885
|
+
readonly license: Schema.optionalKey<Schema.String>;
|
|
886
|
+
readonly keywords: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
887
|
+
readonly types: Schema.optionalKey<Schema.String>;
|
|
888
|
+
readonly userConfig: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
|
|
889
|
+
readonly type: Schema.Literals<readonly ["string", "number", "boolean", "directory", "file"]>;
|
|
890
|
+
readonly title: Schema.String;
|
|
891
|
+
readonly description: Schema.String;
|
|
892
|
+
readonly required: Schema.optionalKey<Schema.Boolean>;
|
|
893
|
+
readonly default: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean, Schema.$Array<Schema.String>]>>;
|
|
894
|
+
readonly options: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
895
|
+
readonly multiple: Schema.optionalKey<Schema.Boolean>;
|
|
896
|
+
readonly sensitive: Schema.optionalKey<Schema.Boolean>;
|
|
897
|
+
readonly min: Schema.optionalKey<Schema.Finite>;
|
|
898
|
+
readonly max: Schema.optionalKey<Schema.Finite>;
|
|
899
|
+
}>>>;
|
|
900
|
+
readonly mcpServers: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
901
|
+
readonly name: Schema.String;
|
|
902
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
903
|
+
readonly hooks: Schema.optionalKey<Schema.String>;
|
|
904
|
+
}>;
|
|
905
|
+
type PluginManifest = typeof PluginManifestSchema.Type;
|
|
906
|
+
declare const HookGroupSchema: Schema.Struct<{
|
|
907
|
+
readonly matcher: Schema.optionalKey<Schema.String>;
|
|
908
|
+
readonly hooks: Schema.$Array<Schema.Struct<{
|
|
909
|
+
readonly type: Schema.Literal<"command">;
|
|
910
|
+
readonly command: Schema.String;
|
|
911
|
+
readonly args: Schema.$Array<Schema.String>;
|
|
912
|
+
readonly timeout: Schema.optionalKey<Schema.Finite>;
|
|
913
|
+
}>>;
|
|
914
|
+
}>;
|
|
915
|
+
export declare const HooksFileSchema: Schema.Struct<{
|
|
916
|
+
readonly hooks: Schema.$Record<Schema.String, Schema.$Array<Schema.Struct<{
|
|
917
|
+
readonly matcher: Schema.optionalKey<Schema.String>;
|
|
918
|
+
readonly hooks: Schema.$Array<Schema.Struct<{
|
|
919
|
+
readonly type: Schema.Literal<"command">;
|
|
920
|
+
readonly command: Schema.String;
|
|
921
|
+
readonly args: Schema.$Array<Schema.String>;
|
|
922
|
+
readonly timeout: Schema.optionalKey<Schema.Finite>;
|
|
923
|
+
}>>;
|
|
924
|
+
}>>>;
|
|
925
|
+
}>;
|
|
926
|
+
type HooksFile = typeof HooksFileSchema.Type;
|
|
927
|
+
type HookGroup = typeof HookGroupSchema.Type;
|
|
928
|
+
export declare const DEFAULT_HOOKS_FILE = "hooks/hooks.json";
|
|
929
|
+
type PluginDefinition = Readonly<{
|
|
930
|
+
entry: string;
|
|
931
|
+
hooks?: readonly AnyHook[];
|
|
932
|
+
hooksFile?: string;
|
|
933
|
+
installDependencies?: boolean;
|
|
934
|
+
manifest?: ManifestFields;
|
|
935
|
+
}>;
|
|
936
|
+
export declare const definePlugin: (plugin: PluginDefinition) => PluginDefinition;
|
|
937
|
+
declare const HookOutsidePlugin_base: Schema.Class<HookOutsidePlugin, Schema.TaggedStruct<"HookOutsidePlugin", {
|
|
938
|
+
readonly hook: Schema.String;
|
|
939
|
+
readonly root: Schema.String;
|
|
940
|
+
}>, import("effect/Cause").YieldableError & {
|
|
941
|
+
readonly brand: unique symbol;
|
|
942
|
+
}>;
|
|
943
|
+
export declare class HookOutsidePlugin extends HookOutsidePlugin_base {}
|
|
944
|
+
type PluginFile = Readonly<{
|
|
945
|
+
path: string;
|
|
946
|
+
text: string;
|
|
947
|
+
}>;
|
|
948
|
+
type PackageFields = Readonly<{
|
|
949
|
+
name: string;
|
|
950
|
+
description?: string;
|
|
951
|
+
}>;
|
|
952
|
+
export declare const pluginFiles: (plugin: {
|
|
953
|
+
readonly entry: string;
|
|
954
|
+
readonly hooks?: readonly {
|
|
955
|
+
readonly entry: string;
|
|
956
|
+
readonly on: {
|
|
957
|
+
readonly ConfigChange?: {
|
|
958
|
+
readonly timeout?: number;
|
|
959
|
+
readonly tools?: readonly [string, ...string[]];
|
|
960
|
+
readonly matcher?: string;
|
|
961
|
+
};
|
|
962
|
+
readonly CwdChanged?: {
|
|
963
|
+
readonly timeout?: number;
|
|
964
|
+
readonly tools?: readonly [string, ...string[]];
|
|
965
|
+
readonly matcher?: string;
|
|
966
|
+
};
|
|
967
|
+
readonly DirectoryAdded?: {
|
|
968
|
+
readonly timeout?: number;
|
|
969
|
+
readonly tools?: readonly [string, ...string[]];
|
|
970
|
+
readonly matcher?: string;
|
|
971
|
+
};
|
|
972
|
+
readonly Elicitation?: {
|
|
973
|
+
readonly timeout?: number;
|
|
974
|
+
readonly tools?: readonly [string, ...string[]];
|
|
975
|
+
readonly matcher?: string;
|
|
976
|
+
};
|
|
977
|
+
readonly ElicitationResult?: {
|
|
978
|
+
readonly timeout?: number;
|
|
979
|
+
readonly tools?: readonly [string, ...string[]];
|
|
980
|
+
readonly matcher?: string;
|
|
981
|
+
};
|
|
982
|
+
readonly FileChanged?: {
|
|
983
|
+
readonly timeout?: number;
|
|
984
|
+
readonly tools?: readonly [string, ...string[]];
|
|
985
|
+
readonly matcher?: string;
|
|
986
|
+
};
|
|
987
|
+
readonly InstructionsLoaded?: {
|
|
988
|
+
readonly timeout?: number;
|
|
989
|
+
readonly tools?: readonly [string, ...string[]];
|
|
990
|
+
readonly matcher?: string;
|
|
991
|
+
};
|
|
992
|
+
readonly MessageDisplay?: {
|
|
993
|
+
readonly timeout?: number;
|
|
994
|
+
readonly tools?: readonly [string, ...string[]];
|
|
995
|
+
readonly matcher?: string;
|
|
996
|
+
};
|
|
997
|
+
readonly Notification?: {
|
|
998
|
+
readonly timeout?: number;
|
|
999
|
+
readonly tools?: readonly [string, ...string[]];
|
|
1000
|
+
readonly matcher?: string;
|
|
1001
|
+
};
|
|
1002
|
+
readonly PermissionDenied?: {
|
|
1003
|
+
readonly timeout?: number;
|
|
1004
|
+
readonly tools?: readonly [string, ...string[]];
|
|
1005
|
+
readonly matcher?: string;
|
|
1006
|
+
};
|
|
1007
|
+
readonly PermissionRequest?: {
|
|
1008
|
+
readonly timeout?: number;
|
|
1009
|
+
readonly tools?: readonly [string, ...string[]];
|
|
1010
|
+
readonly matcher?: string;
|
|
1011
|
+
};
|
|
1012
|
+
readonly PostCompact?: {
|
|
1013
|
+
readonly timeout?: number;
|
|
1014
|
+
readonly tools?: readonly [string, ...string[]];
|
|
1015
|
+
readonly matcher?: string;
|
|
1016
|
+
};
|
|
1017
|
+
readonly PostModelSwitch?: {
|
|
1018
|
+
readonly timeout?: number;
|
|
1019
|
+
readonly tools?: readonly [string, ...string[]];
|
|
1020
|
+
readonly matcher?: string;
|
|
1021
|
+
};
|
|
1022
|
+
readonly PostToolBatch?: {
|
|
1023
|
+
readonly timeout?: number;
|
|
1024
|
+
readonly tools?: readonly [string, ...string[]];
|
|
1025
|
+
readonly matcher?: string;
|
|
1026
|
+
};
|
|
1027
|
+
readonly PostToolUse?: {
|
|
1028
|
+
readonly timeout?: number;
|
|
1029
|
+
readonly tools?: readonly [string, ...string[]];
|
|
1030
|
+
readonly matcher?: string;
|
|
1031
|
+
};
|
|
1032
|
+
readonly PostToolUseFailure?: {
|
|
1033
|
+
readonly timeout?: number;
|
|
1034
|
+
readonly tools?: readonly [string, ...string[]];
|
|
1035
|
+
readonly matcher?: string;
|
|
1036
|
+
};
|
|
1037
|
+
readonly PreCompact?: {
|
|
1038
|
+
readonly timeout?: number;
|
|
1039
|
+
readonly tools?: readonly [string, ...string[]];
|
|
1040
|
+
readonly matcher?: string;
|
|
1041
|
+
};
|
|
1042
|
+
readonly PreModelSwitch?: {
|
|
1043
|
+
readonly timeout?: number;
|
|
1044
|
+
readonly tools?: readonly [string, ...string[]];
|
|
1045
|
+
readonly matcher?: string;
|
|
1046
|
+
};
|
|
1047
|
+
readonly PreSkillShellCommand?: {
|
|
1048
|
+
readonly timeout?: number;
|
|
1049
|
+
readonly tools?: readonly [string, ...string[]];
|
|
1050
|
+
readonly matcher?: string;
|
|
1051
|
+
};
|
|
1052
|
+
readonly PreToolUse?: {
|
|
1053
|
+
readonly timeout?: number;
|
|
1054
|
+
readonly tools?: readonly [string, ...string[]];
|
|
1055
|
+
readonly matcher?: string;
|
|
1056
|
+
};
|
|
1057
|
+
readonly SessionEnd?: {
|
|
1058
|
+
readonly timeout?: number;
|
|
1059
|
+
readonly tools?: readonly [string, ...string[]];
|
|
1060
|
+
readonly matcher?: string;
|
|
1061
|
+
};
|
|
1062
|
+
readonly SessionStart?: {
|
|
1063
|
+
readonly timeout?: number;
|
|
1064
|
+
readonly tools?: readonly [string, ...string[]];
|
|
1065
|
+
readonly matcher?: string;
|
|
1066
|
+
};
|
|
1067
|
+
readonly Setup?: {
|
|
1068
|
+
readonly timeout?: number;
|
|
1069
|
+
readonly tools?: readonly [string, ...string[]];
|
|
1070
|
+
readonly matcher?: string;
|
|
1071
|
+
};
|
|
1072
|
+
readonly Stop?: {
|
|
1073
|
+
readonly timeout?: number;
|
|
1074
|
+
readonly tools?: readonly [string, ...string[]];
|
|
1075
|
+
readonly matcher?: string;
|
|
1076
|
+
};
|
|
1077
|
+
readonly StopFailure?: {
|
|
1078
|
+
readonly timeout?: number;
|
|
1079
|
+
readonly tools?: readonly [string, ...string[]];
|
|
1080
|
+
readonly matcher?: string;
|
|
1081
|
+
};
|
|
1082
|
+
readonly SubagentStart?: {
|
|
1083
|
+
readonly timeout?: number;
|
|
1084
|
+
readonly tools?: readonly [string, ...string[]];
|
|
1085
|
+
readonly matcher?: string;
|
|
1086
|
+
};
|
|
1087
|
+
readonly SubagentStop?: {
|
|
1088
|
+
readonly timeout?: number;
|
|
1089
|
+
readonly tools?: readonly [string, ...string[]];
|
|
1090
|
+
readonly matcher?: string;
|
|
1091
|
+
};
|
|
1092
|
+
readonly TaskCompleted?: {
|
|
1093
|
+
readonly timeout?: number;
|
|
1094
|
+
readonly tools?: readonly [string, ...string[]];
|
|
1095
|
+
readonly matcher?: string;
|
|
1096
|
+
};
|
|
1097
|
+
readonly TaskCreated?: {
|
|
1098
|
+
readonly timeout?: number;
|
|
1099
|
+
readonly tools?: readonly [string, ...string[]];
|
|
1100
|
+
readonly matcher?: string;
|
|
1101
|
+
};
|
|
1102
|
+
readonly TeammateIdle?: {
|
|
1103
|
+
readonly timeout?: number;
|
|
1104
|
+
readonly tools?: readonly [string, ...string[]];
|
|
1105
|
+
readonly matcher?: string;
|
|
1106
|
+
};
|
|
1107
|
+
readonly UserPromptExpansion?: {
|
|
1108
|
+
readonly timeout?: number;
|
|
1109
|
+
readonly tools?: readonly [string, ...string[]];
|
|
1110
|
+
readonly matcher?: string;
|
|
1111
|
+
};
|
|
1112
|
+
readonly UserPromptSubmit?: {
|
|
1113
|
+
readonly timeout?: number;
|
|
1114
|
+
readonly tools?: readonly [string, ...string[]];
|
|
1115
|
+
readonly matcher?: string;
|
|
1116
|
+
};
|
|
1117
|
+
readonly WorktreeCreate?: {
|
|
1118
|
+
readonly timeout?: number;
|
|
1119
|
+
readonly tools?: readonly [string, ...string[]];
|
|
1120
|
+
readonly matcher?: string;
|
|
1121
|
+
};
|
|
1122
|
+
readonly WorktreeRemove?: {
|
|
1123
|
+
readonly timeout?: number;
|
|
1124
|
+
readonly tools?: readonly [string, ...string[]];
|
|
1125
|
+
readonly matcher?: string;
|
|
1126
|
+
};
|
|
1127
|
+
};
|
|
1128
|
+
readonly timeout?: number;
|
|
1129
|
+
readonly node?: readonly string[];
|
|
1130
|
+
}[];
|
|
1131
|
+
readonly hooksFile?: string;
|
|
1132
|
+
readonly installDependencies?: boolean;
|
|
1133
|
+
readonly manifest?: {
|
|
1134
|
+
readonly author?: {
|
|
1135
|
+
readonly name: string;
|
|
1136
|
+
readonly email?: string;
|
|
1137
|
+
readonly url?: string;
|
|
1138
|
+
};
|
|
1139
|
+
readonly homepage?: string;
|
|
1140
|
+
readonly repository?: string;
|
|
1141
|
+
readonly license?: string;
|
|
1142
|
+
readonly keywords?: readonly string[];
|
|
1143
|
+
readonly types?: string;
|
|
1144
|
+
readonly userConfig?: {
|
|
1145
|
+
readonly [x: string]: {
|
|
1146
|
+
readonly type: "boolean" | "directory" | "file" | "number" | "string";
|
|
1147
|
+
readonly title: string;
|
|
1148
|
+
readonly description: string;
|
|
1149
|
+
readonly required?: boolean;
|
|
1150
|
+
readonly default?: string | number | boolean | readonly string[];
|
|
1151
|
+
readonly options?: readonly string[];
|
|
1152
|
+
readonly multiple?: boolean;
|
|
1153
|
+
readonly sensitive?: boolean;
|
|
1154
|
+
readonly min?: number;
|
|
1155
|
+
readonly max?: number;
|
|
1156
|
+
};
|
|
1157
|
+
};
|
|
1158
|
+
readonly mcpServers?: {
|
|
1159
|
+
readonly [x: string]: unknown;
|
|
1160
|
+
};
|
|
1161
|
+
};
|
|
1162
|
+
}, fields: Readonly<{
|
|
1163
|
+
name: string;
|
|
1164
|
+
description?: string;
|
|
1165
|
+
}>) => Effect.Effect<Readonly<{
|
|
1166
|
+
path: string;
|
|
1167
|
+
text: string;
|
|
1168
|
+
}>[], HookOutsidePlugin, never>;
|
|
1169
|
+
export declare const moduleFiles: (loaded: unknown, fields: Readonly<{
|
|
1170
|
+
name: string;
|
|
1171
|
+
description?: string;
|
|
1172
|
+
}>) => Effect.Effect<Readonly<{
|
|
1173
|
+
path: string;
|
|
1174
|
+
text: string;
|
|
1175
|
+
}>[], HookOutsidePlugin | Schema.SchemaError, never>;
|
|
1176
|
+
declare const PluginDataSchema: Schema.Struct<{
|
|
1177
|
+
readonly entry: Schema.String;
|
|
1178
|
+
readonly hooks: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
1179
|
+
readonly entry: Schema.String;
|
|
1180
|
+
readonly on: Schema.Struct<Record<"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", Schema.optionalKey<Schema.Struct<{
|
|
1181
|
+
readonly timeout: Schema.optionalKey<Schema.Finite>;
|
|
1182
|
+
readonly tools: Schema.optionalKey<Schema.NonEmptyArray<Schema.String>>;
|
|
1183
|
+
readonly matcher: Schema.optionalKey<Schema.String>;
|
|
1184
|
+
}>>>>;
|
|
1185
|
+
readonly timeout: Schema.optionalKey<Schema.Finite>;
|
|
1186
|
+
readonly node: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
1187
|
+
}>>>;
|
|
1188
|
+
readonly hooksFile: Schema.optionalKey<Schema.String>;
|
|
1189
|
+
readonly installDependencies: Schema.optionalKey<Schema.Boolean>;
|
|
1190
|
+
readonly manifest: Schema.optionalKey<Schema.Struct<{
|
|
1191
|
+
author: Schema.optionalKey<Schema.Struct<{
|
|
1192
|
+
readonly name: Schema.String;
|
|
1193
|
+
readonly email: Schema.optionalKey<Schema.String>;
|
|
1194
|
+
readonly url: Schema.optionalKey<Schema.String>;
|
|
1195
|
+
}>>;
|
|
1196
|
+
homepage: Schema.optionalKey<Schema.String>;
|
|
1197
|
+
repository: Schema.optionalKey<Schema.String>;
|
|
1198
|
+
license: Schema.optionalKey<Schema.String>;
|
|
1199
|
+
keywords: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
1200
|
+
types: Schema.optionalKey<Schema.String>;
|
|
1201
|
+
userConfig: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
|
|
1202
|
+
readonly type: Schema.Literals<readonly ["string", "number", "boolean", "directory", "file"]>;
|
|
1203
|
+
readonly title: Schema.String;
|
|
1204
|
+
readonly description: Schema.String;
|
|
1205
|
+
readonly required: Schema.optionalKey<Schema.Boolean>;
|
|
1206
|
+
readonly default: Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean, Schema.$Array<Schema.String>]>>;
|
|
1207
|
+
readonly options: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
1208
|
+
readonly multiple: Schema.optionalKey<Schema.Boolean>;
|
|
1209
|
+
readonly sensitive: Schema.optionalKey<Schema.Boolean>;
|
|
1210
|
+
readonly min: Schema.optionalKey<Schema.Finite>;
|
|
1211
|
+
readonly max: Schema.optionalKey<Schema.Finite>;
|
|
1212
|
+
}>>>;
|
|
1213
|
+
mcpServers: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
1214
|
+
}>>;
|
|
1215
|
+
}>;
|
|
1216
|
+
type PluginData = typeof PluginDataSchema.Type;
|
|
1217
|
+
export { type AnyHook, type AnySpecificOutput, type CommonOutput, type ContextAnswer, type ContextEvent, type EventFields, type Hook, type HookEvent, type HookGroup, type HookInput, type HookOutput, type HookSpecificOutput, type HooksFile, type InputOf, type ManifestFields, type OutputOf, type PackageFields, type PluginData, type PluginDefinition, type PluginFile, type PluginManifest, type SpecificEvent, type ToolEvent, type ToolInput, type ToolInputs, type ToolName, type Trigger, type Triggers, type UserConfigOption, blockHook };
|