Files
Agent-System/internal/workflowdef/manifest_loader.go
T
weichenandCursor 90f77eac93 feat(authz): implement six-phase permissions, settings and workflow v2
Close P0 auth gaps for lineage/runs, stage ABAC fail-closed, and
project:create; add IAM migrations 00021-23, me settings APIs, schema v2
manifests, orchestrator skeleton, and gate A regression coverage.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 02:50:23 +00:00

34 lines
905 B
Go
Raw 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",
}