Documentation
¶
Index ¶
- func BuildCronMessage(jobID, jobName, message, timezone string) string
- func ComputeNextRunAtMs(schedule Schedule, nowMs int64) *int64
- func ExecuteTool(ctx context.Context, args map[string]any, deps ToolExecDeps) (string, error)
- func New(host iruntime.Host) iruntime.ModuleHooks
- func ValidateDeliveryTo(to string) error
- func WrapSafeExternalPrompt(message string) string
- type Delivery
- type DeliveryMode
- type DeliveryPatch
- type DeliveryResolverDeps
- type DeliveryTarget
- type Integration
- func (i *Integration) CommandDefinitions(_ context.Context, _ iruntime.CommandScope) []iruntime.CommandDefinition
- func (i *Integration) ExecuteCommand(ctx context.Context, call iruntime.CommandCall) (bool, error)
- func (i *Integration) ExecuteTool(ctx context.Context, call iruntime.ToolCall) (bool, string, error)
- func (i *Integration) Name() string
- func (i *Integration) Start(context.Context) error
- func (i *Integration) Stop()
- func (i *Integration) ToolAvailability(_ context.Context, _ iruntime.ToolScope, toolName string) (bool, bool, iruntime.SettingSource, string)
- func (i *Integration) ToolDefinitions(_ context.Context, _ iruntime.ToolScope) []iruntime.ToolDefinition
- type Job
- type JobCreate
- type JobPatch
- type JobState
- type Payload
- type PayloadPatch
- type ReminderContextLine
- type Schedule
- type TimestampValidationResult
- type ToolCreateContext
- type ToolExecDeps
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildCronMessage ¶
func ComputeNextRunAtMs ¶
func ExecuteTool ¶
func ValidateDeliveryTo ¶
func WrapSafeExternalPrompt ¶
Types ¶
type Delivery ¶
type Delivery struct {
Mode DeliveryMode `json:"mode"`
Channel string `json:"channel,omitempty"`
To string `json:"to,omitempty"`
BestEffort *bool `json:"bestEffort,omitempty"`
}
type DeliveryMode ¶
type DeliveryMode string
const ( DeliveryNone DeliveryMode = "none" DeliveryAnnounce DeliveryMode = "announce" )
type DeliveryPatch ¶
type DeliveryPatch struct {
Mode *DeliveryMode `json:"mode,omitempty"`
Channel *string `json:"channel,omitempty"`
To *string `json:"to,omitempty"`
BestEffort *bool `json:"bestEffort,omitempty"`
}
type DeliveryResolverDeps ¶
type DeliveryResolverDeps struct {
ResolveLastTarget func(agentID string) (channel string, target string, ok bool)
IsStaleTarget func(roomID string, agentID string) bool
LastActiveRoomID func(agentID string) string
DefaultChatRoomID func() string
ResolvePortalByRoom func(roomID string) any
IsLoggedIn func() bool
}
type DeliveryTarget ¶
func ResolveCronDeliveryTarget ¶
func ResolveCronDeliveryTarget(agentID string, delivery *Delivery, deps DeliveryResolverDeps) DeliveryTarget
type Integration ¶
type Integration struct {
// contains filtered or unexported fields
}
func (*Integration) CommandDefinitions ¶
func (i *Integration) CommandDefinitions(_ context.Context, _ iruntime.CommandScope) []iruntime.CommandDefinition
func (*Integration) ExecuteCommand ¶
func (i *Integration) ExecuteCommand(ctx context.Context, call iruntime.CommandCall) (bool, error)
func (*Integration) ExecuteTool ¶
func (*Integration) Name ¶
func (i *Integration) Name() string
func (*Integration) Stop ¶
func (i *Integration) Stop()
func (*Integration) ToolAvailability ¶
func (*Integration) ToolDefinitions ¶
func (i *Integration) ToolDefinitions(_ context.Context, _ iruntime.ToolScope) []iruntime.ToolDefinition
type Job ¶
type Job struct {
ID string `json:"id"`
AgentID string `json:"agentId,omitempty"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Enabled bool `json:"enabled"`
DeleteAfterRun bool `json:"deleteAfterRun,omitempty"`
CreatedAtMs int64 `json:"createdAtMs"`
UpdatedAtMs int64 `json:"updatedAtMs"`
Schedule Schedule `json:"schedule"`
Payload Payload `json:"payload"`
Delivery *Delivery `json:"delivery,omitempty"`
State JobState `json:"state"`
}
type JobCreate ¶
type JobCreate struct {
AgentID *string `json:"agentId,omitempty"`
Name string `json:"name,omitempty"`
Description *string `json:"description,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
DeleteAfterRun *bool `json:"deleteAfterRun,omitempty"`
Schedule Schedule `json:"schedule"`
Payload Payload `json:"payload"`
Delivery *Delivery `json:"delivery,omitempty"`
State *JobState `json:"state,omitempty"`
}
func NormalizeJobCreate ¶
func NormalizeJobCreateRaw ¶
type JobPatch ¶
type JobPatch struct {
AgentID *string `json:"agentId,omitempty"`
Name *string `json:"name,omitempty"`
Description *string `json:"description,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
DeleteAfterRun *bool `json:"deleteAfterRun,omitempty"`
Schedule *Schedule `json:"schedule,omitempty"`
Payload *PayloadPatch `json:"payload,omitempty"`
Delivery *DeliveryPatch `json:"delivery,omitempty"`
State *JobState `json:"state,omitempty"`
}
func NormalizeJobPatchRaw ¶
type JobState ¶
type JobState struct {
NextRunAtMs *int64 `json:"nextRunAtMs,omitempty"`
RunningAtMs *int64 `json:"runningAtMs,omitempty"`
LastRunAtMs *int64 `json:"lastRunAtMs,omitempty"`
LastStatus string `json:"lastStatus,omitempty"`
LastError string `json:"lastError,omitempty"`
LastDurationMs *int64 `json:"lastDurationMs,omitempty"`
}
type PayloadPatch ¶
type PayloadPatch struct {
Kind string `json:"kind"`
Message *string `json:"message,omitempty"`
Model *string `json:"model,omitempty"`
Thinking *string `json:"thinking,omitempty"`
TimeoutSeconds *int `json:"timeoutSeconds,omitempty"`
AllowUnsafeExternal *bool `json:"allowUnsafeExternalContent,omitempty"`
}
type ReminderContextLine ¶
type TimestampValidationResult ¶
func ValidateSchedule ¶
func ValidateSchedule(schedule Schedule) TimestampValidationResult
func ValidateScheduleTimestamp ¶
func ValidateScheduleTimestamp(schedule Schedule, nowMs int64) TimestampValidationResult
type ToolCreateContext ¶
type ToolExecDeps ¶
type ToolExecDeps struct {
Status func() (enabled bool, backend string, jobCount int, nextRun *int64, err error)
List func(includeDisabled bool) ([]Job, error)
Add func(input JobCreate) (Job, error)
Update func(id string, patch JobPatch) (Job, error)
Remove func(id string) (bool, error)
Run func(id string) (bool, string, error)
NowMs func() int64
ResolveCreateContext func() ToolCreateContext
ResolveReminderLines func(count int) []ReminderContextLine
ValidateDeliveryTo func(to string) error
}
Click to show internal directories.
Click to hide internal directories.