Files
leookun c274a9db4c refactor: remove CursorAccountCard component and related localization entries
- Deleted the CursorAccountCard.vue component, which handled user account login and status.
- Removed associated localization entries from catalog.json and various language files.
- Updated Home.vue to eliminate references to the removed component.
- Refactored clientApi.js to remove unused account-related API functions.
2026-08-08 21:19:57 +08:00

43 lines
1.4 KiB
Go

// module.go 负责把 forwarder service 装配成 legacy HTTP/Connect handler。
package forwarder
import (
"net/http"
"connectrpc.com/connect"
modeladapter "cursor/internal/backend/agent/model"
)
type Module struct {
Service *Service
LocalBidiHandler http.Handler
LocalRunSSE http.Handler
AiHandler http.Handler
RepositoryServiceHandler http.Handler
UploadServiceHandler http.Handler
}
// NewModule 创建 forwarder 模块,并导出本地 Bidi / RunSSE 处理器。
func NewModule(historyRoot string, channelService modeladapter.ChannelResolver) *Module {
service := NewService(historyRoot, channelService)
legacyBidiAppendProcedure := "/aiserver.v1.BidiService/BidiAppend"
legacyRunSSEProcedure := "/agent.v1.AgentService/RunSSE"
return &Module{
Service: service,
LocalBidiHandler: connect.NewUnaryHandler(legacyBidiAppendProcedure, service.BidiAppend),
LocalRunSSE: NewLegacyRunSSEHandler(legacyRunSSEProcedure, service.RunSSE),
AiHandler: newAIHandler(service),
RepositoryServiceHandler: newRepositoryServiceHandler(service),
UploadServiceHandler: newUploadServiceHandler(service),
}
}
func (module *Module) HandlesAIPath(path string) bool {
if module == nil || module.AiHandler == nil {
return false
}
handler, ok := module.AiHandler.(interface{ HandlesPath(string) bool })
return ok && handler.HandlesPath(path)
}