Documentation
¶
Index ¶
- Constants
- func ErrTriggerRuntimeUnsupported() error
- func ErrUnknownNode(nodeID string) error
- type ActionNode
- type Bundle
- func (b *Bundle) Describe(_ context.Context) (PluginInfo, error)
- func (b *Bundle) ExecuteAction(ctx context.Context, nodeID string, config json.RawMessage, ...) (any, error)
- func (b *Bundle) ExecuteTool(ctx context.Context, nodeID string, config json.RawMessage, ...) (any, error)
- func (b *Bundle) OpenTriggerRuntime(ctx context.Context) (TriggerRuntime, error)
- func (b *Bundle) ToolDefinition(ctx context.Context, nodeID string, meta ToolNodeMetadata, ...) (*ToolDefinition, error)
- func (b *Bundle) ValidateConfig(ctx context.Context, nodeID string, config json.RawMessage) error
- type FieldOption
- type FieldSpec
- type FieldType
- type NodeKind
- type NodeSpec
- type OutputHandle
- type OutputHint
- type Plugin
- type PluginInfo
- type ToolDefinition
- type ToolNode
- type ToolNodeMetadata
- type ToolSpec
- type TriggerEvent
- type TriggerNode
- type TriggerRuntime
- type TriggerRuntimeProvider
- type TriggerSubscription
- type TriggerSubscriptionSnapshot
Constants ¶
View Source
const APIVersion = "v1"
Variables ¶
This section is empty.
Functions ¶
func ErrTriggerRuntimeUnsupported ¶
func ErrTriggerRuntimeUnsupported() error
func ErrUnknownNode ¶
Types ¶
type ActionNode ¶
type Bundle ¶
type Bundle struct {
Info PluginInfo
Actions map[string]ActionNode
Triggers map[string]TriggerNode
Tools map[string]ToolNode
TriggerRuntimeProvider TriggerRuntimeProvider
}
func (*Bundle) ExecuteAction ¶
func (*Bundle) ExecuteTool ¶
func (*Bundle) OpenTriggerRuntime ¶
func (b *Bundle) OpenTriggerRuntime(ctx context.Context) (TriggerRuntime, error)
func (*Bundle) ToolDefinition ¶
func (b *Bundle) ToolDefinition(ctx context.Context, nodeID string, meta ToolNodeMetadata, config json.RawMessage) (*ToolDefinition, error)
func (*Bundle) ValidateConfig ¶
type FieldOption ¶
type FieldSpec ¶
type FieldSpec struct {
Name string `json:"name"`
Label string `json:"label"`
Description string `json:"description,omitempty"`
Type FieldType `json:"type"`
Required bool `json:"required,omitempty"`
Placeholder string `json:"placeholder,omitempty"`
TemplateSupported bool `json:"template_supported,omitempty"`
Options []FieldOption `json:"options,omitempty"`
DefaultStringValue string `json:"default_string_value,omitempty"`
DefaultBoolValue *bool `json:"default_bool_value,omitempty"`
DefaultNumberValue *float64 `json:"default_number_value,omitempty"`
}
type NodeSpec ¶
type NodeSpec struct {
ID string `json:"id"`
Kind NodeKind `json:"kind"`
Label string `json:"label"`
Description string `json:"description,omitempty"`
Icon string `json:"icon,omitempty"`
Color string `json:"color,omitempty"`
MenuPath []string `json:"menu_path,omitempty"`
DefaultConfig map[string]any `json:"default_config,omitempty"`
Fields []FieldSpec `json:"fields,omitempty"`
Outputs []OutputHandle `json:"outputs,omitempty"`
OutputHints []OutputHint `json:"output_hints,omitempty"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
}
type OutputHandle ¶
type OutputHint ¶
type Plugin ¶
type Plugin interface {
Describe(ctx context.Context) (PluginInfo, error)
ValidateConfig(ctx context.Context, nodeID string, config json.RawMessage) error
ExecuteAction(ctx context.Context, nodeID string, config json.RawMessage, input map[string]any) (any, error)
ToolDefinition(ctx context.Context, nodeID string, meta ToolNodeMetadata, config json.RawMessage) (*ToolDefinition, error)
ExecuteTool(ctx context.Context, nodeID string, config json.RawMessage, args json.RawMessage, input map[string]any) (any, error)
OpenTriggerRuntime(ctx context.Context) (TriggerRuntime, error)
}
type PluginInfo ¶
type ToolDefinition ¶
type ToolNode ¶
type ToolNode interface {
ValidateConfig(ctx context.Context, config json.RawMessage) error
ToolDefinition(ctx context.Context, meta ToolNodeMetadata, config json.RawMessage) (*ToolDefinition, error)
ExecuteTool(ctx context.Context, config json.RawMessage, args json.RawMessage, input map[string]any) (any, error)
}
type ToolNodeMetadata ¶
type TriggerEvent ¶
type TriggerNode ¶
type TriggerNode interface {
ValidateConfig(ctx context.Context, config json.RawMessage) error
}
type TriggerRuntime ¶
type TriggerRuntime interface {
SendSnapshot(ctx context.Context, snapshot TriggerSubscriptionSnapshot) error
Recv(ctx context.Context) (*TriggerEvent, error)
Close() error
}
type TriggerRuntimeProvider ¶
type TriggerRuntimeProvider interface {
OpenTriggerRuntime(ctx context.Context) (TriggerRuntime, error)
}
type TriggerSubscription ¶
type TriggerSubscription struct {
SubscriptionID string `json:"subscription_id"`
PipelineID string `json:"pipeline_id,omitempty"`
NodeType string `json:"node_type,omitempty"`
NodeID string `json:"node_id"`
NodeInstanceID string `json:"node_instance_id,omitempty"`
Config json.RawMessage `json:"config,omitempty"`
}
type TriggerSubscriptionSnapshot ¶
type TriggerSubscriptionSnapshot struct {
Subscriptions []TriggerSubscription `json:"subscriptions"`
}
Click to show internal directories.
Click to hide internal directories.