v0connect

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 15, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CodeExecuteProcedure is the fully-qualified name of the Code's Execute RPC.
	CodeExecuteProcedure = "/codefly.services.code.v0.Code/Execute"
	// CodeListSymbolsProcedure is the fully-qualified name of the Code's ListSymbols RPC.
	CodeListSymbolsProcedure = "/codefly.services.code.v0.Code/ListSymbols"
	// CodeGetDiagnosticsProcedure is the fully-qualified name of the Code's GetDiagnostics RPC.
	CodeGetDiagnosticsProcedure = "/codefly.services.code.v0.Code/GetDiagnostics"
	// CodeGoToDefinitionProcedure is the fully-qualified name of the Code's GoToDefinition RPC.
	CodeGoToDefinitionProcedure = "/codefly.services.code.v0.Code/GoToDefinition"
	// CodeFindReferencesProcedure is the fully-qualified name of the Code's FindReferences RPC.
	CodeFindReferencesProcedure = "/codefly.services.code.v0.Code/FindReferences"
	// CodeGetHoverInfoProcedure is the fully-qualified name of the Code's GetHoverInfo RPC.
	CodeGetHoverInfoProcedure = "/codefly.services.code.v0.Code/GetHoverInfo"
	// CodeApplyEditProcedure is the fully-qualified name of the Code's ApplyEdit RPC.
	CodeApplyEditProcedure = "/codefly.services.code.v0.Code/ApplyEdit"
	// CodeGetCallGraphProcedure is the fully-qualified name of the Code's GetCallGraph RPC.
	CodeGetCallGraphProcedure = "/codefly.services.code.v0.Code/GetCallGraph"
	// CodeShellExecProcedure is the fully-qualified name of the Code's ShellExec RPC.
	CodeShellExecProcedure = "/codefly.services.code.v0.Code/ShellExec"
)

These constants are the fully-qualified names of the RPCs defined in this package. They're exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.

Note that these are different from the fully-qualified method names used by google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to reflection-formatted method names, remove the leading slash and convert the remaining slash to a period.

View Source
const (
	// CodeName is the fully-qualified name of the Code service.
	CodeName = "codefly.services.code.v0.Code"
)

Variables

This section is empty.

Functions

func NewCodeHandler

func NewCodeHandler(svc CodeHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewCodeHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.

By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.

Types

type CodeClient

type CodeClient interface {
	// Execute is the unified dispatch entry point for every code operation.
	// Clients wrap the specific request type in a CodeRequest oneof; the
	// plugin's Execute handler unwraps + dispatches. This is the path Mind
	// uses for everything except the few direct RPCs below that predate
	// the unification and still have live callers in codefly-cli.
	Execute(context.Context, *connect.Request[v0.CodeRequest]) (*connect.Response[v0.CodeResponse], error)
	// ListSymbols directly exposes symbol listing for older CLI callers.
	ListSymbols(context.Context, *connect.Request[v0.ListSymbolsRequest]) (*connect.Response[v0.ListSymbolsResponse], error)
	// GetDiagnostics directly exposes language diagnostics for older CLI callers.
	GetDiagnostics(context.Context, *connect.Request[v0.GetDiagnosticsRequest]) (*connect.Response[v0.GetDiagnosticsResponse], error)
	// GoToDefinition directly exposes definition lookup for older CLI callers.
	GoToDefinition(context.Context, *connect.Request[v0.GoToDefinitionRequest]) (*connect.Response[v0.GoToDefinitionResponse], error)
	// FindReferences directly exposes reference lookup for older CLI callers.
	FindReferences(context.Context, *connect.Request[v0.FindReferencesRequest]) (*connect.Response[v0.FindReferencesResponse], error)
	// GetHoverInfo directly exposes hover information for older CLI callers.
	GetHoverInfo(context.Context, *connect.Request[v0.GetHoverInfoRequest]) (*connect.Response[v0.GetHoverInfoResponse], error)
	// ApplyEdit directly exposes smart edits for older CLI callers.
	ApplyEdit(context.Context, *connect.Request[v0.ApplyEditRequest]) (*connect.Response[v0.ApplyEditResponse], error)
	// GetCallGraph directly exposes call graph analysis for older CLI callers.
	GetCallGraph(context.Context, *connect.Request[v0.GetCallGraphRequest]) (*connect.Response[v0.GetCallGraphResponse], error)
	// ShellExec is the one sanctioned path for running shell commands
	// against a workspace. Clients call this instead of os/exec so all
	// process spawning crosses the plugin boundary (the agent).
	ShellExec(context.Context, *connect.Request[v0.ShellExecRequest]) (*connect.Response[v0.ShellExecResponse], error)
}

CodeClient is a client for the codefly.services.code.v0.Code service.

func NewCodeClient

func NewCodeClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) CodeClient

NewCodeClient constructs a client for the codefly.services.code.v0.Code service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.

The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).

type CodeHandler

type CodeHandler interface {
	// Execute is the unified dispatch entry point for every code operation.
	// Clients wrap the specific request type in a CodeRequest oneof; the
	// plugin's Execute handler unwraps + dispatches. This is the path Mind
	// uses for everything except the few direct RPCs below that predate
	// the unification and still have live callers in codefly-cli.
	Execute(context.Context, *connect.Request[v0.CodeRequest]) (*connect.Response[v0.CodeResponse], error)
	// ListSymbols directly exposes symbol listing for older CLI callers.
	ListSymbols(context.Context, *connect.Request[v0.ListSymbolsRequest]) (*connect.Response[v0.ListSymbolsResponse], error)
	// GetDiagnostics directly exposes language diagnostics for older CLI callers.
	GetDiagnostics(context.Context, *connect.Request[v0.GetDiagnosticsRequest]) (*connect.Response[v0.GetDiagnosticsResponse], error)
	// GoToDefinition directly exposes definition lookup for older CLI callers.
	GoToDefinition(context.Context, *connect.Request[v0.GoToDefinitionRequest]) (*connect.Response[v0.GoToDefinitionResponse], error)
	// FindReferences directly exposes reference lookup for older CLI callers.
	FindReferences(context.Context, *connect.Request[v0.FindReferencesRequest]) (*connect.Response[v0.FindReferencesResponse], error)
	// GetHoverInfo directly exposes hover information for older CLI callers.
	GetHoverInfo(context.Context, *connect.Request[v0.GetHoverInfoRequest]) (*connect.Response[v0.GetHoverInfoResponse], error)
	// ApplyEdit directly exposes smart edits for older CLI callers.
	ApplyEdit(context.Context, *connect.Request[v0.ApplyEditRequest]) (*connect.Response[v0.ApplyEditResponse], error)
	// GetCallGraph directly exposes call graph analysis for older CLI callers.
	GetCallGraph(context.Context, *connect.Request[v0.GetCallGraphRequest]) (*connect.Response[v0.GetCallGraphResponse], error)
	// ShellExec is the one sanctioned path for running shell commands
	// against a workspace. Clients call this instead of os/exec so all
	// process spawning crosses the plugin boundary (the agent).
	ShellExec(context.Context, *connect.Request[v0.ShellExecRequest]) (*connect.Response[v0.ShellExecResponse], error)
}

CodeHandler is an implementation of the codefly.services.code.v0.Code service.

type UnimplementedCodeHandler

type UnimplementedCodeHandler struct{}

UnimplementedCodeHandler returns CodeUnimplemented from all methods.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL