@@ -12,149 +12,140 @@ const evidenceIdSchema = z
1212 . regex ( / ^ e v _ [ a - f 0 - 9 ] { 64 } $ / u)
1313 . describe ( "Evidence ID returned earlier in this session" ) ;
1414
15- const requireExactlyOne = (
16- context : z . RefinementCtx ,
17- fields : readonly [ string , unknown , string , unknown ] ,
18- ) : void => {
19- const [ leftName , left , rightName , right ] = fields ;
20- if ( ( left === undefined ) !== ( right === undefined ) ) return ;
21- context . addIssue ( {
22- code : "custom" ,
23- path : [ left === undefined ? leftName : rightName ] ,
24- message : `Supply exactly one of ${ leftName } or ${ rightName } ` ,
25- } ) ;
26- } ;
15+ const traceApplicationFeatureFacts = {
16+ native_observations :
17+ traceApplicationFeatureInputSchema . shape . native_observations ,
18+ native_observation_evidence_ids : z
19+ . array ( evidenceIdSchema )
20+ . max ( 64 )
21+ . default ( [ ] ) ,
22+ seed : traceApplicationFeatureInputSchema . shape . seed ,
23+ direction : traceApplicationFeatureInputSchema . shape . direction ,
24+ limits : traceApplicationFeatureInputSchema . shape . limits ,
25+ } as const ;
2726
2827/** MCP/CLI trace request accepting full Evidence or a ledger reference. */
29- export const traceApplicationFeatureRequestSchema = z
30- . strictObject ( {
31- application : evidenceSchema . optional ( ) ,
32- application_evidence_id : evidenceIdSchema . optional ( ) ,
33- native_observations :
34- traceApplicationFeatureInputSchema . shape . native_observations ,
35- native_observation_evidence_ids : z
36- . array ( evidenceIdSchema )
37- . max ( 64 )
38- . default ( [ ] ) ,
39- seed : traceApplicationFeatureInputSchema . shape . seed ,
40- direction : traceApplicationFeatureInputSchema . shape . direction ,
41- limits : traceApplicationFeatureInputSchema . shape . limits ,
42- } )
43- . superRefine ( ( input , context ) => {
44- requireExactlyOne ( context , [
45- "application" ,
46- input . application ,
47- "application_evidence_id" ,
48- input . application_evidence_id ,
49- ] ) ;
50- } ) ;
28+ export const traceApplicationFeatureRequestSchema = z . union ( [
29+ z . strictObject ( {
30+ ...traceApplicationFeatureFacts ,
31+ application : evidenceSchema ,
32+ } ) ,
33+ z . strictObject ( {
34+ ...traceApplicationFeatureFacts ,
35+ application_evidence_id : evidenceIdSchema ,
36+ } ) ,
37+ ] ) ;
5138
5239/** MCP/CLI semantic trace request accepting full Evidence or a ledger reference. */
53- export const traceJavaScriptSemanticsRequestSchema = z
54- . strictObject ( {
55- application : evidenceSchema . optional ( ) ,
56- application_evidence_id : evidenceIdSchema . optional ( ) ,
40+ export const traceJavaScriptSemanticsRequestSchema = z . union ( [
41+ z . strictObject ( {
42+ application : evidenceSchema ,
5743 query : javaScriptSemanticQueryInputSchema ,
58- } )
59- . superRefine ( ( input , context ) => {
60- requireExactlyOne ( context , [
61- "application" ,
62- input . application ,
63- "application_evidence_id" ,
64- input . application_evidence_id ,
65- ] ) ;
66- } ) ;
44+ } ) ,
45+ z . strictObject ( {
46+ application_evidence_id : evidenceIdSchema ,
47+ query : javaScriptSemanticQueryInputSchema ,
48+ } ) ,
49+ ] ) ;
50+
51+ const compareApplicationVersionsFacts = {
52+ left_native_observations :
53+ compareApplicationVersionsInputSchema . shape . left_native_observations ,
54+ left_native_observation_evidence_ids : z
55+ . array ( evidenceIdSchema )
56+ . max ( 64 )
57+ . default ( [ ] ) ,
58+ right_native_observations :
59+ compareApplicationVersionsInputSchema . shape . right_native_observations ,
60+ right_native_observation_evidence_ids : z
61+ . array ( evidenceIdSchema )
62+ . max ( 64 )
63+ . default ( [ ] ) ,
64+ limits : compareApplicationVersionsInputSchema . shape . limits ,
65+ unknown_registry_approved :
66+ compareApplicationVersionsInputSchema . shape . unknown_registry_approved ,
67+ } as const ;
6768
6869/** MCP/CLI comparison request accepting full Evidence or ledger references. */
69- export const compareApplicationVersionsRequestSchema = z
70- . strictObject ( {
71- left : evidenceSchema . optional ( ) ,
72- left_evidence_id : evidenceIdSchema . optional ( ) ,
73- right : evidenceSchema . optional ( ) ,
74- right_evidence_id : evidenceIdSchema . optional ( ) ,
75- left_native_observations :
76- compareApplicationVersionsInputSchema . shape . left_native_observations ,
77- left_native_observation_evidence_ids : z
78- . array ( evidenceIdSchema )
79- . max ( 64 )
80- . default ( [ ] ) ,
81- right_native_observations :
82- compareApplicationVersionsInputSchema . shape . right_native_observations ,
83- right_native_observation_evidence_ids : z
84- . array ( evidenceIdSchema )
85- . max ( 64 )
86- . default ( [ ] ) ,
87- limits : compareApplicationVersionsInputSchema . shape . limits ,
88- unknown_registry_approved :
89- compareApplicationVersionsInputSchema . shape . unknown_registry_approved ,
90- } )
91- . superRefine ( ( input , context ) => {
92- requireExactlyOne ( context , [
93- "left" ,
94- input . left ,
95- "left_evidence_id" ,
96- input . left_evidence_id ,
97- ] ) ;
98- requireExactlyOne ( context , [
99- "right" ,
100- input . right ,
101- "right_evidence_id" ,
102- input . right_evidence_id ,
103- ] ) ;
104- } ) ;
70+ export const compareApplicationVersionsRequestSchema = z . union ( [
71+ z . strictObject ( {
72+ ...compareApplicationVersionsFacts ,
73+ left : evidenceSchema ,
74+ right : evidenceSchema ,
75+ } ) ,
76+ z . strictObject ( {
77+ ...compareApplicationVersionsFacts ,
78+ left : evidenceSchema ,
79+ right_evidence_id : evidenceIdSchema ,
80+ } ) ,
81+ z . strictObject ( {
82+ ...compareApplicationVersionsFacts ,
83+ left_evidence_id : evidenceIdSchema ,
84+ right : evidenceSchema ,
85+ } ) ,
86+ z . strictObject ( {
87+ ...compareApplicationVersionsFacts ,
88+ left_evidence_id : evidenceIdSchema ,
89+ right_evidence_id : evidenceIdSchema ,
90+ } ) ,
91+ ] ) ;
92+
93+ const compareSourceToBundleFacts = {
94+ reference : compareSourceToBundleInputSchema . shape . reference ,
95+ limits : compareSourceToBundleInputSchema . shape . limits ,
96+ unknown_registry_approved :
97+ compareSourceToBundleInputSchema . shape . unknown_registry_approved ,
98+ } as const ;
10599
106100/** Historical-source comparison accepting full application Evidence or a ledger reference. */
107- export const compareSourceToBundleRequestSchema = z
108- . strictObject ( {
109- reference : compareSourceToBundleInputSchema . shape . reference ,
110- application : evidenceSchema . optional ( ) ,
111- application_evidence_id : evidenceIdSchema . optional ( ) ,
112- limits : compareSourceToBundleInputSchema . shape . limits ,
113- unknown_registry_approved :
114- compareSourceToBundleInputSchema . shape . unknown_registry_approved ,
115- } )
116- . superRefine ( ( input , context ) => {
117- requireExactlyOne ( context , [
118- "application" ,
119- input . application ,
120- "application_evidence_id" ,
121- input . application_evidence_id ,
122- ] ) ;
123- } ) ;
101+ export const compareSourceToBundleRequestSchema = z . union ( [
102+ z . strictObject ( {
103+ ...compareSourceToBundleFacts ,
104+ application : evidenceSchema ,
105+ } ) ,
106+ z . strictObject ( {
107+ ...compareSourceToBundleFacts ,
108+ application_evidence_id : evidenceIdSchema ,
109+ } ) ,
110+ ] ) ;
111+
112+ const compareJavaScriptExportShapesFacts = {
113+ left_module_path :
114+ compareJavaScriptExportShapesInputSchema . shape . left_module_path ,
115+ left_export_name :
116+ compareJavaScriptExportShapesInputSchema . shape . left_export_name ,
117+ right_module_path :
118+ compareJavaScriptExportShapesInputSchema . shape . right_module_path ,
119+ right_export_name :
120+ compareJavaScriptExportShapesInputSchema . shape . right_export_name ,
121+ limits : compareJavaScriptExportShapesInputSchema . shape . limits ,
122+ unknown_registry_approved :
123+ compareJavaScriptExportShapesInputSchema . shape . unknown_registry_approved ,
124+ } as const ;
124125
125126/** MCP/CLI export-shape request accepting full Evidence or ledger references. */
126- export const compareJavaScriptExportShapesRequestSchema = z
127- . strictObject ( {
128- left : evidenceSchema . optional ( ) ,
129- left_evidence_id : evidenceIdSchema . optional ( ) ,
130- right : evidenceSchema . optional ( ) ,
131- right_evidence_id : evidenceIdSchema . optional ( ) ,
132- left_module_path :
133- compareJavaScriptExportShapesInputSchema . shape . left_module_path ,
134- left_export_name :
135- compareJavaScriptExportShapesInputSchema . shape . left_export_name ,
136- right_module_path :
137- compareJavaScriptExportShapesInputSchema . shape . right_module_path ,
138- right_export_name :
139- compareJavaScriptExportShapesInputSchema . shape . right_export_name ,
140- limits : compareJavaScriptExportShapesInputSchema . shape . limits ,
141- unknown_registry_approved :
142- compareJavaScriptExportShapesInputSchema . shape . unknown_registry_approved ,
143- } )
144- . superRefine ( ( input , context ) => {
145- requireExactlyOne ( context , [
146- "left" ,
147- input . left ,
148- "left_evidence_id" ,
149- input . left_evidence_id ,
150- ] ) ;
151- requireExactlyOne ( context , [
152- "right" ,
153- input . right ,
154- "right_evidence_id" ,
155- input . right_evidence_id ,
156- ] ) ;
157- } ) ;
127+ export const compareJavaScriptExportShapesRequestSchema = z . union ( [
128+ z . strictObject ( {
129+ ...compareJavaScriptExportShapesFacts ,
130+ left : evidenceSchema ,
131+ right : evidenceSchema ,
132+ } ) ,
133+ z . strictObject ( {
134+ ...compareJavaScriptExportShapesFacts ,
135+ left : evidenceSchema ,
136+ right_evidence_id : evidenceIdSchema ,
137+ } ) ,
138+ z . strictObject ( {
139+ ...compareJavaScriptExportShapesFacts ,
140+ left_evidence_id : evidenceIdSchema ,
141+ right : evidenceSchema ,
142+ } ) ,
143+ z . strictObject ( {
144+ ...compareJavaScriptExportShapesFacts ,
145+ left_evidence_id : evidenceIdSchema ,
146+ right_evidence_id : evidenceIdSchema ,
147+ } ) ,
148+ ] ) ;
158149
159150export type TraceApplicationFeatureRequest = z . output <
160151 typeof traceApplicationFeatureRequestSchema
0 commit comments