Files
Agent-System/internal/workflowdef/manifest_loader.go
weichenandCursor 909384c335 feat(workflow): SWBOOT-02..04 software manifests and catalog allowlist
Add software_bootstrap/delivery v2 manifests, expand selectable keys to
five, keep medical doc-count gates, and filter catalog by product_domain.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 15:39:01 +00:00

36 lines
1.0 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package workflowdef
import (
"embed"
"encoding/json"
"fmt"
)
//go:embed manifests/*.json
var manifestFS embed.FS
// LoadManifestDefinition 读取内嵌 v2 manifest(Phase 4 发布种子)。
func LoadManifestDefinition(filename string) (VersionDefinition, error) {
raw, err := manifestFS.ReadFile("manifests/" + filename)
if err != nil {
return VersionDefinition{}, fmt.Errorf("read manifest %s: %w", filename, err)
}
var def VersionDefinition
if err := json.Unmarshal(raw, &def); err != nil {
return VersionDefinition{}, fmt.Errorf("parse manifest %s: %w", filename, err)
}
if def.SchemaVersion <= 0 {
def.SchemaVersion = 2
}
return def, nil
}
// V2ManifestFiles 正式工作流 v2 manifest 文件名(医疗三 + 软件两)。
var V2ManifestFiles = map[string]string{
"main": "main.v2.json",
"product_manager": "product_manager.v2.json",
"test_manager": "test_manager.v2.json",
"software_bootstrap": "software_bootstrap.v2.json",
"software_delivery": "software_delivery.v2.json",
}