Documentation
¶
Index ¶
- func ApplyGraph(base core.Scenario, graph ScenarioGraph) (core.Scenario, error)
- func ApplyScenarioPatch(base core.Scenario, patch ScenarioPatch) (core.Scenario, error)
- func DeepCopyScenario(base core.Scenario) (core.Scenario, error)
- func GenerateBuilderCode(scenario core.Scenario) (string, error)
- func ImportWorkflow(view GraphView) (core.Workflow, error)
- type GraphEdge
- type GraphNode
- type GraphPosition
- type GraphView
- type ScenarioGraph
- type ScenarioPatch
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyGraph ¶
ApplyGraph merges a Studio graph into a scenario, replacing the main workflow and any named subgraph workflows present in the graph payload.
func ApplyScenarioPatch ¶ added in v0.4.0
ApplyScenarioPatch merges patch into a deep copy of base. New agents and skills are added only when their name does not exist in the base scenario; named workflows are added under the same rule. The main workflow is replaced when patch.Workflow is set (topology is the one thing a patch is expected to redefine).
func DeepCopyScenario ¶ added in v0.4.0
DeepCopyScenario returns an independent copy of base. ApplyGraph only shallow-copies its base and merges named workflows into the shared Orchestration.Workflows map, so any ephemeral apply path must deep-copy first to avoid mutating the caller's (live) scenario.
func GenerateBuilderCode ¶
GenerateBuilderCode renders a builder-style Go snippet for the scenario workflow.
Types ¶
type GraphEdge ¶
type GraphEdge struct {
From string `json:"from"`
To string `json:"to"`
Condition string `json:"condition,omitempty"`
}
GraphEdge connects two workflow nodes.
type GraphNode ¶
type GraphNode struct {
ID string `json:"id"`
Kind string `json:"kind"`
Ref string `json:"ref,omitempty"`
Input json.RawMessage `json:"input,omitempty"`
Condition string `json:"condition,omitempty"`
DependsOn []string `json:"depends_on,omitempty"`
Interrupt bool `json:"interrupt,omitempty"`
Resumable bool `json:"resumable"`
ResumeHint string `json:"resume_hint,omitempty"`
}
GraphNode is a workflow node for visualization.
type GraphPosition ¶
GraphPosition stores a Studio canvas coordinate for a node.
type GraphView ¶
type GraphView struct {
ID string `json:"id,omitempty"`
Nodes []GraphNode `json:"nodes"`
Edges []GraphEdge `json:"edges"`
Layout map[string]GraphPosition `json:"layout,omitempty"`
}
GraphView describes one workflow DAG.
type ScenarioGraph ¶
type ScenarioGraph struct {
Name string `json:"name"`
Mode string `json:"mode"`
Workflow *GraphView `json:"workflow,omitempty"`
Workflows map[string]GraphView `json:"workflows,omitempty"`
}
ScenarioGraph is a Studio-friendly view of orchestration topology.
func ExportScenario ¶
func ExportScenario(scenario core.Scenario) ScenarioGraph
ExportScenario builds a nested graph from a core.Scenario.
func MergeLayout ¶
func MergeLayout(edited, exported ScenarioGraph) ScenarioGraph
MergeLayout copies canvas layout from edited onto exported, preserving node positions after save/reload.
type ScenarioPatch ¶ added in v0.4.0
type ScenarioPatch struct {
Mode string `json:"mode,omitempty"`
Agents map[string]core.Agent `json:"agents,omitempty"`
Skills map[string]core.Skill `json:"skills,omitempty"`
Workflow *GraphView `json:"workflow,omitempty"`
Workflows map[string]GraphView `json:"workflows,omitempty"`
}
ScenarioPatch is an incremental, additive edit to a scenario produced by AI composition (ComposeMode scenario). Unlike ApplyGraph it may introduce new agents and skills, but it may never overwrite parts that already exist in the base scenario: composed output is merged into a temporary scenario, so an AI-generated patch must not be able to tamper with host-registered parts.