@goodtiming/baton-sdk 0.5.1 → 0.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
 
3
- declare const SDK_VERSION = "ts-0.5.1";
3
+ declare const SDK_VERSION = "ts-0.5.3";
4
4
 
5
5
  /**
6
6
  * Zod schemas + TS types for the Baton event stream per SPEC §11.4.
@@ -173,6 +173,9 @@ declare const EventTypeSchema: z.ZodEnum<{
173
173
  prompt_get_start: "prompt_get_start";
174
174
  prompt_get_end: "prompt_get_end";
175
175
  prompt_get_error: "prompt_get_error";
176
+ tool_list_start: "tool_list_start";
177
+ tool_list_end: "tool_list_end";
178
+ tool_list_error: "tool_list_error";
176
179
  }>;
177
180
  type EventType = z.infer<typeof EventTypeSchema>;
178
181
  /** `resources/list` reached the server. Deliberately EMPTY — a list request
@@ -261,6 +264,24 @@ declare const PromptListErrorPayloadSchema: z.ZodObject<{
261
264
  error_body: z.ZodString;
262
265
  }, z.core.$strict>;
263
266
  type PromptListErrorPayload = z.infer<typeof PromptListErrorPayloadSchema>;
267
+ /** `tools/list` reached the server (SPEC §11.4.5). Empty, for the reason
268
+ * `ResourceListStartPayloadSchema` carries. */
269
+ declare const ToolListStartPayloadSchema: z.ZodObject<{}, z.core.$strict>;
270
+ type ToolListStartPayload = z.infer<typeof ToolListStartPayloadSchema>;
271
+ /** `tools/list` returned. `count` is the length of the `tools` array in that
272
+ * one response, this SDK's own tool included. */
273
+ declare const ToolListEndPayloadSchema: z.ZodObject<{
274
+ duration_ms: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
275
+ count: z.ZodNumber;
276
+ }, z.core.$strict>;
277
+ type ToolListEndPayload = z.infer<typeof ToolListEndPayloadSchema>;
278
+ /** `tools/list` failed. See `ResourceReadErrorPayloadSchema`. */
279
+ declare const ToolListErrorPayloadSchema: z.ZodObject<{
280
+ duration_ms: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
281
+ error_type: z.ZodString;
282
+ error_body: z.ZodString;
283
+ }, z.core.$strict>;
284
+ type ToolListErrorPayload = z.infer<typeof ToolListErrorPayloadSchema>;
264
285
  /** `prompts/get` reached the server.
265
286
  *
266
287
  * ⚠ **`params` is the request's `arguments` member ALONE, not the whole params
@@ -293,6 +314,7 @@ declare const PromptGetErrorPayloadSchema: z.ZodObject<{
293
314
  }, z.core.$strict>;
294
315
  type PromptGetErrorPayload = z.infer<typeof PromptGetErrorPayloadSchema>;
295
316
  declare const ToolCallStartEventSchema: z.ZodObject<{
317
+ call_id: z.ZodString;
296
318
  event_type: z.ZodDefault<z.ZodLiteral<"tool_call_start">>;
297
319
  payload: z.ZodObject<{
298
320
  tool_name: z.ZodString;
@@ -318,11 +340,21 @@ declare const ToolCallStartEventSchema: z.ZodObject<{
318
340
  display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
319
341
  }, z.core.$strict>>>;
320
342
  transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
321
- call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
343
+ client_observed: z.ZodDefault<z.ZodNullable<z.ZodObject<{
344
+ info: z.ZodOptional<z.ZodObject<{
345
+ name: z.ZodOptional<z.ZodString>;
346
+ version: z.ZodOptional<z.ZodString>;
347
+ }, z.core.$strict>>;
348
+ headers: z.ZodOptional<z.ZodObject<{
349
+ "user-agent": z.ZodOptional<z.ZodString>;
350
+ "x-anthropic-client": z.ZodOptional<z.ZodString>;
351
+ }, z.core.$strict>>;
352
+ }, z.core.$strict>>>;
322
353
  runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
323
354
  }, z.core.$strict>;
324
355
  type ToolCallStartEvent = z.infer<typeof ToolCallStartEventSchema>;
325
356
  declare const ToolCallEndEventSchema: z.ZodObject<{
357
+ call_id: z.ZodString;
326
358
  event_type: z.ZodDefault<z.ZodLiteral<"tool_call_end">>;
327
359
  payload: z.ZodObject<{
328
360
  tool_name: z.ZodString;
@@ -346,11 +378,21 @@ declare const ToolCallEndEventSchema: z.ZodObject<{
346
378
  display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
347
379
  }, z.core.$strict>>>;
348
380
  transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
349
- call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
381
+ client_observed: z.ZodDefault<z.ZodNullable<z.ZodObject<{
382
+ info: z.ZodOptional<z.ZodObject<{
383
+ name: z.ZodOptional<z.ZodString>;
384
+ version: z.ZodOptional<z.ZodString>;
385
+ }, z.core.$strict>>;
386
+ headers: z.ZodOptional<z.ZodObject<{
387
+ "user-agent": z.ZodOptional<z.ZodString>;
388
+ "x-anthropic-client": z.ZodOptional<z.ZodString>;
389
+ }, z.core.$strict>>;
390
+ }, z.core.$strict>>>;
350
391
  runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
351
392
  }, z.core.$strict>;
352
393
  type ToolCallEndEvent = z.infer<typeof ToolCallEndEventSchema>;
353
394
  declare const ToolCallErrorEventSchema: z.ZodObject<{
395
+ call_id: z.ZodString;
354
396
  event_type: z.ZodDefault<z.ZodLiteral<"tool_call_error">>;
355
397
  payload: z.ZodObject<{
356
398
  tool_name: z.ZodString;
@@ -377,7 +419,16 @@ declare const ToolCallErrorEventSchema: z.ZodObject<{
377
419
  display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
378
420
  }, z.core.$strict>>>;
379
421
  transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
380
- call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
422
+ client_observed: z.ZodDefault<z.ZodNullable<z.ZodObject<{
423
+ info: z.ZodOptional<z.ZodObject<{
424
+ name: z.ZodOptional<z.ZodString>;
425
+ version: z.ZodOptional<z.ZodString>;
426
+ }, z.core.$strict>>;
427
+ headers: z.ZodOptional<z.ZodObject<{
428
+ "user-agent": z.ZodOptional<z.ZodString>;
429
+ "x-anthropic-client": z.ZodOptional<z.ZodString>;
430
+ }, z.core.$strict>>;
431
+ }, z.core.$strict>>>;
381
432
  runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
382
433
  }, z.core.$strict>;
383
434
  type ToolCallErrorEvent = z.infer<typeof ToolCallErrorEventSchema>;
@@ -409,6 +460,16 @@ declare const AnnotationEventSchema: z.ZodObject<{
409
460
  display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
410
461
  }, z.core.$strict>>>;
411
462
  transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
463
+ client_observed: z.ZodDefault<z.ZodNullable<z.ZodObject<{
464
+ info: z.ZodOptional<z.ZodObject<{
465
+ name: z.ZodOptional<z.ZodString>;
466
+ version: z.ZodOptional<z.ZodString>;
467
+ }, z.core.$strict>>;
468
+ headers: z.ZodOptional<z.ZodObject<{
469
+ "user-agent": z.ZodOptional<z.ZodString>;
470
+ "x-anthropic-client": z.ZodOptional<z.ZodString>;
471
+ }, z.core.$strict>>;
472
+ }, z.core.$strict>>>;
412
473
  call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
413
474
  runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
414
475
  }, z.core.$strict>;
@@ -439,6 +500,16 @@ declare const SurfaceSnapshotEventSchema: z.ZodObject<{
439
500
  display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
440
501
  }, z.core.$strict>>>;
441
502
  transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
503
+ client_observed: z.ZodDefault<z.ZodNullable<z.ZodObject<{
504
+ info: z.ZodOptional<z.ZodObject<{
505
+ name: z.ZodOptional<z.ZodString>;
506
+ version: z.ZodOptional<z.ZodString>;
507
+ }, z.core.$strict>>;
508
+ headers: z.ZodOptional<z.ZodObject<{
509
+ "user-agent": z.ZodOptional<z.ZodString>;
510
+ "x-anthropic-client": z.ZodOptional<z.ZodString>;
511
+ }, z.core.$strict>>;
512
+ }, z.core.$strict>>>;
442
513
  call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
443
514
  runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
444
515
  }, z.core.$strict>;
@@ -462,6 +533,16 @@ declare const ResourceListStartEventSchema: z.ZodObject<{
462
533
  display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
463
534
  }, z.core.$strict>>>;
464
535
  transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
536
+ client_observed: z.ZodDefault<z.ZodNullable<z.ZodObject<{
537
+ info: z.ZodOptional<z.ZodObject<{
538
+ name: z.ZodOptional<z.ZodString>;
539
+ version: z.ZodOptional<z.ZodString>;
540
+ }, z.core.$strict>>;
541
+ headers: z.ZodOptional<z.ZodObject<{
542
+ "user-agent": z.ZodOptional<z.ZodString>;
543
+ "x-anthropic-client": z.ZodOptional<z.ZodString>;
544
+ }, z.core.$strict>>;
545
+ }, z.core.$strict>>>;
465
546
  call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
466
547
  runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
467
548
  }, z.core.$strict>;
@@ -488,6 +569,16 @@ declare const ResourceListEndEventSchema: z.ZodObject<{
488
569
  display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
489
570
  }, z.core.$strict>>>;
490
571
  transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
572
+ client_observed: z.ZodDefault<z.ZodNullable<z.ZodObject<{
573
+ info: z.ZodOptional<z.ZodObject<{
574
+ name: z.ZodOptional<z.ZodString>;
575
+ version: z.ZodOptional<z.ZodString>;
576
+ }, z.core.$strict>>;
577
+ headers: z.ZodOptional<z.ZodObject<{
578
+ "user-agent": z.ZodOptional<z.ZodString>;
579
+ "x-anthropic-client": z.ZodOptional<z.ZodString>;
580
+ }, z.core.$strict>>;
581
+ }, z.core.$strict>>>;
491
582
  call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
492
583
  runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
493
584
  }, z.core.$strict>;
@@ -515,6 +606,16 @@ declare const ResourceListErrorEventSchema: z.ZodObject<{
515
606
  display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
516
607
  }, z.core.$strict>>>;
517
608
  transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
609
+ client_observed: z.ZodDefault<z.ZodNullable<z.ZodObject<{
610
+ info: z.ZodOptional<z.ZodObject<{
611
+ name: z.ZodOptional<z.ZodString>;
612
+ version: z.ZodOptional<z.ZodString>;
613
+ }, z.core.$strict>>;
614
+ headers: z.ZodOptional<z.ZodObject<{
615
+ "user-agent": z.ZodOptional<z.ZodString>;
616
+ "x-anthropic-client": z.ZodOptional<z.ZodString>;
617
+ }, z.core.$strict>>;
618
+ }, z.core.$strict>>>;
518
619
  call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
519
620
  runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
520
621
  }, z.core.$strict>;
@@ -541,6 +642,16 @@ declare const ResourceReadStartEventSchema: z.ZodObject<{
541
642
  display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
542
643
  }, z.core.$strict>>>;
543
644
  transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
645
+ client_observed: z.ZodDefault<z.ZodNullable<z.ZodObject<{
646
+ info: z.ZodOptional<z.ZodObject<{
647
+ name: z.ZodOptional<z.ZodString>;
648
+ version: z.ZodOptional<z.ZodString>;
649
+ }, z.core.$strict>>;
650
+ headers: z.ZodOptional<z.ZodObject<{
651
+ "user-agent": z.ZodOptional<z.ZodString>;
652
+ "x-anthropic-client": z.ZodOptional<z.ZodString>;
653
+ }, z.core.$strict>>;
654
+ }, z.core.$strict>>>;
544
655
  call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
545
656
  runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
546
657
  }, z.core.$strict>;
@@ -567,6 +678,16 @@ declare const ResourceReadEndEventSchema: z.ZodObject<{
567
678
  display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
568
679
  }, z.core.$strict>>>;
569
680
  transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
681
+ client_observed: z.ZodDefault<z.ZodNullable<z.ZodObject<{
682
+ info: z.ZodOptional<z.ZodObject<{
683
+ name: z.ZodOptional<z.ZodString>;
684
+ version: z.ZodOptional<z.ZodString>;
685
+ }, z.core.$strict>>;
686
+ headers: z.ZodOptional<z.ZodObject<{
687
+ "user-agent": z.ZodOptional<z.ZodString>;
688
+ "x-anthropic-client": z.ZodOptional<z.ZodString>;
689
+ }, z.core.$strict>>;
690
+ }, z.core.$strict>>>;
570
691
  call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
571
692
  runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
572
693
  }, z.core.$strict>;
@@ -595,6 +716,16 @@ declare const ResourceReadErrorEventSchema: z.ZodObject<{
595
716
  display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
596
717
  }, z.core.$strict>>>;
597
718
  transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
719
+ client_observed: z.ZodDefault<z.ZodNullable<z.ZodObject<{
720
+ info: z.ZodOptional<z.ZodObject<{
721
+ name: z.ZodOptional<z.ZodString>;
722
+ version: z.ZodOptional<z.ZodString>;
723
+ }, z.core.$strict>>;
724
+ headers: z.ZodOptional<z.ZodObject<{
725
+ "user-agent": z.ZodOptional<z.ZodString>;
726
+ "x-anthropic-client": z.ZodOptional<z.ZodString>;
727
+ }, z.core.$strict>>;
728
+ }, z.core.$strict>>>;
598
729
  call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
599
730
  runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
600
731
  }, z.core.$strict>;
@@ -618,6 +749,16 @@ declare const PromptListStartEventSchema: z.ZodObject<{
618
749
  display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
619
750
  }, z.core.$strict>>>;
620
751
  transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
752
+ client_observed: z.ZodDefault<z.ZodNullable<z.ZodObject<{
753
+ info: z.ZodOptional<z.ZodObject<{
754
+ name: z.ZodOptional<z.ZodString>;
755
+ version: z.ZodOptional<z.ZodString>;
756
+ }, z.core.$strict>>;
757
+ headers: z.ZodOptional<z.ZodObject<{
758
+ "user-agent": z.ZodOptional<z.ZodString>;
759
+ "x-anthropic-client": z.ZodOptional<z.ZodString>;
760
+ }, z.core.$strict>>;
761
+ }, z.core.$strict>>>;
621
762
  call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
622
763
  runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
623
764
  }, z.core.$strict>;
@@ -644,6 +785,16 @@ declare const PromptListEndEventSchema: z.ZodObject<{
644
785
  display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
645
786
  }, z.core.$strict>>>;
646
787
  transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
788
+ client_observed: z.ZodDefault<z.ZodNullable<z.ZodObject<{
789
+ info: z.ZodOptional<z.ZodObject<{
790
+ name: z.ZodOptional<z.ZodString>;
791
+ version: z.ZodOptional<z.ZodString>;
792
+ }, z.core.$strict>>;
793
+ headers: z.ZodOptional<z.ZodObject<{
794
+ "user-agent": z.ZodOptional<z.ZodString>;
795
+ "x-anthropic-client": z.ZodOptional<z.ZodString>;
796
+ }, z.core.$strict>>;
797
+ }, z.core.$strict>>>;
647
798
  call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
648
799
  runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
649
800
  }, z.core.$strict>;
@@ -671,6 +822,16 @@ declare const PromptListErrorEventSchema: z.ZodObject<{
671
822
  display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
672
823
  }, z.core.$strict>>>;
673
824
  transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
825
+ client_observed: z.ZodDefault<z.ZodNullable<z.ZodObject<{
826
+ info: z.ZodOptional<z.ZodObject<{
827
+ name: z.ZodOptional<z.ZodString>;
828
+ version: z.ZodOptional<z.ZodString>;
829
+ }, z.core.$strict>>;
830
+ headers: z.ZodOptional<z.ZodObject<{
831
+ "user-agent": z.ZodOptional<z.ZodString>;
832
+ "x-anthropic-client": z.ZodOptional<z.ZodString>;
833
+ }, z.core.$strict>>;
834
+ }, z.core.$strict>>>;
674
835
  call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
675
836
  runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
676
837
  }, z.core.$strict>;
@@ -697,6 +858,16 @@ declare const PromptGetStartEventSchema: z.ZodObject<{
697
858
  display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
698
859
  }, z.core.$strict>>>;
699
860
  transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
861
+ client_observed: z.ZodDefault<z.ZodNullable<z.ZodObject<{
862
+ info: z.ZodOptional<z.ZodObject<{
863
+ name: z.ZodOptional<z.ZodString>;
864
+ version: z.ZodOptional<z.ZodString>;
865
+ }, z.core.$strict>>;
866
+ headers: z.ZodOptional<z.ZodObject<{
867
+ "user-agent": z.ZodOptional<z.ZodString>;
868
+ "x-anthropic-client": z.ZodOptional<z.ZodString>;
869
+ }, z.core.$strict>>;
870
+ }, z.core.$strict>>>;
700
871
  call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
701
872
  runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
702
873
  }, z.core.$strict>;
@@ -723,6 +894,16 @@ declare const PromptGetEndEventSchema: z.ZodObject<{
723
894
  display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
724
895
  }, z.core.$strict>>>;
725
896
  transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
897
+ client_observed: z.ZodDefault<z.ZodNullable<z.ZodObject<{
898
+ info: z.ZodOptional<z.ZodObject<{
899
+ name: z.ZodOptional<z.ZodString>;
900
+ version: z.ZodOptional<z.ZodString>;
901
+ }, z.core.$strict>>;
902
+ headers: z.ZodOptional<z.ZodObject<{
903
+ "user-agent": z.ZodOptional<z.ZodString>;
904
+ "x-anthropic-client": z.ZodOptional<z.ZodString>;
905
+ }, z.core.$strict>>;
906
+ }, z.core.$strict>>>;
726
907
  call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
727
908
  runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
728
909
  }, z.core.$strict>;
@@ -751,11 +932,128 @@ declare const PromptGetErrorEventSchema: z.ZodObject<{
751
932
  display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
752
933
  }, z.core.$strict>>>;
753
934
  transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
935
+ client_observed: z.ZodDefault<z.ZodNullable<z.ZodObject<{
936
+ info: z.ZodOptional<z.ZodObject<{
937
+ name: z.ZodOptional<z.ZodString>;
938
+ version: z.ZodOptional<z.ZodString>;
939
+ }, z.core.$strict>>;
940
+ headers: z.ZodOptional<z.ZodObject<{
941
+ "user-agent": z.ZodOptional<z.ZodString>;
942
+ "x-anthropic-client": z.ZodOptional<z.ZodString>;
943
+ }, z.core.$strict>>;
944
+ }, z.core.$strict>>>;
754
945
  call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
755
946
  runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
756
947
  }, z.core.$strict>;
757
948
  type PromptGetErrorEvent = z.infer<typeof PromptGetErrorEventSchema>;
949
+ declare const ToolListStartEventSchema: z.ZodObject<{
950
+ event_type: z.ZodDefault<z.ZodLiteral<"tool_list_start">>;
951
+ payload: z.ZodObject<{}, z.core.$strict>;
952
+ event_id: z.ZodDefault<z.ZodUUID>;
953
+ tenant_id: z.ZodString;
954
+ vendor_id: z.ZodString;
955
+ session_id: z.ZodString;
956
+ sequence_number: z.ZodNumber;
957
+ captured_at: z.ZodString;
958
+ consent_token: z.ZodString;
959
+ sdk_version: z.ZodDefault<z.ZodString>;
960
+ agent_runtime: z.ZodDefault<z.ZodString>;
961
+ principal: z.ZodDefault<z.ZodNullable<z.ZodObject<{
962
+ id: z.ZodString;
963
+ source: z.ZodString;
964
+ form: z.ZodString;
965
+ display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
966
+ }, z.core.$strict>>>;
967
+ transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
968
+ client_observed: z.ZodDefault<z.ZodNullable<z.ZodObject<{
969
+ info: z.ZodOptional<z.ZodObject<{
970
+ name: z.ZodOptional<z.ZodString>;
971
+ version: z.ZodOptional<z.ZodString>;
972
+ }, z.core.$strict>>;
973
+ headers: z.ZodOptional<z.ZodObject<{
974
+ "user-agent": z.ZodOptional<z.ZodString>;
975
+ "x-anthropic-client": z.ZodOptional<z.ZodString>;
976
+ }, z.core.$strict>>;
977
+ }, z.core.$strict>>>;
978
+ call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
979
+ runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
980
+ }, z.core.$strict>;
981
+ type ToolListStartEvent = z.infer<typeof ToolListStartEventSchema>;
982
+ declare const ToolListEndEventSchema: z.ZodObject<{
983
+ event_type: z.ZodDefault<z.ZodLiteral<"tool_list_end">>;
984
+ payload: z.ZodObject<{
985
+ duration_ms: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
986
+ count: z.ZodNumber;
987
+ }, z.core.$strict>;
988
+ event_id: z.ZodDefault<z.ZodUUID>;
989
+ tenant_id: z.ZodString;
990
+ vendor_id: z.ZodString;
991
+ session_id: z.ZodString;
992
+ sequence_number: z.ZodNumber;
993
+ captured_at: z.ZodString;
994
+ consent_token: z.ZodString;
995
+ sdk_version: z.ZodDefault<z.ZodString>;
996
+ agent_runtime: z.ZodDefault<z.ZodString>;
997
+ principal: z.ZodDefault<z.ZodNullable<z.ZodObject<{
998
+ id: z.ZodString;
999
+ source: z.ZodString;
1000
+ form: z.ZodString;
1001
+ display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1002
+ }, z.core.$strict>>>;
1003
+ transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1004
+ client_observed: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1005
+ info: z.ZodOptional<z.ZodObject<{
1006
+ name: z.ZodOptional<z.ZodString>;
1007
+ version: z.ZodOptional<z.ZodString>;
1008
+ }, z.core.$strict>>;
1009
+ headers: z.ZodOptional<z.ZodObject<{
1010
+ "user-agent": z.ZodOptional<z.ZodString>;
1011
+ "x-anthropic-client": z.ZodOptional<z.ZodString>;
1012
+ }, z.core.$strict>>;
1013
+ }, z.core.$strict>>>;
1014
+ call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1015
+ runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1016
+ }, z.core.$strict>;
1017
+ type ToolListEndEvent = z.infer<typeof ToolListEndEventSchema>;
1018
+ declare const ToolListErrorEventSchema: z.ZodObject<{
1019
+ event_type: z.ZodDefault<z.ZodLiteral<"tool_list_error">>;
1020
+ payload: z.ZodObject<{
1021
+ duration_ms: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
1022
+ error_type: z.ZodString;
1023
+ error_body: z.ZodString;
1024
+ }, z.core.$strict>;
1025
+ event_id: z.ZodDefault<z.ZodUUID>;
1026
+ tenant_id: z.ZodString;
1027
+ vendor_id: z.ZodString;
1028
+ session_id: z.ZodString;
1029
+ sequence_number: z.ZodNumber;
1030
+ captured_at: z.ZodString;
1031
+ consent_token: z.ZodString;
1032
+ sdk_version: z.ZodDefault<z.ZodString>;
1033
+ agent_runtime: z.ZodDefault<z.ZodString>;
1034
+ principal: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1035
+ id: z.ZodString;
1036
+ source: z.ZodString;
1037
+ form: z.ZodString;
1038
+ display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1039
+ }, z.core.$strict>>>;
1040
+ transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1041
+ client_observed: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1042
+ info: z.ZodOptional<z.ZodObject<{
1043
+ name: z.ZodOptional<z.ZodString>;
1044
+ version: z.ZodOptional<z.ZodString>;
1045
+ }, z.core.$strict>>;
1046
+ headers: z.ZodOptional<z.ZodObject<{
1047
+ "user-agent": z.ZodOptional<z.ZodString>;
1048
+ "x-anthropic-client": z.ZodOptional<z.ZodString>;
1049
+ }, z.core.$strict>>;
1050
+ }, z.core.$strict>>>;
1051
+ call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1052
+ runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1053
+ }, z.core.$strict>;
1054
+ type ToolListErrorEvent = z.infer<typeof ToolListErrorEventSchema>;
758
1055
  declare const EventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1056
+ call_id: z.ZodString;
759
1057
  event_type: z.ZodDefault<z.ZodLiteral<"tool_call_start">>;
760
1058
  payload: z.ZodObject<{
761
1059
  tool_name: z.ZodString;
@@ -781,9 +1079,19 @@ declare const EventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
781
1079
  display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
782
1080
  }, z.core.$strict>>>;
783
1081
  transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
784
- call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1082
+ client_observed: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1083
+ info: z.ZodOptional<z.ZodObject<{
1084
+ name: z.ZodOptional<z.ZodString>;
1085
+ version: z.ZodOptional<z.ZodString>;
1086
+ }, z.core.$strict>>;
1087
+ headers: z.ZodOptional<z.ZodObject<{
1088
+ "user-agent": z.ZodOptional<z.ZodString>;
1089
+ "x-anthropic-client": z.ZodOptional<z.ZodString>;
1090
+ }, z.core.$strict>>;
1091
+ }, z.core.$strict>>>;
785
1092
  runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
786
1093
  }, z.core.$strict>, z.ZodObject<{
1094
+ call_id: z.ZodString;
787
1095
  event_type: z.ZodDefault<z.ZodLiteral<"tool_call_end">>;
788
1096
  payload: z.ZodObject<{
789
1097
  tool_name: z.ZodString;
@@ -807,9 +1115,19 @@ declare const EventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
807
1115
  display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
808
1116
  }, z.core.$strict>>>;
809
1117
  transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
810
- call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1118
+ client_observed: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1119
+ info: z.ZodOptional<z.ZodObject<{
1120
+ name: z.ZodOptional<z.ZodString>;
1121
+ version: z.ZodOptional<z.ZodString>;
1122
+ }, z.core.$strict>>;
1123
+ headers: z.ZodOptional<z.ZodObject<{
1124
+ "user-agent": z.ZodOptional<z.ZodString>;
1125
+ "x-anthropic-client": z.ZodOptional<z.ZodString>;
1126
+ }, z.core.$strict>>;
1127
+ }, z.core.$strict>>>;
811
1128
  runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
812
1129
  }, z.core.$strict>, z.ZodObject<{
1130
+ call_id: z.ZodString;
813
1131
  event_type: z.ZodDefault<z.ZodLiteral<"tool_call_error">>;
814
1132
  payload: z.ZodObject<{
815
1133
  tool_name: z.ZodString;
@@ -836,7 +1154,16 @@ declare const EventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
836
1154
  display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
837
1155
  }, z.core.$strict>>>;
838
1156
  transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
839
- call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1157
+ client_observed: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1158
+ info: z.ZodOptional<z.ZodObject<{
1159
+ name: z.ZodOptional<z.ZodString>;
1160
+ version: z.ZodOptional<z.ZodString>;
1161
+ }, z.core.$strict>>;
1162
+ headers: z.ZodOptional<z.ZodObject<{
1163
+ "user-agent": z.ZodOptional<z.ZodString>;
1164
+ "x-anthropic-client": z.ZodOptional<z.ZodString>;
1165
+ }, z.core.$strict>>;
1166
+ }, z.core.$strict>>>;
840
1167
  runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
841
1168
  }, z.core.$strict>, z.ZodObject<{
842
1169
  event_type: z.ZodDefault<z.ZodLiteral<"annotation">>;
@@ -866,6 +1193,16 @@ declare const EventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
866
1193
  display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
867
1194
  }, z.core.$strict>>>;
868
1195
  transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1196
+ client_observed: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1197
+ info: z.ZodOptional<z.ZodObject<{
1198
+ name: z.ZodOptional<z.ZodString>;
1199
+ version: z.ZodOptional<z.ZodString>;
1200
+ }, z.core.$strict>>;
1201
+ headers: z.ZodOptional<z.ZodObject<{
1202
+ "user-agent": z.ZodOptional<z.ZodString>;
1203
+ "x-anthropic-client": z.ZodOptional<z.ZodString>;
1204
+ }, z.core.$strict>>;
1205
+ }, z.core.$strict>>>;
869
1206
  call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
870
1207
  runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
871
1208
  }, z.core.$strict>, z.ZodObject<{
@@ -894,6 +1231,16 @@ declare const EventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
894
1231
  display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
895
1232
  }, z.core.$strict>>>;
896
1233
  transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1234
+ client_observed: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1235
+ info: z.ZodOptional<z.ZodObject<{
1236
+ name: z.ZodOptional<z.ZodString>;
1237
+ version: z.ZodOptional<z.ZodString>;
1238
+ }, z.core.$strict>>;
1239
+ headers: z.ZodOptional<z.ZodObject<{
1240
+ "user-agent": z.ZodOptional<z.ZodString>;
1241
+ "x-anthropic-client": z.ZodOptional<z.ZodString>;
1242
+ }, z.core.$strict>>;
1243
+ }, z.core.$strict>>>;
897
1244
  call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
898
1245
  runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
899
1246
  }, z.core.$strict>, z.ZodObject<{
@@ -915,6 +1262,16 @@ declare const EventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
915
1262
  display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
916
1263
  }, z.core.$strict>>>;
917
1264
  transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1265
+ client_observed: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1266
+ info: z.ZodOptional<z.ZodObject<{
1267
+ name: z.ZodOptional<z.ZodString>;
1268
+ version: z.ZodOptional<z.ZodString>;
1269
+ }, z.core.$strict>>;
1270
+ headers: z.ZodOptional<z.ZodObject<{
1271
+ "user-agent": z.ZodOptional<z.ZodString>;
1272
+ "x-anthropic-client": z.ZodOptional<z.ZodString>;
1273
+ }, z.core.$strict>>;
1274
+ }, z.core.$strict>>>;
918
1275
  call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
919
1276
  runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
920
1277
  }, z.core.$strict>, z.ZodObject<{
@@ -939,6 +1296,16 @@ declare const EventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
939
1296
  display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
940
1297
  }, z.core.$strict>>>;
941
1298
  transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1299
+ client_observed: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1300
+ info: z.ZodOptional<z.ZodObject<{
1301
+ name: z.ZodOptional<z.ZodString>;
1302
+ version: z.ZodOptional<z.ZodString>;
1303
+ }, z.core.$strict>>;
1304
+ headers: z.ZodOptional<z.ZodObject<{
1305
+ "user-agent": z.ZodOptional<z.ZodString>;
1306
+ "x-anthropic-client": z.ZodOptional<z.ZodString>;
1307
+ }, z.core.$strict>>;
1308
+ }, z.core.$strict>>>;
942
1309
  call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
943
1310
  runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
944
1311
  }, z.core.$strict>, z.ZodObject<{
@@ -964,6 +1331,16 @@ declare const EventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
964
1331
  display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
965
1332
  }, z.core.$strict>>>;
966
1333
  transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1334
+ client_observed: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1335
+ info: z.ZodOptional<z.ZodObject<{
1336
+ name: z.ZodOptional<z.ZodString>;
1337
+ version: z.ZodOptional<z.ZodString>;
1338
+ }, z.core.$strict>>;
1339
+ headers: z.ZodOptional<z.ZodObject<{
1340
+ "user-agent": z.ZodOptional<z.ZodString>;
1341
+ "x-anthropic-client": z.ZodOptional<z.ZodString>;
1342
+ }, z.core.$strict>>;
1343
+ }, z.core.$strict>>>;
967
1344
  call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
968
1345
  runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
969
1346
  }, z.core.$strict>, z.ZodObject<{
@@ -988,6 +1365,16 @@ declare const EventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
988
1365
  display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
989
1366
  }, z.core.$strict>>>;
990
1367
  transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1368
+ client_observed: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1369
+ info: z.ZodOptional<z.ZodObject<{
1370
+ name: z.ZodOptional<z.ZodString>;
1371
+ version: z.ZodOptional<z.ZodString>;
1372
+ }, z.core.$strict>>;
1373
+ headers: z.ZodOptional<z.ZodObject<{
1374
+ "user-agent": z.ZodOptional<z.ZodString>;
1375
+ "x-anthropic-client": z.ZodOptional<z.ZodString>;
1376
+ }, z.core.$strict>>;
1377
+ }, z.core.$strict>>>;
991
1378
  call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
992
1379
  runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
993
1380
  }, z.core.$strict>, z.ZodObject<{
@@ -1012,6 +1399,16 @@ declare const EventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1012
1399
  display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1013
1400
  }, z.core.$strict>>>;
1014
1401
  transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1402
+ client_observed: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1403
+ info: z.ZodOptional<z.ZodObject<{
1404
+ name: z.ZodOptional<z.ZodString>;
1405
+ version: z.ZodOptional<z.ZodString>;
1406
+ }, z.core.$strict>>;
1407
+ headers: z.ZodOptional<z.ZodObject<{
1408
+ "user-agent": z.ZodOptional<z.ZodString>;
1409
+ "x-anthropic-client": z.ZodOptional<z.ZodString>;
1410
+ }, z.core.$strict>>;
1411
+ }, z.core.$strict>>>;
1015
1412
  call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1016
1413
  runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1017
1414
  }, z.core.$strict>, z.ZodObject<{
@@ -1038,6 +1435,16 @@ declare const EventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1038
1435
  display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1039
1436
  }, z.core.$strict>>>;
1040
1437
  transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1438
+ client_observed: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1439
+ info: z.ZodOptional<z.ZodObject<{
1440
+ name: z.ZodOptional<z.ZodString>;
1441
+ version: z.ZodOptional<z.ZodString>;
1442
+ }, z.core.$strict>>;
1443
+ headers: z.ZodOptional<z.ZodObject<{
1444
+ "user-agent": z.ZodOptional<z.ZodString>;
1445
+ "x-anthropic-client": z.ZodOptional<z.ZodString>;
1446
+ }, z.core.$strict>>;
1447
+ }, z.core.$strict>>>;
1041
1448
  call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1042
1449
  runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1043
1450
  }, z.core.$strict>, z.ZodObject<{
@@ -1059,6 +1466,16 @@ declare const EventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1059
1466
  display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1060
1467
  }, z.core.$strict>>>;
1061
1468
  transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1469
+ client_observed: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1470
+ info: z.ZodOptional<z.ZodObject<{
1471
+ name: z.ZodOptional<z.ZodString>;
1472
+ version: z.ZodOptional<z.ZodString>;
1473
+ }, z.core.$strict>>;
1474
+ headers: z.ZodOptional<z.ZodObject<{
1475
+ "user-agent": z.ZodOptional<z.ZodString>;
1476
+ "x-anthropic-client": z.ZodOptional<z.ZodString>;
1477
+ }, z.core.$strict>>;
1478
+ }, z.core.$strict>>>;
1062
1479
  call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1063
1480
  runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1064
1481
  }, z.core.$strict>, z.ZodObject<{
@@ -1083,6 +1500,16 @@ declare const EventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1083
1500
  display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1084
1501
  }, z.core.$strict>>>;
1085
1502
  transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1503
+ client_observed: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1504
+ info: z.ZodOptional<z.ZodObject<{
1505
+ name: z.ZodOptional<z.ZodString>;
1506
+ version: z.ZodOptional<z.ZodString>;
1507
+ }, z.core.$strict>>;
1508
+ headers: z.ZodOptional<z.ZodObject<{
1509
+ "user-agent": z.ZodOptional<z.ZodString>;
1510
+ "x-anthropic-client": z.ZodOptional<z.ZodString>;
1511
+ }, z.core.$strict>>;
1512
+ }, z.core.$strict>>>;
1086
1513
  call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1087
1514
  runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1088
1515
  }, z.core.$strict>, z.ZodObject<{
@@ -1108,6 +1535,16 @@ declare const EventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1108
1535
  display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1109
1536
  }, z.core.$strict>>>;
1110
1537
  transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1538
+ client_observed: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1539
+ info: z.ZodOptional<z.ZodObject<{
1540
+ name: z.ZodOptional<z.ZodString>;
1541
+ version: z.ZodOptional<z.ZodString>;
1542
+ }, z.core.$strict>>;
1543
+ headers: z.ZodOptional<z.ZodObject<{
1544
+ "user-agent": z.ZodOptional<z.ZodString>;
1545
+ "x-anthropic-client": z.ZodOptional<z.ZodString>;
1546
+ }, z.core.$strict>>;
1547
+ }, z.core.$strict>>>;
1111
1548
  call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1112
1549
  runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1113
1550
  }, z.core.$strict>, z.ZodObject<{
@@ -1132,6 +1569,16 @@ declare const EventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1132
1569
  display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1133
1570
  }, z.core.$strict>>>;
1134
1571
  transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1572
+ client_observed: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1573
+ info: z.ZodOptional<z.ZodObject<{
1574
+ name: z.ZodOptional<z.ZodString>;
1575
+ version: z.ZodOptional<z.ZodString>;
1576
+ }, z.core.$strict>>;
1577
+ headers: z.ZodOptional<z.ZodObject<{
1578
+ "user-agent": z.ZodOptional<z.ZodString>;
1579
+ "x-anthropic-client": z.ZodOptional<z.ZodString>;
1580
+ }, z.core.$strict>>;
1581
+ }, z.core.$strict>>>;
1135
1582
  call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1136
1583
  runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1137
1584
  }, z.core.$strict>, z.ZodObject<{
@@ -1156,6 +1603,16 @@ declare const EventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1156
1603
  display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1157
1604
  }, z.core.$strict>>>;
1158
1605
  transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1606
+ client_observed: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1607
+ info: z.ZodOptional<z.ZodObject<{
1608
+ name: z.ZodOptional<z.ZodString>;
1609
+ version: z.ZodOptional<z.ZodString>;
1610
+ }, z.core.$strict>>;
1611
+ headers: z.ZodOptional<z.ZodObject<{
1612
+ "user-agent": z.ZodOptional<z.ZodString>;
1613
+ "x-anthropic-client": z.ZodOptional<z.ZodString>;
1614
+ }, z.core.$strict>>;
1615
+ }, z.core.$strict>>>;
1159
1616
  call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1160
1617
  runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1161
1618
  }, z.core.$strict>, z.ZodObject<{
@@ -1182,11 +1639,121 @@ declare const EventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1182
1639
  display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1183
1640
  }, z.core.$strict>>>;
1184
1641
  transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1642
+ client_observed: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1643
+ info: z.ZodOptional<z.ZodObject<{
1644
+ name: z.ZodOptional<z.ZodString>;
1645
+ version: z.ZodOptional<z.ZodString>;
1646
+ }, z.core.$strict>>;
1647
+ headers: z.ZodOptional<z.ZodObject<{
1648
+ "user-agent": z.ZodOptional<z.ZodString>;
1649
+ "x-anthropic-client": z.ZodOptional<z.ZodString>;
1650
+ }, z.core.$strict>>;
1651
+ }, z.core.$strict>>>;
1652
+ call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1653
+ runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1654
+ }, z.core.$strict>, z.ZodObject<{
1655
+ event_type: z.ZodDefault<z.ZodLiteral<"tool_list_start">>;
1656
+ payload: z.ZodObject<{}, z.core.$strict>;
1657
+ event_id: z.ZodDefault<z.ZodUUID>;
1658
+ tenant_id: z.ZodString;
1659
+ vendor_id: z.ZodString;
1660
+ session_id: z.ZodString;
1661
+ sequence_number: z.ZodNumber;
1662
+ captured_at: z.ZodString;
1663
+ consent_token: z.ZodString;
1664
+ sdk_version: z.ZodDefault<z.ZodString>;
1665
+ agent_runtime: z.ZodDefault<z.ZodString>;
1666
+ principal: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1667
+ id: z.ZodString;
1668
+ source: z.ZodString;
1669
+ form: z.ZodString;
1670
+ display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1671
+ }, z.core.$strict>>>;
1672
+ transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1673
+ client_observed: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1674
+ info: z.ZodOptional<z.ZodObject<{
1675
+ name: z.ZodOptional<z.ZodString>;
1676
+ version: z.ZodOptional<z.ZodString>;
1677
+ }, z.core.$strict>>;
1678
+ headers: z.ZodOptional<z.ZodObject<{
1679
+ "user-agent": z.ZodOptional<z.ZodString>;
1680
+ "x-anthropic-client": z.ZodOptional<z.ZodString>;
1681
+ }, z.core.$strict>>;
1682
+ }, z.core.$strict>>>;
1683
+ call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1684
+ runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1685
+ }, z.core.$strict>, z.ZodObject<{
1686
+ event_type: z.ZodDefault<z.ZodLiteral<"tool_list_end">>;
1687
+ payload: z.ZodObject<{
1688
+ duration_ms: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
1689
+ count: z.ZodNumber;
1690
+ }, z.core.$strict>;
1691
+ event_id: z.ZodDefault<z.ZodUUID>;
1692
+ tenant_id: z.ZodString;
1693
+ vendor_id: z.ZodString;
1694
+ session_id: z.ZodString;
1695
+ sequence_number: z.ZodNumber;
1696
+ captured_at: z.ZodString;
1697
+ consent_token: z.ZodString;
1698
+ sdk_version: z.ZodDefault<z.ZodString>;
1699
+ agent_runtime: z.ZodDefault<z.ZodString>;
1700
+ principal: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1701
+ id: z.ZodString;
1702
+ source: z.ZodString;
1703
+ form: z.ZodString;
1704
+ display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1705
+ }, z.core.$strict>>>;
1706
+ transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1707
+ client_observed: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1708
+ info: z.ZodOptional<z.ZodObject<{
1709
+ name: z.ZodOptional<z.ZodString>;
1710
+ version: z.ZodOptional<z.ZodString>;
1711
+ }, z.core.$strict>>;
1712
+ headers: z.ZodOptional<z.ZodObject<{
1713
+ "user-agent": z.ZodOptional<z.ZodString>;
1714
+ "x-anthropic-client": z.ZodOptional<z.ZodString>;
1715
+ }, z.core.$strict>>;
1716
+ }, z.core.$strict>>>;
1717
+ call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1718
+ runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1719
+ }, z.core.$strict>, z.ZodObject<{
1720
+ event_type: z.ZodDefault<z.ZodLiteral<"tool_list_error">>;
1721
+ payload: z.ZodObject<{
1722
+ duration_ms: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
1723
+ error_type: z.ZodString;
1724
+ error_body: z.ZodString;
1725
+ }, z.core.$strict>;
1726
+ event_id: z.ZodDefault<z.ZodUUID>;
1727
+ tenant_id: z.ZodString;
1728
+ vendor_id: z.ZodString;
1729
+ session_id: z.ZodString;
1730
+ sequence_number: z.ZodNumber;
1731
+ captured_at: z.ZodString;
1732
+ consent_token: z.ZodString;
1733
+ sdk_version: z.ZodDefault<z.ZodString>;
1734
+ agent_runtime: z.ZodDefault<z.ZodString>;
1735
+ principal: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1736
+ id: z.ZodString;
1737
+ source: z.ZodString;
1738
+ form: z.ZodString;
1739
+ display_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1740
+ }, z.core.$strict>>>;
1741
+ transport_observed: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1742
+ client_observed: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1743
+ info: z.ZodOptional<z.ZodObject<{
1744
+ name: z.ZodOptional<z.ZodString>;
1745
+ version: z.ZodOptional<z.ZodString>;
1746
+ }, z.core.$strict>>;
1747
+ headers: z.ZodOptional<z.ZodObject<{
1748
+ "user-agent": z.ZodOptional<z.ZodString>;
1749
+ "x-anthropic-client": z.ZodOptional<z.ZodString>;
1750
+ }, z.core.$strict>>;
1751
+ }, z.core.$strict>>>;
1185
1752
  call_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1186
1753
  runtime_meta: z.ZodDefault<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1187
1754
  }, z.core.$strict>], "event_type">;
1188
1755
  /** ⚠ DERIVED, not hand-listed. It used to be a third list of the same
1189
- * seventeen members, after `EventTypeSchema` and `EventSchema`'s own branches,
1756
+ * members, after `EventTypeSchema` and `EventSchema`'s own branches,
1190
1757
  * and the twelve lifecycle types made that visible: three lists to keep in
1191
1758
  * step. `EventSchema` is the discriminated union over exactly these schemas,
1192
1759
  * so its inferred output type IS this union — verified mutually assignable
@@ -1407,24 +1974,15 @@ declare class HttpSink implements Sink {
1407
1974
  private sendWithRetry;
1408
1975
  }
1409
1976
 
1410
- /** Principal identity — resolve a raw principal, hash it at the edge.
1977
+ /** Principal identity — what a vendor's resolver hands back, and how it goes
1978
+ * on the wire.
1411
1979
  *
1412
1980
  * The TypeScript half of Python's `baton/identity.py`. Baton attaches the
1413
1981
  * resolved principal to every event so the Console can group by
1414
1982
  * `(tenant_id, vendor_id, principal.id)`, at whatever grain the vendor
1415
- * resolved (SPEC §11.4).
1416
- *
1417
- * Residency contract: the Console DB is metadata-only and may only ever see
1418
- * the HASH — raw identity must never leave the capture edge. So hashing
1419
- * happens HERE, before an event reaches any console-bound sink.
1420
- *
1421
- * ⚠ **This file and Python's must produce byte-identical digests**, and that
1422
- * is asserted rather than believed: `test/identity.test.ts` runs a corpus
1423
- * GENERATED from Python (`test/identityVectors.json`, regenerated by
1424
- * `scripts/gen_identity_vectors.py`) and compares strings. Same discipline as
1425
- * `scrub.ts` — though NOT its method, which was a hand-mirrored matrix, not a
1426
- * generated corpus — for the same reason: one person reaching two SDKs must be one
1427
- * actor downstream, and nothing but a differential corpus can prove it.
1983
+ * resolved (SPEC §11.4). The resolver decides everything about the value: who
1984
+ * it names, whether it is hashed, what a page shows for it. The SDK sends it
1985
+ * on as stated.
1428
1986
  */
