Documentation
¶
Index ¶
- Variables
- func Import(deps ...core.ComponentImport) []core.ComponentImport
- func NewMCPTool[T any](fn func(input T, t *TaskContext) *MCPToolResult, cfg MCPToolConfig) mcpTool
- type AppState
- type ComponentIO
- type ComponentTrigger
- type ConfigurationModification
- type Container
- type ContainerEntityStorage
- func (s *ContainerEntityStorage[T]) Delete(id int64)
- func (s *ContainerEntityStorage[T]) DeleteWhere(filter FilterFn[T])
- func (s *ContainerEntityStorage[T]) Find(filter FilterFn[T]) []T
- func (s *ContainerEntityStorage[T]) Get(id int64) *T
- func (s *ContainerEntityStorage[T]) Insert(record T) int64
- func (s *ContainerEntityStorage[T]) Update(id int64, record T)
- type FilterFn
- type HostIO
- type HourSpecificTask
- type MCPDate
- type MCPTask
- type MCPToolConfig
- type MCPToolResult
- type MCPToolType
- type NativeTerminal
- type RouteResult
- type RouteResultStatus
- type RouteTask
- type RouteTaskFunction
- type RouteTaskNoInput
- type Runtime
- type RuntimeTriggers
- type StartupTask
- type Task
- func NewMCPTask(name, version string, tools ...mcpTool) Task
- func NewPublicRouteTask[T any](fn RouteTaskFunction[T]) Task
- func NewRouteTask[T any](fn RouteTaskFunction[T]) Task
- func NewStartupTask(handler func(*TaskContext)) Task
- func NewTask(fn any, impl TaskImpl) Task
- func NewTimeSpecificTask(hour int, minute int, handler func(*TaskContext)) Task
- func NewTimedTask(duration time.Duration, handler func(*TaskContext)) Task
- func NewTriggerTask[T any](trigger component.ComponentTrigger[T], fn TriggerTaskFn[T]) Task
- type TaskAttachContext
- func (tac *TaskAttachContext) HTTP(path string, handler http.HandlerFunc)
- func (tac *TaskAttachContext) TaskContext(ctx context.Context) *TaskContext
- func (tac *TaskAttachContext) TaskContextGlobal() *TaskContext
- func (tac *TaskAttachContext) Trigger(ns, name string, body func([]byte))
- func (tac *TaskAttachContext) VerifyAuthentication(secret string) bool
- type TaskContext
- func (c *TaskContext) ExecuteFunction(cname, fname string, args any) ([]byte, error)
- func (c *TaskContext) OpenUrl(url string) bool
- func (c *TaskContext) Run(maxTime time.Duration, cmd string, args ...string) core.TerminalResult
- func (c *TaskContext) RunInDirectory(maxTime time.Duration, wd, cmd string, args ...string) core.TerminalResult
- type TaskImpl
- type TerminalProvider
- type TimedEveryTask
- type TriggerTaskFn
- type TriggeredTask
Constants ¶
This section is empty.
Variables ¶
View Source
var ImportBinary = core.ImportBinary
View Source
var ImportGit = core.ImportGit
View Source
var ImportGitSubdirectory = core.ImportGitSubdirectory
View Source
var ImportLocal = core.ImportLocal
Functions ¶
func Import ¶
func Import(deps ...core.ComponentImport) []core.ComponentImport
func NewMCPTool ¶ added in v1.1.0
func NewMCPTool[T any](fn func(input T, t *TaskContext) *MCPToolResult, cfg MCPToolConfig) mcpTool
Types ¶
type ComponentIO ¶
type ComponentIO struct {
// contains filtered or unexported fields
}
func RegisterComponent ¶
func RegisterComponent(dep *core.ComponentExecuteCommand) (*ComponentIO, error)
func (*ComponentIO) Execute ¶
func (cr *ComponentIO) Execute(fname string, args any) *component.ComponentResultPayload
func (*ComponentIO) HandleAPIRequests ¶
func (cr *ComponentIO) HandleAPIRequests()
type ComponentTrigger ¶
type ConfigurationModification ¶
type ConfigurationModification struct {
Permissions []core.ApprovedComponentPermission
}
func PreapprovedPermissions ¶
func PreapprovedPermissions(pm ...core.ApprovedComponentPermission) *ConfigurationModification
type Container ¶
type Container struct {
Storage core.Storage
Keychain core.Keychain
StorageDir string
// contains filtered or unexported fields
}
func (*Container) HasPermission ¶
func (c *Container) HasPermission(act core.PermissionAction, scope string) bool
type ContainerEntityStorage ¶
type ContainerEntityStorage[T any] struct { // contains filtered or unexported fields }
func NewEntityStorage ¶
func NewEntityStorage[T any](c *Container) *ContainerEntityStorage[T]
func (*ContainerEntityStorage[T]) Delete ¶
func (s *ContainerEntityStorage[T]) Delete(id int64)
func (*ContainerEntityStorage[T]) DeleteWhere ¶
func (s *ContainerEntityStorage[T]) DeleteWhere(filter FilterFn[T])
func (*ContainerEntityStorage[T]) Find ¶
func (s *ContainerEntityStorage[T]) Find(filter FilterFn[T]) []T
func (*ContainerEntityStorage[T]) Get ¶
func (s *ContainerEntityStorage[T]) Get(id int64) *T
func (*ContainerEntityStorage[T]) Insert ¶
func (s *ContainerEntityStorage[T]) Insert(record T) int64
func (*ContainerEntityStorage[T]) Update ¶
func (s *ContainerEntityStorage[T]) Update(id int64, record T)
type HostIO ¶
type HostIO struct {
// contains filtered or unexported fields
}
func (*HostIO) RequestPermission ¶
func (hs *HostIO) RequestPermission(permission core.Permission) bool
type HourSpecificTask ¶
type HourSpecificTask struct {
// contains filtered or unexported fields
}
func (*HourSpecificTask) Attach ¶
func (tt *HourSpecificTask) Attach(ctx *TaskAttachContext)
type MCPDate ¶ added in v1.1.1
func (*MCPDate) UnmarshalJSON ¶ added in v1.1.1
type MCPTask ¶ added in v1.1.0
func (*MCPTask) Attach ¶ added in v1.1.0
func (tt *MCPTask) Attach(ctx *TaskAttachContext)
type MCPToolConfig ¶ added in v1.1.0
type MCPToolConfig struct {
Title string
Description string
ToolType MCPToolType
}
type MCPToolResult ¶ added in v1.1.0
func ToolError ¶ added in v1.1.1
func ToolError(msg string) *MCPToolResult
func ToolSuccess ¶ added in v1.1.1
func ToolSuccess(res any) *MCPToolResult
type MCPToolType ¶ added in v1.1.0
type MCPToolType int
const ( MCPToolTypeDestructive MCPToolType = iota MCPToolTypeReadOnly MCPToolTypeIdempotent )
type NativeTerminal ¶
type NativeTerminal struct{}
func (*NativeTerminal) Execute ¶
func (t *NativeTerminal) Execute(ctx context.Context, wd, cm string, args ...string) core.TerminalResult
type RouteResult ¶
type RouteResult struct {
// contains filtered or unexported fields
}
func RouteRequestInvalid ¶
func RouteRequestInvalid(error string) *RouteResult
func RouteResultSuccess ¶
func RouteResultSuccess(data any) *RouteResult
type RouteResultStatus ¶
type RouteResultStatus int
const ( RouteResultStatusSuccess RouteResultStatus = 200 RouteResultStatusBadRequest RouteResultStatus = 400 RouteResultStatusServerError RouteResultStatus = 500 )
type RouteTask ¶
type RouteTask struct {
// contains filtered or unexported fields
}
func (*RouteTask) Attach ¶
func (tt *RouteTask) Attach(ctx *TaskAttachContext)
type RouteTaskFunction ¶
type RouteTaskFunction[T any] func(input T, container *TaskContext) *RouteResult
type RouteTaskNoInput ¶
type RouteTaskNoInput struct{}
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
func NewRuntime ¶
func NewRuntime(tasks []Task, deps []core.ComponentImport, cfg ...*ConfigurationModification) *Runtime
type RuntimeTriggers ¶
type RuntimeTriggers struct {
// contains filtered or unexported fields
}
func (*RuntimeTriggers) Add ¶
func (rt *RuntimeTriggers) Add(ns, name string, body func([]byte))
func (*RuntimeTriggers) Execute ¶
func (rt *RuntimeTriggers) Execute(ns string, r *componentipc.ComponentMessageSendTrigger, as *AppState)
type StartupTask ¶
type StartupTask struct {
// contains filtered or unexported fields
}
func (*StartupTask) Attach ¶
func (tt *StartupTask) Attach(ctx *TaskAttachContext)
type Task ¶
func NewMCPTask ¶ added in v1.1.0
func NewPublicRouteTask ¶
func NewPublicRouteTask[T any](fn RouteTaskFunction[T]) Task
func NewRouteTask ¶
func NewRouteTask[T any](fn RouteTaskFunction[T]) Task
func NewStartupTask ¶
func NewStartupTask(handler func(*TaskContext)) Task
func NewTimeSpecificTask ¶
func NewTimeSpecificTask(hour int, minute int, handler func(*TaskContext)) Task
func NewTimedTask ¶
func NewTimedTask(duration time.Duration, handler func(*TaskContext)) Task
func NewTriggerTask ¶
func NewTriggerTask[T any](trigger component.ComponentTrigger[T], fn TriggerTaskFn[T]) Task
type TaskAttachContext ¶
type TaskAttachContext struct {
Logger core.Logger
Container *Container
Context context.Context
// contains filtered or unexported fields
}
func (*TaskAttachContext) HTTP ¶
func (tac *TaskAttachContext) HTTP(path string, handler http.HandlerFunc)
func (*TaskAttachContext) TaskContext ¶
func (tac *TaskAttachContext) TaskContext(ctx context.Context) *TaskContext
func (*TaskAttachContext) TaskContextGlobal ¶
func (tac *TaskAttachContext) TaskContextGlobal() *TaskContext
func (*TaskAttachContext) Trigger ¶
func (tac *TaskAttachContext) Trigger(ns, name string, body func([]byte))
func (*TaskAttachContext) VerifyAuthentication ¶
func (tac *TaskAttachContext) VerifyAuthentication(secret string) bool
type TaskContext ¶
type TaskContext struct {
Container *Container
Logger core.Logger
// contains filtered or unexported fields
}
func BuildTaskContext ¶
func BuildTaskContext(container *Container, logger core.Logger, cmps map[string]*ComponentIO, ctx context.Context) *TaskContext
func (*TaskContext) ExecuteFunction ¶
func (c *TaskContext) ExecuteFunction(cname, fname string, args any) ([]byte, error)
func (*TaskContext) OpenUrl ¶
func (c *TaskContext) OpenUrl(url string) bool
func (*TaskContext) Run ¶
func (c *TaskContext) Run(maxTime time.Duration, cmd string, args ...string) core.TerminalResult
func (*TaskContext) RunInDirectory ¶
func (c *TaskContext) RunInDirectory(maxTime time.Duration, wd, cmd string, args ...string) core.TerminalResult
type TaskImpl ¶
type TaskImpl interface {
Attach(ctx *TaskAttachContext)
}
type TerminalProvider ¶
type TerminalProvider struct {
// contains filtered or unexported fields
}
func (*TerminalProvider) OpenUrl ¶
func (c *TerminalProvider) OpenUrl(url string) bool
func (*TerminalProvider) Run ¶
func (c *TerminalProvider) Run(maxTime time.Duration, cmd string, args ...string) core.TerminalResult
func (*TerminalProvider) RunInDirectory ¶
func (c *TerminalProvider) RunInDirectory(maxTime time.Duration, wd, cmd string, args ...string) core.TerminalResult
type TimedEveryTask ¶
type TimedEveryTask struct {
// contains filtered or unexported fields
}
func (*TimedEveryTask) Attach ¶
func (tt *TimedEveryTask) Attach(ctx *TaskAttachContext)
type TriggerTaskFn ¶
type TriggerTaskFn[T any] = func(input T, container *TaskContext)
type TriggeredTask ¶
type TriggeredTask struct {
// contains filtered or unexported fields
}
func (*TriggeredTask) Attach ¶
func (tt *TriggeredTask) Attach(ctx *TaskAttachContext)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.