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:
@@ -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{
|
||||
|
||||
Reference in New Issue
Block a user