Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterToolServiceServer(s grpc.ServiceRegistrar, srv ToolServiceServer)
- type ExecuteRequest
- func (*ExecuteRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ExecuteRequest) GetContext() map[string]string
- func (x *ExecuteRequest) GetInput() []byte
- func (x *ExecuteRequest) GetToolName() string
- func (*ExecuteRequest) ProtoMessage()
- func (x *ExecuteRequest) ProtoReflect() protoreflect.Message
- func (x *ExecuteRequest) Reset()
- func (x *ExecuteRequest) String() string
- type ExecuteResponse
- func (*ExecuteResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ExecuteResponse) GetContent() string
- func (x *ExecuteResponse) GetImages() []*ResultImage
- func (x *ExecuteResponse) GetIsError() bool
- func (x *ExecuteResponse) GetSuggestedWorkingDir() string
- func (*ExecuteResponse) ProtoMessage()
- func (x *ExecuteResponse) ProtoReflect() protoreflect.Message
- func (x *ExecuteResponse) Reset()
- func (x *ExecuteResponse) String() string
- type ListToolsRequest
- type ListToolsResponse
- func (*ListToolsResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListToolsResponse) GetTools() []*ToolDefinition
- func (*ListToolsResponse) ProtoMessage()
- func (x *ListToolsResponse) ProtoReflect() protoreflect.Message
- func (x *ListToolsResponse) Reset()
- func (x *ListToolsResponse) String() string
- type ResultImage
- func (*ResultImage) Descriptor() ([]byte, []int)deprecated
- func (x *ResultImage) GetBase64() string
- func (x *ResultImage) GetHeight() int32
- func (x *ResultImage) GetMime() string
- func (x *ResultImage) GetWidth() int32
- func (*ResultImage) ProtoMessage()
- func (x *ResultImage) ProtoReflect() protoreflect.Message
- func (x *ResultImage) Reset()
- func (x *ResultImage) String() string
- type ShutdownRequest
- type ShutdownResponse
- type ToolDefinition
- func (*ToolDefinition) Descriptor() ([]byte, []int)deprecated
- func (x *ToolDefinition) GetCategories() []string
- func (x *ToolDefinition) GetDescription() string
- func (x *ToolDefinition) GetName() string
- func (x *ToolDefinition) GetParameters() []byte
- func (*ToolDefinition) ProtoMessage()
- func (x *ToolDefinition) ProtoReflect() protoreflect.Message
- func (x *ToolDefinition) Reset()
- func (x *ToolDefinition) String() string
- type ToolServiceClient
- type ToolServiceServer
- type UnimplementedToolServiceServer
- func (UnimplementedToolServiceServer) Execute(context.Context, *ExecuteRequest) (*ExecuteResponse, error)
- func (UnimplementedToolServiceServer) ListTools(context.Context, *ListToolsRequest) (*ListToolsResponse, error)
- func (UnimplementedToolServiceServer) Shutdown(context.Context, *ShutdownRequest) (*ShutdownResponse, error)
- type UnsafeToolServiceServer
Constants ¶
const ( ToolService_ListTools_FullMethodName = "/ggcode.plugin.v1.ToolService/ListTools" ToolService_Execute_FullMethodName = "/ggcode.plugin.v1.ToolService/Execute" ToolService_Shutdown_FullMethodName = "/ggcode.plugin.v1.ToolService/Shutdown" )
Variables ¶
var File_ggcode_plugin_proto protoreflect.FileDescriptor
var ToolService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "ggcode.plugin.v1.ToolService", HandlerType: (*ToolServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "ListTools", Handler: _ToolService_ListTools_Handler, }, { MethodName: "Execute", Handler: _ToolService_Execute_Handler, }, { MethodName: "Shutdown", Handler: _ToolService_Shutdown_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "ggcode_plugin.proto", }
ToolService_ServiceDesc is the grpc.ServiceDesc for ToolService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterToolServiceServer ¶
func RegisterToolServiceServer(s grpc.ServiceRegistrar, srv ToolServiceServer)
Types ¶
type ExecuteRequest ¶
type ExecuteRequest struct {
// The tool name (must match a name returned by ListTools).
ToolName string `protobuf:"bytes,1,opt,name=tool_name,json=toolName,proto3" json:"tool_name,omitempty"`
// JSON-encoded arguments (matches the tool's parameters schema).
Input []byte `protobuf:"bytes,2,opt,name=input,proto3" json:"input,omitempty"`
// Runtime context from the host.
Context map[string]string `` /* 141-byte string literal not displayed */
// contains filtered or unexported fields
}
func (*ExecuteRequest) Descriptor
deprecated
func (*ExecuteRequest) Descriptor() ([]byte, []int)
Deprecated: Use ExecuteRequest.ProtoReflect.Descriptor instead.
func (*ExecuteRequest) GetContext ¶
func (x *ExecuteRequest) GetContext() map[string]string
func (*ExecuteRequest) GetInput ¶
func (x *ExecuteRequest) GetInput() []byte
func (*ExecuteRequest) GetToolName ¶
func (x *ExecuteRequest) GetToolName() string
func (*ExecuteRequest) ProtoMessage ¶
func (*ExecuteRequest) ProtoMessage()
func (*ExecuteRequest) ProtoReflect ¶
func (x *ExecuteRequest) ProtoReflect() protoreflect.Message
func (*ExecuteRequest) Reset ¶
func (x *ExecuteRequest) Reset()
func (*ExecuteRequest) String ¶
func (x *ExecuteRequest) String() string
type ExecuteResponse ¶
type ExecuteResponse struct {
Content string `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"`
IsError bool `protobuf:"varint,2,opt,name=is_error,json=isError,proto3" json:"is_error,omitempty"`
Images []*ResultImage `protobuf:"bytes,3,rep,name=images,proto3" json:"images,omitempty"`
// Optional hint: if non-empty, the agent will switch its working directory.
SuggestedWorkingDir string `protobuf:"bytes,4,opt,name=suggested_working_dir,json=suggestedWorkingDir,proto3" json:"suggested_working_dir,omitempty"`
// contains filtered or unexported fields
}
func (*ExecuteResponse) Descriptor
deprecated
func (*ExecuteResponse) Descriptor() ([]byte, []int)
Deprecated: Use ExecuteResponse.ProtoReflect.Descriptor instead.
func (*ExecuteResponse) GetContent ¶
func (x *ExecuteResponse) GetContent() string
func (*ExecuteResponse) GetImages ¶
func (x *ExecuteResponse) GetImages() []*ResultImage
func (*ExecuteResponse) GetIsError ¶
func (x *ExecuteResponse) GetIsError() bool
func (*ExecuteResponse) GetSuggestedWorkingDir ¶
func (x *ExecuteResponse) GetSuggestedWorkingDir() string
func (*ExecuteResponse) ProtoMessage ¶
func (*ExecuteResponse) ProtoMessage()
func (*ExecuteResponse) ProtoReflect ¶
func (x *ExecuteResponse) ProtoReflect() protoreflect.Message
func (*ExecuteResponse) Reset ¶
func (x *ExecuteResponse) Reset()
func (*ExecuteResponse) String ¶
func (x *ExecuteResponse) String() string
type ListToolsRequest ¶
type ListToolsRequest struct {
// contains filtered or unexported fields
}
func (*ListToolsRequest) Descriptor
deprecated
func (*ListToolsRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListToolsRequest.ProtoReflect.Descriptor instead.
func (*ListToolsRequest) ProtoMessage ¶
func (*ListToolsRequest) ProtoMessage()
func (*ListToolsRequest) ProtoReflect ¶
func (x *ListToolsRequest) ProtoReflect() protoreflect.Message
func (*ListToolsRequest) Reset ¶
func (x *ListToolsRequest) Reset()
func (*ListToolsRequest) String ¶
func (x *ListToolsRequest) String() string
type ListToolsResponse ¶
type ListToolsResponse struct {
Tools []*ToolDefinition `protobuf:"bytes,1,rep,name=tools,proto3" json:"tools,omitempty"`
// contains filtered or unexported fields
}
func (*ListToolsResponse) Descriptor
deprecated
func (*ListToolsResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListToolsResponse.ProtoReflect.Descriptor instead.
func (*ListToolsResponse) GetTools ¶
func (x *ListToolsResponse) GetTools() []*ToolDefinition
func (*ListToolsResponse) ProtoMessage ¶
func (*ListToolsResponse) ProtoMessage()
func (*ListToolsResponse) ProtoReflect ¶
func (x *ListToolsResponse) ProtoReflect() protoreflect.Message
func (*ListToolsResponse) Reset ¶
func (x *ListToolsResponse) Reset()
func (*ListToolsResponse) String ¶
func (x *ListToolsResponse) String() string
type ResultImage ¶
type ResultImage struct {
Mime string `protobuf:"bytes,1,opt,name=mime,proto3" json:"mime,omitempty"`
Base64 string `protobuf:"bytes,2,opt,name=base64,proto3" json:"base64,omitempty"`
Width int32 `protobuf:"varint,3,opt,name=width,proto3" json:"width,omitempty"`
Height int32 `protobuf:"varint,4,opt,name=height,proto3" json:"height,omitempty"`
// contains filtered or unexported fields
}
func (*ResultImage) Descriptor
deprecated
func (*ResultImage) Descriptor() ([]byte, []int)
Deprecated: Use ResultImage.ProtoReflect.Descriptor instead.
func (*ResultImage) GetBase64 ¶
func (x *ResultImage) GetBase64() string
func (*ResultImage) GetHeight ¶
func (x *ResultImage) GetHeight() int32
func (*ResultImage) GetMime ¶
func (x *ResultImage) GetMime() string
func (*ResultImage) GetWidth ¶
func (x *ResultImage) GetWidth() int32
func (*ResultImage) ProtoMessage ¶
func (*ResultImage) ProtoMessage()
func (*ResultImage) ProtoReflect ¶
func (x *ResultImage) ProtoReflect() protoreflect.Message
func (*ResultImage) Reset ¶
func (x *ResultImage) Reset()
func (*ResultImage) String ¶
func (x *ResultImage) String() string
type ShutdownRequest ¶
type ShutdownRequest struct {
// contains filtered or unexported fields
}
func (*ShutdownRequest) Descriptor
deprecated
func (*ShutdownRequest) Descriptor() ([]byte, []int)
Deprecated: Use ShutdownRequest.ProtoReflect.Descriptor instead.
func (*ShutdownRequest) ProtoMessage ¶
func (*ShutdownRequest) ProtoMessage()
func (*ShutdownRequest) ProtoReflect ¶
func (x *ShutdownRequest) ProtoReflect() protoreflect.Message
func (*ShutdownRequest) Reset ¶
func (x *ShutdownRequest) Reset()
func (*ShutdownRequest) String ¶
func (x *ShutdownRequest) String() string
type ShutdownResponse ¶
type ShutdownResponse struct {
// contains filtered or unexported fields
}
func (*ShutdownResponse) Descriptor
deprecated
func (*ShutdownResponse) Descriptor() ([]byte, []int)
Deprecated: Use ShutdownResponse.ProtoReflect.Descriptor instead.
func (*ShutdownResponse) ProtoMessage ¶
func (*ShutdownResponse) ProtoMessage()
func (*ShutdownResponse) ProtoReflect ¶
func (x *ShutdownResponse) ProtoReflect() protoreflect.Message
func (*ShutdownResponse) Reset ¶
func (x *ShutdownResponse) Reset()
func (*ShutdownResponse) String ¶
func (x *ShutdownResponse) String() string
type ToolDefinition ¶
type ToolDefinition struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
// JSON Schema encoded as JSON bytes.
// Example: {"type":"object","properties":{"query":{"type":"string"}}}
Parameters []byte `protobuf:"bytes,3,opt,name=parameters,proto3" json:"parameters,omitempty"`
// Optional category tags for grouping (e.g. "jira", "search").
Categories []string `protobuf:"bytes,4,rep,name=categories,proto3" json:"categories,omitempty"`
// contains filtered or unexported fields
}
func (*ToolDefinition) Descriptor
deprecated
func (*ToolDefinition) Descriptor() ([]byte, []int)
Deprecated: Use ToolDefinition.ProtoReflect.Descriptor instead.
func (*ToolDefinition) GetCategories ¶
func (x *ToolDefinition) GetCategories() []string
func (*ToolDefinition) GetDescription ¶
func (x *ToolDefinition) GetDescription() string
func (*ToolDefinition) GetName ¶
func (x *ToolDefinition) GetName() string
func (*ToolDefinition) GetParameters ¶
func (x *ToolDefinition) GetParameters() []byte
func (*ToolDefinition) ProtoMessage ¶
func (*ToolDefinition) ProtoMessage()
func (*ToolDefinition) ProtoReflect ¶
func (x *ToolDefinition) ProtoReflect() protoreflect.Message
func (*ToolDefinition) Reset ¶
func (x *ToolDefinition) Reset()
func (*ToolDefinition) String ¶
func (x *ToolDefinition) String() string
type ToolServiceClient ¶
type ToolServiceClient interface {
// ListTools returns all tools provided by this plugin.
// Called once at startup after the gRPC connection is established.
ListTools(ctx context.Context, in *ListToolsRequest, opts ...grpc.CallOption) (*ListToolsResponse, error)
// Execute invokes a single tool call.
Execute(ctx context.Context, in *ExecuteRequest, opts ...grpc.CallOption) (*ExecuteResponse, error)
// Shutdown is called before the host terminates the plugin process.
// The plugin should do any cleanup (close connections, flush state).
Shutdown(ctx context.Context, in *ShutdownRequest, opts ...grpc.CallOption) (*ShutdownResponse, error)
}
ToolServiceClient is the client API for ToolService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
ToolService is implemented by the plugin process. The host (ggcode) acts as the gRPC client; the plugin is the server.
func NewToolServiceClient ¶
func NewToolServiceClient(cc grpc.ClientConnInterface) ToolServiceClient
type ToolServiceServer ¶
type ToolServiceServer interface {
// ListTools returns all tools provided by this plugin.
// Called once at startup after the gRPC connection is established.
ListTools(context.Context, *ListToolsRequest) (*ListToolsResponse, error)
// Execute invokes a single tool call.
Execute(context.Context, *ExecuteRequest) (*ExecuteResponse, error)
// Shutdown is called before the host terminates the plugin process.
// The plugin should do any cleanup (close connections, flush state).
Shutdown(context.Context, *ShutdownRequest) (*ShutdownResponse, error)
// contains filtered or unexported methods
}
ToolServiceServer is the server API for ToolService service. All implementations must embed UnimplementedToolServiceServer for forward compatibility.
ToolService is implemented by the plugin process. The host (ggcode) acts as the gRPC client; the plugin is the server.
type UnimplementedToolServiceServer ¶
type UnimplementedToolServiceServer struct{}
UnimplementedToolServiceServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedToolServiceServer) Execute ¶
func (UnimplementedToolServiceServer) Execute(context.Context, *ExecuteRequest) (*ExecuteResponse, error)
func (UnimplementedToolServiceServer) ListTools ¶
func (UnimplementedToolServiceServer) ListTools(context.Context, *ListToolsRequest) (*ListToolsResponse, error)
func (UnimplementedToolServiceServer) Shutdown ¶
func (UnimplementedToolServiceServer) Shutdown(context.Context, *ShutdownRequest) (*ShutdownResponse, error)
type UnsafeToolServiceServer ¶
type UnsafeToolServiceServer interface {
// contains filtered or unexported methods
}
UnsafeToolServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ToolServiceServer will result in compilation errors.