Documentation
¶
Overview ¶
Package executions coordinates async execution requests and user selections.
Index ¶
- Variables
- type Callback
- type Execution
- type Registry
- func (r *Registry) Add(req Request) (*Execution, error)
- func (r *Registry) ClearPrompt(correlationID string) int
- func (r *Registry) CurrentPrompt() (*Execution, int)
- func (r *Registry) Get(correlationID string) *Execution
- func (r *Registry) Resolve(correlationID string) (*Execution, int, bool)
- func (r *Registry) SetMessage(correlationID string, messageID int, messageText string)
- func (r *Registry) SetPromptMessage(correlationID string, messageID int)
- func (r *Registry) StartCustomInput(correlationID string) (int, bool)
- type Request
- type Result
- type Status
- type Tool
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrAlreadyExists = errors.New("execution already exists")
ErrAlreadyExists is returned when correlation id already exists.
Functions ¶
This section is empty.
Types ¶
type Callback ¶
type Callback struct {
// URL is the webhook callback URL.
URL string `json:"url"`
}
Callback defines async callback settings.
type Execution ¶
type Execution struct {
Request Request
CreatedAt time.Time
MessageID int
MessageText string
AwaitingText bool
}
Execution stores state for a single execution request.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry stores active execution requests.
func (*Registry) ClearPrompt ¶
ClearPrompt removes active custom-input prompt if correlation id matches.
func (*Registry) CurrentPrompt ¶
CurrentPrompt returns execution awaiting custom input and prompt message id.
func (*Registry) SetMessage ¶
SetMessage stores Telegram message metadata for execution.
func (*Registry) SetPromptMessage ¶
SetPromptMessage stores active custom-input prompt message id.
type Request ¶
type Request struct {
CorrelationID string
Tool Tool
Arguments map[string]any
Spec map[string]any
Question string
Context string
Options []string
AllowCustom bool
CustomLabel string
Lang string
Markup string
Callback Callback
}
Request holds data required for execution.
type Tool ¶
type Tool struct {
Name string `json:"name"`
Title string `json:"title,omitempty"`
Description string `json:"description,omitempty"`
InputSchema map[string]any `json:"input_schema,omitempty"`
OutputSchema map[string]any `json:"output_schema,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
Tags []string `json:"tags,omitempty"`
}
Tool describes tool metadata from yaml-mcp-server.
Click to show internal directories.
Click to hide internal directories.