@raytio/mcp-server 10.4.0 → 10.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,986 @@
1
+ import { z } from 'zod';
2
+ import { type PersistResourceContract } from './persist-resource-contract.js';
3
+ declare const operationSchema: z.ZodEnum<["create", "update", "filter", "read", "response"]>;
4
+ export declare const toolBindingSchema: z.ZodObject<{
5
+ toolName: z.ZodString;
6
+ authority: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
7
+ kind: z.ZodLiteral<"relation">;
8
+ resourceId: z.ZodString;
9
+ }, "strip", z.ZodTypeAny, {
10
+ kind: "relation";
11
+ resourceId: string;
12
+ }, {
13
+ kind: "relation";
14
+ resourceId: string;
15
+ }>, z.ZodObject<{
16
+ kind: z.ZodLiteral<"endpoint">;
17
+ endpoint: z.ZodString;
18
+ fields: z.ZodArray<z.ZodString, "many">;
19
+ }, "strip", z.ZodTypeAny, {
20
+ fields: string[];
21
+ kind: "endpoint";
22
+ endpoint: string;
23
+ }, {
24
+ fields: string[];
25
+ kind: "endpoint";
26
+ endpoint: string;
27
+ }>, z.ZodObject<{
28
+ kind: z.ZodLiteral<"composite">;
29
+ sources: z.ZodArray<z.ZodString, "many">;
30
+ reason: z.ZodString;
31
+ }, "strip", z.ZodTypeAny, {
32
+ reason: string;
33
+ kind: "composite";
34
+ sources: string[];
35
+ }, {
36
+ reason: string;
37
+ kind: "composite";
38
+ sources: string[];
39
+ }>]>;
40
+ surfaces: z.ZodArray<z.ZodObject<{
41
+ operation: z.ZodEnum<["create", "update", "filter", "read", "response"]>;
42
+ fields: z.ZodArray<z.ZodObject<{
43
+ toolField: z.ZodString;
44
+ upstreamField: z.ZodString;
45
+ mapping: z.ZodEnum<["direct", "alias"]>;
46
+ requirement: z.ZodEnum<["upstream", "optional"]>;
47
+ }, "strip", z.ZodTypeAny, {
48
+ toolField: string;
49
+ upstreamField: string;
50
+ mapping: "direct" | "alias";
51
+ requirement: "upstream" | "optional";
52
+ }, {
53
+ toolField: string;
54
+ upstreamField: string;
55
+ mapping: "direct" | "alias";
56
+ requirement: "upstream" | "optional";
57
+ }>, "many">;
58
+ overrides: z.ZodArray<z.ZodObject<{
59
+ toolField: z.ZodOptional<z.ZodString>;
60
+ upstreamField: z.ZodString;
61
+ override: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
62
+ kind: z.ZodLiteral<"database_default">;
63
+ reason: z.ZodString;
64
+ }, "strip", z.ZodTypeAny, {
65
+ reason: string;
66
+ kind: "database_default";
67
+ }, {
68
+ reason: string;
69
+ kind: "database_default";
70
+ }>, z.ZodObject<{
71
+ kind: z.ZodLiteral<"trigger">;
72
+ reason: z.ZodString;
73
+ }, "strip", z.ZodTypeAny, {
74
+ reason: string;
75
+ kind: "trigger";
76
+ }, {
77
+ reason: string;
78
+ kind: "trigger";
79
+ }>, z.ZodObject<{
80
+ kind: z.ZodLiteral<"generated">;
81
+ reason: z.ZodString;
82
+ }, "strip", z.ZodTypeAny, {
83
+ reason: string;
84
+ kind: "generated";
85
+ }, {
86
+ reason: string;
87
+ kind: "generated";
88
+ }>, z.ZodObject<{
89
+ kind: z.ZodLiteral<"auth_context">;
90
+ reason: z.ZodString;
91
+ }, "strip", z.ZodTypeAny, {
92
+ reason: string;
93
+ kind: "auth_context";
94
+ }, {
95
+ reason: string;
96
+ kind: "auth_context";
97
+ }>, z.ZodObject<{
98
+ kind: z.ZodLiteral<"composite_logic">;
99
+ reason: z.ZodString;
100
+ }, "strip", z.ZodTypeAny, {
101
+ reason: string;
102
+ kind: "composite_logic";
103
+ }, {
104
+ reason: string;
105
+ kind: "composite_logic";
106
+ }>, z.ZodObject<{
107
+ kind: z.ZodLiteral<"hidden">;
108
+ reason: z.ZodString;
109
+ }, "strip", z.ZodTypeAny, {
110
+ reason: string;
111
+ kind: "hidden";
112
+ }, {
113
+ reason: string;
114
+ kind: "hidden";
115
+ }>, z.ZodObject<{
116
+ kind: z.ZodLiteral<"nullable">;
117
+ reason: z.ZodString;
118
+ }, "strip", z.ZodTypeAny, {
119
+ reason: string;
120
+ kind: "nullable";
121
+ }, {
122
+ reason: string;
123
+ kind: "nullable";
124
+ }>, z.ZodObject<{
125
+ kind: z.ZodLiteral<"conditional">;
126
+ reason: z.ZodString;
127
+ condition: z.ZodString;
128
+ }, "strip", z.ZodTypeAny, {
129
+ reason: string;
130
+ kind: "conditional";
131
+ condition: string;
132
+ }, {
133
+ reason: string;
134
+ kind: "conditional";
135
+ condition: string;
136
+ }>]>;
137
+ }, "strip", z.ZodTypeAny, {
138
+ upstreamField: string;
139
+ override: {
140
+ reason: string;
141
+ kind: "database_default";
142
+ } | {
143
+ reason: string;
144
+ kind: "trigger";
145
+ } | {
146
+ reason: string;
147
+ kind: "generated";
148
+ } | {
149
+ reason: string;
150
+ kind: "auth_context";
151
+ } | {
152
+ reason: string;
153
+ kind: "composite_logic";
154
+ } | {
155
+ reason: string;
156
+ kind: "hidden";
157
+ } | {
158
+ reason: string;
159
+ kind: "nullable";
160
+ } | {
161
+ reason: string;
162
+ kind: "conditional";
163
+ condition: string;
164
+ };
165
+ toolField?: string | undefined;
166
+ }, {
167
+ upstreamField: string;
168
+ override: {
169
+ reason: string;
170
+ kind: "database_default";
171
+ } | {
172
+ reason: string;
173
+ kind: "trigger";
174
+ } | {
175
+ reason: string;
176
+ kind: "generated";
177
+ } | {
178
+ reason: string;
179
+ kind: "auth_context";
180
+ } | {
181
+ reason: string;
182
+ kind: "composite_logic";
183
+ } | {
184
+ reason: string;
185
+ kind: "hidden";
186
+ } | {
187
+ reason: string;
188
+ kind: "nullable";
189
+ } | {
190
+ reason: string;
191
+ kind: "conditional";
192
+ condition: string;
193
+ };
194
+ toolField?: string | undefined;
195
+ }>, "many">;
196
+ }, "strip", z.ZodTypeAny, {
197
+ operation: "filter" | "create" | "update" | "read" | "response";
198
+ fields: {
199
+ toolField: string;
200
+ upstreamField: string;
201
+ mapping: "direct" | "alias";
202
+ requirement: "upstream" | "optional";
203
+ }[];
204
+ overrides: {
205
+ upstreamField: string;
206
+ override: {
207
+ reason: string;
208
+ kind: "database_default";
209
+ } | {
210
+ reason: string;
211
+ kind: "trigger";
212
+ } | {
213
+ reason: string;
214
+ kind: "generated";
215
+ } | {
216
+ reason: string;
217
+ kind: "auth_context";
218
+ } | {
219
+ reason: string;
220
+ kind: "composite_logic";
221
+ } | {
222
+ reason: string;
223
+ kind: "hidden";
224
+ } | {
225
+ reason: string;
226
+ kind: "nullable";
227
+ } | {
228
+ reason: string;
229
+ kind: "conditional";
230
+ condition: string;
231
+ };
232
+ toolField?: string | undefined;
233
+ }[];
234
+ }, {
235
+ operation: "filter" | "create" | "update" | "read" | "response";
236
+ fields: {
237
+ toolField: string;
238
+ upstreamField: string;
239
+ mapping: "direct" | "alias";
240
+ requirement: "upstream" | "optional";
241
+ }[];
242
+ overrides: {
243
+ upstreamField: string;
244
+ override: {
245
+ reason: string;
246
+ kind: "database_default";
247
+ } | {
248
+ reason: string;
249
+ kind: "trigger";
250
+ } | {
251
+ reason: string;
252
+ kind: "generated";
253
+ } | {
254
+ reason: string;
255
+ kind: "auth_context";
256
+ } | {
257
+ reason: string;
258
+ kind: "composite_logic";
259
+ } | {
260
+ reason: string;
261
+ kind: "hidden";
262
+ } | {
263
+ reason: string;
264
+ kind: "nullable";
265
+ } | {
266
+ reason: string;
267
+ kind: "conditional";
268
+ condition: string;
269
+ };
270
+ toolField?: string | undefined;
271
+ }[];
272
+ }>, "many">;
273
+ }, "strip", z.ZodTypeAny, {
274
+ toolName: string;
275
+ authority: {
276
+ kind: "relation";
277
+ resourceId: string;
278
+ } | {
279
+ fields: string[];
280
+ kind: "endpoint";
281
+ endpoint: string;
282
+ } | {
283
+ reason: string;
284
+ kind: "composite";
285
+ sources: string[];
286
+ };
287
+ surfaces: {
288
+ operation: "filter" | "create" | "update" | "read" | "response";
289
+ fields: {
290
+ toolField: string;
291
+ upstreamField: string;
292
+ mapping: "direct" | "alias";
293
+ requirement: "upstream" | "optional";
294
+ }[];
295
+ overrides: {
296
+ upstreamField: string;
297
+ override: {
298
+ reason: string;
299
+ kind: "database_default";
300
+ } | {
301
+ reason: string;
302
+ kind: "trigger";
303
+ } | {
304
+ reason: string;
305
+ kind: "generated";
306
+ } | {
307
+ reason: string;
308
+ kind: "auth_context";
309
+ } | {
310
+ reason: string;
311
+ kind: "composite_logic";
312
+ } | {
313
+ reason: string;
314
+ kind: "hidden";
315
+ } | {
316
+ reason: string;
317
+ kind: "nullable";
318
+ } | {
319
+ reason: string;
320
+ kind: "conditional";
321
+ condition: string;
322
+ };
323
+ toolField?: string | undefined;
324
+ }[];
325
+ }[];
326
+ }, {
327
+ toolName: string;
328
+ authority: {
329
+ kind: "relation";
330
+ resourceId: string;
331
+ } | {
332
+ fields: string[];
333
+ kind: "endpoint";
334
+ endpoint: string;
335
+ } | {
336
+ reason: string;
337
+ kind: "composite";
338
+ sources: string[];
339
+ };
340
+ surfaces: {
341
+ operation: "filter" | "create" | "update" | "read" | "response";
342
+ fields: {
343
+ toolField: string;
344
+ upstreamField: string;
345
+ mapping: "direct" | "alias";
346
+ requirement: "upstream" | "optional";
347
+ }[];
348
+ overrides: {
349
+ upstreamField: string;
350
+ override: {
351
+ reason: string;
352
+ kind: "database_default";
353
+ } | {
354
+ reason: string;
355
+ kind: "trigger";
356
+ } | {
357
+ reason: string;
358
+ kind: "generated";
359
+ } | {
360
+ reason: string;
361
+ kind: "auth_context";
362
+ } | {
363
+ reason: string;
364
+ kind: "composite_logic";
365
+ } | {
366
+ reason: string;
367
+ kind: "hidden";
368
+ } | {
369
+ reason: string;
370
+ kind: "nullable";
371
+ } | {
372
+ reason: string;
373
+ kind: "conditional";
374
+ condition: string;
375
+ };
376
+ toolField?: string | undefined;
377
+ }[];
378
+ }[];
379
+ }>;
380
+ export declare const toolBindingManifestSchema: z.ZodObject<{
381
+ version: z.ZodLiteral<1>;
382
+ tools: z.ZodArray<z.ZodObject<{
383
+ toolName: z.ZodString;
384
+ authority: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
385
+ kind: z.ZodLiteral<"relation">;
386
+ resourceId: z.ZodString;
387
+ }, "strip", z.ZodTypeAny, {
388
+ kind: "relation";
389
+ resourceId: string;
390
+ }, {
391
+ kind: "relation";
392
+ resourceId: string;
393
+ }>, z.ZodObject<{
394
+ kind: z.ZodLiteral<"endpoint">;
395
+ endpoint: z.ZodString;
396
+ fields: z.ZodArray<z.ZodString, "many">;
397
+ }, "strip", z.ZodTypeAny, {
398
+ fields: string[];
399
+ kind: "endpoint";
400
+ endpoint: string;
401
+ }, {
402
+ fields: string[];
403
+ kind: "endpoint";
404
+ endpoint: string;
405
+ }>, z.ZodObject<{
406
+ kind: z.ZodLiteral<"composite">;
407
+ sources: z.ZodArray<z.ZodString, "many">;
408
+ reason: z.ZodString;
409
+ }, "strip", z.ZodTypeAny, {
410
+ reason: string;
411
+ kind: "composite";
412
+ sources: string[];
413
+ }, {
414
+ reason: string;
415
+ kind: "composite";
416
+ sources: string[];
417
+ }>]>;
418
+ surfaces: z.ZodArray<z.ZodObject<{
419
+ operation: z.ZodEnum<["create", "update", "filter", "read", "response"]>;
420
+ fields: z.ZodArray<z.ZodObject<{
421
+ toolField: z.ZodString;
422
+ upstreamField: z.ZodString;
423
+ mapping: z.ZodEnum<["direct", "alias"]>;
424
+ requirement: z.ZodEnum<["upstream", "optional"]>;
425
+ }, "strip", z.ZodTypeAny, {
426
+ toolField: string;
427
+ upstreamField: string;
428
+ mapping: "direct" | "alias";
429
+ requirement: "upstream" | "optional";
430
+ }, {
431
+ toolField: string;
432
+ upstreamField: string;
433
+ mapping: "direct" | "alias";
434
+ requirement: "upstream" | "optional";
435
+ }>, "many">;
436
+ overrides: z.ZodArray<z.ZodObject<{
437
+ toolField: z.ZodOptional<z.ZodString>;
438
+ upstreamField: z.ZodString;
439
+ override: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
440
+ kind: z.ZodLiteral<"database_default">;
441
+ reason: z.ZodString;
442
+ }, "strip", z.ZodTypeAny, {
443
+ reason: string;
444
+ kind: "database_default";
445
+ }, {
446
+ reason: string;
447
+ kind: "database_default";
448
+ }>, z.ZodObject<{
449
+ kind: z.ZodLiteral<"trigger">;
450
+ reason: z.ZodString;
451
+ }, "strip", z.ZodTypeAny, {
452
+ reason: string;
453
+ kind: "trigger";
454
+ }, {
455
+ reason: string;
456
+ kind: "trigger";
457
+ }>, z.ZodObject<{
458
+ kind: z.ZodLiteral<"generated">;
459
+ reason: z.ZodString;
460
+ }, "strip", z.ZodTypeAny, {
461
+ reason: string;
462
+ kind: "generated";
463
+ }, {
464
+ reason: string;
465
+ kind: "generated";
466
+ }>, z.ZodObject<{
467
+ kind: z.ZodLiteral<"auth_context">;
468
+ reason: z.ZodString;
469
+ }, "strip", z.ZodTypeAny, {
470
+ reason: string;
471
+ kind: "auth_context";
472
+ }, {
473
+ reason: string;
474
+ kind: "auth_context";
475
+ }>, z.ZodObject<{
476
+ kind: z.ZodLiteral<"composite_logic">;
477
+ reason: z.ZodString;
478
+ }, "strip", z.ZodTypeAny, {
479
+ reason: string;
480
+ kind: "composite_logic";
481
+ }, {
482
+ reason: string;
483
+ kind: "composite_logic";
484
+ }>, z.ZodObject<{
485
+ kind: z.ZodLiteral<"hidden">;
486
+ reason: z.ZodString;
487
+ }, "strip", z.ZodTypeAny, {
488
+ reason: string;
489
+ kind: "hidden";
490
+ }, {
491
+ reason: string;
492
+ kind: "hidden";
493
+ }>, z.ZodObject<{
494
+ kind: z.ZodLiteral<"nullable">;
495
+ reason: z.ZodString;
496
+ }, "strip", z.ZodTypeAny, {
497
+ reason: string;
498
+ kind: "nullable";
499
+ }, {
500
+ reason: string;
501
+ kind: "nullable";
502
+ }>, z.ZodObject<{
503
+ kind: z.ZodLiteral<"conditional">;
504
+ reason: z.ZodString;
505
+ condition: z.ZodString;
506
+ }, "strip", z.ZodTypeAny, {
507
+ reason: string;
508
+ kind: "conditional";
509
+ condition: string;
510
+ }, {
511
+ reason: string;
512
+ kind: "conditional";
513
+ condition: string;
514
+ }>]>;
515
+ }, "strip", z.ZodTypeAny, {
516
+ upstreamField: string;
517
+ override: {
518
+ reason: string;
519
+ kind: "database_default";
520
+ } | {
521
+ reason: string;
522
+ kind: "trigger";
523
+ } | {
524
+ reason: string;
525
+ kind: "generated";
526
+ } | {
527
+ reason: string;
528
+ kind: "auth_context";
529
+ } | {
530
+ reason: string;
531
+ kind: "composite_logic";
532
+ } | {
533
+ reason: string;
534
+ kind: "hidden";
535
+ } | {
536
+ reason: string;
537
+ kind: "nullable";
538
+ } | {
539
+ reason: string;
540
+ kind: "conditional";
541
+ condition: string;
542
+ };
543
+ toolField?: string | undefined;
544
+ }, {
545
+ upstreamField: string;
546
+ override: {
547
+ reason: string;
548
+ kind: "database_default";
549
+ } | {
550
+ reason: string;
551
+ kind: "trigger";
552
+ } | {
553
+ reason: string;
554
+ kind: "generated";
555
+ } | {
556
+ reason: string;
557
+ kind: "auth_context";
558
+ } | {
559
+ reason: string;
560
+ kind: "composite_logic";
561
+ } | {
562
+ reason: string;
563
+ kind: "hidden";
564
+ } | {
565
+ reason: string;
566
+ kind: "nullable";
567
+ } | {
568
+ reason: string;
569
+ kind: "conditional";
570
+ condition: string;
571
+ };
572
+ toolField?: string | undefined;
573
+ }>, "many">;
574
+ }, "strip", z.ZodTypeAny, {
575
+ operation: "filter" | "create" | "update" | "read" | "response";
576
+ fields: {
577
+ toolField: string;
578
+ upstreamField: string;
579
+ mapping: "direct" | "alias";
580
+ requirement: "upstream" | "optional";
581
+ }[];
582
+ overrides: {
583
+ upstreamField: string;
584
+ override: {
585
+ reason: string;
586
+ kind: "database_default";
587
+ } | {
588
+ reason: string;
589
+ kind: "trigger";
590
+ } | {
591
+ reason: string;
592
+ kind: "generated";
593
+ } | {
594
+ reason: string;
595
+ kind: "auth_context";
596
+ } | {
597
+ reason: string;
598
+ kind: "composite_logic";
599
+ } | {
600
+ reason: string;
601
+ kind: "hidden";
602
+ } | {
603
+ reason: string;
604
+ kind: "nullable";
605
+ } | {
606
+ reason: string;
607
+ kind: "conditional";
608
+ condition: string;
609
+ };
610
+ toolField?: string | undefined;
611
+ }[];
612
+ }, {
613
+ operation: "filter" | "create" | "update" | "read" | "response";
614
+ fields: {
615
+ toolField: string;
616
+ upstreamField: string;
617
+ mapping: "direct" | "alias";
618
+ requirement: "upstream" | "optional";
619
+ }[];
620
+ overrides: {
621
+ upstreamField: string;
622
+ override: {
623
+ reason: string;
624
+ kind: "database_default";
625
+ } | {
626
+ reason: string;
627
+ kind: "trigger";
628
+ } | {
629
+ reason: string;
630
+ kind: "generated";
631
+ } | {
632
+ reason: string;
633
+ kind: "auth_context";
634
+ } | {
635
+ reason: string;
636
+ kind: "composite_logic";
637
+ } | {
638
+ reason: string;
639
+ kind: "hidden";
640
+ } | {
641
+ reason: string;
642
+ kind: "nullable";
643
+ } | {
644
+ reason: string;
645
+ kind: "conditional";
646
+ condition: string;
647
+ };
648
+ toolField?: string | undefined;
649
+ }[];
650
+ }>, "many">;
651
+ }, "strip", z.ZodTypeAny, {
652
+ toolName: string;
653
+ authority: {
654
+ kind: "relation";
655
+ resourceId: string;
656
+ } | {
657
+ fields: string[];
658
+ kind: "endpoint";
659
+ endpoint: string;
660
+ } | {
661
+ reason: string;
662
+ kind: "composite";
663
+ sources: string[];
664
+ };
665
+ surfaces: {
666
+ operation: "filter" | "create" | "update" | "read" | "response";
667
+ fields: {
668
+ toolField: string;
669
+ upstreamField: string;
670
+ mapping: "direct" | "alias";
671
+ requirement: "upstream" | "optional";
672
+ }[];
673
+ overrides: {
674
+ upstreamField: string;
675
+ override: {
676
+ reason: string;
677
+ kind: "database_default";
678
+ } | {
679
+ reason: string;
680
+ kind: "trigger";
681
+ } | {
682
+ reason: string;
683
+ kind: "generated";
684
+ } | {
685
+ reason: string;
686
+ kind: "auth_context";
687
+ } | {
688
+ reason: string;
689
+ kind: "composite_logic";
690
+ } | {
691
+ reason: string;
692
+ kind: "hidden";
693
+ } | {
694
+ reason: string;
695
+ kind: "nullable";
696
+ } | {
697
+ reason: string;
698
+ kind: "conditional";
699
+ condition: string;
700
+ };
701
+ toolField?: string | undefined;
702
+ }[];
703
+ }[];
704
+ }, {
705
+ toolName: string;
706
+ authority: {
707
+ kind: "relation";
708
+ resourceId: string;
709
+ } | {
710
+ fields: string[];
711
+ kind: "endpoint";
712
+ endpoint: string;
713
+ } | {
714
+ reason: string;
715
+ kind: "composite";
716
+ sources: string[];
717
+ };
718
+ surfaces: {
719
+ operation: "filter" | "create" | "update" | "read" | "response";
720
+ fields: {
721
+ toolField: string;
722
+ upstreamField: string;
723
+ mapping: "direct" | "alias";
724
+ requirement: "upstream" | "optional";
725
+ }[];
726
+ overrides: {
727
+ upstreamField: string;
728
+ override: {
729
+ reason: string;
730
+ kind: "database_default";
731
+ } | {
732
+ reason: string;
733
+ kind: "trigger";
734
+ } | {
735
+ reason: string;
736
+ kind: "generated";
737
+ } | {
738
+ reason: string;
739
+ kind: "auth_context";
740
+ } | {
741
+ reason: string;
742
+ kind: "composite_logic";
743
+ } | {
744
+ reason: string;
745
+ kind: "hidden";
746
+ } | {
747
+ reason: string;
748
+ kind: "nullable";
749
+ } | {
750
+ reason: string;
751
+ kind: "conditional";
752
+ condition: string;
753
+ };
754
+ toolField?: string | undefined;
755
+ }[];
756
+ }[];
757
+ }>, "many">;
758
+ }, "strip", z.ZodTypeAny, {
759
+ version: 1;
760
+ tools: {
761
+ toolName: string;
762
+ authority: {
763
+ kind: "relation";
764
+ resourceId: string;
765
+ } | {
766
+ fields: string[];
767
+ kind: "endpoint";
768
+ endpoint: string;
769
+ } | {
770
+ reason: string;
771
+ kind: "composite";
772
+ sources: string[];
773
+ };
774
+ surfaces: {
775
+ operation: "filter" | "create" | "update" | "read" | "response";
776
+ fields: {
777
+ toolField: string;
778
+ upstreamField: string;
779
+ mapping: "direct" | "alias";
780
+ requirement: "upstream" | "optional";
781
+ }[];
782
+ overrides: {
783
+ upstreamField: string;
784
+ override: {
785
+ reason: string;
786
+ kind: "database_default";
787
+ } | {
788
+ reason: string;
789
+ kind: "trigger";
790
+ } | {
791
+ reason: string;
792
+ kind: "generated";
793
+ } | {
794
+ reason: string;
795
+ kind: "auth_context";
796
+ } | {
797
+ reason: string;
798
+ kind: "composite_logic";
799
+ } | {
800
+ reason: string;
801
+ kind: "hidden";
802
+ } | {
803
+ reason: string;
804
+ kind: "nullable";
805
+ } | {
806
+ reason: string;
807
+ kind: "conditional";
808
+ condition: string;
809
+ };
810
+ toolField?: string | undefined;
811
+ }[];
812
+ }[];
813
+ }[];
814
+ }, {
815
+ version: 1;
816
+ tools: {
817
+ toolName: string;
818
+ authority: {
819
+ kind: "relation";
820
+ resourceId: string;
821
+ } | {
822
+ fields: string[];
823
+ kind: "endpoint";
824
+ endpoint: string;
825
+ } | {
826
+ reason: string;
827
+ kind: "composite";
828
+ sources: string[];
829
+ };
830
+ surfaces: {
831
+ operation: "filter" | "create" | "update" | "read" | "response";
832
+ fields: {
833
+ toolField: string;
834
+ upstreamField: string;
835
+ mapping: "direct" | "alias";
836
+ requirement: "upstream" | "optional";
837
+ }[];
838
+ overrides: {
839
+ upstreamField: string;
840
+ override: {
841
+ reason: string;
842
+ kind: "database_default";
843
+ } | {
844
+ reason: string;
845
+ kind: "trigger";
846
+ } | {
847
+ reason: string;
848
+ kind: "generated";
849
+ } | {
850
+ reason: string;
851
+ kind: "auth_context";
852
+ } | {
853
+ reason: string;
854
+ kind: "composite_logic";
855
+ } | {
856
+ reason: string;
857
+ kind: "hidden";
858
+ } | {
859
+ reason: string;
860
+ kind: "nullable";
861
+ } | {
862
+ reason: string;
863
+ kind: "conditional";
864
+ condition: string;
865
+ };
866
+ toolField?: string | undefined;
867
+ }[];
868
+ }[];
869
+ }[];
870
+ }>;
871
+ export type ToolBindingManifest = z.infer<typeof toolBindingManifestSchema>;
872
+ export type ToolBinding = z.infer<typeof toolBindingSchema>;
873
+ /**
874
+ * Initial manifest for direct PPM bindings. Each operation has its own field
875
+ * surface: sharing a relation never implies identical create, update, filter,
876
+ * and response semantics.
877
+ */
878
+ export declare const toolBindingManifest: {
879
+ readonly version: 1;
880
+ readonly tools: [{
881
+ readonly toolName: "ppm_work_item_create";
882
+ readonly authority: {
883
+ readonly kind: "relation";
884
+ readonly resourceId: "ppm_work_items";
885
+ };
886
+ readonly surfaces: [{
887
+ readonly operation: "create";
888
+ readonly fields: [{
889
+ readonly toolField: "role_id";
890
+ readonly upstreamField: "role_id";
891
+ readonly mapping: "direct";
892
+ readonly requirement: "upstream";
893
+ }];
894
+ readonly overrides: [{
895
+ readonly upstreamField: "tenant_id";
896
+ readonly override: {
897
+ readonly kind: "auth_context";
898
+ readonly reason: "Tenant identity is derived from the authenticated JWT and is never caller-controlled.";
899
+ };
900
+ }, {
901
+ readonly upstreamField: "created_date";
902
+ readonly override: {
903
+ readonly kind: "trigger";
904
+ readonly reason: "Audit timestamps are populated by Persist rather than accepted from MCP callers.";
905
+ };
906
+ }, {
907
+ readonly upstreamField: "updated_date";
908
+ readonly override: {
909
+ readonly kind: "trigger";
910
+ readonly reason: "Audit timestamps are populated by Persist rather than accepted from MCP callers.";
911
+ };
912
+ }];
913
+ }];
914
+ }, {
915
+ readonly toolName: "ppm_template_slot_create";
916
+ readonly authority: {
917
+ readonly kind: "relation";
918
+ readonly resourceId: "ppm_epic_template_slots";
919
+ };
920
+ readonly surfaces: [{
921
+ readonly operation: "create";
922
+ readonly fields: [{
923
+ readonly toolField: "template_id";
924
+ readonly upstreamField: "template_id";
925
+ readonly mapping: "direct";
926
+ readonly requirement: "upstream";
927
+ }, {
928
+ readonly toolField: "slot_code";
929
+ readonly upstreamField: "slot_code";
930
+ readonly mapping: "direct";
931
+ readonly requirement: "upstream";
932
+ }, {
933
+ readonly toolField: "slot_name";
934
+ readonly upstreamField: "slot_name";
935
+ readonly mapping: "direct";
936
+ readonly requirement: "upstream";
937
+ }, {
938
+ readonly toolField: "slot_order";
939
+ readonly upstreamField: "slot_order";
940
+ readonly mapping: "direct";
941
+ readonly requirement: "optional";
942
+ }, {
943
+ readonly toolField: "role_id";
944
+ readonly upstreamField: "role_id";
945
+ readonly mapping: "direct";
946
+ readonly requirement: "upstream";
947
+ }];
948
+ readonly overrides: [{
949
+ readonly upstreamField: "tenant_id";
950
+ readonly override: {
951
+ readonly kind: "auth_context";
952
+ readonly reason: "Tenant identity is derived from the authenticated JWT and is never caller-controlled.";
953
+ };
954
+ }, {
955
+ readonly upstreamField: "slot_order";
956
+ readonly toolField: "slot_order";
957
+ readonly override: {
958
+ readonly kind: "database_default";
959
+ readonly reason: "Persist supplies the default ordering value when the caller omits slot_order.";
960
+ };
961
+ }];
962
+ }];
963
+ }];
964
+ };
965
+ export interface ToolFieldSurface {
966
+ toolName: string;
967
+ operation: z.infer<typeof operationSchema>;
968
+ fields: ReadonlySet<string>;
969
+ requiredFields: ReadonlySet<string>;
970
+ }
971
+ /** Validate references against the pinned upstream contract and MCP schemas. */
972
+ export declare function validateToolBindingManifest(input: unknown, contract: PersistResourceContract, toolSurfaces: readonly ToolFieldSurface[]): ToolBindingManifest;
973
+ /**
974
+ * Whether a tool's create field is required, for tool schemas while the
975
+ * contract rollout remains incremental.
976
+ *
977
+ * `requirement: 'upstream'` follows Persist: for a relation binding the
978
+ * answer is the pinned resource contract's `required` flag for the mapped
979
+ * column, so a column that becomes nullable upstream makes the MCP field
980
+ * optional on the next contract sync. Endpoint and composite bindings have
981
+ * no column metadata, so `upstream` there means required.
982
+ * `requirement: 'optional'` is always optional.
983
+ */
984
+ export declare function isCreateFieldRequired(toolName: string, toolField: string, contract?: PersistResourceContract): boolean;
985
+ export {};
986
+ //# sourceMappingURL=tool-binding-manifest.d.ts.map