1429
1987
  /** Where a principal came from. `"asserted"` is a vendor's own resolver,
1430
1988
  * which nothing in the protocol checks, and is the only value this SDK
@@ -1435,44 +1993,25 @@ declare const PRINCIPAL_SOURCE_ASSERTED = "asserted";
1435
1993
  * SPEC §11.4 lets a consumer classify on. */
1436
1994
  declare const PRINCIPAL_FORM_HASHED = "hashed";
1437
1995
  declare const PRINCIPAL_FORM_RAW = "raw";
1438
- declare const PRINCIPAL_ID_MODE_HASHED = "hashed";
1439
- declare const PRINCIPAL_ID_MODE_RAW = "raw";
1440
- type PrincipalIdMode = typeof PRINCIPAL_ID_MODE_HASHED | typeof PRINCIPAL_ID_MODE_RAW;
1441
- /** A raw, UNHASHED principal, as a resolver produced it. */
1996
+ type PrincipalForm = typeof PRINCIPAL_FORM_HASHED | typeof PRINCIPAL_FORM_RAW;
1997
+ /** A principal as a vendor's resolver produced it. */
1442
1998
  interface Principal {
1443
- /** The subject — a stable identifier from the vendor's own
1444
- * system. Never an application id: that names the app and is identical for
1445
- * every one of its users, which merges them into one actor. */
1999
+ /** A stable identifier from the vendor's own system. Never an application
2000
+ * id: that names the app and is identical for every one of its users, which
2001
+ * merges them into one actor. */
1446
2002
  principalId: string;
1447
- /** The issuing authority, where one exists (the OIDC `iss`). Folded into
1448
- * the hash because a subject is unique only within the provider that minted
1449
- * it, so two identity providers behind one vendor can hand the same subject
1450
- * to different people. */
1451
- issuer?: string | null | undefined;
2003
+ /** What `principalId` is: `"raw"`, a real identity, or `"hashed"`, a
2004
+ * pseudonym the resolver derived itself. A consumer treats anything not
2005
+ * `"hashed"` as personal data, so leave it unset unless the resolver hashed
2006
+ * the value. */
2007
+ form?: PrincipalForm | undefined;
1452
2008
  /** What a page shows for this principal — `principalFromOAuthEmail` puts
1453
- * the part of the address before the last `@` here. **Sent verbatim, in
1454
- * every mode, hashed included, and never through the scrubber** (SPEC
1455
- * §11.4): the vendor chooses what is safe to show. An unusable value is
2009
+ * the part of the address before the last `@` here. Sent verbatim and never
2010
+ * through the scrubber (SPEC §11.4): the vendor chooses what is safe to
2011
+ * show, and it is personal data whatever `form` says. An unusable value is
1456
2012
  * dropped alone — see `wireDisplayName`. */
1457
2013
  displayName?: string | null | undefined;
1458
2014
  }
