Files
Memoh/internal/schedule/trigger.go
T
BBQ 83b6ee608c refactor: bind container lifecycle to bot and improve schedule trigger flow
- Add SetupBotContainer to ContainerLifecycle interface so containers
  are automatically created when a bot is created, matching the existing
  cleanup-on-delete behavior.
- Refactor schedule tools to use bot-scoped API paths and pass identity
  context for proper authorization.
- Introduce dedicated trigger-schedule endpoint in chat resolver with
  explicit schedule payload instead of reusing the generic chat path.
- Generate short-lived JWT tokens for schedule trigger callbacks with
  resolved bot owner identity.
- Validate required parameters in NewLLMClient and NewOpenAIEmbedder
  constructors, returning errors instead of falling back to defaults.
- Add unit tests for schedule token generation and chat resolver.
2026-02-07 12:04:37 +08:00

20 lines
483 B
Go

package schedule
import "context"
// TriggerPayload describes the parameters passed to the chat side when a schedule triggers.
type TriggerPayload struct {
ID string
Name string
Description string
Pattern string
MaxCalls *int
Command string
OwnerUserID string
}
// Triggerer 负责触发与聊天相关的调度执行。
type Triggerer interface {
TriggerSchedule(ctx context.Context, botID string, payload TriggerPayload, token string) error
}