feat(channel): add Bubble Tea TUI chat interface and Matrix adapter stub
This commit is contained in:
33
internal/channel/matrix.go
Normal file
33
internal/channel/matrix.go
Normal file
@@ -0,0 +1,33 @@
|
||||
package channel
|
||||
|
||||
import (
|
||||
"context"
|
||||
"log/slog"
|
||||
|
||||
"git.db123.ir/db123/divacode/internal/agent"
|
||||
"git.db123.ir/db123/divacode/internal/config"
|
||||
)
|
||||
|
||||
type MatrixClient struct {
|
||||
cfg *config.Config
|
||||
agent *agent.Agent
|
||||
}
|
||||
|
||||
func NewMatrixClient(cfg *config.Config, a *agent.Agent) *MatrixClient {
|
||||
return &MatrixClient{
|
||||
cfg: cfg,
|
||||
agent: a,
|
||||
}
|
||||
}
|
||||
|
||||
func (mc *MatrixClient) Start(ctx context.Context) error {
|
||||
if !mc.cfg.MatrixEnabled {
|
||||
slog.Info("matrix channel disabled")
|
||||
return nil
|
||||
}
|
||||
slog.Info("matrix client connecting",
|
||||
"homeserver", mc.cfg.MatrixHomeserver,
|
||||
"user", mc.cfg.MatrixUser,
|
||||
)
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user