-
Notifications
You must be signed in to change notification settings - Fork 60
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Summary
Add a registerCommand(name, handler) API that lets local deployments add custom commands without modifying core files.
Motivation
Community user (bibbs) added a runtime /config command to adjust jitter, debounce, and heartbeat settings without restarting their 3 Raspberry Pi instances. This requires patching bot.ts and commands.ts on every upstream rebase.
More broadly, any deployment-specific command (debug tools, status checks, integration triggers) currently requires forking core files. A plugin API would eliminate this friction for all downstream users.
Current Workaround
- Add
'config'to theCOMMANDSarray incommands.ts - Add
case 'config'inhandleCommandinbot.ts - Parse subcommands (
jitter,debounce,heartbeat) and modify in-memory settings - Also added
reschedule(intervalMinutes)andgetIntervalMinutes()toHeartbeatServicefor runtime heartbeat adjustment
Proposed API
// In a plugin file or config-referenced module
export default function register(bot: LettaBot) {
bot.registerCommand('config', async (args, context) => {
// handle subcommands
});
}Or config-driven:
features:
commands:
- name: config
module: ./plugins/config-command.tsImplementation Considerations
- Commands currently live in a static
COMMANDSarray and aswitchstatement inhandleCommand - Plugin commands would need access to bot internals (config values, services like HeartbeatService)
- Should validate no collisions with built-in commands
- The heartbeat
reschedule()method is independently useful and could ship as a built-in/heartbeat interval <N>subcommand regardless of the plugin system
Context
This is one of 5 issues filed from a community user's multi-bot deployment feedback.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request