periodicprompts

package module
v0.0.0-...-69caf6b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 3, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package periodicprompts provides a Crush plugin for scheduled prompt execution. It allows users to configure cron-style schedules for prompts that are automatically sent to the LLM when periodic prompting is enabled.

Index

Constants

View Source
const (
	// HookName is the name of this plugin.
	HookName = "periodic-prompts"

	// ToolName is the name of the toggle tool.
	ToolName = "periodic_prompts"

	// Description is shown to the LLM.
	Description = `` /* 617-byte string literal not displayed */

)
View Source
const (
	// DialogID is the identifier for the periodic prompts dialog.
	DialogID = "periodic-prompts-config"
)

Variables

This section is empty.

Functions

func NewDialog

func NewDialog(app *plugin.App) (plugin.PluginDialog, error)

NewDialog creates a new periodic prompts dialog.

func NewTool

func NewTool(app *plugin.App) fantasy.AgentTool

NewTool creates a new periodic prompts tool.

Types

type Config

type Config struct {
	// Prompts is the list of scheduled prompts.
	Prompts []PromptConfig `json:"prompts,omitempty"`
}

Config defines configuration options for this plugin. Users configure this in crush.json under options.plugins.periodic-prompts

type Dialog

type Dialog struct {
	// contains filtered or unexported fields
}

Dialog implements a dialog for configuring periodic prompts.

func (*Dialog) ID

func (d *Dialog) ID() string

func (*Dialog) Init

func (d *Dialog) Init() error

func (*Dialog) Size

func (d *Dialog) Size() (width, height int)

func (*Dialog) Title

func (d *Dialog) Title() string

func (*Dialog) Update

func (d *Dialog) Update(event plugin.DialogEvent) (done bool, action plugin.PluginAction, err error)

func (*Dialog) View

func (d *Dialog) View() string

type Hook

type Hook struct {
	// contains filtered or unexported fields
}

Hook implements the periodic prompts hook.

func NewHook

func NewHook(app *plugin.App, cfg Config) (*Hook, error)

NewHook creates a new periodic prompts hook.

func (*Hook) GetPrompts

func (h *Hook) GetPrompts() []PromptConfig

GetPrompts returns the configured prompts.

func (*Hook) IsEnabled

func (h *Hook) IsEnabled() bool

IsEnabled returns whether periodic prompting is enabled.

func (*Hook) Name

func (h *Hook) Name() string

Name returns the hook name.

func (*Hook) SetEnabled

func (h *Hook) SetEnabled(enabled bool)

SetEnabled enables or disables periodic prompting.

func (*Hook) Start

func (h *Hook) Start(ctx context.Context) error

Start begins the cron scheduler.

func (*Hook) Stop

func (h *Hook) Stop() error

Stop halts the cron scheduler.

type PromptConfig

type PromptConfig struct {
	// File is the path to the prompt file (supports ~ expansion).
	File string `json:"file"`
	// Schedule is a crontab-style schedule (e.g., "*/30 * * * *").
	Schedule string `json:"schedule"`
	// Name is an optional friendly name for the prompt.
	Name string `json:"name,omitempty"`
}

PromptConfig defines a single scheduled prompt.

type Tool

type Tool struct {
	// contains filtered or unexported fields
}

Tool implements the periodic_prompts tool for enabling/disabling via chat.

type ToolParams

type ToolParams struct {
	// Action is the operation to perform: "status", "enable", "disable", "list".
	Action string `json:"action" jsonschema:"description=Action to perform: status, enable, disable, or list"`
}

ToolParams defines the parameters the LLM can pass to the toggle tool.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL