Removed all references to dropped packages in non-test code.
Zero dropped imports, store refs, or model types remaining.
Major removals:
- scheduler/ package (entire dir) — tasks moved to extension track
- taskutil/ package (entire dir)
- health/ package (entire dir) — provider/tool health
- sandbox/provider_module.go — provider.complete module
- handlers: workflow_entry, workflow_instances, workflow_forms,
workflow_assignments, workflow_monitor, health_admin (6 files)
- auth/session.go, middleware/session_auth.go
- store/{postgres,sqlite}/sessions.go, tasks.go
Rewrites:
- store/{postgres,sqlite}/health.go — kernel-only Prune
(ws_tickets, rate_limit_counters, stale presence)
- handlers/admin.go: 847→467 lines (stripped provider CRUD)
- handlers/teams.go: 520→411 lines (stripped model listing)
- sandbox/runner.go: removed ProviderResolver
- sandbox/workflow_module.go: 216→83 lines (definition-only)
- main.go: 1579→1325 lines (stripped dropped package init)
- pages/pages.go: stripped channel/session lookups
- events/types.go: stripped chat/channel/workspace event routes
- models: stripped stale types, constants, notification types
Store interface cleanup:
- Removed SessionStore, TaskStore from Stores struct
- Stripped workflow assignment methods from WorkflowStore iface
- Stripped assignment methods from PG+SQLite workflow stores
- Updated testhelper.go table list to kernel-only
Migrations: removed 008_tasks.sql (both dialects)
-9665/+69 lines across 51 files.
63 lines
2.3 KiB
Go
63 lines
2.3 KiB
Go
package models
|
|
|
|
import "time"
|
|
|
|
// ── Package Status Constants ─────────────────
|
|
|
|
const (
|
|
// PackageStatusActive means the package is running normally.
|
|
PackageStatusActive = "active"
|
|
|
|
// PackageStatusPendingReview means the package declared permissions
|
|
// that require admin approval before activation.
|
|
PackageStatusPendingReview = "pending_review"
|
|
|
|
// PackageStatusSuspended means an admin has suspended the package.
|
|
PackageStatusSuspended = "suspended"
|
|
)
|
|
|
|
// ValidPackageStatuses is the set of valid package status values.
|
|
var ValidPackageStatuses = map[string]bool{
|
|
PackageStatusActive: true,
|
|
PackageStatusPendingReview: true,
|
|
PackageStatusSuspended: true,
|
|
}
|
|
|
|
// ── Extension Permission Constants ───────────
|
|
|
|
const (
|
|
ExtPermSecretsRead = "secrets.read"
|
|
ExtPermNotificationsSend = "notifications.send"
|
|
ExtPermDBRead = "db.read"
|
|
ExtPermDBWrite = "db.write"
|
|
ExtPermAPIHTTP = "api.http"
|
|
ExtPermFormValidate = "forms.validate" // v0.29.3: form validation hooks
|
|
ExtPermWorkflowAccess = "workflow.access" // v0.30.2: workflow definition + stage data access
|
|
ExtPermConnectionsRead = "connections.read" // v0.38.1: extension connection resolution
|
|
)
|
|
|
|
// ValidExtensionPermissions is the set of recognized permission keys.
|
|
var ValidExtensionPermissions = map[string]bool{
|
|
ExtPermSecretsRead: true,
|
|
ExtPermNotificationsSend: true,
|
|
ExtPermDBRead: true,
|
|
ExtPermDBWrite: true,
|
|
ExtPermAPIHTTP: true,
|
|
ExtPermFormValidate: true,
|
|
ExtPermWorkflowAccess: true,
|
|
ExtPermConnectionsRead: true,
|
|
}
|
|
|
|
// ── Extension Permission Model ───────────────
|
|
|
|
// ExtensionPermission represents a declared/granted capability for a package.
|
|
type ExtensionPermission struct {
|
|
ID string `json:"id" db:"id"`
|
|
PackageID string `json:"package_id" db:"package_id"`
|
|
Permission string `json:"permission" db:"permission"`
|
|
Granted bool `json:"granted" db:"granted"`
|
|
GrantedBy *string `json:"granted_by,omitempty" db:"granted_by"`
|
|
GrantedAt *time.Time `json:"granted_at,omitempty" db:"granted_at"`
|
|
CreatedAt time.Time `json:"created_at" db:"created_at"`
|
|
}
|