2026-07-16 16:52:46 +08:00
{
"$schema" : "https://json-schema.org/draft/2020-12/schema" ,
"$id" : "https://softbox.invalid/schemas/app.schema.json" ,
"title" : "SoftBox Package app.json v1" ,
"type" : "object" ,
"additionalProperties" : false ,
"required" : [
"schema_version" ,
"id" ,
"name" ,
"vendor" ,
"version" ,
"channel" ,
"min_os" ,
"architecture" ,
"entrypoint" ,
"working_directory" ,
"product_id" ,
"supports_trial" ,
"requires_admin" ,
"data_policy" ,
"update_policy"
],
"properties" : {
"schema_version" : {
"const" : 1
},
"id" : {
"type" : "string" ,
"pattern" : "^[a-z0-9-]+$"
},
"name" : {
"type" : "string" ,
"minLength" : 1
},
"vendor" : {
"type" : "string" ,
"minLength" : 1
},
"version" : {
"type" : "string" ,
2026-07-16 17:00:06 +08:00
"pattern" : "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(?:-((?:0|[1-9][0-9]*|[0-9]*[A-Za-z-][0-9A-Za-z-]*)(?:\\.(?:0|[1-9][0-9]*|[0-9]*[A-Za-z-][0-9A-Za-z-]*))*))?(?:\\+([0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*))?$"
2026-07-16 16:52:46 +08:00
},
"channel" : {
"const" : "stable"
},
"min_os" : {
"enum" : [ "windows-7-sp1" , "windows-10" , "windows-11" ]
},
"architecture" : {
"enum" : [ "386" , "amd64" ]
},
"entrypoint" : {
"$ref" : "#/$defs/safeRelativePath"
},
"working_directory" : {
"oneOf" : [
{
"const" : "."
},
{
"$ref" : "#/$defs/safeRelativePath"
}
]
},
"product_id" : {
"type" : "string" ,
"pattern" : "^[a-z0-9-]+$"
},
"supports_trial" : {
"type" : "boolean"
},
"requires_admin" : {
"type" : "boolean"
},
"data_policy" : {
"const" : "local-app-data"
},
"update_policy" : {
"const" : "managed-by-softbox"
}
},
"$defs" : {
"safeRelativePath" : {
"type" : "string" ,
"minLength" : 1 ,
2026-07-16 23:56:19 +08:00
"$comment" : "Runtime validation additionally rejects invalid UTF-8/control characters and Windows reserved device names; this pattern is only a basic shape constraint." ,
"pattern" : "^(?!/)(?! )(?!.*(/ ))(?!.*\\\\)(?!.*[:<>\"|?*])(?!\\.\\.?(/|$))(?!.*(/\\.\\.?)(/|$))(?!.*//)(?!.*[ .](/|$)).+$"
2026-07-16 16:52:46 +08:00
}
}
}