@bookedsolid/rea 0.29.0 → 0.30.1

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.
@@ -0,0 +1,2099 @@
1
+ /**
2
+ * Class M — `.claude/settings.json` zod schema (0.30.0+).
3
+ *
4
+ * Consumer-side validation for the Claude Code harness `settings.json`
5
+ * file. The harness itself accepts a JSON object with a documented
6
+ * shape; rea adds a strict subset of that shape so a typo in a hook
7
+ * registration ("statusMessasge", "PreToolUze") doesn't silently
8
+ * disable a load-bearing rea hook on a consumer's install.
9
+ *
10
+ * Two modes:
11
+ * - Default (`mode: 'warn'`) — `rea doctor` logs a warn for any
12
+ * unknown top-level key, unknown hook event, or unrecognized
13
+ * matcher pattern. Existing consumer files that haven't seen the
14
+ * schema before keep working without action.
15
+ * - Strict (`mode: 'strict'`) — `rea doctor --strict` fails on any
16
+ * zod failure, on path-traversal in a `command` value, and when
17
+ * a rea-shipped hook (`EXPECTED_HOOKS`) is missing from the
18
+ * PreToolUse / PostToolUse registrations. Used by CI gates that
19
+ * want a hard floor.
20
+ *
21
+ * Path-traversal is checked OUTSIDE zod (see `validateNoTraversal`)
22
+ * — zod's job is shape; ours is to make sure a `command` literally
23
+ * cannot reference `..` after stripping `$CLAUDE_PROJECT_DIR`. The
24
+ * harness expands the variable at exec time, so the on-disk value
25
+ * is the right anchor for the check.
26
+ */
27
+ import { z } from 'zod';
28
+ /**
29
+ * Hook event names the harness honors. Strict union so a typo
30
+ * ("PreToolUze") fails closed. The union mirrors Anthropic's
31
+ * published list as of 2026-05; new events get added here as the
32
+ * harness ships them.
33
+ */
34
+ export declare const HOOK_EVENT_NAMES: readonly ["PreToolUse", "PostToolUse", "UserPromptSubmit", "Stop", "SubagentStop", "PreCompact", "Notification", "SessionStart"];
35
+ export type HookEventName = (typeof HOOK_EVENT_NAMES)[number];
36
+ /**
37
+ * Hook-command entry. `statusMessage` is REQUIRED to ALLOW (not to
38
+ * require) because every canonical entry rea ships carries one — the
39
+ * harness uses it for the spinner status line, and omitting it would
40
+ * be technically valid but degrade UX. `timeout` is optional; when
41
+ * present must be a positive int up to the harness ceiling of
42
+ * 600_000 ms (10 minutes).
43
+ */
44
+ export declare const HookCommandSchema: z.ZodObject<{
45
+ type: z.ZodLiteral<"command">;
46
+ command: z.ZodString;
47
+ timeout: z.ZodOptional<z.ZodNumber>;
48
+ statusMessage: z.ZodOptional<z.ZodString>;
49
+ }, "strict", z.ZodTypeAny, {
50
+ type: "command";
51
+ command: string;
52
+ timeout?: number | undefined;
53
+ statusMessage?: string | undefined;
54
+ }, {
55
+ type: "command";
56
+ command: string;
57
+ timeout?: number | undefined;
58
+ statusMessage?: string | undefined;
59
+ }>;
60
+ export type HookCommand = z.infer<typeof HookCommandSchema>;
61
+ /**
62
+ * Hook entry group: a matcher pattern (string like `Bash` or
63
+ * `Write|Edit|MultiEdit|NotebookEdit`) plus its list of hook commands.
64
+ * The matcher is opaque to the schema — the harness parses it as a
65
+ * pipe-separated tool-name list. Empty matcher is rejected.
66
+ */
67
+ export declare const HookEntrySchema: z.ZodObject<{
68
+ matcher: z.ZodString;
69
+ hooks: z.ZodArray<z.ZodObject<{
70
+ type: z.ZodLiteral<"command">;
71
+ command: z.ZodString;
72
+ timeout: z.ZodOptional<z.ZodNumber>;
73
+ statusMessage: z.ZodOptional<z.ZodString>;
74
+ }, "strict", z.ZodTypeAny, {
75
+ type: "command";
76
+ command: string;
77
+ timeout?: number | undefined;
78
+ statusMessage?: string | undefined;
79
+ }, {
80
+ type: "command";
81
+ command: string;
82
+ timeout?: number | undefined;
83
+ statusMessage?: string | undefined;
84
+ }>, "many">;
85
+ }, "strict", z.ZodTypeAny, {
86
+ hooks: {
87
+ type: "command";
88
+ command: string;
89
+ timeout?: number | undefined;
90
+ statusMessage?: string | undefined;
91
+ }[];
92
+ matcher: string;
93
+ }, {
94
+ hooks: {
95
+ type: "command";
96
+ command: string;
97
+ timeout?: number | undefined;
98
+ statusMessage?: string | undefined;
99
+ }[];
100
+ matcher: string;
101
+ }>;
102
+ export type HookEntry = z.infer<typeof HookEntrySchema>;
103
+ /**
104
+ * Top-level `.claude/settings.json` shape.
105
+ *
106
+ * `permissions` is pass-through (`z.record`) because it carries
107
+ * harness-defined structure that rea is not the source of truth for.
108
+ * `env` is a string-to-string map. `model` is a free string (the
109
+ * harness validates the model name at runtime).
110
+ *
111
+ * Each hook-event field is strict — a typo in the event name fails
112
+ * the parse instead of silently registering on a phantom event.
113
+ */
114
+ export declare const SettingsSchema: z.ZodObject<{
115
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
116
+ permissions: z.ZodOptional<z.ZodUnknown>;
117
+ model: z.ZodOptional<z.ZodString>;
118
+ hooks: z.ZodOptional<z.ZodObject<{
119
+ PreToolUse: z.ZodOptional<z.ZodArray<z.ZodObject<{
120
+ matcher: z.ZodString;
121
+ hooks: z.ZodArray<z.ZodObject<{
122
+ type: z.ZodLiteral<"command">;
123
+ command: z.ZodString;
124
+ timeout: z.ZodOptional<z.ZodNumber>;
125
+ statusMessage: z.ZodOptional<z.ZodString>;
126
+ }, "strict", z.ZodTypeAny, {
127
+ type: "command";
128
+ command: string;
129
+ timeout?: number | undefined;
130
+ statusMessage?: string | undefined;
131
+ }, {
132
+ type: "command";
133
+ command: string;
134
+ timeout?: number | undefined;
135
+ statusMessage?: string | undefined;
136
+ }>, "many">;
137
+ }, "strict", z.ZodTypeAny, {
138
+ hooks: {
139
+ type: "command";
140
+ command: string;
141
+ timeout?: number | undefined;
142
+ statusMessage?: string | undefined;
143
+ }[];
144
+ matcher: string;
145
+ }, {
146
+ hooks: {
147
+ type: "command";
148
+ command: string;
149
+ timeout?: number | undefined;
150
+ statusMessage?: string | undefined;
151
+ }[];
152
+ matcher: string;
153
+ }>, "many">>;
154
+ PostToolUse: z.ZodOptional<z.ZodArray<z.ZodObject<{
155
+ matcher: z.ZodString;
156
+ hooks: z.ZodArray<z.ZodObject<{
157
+ type: z.ZodLiteral<"command">;
158
+ command: z.ZodString;
159
+ timeout: z.ZodOptional<z.ZodNumber>;
160
+ statusMessage: z.ZodOptional<z.ZodString>;
161
+ }, "strict", z.ZodTypeAny, {
162
+ type: "command";
163
+ command: string;
164
+ timeout?: number | undefined;
165
+ statusMessage?: string | undefined;
166
+ }, {
167
+ type: "command";
168
+ command: string;
169
+ timeout?: number | undefined;
170
+ statusMessage?: string | undefined;
171
+ }>, "many">;
172
+ }, "strict", z.ZodTypeAny, {
173
+ hooks: {
174
+ type: "command";
175
+ command: string;
176
+ timeout?: number | undefined;
177
+ statusMessage?: string | undefined;
178
+ }[];
179
+ matcher: string;
180
+ }, {
181
+ hooks: {
182
+ type: "command";
183
+ command: string;
184
+ timeout?: number | undefined;
185
+ statusMessage?: string | undefined;
186
+ }[];
187
+ matcher: string;
188
+ }>, "many">>;
189
+ UserPromptSubmit: z.ZodOptional<z.ZodArray<z.ZodObject<{
190
+ matcher: z.ZodString;
191
+ hooks: z.ZodArray<z.ZodObject<{
192
+ type: z.ZodLiteral<"command">;
193
+ command: z.ZodString;
194
+ timeout: z.ZodOptional<z.ZodNumber>;
195
+ statusMessage: z.ZodOptional<z.ZodString>;
196
+ }, "strict", z.ZodTypeAny, {
197
+ type: "command";
198
+ command: string;
199
+ timeout?: number | undefined;
200
+ statusMessage?: string | undefined;
201
+ }, {
202
+ type: "command";
203
+ command: string;
204
+ timeout?: number | undefined;
205
+ statusMessage?: string | undefined;
206
+ }>, "many">;
207
+ }, "strict", z.ZodTypeAny, {
208
+ hooks: {
209
+ type: "command";
210
+ command: string;
211
+ timeout?: number | undefined;
212
+ statusMessage?: string | undefined;
213
+ }[];
214
+ matcher: string;
215
+ }, {
216
+ hooks: {
217
+ type: "command";
218
+ command: string;
219
+ timeout?: number | undefined;
220
+ statusMessage?: string | undefined;
221
+ }[];
222
+ matcher: string;
223
+ }>, "many">>;
224
+ Stop: z.ZodOptional<z.ZodArray<z.ZodObject<{
225
+ matcher: z.ZodString;
226
+ hooks: z.ZodArray<z.ZodObject<{
227
+ type: z.ZodLiteral<"command">;
228
+ command: z.ZodString;
229
+ timeout: z.ZodOptional<z.ZodNumber>;
230
+ statusMessage: z.ZodOptional<z.ZodString>;
231
+ }, "strict", z.ZodTypeAny, {
232
+ type: "command";
233
+ command: string;
234
+ timeout?: number | undefined;
235
+ statusMessage?: string | undefined;
236
+ }, {
237
+ type: "command";
238
+ command: string;
239
+ timeout?: number | undefined;
240
+ statusMessage?: string | undefined;
241
+ }>, "many">;
242
+ }, "strict", z.ZodTypeAny, {
243
+ hooks: {
244
+ type: "command";
245
+ command: string;
246
+ timeout?: number | undefined;
247
+ statusMessage?: string | undefined;
248
+ }[];
249
+ matcher: string;
250
+ }, {
251
+ hooks: {
252
+ type: "command";
253
+ command: string;
254
+ timeout?: number | undefined;
255
+ statusMessage?: string | undefined;
256
+ }[];
257
+ matcher: string;
258
+ }>, "many">>;
259
+ SubagentStop: z.ZodOptional<z.ZodArray<z.ZodObject<{
260
+ matcher: z.ZodString;
261
+ hooks: z.ZodArray<z.ZodObject<{
262
+ type: z.ZodLiteral<"command">;
263
+ command: z.ZodString;
264
+ timeout: z.ZodOptional<z.ZodNumber>;
265
+ statusMessage: z.ZodOptional<z.ZodString>;
266
+ }, "strict", z.ZodTypeAny, {
267
+ type: "command";
268
+ command: string;
269
+ timeout?: number | undefined;
270
+ statusMessage?: string | undefined;
271
+ }, {
272
+ type: "command";
273
+ command: string;
274
+ timeout?: number | undefined;
275
+ statusMessage?: string | undefined;
276
+ }>, "many">;
277
+ }, "strict", z.ZodTypeAny, {
278
+ hooks: {
279
+ type: "command";
280
+ command: string;
281
+ timeout?: number | undefined;
282
+ statusMessage?: string | undefined;
283
+ }[];
284
+ matcher: string;
285
+ }, {
286
+ hooks: {
287
+ type: "command";
288
+ command: string;
289
+ timeout?: number | undefined;
290
+ statusMessage?: string | undefined;
291
+ }[];
292
+ matcher: string;
293
+ }>, "many">>;
294
+ PreCompact: z.ZodOptional<z.ZodArray<z.ZodObject<{
295
+ matcher: z.ZodString;
296
+ hooks: z.ZodArray<z.ZodObject<{
297
+ type: z.ZodLiteral<"command">;
298
+ command: z.ZodString;
299
+ timeout: z.ZodOptional<z.ZodNumber>;
300
+ statusMessage: z.ZodOptional<z.ZodString>;
301
+ }, "strict", z.ZodTypeAny, {
302
+ type: "command";
303
+ command: string;
304
+ timeout?: number | undefined;
305
+ statusMessage?: string | undefined;
306
+ }, {
307
+ type: "command";
308
+ command: string;
309
+ timeout?: number | undefined;
310
+ statusMessage?: string | undefined;
311
+ }>, "many">;
312
+ }, "strict", z.ZodTypeAny, {
313
+ hooks: {
314
+ type: "command";
315
+ command: string;
316
+ timeout?: number | undefined;
317
+ statusMessage?: string | undefined;
318
+ }[];
319
+ matcher: string;
320
+ }, {
321
+ hooks: {
322
+ type: "command";
323
+ command: string;
324
+ timeout?: number | undefined;
325
+ statusMessage?: string | undefined;
326
+ }[];
327
+ matcher: string;
328
+ }>, "many">>;
329
+ Notification: z.ZodOptional<z.ZodArray<z.ZodObject<{
330
+ matcher: z.ZodString;
331
+ hooks: z.ZodArray<z.ZodObject<{
332
+ type: z.ZodLiteral<"command">;
333
+ command: z.ZodString;
334
+ timeout: z.ZodOptional<z.ZodNumber>;
335
+ statusMessage: z.ZodOptional<z.ZodString>;
336
+ }, "strict", z.ZodTypeAny, {
337
+ type: "command";
338
+ command: string;
339
+ timeout?: number | undefined;
340
+ statusMessage?: string | undefined;
341
+ }, {
342
+ type: "command";
343
+ command: string;
344
+ timeout?: number | undefined;
345
+ statusMessage?: string | undefined;
346
+ }>, "many">;
347
+ }, "strict", z.ZodTypeAny, {
348
+ hooks: {
349
+ type: "command";
350
+ command: string;
351
+ timeout?: number | undefined;
352
+ statusMessage?: string | undefined;
353
+ }[];
354
+ matcher: string;
355
+ }, {
356
+ hooks: {
357
+ type: "command";
358
+ command: string;
359
+ timeout?: number | undefined;
360
+ statusMessage?: string | undefined;
361
+ }[];
362
+ matcher: string;
363
+ }>, "many">>;
364
+ SessionStart: z.ZodOptional<z.ZodArray<z.ZodObject<{
365
+ matcher: z.ZodString;
366
+ hooks: z.ZodArray<z.ZodObject<{
367
+ type: z.ZodLiteral<"command">;
368
+ command: z.ZodString;
369
+ timeout: z.ZodOptional<z.ZodNumber>;
370
+ statusMessage: z.ZodOptional<z.ZodString>;
371
+ }, "strict", z.ZodTypeAny, {
372
+ type: "command";
373
+ command: string;
374
+ timeout?: number | undefined;
375
+ statusMessage?: string | undefined;
376
+ }, {
377
+ type: "command";
378
+ command: string;
379
+ timeout?: number | undefined;
380
+ statusMessage?: string | undefined;
381
+ }>, "many">;
382
+ }, "strict", z.ZodTypeAny, {
383
+ hooks: {
384
+ type: "command";
385
+ command: string;
386
+ timeout?: number | undefined;
387
+ statusMessage?: string | undefined;
388
+ }[];
389
+ matcher: string;
390
+ }, {
391
+ hooks: {
392
+ type: "command";
393
+ command: string;
394
+ timeout?: number | undefined;
395
+ statusMessage?: string | undefined;
396
+ }[];
397
+ matcher: string;
398
+ }>, "many">>;
399
+ }, "strict", z.ZodTypeAny, {
400
+ PreToolUse?: {
401
+ hooks: {
402
+ type: "command";
403
+ command: string;
404
+ timeout?: number | undefined;
405
+ statusMessage?: string | undefined;
406
+ }[];
407
+ matcher: string;
408
+ }[] | undefined;
409
+ PostToolUse?: {
410
+ hooks: {
411
+ type: "command";
412
+ command: string;
413
+ timeout?: number | undefined;
414
+ statusMessage?: string | undefined;
415
+ }[];
416
+ matcher: string;
417
+ }[] | undefined;
418
+ Notification?: {
419
+ hooks: {
420
+ type: "command";
421
+ command: string;
422
+ timeout?: number | undefined;
423
+ statusMessage?: string | undefined;
424
+ }[];
425
+ matcher: string;
426
+ }[] | undefined;
427
+ Stop?: {
428
+ hooks: {
429
+ type: "command";
430
+ command: string;
431
+ timeout?: number | undefined;
432
+ statusMessage?: string | undefined;
433
+ }[];
434
+ matcher: string;
435
+ }[] | undefined;
436
+ UserPromptSubmit?: {
437
+ hooks: {
438
+ type: "command";
439
+ command: string;
440
+ timeout?: number | undefined;
441
+ statusMessage?: string | undefined;
442
+ }[];
443
+ matcher: string;
444
+ }[] | undefined;
445
+ SubagentStop?: {
446
+ hooks: {
447
+ type: "command";
448
+ command: string;
449
+ timeout?: number | undefined;
450
+ statusMessage?: string | undefined;
451
+ }[];
452
+ matcher: string;
453
+ }[] | undefined;
454
+ PreCompact?: {
455
+ hooks: {
456
+ type: "command";
457
+ command: string;
458
+ timeout?: number | undefined;
459
+ statusMessage?: string | undefined;
460
+ }[];
461
+ matcher: string;
462
+ }[] | undefined;
463
+ SessionStart?: {
464
+ hooks: {
465
+ type: "command";
466
+ command: string;
467
+ timeout?: number | undefined;
468
+ statusMessage?: string | undefined;
469
+ }[];
470
+ matcher: string;
471
+ }[] | undefined;
472
+ }, {
473
+ PreToolUse?: {
474
+ hooks: {
475
+ type: "command";
476
+ command: string;
477
+ timeout?: number | undefined;
478
+ statusMessage?: string | undefined;
479
+ }[];
480
+ matcher: string;
481
+ }[] | undefined;
482
+ PostToolUse?: {
483
+ hooks: {
484
+ type: "command";
485
+ command: string;
486
+ timeout?: number | undefined;
487
+ statusMessage?: string | undefined;
488
+ }[];
489
+ matcher: string;
490
+ }[] | undefined;
491
+ Notification?: {
492
+ hooks: {
493
+ type: "command";
494
+ command: string;
495
+ timeout?: number | undefined;
496
+ statusMessage?: string | undefined;
497
+ }[];
498
+ matcher: string;
499
+ }[] | undefined;
500
+ Stop?: {
501
+ hooks: {
502
+ type: "command";
503
+ command: string;
504
+ timeout?: number | undefined;
505
+ statusMessage?: string | undefined;
506
+ }[];
507
+ matcher: string;
508
+ }[] | undefined;
509
+ UserPromptSubmit?: {
510
+ hooks: {
511
+ type: "command";
512
+ command: string;
513
+ timeout?: number | undefined;
514
+ statusMessage?: string | undefined;
515
+ }[];
516
+ matcher: string;
517
+ }[] | undefined;
518
+ SubagentStop?: {
519
+ hooks: {
520
+ type: "command";
521
+ command: string;
522
+ timeout?: number | undefined;
523
+ statusMessage?: string | undefined;
524
+ }[];
525
+ matcher: string;
526
+ }[] | undefined;
527
+ PreCompact?: {
528
+ hooks: {
529
+ type: "command";
530
+ command: string;
531
+ timeout?: number | undefined;
532
+ statusMessage?: string | undefined;
533
+ }[];
534
+ matcher: string;
535
+ }[] | undefined;
536
+ SessionStart?: {
537
+ hooks: {
538
+ type: "command";
539
+ command: string;
540
+ timeout?: number | undefined;
541
+ statusMessage?: string | undefined;
542
+ }[];
543
+ matcher: string;
544
+ }[] | undefined;
545
+ }>>;
546
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
547
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
548
+ permissions: z.ZodOptional<z.ZodUnknown>;
549
+ model: z.ZodOptional<z.ZodString>;
550
+ hooks: z.ZodOptional<z.ZodObject<{
551
+ PreToolUse: z.ZodOptional<z.ZodArray<z.ZodObject<{
552
+ matcher: z.ZodString;
553
+ hooks: z.ZodArray<z.ZodObject<{
554
+ type: z.ZodLiteral<"command">;
555
+ command: z.ZodString;
556
+ timeout: z.ZodOptional<z.ZodNumber>;
557
+ statusMessage: z.ZodOptional<z.ZodString>;
558
+ }, "strict", z.ZodTypeAny, {
559
+ type: "command";
560
+ command: string;
561
+ timeout?: number | undefined;
562
+ statusMessage?: string | undefined;
563
+ }, {
564
+ type: "command";
565
+ command: string;
566
+ timeout?: number | undefined;
567
+ statusMessage?: string | undefined;
568
+ }>, "many">;
569
+ }, "strict", z.ZodTypeAny, {
570
+ hooks: {
571
+ type: "command";
572
+ command: string;
573
+ timeout?: number | undefined;
574
+ statusMessage?: string | undefined;
575
+ }[];
576
+ matcher: string;
577
+ }, {
578
+ hooks: {
579
+ type: "command";
580
+ command: string;
581
+ timeout?: number | undefined;
582
+ statusMessage?: string | undefined;
583
+ }[];
584
+ matcher: string;
585
+ }>, "many">>;
586
+ PostToolUse: z.ZodOptional<z.ZodArray<z.ZodObject<{
587
+ matcher: z.ZodString;
588
+ hooks: z.ZodArray<z.ZodObject<{
589
+ type: z.ZodLiteral<"command">;
590
+ command: z.ZodString;
591
+ timeout: z.ZodOptional<z.ZodNumber>;
592
+ statusMessage: z.ZodOptional<z.ZodString>;
593
+ }, "strict", z.ZodTypeAny, {
594
+ type: "command";
595
+ command: string;
596
+ timeout?: number | undefined;
597
+ statusMessage?: string | undefined;
598
+ }, {
599
+ type: "command";
600
+ command: string;
601
+ timeout?: number | undefined;
602
+ statusMessage?: string | undefined;
603
+ }>, "many">;
604
+ }, "strict", z.ZodTypeAny, {
605
+ hooks: {
606
+ type: "command";
607
+ command: string;
608
+ timeout?: number | undefined;
609
+ statusMessage?: string | undefined;
610
+ }[];
611
+ matcher: string;
612
+ }, {
613
+ hooks: {
614
+ type: "command";
615
+ command: string;
616
+ timeout?: number | undefined;
617
+ statusMessage?: string | undefined;
618
+ }[];
619
+ matcher: string;
620
+ }>, "many">>;
621
+ UserPromptSubmit: z.ZodOptional<z.ZodArray<z.ZodObject<{
622
+ matcher: z.ZodString;
623
+ hooks: z.ZodArray<z.ZodObject<{
624
+ type: z.ZodLiteral<"command">;
625
+ command: z.ZodString;
626
+ timeout: z.ZodOptional<z.ZodNumber>;
627
+ statusMessage: z.ZodOptional<z.ZodString>;
628
+ }, "strict", z.ZodTypeAny, {
629
+ type: "command";
630
+ command: string;
631
+ timeout?: number | undefined;
632
+ statusMessage?: string | undefined;
633
+ }, {
634
+ type: "command";
635
+ command: string;
636
+ timeout?: number | undefined;
637
+ statusMessage?: string | undefined;
638
+ }>, "many">;
639
+ }, "strict", z.ZodTypeAny, {
640
+ hooks: {
641
+ type: "command";
642
+ command: string;
643
+ timeout?: number | undefined;
644
+ statusMessage?: string | undefined;
645
+ }[];
646
+ matcher: string;
647
+ }, {
648
+ hooks: {
649
+ type: "command";
650
+ command: string;
651
+ timeout?: number | undefined;
652
+ statusMessage?: string | undefined;
653
+ }[];
654
+ matcher: string;
655
+ }>, "many">>;
656
+ Stop: z.ZodOptional<z.ZodArray<z.ZodObject<{
657
+ matcher: z.ZodString;
658
+ hooks: z.ZodArray<z.ZodObject<{
659
+ type: z.ZodLiteral<"command">;
660
+ command: z.ZodString;
661
+ timeout: z.ZodOptional<z.ZodNumber>;
662
+ statusMessage: z.ZodOptional<z.ZodString>;
663
+ }, "strict", z.ZodTypeAny, {
664
+ type: "command";
665
+ command: string;
666
+ timeout?: number | undefined;
667
+ statusMessage?: string | undefined;
668
+ }, {
669
+ type: "command";
670
+ command: string;
671
+ timeout?: number | undefined;
672
+ statusMessage?: string | undefined;
673
+ }>, "many">;
674
+ }, "strict", z.ZodTypeAny, {
675
+ hooks: {
676
+ type: "command";
677
+ command: string;
678
+ timeout?: number | undefined;
679
+ statusMessage?: string | undefined;
680
+ }[];
681
+ matcher: string;
682
+ }, {
683
+ hooks: {
684
+ type: "command";
685
+ command: string;
686
+ timeout?: number | undefined;
687
+ statusMessage?: string | undefined;
688
+ }[];
689
+ matcher: string;
690
+ }>, "many">>;
691
+ SubagentStop: z.ZodOptional<z.ZodArray<z.ZodObject<{
692
+ matcher: z.ZodString;
693
+ hooks: z.ZodArray<z.ZodObject<{
694
+ type: z.ZodLiteral<"command">;
695
+ command: z.ZodString;
696
+ timeout: z.ZodOptional<z.ZodNumber>;
697
+ statusMessage: z.ZodOptional<z.ZodString>;
698
+ }, "strict", z.ZodTypeAny, {
699
+ type: "command";
700
+ command: string;
701
+ timeout?: number | undefined;
702
+ statusMessage?: string | undefined;
703
+ }, {
704
+ type: "command";
705
+ command: string;
706
+ timeout?: number | undefined;
707
+ statusMessage?: string | undefined;
708
+ }>, "many">;
709
+ }, "strict", z.ZodTypeAny, {
710
+ hooks: {
711
+ type: "command";
712
+ command: string;
713
+ timeout?: number | undefined;
714
+ statusMessage?: string | undefined;
715
+ }[];
716
+ matcher: string;
717
+ }, {
718
+ hooks: {
719
+ type: "command";
720
+ command: string;
721
+ timeout?: number | undefined;
722
+ statusMessage?: string | undefined;
723
+ }[];
724
+ matcher: string;
725
+ }>, "many">>;
726
+ PreCompact: z.ZodOptional<z.ZodArray<z.ZodObject<{
727
+ matcher: z.ZodString;
728
+ hooks: z.ZodArray<z.ZodObject<{
729
+ type: z.ZodLiteral<"command">;
730
+ command: z.ZodString;
731
+ timeout: z.ZodOptional<z.ZodNumber>;
732
+ statusMessage: z.ZodOptional<z.ZodString>;
733
+ }, "strict", z.ZodTypeAny, {
734
+ type: "command";
735
+ command: string;
736
+ timeout?: number | undefined;
737
+ statusMessage?: string | undefined;
738
+ }, {
739
+ type: "command";
740
+ command: string;
741
+ timeout?: number | undefined;
742
+ statusMessage?: string | undefined;
743
+ }>, "many">;
744
+ }, "strict", z.ZodTypeAny, {
745
+ hooks: {
746
+ type: "command";
747
+ command: string;
748
+ timeout?: number | undefined;
749
+ statusMessage?: string | undefined;
750
+ }[];
751
+ matcher: string;
752
+ }, {
753
+ hooks: {
754
+ type: "command";
755
+ command: string;
756
+ timeout?: number | undefined;
757
+ statusMessage?: string | undefined;
758
+ }[];
759
+ matcher: string;
760
+ }>, "many">>;
761
+ Notification: z.ZodOptional<z.ZodArray<z.ZodObject<{
762
+ matcher: z.ZodString;
763
+ hooks: z.ZodArray<z.ZodObject<{
764
+ type: z.ZodLiteral<"command">;
765
+ command: z.ZodString;
766
+ timeout: z.ZodOptional<z.ZodNumber>;
767
+ statusMessage: z.ZodOptional<z.ZodString>;
768
+ }, "strict", z.ZodTypeAny, {
769
+ type: "command";
770
+ command: string;
771
+ timeout?: number | undefined;
772
+ statusMessage?: string | undefined;
773
+ }, {
774
+ type: "command";
775
+ command: string;
776
+ timeout?: number | undefined;
777
+ statusMessage?: string | undefined;
778
+ }>, "many">;
779
+ }, "strict", z.ZodTypeAny, {
780
+ hooks: {
781
+ type: "command";
782
+ command: string;
783
+ timeout?: number | undefined;
784
+ statusMessage?: string | undefined;
785
+ }[];
786
+ matcher: string;
787
+ }, {
788
+ hooks: {
789
+ type: "command";
790
+ command: string;
791
+ timeout?: number | undefined;
792
+ statusMessage?: string | undefined;
793
+ }[];
794
+ matcher: string;
795
+ }>, "many">>;
796
+ SessionStart: z.ZodOptional<z.ZodArray<z.ZodObject<{
797
+ matcher: z.ZodString;
798
+ hooks: z.ZodArray<z.ZodObject<{
799
+ type: z.ZodLiteral<"command">;
800
+ command: z.ZodString;
801
+ timeout: z.ZodOptional<z.ZodNumber>;
802
+ statusMessage: z.ZodOptional<z.ZodString>;
803
+ }, "strict", z.ZodTypeAny, {
804
+ type: "command";
805
+ command: string;
806
+ timeout?: number | undefined;
807
+ statusMessage?: string | undefined;
808
+ }, {
809
+ type: "command";
810
+ command: string;
811
+ timeout?: number | undefined;
812
+ statusMessage?: string | undefined;
813
+ }>, "many">;
814
+ }, "strict", z.ZodTypeAny, {
815
+ hooks: {
816
+ type: "command";
817
+ command: string;
818
+ timeout?: number | undefined;
819
+ statusMessage?: string | undefined;
820
+ }[];
821
+ matcher: string;
822
+ }, {
823
+ hooks: {
824
+ type: "command";
825
+ command: string;
826
+ timeout?: number | undefined;
827
+ statusMessage?: string | undefined;
828
+ }[];
829
+ matcher: string;
830
+ }>, "many">>;
831
+ }, "strict", z.ZodTypeAny, {
832
+ PreToolUse?: {
833
+ hooks: {
834
+ type: "command";
835
+ command: string;
836
+ timeout?: number | undefined;
837
+ statusMessage?: string | undefined;
838
+ }[];
839
+ matcher: string;
840
+ }[] | undefined;
841
+ PostToolUse?: {
842
+ hooks: {
843
+ type: "command";
844
+ command: string;
845
+ timeout?: number | undefined;
846
+ statusMessage?: string | undefined;
847
+ }[];
848
+ matcher: string;
849
+ }[] | undefined;
850
+ Notification?: {
851
+ hooks: {
852
+ type: "command";
853
+ command: string;
854
+ timeout?: number | undefined;
855
+ statusMessage?: string | undefined;
856
+ }[];
857
+ matcher: string;
858
+ }[] | undefined;
859
+ Stop?: {
860
+ hooks: {
861
+ type: "command";
862
+ command: string;
863
+ timeout?: number | undefined;
864
+ statusMessage?: string | undefined;
865
+ }[];
866
+ matcher: string;
867
+ }[] | undefined;
868
+ UserPromptSubmit?: {
869
+ hooks: {
870
+ type: "command";
871
+ command: string;
872
+ timeout?: number | undefined;
873
+ statusMessage?: string | undefined;
874
+ }[];
875
+ matcher: string;
876
+ }[] | undefined;
877
+ SubagentStop?: {
878
+ hooks: {
879
+ type: "command";
880
+ command: string;
881
+ timeout?: number | undefined;
882
+ statusMessage?: string | undefined;
883
+ }[];
884
+ matcher: string;
885
+ }[] | undefined;
886
+ PreCompact?: {
887
+ hooks: {
888
+ type: "command";
889
+ command: string;
890
+ timeout?: number | undefined;
891
+ statusMessage?: string | undefined;
892
+ }[];
893
+ matcher: string;
894
+ }[] | undefined;
895
+ SessionStart?: {
896
+ hooks: {
897
+ type: "command";
898
+ command: string;
899
+ timeout?: number | undefined;
900
+ statusMessage?: string | undefined;
901
+ }[];
902
+ matcher: string;
903
+ }[] | undefined;
904
+ }, {
905
+ PreToolUse?: {
906
+ hooks: {
907
+ type: "command";
908
+ command: string;
909
+ timeout?: number | undefined;
910
+ statusMessage?: string | undefined;
911
+ }[];
912
+ matcher: string;
913
+ }[] | undefined;
914
+ PostToolUse?: {
915
+ hooks: {
916
+ type: "command";
917
+ command: string;
918
+ timeout?: number | undefined;
919
+ statusMessage?: string | undefined;
920
+ }[];
921
+ matcher: string;
922
+ }[] | undefined;
923
+ Notification?: {
924
+ hooks: {
925
+ type: "command";
926
+ command: string;
927
+ timeout?: number | undefined;
928
+ statusMessage?: string | undefined;
929
+ }[];
930
+ matcher: string;
931
+ }[] | undefined;
932
+ Stop?: {
933
+ hooks: {
934
+ type: "command";
935
+ command: string;
936
+ timeout?: number | undefined;
937
+ statusMessage?: string | undefined;
938
+ }[];
939
+ matcher: string;
940
+ }[] | undefined;
941
+ UserPromptSubmit?: {
942
+ hooks: {
943
+ type: "command";
944
+ command: string;
945
+ timeout?: number | undefined;
946
+ statusMessage?: string | undefined;
947
+ }[];
948
+ matcher: string;
949
+ }[] | undefined;
950
+ SubagentStop?: {
951
+ hooks: {
952
+ type: "command";
953
+ command: string;
954
+ timeout?: number | undefined;
955
+ statusMessage?: string | undefined;
956
+ }[];
957
+ matcher: string;
958
+ }[] | undefined;
959
+ PreCompact?: {
960
+ hooks: {
961
+ type: "command";
962
+ command: string;
963
+ timeout?: number | undefined;
964
+ statusMessage?: string | undefined;
965
+ }[];
966
+ matcher: string;
967
+ }[] | undefined;
968
+ SessionStart?: {
969
+ hooks: {
970
+ type: "command";
971
+ command: string;
972
+ timeout?: number | undefined;
973
+ statusMessage?: string | undefined;
974
+ }[];
975
+ matcher: string;
976
+ }[] | undefined;
977
+ }>>;
978
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
979
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
980
+ permissions: z.ZodOptional<z.ZodUnknown>;
981
+ model: z.ZodOptional<z.ZodString>;
982
+ hooks: z.ZodOptional<z.ZodObject<{
983
+ PreToolUse: z.ZodOptional<z.ZodArray<z.ZodObject<{
984
+ matcher: z.ZodString;
985
+ hooks: z.ZodArray<z.ZodObject<{
986
+ type: z.ZodLiteral<"command">;
987
+ command: z.ZodString;
988
+ timeout: z.ZodOptional<z.ZodNumber>;
989
+ statusMessage: z.ZodOptional<z.ZodString>;
990
+ }, "strict", z.ZodTypeAny, {
991
+ type: "command";
992
+ command: string;
993
+ timeout?: number | undefined;
994
+ statusMessage?: string | undefined;
995
+ }, {
996
+ type: "command";
997
+ command: string;
998
+ timeout?: number | undefined;
999
+ statusMessage?: string | undefined;
1000
+ }>, "many">;
1001
+ }, "strict", z.ZodTypeAny, {
1002
+ hooks: {
1003
+ type: "command";
1004
+ command: string;
1005
+ timeout?: number | undefined;
1006
+ statusMessage?: string | undefined;
1007
+ }[];
1008
+ matcher: string;
1009
+ }, {
1010
+ hooks: {
1011
+ type: "command";
1012
+ command: string;
1013
+ timeout?: number | undefined;
1014
+ statusMessage?: string | undefined;
1015
+ }[];
1016
+ matcher: string;
1017
+ }>, "many">>;
1018
+ PostToolUse: z.ZodOptional<z.ZodArray<z.ZodObject<{
1019
+ matcher: z.ZodString;
1020
+ hooks: z.ZodArray<z.ZodObject<{
1021
+ type: z.ZodLiteral<"command">;
1022
+ command: z.ZodString;
1023
+ timeout: z.ZodOptional<z.ZodNumber>;
1024
+ statusMessage: z.ZodOptional<z.ZodString>;
1025
+ }, "strict", z.ZodTypeAny, {
1026
+ type: "command";
1027
+ command: string;
1028
+ timeout?: number | undefined;
1029
+ statusMessage?: string | undefined;
1030
+ }, {
1031
+ type: "command";
1032
+ command: string;
1033
+ timeout?: number | undefined;
1034
+ statusMessage?: string | undefined;
1035
+ }>, "many">;
1036
+ }, "strict", z.ZodTypeAny, {
1037
+ hooks: {
1038
+ type: "command";
1039
+ command: string;
1040
+ timeout?: number | undefined;
1041
+ statusMessage?: string | undefined;
1042
+ }[];
1043
+ matcher: string;
1044
+ }, {
1045
+ hooks: {
1046
+ type: "command";
1047
+ command: string;
1048
+ timeout?: number | undefined;
1049
+ statusMessage?: string | undefined;
1050
+ }[];
1051
+ matcher: string;
1052
+ }>, "many">>;
1053
+ UserPromptSubmit: z.ZodOptional<z.ZodArray<z.ZodObject<{
1054
+ matcher: z.ZodString;
1055
+ hooks: z.ZodArray<z.ZodObject<{
1056
+ type: z.ZodLiteral<"command">;
1057
+ command: z.ZodString;
1058
+ timeout: z.ZodOptional<z.ZodNumber>;
1059
+ statusMessage: z.ZodOptional<z.ZodString>;
1060
+ }, "strict", z.ZodTypeAny, {
1061
+ type: "command";
1062
+ command: string;
1063
+ timeout?: number | undefined;
1064
+ statusMessage?: string | undefined;
1065
+ }, {
1066
+ type: "command";
1067
+ command: string;
1068
+ timeout?: number | undefined;
1069
+ statusMessage?: string | undefined;
1070
+ }>, "many">;
1071
+ }, "strict", z.ZodTypeAny, {
1072
+ hooks: {
1073
+ type: "command";
1074
+ command: string;
1075
+ timeout?: number | undefined;
1076
+ statusMessage?: string | undefined;
1077
+ }[];
1078
+ matcher: string;
1079
+ }, {
1080
+ hooks: {
1081
+ type: "command";
1082
+ command: string;
1083
+ timeout?: number | undefined;
1084
+ statusMessage?: string | undefined;
1085
+ }[];
1086
+ matcher: string;
1087
+ }>, "many">>;
1088
+ Stop: z.ZodOptional<z.ZodArray<z.ZodObject<{
1089
+ matcher: z.ZodString;
1090
+ hooks: z.ZodArray<z.ZodObject<{
1091
+ type: z.ZodLiteral<"command">;
1092
+ command: z.ZodString;
1093
+ timeout: z.ZodOptional<z.ZodNumber>;
1094
+ statusMessage: z.ZodOptional<z.ZodString>;
1095
+ }, "strict", z.ZodTypeAny, {
1096
+ type: "command";
1097
+ command: string;
1098
+ timeout?: number | undefined;
1099
+ statusMessage?: string | undefined;
1100
+ }, {
1101
+ type: "command";
1102
+ command: string;
1103
+ timeout?: number | undefined;
1104
+ statusMessage?: string | undefined;
1105
+ }>, "many">;
1106
+ }, "strict", z.ZodTypeAny, {
1107
+ hooks: {
1108
+ type: "command";
1109
+ command: string;
1110
+ timeout?: number | undefined;
1111
+ statusMessage?: string | undefined;
1112
+ }[];
1113
+ matcher: string;
1114
+ }, {
1115
+ hooks: {
1116
+ type: "command";
1117
+ command: string;
1118
+ timeout?: number | undefined;
1119
+ statusMessage?: string | undefined;
1120
+ }[];
1121
+ matcher: string;
1122
+ }>, "many">>;
1123
+ SubagentStop: z.ZodOptional<z.ZodArray<z.ZodObject<{
1124
+ matcher: z.ZodString;
1125
+ hooks: z.ZodArray<z.ZodObject<{
1126
+ type: z.ZodLiteral<"command">;
1127
+ command: z.ZodString;
1128
+ timeout: z.ZodOptional<z.ZodNumber>;
1129
+ statusMessage: z.ZodOptional<z.ZodString>;
1130
+ }, "strict", z.ZodTypeAny, {
1131
+ type: "command";
1132
+ command: string;
1133
+ timeout?: number | undefined;
1134
+ statusMessage?: string | undefined;
1135
+ }, {
1136
+ type: "command";
1137
+ command: string;
1138
+ timeout?: number | undefined;
1139
+ statusMessage?: string | undefined;
1140
+ }>, "many">;
1141
+ }, "strict", z.ZodTypeAny, {
1142
+ hooks: {
1143
+ type: "command";
1144
+ command: string;
1145
+ timeout?: number | undefined;
1146
+ statusMessage?: string | undefined;
1147
+ }[];
1148
+ matcher: string;
1149
+ }, {
1150
+ hooks: {
1151
+ type: "command";
1152
+ command: string;
1153
+ timeout?: number | undefined;
1154
+ statusMessage?: string | undefined;
1155
+ }[];
1156
+ matcher: string;
1157
+ }>, "many">>;
1158
+ PreCompact: z.ZodOptional<z.ZodArray<z.ZodObject<{
1159
+ matcher: z.ZodString;
1160
+ hooks: z.ZodArray<z.ZodObject<{
1161
+ type: z.ZodLiteral<"command">;
1162
+ command: z.ZodString;
1163
+ timeout: z.ZodOptional<z.ZodNumber>;
1164
+ statusMessage: z.ZodOptional<z.ZodString>;
1165
+ }, "strict", z.ZodTypeAny, {
1166
+ type: "command";
1167
+ command: string;
1168
+ timeout?: number | undefined;
1169
+ statusMessage?: string | undefined;
1170
+ }, {
1171
+ type: "command";
1172
+ command: string;
1173
+ timeout?: number | undefined;
1174
+ statusMessage?: string | undefined;
1175
+ }>, "many">;
1176
+ }, "strict", z.ZodTypeAny, {
1177
+ hooks: {
1178
+ type: "command";
1179
+ command: string;
1180
+ timeout?: number | undefined;
1181
+ statusMessage?: string | undefined;
1182
+ }[];
1183
+ matcher: string;
1184
+ }, {
1185
+ hooks: {
1186
+ type: "command";
1187
+ command: string;
1188
+ timeout?: number | undefined;
1189
+ statusMessage?: string | undefined;
1190
+ }[];
1191
+ matcher: string;
1192
+ }>, "many">>;
1193
+ Notification: z.ZodOptional<z.ZodArray<z.ZodObject<{
1194
+ matcher: z.ZodString;
1195
+ hooks: z.ZodArray<z.ZodObject<{
1196
+ type: z.ZodLiteral<"command">;
1197
+ command: z.ZodString;
1198
+ timeout: z.ZodOptional<z.ZodNumber>;
1199
+ statusMessage: z.ZodOptional<z.ZodString>;
1200
+ }, "strict", z.ZodTypeAny, {
1201
+ type: "command";
1202
+ command: string;
1203
+ timeout?: number | undefined;
1204
+ statusMessage?: string | undefined;
1205
+ }, {
1206
+ type: "command";
1207
+ command: string;
1208
+ timeout?: number | undefined;
1209
+ statusMessage?: string | undefined;
1210
+ }>, "many">;
1211
+ }, "strict", z.ZodTypeAny, {
1212
+ hooks: {
1213
+ type: "command";
1214
+ command: string;
1215
+ timeout?: number | undefined;
1216
+ statusMessage?: string | undefined;
1217
+ }[];
1218
+ matcher: string;
1219
+ }, {
1220
+ hooks: {
1221
+ type: "command";
1222
+ command: string;
1223
+ timeout?: number | undefined;
1224
+ statusMessage?: string | undefined;
1225
+ }[];
1226
+ matcher: string;
1227
+ }>, "many">>;
1228
+ SessionStart: z.ZodOptional<z.ZodArray<z.ZodObject<{
1229
+ matcher: z.ZodString;
1230
+ hooks: z.ZodArray<z.ZodObject<{
1231
+ type: z.ZodLiteral<"command">;
1232
+ command: z.ZodString;
1233
+ timeout: z.ZodOptional<z.ZodNumber>;
1234
+ statusMessage: z.ZodOptional<z.ZodString>;
1235
+ }, "strict", z.ZodTypeAny, {
1236
+ type: "command";
1237
+ command: string;
1238
+ timeout?: number | undefined;
1239
+ statusMessage?: string | undefined;
1240
+ }, {
1241
+ type: "command";
1242
+ command: string;
1243
+ timeout?: number | undefined;
1244
+ statusMessage?: string | undefined;
1245
+ }>, "many">;
1246
+ }, "strict", z.ZodTypeAny, {
1247
+ hooks: {
1248
+ type: "command";
1249
+ command: string;
1250
+ timeout?: number | undefined;
1251
+ statusMessage?: string | undefined;
1252
+ }[];
1253
+ matcher: string;
1254
+ }, {
1255
+ hooks: {
1256
+ type: "command";
1257
+ command: string;
1258
+ timeout?: number | undefined;
1259
+ statusMessage?: string | undefined;
1260
+ }[];
1261
+ matcher: string;
1262
+ }>, "many">>;
1263
+ }, "strict", z.ZodTypeAny, {
1264
+ PreToolUse?: {
1265
+ hooks: {
1266
+ type: "command";
1267
+ command: string;
1268
+ timeout?: number | undefined;
1269
+ statusMessage?: string | undefined;
1270
+ }[];
1271
+ matcher: string;
1272
+ }[] | undefined;
1273
+ PostToolUse?: {
1274
+ hooks: {
1275
+ type: "command";
1276
+ command: string;
1277
+ timeout?: number | undefined;
1278
+ statusMessage?: string | undefined;
1279
+ }[];
1280
+ matcher: string;
1281
+ }[] | undefined;
1282
+ Notification?: {
1283
+ hooks: {
1284
+ type: "command";
1285
+ command: string;
1286
+ timeout?: number | undefined;
1287
+ statusMessage?: string | undefined;
1288
+ }[];
1289
+ matcher: string;
1290
+ }[] | undefined;
1291
+ Stop?: {
1292
+ hooks: {
1293
+ type: "command";
1294
+ command: string;
1295
+ timeout?: number | undefined;
1296
+ statusMessage?: string | undefined;
1297
+ }[];
1298
+ matcher: string;
1299
+ }[] | undefined;
1300
+ UserPromptSubmit?: {
1301
+ hooks: {
1302
+ type: "command";
1303
+ command: string;
1304
+ timeout?: number | undefined;
1305
+ statusMessage?: string | undefined;
1306
+ }[];
1307
+ matcher: string;
1308
+ }[] | undefined;
1309
+ SubagentStop?: {
1310
+ hooks: {
1311
+ type: "command";
1312
+ command: string;
1313
+ timeout?: number | undefined;
1314
+ statusMessage?: string | undefined;
1315
+ }[];
1316
+ matcher: string;
1317
+ }[] | undefined;
1318
+ PreCompact?: {
1319
+ hooks: {
1320
+ type: "command";
1321
+ command: string;
1322
+ timeout?: number | undefined;
1323
+ statusMessage?: string | undefined;
1324
+ }[];
1325
+ matcher: string;
1326
+ }[] | undefined;
1327
+ SessionStart?: {
1328
+ hooks: {
1329
+ type: "command";
1330
+ command: string;
1331
+ timeout?: number | undefined;
1332
+ statusMessage?: string | undefined;
1333
+ }[];
1334
+ matcher: string;
1335
+ }[] | undefined;
1336
+ }, {
1337
+ PreToolUse?: {
1338
+ hooks: {
1339
+ type: "command";
1340
+ command: string;
1341
+ timeout?: number | undefined;
1342
+ statusMessage?: string | undefined;
1343
+ }[];
1344
+ matcher: string;
1345
+ }[] | undefined;
1346
+ PostToolUse?: {
1347
+ hooks: {
1348
+ type: "command";
1349
+ command: string;
1350
+ timeout?: number | undefined;
1351
+ statusMessage?: string | undefined;
1352
+ }[];
1353
+ matcher: string;
1354
+ }[] | undefined;
1355
+ Notification?: {
1356
+ hooks: {
1357
+ type: "command";
1358
+ command: string;
1359
+ timeout?: number | undefined;
1360
+ statusMessage?: string | undefined;
1361
+ }[];
1362
+ matcher: string;
1363
+ }[] | undefined;
1364
+ Stop?: {
1365
+ hooks: {
1366
+ type: "command";
1367
+ command: string;
1368
+ timeout?: number | undefined;
1369
+ statusMessage?: string | undefined;
1370
+ }[];
1371
+ matcher: string;
1372
+ }[] | undefined;
1373
+ UserPromptSubmit?: {
1374
+ hooks: {
1375
+ type: "command";
1376
+ command: string;
1377
+ timeout?: number | undefined;
1378
+ statusMessage?: string | undefined;
1379
+ }[];
1380
+ matcher: string;
1381
+ }[] | undefined;
1382
+ SubagentStop?: {
1383
+ hooks: {
1384
+ type: "command";
1385
+ command: string;
1386
+ timeout?: number | undefined;
1387
+ statusMessage?: string | undefined;
1388
+ }[];
1389
+ matcher: string;
1390
+ }[] | undefined;
1391
+ PreCompact?: {
1392
+ hooks: {
1393
+ type: "command";
1394
+ command: string;
1395
+ timeout?: number | undefined;
1396
+ statusMessage?: string | undefined;
1397
+ }[];
1398
+ matcher: string;
1399
+ }[] | undefined;
1400
+ SessionStart?: {
1401
+ hooks: {
1402
+ type: "command";
1403
+ command: string;
1404
+ timeout?: number | undefined;
1405
+ statusMessage?: string | undefined;
1406
+ }[];
1407
+ matcher: string;
1408
+ }[] | undefined;
1409
+ }>>;
1410
+ }, z.ZodTypeAny, "passthrough">>;
1411
+ /**
1412
+ * Strict variant for `rea doctor --strict`. Same shape as `SettingsSchema`
1413
+ * but rejects unknown top-level keys. Used only by the CI-gate path,
1414
+ * never by `rea upgrade`. Exported so the doctor can opt into stricter
1415
+ * validation when consumers explicitly request it.
1416
+ */
1417
+ export declare const SettingsSchemaStrict: z.ZodObject<{
1418
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1419
+ permissions: z.ZodOptional<z.ZodUnknown>;
1420
+ model: z.ZodOptional<z.ZodString>;
1421
+ hooks: z.ZodOptional<z.ZodObject<{
1422
+ PreToolUse: z.ZodOptional<z.ZodArray<z.ZodObject<{
1423
+ matcher: z.ZodString;
1424
+ hooks: z.ZodArray<z.ZodObject<{
1425
+ type: z.ZodLiteral<"command">;
1426
+ command: z.ZodString;
1427
+ timeout: z.ZodOptional<z.ZodNumber>;
1428
+ statusMessage: z.ZodOptional<z.ZodString>;
1429
+ }, "strict", z.ZodTypeAny, {
1430
+ type: "command";
1431
+ command: string;
1432
+ timeout?: number | undefined;
1433
+ statusMessage?: string | undefined;
1434
+ }, {
1435
+ type: "command";
1436
+ command: string;
1437
+ timeout?: number | undefined;
1438
+ statusMessage?: string | undefined;
1439
+ }>, "many">;
1440
+ }, "strict", z.ZodTypeAny, {
1441
+ hooks: {
1442
+ type: "command";
1443
+ command: string;
1444
+ timeout?: number | undefined;
1445
+ statusMessage?: string | undefined;
1446
+ }[];
1447
+ matcher: string;
1448
+ }, {
1449
+ hooks: {
1450
+ type: "command";
1451
+ command: string;
1452
+ timeout?: number | undefined;
1453
+ statusMessage?: string | undefined;
1454
+ }[];
1455
+ matcher: string;
1456
+ }>, "many">>;
1457
+ PostToolUse: z.ZodOptional<z.ZodArray<z.ZodObject<{
1458
+ matcher: z.ZodString;
1459
+ hooks: z.ZodArray<z.ZodObject<{
1460
+ type: z.ZodLiteral<"command">;
1461
+ command: z.ZodString;
1462
+ timeout: z.ZodOptional<z.ZodNumber>;
1463
+ statusMessage: z.ZodOptional<z.ZodString>;
1464
+ }, "strict", z.ZodTypeAny, {
1465
+ type: "command";
1466
+ command: string;
1467
+ timeout?: number | undefined;
1468
+ statusMessage?: string | undefined;
1469
+ }, {
1470
+ type: "command";
1471
+ command: string;
1472
+ timeout?: number | undefined;
1473
+ statusMessage?: string | undefined;
1474
+ }>, "many">;
1475
+ }, "strict", z.ZodTypeAny, {
1476
+ hooks: {
1477
+ type: "command";
1478
+ command: string;
1479
+ timeout?: number | undefined;
1480
+ statusMessage?: string | undefined;
1481
+ }[];
1482
+ matcher: string;
1483
+ }, {
1484
+ hooks: {
1485
+ type: "command";
1486
+ command: string;
1487
+ timeout?: number | undefined;
1488
+ statusMessage?: string | undefined;
1489
+ }[];
1490
+ matcher: string;
1491
+ }>, "many">>;
1492
+ UserPromptSubmit: z.ZodOptional<z.ZodArray<z.ZodObject<{
1493
+ matcher: z.ZodString;
1494
+ hooks: z.ZodArray<z.ZodObject<{
1495
+ type: z.ZodLiteral<"command">;
1496
+ command: z.ZodString;
1497
+ timeout: z.ZodOptional<z.ZodNumber>;
1498
+ statusMessage: z.ZodOptional<z.ZodString>;
1499
+ }, "strict", z.ZodTypeAny, {
1500
+ type: "command";
1501
+ command: string;
1502
+ timeout?: number | undefined;
1503
+ statusMessage?: string | undefined;
1504
+ }, {
1505
+ type: "command";
1506
+ command: string;
1507
+ timeout?: number | undefined;
1508
+ statusMessage?: string | undefined;
1509
+ }>, "many">;
1510
+ }, "strict", z.ZodTypeAny, {
1511
+ hooks: {
1512
+ type: "command";
1513
+ command: string;
1514
+ timeout?: number | undefined;
1515
+ statusMessage?: string | undefined;
1516
+ }[];
1517
+ matcher: string;
1518
+ }, {
1519
+ hooks: {
1520
+ type: "command";
1521
+ command: string;
1522
+ timeout?: number | undefined;
1523
+ statusMessage?: string | undefined;
1524
+ }[];
1525
+ matcher: string;
1526
+ }>, "many">>;
1527
+ Stop: z.ZodOptional<z.ZodArray<z.ZodObject<{
1528
+ matcher: z.ZodString;
1529
+ hooks: z.ZodArray<z.ZodObject<{
1530
+ type: z.ZodLiteral<"command">;
1531
+ command: z.ZodString;
1532
+ timeout: z.ZodOptional<z.ZodNumber>;
1533
+ statusMessage: z.ZodOptional<z.ZodString>;
1534
+ }, "strict", z.ZodTypeAny, {
1535
+ type: "command";
1536
+ command: string;
1537
+ timeout?: number | undefined;
1538
+ statusMessage?: string | undefined;
1539
+ }, {
1540
+ type: "command";
1541
+ command: string;
1542
+ timeout?: number | undefined;
1543
+ statusMessage?: string | undefined;
1544
+ }>, "many">;
1545
+ }, "strict", z.ZodTypeAny, {
1546
+ hooks: {
1547
+ type: "command";
1548
+ command: string;
1549
+ timeout?: number | undefined;
1550
+ statusMessage?: string | undefined;
1551
+ }[];
1552
+ matcher: string;
1553
+ }, {
1554
+ hooks: {
1555
+ type: "command";
1556
+ command: string;
1557
+ timeout?: number | undefined;
1558
+ statusMessage?: string | undefined;
1559
+ }[];
1560
+ matcher: string;
1561
+ }>, "many">>;
1562
+ SubagentStop: z.ZodOptional<z.ZodArray<z.ZodObject<{
1563
+ matcher: z.ZodString;
1564
+ hooks: z.ZodArray<z.ZodObject<{
1565
+ type: z.ZodLiteral<"command">;
1566
+ command: z.ZodString;
1567
+ timeout: z.ZodOptional<z.ZodNumber>;
1568
+ statusMessage: z.ZodOptional<z.ZodString>;
1569
+ }, "strict", z.ZodTypeAny, {
1570
+ type: "command";
1571
+ command: string;
1572
+ timeout?: number | undefined;
1573
+ statusMessage?: string | undefined;
1574
+ }, {
1575
+ type: "command";
1576
+ command: string;
1577
+ timeout?: number | undefined;
1578
+ statusMessage?: string | undefined;
1579
+ }>, "many">;
1580
+ }, "strict", z.ZodTypeAny, {
1581
+ hooks: {
1582
+ type: "command";
1583
+ command: string;
1584
+ timeout?: number | undefined;
1585
+ statusMessage?: string | undefined;
1586
+ }[];
1587
+ matcher: string;
1588
+ }, {
1589
+ hooks: {
1590
+ type: "command";
1591
+ command: string;
1592
+ timeout?: number | undefined;
1593
+ statusMessage?: string | undefined;
1594
+ }[];
1595
+ matcher: string;
1596
+ }>, "many">>;
1597
+ PreCompact: z.ZodOptional<z.ZodArray<z.ZodObject<{
1598
+ matcher: z.ZodString;
1599
+ hooks: z.ZodArray<z.ZodObject<{
1600
+ type: z.ZodLiteral<"command">;
1601
+ command: z.ZodString;
1602
+ timeout: z.ZodOptional<z.ZodNumber>;
1603
+ statusMessage: z.ZodOptional<z.ZodString>;
1604
+ }, "strict", z.ZodTypeAny, {
1605
+ type: "command";
1606
+ command: string;
1607
+ timeout?: number | undefined;
1608
+ statusMessage?: string | undefined;
1609
+ }, {
1610
+ type: "command";
1611
+ command: string;
1612
+ timeout?: number | undefined;
1613
+ statusMessage?: string | undefined;
1614
+ }>, "many">;
1615
+ }, "strict", z.ZodTypeAny, {
1616
+ hooks: {
1617
+ type: "command";
1618
+ command: string;
1619
+ timeout?: number | undefined;
1620
+ statusMessage?: string | undefined;
1621
+ }[];
1622
+ matcher: string;
1623
+ }, {
1624
+ hooks: {
1625
+ type: "command";
1626
+ command: string;
1627
+ timeout?: number | undefined;
1628
+ statusMessage?: string | undefined;
1629
+ }[];
1630
+ matcher: string;
1631
+ }>, "many">>;
1632
+ Notification: z.ZodOptional<z.ZodArray<z.ZodObject<{
1633
+ matcher: z.ZodString;
1634
+ hooks: z.ZodArray<z.ZodObject<{
1635
+ type: z.ZodLiteral<"command">;
1636
+ command: z.ZodString;
1637
+ timeout: z.ZodOptional<z.ZodNumber>;
1638
+ statusMessage: z.ZodOptional<z.ZodString>;
1639
+ }, "strict", z.ZodTypeAny, {
1640
+ type: "command";
1641
+ command: string;
1642
+ timeout?: number | undefined;
1643
+ statusMessage?: string | undefined;
1644
+ }, {
1645
+ type: "command";
1646
+ command: string;
1647
+ timeout?: number | undefined;
1648
+ statusMessage?: string | undefined;
1649
+ }>, "many">;
1650
+ }, "strict", z.ZodTypeAny, {
1651
+ hooks: {
1652
+ type: "command";
1653
+ command: string;
1654
+ timeout?: number | undefined;
1655
+ statusMessage?: string | undefined;
1656
+ }[];
1657
+ matcher: string;
1658
+ }, {
1659
+ hooks: {
1660
+ type: "command";
1661
+ command: string;
1662
+ timeout?: number | undefined;
1663
+ statusMessage?: string | undefined;
1664
+ }[];
1665
+ matcher: string;
1666
+ }>, "many">>;
1667
+ SessionStart: z.ZodOptional<z.ZodArray<z.ZodObject<{
1668
+ matcher: z.ZodString;
1669
+ hooks: z.ZodArray<z.ZodObject<{
1670
+ type: z.ZodLiteral<"command">;
1671
+ command: z.ZodString;
1672
+ timeout: z.ZodOptional<z.ZodNumber>;
1673
+ statusMessage: z.ZodOptional<z.ZodString>;
1674
+ }, "strict", z.ZodTypeAny, {
1675
+ type: "command";
1676
+ command: string;
1677
+ timeout?: number | undefined;
1678
+ statusMessage?: string | undefined;
1679
+ }, {
1680
+ type: "command";
1681
+ command: string;
1682
+ timeout?: number | undefined;
1683
+ statusMessage?: string | undefined;
1684
+ }>, "many">;
1685
+ }, "strict", z.ZodTypeAny, {
1686
+ hooks: {
1687
+ type: "command";
1688
+ command: string;
1689
+ timeout?: number | undefined;
1690
+ statusMessage?: string | undefined;
1691
+ }[];
1692
+ matcher: string;
1693
+ }, {
1694
+ hooks: {
1695
+ type: "command";
1696
+ command: string;
1697
+ timeout?: number | undefined;
1698
+ statusMessage?: string | undefined;
1699
+ }[];
1700
+ matcher: string;
1701
+ }>, "many">>;
1702
+ }, "strict", z.ZodTypeAny, {
1703
+ PreToolUse?: {
1704
+ hooks: {
1705
+ type: "command";
1706
+ command: string;
1707
+ timeout?: number | undefined;
1708
+ statusMessage?: string | undefined;
1709
+ }[];
1710
+ matcher: string;
1711
+ }[] | undefined;
1712
+ PostToolUse?: {
1713
+ hooks: {
1714
+ type: "command";
1715
+ command: string;
1716
+ timeout?: number | undefined;
1717
+ statusMessage?: string | undefined;
1718
+ }[];
1719
+ matcher: string;
1720
+ }[] | undefined;
1721
+ Notification?: {
1722
+ hooks: {
1723
+ type: "command";
1724
+ command: string;
1725
+ timeout?: number | undefined;
1726
+ statusMessage?: string | undefined;
1727
+ }[];
1728
+ matcher: string;
1729
+ }[] | undefined;
1730
+ Stop?: {
1731
+ hooks: {
1732
+ type: "command";
1733
+ command: string;
1734
+ timeout?: number | undefined;
1735
+ statusMessage?: string | undefined;
1736
+ }[];
1737
+ matcher: string;
1738
+ }[] | undefined;
1739
+ UserPromptSubmit?: {
1740
+ hooks: {
1741
+ type: "command";
1742
+ command: string;
1743
+ timeout?: number | undefined;
1744
+ statusMessage?: string | undefined;
1745
+ }[];
1746
+ matcher: string;
1747
+ }[] | undefined;
1748
+ SubagentStop?: {
1749
+ hooks: {
1750
+ type: "command";
1751
+ command: string;
1752
+ timeout?: number | undefined;
1753
+ statusMessage?: string | undefined;
1754
+ }[];
1755
+ matcher: string;
1756
+ }[] | undefined;
1757
+ PreCompact?: {
1758
+ hooks: {
1759
+ type: "command";
1760
+ command: string;
1761
+ timeout?: number | undefined;
1762
+ statusMessage?: string | undefined;
1763
+ }[];
1764
+ matcher: string;
1765
+ }[] | undefined;
1766
+ SessionStart?: {
1767
+ hooks: {
1768
+ type: "command";
1769
+ command: string;
1770
+ timeout?: number | undefined;
1771
+ statusMessage?: string | undefined;
1772
+ }[];
1773
+ matcher: string;
1774
+ }[] | undefined;
1775
+ }, {
1776
+ PreToolUse?: {
1777
+ hooks: {
1778
+ type: "command";
1779
+ command: string;
1780
+ timeout?: number | undefined;
1781
+ statusMessage?: string | undefined;
1782
+ }[];
1783
+ matcher: string;
1784
+ }[] | undefined;
1785
+ PostToolUse?: {
1786
+ hooks: {
1787
+ type: "command";
1788
+ command: string;
1789
+ timeout?: number | undefined;
1790
+ statusMessage?: string | undefined;
1791
+ }[];
1792
+ matcher: string;
1793
+ }[] | undefined;
1794
+ Notification?: {
1795
+ hooks: {
1796
+ type: "command";
1797
+ command: string;
1798
+ timeout?: number | undefined;
1799
+ statusMessage?: string | undefined;
1800
+ }[];
1801
+ matcher: string;
1802
+ }[] | undefined;
1803
+ Stop?: {
1804
+ hooks: {
1805
+ type: "command";
1806
+ command: string;
1807
+ timeout?: number | undefined;
1808
+ statusMessage?: string | undefined;
1809
+ }[];
1810
+ matcher: string;
1811
+ }[] | undefined;
1812
+ UserPromptSubmit?: {
1813
+ hooks: {
1814
+ type: "command";
1815
+ command: string;
1816
+ timeout?: number | undefined;
1817
+ statusMessage?: string | undefined;
1818
+ }[];
1819
+ matcher: string;
1820
+ }[] | undefined;
1821
+ SubagentStop?: {
1822
+ hooks: {
1823
+ type: "command";
1824
+ command: string;
1825
+ timeout?: number | undefined;
1826
+ statusMessage?: string | undefined;
1827
+ }[];
1828
+ matcher: string;
1829
+ }[] | undefined;
1830
+ PreCompact?: {
1831
+ hooks: {
1832
+ type: "command";
1833
+ command: string;
1834
+ timeout?: number | undefined;
1835
+ statusMessage?: string | undefined;
1836
+ }[];
1837
+ matcher: string;
1838
+ }[] | undefined;
1839
+ SessionStart?: {
1840
+ hooks: {
1841
+ type: "command";
1842
+ command: string;
1843
+ timeout?: number | undefined;
1844
+ statusMessage?: string | undefined;
1845
+ }[];
1846
+ matcher: string;
1847
+ }[] | undefined;
1848
+ }>>;
1849
+ }, "strict", z.ZodTypeAny, {
1850
+ env?: Record<string, string> | undefined;
1851
+ hooks?: {
1852
+ PreToolUse?: {
1853
+ hooks: {
1854
+ type: "command";
1855
+ command: string;
1856
+ timeout?: number | undefined;
1857
+ statusMessage?: string | undefined;
1858
+ }[];
1859
+ matcher: string;
1860
+ }[] | undefined;
1861
+ PostToolUse?: {
1862
+ hooks: {
1863
+ type: "command";
1864
+ command: string;
1865
+ timeout?: number | undefined;
1866
+ statusMessage?: string | undefined;
1867
+ }[];
1868
+ matcher: string;
1869
+ }[] | undefined;
1870
+ Notification?: {
1871
+ hooks: {
1872
+ type: "command";
1873
+ command: string;
1874
+ timeout?: number | undefined;
1875
+ statusMessage?: string | undefined;
1876
+ }[];
1877
+ matcher: string;
1878
+ }[] | undefined;
1879
+ Stop?: {
1880
+ hooks: {
1881
+ type: "command";
1882
+ command: string;
1883
+ timeout?: number | undefined;
1884
+ statusMessage?: string | undefined;
1885
+ }[];
1886
+ matcher: string;
1887
+ }[] | undefined;
1888
+ UserPromptSubmit?: {
1889
+ hooks: {
1890
+ type: "command";
1891
+ command: string;
1892
+ timeout?: number | undefined;
1893
+ statusMessage?: string | undefined;
1894
+ }[];
1895
+ matcher: string;
1896
+ }[] | undefined;
1897
+ SubagentStop?: {
1898
+ hooks: {
1899
+ type: "command";
1900
+ command: string;
1901
+ timeout?: number | undefined;
1902
+ statusMessage?: string | undefined;
1903
+ }[];
1904
+ matcher: string;
1905
+ }[] | undefined;
1906
+ PreCompact?: {
1907
+ hooks: {
1908
+ type: "command";
1909
+ command: string;
1910
+ timeout?: number | undefined;
1911
+ statusMessage?: string | undefined;
1912
+ }[];
1913
+ matcher: string;
1914
+ }[] | undefined;
1915
+ SessionStart?: {
1916
+ hooks: {
1917
+ type: "command";
1918
+ command: string;
1919
+ timeout?: number | undefined;
1920
+ statusMessage?: string | undefined;
1921
+ }[];
1922
+ matcher: string;
1923
+ }[] | undefined;
1924
+ } | undefined;
1925
+ permissions?: unknown;
1926
+ model?: string | undefined;
1927
+ }, {
1928
+ env?: Record<string, string> | undefined;
1929
+ hooks?: {
1930
+ PreToolUse?: {
1931
+ hooks: {
1932
+ type: "command";
1933
+ command: string;
1934
+ timeout?: number | undefined;
1935
+ statusMessage?: string | undefined;
1936
+ }[];
1937
+ matcher: string;
1938
+ }[] | undefined;
1939
+ PostToolUse?: {
1940
+ hooks: {
1941
+ type: "command";
1942
+ command: string;
1943
+ timeout?: number | undefined;
1944
+ statusMessage?: string | undefined;
1945
+ }[];
1946
+ matcher: string;
1947
+ }[] | undefined;
1948
+ Notification?: {
1949
+ hooks: {
1950
+ type: "command";
1951
+ command: string;
1952
+ timeout?: number | undefined;
1953
+ statusMessage?: string | undefined;
1954
+ }[];
1955
+ matcher: string;
1956
+ }[] | undefined;
1957
+ Stop?: {
1958
+ hooks: {
1959
+ type: "command";
1960
+ command: string;
1961
+ timeout?: number | undefined;
1962
+ statusMessage?: string | undefined;
1963
+ }[];
1964
+ matcher: string;
1965
+ }[] | undefined;
1966
+ UserPromptSubmit?: {
1967
+ hooks: {
1968
+ type: "command";
1969
+ command: string;
1970
+ timeout?: number | undefined;
1971
+ statusMessage?: string | undefined;
1972
+ }[];
1973
+ matcher: string;
1974
+ }[] | undefined;
1975
+ SubagentStop?: {
1976
+ hooks: {
1977
+ type: "command";
1978
+ command: string;
1979
+ timeout?: number | undefined;
1980
+ statusMessage?: string | undefined;
1981
+ }[];
1982
+ matcher: string;
1983
+ }[] | undefined;
1984
+ PreCompact?: {
1985
+ hooks: {
1986
+ type: "command";
1987
+ command: string;
1988
+ timeout?: number | undefined;
1989
+ statusMessage?: string | undefined;
1990
+ }[];
1991
+ matcher: string;
1992
+ }[] | undefined;
1993
+ SessionStart?: {
1994
+ hooks: {
1995
+ type: "command";
1996
+ command: string;
1997
+ timeout?: number | undefined;
1998
+ statusMessage?: string | undefined;
1999
+ }[];
2000
+ matcher: string;
2001
+ }[] | undefined;
2002
+ } | undefined;
2003
+ permissions?: unknown;
2004
+ model?: string | undefined;
2005
+ }>;
2006
+ export type Settings = z.infer<typeof SettingsSchema>;
2007
+ /**
2008
+ * Path-traversal check on every `command` value. Zod's job is shape;
2009
+ * this lives OUTSIDE the schema so the rule is auditable separately.
2010
+ *
2011
+ * Algorithm:
2012
+ * 1. Strip `$CLAUDE_PROJECT_DIR` (the harness expands this at exec).
2013
+ * 2. Strip `"$CLAUDE_PROJECT_DIR"` (the canonical quoted form rea
2014
+ * itself emits).
2015
+ * 3. Search for `..<sep>` segments in what remains. A literal `..`
2016
+ * anywhere in the path is treated as traversal.
2017
+ *
2018
+ * Returns a list of `{ event, matcher, index, command, reason }`
2019
+ * tuples. Empty list = clean.
2020
+ */
2021
+ export interface TraversalFinding {
2022
+ event: string;
2023
+ matcher: string;
2024
+ index: number;
2025
+ command: string;
2026
+ reason: string;
2027
+ }
2028
+ export declare function validateNoTraversal(settings: Settings): TraversalFinding[];
2029
+ /**
2030
+ * Result of validating a consumer `.claude/settings.json`.
2031
+ *
2032
+ * - `parsed: true` — zod parse succeeded; the schema-typed value is
2033
+ * `settings`.
2034
+ * - `parsed: false` — zod failed; `errors` is the list of
2035
+ * `z.ZodIssue` strings.
2036
+ *
2037
+ * Findings are accumulated regardless of zod success:
2038
+ * - `traversalFindings` — `..` segments inside `command` values.
2039
+ * - `missingReaHooks` — rea-shipped hooks (`EXPECTED_HOOKS`) that do
2040
+ * not appear in any `command` value across PreToolUse +
2041
+ * PostToolUse. Strict-mode `rea doctor` fails on a non-empty
2042
+ * list.
2043
+ *
2044
+ * Lossy-but-useful: when zod fails, we still try the traversal +
2045
+ * missing-hooks checks against the raw input so the operator sees as
2046
+ * much information as possible per `rea doctor` invocation.
2047
+ */
2048
+ export interface SettingsValidationResult {
2049
+ parsed: boolean;
2050
+ settings: Settings | null;
2051
+ errors: string[];
2052
+ traversalFindings: TraversalFinding[];
2053
+ missingReaHooks: string[];
2054
+ /**
2055
+ * Schema-passes-but-not-strict warnings: unknown top-level keys,
2056
+ * unknown hook event names that we recognized as strings but didn't
2057
+ * match the union. Empty when nothing surprising lurks.
2058
+ */
2059
+ warnings: string[];
2060
+ }
2061
+ /**
2062
+ * Validate a parsed JSON object against the settings schema.
2063
+ *
2064
+ * Strategy: try `SettingsSchema.parse(input)`. On success run the
2065
+ * traversal + missing-hooks checks. On failure fall back to a
2066
+ * best-effort scan of any `hooks: { PreToolUse: [...] }` shape we
2067
+ * recognize, so the operator still sees traversal + missing-hooks
2068
+ * findings.
2069
+ *
2070
+ * `strict` selects the schema:
2071
+ * - `false` (default) — `SettingsSchema`, top-level `.passthrough()`.
2072
+ * Unknown harness keys pass. Used by `rea upgrade` and advisory
2073
+ * `rea doctor`.
2074
+ * - `true` — `SettingsSchemaStrict`, top-level `.strict()`. Unknown
2075
+ * keys fail the parse. Used only by `rea doctor --strict` (the CI
2076
+ * gate path). 0.30.1 round-5 P2: the strict schema existed since
2077
+ * 0.30.0 but `validateSettings` never accepted the selector, so
2078
+ * `rea doctor --strict` silently ran the lenient schema.
2079
+ */
2080
+ export declare function validateSettings(input: unknown, options?: {
2081
+ strict?: boolean;
2082
+ }): SettingsValidationResult;
2083
+ /**
2084
+ * Cross-check: every name in `EXPECTED_HOOKS` should appear as the
2085
+ * basename of at least one `command` across PreToolUse + PostToolUse.
2086
+ * Returns the missing list (empty when complete).
2087
+ *
2088
+ * Defensive: `EXPECTED_HOOKS` is sourced from `doctor.ts` so the
2089
+ * single edit-point is preserved (new hook adds → both doctor's
2090
+ * file-existence check AND this schema check pick it up).
2091
+ */
2092
+ export declare function findMissingReaHooks(settings: Settings): string[];
2093
+ /**
2094
+ * Compute the desired-hooks registration that `rea init` would emit
2095
+ * for a fresh install. Exported so `rea doctor --strict` can show the
2096
+ * operator the exact set the schema is enforcing without forcing them
2097
+ * to dig through source.
2098
+ */
2099
+ export declare function expectedHookNames(): string[];