File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525 "tag" : { "type" : " string" },
2626 "checksums" : {
2727 "type" : " object" ,
28- "additionalProperties" : { "type" : " string" }
28+ "additionalProperties" : {
29+ "oneOf" : [
30+ {
31+ "type" : " object" ,
32+ "properties" : {
33+ "asset" : { "type" : " string" },
34+ "sha256" : { "type" : " string" }
35+ },
36+ "required" : [" asset" , " sha256" ]
37+ },
38+ { "type" : " string" }
39+ ]
40+ }
2941 }
3042 },
3143 "additionalProperties" : true
3244 }
3345 }
3446 },
35- "required " : [ " tools " ]
47+ "additionalProperties " : true
3648}
Original file line number Diff line number Diff line change @@ -44,9 +44,20 @@ const toolSchema = z
4444 . optional ( )
4545 . describe ( 'Release tag (when different from version)' ) ,
4646 checksums : z
47- . record ( z . string ( ) , z . string ( ) )
47+ . record (
48+ z . string ( ) ,
49+ z . union ( [
50+ // Platform-keyed: { "darwin-arm64": { "asset": "file.tar.gz", "sha256": "abc..." } }
51+ z . object ( {
52+ asset : z . string ( ) ,
53+ sha256 : z . string ( ) ,
54+ } ) ,
55+ // Flat: { "file.tar.gz": "abc..." } (legacy/simple)
56+ z . string ( ) ,
57+ ] ) ,
58+ )
4859 . optional ( )
49- . describe ( 'SHA-256 checksums keyed by asset filename' ) ,
60+ . describe ( 'Checksums keyed by platform or asset filename' ) ,
5061
5162 // npm package fields (socket-cli bundle-tools).
5263 integrity : z
@@ -76,9 +87,10 @@ export const externalToolsSchema = z
7687 . describe ( 'Path to a base external-tools.json to inherit tools from' ) ,
7788 tools : z
7889 . record ( z . string ( ) , toolSchema )
90+ . optional ( )
7991 . describe ( 'Map of tool name to tool configuration' ) ,
8092 } )
81- . strict ( )
93+ . passthrough ( )
8294
8395/**
8496 * Validate an external-tools.json object against the schema.
You can’t perform that action at this time.
0 commit comments