opencode-cursor-agent/internal/svc/service_context.go

29 lines
564 B
Go

package svc
import (
"cursor-api-proxy/internal/config"
domainrepo "cursor-api-proxy/pkg/domain/repository"
"cursor-api-proxy/pkg/repository"
)
type ServiceContext struct {
Config config.Config
// Domain services
AccountPool domainrepo.AccountPool
// Last model for sticky model mode
LastModel *string
}
func NewServiceContext(c config.Config) *ServiceContext {
accountPool := repository.NewAccountPool(c.ConfigDirs)
lastModel := c.DefaultModel
return &ServiceContext{
Config: c,
AccountPool: accountPool,
LastModel: &lastModel,
}
}