Documentation
¶
Index ¶
- func AsClassifierConfig(cfg interface{}) (*models.ClassifierConfig, bool)
- func AsCodeConfig(cfg interface{}) (*models.CodeConfig, bool)
- func AsConditionConfig(cfg interface{}) (*models.ConditionConfig, bool)
- func AsEndConfig(cfg interface{}) (*models.EndConfig, bool)
- func AsIterationConfig(cfg interface{}) (*models.IterationConfig, bool)
- func AsLLMConfig(cfg interface{}) (*models.LLMConfig, bool)
- func AsStartConfig(cfg interface{}) (*models.StartConfig, bool)
- func CollectAllEdgesAndNodes(unifiedDSL *models.UnifiedDSL, iterationInternalNodeIDs map[string]bool) ([]models.Edge, []models.Node)
- func CollectIterationInternalNodeIDs(nodes []models.Node) map[string]bool
- func CreateVariableReference(originalRef *models.VariableReference, nodeID, outputName string) *models.VariableReference
- func GenerateSimpleNodeID(node models.Node, index int) string
- func NewNodeIDMapper() interfaces.IDMapper
- func NewSecureNodeIDMapper() interfaces.IDMapper
- func NewUnifiedIDMapper(strategy IDGenerationStrategy) interfaces.IDMapper
- func ReplaceTemplateNodeReferences(text string, nodeIDMapping map[string]string) string
- func ReverseIDMapping(idMapping map[string]string, targetID string) string
- func TryRemapNodeID(idMapping map[string]string, nodeID string) (string, bool)
- func UpdateVariableSelector(selector []string, nodeIDMapping map[string]string) []string
- type BaseGenerator
- type BaseParser
- type GraphGenerationContext
- type IDGenerationStrategy
- type NodeGenerationContext
- type NodeGenerationPhase
- type UnifiedDSLValidator
- func (v *UnifiedDSLValidator) ValidateEdge(edge *models.Edge, nodes []models.Node) error
- func (v *UnifiedDSLValidator) ValidateMetadata(metadata *models.Metadata) error
- func (v *UnifiedDSLValidator) ValidateNode(node *models.Node) error
- func (v *UnifiedDSLValidator) ValidateWorkflow(workflow *models.Workflow) error
- type UnifiedIDMapper
- func (m *UnifiedIDMapper) Clear()
- func (m *UnifiedIDMapper) GetMapping() map[string]string
- func (m *UnifiedIDMapper) GetStrategy() IDGenerationStrategy
- func (m *UnifiedIDMapper) HasMapping(originalID string) bool
- func (m *UnifiedIDMapper) MapNodeID(originalID string, nodeType models.NodeType) string
- func (m *UnifiedIDMapper) SetMapping(mapping map[string]string)
- func (m *UnifiedIDMapper) SetStrategy(strategy IDGenerationStrategy)
- func (m *UnifiedIDMapper) Statistics() map[string]interface{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AsClassifierConfig ¶
func AsClassifierConfig(cfg interface{}) (*models.ClassifierConfig, bool)
AsClassifierConfig returns a pointer to ClassifierConfig regardless of value or pointer storage.
func AsCodeConfig ¶
func AsCodeConfig(cfg interface{}) (*models.CodeConfig, bool)
AsCodeConfig returns a pointer to CodeConfig regardless of value or pointer storage.
func AsConditionConfig ¶
func AsConditionConfig(cfg interface{}) (*models.ConditionConfig, bool)
AsConditionConfig returns a pointer to ConditionConfig regardless of value or pointer storage.
func AsEndConfig ¶
AsEndConfig returns a pointer to EndConfig regardless of value or pointer storage.
func AsIterationConfig ¶
func AsIterationConfig(cfg interface{}) (*models.IterationConfig, bool)
AsIterationConfig returns a pointer to IterationConfig regardless of value or pointer storage.
func AsLLMConfig ¶
AsLLMConfig returns a pointer to LLMConfig regardless of value or pointer storage.
func AsStartConfig ¶
func AsStartConfig(cfg interface{}) (*models.StartConfig, bool)
AsStartConfig returns a pointer to StartConfig regardless of value or pointer storage.
func CollectAllEdgesAndNodes ¶
func CollectAllEdgesAndNodes(unifiedDSL *models.UnifiedDSL, iterationInternalNodeIDs map[string]bool) ([]models.Edge, []models.Node)
CollectAllEdgesAndNodes collects all edges and nodes from main workflow and iterations
func CollectIterationInternalNodeIDs ¶
CollectIterationInternalNodeIDs collects all iteration internal node IDs for filtering
func CreateVariableReference ¶
func CreateVariableReference(originalRef *models.VariableReference, nodeID, outputName string) *models.VariableReference
CreateVariableReference creates a variable reference with given parameters
func GenerateSimpleNodeID ¶
GenerateSimpleNodeID generates a simple random 16-digit numeric ID
func NewNodeIDMapper ¶
func NewNodeIDMapper() interfaces.IDMapper
NewNodeIDMapper creates a timestamp-based ID mapper.
func NewSecureNodeIDMapper ¶
func NewSecureNodeIDMapper() interfaces.IDMapper
NewSecureNodeIDMapper creates a cryptographically secure ID mapper.
func NewUnifiedIDMapper ¶
func NewUnifiedIDMapper(strategy IDGenerationStrategy) interfaces.IDMapper
NewUnifiedIDMapper creates a unified ID mapper with configurable strategies.
func ReplaceTemplateNodeReferences ¶
ReplaceTemplateNodeReferences replaces node ID references in template strings
func ReverseIDMapping ¶
ReverseIDMapping performs reverse lookup in ID mapping to find original ID
func TryRemapNodeID ¶
TryRemapNodeID attempts to remap a node ID using the provided mapping
Types ¶
type BaseGenerator ¶
type BaseGenerator struct {
// contains filtered or unexported fields
}
BaseGenerator provides base implementation for generators
func NewBaseGenerator ¶
func NewBaseGenerator(platformType models.PlatformType) *BaseGenerator
func (*BaseGenerator) GetPlatformType ¶
func (g *BaseGenerator) GetPlatformType() models.PlatformType
GetPlatformType returns the platform type
type BaseParser ¶
type BaseParser struct {
// contains filtered or unexported fields
}
BaseParser provides base implementation for parsers
func NewBaseParser ¶
func NewBaseParser(platformType models.PlatformType) *BaseParser
func (*BaseParser) GetPlatformType ¶
func (p *BaseParser) GetPlatformType() models.PlatformType
GetPlatformType returns the platform type
type GraphGenerationContext ¶
type GraphGenerationContext struct {
UnifiedDSL *models.UnifiedDSL
NodeIDMapping map[string]string
Graph interface{} // Generic graph type (could be DifyGraph, IflytekGraph, etc.)
}
GraphGenerationContext holds context information for graph generation
type IDGenerationStrategy ¶
type IDGenerationStrategy int
IDGenerationStrategy defines ID generation strategies.
const ( StrategyTimestampBased IDGenerationStrategy = iota // Timestamp-based ID generation for general use StrategyCryptoSecure // Cryptographically secure ID generation StrategySimpleNumeric // Simple numeric ID generation for platforms requiring simple IDs )
type NodeGenerationContext ¶
type NodeGenerationContext struct {
Phase NodeGenerationPhase
IDMapping map[string]string
TitleMapping map[string]string
BranchMapping map[string]string
SkipSubNodes bool
}
NodeGenerationContext holds context for node generation process
type NodeGenerationPhase ¶
type NodeGenerationPhase int
NodeGenerationPhase represents the phase of node generation
const ( PhaseInitialGeneration NodeGenerationPhase = iota PhaseRegeneration )
type UnifiedDSLValidator ¶
type UnifiedDSLValidator struct{}
UnifiedDSLValidator validates unified DSL structures
func NewUnifiedDSLValidator ¶
func NewUnifiedDSLValidator() *UnifiedDSLValidator
func (*UnifiedDSLValidator) ValidateEdge ¶
ValidateEdge validates edges
func (*UnifiedDSLValidator) ValidateMetadata ¶
func (v *UnifiedDSLValidator) ValidateMetadata(metadata *models.Metadata) error
ValidateMetadata validates metadata
func (*UnifiedDSLValidator) ValidateNode ¶
func (v *UnifiedDSLValidator) ValidateNode(node *models.Node) error
ValidateNode validates a single node
func (*UnifiedDSLValidator) ValidateWorkflow ¶
func (v *UnifiedDSLValidator) ValidateWorkflow(workflow *models.Workflow) error
ValidateWorkflow validates basic workflow structure
type UnifiedIDMapper ¶
type UnifiedIDMapper struct {
// contains filtered or unexported fields
}
UnifiedIDMapper provides unified node ID mapping with configurable strategies.
func (*UnifiedIDMapper) GetMapping ¶
func (m *UnifiedIDMapper) GetMapping() map[string]string
GetMapping returns the complete mapping table.
func (*UnifiedIDMapper) GetStrategy ¶
func (m *UnifiedIDMapper) GetStrategy() IDGenerationStrategy
GetStrategy returns the current ID generation strategy.
func (*UnifiedIDMapper) HasMapping ¶
func (m *UnifiedIDMapper) HasMapping(originalID string) bool
HasMapping checks if a mapping exists.
func (*UnifiedIDMapper) MapNodeID ¶
func (m *UnifiedIDMapper) MapNodeID(originalID string, nodeType models.NodeType) string
MapNodeID maps original node ID to generated ID.
func (*UnifiedIDMapper) SetMapping ¶
func (m *UnifiedIDMapper) SetMapping(mapping map[string]string)
SetMapping sets the mapping table.
func (*UnifiedIDMapper) SetStrategy ¶
func (m *UnifiedIDMapper) SetStrategy(strategy IDGenerationStrategy)
SetStrategy sets the ID generation strategy.
func (*UnifiedIDMapper) Statistics ¶
func (m *UnifiedIDMapper) Statistics() map[string]interface{}
Statistics returns mapper statistics.