Files
CaIon 210734bb73 refactor(task): remove the custom-plugin layer switch
TaskPluginOverrideEnabled had no UI since the master switch landed, yet
when left off it marked every third-party plugin "disabled; platform
unavailable" regardless of its own toggle. Drop the option, env var,
registry flag, and the dead branch in ListTaskPlugins; the master switch
and per-plugin toggles are the only two levels now.
2026-09-07 22:38:09 +08:00

38 lines
1.1 KiB
Go

package constant
type TaskPlatform string
const (
TaskPlatformSuno TaskPlatform = "suno"
TaskPlatformMidjourney = "mj"
)
const (
TaskActionImageToVideo = "image_to_video"
TaskActionTextToVideo = "text_to_video"
TaskActionFirstTailToVideo = "first_tail_to_video"
TaskActionReferenceToVideo = "reference_to_video"
TaskActionRemix = "remix"
)
var legacyTaskActionAliases = map[string]string{
"generate": TaskActionImageToVideo,
"textGenerate": TaskActionTextToVideo,
"firstTailGenerate": TaskActionFirstTailToVideo,
"referenceGenerate": TaskActionReferenceToVideo,
"remixGenerate": TaskActionRemix,
}
// TaskPluginEnabled is the master switch for the whole task-plugin system.
// When disabled, factory and override plugins both stop serving.
var TaskPluginEnabled = true
// NormalizeTaskAction maps persisted legacy action names to the canonical task
// action vocabulary. Unknown platform-specific actions pass through unchanged.
func NormalizeTaskAction(action string) string {
if canonical, ok := legacyTaskActionAliases[action]; ok {
return canonical
}
return action
}