@goodtiming/baton-sdk 0.5.2 → 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/README.md +57 -2
- package/dist/index.cjs +292 -150
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +607 -30
- package/dist/index.d.ts +607 -30
- package/dist/index.js +283 -148
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
|
|
3
|
-
declare const SDK_VERSION = "ts-0.5.
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
*
|
|
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
|
|
@@ -1478,12 +2045,7 @@ interface AuthInfo {
|
|
|
1478
2045
|
*
|
|
1479
2046
|
* Adapter-neutral BY CONSTRUCTION rather than by convention — the peers' own
|
|
1480
2047
|
* handler-context objects differ in shape between the two majors, and this
|
|
1481
|
-
* type is what makes one hook portable across them.
|
|
1482
|
-
* opposite approach: AgentCat's `identify()` receives the raw per-major object
|
|
1483
|
-
* behind `{ sessionId?: string; [key: string]: any }`, documented as "only
|
|
1484
|
-
* `sessionId` is common to both; everything else is SDK-version-specific".
|
|
1485
|
-
* That is the divergence handed to the vendor as `any`; this is the divergence
|
|
1486
|
-
* absorbed by us.
|
|
2048
|
+
* type is what makes one hook portable across them.
|
|
1487
2049
|
*/
|
|
1488
2050
|
interface PrincipalResolutionContext {
|
|
1489
2051
|
/** The call's HTTP headers, case-insensitive on BOTH majors — see
|
|
@@ -1497,10 +2059,12 @@ interface PrincipalResolutionContext {
|
|
|
1497
2059
|
/** The call's `_meta`, from wherever this major keeps it. */
|
|
1498
2060
|
meta: Record<string, unknown> | null;
|
|
1499
2061
|
/** The tool being called — the annotation tool's own name on that path, so a
|
|
1500
|
-
* hook can answer differently per call rather than per install.
|
|
1501
|
-
|
|
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;
|
|
1502
2065
|
/** The call's arguments, AFTER Baton's injected intent params are stripped,
|
|
1503
|
-
* 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. */
|
|
1504
2068
|
arguments: Record<string, unknown>;
|
|
1505
2069
|
/** The validated access token for this request, read from wherever this
|
|
1506
2070
|
* major keeps it — see `extraAuthInfo`. `null` on stdio and on any
|
|
@@ -1624,10 +2188,10 @@ interface BatonConfig {
|
|
|
1624
2188
|
/** Per-tool intent-param injection (mirrors baton-extmcp's vendor-neutral
|
|
1625
2189
|
* naming). `"required"` (default) injects `user_goal`/`expected_result`/
|
|
1626
2190
|
* `overall_task` string params on every wrapped tool's advertised schema
|
|
1627
|
-
* and ADVERTISES
|
|
1628
|
-
*
|
|
1629
|
-
* carries no intent. `"optional"` injects
|
|
1630
|
-
* 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
|
|
1631
2195
|
* stripped before the vendor handler runs, so the tool never sees them.
|
|
1632
2196
|
* This is what captures intent on runtimes that drop `instructions`
|
|
1633
2197
|
* (notably Claude Desktop) — where the annotation tool alone yields
|
|
@@ -1664,11 +2228,13 @@ interface BatonConfig {
|
|
|
1664
2228
|
* envelope's `principal` (SPEC §11.4 rung 0), which emits
|
|
1665
2229
|
* `source: "asserted"`. It is the only provenance this SDK has.
|
|
1666
2230
|
*
|
|
1667
|
-
* Called on every captured tool call
|
|
1668
|
-
*
|
|
1669
|
-
*
|
|
1670
|
-
*
|
|
1671
|
-
*
|
|
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".
|
|
1672
2238
|
*
|
|
1673
2239
|
* **This is the only identity mechanism, on both SDKs** (SPEC §11.4): unset,
|
|
1674
2240
|
* no event carries a `principal`. For OAuth, pass `principalFromOAuthSub` or
|
|
@@ -1676,9 +2242,10 @@ interface BatonConfig {
|
|
|
1676
2242
|
* carries as `authInfo`. MCP auth is HTTP middleware, so on stdio there is no
|
|
1677
2243
|
* token and a hook names the user from whatever the vendor authenticated.
|
|
1678
2244
|
*
|
|
1679
|
-
* Never fails a
|
|
1680
|
-
* anonymous
|
|
1681
|
-
*
|
|
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.
|
|
1682
2249
|
*
|
|
1683
2250
|
* The SDK sends what the hook returns and does nothing else to it: the id
|
|
1684
2251
|
* as given, `form` to say whether the hook hashed it, and `displayName` for
|
|
@@ -1812,6 +2379,16 @@ interface SupportedMcpServer {
|
|
|
1812
2379
|
}
|
|
1813
2380
|
/** Install Baton into an `McpServer`. See module docstring for usage. */
|
|
1814
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;
|
|
1815
2392
|
|
|
1816
2393
|
/** Ready-made `resolvePrincipal` hooks for a server running OAuth.
|
|
1817
2394
|
*
|
|
@@ -1861,4 +2438,4 @@ declare function principalFromOAuthSub(context: PrincipalResolutionContext): Pri
|
|
|
1861
2438
|
* good enough is the vendor's call. */
|
|
1862
2439
|
declare function principalFromOAuthEmail(context: PrincipalResolutionContext): Principal | null;
|
|
1863
2440
|
|
|
1864
|
-
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 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, 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 };
|