1459
- /** HMAC-SHA256 a raw principal into a console-safe, per-tenant `principal.id`.
1460
- *
1461
- * `tenantId` is folded into the HMAC MESSAGE (not just the key) so the same
1462
- * principal under two tenants can never collide or be cross-tenant-correlated.
1463
- * Returns the BARE lowercase hex digest — no tag, no prefix, no scheme. It
1464
- * returned `"h1:<hex>"` until 0.4.1; the tag was never part of the HMAC
1465
- * message, so taking it off moved no digit of the digest.
1466
- *
1467
- * ⚠ **`issuer` null/undefined MUST hash byte-identically to the pre-issuer
1468
- * form** — the append-only message layout is what guarantees it, and every
1469
- * hash baton-proxy and baton-extmcp have produced since 0.5.0 was issuer-less.
1470
- */
1471
- declare function hashPrincipalId(rawPrincipal: string, options: {
1472
- tenantId: string;
1473
- key: Uint8Array | string;
1474
- issuer?: string | null | undefined;
1475
- }): string;
1476
2015
 
1477
2016
  /** A validated access token, as both majors declare it
1478
2017
  * (`@modelcontextprotocol/sdk` 1.x `server/auth/types.d.ts`,
@@ -1493,27 +2032,20 @@ interface AuthInfo {
1493
2032
 
1494
2033
  /** `BatonConfig.resolvePrincipal` — the ONLY identity provenance (SPEC §11.4).
1495
2034
  *
1496
- * **The producer never reads the token itself** (SPEC §11.4, §13 2026-10-02 —
1497
- * Python's own token rung was removed the same day), so every principal this
1498
- * SDK emits is `source: "asserted"`. The hook's context carries the validated
1499
- * `authInfo`, and `oauthHooks.ts` ships the two ready-made OAuth hooks.
2035
+ * The producer never reads the token itself and never derives the value: who
2036
+ * the person is, and whether the id is hashed, are the hook's to state. Every
2037
+ * principal this SDK emits is `source: "asserted"`. The hook's context carries
2038
+ * the validated `authInfo`, and `oauthHooks.ts` ships the two ready-made
2039
+ * OAuth hooks.
1500
2040
  *
1501
- * The TypeScript half of Python's `integrations/identity_adapter.py`, built to
1502
- * close register D6: the field (`user_id` until 0.3.5) had been on this SDK's
1503
- * envelope since 0.3.0 and NOTHING could populate it, so a partition that
1504
- * works on one of two SDKs is not a partition.
2041
+ * The TypeScript half of Python's `integrations/identity_adapter.py`.
1505
2042
  */
