* super sketchy big merge with main * gitignore * gitignore * Delete cli/bin/air * Delete cli/bin directory * Delete cli/cline-host * Fix missing package.json in cli Copy the package JSON into the dist-standalone dir during compilation. Remove workaround for missing package.json * Update scripts/build-cli.sh Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> * Remove reference to watchservice, it has been removed * Update scripts/build-go-proto.mjs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Fix timestamp to string conversion * diff.go ellipsis fix * COMMON_TYPES --------- Co-authored-by: Sarah Fortune <sarah.fortune@gmail.com> Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
64 lines
1.7 KiB
Go
64 lines
1.7 KiB
Go
package hostbridge
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"log"
|
|
|
|
proto "github.com/cline/grpc-go/host"
|
|
)
|
|
|
|
// WindowService implements the proto.WindowServiceServer interface
|
|
type WindowService struct {
|
|
proto.UnimplementedWindowServiceServer
|
|
coreAddress string
|
|
verbose bool
|
|
}
|
|
|
|
// NewWindowService creates a new WindowService
|
|
func NewWindowService(coreAddress string, verbose bool) *WindowService {
|
|
return &WindowService{
|
|
coreAddress: coreAddress,
|
|
verbose: verbose,
|
|
}
|
|
}
|
|
|
|
// ShowTextDocument opens a text document for viewing/editing
|
|
func (s *WindowService) ShowTextDocument(ctx context.Context, req *proto.ShowTextDocumentRequest) (*proto.TextEditorInfo, error) {
|
|
if s.verbose {
|
|
log.Printf("ShowTextDocument called for path: %s", req.GetPath())
|
|
}
|
|
|
|
// For console implementation, we'll just log that we would open the document
|
|
fmt.Printf("[Cline] Would open document: %s\n", req.GetPath())
|
|
|
|
return &proto.TextEditorInfo{
|
|
DocumentPath: req.GetPath(),
|
|
IsActive: true,
|
|
}, nil
|
|
}
|
|
|
|
// ShowOpenDialogue shows a file open dialog
|
|
func (s *WindowService) ShowOpenDialogue(ctx context.Context, req *proto.ShowOpenDialogueRequest) (*proto.SelectedResources, error) {
|
|
if s.verbose {
|
|
log.Printf("ShowOpenDialogue called")
|
|
}
|
|
|
|
// For console implementation, return empty list (user cancelled)
|
|
return &proto.SelectedResources{
|
|
Paths: []string{},
|
|
}, nil
|
|
}
|
|
|
|
// ShowMessage displays a message to the user
|
|
func (s *WindowService) ShowMessage(ctx context.Context, req *proto.ShowMessageRequest) (*proto.SelectedResponse, error) {
|
|
if s.verbose {
|
|
log.Printf("ShowMessage called: %s", req.GetMessage())
|
|
}
|
|
|
|
// Display message to console
|
|
fmt.Printf("[Cline] %s\n", req.GetMessage())
|
|
|
|
return &proto.SelectedResponse{}, nil
|
|
}
|