Fix v0.3.7: tag dashboard + editor as dormant, generalize requires check

Functional audit found dashboard and editor render blank — they depend
on the removed sw.* imperative SDK (sw.tabs, sw.chat, sw.layout, etc).
Tagged with requires: ["legacy-sdk"] so the installer auto-sets dormant.

Generalized the dormant requires check: any unmet requirement now
triggers dormant status, not just "chat".

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-28 20:34:35 +00:00
parent 6fec66bcc1
commit 0364fbb1a9
4 changed files with 15 additions and 11 deletions

View File

@@ -584,21 +584,23 @@ func (h *PackageHandler) InstallPackage(c *gin.Context) {
}
// v0.3.7: Auto-set dormant for packages with unmet requires.
isDormant := false
// Known capabilities: (none yet — chat and legacy-sdk are future/removed).
knownCaps := map[string]bool{}
var unmetReqs []string
if reqs, ok := manifest["requires"].([]any); ok && len(reqs) > 0 {
for _, r := range reqs {
req, _ := r.(string)
if req == "chat" {
isDormant = true
break
if req != "" && !knownCaps[req] {
unmetReqs = append(unmetReqs, req)
}
}
}
isDormant := len(unmetReqs) > 0
if isDormant {
h.stores.Packages.SetStatus(c.Request.Context(), pkgID, "dormant")
h.stores.Packages.SetEnabled(c.Request.Context(), pkgID, false)
preservedEnabled = false
log.Printf("[packages] %s: dormant (unmet requires: chat)", pkgID)
log.Printf("[packages] %s: dormant (unmet requires: %v)", pkgID, unmetReqs)
}
resp := gin.H{