feat: /spawn gateway command for chat-initiated tasks

TaskCreator interface on gateway.Router allows chat users to create
tasks via /spawn <title>. Implemented as gateway-local command (no LLM
needed). StoreTaskCreator wraps the daemon's store and uses the first
configured repo as the task workspace with timestamp-based synthetic
issue numbers to avoid collisions with Gitea-issued tasks.

Wired into archied's gateway startup: when repos are configured,
router.Tasks is populated so /spawn works. When no repos are
configured, /spawn returns 'not configured'.

Closes: archie-core-abg.13
This commit is contained in:
sam committed 2026-07-25 23:54:06 +10:00
1 parent 9df02f2b60
commit ae744d1cc4
5 files changed
+237

No files matched your search

+3
View File
@@ -184,6 +184,9 @@ func run() int {
}
tg := telegram.New(tgToken, "", "", nil, log)
router := gateway.NewRouter(st, nil, "telegram")
if len(cfg.Repos) > 0 {
router.Tasks = gateway.NewStoreTaskCreator(st, cfg.Repos[0].Owner, cfg.Repos[0].Name)
}
go func() {
if err := tg.Start(ctx, router); err != nil && ctx.Err() == nil {
log.Error("telegram gateway stopped", "err", err)