Add GSP init and AI usage tooling

This commit is contained in:
2026-05-06 19:40:55 +08:00
parent 67a1bf2600
commit 1478972e53
17 changed files with 870 additions and 8 deletions

View File

@@ -19,6 +19,13 @@ func (p *Project) Validate(stage string) Report {
report.Notices = append(report.Notices, issue)
}
}
if p.Manifest != nil {
if p.Manifest.GSPVersion == "" {
report.addWarning("missing_gsp_version", "", p.Manifest.File, "manifest has no gspVersion")
} else if !SupportsGSPVersion(p.Manifest.GSPVersion) {
report.addError("unsupported_gsp_version", "", p.Manifest.File, fmt.Sprintf("GSP version %q is not supported by this toolkit", p.Manifest.GSPVersion))
}
}
for _, unit := range p.Units {
if unit.ID == "" {
report.addError("missing_id", "", unit.File, "GSP requires id")