Feat v0.2.5 ui polish dead code #9
@@ -101,13 +101,13 @@ func (h *PackageHandler) EnablePackage(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, gin.H{"id": id, "enabled": true})
|
||||
}
|
||||
|
||||
// DisablePackage disables a package. Chat and Admin cannot be disabled.
|
||||
// DisablePackage disables a package. Admin cannot be disabled.
|
||||
// PUT /api/v1/admin/packages/:id/disable
|
||||
// PUT /api/v1/admin/surfaces/:id/disable (alias)
|
||||
func (h *PackageHandler) DisablePackage(c *gin.Context) {
|
||||
id := c.Param("id")
|
||||
|
||||
if id == "chat" || id == "admin" {
|
||||
if id == "admin" {
|
||||
c.JSON(http.StatusBadRequest, gin.H{"error": id + " cannot be disabled"})
|
||||
return
|
||||
}
|
||||
|
||||
@@ -285,7 +285,7 @@ func (h *WorkflowHandler) Publish(c *gin.Context) {
|
||||
stages = []models.WorkflowStage{}
|
||||
}
|
||||
|
||||
// Snapshot includes persona tool grants at publish time (frozen for running instances)
|
||||
// Snapshot stages at publish time (frozen for running instances)
|
||||
type stageSnapshot struct {
|
||||
models.WorkflowStage
|
||||
ToolGrants []string `json:"tool_grants,omitempty"`
|
||||
|
||||
@@ -48,11 +48,10 @@ func (e *Engine) SeedSurfaces() {
|
||||
}
|
||||
|
||||
// IsSurfaceEnabled checks if a surface is enabled in the registry.
|
||||
// Chat and Admin are always enabled (system-critical).
|
||||
// Admin is always enabled (system-critical).
|
||||
// Returns true if the surface is not found (fail-open for backward compat).
|
||||
func (e *Engine) IsSurfaceEnabled(surfaceID string) bool {
|
||||
// Chat and Admin cannot be disabled — they're system-critical
|
||||
if surfaceID == "chat" || surfaceID == "admin" {
|
||||
if surfaceID == "admin" {
|
||||
return true
|
||||
}
|
||||
if e.stores.Packages == nil {
|
||||
|
||||
@@ -4,7 +4,6 @@ import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
"switchboard-core/models"
|
||||
)
|
||||
@@ -224,8 +223,6 @@ func (s *TeamStore) IsMember(ctx context.Context, teamID, userID string) (bool,
|
||||
return exists, err
|
||||
}
|
||||
|
||||
// unused but keeping for reference
|
||||
var _ = fmt.Sprintf
|
||||
|
||||
// ── CS1 additions (v0.29.0) ─────────────────────────────────────────────
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"switchboard-core/models"
|
||||
@@ -231,8 +230,6 @@ func (s *TeamStore) IsMember(ctx context.Context, teamID, userID string) (bool,
|
||||
return exists, err
|
||||
}
|
||||
|
||||
// unused but keeping for reference
|
||||
var _ = fmt.Sprintf
|
||||
|
||||
// ── CS1 additions (v0.29.0) ─────────────────────────────────────────────
|
||||
|
||||
|
||||
Reference in New Issue
Block a user