wip: refactoring

This commit is contained in:
adamdottv
2025-05-12 09:44:56 -05:00
parent ed9fba99c9
commit dfe5fd8d97
19 changed files with 97 additions and 75 deletions

View File

@@ -12,7 +12,6 @@ import (
"github.com/opencode-ai/opencode/internal/pubsub"
)
// Session represents a conversation session.
type Session struct {
ID string
ParentSessionID string
@@ -27,16 +26,12 @@ type Session struct {
UpdatedAt int64
}
// --- Events ---
const (
EventSessionCreated pubsub.EventType = "session_created"
EventSessionUpdated pubsub.EventType = "session_updated"
EventSessionDeleted pubsub.EventType = "session_deleted"
)
// --- Service Definition ---
type Service interface {
pubsub.Subscriber[Session]
@@ -77,8 +72,6 @@ func GetService() Service {
return globalSessionService
}
// --- Service Methods ---
func (s *service) Create(ctx context.Context, title string) (Session, error) {
s.mu.Lock()
defer s.mu.Unlock()