Feat v0.7.0 shell contract + surface audit + rebrand

Two-slot shell topbar (home, left, center, bell, user menu) with SDK API
(setLeft/setSlot/setTitle/hide/show). All 4 primary surfaces migrated:
Settings and Team Admin to Pattern B (flat tabs), Admin to Pattern C
(category tabs + sidebar), Docs to Pattern A (default).

Backend WS events: package.changed (broadcast), auth.changed (targeted),
notification.all_read. User menu re-fetches on package/auth changes.
Bell syncs read state across tabs.

Error handling pass with .sw-inline-error CSS primitive. Empty state
guidance for Admin Workflows/Groups. Announcement global dismiss via
localStorage. Rebrand assets deployed (both b/e icon variants, wordmarks,
full icon library). Docs outline scroll-to-heading fix.

Bug fixes: ICD security assertion tightened, workflow-demo error surfacing,
signoff display names, hello-dashboard + team-admin/groups.js deleted.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-01 20:08:57 +00:00
parent 1236220302
commit 1fbd836c5c
150 changed files with 3250 additions and 533 deletions

View File

@@ -11,11 +11,13 @@ import (
"path/filepath"
"regexp"
"strings"
"time"
"github.com/gin-gonic/gin"
"go.starlark.net/starlark"
"armature/database"
"armature/events"
"armature/models"
"armature/sandbox"
"armature/store"
@@ -34,6 +36,7 @@ type PackageHandler struct {
bundledDir string // e.g. /app/bundled-packages — .pkg archive source
sandbox *sandbox.Sandbox
runner *sandbox.Runner
hub *events.Hub
}
func NewPackageHandler(s store.Stores, packagesDir ...string) *PackageHandler {
@@ -60,6 +63,23 @@ func (h *PackageHandler) SetRunner(r *sandbox.Runner) {
h.runner = r
}
// SetHub attaches the event hub for broadcasting package lifecycle events.
func (h *PackageHandler) SetHub(hub *events.Hub) {
h.hub = hub
}
// broadcastPackageChanged emits a package.changed event to all clients.
func (h *PackageHandler) broadcastPackageChanged(action, id string) {
if h.hub == nil {
return
}
h.hub.Broadcast(events.Event{
Label: "package.changed",
Payload: events.MustJSON(map[string]string{"action": action, "id": id}),
Ts: time.Now().UnixMilli(),
})
}
// ListPackages returns all registered packages.
// GET /api/v1/admin/packages
func (h *PackageHandler) ListPackages(c *gin.Context) {
@@ -116,6 +136,7 @@ func (h *PackageHandler) EnablePackage(c *gin.Context) {
return
}
c.JSON(http.StatusOK, gin.H{"id": id, "enabled": true})
h.broadcastPackageChanged("enabled", id)
}
// DisablePackage disables a package. Admin cannot be disabled.
@@ -133,6 +154,7 @@ func (h *PackageHandler) DisablePackage(c *gin.Context) {
return
}
c.JSON(http.StatusOK, gin.H{"id": id, "enabled": false})
h.broadcastPackageChanged("disabled", id)
}
// DeletePackage uninstalls a package. Core packages cannot be deleted.
@@ -180,6 +202,7 @@ func (h *PackageHandler) DeletePackage(c *gin.Context) {
}
c.JSON(http.StatusOK, gin.H{"id": id, "deleted": true})
h.broadcastPackageChanged("deleted", id)
}
// InstallPackage uploads and installs a .pkg/.surface archive.
@@ -586,6 +609,7 @@ func (h *PackageHandler) InstallPackage(c *gin.Context) {
resp["status"] = "dormant"
}
c.JSON(http.StatusOK, resp)
h.broadcastPackageChanged("installed", pkgID)
}
// extractableRelPath returns the relative path for a zip entry if it
@@ -1073,6 +1097,7 @@ func (h *PackageHandler) UpdatePackage(c *gin.Context) {
"previous_version": previousVersion,
"changes": schemaChanges,
})
h.broadcastPackageChanged("updated", pkgID)
}
// mergePackageSettings merges existing settings with a new manifest's settings schema.