1506
2043
 
1507
2044
  /** What a vendor's `resolvePrincipal` hook is handed.
1508
2045
  *
1509
2046
  * Adapter-neutral BY CONSTRUCTION rather than by convention — the peers' own
1510
2047
  * handler-context objects differ in shape between the two majors, and this
1511
- * type is what makes one hook portable across them. The prior art takes the
1512
- * opposite approach: AgentCat's `identify()` receives the raw per-major object
1513
- * behind `{ sessionId?: string; [key: string]: any }`, documented as "only
1514
- * `sessionId` is common to both; everything else is SDK-version-specific".
1515
- * That is the divergence handed to the vendor as `any`; this is the divergence
1516
- * absorbed by us.
2048
+ * type is what makes one hook portable across them.
1517
2049
  */
1518
2050
  interface PrincipalResolutionContext {
1519
2051
  /** The call's HTTP headers, case-insensitive on BOTH majors — see
@@ -1527,10 +2059,12 @@ interface PrincipalResolutionContext {
1527
2059
  /** The call's `_meta`, from wherever this major keeps it. */
1528
2060
  meta: Record<string, unknown> | null;
1529
2061
  /** The tool being called — the annotation tool's own name on that path, so a
1530
- * hook can answer differently per call rather than per install. */
1531
- toolName: string;
2062
+ * hook can answer differently per call rather than per install. `null` on a
2063
+ * `tools/list` request, which names no tool. */
2064
+ toolName: string | null;
1532
2065
  /** The call's arguments, AFTER Baton's injected intent params are stripped,
1533
- * so a hook sees exactly what the vendor's own handler will. */
2066
+ * so a hook sees exactly what the vendor's own handler will. Empty on a
2067
+ * `tools/list` request. */
1534
2068
  arguments: Record<string, unknown>;
1535
2069
  /** The validated access token for this request, read from wherever this
1536
2070
  * major keeps it — see `extraAuthInfo`. `null` on stdio and on any
@@ -1548,10 +2082,8 @@ type ResolvePrincipalHook = (context: PrincipalResolutionContext) => Principal |
1548
2082
  /** The registered values of `resultCaptureMode` (SPEC §11.4), and the single
1549
2083
  * source of truth for them.
1550
2084
  *
1551
- * Shaped after `identity.ts`'s `FORM_BY_MODE` → `PRINCIPAL_ID_MODES`, whose
1552
- * own note says why: a second hand-written list makes the guarantee "two lists
1553
- * happen to agree", which is the prose-shaped binding that pattern exists to
1554
- * replace. `config.ts` builds its validator set from THIS array rather than
2085
+ * A second hand-written list would make the guarantee "two lists happen to
2086
+ * agree". `config.ts` builds its validator set from THIS array rather than
1555
2087
  * restating the literals, so a mode cannot be accepted at the door without
1556
2088
  * someone having given it a payload shape below. */
1557
2089
  declare const RESULT_CAPTURE_MODES: readonly ["full", "off"];
@@ -1656,10 +2188,10 @@ interface BatonConfig {
1656
2188
  /** Per-tool intent-param injection (mirrors baton-extmcp's vendor-neutral
1657
2189
  * naming). `"required"` (default) injects `user_goal`/`expected_result`/
1658
2190
  * `overall_task` string params on every wrapped tool's advertised schema
1659
- * and ADVERTISES `user_goal` as required in `tools/list`, without enforcing
1660
- * it: a call that omits it still reaches your handler, and its event simply
1661
- * carries no intent. `"optional"` injects the same params and advertises
1662
- * none of them as required. `"off"` disables injection. The params are
2191
+ * and ADVERTISES all three as required in
2192
+ * `tools/list`, without enforcing them: a call that omits them still reaches
2193
+ * your handler, and its event simply carries no intent. `"optional"` injects
2194
+ * the same params and advertises none of them as required. `"off"` disables injection. The params are
1663
2195
  * stripped before the vendor handler runs, so the tool never sees them.
1664
2196
  * This is what captures intent on runtimes that drop `instructions`
1665
2197
  * (notably Claude Desktop) — where the annotation tool alone yields
@@ -1696,11 +2228,13 @@ interface BatonConfig {
1696
2228
  * envelope's `principal` (SPEC §11.4 rung 0), which emits
1697
2229
  * `source: "asserted"`. It is the only provenance this SDK has.
1698
2230
  *
1699
- * Called on every captured tool call and on the annotation tool, with an
1700
- * adapter-neutral {@link PrincipalResolutionContext}: headers folded to ONE
1701
- * case-insensitive shape across both SDK majors, the call's `_meta`, the
1702
- * tool name, and the arguments the vendor's own handler will see. Return a
1703
- * `Principal`, or `null` for "no opinion about this caller".
2231
+ * Called on every captured tool call, on the annotation tool and on every
2232
+ * `tools/list` request, with an adapter-neutral
2233
+ * {@link PrincipalResolutionContext}: headers folded to ONE case-insensitive
2234
+ * shape across both SDK majors, the request's `_meta`, the tool name, and
2235
+ * the arguments the vendor's own handler will see. On a `tools/list` request
2236
+ * the tool name is `null` and the arguments are empty. Return a `Principal`,
2237
+ * or `null` for "no opinion about this caller".
1704
2238
  *
1705
2239
  * **This is the only identity mechanism, on both SDKs** (SPEC §11.4): unset,
1706
2240
  * no event carries a `principal`. For OAuth, pass `principalFromOAuthSub` or
@@ -1708,25 +2242,16 @@ interface BatonConfig {
1708
2242
  * carries as `authInfo`. MCP auth is HTTP middleware, so on stdio there is no
1709
2243
  * token and a hook names the user from whatever the vendor authenticated.
1710
2244
  *
1711
- * Never fails a tool call: a hook that throws or returns junk yields an
1712
- * anonymous call. ⚠ It is awaited INLINE with no timeout — a blocking hook
1713
- * stalls its own request. */
1714
- resolvePrincipal?: ResolvePrincipalHook;
1715
- /** `"hashed"` (default) emits a per-tenant HMAC pseudonym and
1716
- * `form: "hashed"`; `"raw"` emits the subject VERBATIM and `form: "raw"`.
1717
- *
1718
- * `"raw"` puts real identity in the collector's database and is the vendor's
1719
- * deliberate choice. ⚠ A consumer classifies on `form`, never on this
1720
- * setting — `PrincipalWireSchema` carries the rule and why it is stated that
1721
- * way round. */
1722
- principalIdMode?: PrincipalIdMode;
1723
- /** The HMAC secret for hashed mode. Resolved explicit →
1724
- * `BATON_PRINCIPAL_ID_HMAC_KEY` → unset.
2245
+ * Never fails a request: a hook that throws or returns junk yields an
2246
+ * anonymous one. A hook that has not answered after 5 seconds is given up
2247
+ * on, and that request is anonymous. ⚠ That only bounds an async hook: one that
2248
+ * blocks synchronously holds the whole process, and nothing can interrupt it.
1725
2249
  *
1726
- * ⚠ **With none set, hashed mode DROPS the principal rather than falling back to
1727
- * raw.** The fallback would be a residency breach that looks like success:
1728
- * the field present, populated, and carrying the subject verbatim. */
1729
- principalIdHmacKey?: string | Uint8Array;
2250
+ * The SDK sends what the hook returns and does nothing else to it: the id
2251
+ * as given, `form` to say whether the hook hashed it, and `displayName` for
2252
+ * what a page shows. A vendor who must not send real identities hashes
2253
+ * inside the hook and returns `form: "hashed"`. */
2254
+ resolvePrincipal?: ResolvePrincipalHook;
1730
2255
  }
1731
2256
 
1732
2257
  /**
@@ -1854,6 +2379,16 @@ interface SupportedMcpServer {
1854
2379
  }
1855
2380
  /** Install Baton into an `McpServer`. See module docstring for usage. */
1856
2381
  declare function withBaton(server: SupportedMcpServer, supplied?: BatonConfig): BatonHandle;
2382
+ /** One Baton for a process that builds a new `McpServer` for every request.
2383
+ * Owns the sink, so a request has nothing to close. */
2384
+ interface Baton {
2385
+ wrap(server: SupportedMcpServer): void;
2386
+ flush(): Promise<void>;
2387
+ aclose(): Promise<void>;
2388
+ }
2389
+ /** Create once at startup, then `wrap` each per-request server. For a server
2390
+ * that lives as long as the process, use `withBaton`. */
2391
+ declare function createBaton(supplied?: BatonConfig): Baton;
1857
2392
 
1858
2393
  /** Ready-made `resolvePrincipal` hooks for a server running OAuth.
1859
2394
  *
@@ -1887,20 +2422,15 @@ declare function withBaton(server: SupportedMcpServer, supplied?: BatonConfig):
1887
2422
  * hooks return `null` there.
1888
2423
  */
1889
2424
 
1890
- /** The token's `sub`, keyed with its `iss` — a subject is unique only per
1891
- * issuer, so two identity providers can hand two people the same one. */
2425
+ /** The token's `sub`. A subject is unique only per issuer: a vendor running
2426
+ * two identity providers writes a hook that combines it with `iss`. */
1892
2427
  declare function principalFromOAuthSub(context: PrincipalResolutionContext): Principal | null;
1893
- /** The token's `email`, as the WHOLE address and with NO issuer.
2428
+ /** The token's `email`, as the WHOLE address.
1894
2429
  *
1895
2430
  * `principalId` is the whole address and `displayName` the part before the
1896
2431
  * last `@`. The local part alone is not an id — `alice@acme.com` and
1897
- * `alice@contoso.com` are two people. `displayName` IS sent, in every mode: a
1898
- * vendor who hashes ids and does not want `alice` on the wire writes their
1899
- * own hook.
1900
- *
1901
- * No issuer, unlike the `sub` hook: a subject is unique only per issuer, an
1902
- * address on its own, and folding `iss` in would give one person a new
1903
- * pseudonym the day their identity provider changes its issuer URL.
2432
+ * `alice@contoso.com` are two people. A vendor who does not want `alice` on
2433
+ * the wire writes their own hook.
1904
2434
  *
1905
2435
  * ⚠ `email` is not a standard ACCESS-token claim (OIDC puts it in the ID
1906
2436
  * token), so it is here only if the identity provider adds it and the verifier
@@ -1908,4 +2438,4 @@ declare function principalFromOAuthSub(context: PrincipalResolutionContext): Pri
1908
2438
  * good enough is the vendor's call. */
1909
2439
  declare function principalFromOAuthEmail(context: PrincipalResolutionContext): Principal | null;
1910
2440
 
1911
- export { type AnnotationEvent, AnnotationEventSchema, type AnnotationPayload, AnnotationPayloadSchema, type AuthInfo, type BatonConfig, BatonHandle, DEFAULT_CONSENT_TOKEN, DEPTH_LIMIT, type Event, EventSchema, type EventType, EventTypeSchema, HttpSink, type HttpSinkOptions, PRINCIPAL_FORM_HASHED, PRINCIPAL_FORM_RAW, PRINCIPAL_SOURCE_ASSERTED, type Principal, type PrincipalIdMode, type PrincipalResolutionContext, PrincipalWireSchema, type PromptGetEndEvent, PromptGetEndEventSchema, type PromptGetEndPayload, PromptGetEndPayloadSchema, type PromptGetErrorEvent, PromptGetErrorEventSchema, type PromptGetErrorPayload, PromptGetErrorPayloadSchema, type PromptGetStartEvent, PromptGetStartEventSchema, type PromptGetStartPayload, PromptGetStartPayloadSchema, type PromptListEndEvent, PromptListEndEventSchema, type PromptListEndPayload, PromptListEndPayloadSchema, type PromptListErrorEvent, PromptListErrorEventSchema, type PromptListErrorPayload, PromptListErrorPayloadSchema, type PromptListStartEvent, PromptListStartEventSchema, type PromptListStartPayload, PromptListStartPayloadSchema, type ResolvePrincipalHook, type ResourceListEndEvent, ResourceListEndEventSchema, type ResourceListEndPayload, ResourceListEndPayloadSchema, type ResourceListErrorEvent, ResourceListErrorEventSchema, type ResourceListErrorPayload, ResourceListErrorPayloadSchema, type ResourceListStartEvent, ResourceListStartEventSchema, type ResourceListStartPayload, ResourceListStartPayloadSchema, type ResourceReadEndEvent, ResourceReadEndEventSchema, type ResourceReadEndPayload, ResourceReadEndPayloadSchema, type ResourceReadErrorEvent, ResourceReadErrorEventSchema, type ResourceReadErrorPayload, ResourceReadErrorPayloadSchema, type ResourceReadStartEvent, ResourceReadStartEventSchema, type ResourceReadStartPayload, ResourceReadStartPayloadSchema, type ResultCaptureMode, SDK_VERSION, Scrubber, type Sink, StdoutSink, type StdoutSinkOptions, type SupportedMcpServer, type SurfaceSnapshotEvent, SurfaceSnapshotEventSchema, type SurfaceSnapshotPayload, SurfaceSnapshotPayloadSchema, type ToolCallEndEvent, ToolCallEndEventSchema, type ToolCallEndPayload, ToolCallEndPayloadSchema, type ToolCallErrorEvent, ToolCallErrorEventSchema, type ToolCallErrorPayload, ToolCallErrorPayloadSchema, type ToolCallStartEvent, ToolCallStartEventSchema, type ToolCallStartPayload, ToolCallStartPayloadSchema, hashPrincipalId, identityScrub, principalFromOAuthEmail, principalFromOAuthSub, safeWrite, withBaton };
2441
+ export { type AnnotationEvent, AnnotationEventSchema, type AnnotationPayload, AnnotationPayloadSchema, type AuthInfo, type Baton, type BatonConfig, BatonHandle, DEFAULT_CONSENT_TOKEN, DEPTH_LIMIT, type Event, EventSchema, type EventType, EventTypeSchema, HttpSink, type HttpSinkOptions, PRINCIPAL_FORM_HASHED, PRINCIPAL_FORM_RAW, PRINCIPAL_SOURCE_ASSERTED, type Principal, type PrincipalForm, type PrincipalResolutionContext, PrincipalWireSchema, type PromptGetEndEvent, PromptGetEndEventSchema, type PromptGetEndPayload, PromptGetEndPayloadSchema, type PromptGetErrorEvent, PromptGetErrorEventSchema, type PromptGetErrorPayload, PromptGetErrorPayloadSchema, type PromptGetStartEvent, PromptGetStartEventSchema, type PromptGetStartPayload, PromptGetStartPayloadSchema, type PromptListEndEvent, PromptListEndEventSchema, type PromptListEndPayload, PromptListEndPayloadSchema, type PromptListErrorEvent, PromptListErrorEventSchema, type PromptListErrorPayload, PromptListErrorPayloadSchema, type PromptListStartEvent, PromptListStartEventSchema, type PromptListStartPayload, PromptListStartPayloadSchema, type ResolvePrincipalHook, type ResourceListEndEvent, ResourceListEndEventSchema, type ResourceListEndPayload, ResourceListEndPayloadSchema, type ResourceListErrorEvent, ResourceListErrorEventSchema, type ResourceListErrorPayload, ResourceListErrorPayloadSchema, type ResourceListStartEvent, ResourceListStartEventSchema, type ResourceListStartPayload, ResourceListStartPayloadSchema, type ResourceReadEndEvent, ResourceReadEndEventSchema, type ResourceReadEndPayload, ResourceReadEndPayloadSchema, type ResourceReadErrorEvent, ResourceReadErrorEventSchema, type ResourceReadErrorPayload, ResourceReadErrorPayloadSchema, type ResourceReadStartEvent, ResourceReadStartEventSchema, type ResourceReadStartPayload, ResourceReadStartPayloadSchema, type ResultCaptureMode, SDK_VERSION, Scrubber, type Sink, StdoutSink, type StdoutSinkOptions, type SupportedMcpServer, type SurfaceSnapshotEvent, SurfaceSnapshotEventSchema, type SurfaceSnapshotPayload, SurfaceSnapshotPayloadSchema, type ToolCallEndEvent, ToolCallEndEventSchema, type ToolCallEndPayload, ToolCallEndPayloadSchema, type ToolCallErrorEvent, ToolCallErrorEventSchema, type ToolCallErrorPayload, ToolCallErrorPayloadSchema, type ToolCallStartEvent, ToolCallStartEventSchema, type ToolCallStartPayload, ToolCallStartPayloadSchema, type ToolListEndEvent, ToolListEndEventSchema, type ToolListEndPayload, ToolListEndPayloadSchema, type ToolListErrorEvent, ToolListErrorEventSchema, type ToolListErrorPayload, ToolListErrorPayloadSchema, type ToolListStartEvent, ToolListStartEventSchema, type ToolListStartPayload, ToolListStartPayloadSchema, createBaton, identityScrub, principalFromOAuthEmail, principalFromOAuthSub, safeWrite, withBaton };