Init Project
Some checks failed
Go CI Pipeline / build_and_test (push) Failing after 22m0s

This commit is contained in:
enkly
2026-10-30 18:06:55 +01:00
parent da8af794bd
commit 79ce8dc4c0
211 changed files with 44434 additions and 1 deletions

999
gen/agent/v1/agent.pb.go Normal file
View File

@@ -0,0 +1,999 @@
// Package agent is the Agent Orchestration bounded context: the agentic
// run loop (prompt -> vLLM -> tool calls -> final reply), the chat-run
// quota/concurrency guard, and the in-flight/just-finished run registry
// that used to live in internal/handlers/chat.go's StreamManager.
//
// This is a saga coordinator, not a data owner: it holds no SQL table of
// its own. It calls billing (usage quota), conversation (persisting
// turns) and knowledge (the search_codebase tool) over gRPC, and
// workspace (every filesystem/bash tool) over gRPC, exactly replacing
// internal/llm/agent.go + internal/llm/tools.go's direct, in-process
// calls into internal/db and the local filesystem.
//
// Rendering (Markdown, syntax highlighting, deliverable cards) stays out
// of this service on purpose — see internal/render's doc comment in the
// gateway service — so this API deals in plain text and structured tool
// results, never HTML.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.34.2
// protoc v3.21.12
// source: agent/v1/agent.proto
package agentv1
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type StartTurnOutcome int32
const (
StartTurnOutcome_START_TURN_OUTCOME_UNSPECIFIED StartTurnOutcome = 0
StartTurnOutcome_START_TURN_OUTCOME_OK StartTurnOutcome = 1
StartTurnOutcome_START_TURN_OUTCOME_CONVERSATION_NOT_FOUND StartTurnOutcome = 2
StartTurnOutcome_START_TURN_OUTCOME_CONVERSATION_BUSY StartTurnOutcome = 3
StartTurnOutcome_START_TURN_OUTCOME_TOO_MANY_STREAMS StartTurnOutcome = 4
StartTurnOutcome_START_TURN_OUTCOME_RATE_LIMITED StartTurnOutcome = 5
StartTurnOutcome_START_TURN_OUTCOME_QUOTA_EXCEEDED StartTurnOutcome = 6
StartTurnOutcome_START_TURN_OUTCOME_INTERNAL_ERROR StartTurnOutcome = 7
)
// Enum value maps for StartTurnOutcome.
var (
StartTurnOutcome_name = map[int32]string{
0: "START_TURN_OUTCOME_UNSPECIFIED",
1: "START_TURN_OUTCOME_OK",
2: "START_TURN_OUTCOME_CONVERSATION_NOT_FOUND",
3: "START_TURN_OUTCOME_CONVERSATION_BUSY",
4: "START_TURN_OUTCOME_TOO_MANY_STREAMS",
5: "START_TURN_OUTCOME_RATE_LIMITED",
6: "START_TURN_OUTCOME_QUOTA_EXCEEDED",
7: "START_TURN_OUTCOME_INTERNAL_ERROR",
}
StartTurnOutcome_value = map[string]int32{
"START_TURN_OUTCOME_UNSPECIFIED": 0,
"START_TURN_OUTCOME_OK": 1,
"START_TURN_OUTCOME_CONVERSATION_NOT_FOUND": 2,
"START_TURN_OUTCOME_CONVERSATION_BUSY": 3,
"START_TURN_OUTCOME_TOO_MANY_STREAMS": 4,
"START_TURN_OUTCOME_RATE_LIMITED": 5,
"START_TURN_OUTCOME_QUOTA_EXCEEDED": 6,
"START_TURN_OUTCOME_INTERNAL_ERROR": 7,
}
)
func (x StartTurnOutcome) Enum() *StartTurnOutcome {
p := new(StartTurnOutcome)
*p = x
return p
}
func (x StartTurnOutcome) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (StartTurnOutcome) Descriptor() protoreflect.EnumDescriptor {
return file_agent_v1_agent_proto_enumTypes[0].Descriptor()
}
func (StartTurnOutcome) Type() protoreflect.EnumType {
return &file_agent_v1_agent_proto_enumTypes[0]
}
func (x StartTurnOutcome) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use StartTurnOutcome.Descriptor instead.
func (StartTurnOutcome) EnumDescriptor() ([]byte, []int) {
return file_agent_v1_agent_proto_rawDescGZIP(), []int{0}
}
type StartTurnRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
ConversationId int64 `protobuf:"varint,2,opt,name=conversation_id,json=conversationId,proto3" json:"conversation_id,omitempty"`
Prompt string `protobuf:"bytes,3,opt,name=prompt,proto3" json:"prompt,omitempty"`
}
func (x *StartTurnRequest) Reset() {
*x = StartTurnRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_agent_v1_agent_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *StartTurnRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*StartTurnRequest) ProtoMessage() {}
func (x *StartTurnRequest) ProtoReflect() protoreflect.Message {
mi := &file_agent_v1_agent_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use StartTurnRequest.ProtoReflect.Descriptor instead.
func (*StartTurnRequest) Descriptor() ([]byte, []int) {
return file_agent_v1_agent_proto_rawDescGZIP(), []int{0}
}
func (x *StartTurnRequest) GetUserId() int64 {
if x != nil {
return x.UserId
}
return 0
}
func (x *StartTurnRequest) GetConversationId() int64 {
if x != nil {
return x.ConversationId
}
return 0
}
func (x *StartTurnRequest) GetPrompt() string {
if x != nil {
return x.Prompt
}
return ""
}
type StartTurnResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Outcome StartTurnOutcome `protobuf:"varint,1,opt,name=outcome,proto3,enum=enkly.agent.v1.StartTurnOutcome" json:"outcome,omitempty"`
Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` // user-facing text for any non-OK outcome
StreamId string `protobuf:"bytes,3,opt,name=stream_id,json=streamId,proto3" json:"stream_id,omitempty"` // set when outcome == OK
}
func (x *StartTurnResponse) Reset() {
*x = StartTurnResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_agent_v1_agent_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *StartTurnResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*StartTurnResponse) ProtoMessage() {}
func (x *StartTurnResponse) ProtoReflect() protoreflect.Message {
mi := &file_agent_v1_agent_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use StartTurnResponse.ProtoReflect.Descriptor instead.
func (*StartTurnResponse) Descriptor() ([]byte, []int) {
return file_agent_v1_agent_proto_rawDescGZIP(), []int{1}
}
func (x *StartTurnResponse) GetOutcome() StartTurnOutcome {
if x != nil {
return x.Outcome
}
return StartTurnOutcome_START_TURN_OUTCOME_UNSPECIFIED
}
func (x *StartTurnResponse) GetMessage() string {
if x != nil {
return x.Message
}
return ""
}
func (x *StartTurnResponse) GetStreamId() string {
if x != nil {
return x.StreamId
}
return ""
}
type StreamTurnRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
StreamId string `protobuf:"bytes,2,opt,name=stream_id,json=streamId,proto3" json:"stream_id,omitempty"`
ResumeFromToolIndex int32 `protobuf:"varint,3,opt,name=resume_from_tool_index,json=resumeFromToolIndex,proto3" json:"resume_from_tool_index,omitempty"`
}
func (x *StreamTurnRequest) Reset() {
*x = StreamTurnRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_agent_v1_agent_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *StreamTurnRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*StreamTurnRequest) ProtoMessage() {}
func (x *StreamTurnRequest) ProtoReflect() protoreflect.Message {
mi := &file_agent_v1_agent_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use StreamTurnRequest.ProtoReflect.Descriptor instead.
func (*StreamTurnRequest) Descriptor() ([]byte, []int) {
return file_agent_v1_agent_proto_rawDescGZIP(), []int{2}
}
func (x *StreamTurnRequest) GetUserId() int64 {
if x != nil {
return x.UserId
}
return 0
}
func (x *StreamTurnRequest) GetStreamId() string {
if x != nil {
return x.StreamId
}
return ""
}
func (x *StreamTurnRequest) GetResumeFromToolIndex() int32 {
if x != nil {
return x.ResumeFromToolIndex
}
return 0
}
type ToolCall struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
ArgumentsJson string `protobuf:"bytes,2,opt,name=arguments_json,json=argumentsJson,proto3" json:"arguments_json,omitempty"`
Result string `protobuf:"bytes,3,opt,name=result,proto3" json:"result,omitempty"`
IsError bool `protobuf:"varint,4,opt,name=is_error,json=isError,proto3" json:"is_error,omitempty"`
}
func (x *ToolCall) Reset() {
*x = ToolCall{}
if protoimpl.UnsafeEnabled {
mi := &file_agent_v1_agent_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ToolCall) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ToolCall) ProtoMessage() {}
func (x *ToolCall) ProtoReflect() protoreflect.Message {
mi := &file_agent_v1_agent_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ToolCall.ProtoReflect.Descriptor instead.
func (*ToolCall) Descriptor() ([]byte, []int) {
return file_agent_v1_agent_proto_rawDescGZIP(), []int{3}
}
func (x *ToolCall) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *ToolCall) GetArgumentsJson() string {
if x != nil {
return x.ArgumentsJson
}
return ""
}
func (x *ToolCall) GetResult() string {
if x != nil {
return x.Result
}
return ""
}
func (x *ToolCall) GetIsError() bool {
if x != nil {
return x.IsError
}
return false
}
// ThinkingRound is one agent round's own reasoning trace, standalone
// rather than folded into the running total thinking_delta carries —
// the same per-step granularity Claude's interleaved thinking exposes
// (one distinct thinking block per tool-use step) rather than one
// cumulative blob for the whole turn. round is 0-indexed and matches
// the round the agent service's internal run loop was on when this
// trace was produced; a client can use it to render reasoning as
// discrete, collapsible steps next to the tool call each one preceded,
// instead of a single growing "thinking" pane.
type ThinkingRound struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Round int32 `protobuf:"varint,1,opt,name=round,proto3" json:"round,omitempty"`
Thinking string `protobuf:"bytes,2,opt,name=thinking,proto3" json:"thinking,omitempty"`
}
func (x *ThinkingRound) Reset() {
*x = ThinkingRound{}
if protoimpl.UnsafeEnabled {
mi := &file_agent_v1_agent_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ThinkingRound) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ThinkingRound) ProtoMessage() {}
func (x *ThinkingRound) ProtoReflect() protoreflect.Message {
mi := &file_agent_v1_agent_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ThinkingRound.ProtoReflect.Descriptor instead.
func (*ThinkingRound) Descriptor() ([]byte, []int) {
return file_agent_v1_agent_proto_rawDescGZIP(), []int{4}
}
func (x *ThinkingRound) GetRound() int32 {
if x != nil {
return x.Round
}
return 0
}
func (x *ThinkingRound) GetThinking() string {
if x != nil {
return x.Thinking
}
return ""
}
type TurnEvent struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Types that are assignable to Event:
//
// *TurnEvent_ThinkingDelta
// *TurnEvent_TokenDelta
// *TurnEvent_ToolCall
// *TurnEvent_Done
// *TurnEvent_ThinkingRound
Event isTurnEvent_Event `protobuf_oneof:"event"`
}
func (x *TurnEvent) Reset() {
*x = TurnEvent{}
if protoimpl.UnsafeEnabled {
mi := &file_agent_v1_agent_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *TurnEvent) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*TurnEvent) ProtoMessage() {}
func (x *TurnEvent) ProtoReflect() protoreflect.Message {
mi := &file_agent_v1_agent_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use TurnEvent.ProtoReflect.Descriptor instead.
func (*TurnEvent) Descriptor() ([]byte, []int) {
return file_agent_v1_agent_proto_rawDescGZIP(), []int{5}
}
func (m *TurnEvent) GetEvent() isTurnEvent_Event {
if m != nil {
return m.Event
}
return nil
}
func (x *TurnEvent) GetThinkingDelta() string {
if x, ok := x.GetEvent().(*TurnEvent_ThinkingDelta); ok {
return x.ThinkingDelta
}
return ""
}
func (x *TurnEvent) GetTokenDelta() string {
if x, ok := x.GetEvent().(*TurnEvent_TokenDelta); ok {
return x.TokenDelta
}
return ""
}
func (x *TurnEvent) GetToolCall() *ToolCall {
if x, ok := x.GetEvent().(*TurnEvent_ToolCall); ok {
return x.ToolCall
}
return nil
}
func (x *TurnEvent) GetDone() *TurnDone {
if x, ok := x.GetEvent().(*TurnEvent_Done); ok {
return x.Done
}
return nil
}
func (x *TurnEvent) GetThinkingRound() *ThinkingRound {
if x, ok := x.GetEvent().(*TurnEvent_ThinkingRound); ok {
return x.ThinkingRound
}
return nil
}
type isTurnEvent_Event interface {
isTurnEvent_Event()
}
type TurnEvent_ThinkingDelta struct {
ThinkingDelta string `protobuf:"bytes,1,opt,name=thinking_delta,json=thinkingDelta,proto3,oneof"` // cumulative reasoning text so far, plain
}
type TurnEvent_TokenDelta struct {
TokenDelta string `protobuf:"bytes,2,opt,name=token_delta,json=tokenDelta,proto3,oneof"` // cumulative reply text so far, plain
}
type TurnEvent_ToolCall struct {
ToolCall *ToolCall `protobuf:"bytes,3,opt,name=tool_call,json=toolCall,proto3,oneof"` // one completed tool call
}
type TurnEvent_Done struct {
Done *TurnDone `protobuf:"bytes,4,opt,name=done,proto3,oneof"`
}
type TurnEvent_ThinkingRound struct {
ThinkingRound *ThinkingRound `protobuf:"bytes,5,opt,name=thinking_round,json=thinkingRound,proto3,oneof"` // one round's own reasoning trace, standalone
}
func (*TurnEvent_ThinkingDelta) isTurnEvent_Event() {}
func (*TurnEvent_TokenDelta) isTurnEvent_Event() {}
func (*TurnEvent_ToolCall) isTurnEvent_Event() {}
func (*TurnEvent_Done) isTurnEvent_Event() {}
func (*TurnEvent_ThinkingRound) isTurnEvent_Event() {}
type TurnDone struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
FinalText string `protobuf:"bytes,1,opt,name=final_text,json=finalText,proto3" json:"final_text,omitempty"` // plain Markdown source, not yet rendered
// every tool call made during the turn, successful or not — the
// gateway uses this to build deliverable (download) cards exactly
// like internal/handlers/deliverables.go.attachDeliverables.
ToolCalls []*ToolCall `protobuf:"bytes,2,rep,name=tool_calls,json=toolCalls,proto3" json:"tool_calls,omitempty"`
}
func (x *TurnDone) Reset() {
*x = TurnDone{}
if protoimpl.UnsafeEnabled {
mi := &file_agent_v1_agent_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *TurnDone) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*TurnDone) ProtoMessage() {}
func (x *TurnDone) ProtoReflect() protoreflect.Message {
mi := &file_agent_v1_agent_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use TurnDone.ProtoReflect.Descriptor instead.
func (*TurnDone) Descriptor() ([]byte, []int) {
return file_agent_v1_agent_proto_rawDescGZIP(), []int{6}
}
func (x *TurnDone) GetFinalText() string {
if x != nil {
return x.FinalText
}
return ""
}
func (x *TurnDone) GetToolCalls() []*ToolCall {
if x != nil {
return x.ToolCalls
}
return nil
}
type StopTurnRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
StreamId string `protobuf:"bytes,2,opt,name=stream_id,json=streamId,proto3" json:"stream_id,omitempty"`
}
func (x *StopTurnRequest) Reset() {
*x = StopTurnRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_agent_v1_agent_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *StopTurnRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*StopTurnRequest) ProtoMessage() {}
func (x *StopTurnRequest) ProtoReflect() protoreflect.Message {
mi := &file_agent_v1_agent_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use StopTurnRequest.ProtoReflect.Descriptor instead.
func (*StopTurnRequest) Descriptor() ([]byte, []int) {
return file_agent_v1_agent_proto_rawDescGZIP(), []int{7}
}
func (x *StopTurnRequest) GetUserId() int64 {
if x != nil {
return x.UserId
}
return 0
}
func (x *StopTurnRequest) GetStreamId() string {
if x != nil {
return x.StreamId
}
return ""
}
type StopTurnResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *StopTurnResponse) Reset() {
*x = StopTurnResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_agent_v1_agent_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *StopTurnResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*StopTurnResponse) ProtoMessage() {}
func (x *StopTurnResponse) ProtoReflect() protoreflect.Message {
mi := &file_agent_v1_agent_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use StopTurnResponse.ProtoReflect.Descriptor instead.
func (*StopTurnResponse) Descriptor() ([]byte, []int) {
return file_agent_v1_agent_proto_rawDescGZIP(), []int{8}
}
var File_agent_v1_agent_proto protoreflect.FileDescriptor
var file_agent_v1_agent_proto_rawDesc = []byte{
0x0a, 0x14, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x67, 0x65, 0x6e, 0x74,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x65, 0x6e, 0x6b, 0x6c, 0x79, 0x2e, 0x61, 0x67,
0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x22, 0x6c, 0x0a, 0x10, 0x53, 0x74, 0x61, 0x72, 0x74, 0x54,
0x75, 0x72, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73,
0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65,
0x72, 0x49, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x63, 0x6f,
0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06,
0x70, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x72,
0x6f, 0x6d, 0x70, 0x74, 0x22, 0x86, 0x01, 0x0a, 0x11, 0x53, 0x74, 0x61, 0x72, 0x74, 0x54, 0x75,
0x72, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x07, 0x6f, 0x75,
0x74, 0x63, 0x6f, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x65, 0x6e,
0x6b, 0x6c, 0x79, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61,
0x72, 0x74, 0x54, 0x75, 0x72, 0x6e, 0x4f, 0x75, 0x74, 0x63, 0x6f, 0x6d, 0x65, 0x52, 0x07, 0x6f,
0x75, 0x74, 0x63, 0x6f, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
0x12, 0x1b, 0x0a, 0x09, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20,
0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x22, 0x7e, 0x0a,
0x11, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x54, 0x75, 0x72, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73,
0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08,
0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x12, 0x33, 0x0a, 0x16, 0x72, 0x65, 0x73, 0x75,
0x6d, 0x65, 0x5f, 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x74, 0x6f, 0x6f, 0x6c, 0x5f, 0x69, 0x6e, 0x64,
0x65, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x13, 0x72, 0x65, 0x73, 0x75, 0x6d, 0x65,
0x46, 0x72, 0x6f, 0x6d, 0x54, 0x6f, 0x6f, 0x6c, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x22, 0x78, 0x0a,
0x08, 0x54, 0x6f, 0x6f, 0x6c, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d,
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x0a,
0x0e, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x18,
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73,
0x4a, 0x73, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x03,
0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x19, 0x0a, 0x08,
0x69, 0x73, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07,
0x69, 0x73, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x41, 0x0a, 0x0d, 0x54, 0x68, 0x69, 0x6e, 0x6b,
0x69, 0x6e, 0x67, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x6f, 0x75, 0x6e,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x1a,
0x0a, 0x08, 0x74, 0x68, 0x69, 0x6e, 0x6b, 0x69, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
0x52, 0x08, 0x74, 0x68, 0x69, 0x6e, 0x6b, 0x69, 0x6e, 0x67, 0x22, 0x91, 0x02, 0x0a, 0x09, 0x54,
0x75, 0x72, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x27, 0x0a, 0x0e, 0x74, 0x68, 0x69, 0x6e,
0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x65, 0x6c, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x48, 0x00, 0x52, 0x0d, 0x74, 0x68, 0x69, 0x6e, 0x6b, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x74,
0x61, 0x12, 0x21, 0x0a, 0x0b, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x64, 0x65, 0x6c, 0x74, 0x61,
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0a, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x44,
0x65, 0x6c, 0x74, 0x61, 0x12, 0x37, 0x0a, 0x09, 0x74, 0x6f, 0x6f, 0x6c, 0x5f, 0x63, 0x61, 0x6c,
0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x65, 0x6e, 0x6b, 0x6c, 0x79, 0x2e,
0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x6f, 0x6f, 0x6c, 0x43, 0x61, 0x6c,
0x6c, 0x48, 0x00, 0x52, 0x08, 0x74, 0x6f, 0x6f, 0x6c, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x2e, 0x0a,
0x04, 0x64, 0x6f, 0x6e, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x65, 0x6e,
0x6b, 0x6c, 0x79, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x75, 0x72,
0x6e, 0x44, 0x6f, 0x6e, 0x65, 0x48, 0x00, 0x52, 0x04, 0x64, 0x6f, 0x6e, 0x65, 0x12, 0x46, 0x0a,
0x0e, 0x74, 0x68, 0x69, 0x6e, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x18,
0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x65, 0x6e, 0x6b, 0x6c, 0x79, 0x2e, 0x61, 0x67,
0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x68, 0x69, 0x6e, 0x6b, 0x69, 0x6e, 0x67, 0x52,
0x6f, 0x75, 0x6e, 0x64, 0x48, 0x00, 0x52, 0x0d, 0x74, 0x68, 0x69, 0x6e, 0x6b, 0x69, 0x6e, 0x67,
0x52, 0x6f, 0x75, 0x6e, 0x64, 0x42, 0x07, 0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x22, 0x62,
0x0a, 0x08, 0x54, 0x75, 0x72, 0x6e, 0x44, 0x6f, 0x6e, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x69,
0x6e, 0x61, 0x6c, 0x5f, 0x74, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09,
0x66, 0x69, 0x6e, 0x61, 0x6c, 0x54, 0x65, 0x78, 0x74, 0x12, 0x37, 0x0a, 0x0a, 0x74, 0x6f, 0x6f,
0x6c, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e,
0x65, 0x6e, 0x6b, 0x6c, 0x79, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x54,
0x6f, 0x6f, 0x6c, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x09, 0x74, 0x6f, 0x6f, 0x6c, 0x43, 0x61, 0x6c,
0x6c, 0x73, 0x22, 0x47, 0x0a, 0x0f, 0x53, 0x74, 0x6f, 0x70, 0x54, 0x75, 0x72, 0x6e, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64,
0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1b,
0x0a, 0x09, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28,
0x09, 0x52, 0x08, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x22, 0x12, 0x0a, 0x10, 0x53,
0x74, 0x6f, 0x70, 0x54, 0x75, 0x72, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2a,
0xc6, 0x02, 0x0a, 0x10, 0x53, 0x74, 0x61, 0x72, 0x74, 0x54, 0x75, 0x72, 0x6e, 0x4f, 0x75, 0x74,
0x63, 0x6f, 0x6d, 0x65, 0x12, 0x22, 0x0a, 0x1e, 0x53, 0x54, 0x41, 0x52, 0x54, 0x5f, 0x54, 0x55,
0x52, 0x4e, 0x5f, 0x4f, 0x55, 0x54, 0x43, 0x4f, 0x4d, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45,
0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x19, 0x0a, 0x15, 0x53, 0x54, 0x41, 0x52,
0x54, 0x5f, 0x54, 0x55, 0x52, 0x4e, 0x5f, 0x4f, 0x55, 0x54, 0x43, 0x4f, 0x4d, 0x45, 0x5f, 0x4f,
0x4b, 0x10, 0x01, 0x12, 0x2d, 0x0a, 0x29, 0x53, 0x54, 0x41, 0x52, 0x54, 0x5f, 0x54, 0x55, 0x52,
0x4e, 0x5f, 0x4f, 0x55, 0x54, 0x43, 0x4f, 0x4d, 0x45, 0x5f, 0x43, 0x4f, 0x4e, 0x56, 0x45, 0x52,
0x53, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44,
0x10, 0x02, 0x12, 0x28, 0x0a, 0x24, 0x53, 0x54, 0x41, 0x52, 0x54, 0x5f, 0x54, 0x55, 0x52, 0x4e,
0x5f, 0x4f, 0x55, 0x54, 0x43, 0x4f, 0x4d, 0x45, 0x5f, 0x43, 0x4f, 0x4e, 0x56, 0x45, 0x52, 0x53,
0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x42, 0x55, 0x53, 0x59, 0x10, 0x03, 0x12, 0x27, 0x0a, 0x23,
0x53, 0x54, 0x41, 0x52, 0x54, 0x5f, 0x54, 0x55, 0x52, 0x4e, 0x5f, 0x4f, 0x55, 0x54, 0x43, 0x4f,
0x4d, 0x45, 0x5f, 0x54, 0x4f, 0x4f, 0x5f, 0x4d, 0x41, 0x4e, 0x59, 0x5f, 0x53, 0x54, 0x52, 0x45,
0x41, 0x4d, 0x53, 0x10, 0x04, 0x12, 0x23, 0x0a, 0x1f, 0x53, 0x54, 0x41, 0x52, 0x54, 0x5f, 0x54,
0x55, 0x52, 0x4e, 0x5f, 0x4f, 0x55, 0x54, 0x43, 0x4f, 0x4d, 0x45, 0x5f, 0x52, 0x41, 0x54, 0x45,
0x5f, 0x4c, 0x49, 0x4d, 0x49, 0x54, 0x45, 0x44, 0x10, 0x05, 0x12, 0x25, 0x0a, 0x21, 0x53, 0x54,
0x41, 0x52, 0x54, 0x5f, 0x54, 0x55, 0x52, 0x4e, 0x5f, 0x4f, 0x55, 0x54, 0x43, 0x4f, 0x4d, 0x45,
0x5f, 0x51, 0x55, 0x4f, 0x54, 0x41, 0x5f, 0x45, 0x58, 0x43, 0x45, 0x45, 0x44, 0x45, 0x44, 0x10,
0x06, 0x12, 0x25, 0x0a, 0x21, 0x53, 0x54, 0x41, 0x52, 0x54, 0x5f, 0x54, 0x55, 0x52, 0x4e, 0x5f,
0x4f, 0x55, 0x54, 0x43, 0x4f, 0x4d, 0x45, 0x5f, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c,
0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x07, 0x32, 0xfd, 0x01, 0x0a, 0x0c, 0x41, 0x67, 0x65,
0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x50, 0x0a, 0x09, 0x53, 0x74, 0x61,
0x72, 0x74, 0x54, 0x75, 0x72, 0x6e, 0x12, 0x20, 0x2e, 0x65, 0x6e, 0x6b, 0x6c, 0x79, 0x2e, 0x61,
0x67, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x54, 0x75, 0x72,
0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x65, 0x6e, 0x6b, 0x6c, 0x79,
0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x54,
0x75, 0x72, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4c, 0x0a, 0x0a, 0x53,
0x74, 0x72, 0x65, 0x61, 0x6d, 0x54, 0x75, 0x72, 0x6e, 0x12, 0x21, 0x2e, 0x65, 0x6e, 0x6b, 0x6c,
0x79, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61,
0x6d, 0x54, 0x75, 0x72, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x65,
0x6e, 0x6b, 0x6c, 0x79, 0x2e, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x75,
0x72, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x30, 0x01, 0x12, 0x4d, 0x0a, 0x08, 0x53, 0x74, 0x6f,
0x70, 0x54, 0x75, 0x72, 0x6e, 0x12, 0x1f, 0x2e, 0x65, 0x6e, 0x6b, 0x6c, 0x79, 0x2e, 0x61, 0x67,
0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x54, 0x75, 0x72, 0x6e, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x65, 0x6e, 0x6b, 0x6c, 0x79, 0x2e, 0x61,
0x67, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x54, 0x75, 0x72, 0x6e,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x1c, 0x5a, 0x1a, 0x65, 0x6e, 0x6b, 0x6c,
0x79, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x61,
0x67, 0x65, 0x6e, 0x74, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_agent_v1_agent_proto_rawDescOnce sync.Once
file_agent_v1_agent_proto_rawDescData = file_agent_v1_agent_proto_rawDesc
)
func file_agent_v1_agent_proto_rawDescGZIP() []byte {
file_agent_v1_agent_proto_rawDescOnce.Do(func() {
file_agent_v1_agent_proto_rawDescData = protoimpl.X.CompressGZIP(file_agent_v1_agent_proto_rawDescData)
})
return file_agent_v1_agent_proto_rawDescData
}
var file_agent_v1_agent_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_agent_v1_agent_proto_msgTypes = make([]protoimpl.MessageInfo, 9)
var file_agent_v1_agent_proto_goTypes = []any{
(StartTurnOutcome)(0), // 0: enkly.agent.v1.StartTurnOutcome
(*StartTurnRequest)(nil), // 1: enkly.agent.v1.StartTurnRequest
(*StartTurnResponse)(nil), // 2: enkly.agent.v1.StartTurnResponse
(*StreamTurnRequest)(nil), // 3: enkly.agent.v1.StreamTurnRequest
(*ToolCall)(nil), // 4: enkly.agent.v1.ToolCall
(*ThinkingRound)(nil), // 5: enkly.agent.v1.ThinkingRound
(*TurnEvent)(nil), // 6: enkly.agent.v1.TurnEvent
(*TurnDone)(nil), // 7: enkly.agent.v1.TurnDone
(*StopTurnRequest)(nil), // 8: enkly.agent.v1.StopTurnRequest
(*StopTurnResponse)(nil), // 9: enkly.agent.v1.StopTurnResponse
}
var file_agent_v1_agent_proto_depIdxs = []int32{
0, // 0: enkly.agent.v1.StartTurnResponse.outcome:type_name -> enkly.agent.v1.StartTurnOutcome
4, // 1: enkly.agent.v1.TurnEvent.tool_call:type_name -> enkly.agent.v1.ToolCall
7, // 2: enkly.agent.v1.TurnEvent.done:type_name -> enkly.agent.v1.TurnDone
5, // 3: enkly.agent.v1.TurnEvent.thinking_round:type_name -> enkly.agent.v1.ThinkingRound
4, // 4: enkly.agent.v1.TurnDone.tool_calls:type_name -> enkly.agent.v1.ToolCall
1, // 5: enkly.agent.v1.AgentService.StartTurn:input_type -> enkly.agent.v1.StartTurnRequest
3, // 6: enkly.agent.v1.AgentService.StreamTurn:input_type -> enkly.agent.v1.StreamTurnRequest
8, // 7: enkly.agent.v1.AgentService.StopTurn:input_type -> enkly.agent.v1.StopTurnRequest
2, // 8: enkly.agent.v1.AgentService.StartTurn:output_type -> enkly.agent.v1.StartTurnResponse
6, // 9: enkly.agent.v1.AgentService.StreamTurn:output_type -> enkly.agent.v1.TurnEvent
9, // 10: enkly.agent.v1.AgentService.StopTurn:output_type -> enkly.agent.v1.StopTurnResponse
8, // [8:11] is the sub-list for method output_type
5, // [5:8] is the sub-list for method input_type
5, // [5:5] is the sub-list for extension type_name
5, // [5:5] is the sub-list for extension extendee
0, // [0:5] is the sub-list for field type_name
}
func init() { file_agent_v1_agent_proto_init() }
func file_agent_v1_agent_proto_init() {
if File_agent_v1_agent_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_agent_v1_agent_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*StartTurnRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_agent_v1_agent_proto_msgTypes[1].Exporter = func(v any, i int) any {
switch v := v.(*StartTurnResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_agent_v1_agent_proto_msgTypes[2].Exporter = func(v any, i int) any {
switch v := v.(*StreamTurnRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_agent_v1_agent_proto_msgTypes[3].Exporter = func(v any, i int) any {
switch v := v.(*ToolCall); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_agent_v1_agent_proto_msgTypes[4].Exporter = func(v any, i int) any {
switch v := v.(*ThinkingRound); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_agent_v1_agent_proto_msgTypes[5].Exporter = func(v any, i int) any {
switch v := v.(*TurnEvent); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_agent_v1_agent_proto_msgTypes[6].Exporter = func(v any, i int) any {
switch v := v.(*TurnDone); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_agent_v1_agent_proto_msgTypes[7].Exporter = func(v any, i int) any {
switch v := v.(*StopTurnRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_agent_v1_agent_proto_msgTypes[8].Exporter = func(v any, i int) any {
switch v := v.(*StopTurnResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
file_agent_v1_agent_proto_msgTypes[5].OneofWrappers = []any{
(*TurnEvent_ThinkingDelta)(nil),
(*TurnEvent_TokenDelta)(nil),
(*TurnEvent_ToolCall)(nil),
(*TurnEvent_Done)(nil),
(*TurnEvent_ThinkingRound)(nil),
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_agent_v1_agent_proto_rawDesc,
NumEnums: 1,
NumMessages: 9,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_agent_v1_agent_proto_goTypes,
DependencyIndexes: file_agent_v1_agent_proto_depIdxs,
EnumInfos: file_agent_v1_agent_proto_enumTypes,
MessageInfos: file_agent_v1_agent_proto_msgTypes,
}.Build()
File_agent_v1_agent_proto = out.File
file_agent_v1_agent_proto_rawDesc = nil
file_agent_v1_agent_proto_goTypes = nil
file_agent_v1_agent_proto_depIdxs = nil
}

View File

@@ -0,0 +1,240 @@
// Package agent is the Agent Orchestration bounded context: the agentic
// run loop (prompt -> vLLM -> tool calls -> final reply), the chat-run
// quota/concurrency guard, and the in-flight/just-finished run registry
// that used to live in internal/handlers/chat.go's StreamManager.
//
// This is a saga coordinator, not a data owner: it holds no SQL table of
// its own. It calls billing (usage quota), conversation (persisting
// turns) and knowledge (the search_codebase tool) over gRPC, and
// workspace (every filesystem/bash tool) over gRPC, exactly replacing
// internal/llm/agent.go + internal/llm/tools.go's direct, in-process
// calls into internal/db and the local filesystem.
//
// Rendering (Markdown, syntax highlighting, deliverable cards) stays out
// of this service on purpose — see internal/render's doc comment in the
// gateway service — so this API deals in plain text and structured tool
// results, never HTML.
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc v3.21.12
// source: agent/v1/agent.proto
package agentv1
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
AgentService_StartTurn_FullMethodName = "/enkly.agent.v1.AgentService/StartTurn"
AgentService_StreamTurn_FullMethodName = "/enkly.agent.v1.AgentService/StreamTurn"
AgentService_StopTurn_FullMethodName = "/enkly.agent.v1.AgentService/StopTurn"
)
// AgentServiceClient is the client API for AgentService 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.
type AgentServiceClient interface {
// StartTurn replaces the synchronous prefix of Handlers.Chat: the
// per-user throttle (ChatLimiter), the billing quota check, loading
// the conversation, persisting the user's prompt, auto-titling, and
// registering a new run (StreamManager.create) before handing off to
// a background goroutine. Returns immediately with a stream_id; the
// reply itself arrives via StreamTurn.
StartTurn(ctx context.Context, in *StartTurnRequest, opts ...grpc.CallOption) (*StartTurnResponse, error)
// StreamTurn replaces Handlers.StreamChat: a server-streaming view of
// one run's progress. resume_from_tool_index mirrors the monolith's
// SSE Last-Event-ID handling, so a reconnecting client doesn't see
// tool cards it already has.
StreamTurn(ctx context.Context, in *StreamTurnRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[TurnEvent], error)
// StopTurn replaces Handlers.StopStream.
StopTurn(ctx context.Context, in *StopTurnRequest, opts ...grpc.CallOption) (*StopTurnResponse, error)
}
type agentServiceClient struct {
cc grpc.ClientConnInterface
}
func NewAgentServiceClient(cc grpc.ClientConnInterface) AgentServiceClient {
return &agentServiceClient{cc}
}
func (c *agentServiceClient) StartTurn(ctx context.Context, in *StartTurnRequest, opts ...grpc.CallOption) (*StartTurnResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StartTurnResponse)
err := c.cc.Invoke(ctx, AgentService_StartTurn_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *agentServiceClient) StreamTurn(ctx context.Context, in *StreamTurnRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[TurnEvent], error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
stream, err := c.cc.NewStream(ctx, &AgentService_ServiceDesc.Streams[0], AgentService_StreamTurn_FullMethodName, cOpts...)
if err != nil {
return nil, err
}
x := &grpc.GenericClientStream[StreamTurnRequest, TurnEvent]{ClientStream: stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
return x, nil
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type AgentService_StreamTurnClient = grpc.ServerStreamingClient[TurnEvent]
func (c *agentServiceClient) StopTurn(ctx context.Context, in *StopTurnRequest, opts ...grpc.CallOption) (*StopTurnResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StopTurnResponse)
err := c.cc.Invoke(ctx, AgentService_StopTurn_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// AgentServiceServer is the server API for AgentService service.
// All implementations must embed UnimplementedAgentServiceServer
// for forward compatibility.
type AgentServiceServer interface {
// StartTurn replaces the synchronous prefix of Handlers.Chat: the
// per-user throttle (ChatLimiter), the billing quota check, loading
// the conversation, persisting the user's prompt, auto-titling, and
// registering a new run (StreamManager.create) before handing off to
// a background goroutine. Returns immediately with a stream_id; the
// reply itself arrives via StreamTurn.
StartTurn(context.Context, *StartTurnRequest) (*StartTurnResponse, error)
// StreamTurn replaces Handlers.StreamChat: a server-streaming view of
// one run's progress. resume_from_tool_index mirrors the monolith's
// SSE Last-Event-ID handling, so a reconnecting client doesn't see
// tool cards it already has.
StreamTurn(*StreamTurnRequest, grpc.ServerStreamingServer[TurnEvent]) error
// StopTurn replaces Handlers.StopStream.
StopTurn(context.Context, *StopTurnRequest) (*StopTurnResponse, error)
mustEmbedUnimplementedAgentServiceServer()
}
// UnimplementedAgentServiceServer 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.
type UnimplementedAgentServiceServer struct{}
func (UnimplementedAgentServiceServer) StartTurn(context.Context, *StartTurnRequest) (*StartTurnResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method StartTurn not implemented")
}
func (UnimplementedAgentServiceServer) StreamTurn(*StreamTurnRequest, grpc.ServerStreamingServer[TurnEvent]) error {
return status.Errorf(codes.Unimplemented, "method StreamTurn not implemented")
}
func (UnimplementedAgentServiceServer) StopTurn(context.Context, *StopTurnRequest) (*StopTurnResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method StopTurn not implemented")
}
func (UnimplementedAgentServiceServer) mustEmbedUnimplementedAgentServiceServer() {}
func (UnimplementedAgentServiceServer) testEmbeddedByValue() {}
// UnsafeAgentServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to AgentServiceServer will
// result in compilation errors.
type UnsafeAgentServiceServer interface {
mustEmbedUnimplementedAgentServiceServer()
}
func RegisterAgentServiceServer(s grpc.ServiceRegistrar, srv AgentServiceServer) {
// If the following call pancis, it indicates UnimplementedAgentServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&AgentService_ServiceDesc, srv)
}
func _AgentService_StartTurn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(StartTurnRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AgentServiceServer).StartTurn(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: AgentService_StartTurn_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AgentServiceServer).StartTurn(ctx, req.(*StartTurnRequest))
}
return interceptor(ctx, in, info, handler)
}
func _AgentService_StreamTurn_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(StreamTurnRequest)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(AgentServiceServer).StreamTurn(m, &grpc.GenericServerStream[StreamTurnRequest, TurnEvent]{ServerStream: stream})
}
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type AgentService_StreamTurnServer = grpc.ServerStreamingServer[TurnEvent]
func _AgentService_StopTurn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(StopTurnRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AgentServiceServer).StopTurn(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: AgentService_StopTurn_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AgentServiceServer).StopTurn(ctx, req.(*StopTurnRequest))
}
return interceptor(ctx, in, info, handler)
}
// AgentService_ServiceDesc is the grpc.ServiceDesc for AgentService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var AgentService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "enkly.agent.v1.AgentService",
HandlerType: (*AgentServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "StartTurn",
Handler: _AgentService_StartTurn_Handler,
},
{
MethodName: "StopTurn",
Handler: _AgentService_StopTurn_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "StreamTurn",
Handler: _AgentService_StreamTurn_Handler,
ServerStreams: true,
},
},
Metadata: "agent/v1/agent.proto",
}

1455
gen/billing/v1/billing.pb.go Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,445 @@
// Package billing is the Billing & Subscription bounded context: plans,
// Stripe checkout/portal, webhook ingestion, and the per-plan daily
// message quota. System of record for `subscriptions`, `stripe_events`
// and `usage_daily` (see services/billing/migrations/0001_init.sql).
//
// Mirrors internal/handlers/billing.go + internal/billing/*.go +
// internal/db/subscriptions.go.
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc v3.21.12
// source: billing/v1/billing.proto
package billingv1
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
BillingService_GetOrCreateSubscription_FullMethodName = "/enkly.billing.v1.BillingService/GetOrCreateSubscription"
BillingService_GetPlanCatalog_FullMethodName = "/enkly.billing.v1.BillingService/GetPlanCatalog"
BillingService_CreateCheckoutSession_FullMethodName = "/enkly.billing.v1.BillingService/CreateCheckoutSession"
BillingService_SyncCheckoutSession_FullMethodName = "/enkly.billing.v1.BillingService/SyncCheckoutSession"
BillingService_CreateBillingPortalSession_FullMethodName = "/enkly.billing.v1.BillingService/CreateBillingPortalSession"
BillingService_IngestStripeWebhook_FullMethodName = "/enkly.billing.v1.BillingService/IngestStripeWebhook"
BillingService_CheckAndIncrementUsage_FullMethodName = "/enkly.billing.v1.BillingService/CheckAndIncrementUsage"
BillingService_GetDailyUsage_FullMethodName = "/enkly.billing.v1.BillingService/GetDailyUsage"
)
// BillingServiceClient is the client API for BillingService 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.
type BillingServiceClient interface {
// GetOrCreateSubscription replaces db.GetOrCreateSubscription: lazily
// inserts the default free-plan row the first time a user's
// subscription is looked up.
GetOrCreateSubscription(ctx context.Context, in *GetOrCreateSubscriptionRequest, opts ...grpc.CallOption) (*Subscription, error)
// GetPlanCatalog replaces billing.Catalog + billing.PlanPriceIDs for
// rendering /subscription — returns every plan and whether its Stripe
// price is currently configured (so an unconfigured plan renders as
// "Unavailable", same as today).
GetPlanCatalog(ctx context.Context, in *GetPlanCatalogRequest, opts ...grpc.CallOption) (*GetPlanCatalogResponse, error)
// CreateCheckoutSession replaces Handlers.CreateCheckout.
CreateCheckoutSession(ctx context.Context, in *CreateCheckoutSessionRequest, opts ...grpc.CallOption) (*CreateCheckoutSessionResponse, error)
// SyncCheckoutSession replaces Handlers.syncCheckoutSession, the
// fallback path SubscriptionSuccess uses when the webhook hasn't
// landed yet.
SyncCheckoutSession(ctx context.Context, in *SyncCheckoutSessionRequest, opts ...grpc.CallOption) (*Subscription, error)
// CreateBillingPortalSession replaces Handlers.BillingPortal.
CreateBillingPortalSession(ctx context.Context, in *CreateBillingPortalSessionRequest, opts ...grpc.CallOption) (*CreateBillingPortalSessionResponse, error)
// IngestStripeWebhook replaces Handlers.StripeWebhook /
// applyStripeEvent. The gateway still terminates the public
// POST /webhooks/stripe route (so the URL Stripe is configured with
// never changes) but forwards the raw body and signature header here
// untouched — signature verification needs STRIPE_WEBHOOK_SECRET,
// which only billing holds.
IngestStripeWebhook(ctx context.Context, in *IngestStripeWebhookRequest, opts ...grpc.CallOption) (*IngestStripeWebhookResponse, error)
// CheckAndIncrementUsage replaces the daily-cap check + db.
// IncrementDailyUsage call in Handlers.Chat. Called by the agent
// service once per chat turn, after the message is accepted and
// before the agent run starts (same ordering as the monolith).
CheckAndIncrementUsage(ctx context.Context, in *CheckAndIncrementUsageRequest, opts ...grpc.CallOption) (*CheckAndIncrementUsageResponse, error)
// GetDailyUsage replaces db.DailyUsage — a read-only lookup (no
// increment) used by the gateway's /subscription page to show
// today's count without miscounting it as a sent message.
GetDailyUsage(ctx context.Context, in *GetDailyUsageRequest, opts ...grpc.CallOption) (*GetDailyUsageResponse, error)
}
type billingServiceClient struct {
cc grpc.ClientConnInterface
}
func NewBillingServiceClient(cc grpc.ClientConnInterface) BillingServiceClient {
return &billingServiceClient{cc}
}
func (c *billingServiceClient) GetOrCreateSubscription(ctx context.Context, in *GetOrCreateSubscriptionRequest, opts ...grpc.CallOption) (*Subscription, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(Subscription)
err := c.cc.Invoke(ctx, BillingService_GetOrCreateSubscription_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *billingServiceClient) GetPlanCatalog(ctx context.Context, in *GetPlanCatalogRequest, opts ...grpc.CallOption) (*GetPlanCatalogResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetPlanCatalogResponse)
err := c.cc.Invoke(ctx, BillingService_GetPlanCatalog_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *billingServiceClient) CreateCheckoutSession(ctx context.Context, in *CreateCheckoutSessionRequest, opts ...grpc.CallOption) (*CreateCheckoutSessionResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(CreateCheckoutSessionResponse)
err := c.cc.Invoke(ctx, BillingService_CreateCheckoutSession_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *billingServiceClient) SyncCheckoutSession(ctx context.Context, in *SyncCheckoutSessionRequest, opts ...grpc.CallOption) (*Subscription, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(Subscription)
err := c.cc.Invoke(ctx, BillingService_SyncCheckoutSession_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *billingServiceClient) CreateBillingPortalSession(ctx context.Context, in *CreateBillingPortalSessionRequest, opts ...grpc.CallOption) (*CreateBillingPortalSessionResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(CreateBillingPortalSessionResponse)
err := c.cc.Invoke(ctx, BillingService_CreateBillingPortalSession_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *billingServiceClient) IngestStripeWebhook(ctx context.Context, in *IngestStripeWebhookRequest, opts ...grpc.CallOption) (*IngestStripeWebhookResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(IngestStripeWebhookResponse)
err := c.cc.Invoke(ctx, BillingService_IngestStripeWebhook_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *billingServiceClient) CheckAndIncrementUsage(ctx context.Context, in *CheckAndIncrementUsageRequest, opts ...grpc.CallOption) (*CheckAndIncrementUsageResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(CheckAndIncrementUsageResponse)
err := c.cc.Invoke(ctx, BillingService_CheckAndIncrementUsage_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *billingServiceClient) GetDailyUsage(ctx context.Context, in *GetDailyUsageRequest, opts ...grpc.CallOption) (*GetDailyUsageResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetDailyUsageResponse)
err := c.cc.Invoke(ctx, BillingService_GetDailyUsage_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// BillingServiceServer is the server API for BillingService service.
// All implementations must embed UnimplementedBillingServiceServer
// for forward compatibility.
type BillingServiceServer interface {
// GetOrCreateSubscription replaces db.GetOrCreateSubscription: lazily
// inserts the default free-plan row the first time a user's
// subscription is looked up.
GetOrCreateSubscription(context.Context, *GetOrCreateSubscriptionRequest) (*Subscription, error)
// GetPlanCatalog replaces billing.Catalog + billing.PlanPriceIDs for
// rendering /subscription — returns every plan and whether its Stripe
// price is currently configured (so an unconfigured plan renders as
// "Unavailable", same as today).
GetPlanCatalog(context.Context, *GetPlanCatalogRequest) (*GetPlanCatalogResponse, error)
// CreateCheckoutSession replaces Handlers.CreateCheckout.
CreateCheckoutSession(context.Context, *CreateCheckoutSessionRequest) (*CreateCheckoutSessionResponse, error)
// SyncCheckoutSession replaces Handlers.syncCheckoutSession, the
// fallback path SubscriptionSuccess uses when the webhook hasn't
// landed yet.
SyncCheckoutSession(context.Context, *SyncCheckoutSessionRequest) (*Subscription, error)
// CreateBillingPortalSession replaces Handlers.BillingPortal.
CreateBillingPortalSession(context.Context, *CreateBillingPortalSessionRequest) (*CreateBillingPortalSessionResponse, error)
// IngestStripeWebhook replaces Handlers.StripeWebhook /
// applyStripeEvent. The gateway still terminates the public
// POST /webhooks/stripe route (so the URL Stripe is configured with
// never changes) but forwards the raw body and signature header here
// untouched — signature verification needs STRIPE_WEBHOOK_SECRET,
// which only billing holds.
IngestStripeWebhook(context.Context, *IngestStripeWebhookRequest) (*IngestStripeWebhookResponse, error)
// CheckAndIncrementUsage replaces the daily-cap check + db.
// IncrementDailyUsage call in Handlers.Chat. Called by the agent
// service once per chat turn, after the message is accepted and
// before the agent run starts (same ordering as the monolith).
CheckAndIncrementUsage(context.Context, *CheckAndIncrementUsageRequest) (*CheckAndIncrementUsageResponse, error)
// GetDailyUsage replaces db.DailyUsage — a read-only lookup (no
// increment) used by the gateway's /subscription page to show
// today's count without miscounting it as a sent message.
GetDailyUsage(context.Context, *GetDailyUsageRequest) (*GetDailyUsageResponse, error)
mustEmbedUnimplementedBillingServiceServer()
}
// UnimplementedBillingServiceServer 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.
type UnimplementedBillingServiceServer struct{}
func (UnimplementedBillingServiceServer) GetOrCreateSubscription(context.Context, *GetOrCreateSubscriptionRequest) (*Subscription, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetOrCreateSubscription not implemented")
}
func (UnimplementedBillingServiceServer) GetPlanCatalog(context.Context, *GetPlanCatalogRequest) (*GetPlanCatalogResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetPlanCatalog not implemented")
}
func (UnimplementedBillingServiceServer) CreateCheckoutSession(context.Context, *CreateCheckoutSessionRequest) (*CreateCheckoutSessionResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateCheckoutSession not implemented")
}
func (UnimplementedBillingServiceServer) SyncCheckoutSession(context.Context, *SyncCheckoutSessionRequest) (*Subscription, error) {
return nil, status.Errorf(codes.Unimplemented, "method SyncCheckoutSession not implemented")
}
func (UnimplementedBillingServiceServer) CreateBillingPortalSession(context.Context, *CreateBillingPortalSessionRequest) (*CreateBillingPortalSessionResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateBillingPortalSession not implemented")
}
func (UnimplementedBillingServiceServer) IngestStripeWebhook(context.Context, *IngestStripeWebhookRequest) (*IngestStripeWebhookResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method IngestStripeWebhook not implemented")
}
func (UnimplementedBillingServiceServer) CheckAndIncrementUsage(context.Context, *CheckAndIncrementUsageRequest) (*CheckAndIncrementUsageResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CheckAndIncrementUsage not implemented")
}
func (UnimplementedBillingServiceServer) GetDailyUsage(context.Context, *GetDailyUsageRequest) (*GetDailyUsageResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetDailyUsage not implemented")
}
func (UnimplementedBillingServiceServer) mustEmbedUnimplementedBillingServiceServer() {}
func (UnimplementedBillingServiceServer) testEmbeddedByValue() {}
// UnsafeBillingServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to BillingServiceServer will
// result in compilation errors.
type UnsafeBillingServiceServer interface {
mustEmbedUnimplementedBillingServiceServer()
}
func RegisterBillingServiceServer(s grpc.ServiceRegistrar, srv BillingServiceServer) {
// If the following call pancis, it indicates UnimplementedBillingServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&BillingService_ServiceDesc, srv)
}
func _BillingService_GetOrCreateSubscription_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetOrCreateSubscriptionRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BillingServiceServer).GetOrCreateSubscription(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: BillingService_GetOrCreateSubscription_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BillingServiceServer).GetOrCreateSubscription(ctx, req.(*GetOrCreateSubscriptionRequest))
}
return interceptor(ctx, in, info, handler)
}
func _BillingService_GetPlanCatalog_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetPlanCatalogRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BillingServiceServer).GetPlanCatalog(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: BillingService_GetPlanCatalog_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BillingServiceServer).GetPlanCatalog(ctx, req.(*GetPlanCatalogRequest))
}
return interceptor(ctx, in, info, handler)
}
func _BillingService_CreateCheckoutSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateCheckoutSessionRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BillingServiceServer).CreateCheckoutSession(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: BillingService_CreateCheckoutSession_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BillingServiceServer).CreateCheckoutSession(ctx, req.(*CreateCheckoutSessionRequest))
}
return interceptor(ctx, in, info, handler)
}
func _BillingService_SyncCheckoutSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SyncCheckoutSessionRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BillingServiceServer).SyncCheckoutSession(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: BillingService_SyncCheckoutSession_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BillingServiceServer).SyncCheckoutSession(ctx, req.(*SyncCheckoutSessionRequest))
}
return interceptor(ctx, in, info, handler)
}
func _BillingService_CreateBillingPortalSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateBillingPortalSessionRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BillingServiceServer).CreateBillingPortalSession(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: BillingService_CreateBillingPortalSession_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BillingServiceServer).CreateBillingPortalSession(ctx, req.(*CreateBillingPortalSessionRequest))
}
return interceptor(ctx, in, info, handler)
}
func _BillingService_IngestStripeWebhook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(IngestStripeWebhookRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BillingServiceServer).IngestStripeWebhook(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: BillingService_IngestStripeWebhook_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BillingServiceServer).IngestStripeWebhook(ctx, req.(*IngestStripeWebhookRequest))
}
return interceptor(ctx, in, info, handler)
}
func _BillingService_CheckAndIncrementUsage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CheckAndIncrementUsageRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BillingServiceServer).CheckAndIncrementUsage(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: BillingService_CheckAndIncrementUsage_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BillingServiceServer).CheckAndIncrementUsage(ctx, req.(*CheckAndIncrementUsageRequest))
}
return interceptor(ctx, in, info, handler)
}
func _BillingService_GetDailyUsage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetDailyUsageRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BillingServiceServer).GetDailyUsage(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: BillingService_GetDailyUsage_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BillingServiceServer).GetDailyUsage(ctx, req.(*GetDailyUsageRequest))
}
return interceptor(ctx, in, info, handler)
}
// BillingService_ServiceDesc is the grpc.ServiceDesc for BillingService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var BillingService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "enkly.billing.v1.BillingService",
HandlerType: (*BillingServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetOrCreateSubscription",
Handler: _BillingService_GetOrCreateSubscription_Handler,
},
{
MethodName: "GetPlanCatalog",
Handler: _BillingService_GetPlanCatalog_Handler,
},
{
MethodName: "CreateCheckoutSession",
Handler: _BillingService_CreateCheckoutSession_Handler,
},
{
MethodName: "SyncCheckoutSession",
Handler: _BillingService_SyncCheckoutSession_Handler,
},
{
MethodName: "CreateBillingPortalSession",
Handler: _BillingService_CreateBillingPortalSession_Handler,
},
{
MethodName: "IngestStripeWebhook",
Handler: _BillingService_IngestStripeWebhook_Handler,
},
{
MethodName: "CheckAndIncrementUsage",
Handler: _BillingService_CheckAndIncrementUsage_Handler,
},
{
MethodName: "GetDailyUsage",
Handler: _BillingService_GetDailyUsage_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "billing/v1/billing.proto",
}

301
gen/common/v1/common.pb.go Normal file
View File

@@ -0,0 +1,301 @@
// Package common holds message types shared across every enkly bounded
// context's gRPC API, so each context's own .proto only needs to import
// this one file instead of depending on each other directly.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.34.2
// protoc v3.21.12
// source: common/v1/common.proto
package commonv1
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// Money is a decimal amount in the smallest unit of currency (cents),
// matching how internal/billing.Info prices plans today (EUR integer
// amounts) without pulling in a floating point rounding bug.
type Money struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
MinorUnits int64 `protobuf:"varint,1,opt,name=minor_units,json=minorUnits,proto3" json:"minor_units,omitempty"` // e.g. 500 = 5.00
CurrencyCode string `protobuf:"bytes,2,opt,name=currency_code,json=currencyCode,proto3" json:"currency_code,omitempty"` // ISO 4217, e.g. "EUR"
}
func (x *Money) Reset() {
*x = Money{}
if protoimpl.UnsafeEnabled {
mi := &file_common_v1_common_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Money) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Money) ProtoMessage() {}
func (x *Money) ProtoReflect() protoreflect.Message {
mi := &file_common_v1_common_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Money.ProtoReflect.Descriptor instead.
func (*Money) Descriptor() ([]byte, []int) {
return file_common_v1_common_proto_rawDescGZIP(), []int{0}
}
func (x *Money) GetMinorUnits() int64 {
if x != nil {
return x.MinorUnits
}
return 0
}
func (x *Money) GetCurrencyCode() string {
if x != nil {
return x.CurrencyCode
}
return ""
}
// PageRequest / PageResponse: not used by today's list endpoints (the
// monolith never paginates conversations or messages), reserved so a
// service can add pagination later without a breaking proto change.
type PageRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
}
func (x *PageRequest) Reset() {
*x = PageRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_common_v1_common_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *PageRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PageRequest) ProtoMessage() {}
func (x *PageRequest) ProtoReflect() protoreflect.Message {
mi := &file_common_v1_common_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use PageRequest.ProtoReflect.Descriptor instead.
func (*PageRequest) Descriptor() ([]byte, []int) {
return file_common_v1_common_proto_rawDescGZIP(), []int{1}
}
func (x *PageRequest) GetPageSize() int32 {
if x != nil {
return x.PageSize
}
return 0
}
func (x *PageRequest) GetPageToken() string {
if x != nil {
return x.PageToken
}
return ""
}
type PageResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
NextPageToken string `protobuf:"bytes,1,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
}
func (x *PageResponse) Reset() {
*x = PageResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_common_v1_common_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *PageResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PageResponse) ProtoMessage() {}
func (x *PageResponse) ProtoReflect() protoreflect.Message {
mi := &file_common_v1_common_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use PageResponse.ProtoReflect.Descriptor instead.
func (*PageResponse) Descriptor() ([]byte, []int) {
return file_common_v1_common_proto_rawDescGZIP(), []int{2}
}
func (x *PageResponse) GetNextPageToken() string {
if x != nil {
return x.NextPageToken
}
return ""
}
var File_common_v1_common_proto protoreflect.FileDescriptor
var file_common_v1_common_proto_rawDesc = []byte{
0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d,
0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x65, 0x6e, 0x6b, 0x6c, 0x79, 0x2e,
0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x22, 0x4d, 0x0a, 0x05, 0x4d, 0x6f, 0x6e,
0x65, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x5f, 0x75, 0x6e, 0x69, 0x74,
0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x55, 0x6e,
0x69, 0x74, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x5f,
0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x75, 0x72, 0x72,
0x65, 0x6e, 0x63, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x22, 0x49, 0x0a, 0x0b, 0x50, 0x61, 0x67, 0x65,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f,
0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65,
0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b,
0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f,
0x6b, 0x65, 0x6e, 0x22, 0x36, 0x0a, 0x0c, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65,
0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65,
0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x1e, 0x5a, 0x1c, 0x65,
0x6e, 0x6b, 0x6c, 0x79, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f,
0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
}
var (
file_common_v1_common_proto_rawDescOnce sync.Once
file_common_v1_common_proto_rawDescData = file_common_v1_common_proto_rawDesc
)
func file_common_v1_common_proto_rawDescGZIP() []byte {
file_common_v1_common_proto_rawDescOnce.Do(func() {
file_common_v1_common_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_v1_common_proto_rawDescData)
})
return file_common_v1_common_proto_rawDescData
}
var file_common_v1_common_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_common_v1_common_proto_goTypes = []any{
(*Money)(nil), // 0: enkly.common.v1.Money
(*PageRequest)(nil), // 1: enkly.common.v1.PageRequest
(*PageResponse)(nil), // 2: enkly.common.v1.PageResponse
}
var file_common_v1_common_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_common_v1_common_proto_init() }
func file_common_v1_common_proto_init() {
if File_common_v1_common_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_common_v1_common_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*Money); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_common_v1_common_proto_msgTypes[1].Exporter = func(v any, i int) any {
switch v := v.(*PageRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_common_v1_common_proto_msgTypes[2].Exporter = func(v any, i int) any {
switch v := v.(*PageResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_common_v1_common_proto_rawDesc,
NumEnums: 0,
NumMessages: 3,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_common_v1_common_proto_goTypes,
DependencyIndexes: file_common_v1_common_proto_depIdxs,
MessageInfos: file_common_v1_common_proto_msgTypes,
}.Build()
File_common_v1_common_proto = out.File
file_common_v1_common_proto_rawDesc = nil
file_common_v1_common_proto_goTypes = nil
file_common_v1_common_proto_depIdxs = nil
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,516 @@
// Package conversation is the Conversation bounded context: chat threads
// and their messages/tool-call audit log. System of record for
// `conversations`, `messages` and `tool_calls` (see
// services/conversation/migrations/0001_init.sql).
//
// Mirrors internal/db/conversations.go, called both by the gateway
// (listing/renaming/deleting threads, loading history to render) and by
// the agent service (appending messages as a run proceeds).
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc v3.21.12
// source: conversation/v1/conversation.proto
package conversationv1
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
ConversationService_CreateConversation_FullMethodName = "/enkly.conversation.v1.ConversationService/CreateConversation"
ConversationService_GetConversation_FullMethodName = "/enkly.conversation.v1.ConversationService/GetConversation"
ConversationService_ListConversations_FullMethodName = "/enkly.conversation.v1.ConversationService/ListConversations"
ConversationService_MostRecentConversation_FullMethodName = "/enkly.conversation.v1.ConversationService/MostRecentConversation"
ConversationService_RenameConversation_FullMethodName = "/enkly.conversation.v1.ConversationService/RenameConversation"
ConversationService_AutoTitleConversation_FullMethodName = "/enkly.conversation.v1.ConversationService/AutoTitleConversation"
ConversationService_DeleteConversation_FullMethodName = "/enkly.conversation.v1.ConversationService/DeleteConversation"
ConversationService_CountMessages_FullMethodName = "/enkly.conversation.v1.ConversationService/CountMessages"
ConversationService_AddMessage_FullMethodName = "/enkly.conversation.v1.ConversationService/AddMessage"
ConversationService_ListMessages_FullMethodName = "/enkly.conversation.v1.ConversationService/ListMessages"
ConversationService_AddToolCall_FullMethodName = "/enkly.conversation.v1.ConversationService/AddToolCall"
)
// ConversationServiceClient is the client API for ConversationService 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.
type ConversationServiceClient interface {
CreateConversation(ctx context.Context, in *CreateConversationRequest, opts ...grpc.CallOption) (*Conversation, error)
GetConversation(ctx context.Context, in *GetConversationRequest, opts ...grpc.CallOption) (*Conversation, error)
ListConversations(ctx context.Context, in *ListConversationsRequest, opts ...grpc.CallOption) (*ListConversationsResponse, error)
MostRecentConversation(ctx context.Context, in *MostRecentConversationRequest, opts ...grpc.CallOption) (*Conversation, error)
RenameConversation(ctx context.Context, in *RenameConversationRequest, opts ...grpc.CallOption) (*Conversation, error)
// AutoTitleConversation replaces db.AutoTitleConversation: sets the
// title from the first prompt only if the conversation still has the
// default title (returns retitled=true when it actually changed it).
AutoTitleConversation(ctx context.Context, in *AutoTitleConversationRequest, opts ...grpc.CallOption) (*AutoTitleConversationResponse, error)
DeleteConversation(ctx context.Context, in *DeleteConversationRequest, opts ...grpc.CallOption) (*DeleteConversationResponse, error)
CountMessages(ctx context.Context, in *CountMessagesRequest, opts ...grpc.CallOption) (*CountMessagesResponse, error)
AddMessage(ctx context.Context, in *AddMessageRequest, opts ...grpc.CallOption) (*Message, error)
ListMessages(ctx context.Context, in *ListMessagesRequest, opts ...grpc.CallOption) (*ListMessagesResponse, error)
AddToolCall(ctx context.Context, in *AddToolCallRequest, opts ...grpc.CallOption) (*AddToolCallResponse, error)
}
type conversationServiceClient struct {
cc grpc.ClientConnInterface
}
func NewConversationServiceClient(cc grpc.ClientConnInterface) ConversationServiceClient {
return &conversationServiceClient{cc}
}
func (c *conversationServiceClient) CreateConversation(ctx context.Context, in *CreateConversationRequest, opts ...grpc.CallOption) (*Conversation, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(Conversation)
err := c.cc.Invoke(ctx, ConversationService_CreateConversation_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *conversationServiceClient) GetConversation(ctx context.Context, in *GetConversationRequest, opts ...grpc.CallOption) (*Conversation, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(Conversation)
err := c.cc.Invoke(ctx, ConversationService_GetConversation_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *conversationServiceClient) ListConversations(ctx context.Context, in *ListConversationsRequest, opts ...grpc.CallOption) (*ListConversationsResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ListConversationsResponse)
err := c.cc.Invoke(ctx, ConversationService_ListConversations_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *conversationServiceClient) MostRecentConversation(ctx context.Context, in *MostRecentConversationRequest, opts ...grpc.CallOption) (*Conversation, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(Conversation)
err := c.cc.Invoke(ctx, ConversationService_MostRecentConversation_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *conversationServiceClient) RenameConversation(ctx context.Context, in *RenameConversationRequest, opts ...grpc.CallOption) (*Conversation, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(Conversation)
err := c.cc.Invoke(ctx, ConversationService_RenameConversation_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *conversationServiceClient) AutoTitleConversation(ctx context.Context, in *AutoTitleConversationRequest, opts ...grpc.CallOption) (*AutoTitleConversationResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(AutoTitleConversationResponse)
err := c.cc.Invoke(ctx, ConversationService_AutoTitleConversation_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *conversationServiceClient) DeleteConversation(ctx context.Context, in *DeleteConversationRequest, opts ...grpc.CallOption) (*DeleteConversationResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(DeleteConversationResponse)
err := c.cc.Invoke(ctx, ConversationService_DeleteConversation_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *conversationServiceClient) CountMessages(ctx context.Context, in *CountMessagesRequest, opts ...grpc.CallOption) (*CountMessagesResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(CountMessagesResponse)
err := c.cc.Invoke(ctx, ConversationService_CountMessages_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *conversationServiceClient) AddMessage(ctx context.Context, in *AddMessageRequest, opts ...grpc.CallOption) (*Message, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(Message)
err := c.cc.Invoke(ctx, ConversationService_AddMessage_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *conversationServiceClient) ListMessages(ctx context.Context, in *ListMessagesRequest, opts ...grpc.CallOption) (*ListMessagesResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ListMessagesResponse)
err := c.cc.Invoke(ctx, ConversationService_ListMessages_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *conversationServiceClient) AddToolCall(ctx context.Context, in *AddToolCallRequest, opts ...grpc.CallOption) (*AddToolCallResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(AddToolCallResponse)
err := c.cc.Invoke(ctx, ConversationService_AddToolCall_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// ConversationServiceServer is the server API for ConversationService service.
// All implementations must embed UnimplementedConversationServiceServer
// for forward compatibility.
type ConversationServiceServer interface {
CreateConversation(context.Context, *CreateConversationRequest) (*Conversation, error)
GetConversation(context.Context, *GetConversationRequest) (*Conversation, error)
ListConversations(context.Context, *ListConversationsRequest) (*ListConversationsResponse, error)
MostRecentConversation(context.Context, *MostRecentConversationRequest) (*Conversation, error)
RenameConversation(context.Context, *RenameConversationRequest) (*Conversation, error)
// AutoTitleConversation replaces db.AutoTitleConversation: sets the
// title from the first prompt only if the conversation still has the
// default title (returns retitled=true when it actually changed it).
AutoTitleConversation(context.Context, *AutoTitleConversationRequest) (*AutoTitleConversationResponse, error)
DeleteConversation(context.Context, *DeleteConversationRequest) (*DeleteConversationResponse, error)
CountMessages(context.Context, *CountMessagesRequest) (*CountMessagesResponse, error)
AddMessage(context.Context, *AddMessageRequest) (*Message, error)
ListMessages(context.Context, *ListMessagesRequest) (*ListMessagesResponse, error)
AddToolCall(context.Context, *AddToolCallRequest) (*AddToolCallResponse, error)
mustEmbedUnimplementedConversationServiceServer()
}
// UnimplementedConversationServiceServer 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.
type UnimplementedConversationServiceServer struct{}
func (UnimplementedConversationServiceServer) CreateConversation(context.Context, *CreateConversationRequest) (*Conversation, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateConversation not implemented")
}
func (UnimplementedConversationServiceServer) GetConversation(context.Context, *GetConversationRequest) (*Conversation, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetConversation not implemented")
}
func (UnimplementedConversationServiceServer) ListConversations(context.Context, *ListConversationsRequest) (*ListConversationsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListConversations not implemented")
}
func (UnimplementedConversationServiceServer) MostRecentConversation(context.Context, *MostRecentConversationRequest) (*Conversation, error) {
return nil, status.Errorf(codes.Unimplemented, "method MostRecentConversation not implemented")
}
func (UnimplementedConversationServiceServer) RenameConversation(context.Context, *RenameConversationRequest) (*Conversation, error) {
return nil, status.Errorf(codes.Unimplemented, "method RenameConversation not implemented")
}
func (UnimplementedConversationServiceServer) AutoTitleConversation(context.Context, *AutoTitleConversationRequest) (*AutoTitleConversationResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method AutoTitleConversation not implemented")
}
func (UnimplementedConversationServiceServer) DeleteConversation(context.Context, *DeleteConversationRequest) (*DeleteConversationResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteConversation not implemented")
}
func (UnimplementedConversationServiceServer) CountMessages(context.Context, *CountMessagesRequest) (*CountMessagesResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CountMessages not implemented")
}
func (UnimplementedConversationServiceServer) AddMessage(context.Context, *AddMessageRequest) (*Message, error) {
return nil, status.Errorf(codes.Unimplemented, "method AddMessage not implemented")
}
func (UnimplementedConversationServiceServer) ListMessages(context.Context, *ListMessagesRequest) (*ListMessagesResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListMessages not implemented")
}
func (UnimplementedConversationServiceServer) AddToolCall(context.Context, *AddToolCallRequest) (*AddToolCallResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method AddToolCall not implemented")
}
func (UnimplementedConversationServiceServer) mustEmbedUnimplementedConversationServiceServer() {}
func (UnimplementedConversationServiceServer) testEmbeddedByValue() {}
// UnsafeConversationServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ConversationServiceServer will
// result in compilation errors.
type UnsafeConversationServiceServer interface {
mustEmbedUnimplementedConversationServiceServer()
}
func RegisterConversationServiceServer(s grpc.ServiceRegistrar, srv ConversationServiceServer) {
// If the following call pancis, it indicates UnimplementedConversationServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&ConversationService_ServiceDesc, srv)
}
func _ConversationService_CreateConversation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateConversationRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ConversationServiceServer).CreateConversation(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ConversationService_CreateConversation_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ConversationServiceServer).CreateConversation(ctx, req.(*CreateConversationRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ConversationService_GetConversation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetConversationRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ConversationServiceServer).GetConversation(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ConversationService_GetConversation_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ConversationServiceServer).GetConversation(ctx, req.(*GetConversationRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ConversationService_ListConversations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListConversationsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ConversationServiceServer).ListConversations(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ConversationService_ListConversations_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ConversationServiceServer).ListConversations(ctx, req.(*ListConversationsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ConversationService_MostRecentConversation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MostRecentConversationRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ConversationServiceServer).MostRecentConversation(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ConversationService_MostRecentConversation_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ConversationServiceServer).MostRecentConversation(ctx, req.(*MostRecentConversationRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ConversationService_RenameConversation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(RenameConversationRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ConversationServiceServer).RenameConversation(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ConversationService_RenameConversation_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ConversationServiceServer).RenameConversation(ctx, req.(*RenameConversationRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ConversationService_AutoTitleConversation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AutoTitleConversationRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ConversationServiceServer).AutoTitleConversation(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ConversationService_AutoTitleConversation_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ConversationServiceServer).AutoTitleConversation(ctx, req.(*AutoTitleConversationRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ConversationService_DeleteConversation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteConversationRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ConversationServiceServer).DeleteConversation(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ConversationService_DeleteConversation_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ConversationServiceServer).DeleteConversation(ctx, req.(*DeleteConversationRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ConversationService_CountMessages_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CountMessagesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ConversationServiceServer).CountMessages(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ConversationService_CountMessages_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ConversationServiceServer).CountMessages(ctx, req.(*CountMessagesRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ConversationService_AddMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AddMessageRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ConversationServiceServer).AddMessage(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ConversationService_AddMessage_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ConversationServiceServer).AddMessage(ctx, req.(*AddMessageRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ConversationService_ListMessages_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListMessagesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ConversationServiceServer).ListMessages(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ConversationService_ListMessages_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ConversationServiceServer).ListMessages(ctx, req.(*ListMessagesRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ConversationService_AddToolCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AddToolCallRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ConversationServiceServer).AddToolCall(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ConversationService_AddToolCall_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ConversationServiceServer).AddToolCall(ctx, req.(*AddToolCallRequest))
}
return interceptor(ctx, in, info, handler)
}
// ConversationService_ServiceDesc is the grpc.ServiceDesc for ConversationService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ConversationService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "enkly.conversation.v1.ConversationService",
HandlerType: (*ConversationServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "CreateConversation",
Handler: _ConversationService_CreateConversation_Handler,
},
{
MethodName: "GetConversation",
Handler: _ConversationService_GetConversation_Handler,
},
{
MethodName: "ListConversations",
Handler: _ConversationService_ListConversations_Handler,
},
{
MethodName: "MostRecentConversation",
Handler: _ConversationService_MostRecentConversation_Handler,
},
{
MethodName: "RenameConversation",
Handler: _ConversationService_RenameConversation_Handler,
},
{
MethodName: "AutoTitleConversation",
Handler: _ConversationService_AutoTitleConversation_Handler,
},
{
MethodName: "DeleteConversation",
Handler: _ConversationService_DeleteConversation_Handler,
},
{
MethodName: "CountMessages",
Handler: _ConversationService_CountMessages_Handler,
},
{
MethodName: "AddMessage",
Handler: _ConversationService_AddMessage_Handler,
},
{
MethodName: "ListMessages",
Handler: _ConversationService_ListMessages_Handler,
},
{
MethodName: "AddToolCall",
Handler: _ConversationService_AddToolCall_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "conversation/v1/conversation.proto",
}

1632
gen/iam/v1/iam.pb.go Normal file

File diff suppressed because it is too large Load Diff

523
gen/iam/v1/iam_grpc.pb.go Normal file
View File

@@ -0,0 +1,523 @@
// Package iam is the Identity & Access bounded context: accounts,
// sessions, email verification and password reset. It is the system of
// record for `users`, `sessions`, `email_verification_codes` and
// `password_reset_tokens` (see services/iam/migrations/0001_init.sql) —
// no other service may read or write those tables directly.
//
// Mirrors the monolith's internal/handlers/auth.go + internal/db/users.go
// + internal/auth/*.go one-for-one; see each rpc's comment for the
// handler function it replaces.
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc v3.21.12
// source: iam/v1/iam.proto
package iamv1
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
IAMService_SignUp_FullMethodName = "/enkly.iam.v1.IAMService/SignUp"
IAMService_ResendVerification_FullMethodName = "/enkly.iam.v1.IAMService/ResendVerification"
IAMService_VerifyEmail_FullMethodName = "/enkly.iam.v1.IAMService/VerifyEmail"
IAMService_Login_FullMethodName = "/enkly.iam.v1.IAMService/Login"
IAMService_Logout_FullMethodName = "/enkly.iam.v1.IAMService/Logout"
IAMService_ValidateSession_FullMethodName = "/enkly.iam.v1.IAMService/ValidateSession"
IAMService_ForgotPassword_FullMethodName = "/enkly.iam.v1.IAMService/ForgotPassword"
IAMService_CheckPasswordResetToken_FullMethodName = "/enkly.iam.v1.IAMService/CheckPasswordResetToken"
IAMService_ResetPassword_FullMethodName = "/enkly.iam.v1.IAMService/ResetPassword"
IAMService_GetUser_FullMethodName = "/enkly.iam.v1.IAMService/GetUser"
)
// IAMServiceClient is the client API for IAMService 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.
type IAMServiceClient interface {
// SignUp replaces Handlers.Signup. Validates and normalizes the email,
// hashes the password (PBKDF2, see internal/auth/password.go), creates
// the account (or silently reuses an existing unverified one — same
// anti-enumeration behavior as the monolith), issues a verification
// code and publishes an iam.verification_code.issued event for the
// notification service to deliver it. Never returns whether the email
// already existed.
SignUp(ctx context.Context, in *SignUpRequest, opts ...grpc.CallOption) (*SignUpResponse, error)
// ResendVerification replaces Handlers.ResendVerification.
ResendVerification(ctx context.Context, in *ResendVerificationRequest, opts ...grpc.CallOption) (*ResendVerificationResponse, error)
// VerifyEmail replaces Handlers.VerifyEmail.
VerifyEmail(ctx context.Context, in *VerifyEmailRequest, opts ...grpc.CallOption) (*VerifyEmailResponse, error)
// Login replaces Handlers.Login: verifies credentials (constant-time
// against a dummy hash for unknown emails) and, on success, mints a
// session and returns its raw token for the gateway to set as a
// cookie. Never persists the raw token — only its SHA-256 hash.
Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error)
// Logout replaces Handlers.Logout: deletes the session row for the
// given raw session token.
Logout(ctx context.Context, in *LogoutRequest, opts ...grpc.CallOption) (*LogoutResponse, error)
// ValidateSession replaces the session half of Handlers.RequireAuth /
// db.GetSessionUser. Called by the gateway on every authenticated
// request.
ValidateSession(ctx context.Context, in *ValidateSessionRequest, opts ...grpc.CallOption) (*ValidateSessionResponse, error)
// ForgotPassword replaces Handlers.ForgotPassword.
ForgotPassword(ctx context.Context, in *ForgotPasswordRequest, opts ...grpc.CallOption) (*ForgotPasswordResponse, error)
// CheckPasswordResetToken replaces the GET-time validity check in
// Handlers.ResetPasswordPage (db.PasswordResetTokenValid).
CheckPasswordResetToken(ctx context.Context, in *CheckPasswordResetTokenRequest, opts ...grpc.CallOption) (*CheckPasswordResetTokenResponse, error)
// ResetPassword replaces Handlers.ResetPassword. Also revokes every
// session for the account (db.UpdatePassword's cascade delete).
ResetPassword(ctx context.Context, in *ResetPasswordRequest, opts ...grpc.CallOption) (*ResetPasswordResponse, error)
// GetUser is used by other services (e.g. billing, when it only has a
// user_id) to resolve an email address. Never returns PasswordHash.
GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*User, error)
}
type iAMServiceClient struct {
cc grpc.ClientConnInterface
}
func NewIAMServiceClient(cc grpc.ClientConnInterface) IAMServiceClient {
return &iAMServiceClient{cc}
}
func (c *iAMServiceClient) SignUp(ctx context.Context, in *SignUpRequest, opts ...grpc.CallOption) (*SignUpResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(SignUpResponse)
err := c.cc.Invoke(ctx, IAMService_SignUp_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *iAMServiceClient) ResendVerification(ctx context.Context, in *ResendVerificationRequest, opts ...grpc.CallOption) (*ResendVerificationResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ResendVerificationResponse)
err := c.cc.Invoke(ctx, IAMService_ResendVerification_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *iAMServiceClient) VerifyEmail(ctx context.Context, in *VerifyEmailRequest, opts ...grpc.CallOption) (*VerifyEmailResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(VerifyEmailResponse)
err := c.cc.Invoke(ctx, IAMService_VerifyEmail_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *iAMServiceClient) Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(LoginResponse)
err := c.cc.Invoke(ctx, IAMService_Login_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *iAMServiceClient) Logout(ctx context.Context, in *LogoutRequest, opts ...grpc.CallOption) (*LogoutResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(LogoutResponse)
err := c.cc.Invoke(ctx, IAMService_Logout_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *iAMServiceClient) ValidateSession(ctx context.Context, in *ValidateSessionRequest, opts ...grpc.CallOption) (*ValidateSessionResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ValidateSessionResponse)
err := c.cc.Invoke(ctx, IAMService_ValidateSession_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *iAMServiceClient) ForgotPassword(ctx context.Context, in *ForgotPasswordRequest, opts ...grpc.CallOption) (*ForgotPasswordResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ForgotPasswordResponse)
err := c.cc.Invoke(ctx, IAMService_ForgotPassword_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *iAMServiceClient) CheckPasswordResetToken(ctx context.Context, in *CheckPasswordResetTokenRequest, opts ...grpc.CallOption) (*CheckPasswordResetTokenResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(CheckPasswordResetTokenResponse)
err := c.cc.Invoke(ctx, IAMService_CheckPasswordResetToken_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *iAMServiceClient) ResetPassword(ctx context.Context, in *ResetPasswordRequest, opts ...grpc.CallOption) (*ResetPasswordResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ResetPasswordResponse)
err := c.cc.Invoke(ctx, IAMService_ResetPassword_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *iAMServiceClient) GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*User, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(User)
err := c.cc.Invoke(ctx, IAMService_GetUser_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// IAMServiceServer is the server API for IAMService service.
// All implementations must embed UnimplementedIAMServiceServer
// for forward compatibility.
type IAMServiceServer interface {
// SignUp replaces Handlers.Signup. Validates and normalizes the email,
// hashes the password (PBKDF2, see internal/auth/password.go), creates
// the account (or silently reuses an existing unverified one — same
// anti-enumeration behavior as the monolith), issues a verification
// code and publishes an iam.verification_code.issued event for the
// notification service to deliver it. Never returns whether the email
// already existed.
SignUp(context.Context, *SignUpRequest) (*SignUpResponse, error)
// ResendVerification replaces Handlers.ResendVerification.
ResendVerification(context.Context, *ResendVerificationRequest) (*ResendVerificationResponse, error)
// VerifyEmail replaces Handlers.VerifyEmail.
VerifyEmail(context.Context, *VerifyEmailRequest) (*VerifyEmailResponse, error)
// Login replaces Handlers.Login: verifies credentials (constant-time
// against a dummy hash for unknown emails) and, on success, mints a
// session and returns its raw token for the gateway to set as a
// cookie. Never persists the raw token — only its SHA-256 hash.
Login(context.Context, *LoginRequest) (*LoginResponse, error)
// Logout replaces Handlers.Logout: deletes the session row for the
// given raw session token.
Logout(context.Context, *LogoutRequest) (*LogoutResponse, error)
// ValidateSession replaces the session half of Handlers.RequireAuth /
// db.GetSessionUser. Called by the gateway on every authenticated
// request.
ValidateSession(context.Context, *ValidateSessionRequest) (*ValidateSessionResponse, error)
// ForgotPassword replaces Handlers.ForgotPassword.
ForgotPassword(context.Context, *ForgotPasswordRequest) (*ForgotPasswordResponse, error)
// CheckPasswordResetToken replaces the GET-time validity check in
// Handlers.ResetPasswordPage (db.PasswordResetTokenValid).
CheckPasswordResetToken(context.Context, *CheckPasswordResetTokenRequest) (*CheckPasswordResetTokenResponse, error)
// ResetPassword replaces Handlers.ResetPassword. Also revokes every
// session for the account (db.UpdatePassword's cascade delete).
ResetPassword(context.Context, *ResetPasswordRequest) (*ResetPasswordResponse, error)
// GetUser is used by other services (e.g. billing, when it only has a
// user_id) to resolve an email address. Never returns PasswordHash.
GetUser(context.Context, *GetUserRequest) (*User, error)
mustEmbedUnimplementedIAMServiceServer()
}
// UnimplementedIAMServiceServer 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.
type UnimplementedIAMServiceServer struct{}
func (UnimplementedIAMServiceServer) SignUp(context.Context, *SignUpRequest) (*SignUpResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SignUp not implemented")
}
func (UnimplementedIAMServiceServer) ResendVerification(context.Context, *ResendVerificationRequest) (*ResendVerificationResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ResendVerification not implemented")
}
func (UnimplementedIAMServiceServer) VerifyEmail(context.Context, *VerifyEmailRequest) (*VerifyEmailResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method VerifyEmail not implemented")
}
func (UnimplementedIAMServiceServer) Login(context.Context, *LoginRequest) (*LoginResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Login not implemented")
}
func (UnimplementedIAMServiceServer) Logout(context.Context, *LogoutRequest) (*LogoutResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Logout not implemented")
}
func (UnimplementedIAMServiceServer) ValidateSession(context.Context, *ValidateSessionRequest) (*ValidateSessionResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ValidateSession not implemented")
}
func (UnimplementedIAMServiceServer) ForgotPassword(context.Context, *ForgotPasswordRequest) (*ForgotPasswordResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ForgotPassword not implemented")
}
func (UnimplementedIAMServiceServer) CheckPasswordResetToken(context.Context, *CheckPasswordResetTokenRequest) (*CheckPasswordResetTokenResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CheckPasswordResetToken not implemented")
}
func (UnimplementedIAMServiceServer) ResetPassword(context.Context, *ResetPasswordRequest) (*ResetPasswordResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ResetPassword not implemented")
}
func (UnimplementedIAMServiceServer) GetUser(context.Context, *GetUserRequest) (*User, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetUser not implemented")
}
func (UnimplementedIAMServiceServer) mustEmbedUnimplementedIAMServiceServer() {}
func (UnimplementedIAMServiceServer) testEmbeddedByValue() {}
// UnsafeIAMServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to IAMServiceServer will
// result in compilation errors.
type UnsafeIAMServiceServer interface {
mustEmbedUnimplementedIAMServiceServer()
}
func RegisterIAMServiceServer(s grpc.ServiceRegistrar, srv IAMServiceServer) {
// If the following call pancis, it indicates UnimplementedIAMServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&IAMService_ServiceDesc, srv)
}
func _IAMService_SignUp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SignUpRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(IAMServiceServer).SignUp(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: IAMService_SignUp_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(IAMServiceServer).SignUp(ctx, req.(*SignUpRequest))
}
return interceptor(ctx, in, info, handler)
}
func _IAMService_ResendVerification_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ResendVerificationRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(IAMServiceServer).ResendVerification(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: IAMService_ResendVerification_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(IAMServiceServer).ResendVerification(ctx, req.(*ResendVerificationRequest))
}
return interceptor(ctx, in, info, handler)
}
func _IAMService_VerifyEmail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(VerifyEmailRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(IAMServiceServer).VerifyEmail(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: IAMService_VerifyEmail_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(IAMServiceServer).VerifyEmail(ctx, req.(*VerifyEmailRequest))
}
return interceptor(ctx, in, info, handler)
}
func _IAMService_Login_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(LoginRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(IAMServiceServer).Login(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: IAMService_Login_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(IAMServiceServer).Login(ctx, req.(*LoginRequest))
}
return interceptor(ctx, in, info, handler)
}
func _IAMService_Logout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(LogoutRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(IAMServiceServer).Logout(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: IAMService_Logout_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(IAMServiceServer).Logout(ctx, req.(*LogoutRequest))
}
return interceptor(ctx, in, info, handler)
}
func _IAMService_ValidateSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ValidateSessionRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(IAMServiceServer).ValidateSession(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: IAMService_ValidateSession_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(IAMServiceServer).ValidateSession(ctx, req.(*ValidateSessionRequest))
}
return interceptor(ctx, in, info, handler)
}
func _IAMService_ForgotPassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ForgotPasswordRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(IAMServiceServer).ForgotPassword(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: IAMService_ForgotPassword_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(IAMServiceServer).ForgotPassword(ctx, req.(*ForgotPasswordRequest))
}
return interceptor(ctx, in, info, handler)
}
func _IAMService_CheckPasswordResetToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CheckPasswordResetTokenRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(IAMServiceServer).CheckPasswordResetToken(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: IAMService_CheckPasswordResetToken_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(IAMServiceServer).CheckPasswordResetToken(ctx, req.(*CheckPasswordResetTokenRequest))
}
return interceptor(ctx, in, info, handler)
}
func _IAMService_ResetPassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ResetPasswordRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(IAMServiceServer).ResetPassword(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: IAMService_ResetPassword_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(IAMServiceServer).ResetPassword(ctx, req.(*ResetPasswordRequest))
}
return interceptor(ctx, in, info, handler)
}
func _IAMService_GetUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetUserRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(IAMServiceServer).GetUser(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: IAMService_GetUser_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(IAMServiceServer).GetUser(ctx, req.(*GetUserRequest))
}
return interceptor(ctx, in, info, handler)
}
// IAMService_ServiceDesc is the grpc.ServiceDesc for IAMService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var IAMService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "enkly.iam.v1.IAMService",
HandlerType: (*IAMServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "SignUp",
Handler: _IAMService_SignUp_Handler,
},
{
MethodName: "ResendVerification",
Handler: _IAMService_ResendVerification_Handler,
},
{
MethodName: "VerifyEmail",
Handler: _IAMService_VerifyEmail_Handler,
},
{
MethodName: "Login",
Handler: _IAMService_Login_Handler,
},
{
MethodName: "Logout",
Handler: _IAMService_Logout_Handler,
},
{
MethodName: "ValidateSession",
Handler: _IAMService_ValidateSession_Handler,
},
{
MethodName: "ForgotPassword",
Handler: _IAMService_ForgotPassword_Handler,
},
{
MethodName: "CheckPasswordResetToken",
Handler: _IAMService_CheckPasswordResetToken_Handler,
},
{
MethodName: "ResetPassword",
Handler: _IAMService_ResetPassword_Handler,
},
{
MethodName: "GetUser",
Handler: _IAMService_GetUser_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "iam/v1/iam.proto",
}

View File

@@ -0,0 +1,765 @@
// Package knowledge is the Code Intelligence (RAG) bounded context:
// chunking, embedding (via the knowledge service's vLLM-backed embed client) and
// cosine-similarity search over workspace source files. System of
// record for the pgvector-backed `documents` table (see
// services/knowledge/migrations/0001_init.sql).
//
// Mirrors internal/rag/*.go. IndexDirectory (cmd/indexer) now walks the
// workspace through the workspace service instead of the local
// filesystem — see tools/indexer.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.34.2
// protoc v3.21.12
// source: knowledge/v1/knowledge.proto
package knowledgev1
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type CodeChunk struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
FilePath string `protobuf:"bytes,2,opt,name=file_path,json=filePath,proto3" json:"file_path,omitempty"`
ChunkIndex int32 `protobuf:"varint,3,opt,name=chunk_index,json=chunkIndex,proto3" json:"chunk_index,omitempty"`
Content string `protobuf:"bytes,4,opt,name=content,proto3" json:"content,omitempty"`
Distance float64 `protobuf:"fixed64,5,opt,name=distance,proto3" json:"distance,omitempty"` // cosine distance; lower = more relevant
}
func (x *CodeChunk) Reset() {
*x = CodeChunk{}
if protoimpl.UnsafeEnabled {
mi := &file_knowledge_v1_knowledge_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CodeChunk) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CodeChunk) ProtoMessage() {}
func (x *CodeChunk) ProtoReflect() protoreflect.Message {
mi := &file_knowledge_v1_knowledge_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CodeChunk.ProtoReflect.Descriptor instead.
func (*CodeChunk) Descriptor() ([]byte, []int) {
return file_knowledge_v1_knowledge_proto_rawDescGZIP(), []int{0}
}
func (x *CodeChunk) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
func (x *CodeChunk) GetFilePath() string {
if x != nil {
return x.FilePath
}
return ""
}
func (x *CodeChunk) GetChunkIndex() int32 {
if x != nil {
return x.ChunkIndex
}
return 0
}
func (x *CodeChunk) GetContent() string {
if x != nil {
return x.Content
}
return ""
}
func (x *CodeChunk) GetDistance() float64 {
if x != nil {
return x.Distance
}
return 0
}
type IndexFileRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
FilePath string `protobuf:"bytes,1,opt,name=file_path,json=filePath,proto3" json:"file_path,omitempty"`
Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
}
func (x *IndexFileRequest) Reset() {
*x = IndexFileRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_knowledge_v1_knowledge_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *IndexFileRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*IndexFileRequest) ProtoMessage() {}
func (x *IndexFileRequest) ProtoReflect() protoreflect.Message {
mi := &file_knowledge_v1_knowledge_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use IndexFileRequest.ProtoReflect.Descriptor instead.
func (*IndexFileRequest) Descriptor() ([]byte, []int) {
return file_knowledge_v1_knowledge_proto_rawDescGZIP(), []int{1}
}
func (x *IndexFileRequest) GetFilePath() string {
if x != nil {
return x.FilePath
}
return ""
}
func (x *IndexFileRequest) GetContent() string {
if x != nil {
return x.Content
}
return ""
}
type IndexFileResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ChunksIndexed int32 `protobuf:"varint,1,opt,name=chunks_indexed,json=chunksIndexed,proto3" json:"chunks_indexed,omitempty"`
ChunksSkipped int32 `protobuf:"varint,2,opt,name=chunks_skipped,json=chunksSkipped,proto3" json:"chunks_skipped,omitempty"` // unchanged content_hash
}
func (x *IndexFileResponse) Reset() {
*x = IndexFileResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_knowledge_v1_knowledge_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *IndexFileResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*IndexFileResponse) ProtoMessage() {}
func (x *IndexFileResponse) ProtoReflect() protoreflect.Message {
mi := &file_knowledge_v1_knowledge_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use IndexFileResponse.ProtoReflect.Descriptor instead.
func (*IndexFileResponse) Descriptor() ([]byte, []int) {
return file_knowledge_v1_knowledge_proto_rawDescGZIP(), []int{2}
}
func (x *IndexFileResponse) GetChunksIndexed() int32 {
if x != nil {
return x.ChunksIndexed
}
return 0
}
func (x *IndexFileResponse) GetChunksSkipped() int32 {
if x != nil {
return x.ChunksSkipped
}
return 0
}
type PruneMissingRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
KeepFilePaths []string `protobuf:"bytes,1,rep,name=keep_file_paths,json=keepFilePaths,proto3" json:"keep_file_paths,omitempty"`
}
func (x *PruneMissingRequest) Reset() {
*x = PruneMissingRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_knowledge_v1_knowledge_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *PruneMissingRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PruneMissingRequest) ProtoMessage() {}
func (x *PruneMissingRequest) ProtoReflect() protoreflect.Message {
mi := &file_knowledge_v1_knowledge_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use PruneMissingRequest.ProtoReflect.Descriptor instead.
func (*PruneMissingRequest) Descriptor() ([]byte, []int) {
return file_knowledge_v1_knowledge_proto_rawDescGZIP(), []int{3}
}
func (x *PruneMissingRequest) GetKeepFilePaths() []string {
if x != nil {
return x.KeepFilePaths
}
return nil
}
type PruneMissingResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
RowsDeleted int32 `protobuf:"varint,1,opt,name=rows_deleted,json=rowsDeleted,proto3" json:"rows_deleted,omitempty"`
}
func (x *PruneMissingResponse) Reset() {
*x = PruneMissingResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_knowledge_v1_knowledge_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *PruneMissingResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PruneMissingResponse) ProtoMessage() {}
func (x *PruneMissingResponse) ProtoReflect() protoreflect.Message {
mi := &file_knowledge_v1_knowledge_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use PruneMissingResponse.ProtoReflect.Descriptor instead.
func (*PruneMissingResponse) Descriptor() ([]byte, []int) {
return file_knowledge_v1_knowledge_proto_rawDescGZIP(), []int{4}
}
func (x *PruneMissingResponse) GetRowsDeleted() int32 {
if x != nil {
return x.RowsDeleted
}
return 0
}
type SearchRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"`
TopK int32 `protobuf:"varint,2,opt,name=top_k,json=topK,proto3" json:"top_k,omitempty"`
}
func (x *SearchRequest) Reset() {
*x = SearchRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_knowledge_v1_knowledge_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SearchRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SearchRequest) ProtoMessage() {}
func (x *SearchRequest) ProtoReflect() protoreflect.Message {
mi := &file_knowledge_v1_knowledge_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SearchRequest.ProtoReflect.Descriptor instead.
func (*SearchRequest) Descriptor() ([]byte, []int) {
return file_knowledge_v1_knowledge_proto_rawDescGZIP(), []int{5}
}
func (x *SearchRequest) GetQuery() string {
if x != nil {
return x.Query
}
return ""
}
func (x *SearchRequest) GetTopK() int32 {
if x != nil {
return x.TopK
}
return 0
}
type SearchResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Chunks []*CodeChunk `protobuf:"bytes,1,rep,name=chunks,proto3" json:"chunks,omitempty"`
}
func (x *SearchResponse) Reset() {
*x = SearchResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_knowledge_v1_knowledge_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SearchResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SearchResponse) ProtoMessage() {}
func (x *SearchResponse) ProtoReflect() protoreflect.Message {
mi := &file_knowledge_v1_knowledge_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SearchResponse.ProtoReflect.Descriptor instead.
func (*SearchResponse) Descriptor() ([]byte, []int) {
return file_knowledge_v1_knowledge_proto_rawDescGZIP(), []int{6}
}
func (x *SearchResponse) GetChunks() []*CodeChunk {
if x != nil {
return x.Chunks
}
return nil
}
type ListIndexedFilesRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Limit int32 `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"` // 0 = default (200)
}
func (x *ListIndexedFilesRequest) Reset() {
*x = ListIndexedFilesRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_knowledge_v1_knowledge_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ListIndexedFilesRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListIndexedFilesRequest) ProtoMessage() {}
func (x *ListIndexedFilesRequest) ProtoReflect() protoreflect.Message {
mi := &file_knowledge_v1_knowledge_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ListIndexedFilesRequest.ProtoReflect.Descriptor instead.
func (*ListIndexedFilesRequest) Descriptor() ([]byte, []int) {
return file_knowledge_v1_knowledge_proto_rawDescGZIP(), []int{7}
}
func (x *ListIndexedFilesRequest) GetLimit() int32 {
if x != nil {
return x.Limit
}
return 0
}
type ListIndexedFilesResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
FilePaths []string `protobuf:"bytes,1,rep,name=file_paths,json=filePaths,proto3" json:"file_paths,omitempty"`
}
func (x *ListIndexedFilesResponse) Reset() {
*x = ListIndexedFilesResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_knowledge_v1_knowledge_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ListIndexedFilesResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListIndexedFilesResponse) ProtoMessage() {}
func (x *ListIndexedFilesResponse) ProtoReflect() protoreflect.Message {
mi := &file_knowledge_v1_knowledge_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ListIndexedFilesResponse.ProtoReflect.Descriptor instead.
func (*ListIndexedFilesResponse) Descriptor() ([]byte, []int) {
return file_knowledge_v1_knowledge_proto_rawDescGZIP(), []int{8}
}
func (x *ListIndexedFilesResponse) GetFilePaths() []string {
if x != nil {
return x.FilePaths
}
return nil
}
var File_knowledge_v1_knowledge_proto protoreflect.FileDescriptor
var file_knowledge_v1_knowledge_proto_rawDesc = []byte{
0x0a, 0x1c, 0x6b, 0x6e, 0x6f, 0x77, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6b,
0x6e, 0x6f, 0x77, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12,
0x65, 0x6e, 0x6b, 0x6c, 0x79, 0x2e, 0x6b, 0x6e, 0x6f, 0x77, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x2e,
0x76, 0x31, 0x22, 0x8f, 0x01, 0x0a, 0x09, 0x43, 0x6f, 0x64, 0x65, 0x43, 0x68, 0x75, 0x6e, 0x6b,
0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64,
0x12, 0x1b, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x50, 0x61, 0x74, 0x68, 0x12, 0x1f, 0x0a,
0x0b, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x03, 0x20, 0x01,
0x28, 0x05, 0x52, 0x0a, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x18,
0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,
0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x69, 0x73, 0x74,
0x61, 0x6e, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x01, 0x52, 0x08, 0x64, 0x69, 0x73, 0x74,
0x61, 0x6e, 0x63, 0x65, 0x22, 0x49, 0x0a, 0x10, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x46, 0x69, 0x6c,
0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x65,
0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c,
0x65, 0x50, 0x61, 0x74, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74,
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22,
0x61, 0x0a, 0x11, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x5f, 0x69,
0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x63, 0x68,
0x75, 0x6e, 0x6b, 0x73, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x63,
0x68, 0x75, 0x6e, 0x6b, 0x73, 0x5f, 0x73, 0x6b, 0x69, 0x70, 0x70, 0x65, 0x64, 0x18, 0x02, 0x20,
0x01, 0x28, 0x05, 0x52, 0x0d, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x53, 0x6b, 0x69, 0x70, 0x70,
0x65, 0x64, 0x22, 0x3d, 0x0a, 0x13, 0x50, 0x72, 0x75, 0x6e, 0x65, 0x4d, 0x69, 0x73, 0x73, 0x69,
0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x0f, 0x6b, 0x65, 0x65,
0x70, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x73, 0x18, 0x01, 0x20, 0x03,
0x28, 0x09, 0x52, 0x0d, 0x6b, 0x65, 0x65, 0x70, 0x46, 0x69, 0x6c, 0x65, 0x50, 0x61, 0x74, 0x68,
0x73, 0x22, 0x39, 0x0a, 0x14, 0x50, 0x72, 0x75, 0x6e, 0x65, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e,
0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x6f, 0x77,
0x73, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,
0x0b, 0x72, 0x6f, 0x77, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x22, 0x3a, 0x0a, 0x0d,
0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a,
0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75,
0x65, 0x72, 0x79, 0x12, 0x13, 0x0a, 0x05, 0x74, 0x6f, 0x70, 0x5f, 0x6b, 0x18, 0x02, 0x20, 0x01,
0x28, 0x05, 0x52, 0x04, 0x74, 0x6f, 0x70, 0x4b, 0x22, 0x47, 0x0a, 0x0e, 0x53, 0x65, 0x61, 0x72,
0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x06, 0x63, 0x68,
0x75, 0x6e, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x65, 0x6e, 0x6b,
0x6c, 0x79, 0x2e, 0x6b, 0x6e, 0x6f, 0x77, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e,
0x43, 0x6f, 0x64, 0x65, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x06, 0x63, 0x68, 0x75, 0x6e, 0x6b,
0x73, 0x22, 0x2f, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64,
0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05,
0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x69, 0x6d,
0x69, 0x74, 0x22, 0x39, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65,
0x64, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d,
0x0a, 0x0a, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x73, 0x18, 0x01, 0x20, 0x03,
0x28, 0x09, 0x52, 0x09, 0x66, 0x69, 0x6c, 0x65, 0x50, 0x61, 0x74, 0x68, 0x73, 0x32, 0x8f, 0x03,
0x0a, 0x10, 0x4b, 0x6e, 0x6f, 0x77, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69,
0x63, 0x65, 0x12, 0x58, 0x0a, 0x09, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x46, 0x69, 0x6c, 0x65, 0x12,
0x24, 0x2e, 0x65, 0x6e, 0x6b, 0x6c, 0x79, 0x2e, 0x6b, 0x6e, 0x6f, 0x77, 0x6c, 0x65, 0x64, 0x67,
0x65, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x65, 0x6e, 0x6b, 0x6c, 0x79, 0x2e, 0x6b, 0x6e,
0x6f, 0x77, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78,
0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x61, 0x0a, 0x0c,
0x50, 0x72, 0x75, 0x6e, 0x65, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x12, 0x27, 0x2e, 0x65,
0x6e, 0x6b, 0x6c, 0x79, 0x2e, 0x6b, 0x6e, 0x6f, 0x77, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x2e, 0x76,
0x31, 0x2e, 0x50, 0x72, 0x75, 0x6e, 0x65, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x65, 0x6e, 0x6b, 0x6c, 0x79, 0x2e, 0x6b, 0x6e,
0x6f, 0x77, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x75, 0x6e, 0x65,
0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
0x4f, 0x0a, 0x06, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x21, 0x2e, 0x65, 0x6e, 0x6b, 0x6c,
0x79, 0x2e, 0x6b, 0x6e, 0x6f, 0x77, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53,
0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x65,
0x6e, 0x6b, 0x6c, 0x79, 0x2e, 0x6b, 0x6e, 0x6f, 0x77, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x2e, 0x76,
0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x12, 0x6d, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x46,
0x69, 0x6c, 0x65, 0x73, 0x12, 0x2b, 0x2e, 0x65, 0x6e, 0x6b, 0x6c, 0x79, 0x2e, 0x6b, 0x6e, 0x6f,
0x77, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e,
0x64, 0x65, 0x78, 0x65, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x1a, 0x2c, 0x2e, 0x65, 0x6e, 0x6b, 0x6c, 0x79, 0x2e, 0x6b, 0x6e, 0x6f, 0x77, 0x6c, 0x65,
0x64, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78,
0x65, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42,
0x24, 0x5a, 0x22, 0x65, 0x6e, 0x6b, 0x6c, 0x79, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x6b, 0x6e, 0x6f,
0x77, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6b, 0x6e, 0x6f, 0x77, 0x6c, 0x65,
0x64, 0x67, 0x65, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_knowledge_v1_knowledge_proto_rawDescOnce sync.Once
file_knowledge_v1_knowledge_proto_rawDescData = file_knowledge_v1_knowledge_proto_rawDesc
)
func file_knowledge_v1_knowledge_proto_rawDescGZIP() []byte {
file_knowledge_v1_knowledge_proto_rawDescOnce.Do(func() {
file_knowledge_v1_knowledge_proto_rawDescData = protoimpl.X.CompressGZIP(file_knowledge_v1_knowledge_proto_rawDescData)
})
return file_knowledge_v1_knowledge_proto_rawDescData
}
var file_knowledge_v1_knowledge_proto_msgTypes = make([]protoimpl.MessageInfo, 9)
var file_knowledge_v1_knowledge_proto_goTypes = []any{
(*CodeChunk)(nil), // 0: enkly.knowledge.v1.CodeChunk
(*IndexFileRequest)(nil), // 1: enkly.knowledge.v1.IndexFileRequest
(*IndexFileResponse)(nil), // 2: enkly.knowledge.v1.IndexFileResponse
(*PruneMissingRequest)(nil), // 3: enkly.knowledge.v1.PruneMissingRequest
(*PruneMissingResponse)(nil), // 4: enkly.knowledge.v1.PruneMissingResponse
(*SearchRequest)(nil), // 5: enkly.knowledge.v1.SearchRequest
(*SearchResponse)(nil), // 6: enkly.knowledge.v1.SearchResponse
(*ListIndexedFilesRequest)(nil), // 7: enkly.knowledge.v1.ListIndexedFilesRequest
(*ListIndexedFilesResponse)(nil), // 8: enkly.knowledge.v1.ListIndexedFilesResponse
}
var file_knowledge_v1_knowledge_proto_depIdxs = []int32{
0, // 0: enkly.knowledge.v1.SearchResponse.chunks:type_name -> enkly.knowledge.v1.CodeChunk
1, // 1: enkly.knowledge.v1.KnowledgeService.IndexFile:input_type -> enkly.knowledge.v1.IndexFileRequest
3, // 2: enkly.knowledge.v1.KnowledgeService.PruneMissing:input_type -> enkly.knowledge.v1.PruneMissingRequest
5, // 3: enkly.knowledge.v1.KnowledgeService.Search:input_type -> enkly.knowledge.v1.SearchRequest
7, // 4: enkly.knowledge.v1.KnowledgeService.ListIndexedFiles:input_type -> enkly.knowledge.v1.ListIndexedFilesRequest
2, // 5: enkly.knowledge.v1.KnowledgeService.IndexFile:output_type -> enkly.knowledge.v1.IndexFileResponse
4, // 6: enkly.knowledge.v1.KnowledgeService.PruneMissing:output_type -> enkly.knowledge.v1.PruneMissingResponse
6, // 7: enkly.knowledge.v1.KnowledgeService.Search:output_type -> enkly.knowledge.v1.SearchResponse
8, // 8: enkly.knowledge.v1.KnowledgeService.ListIndexedFiles:output_type -> enkly.knowledge.v1.ListIndexedFilesResponse
5, // [5:9] is the sub-list for method output_type
1, // [1:5] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
}
func init() { file_knowledge_v1_knowledge_proto_init() }
func file_knowledge_v1_knowledge_proto_init() {
if File_knowledge_v1_knowledge_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_knowledge_v1_knowledge_proto_msgTypes[0].Exporter = func(v any, i int) any {
switch v := v.(*CodeChunk); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_knowledge_v1_knowledge_proto_msgTypes[1].Exporter = func(v any, i int) any {
switch v := v.(*IndexFileRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_knowledge_v1_knowledge_proto_msgTypes[2].Exporter = func(v any, i int) any {
switch v := v.(*IndexFileResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_knowledge_v1_knowledge_proto_msgTypes[3].Exporter = func(v any, i int) any {
switch v := v.(*PruneMissingRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_knowledge_v1_knowledge_proto_msgTypes[4].Exporter = func(v any, i int) any {
switch v := v.(*PruneMissingResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_knowledge_v1_knowledge_proto_msgTypes[5].Exporter = func(v any, i int) any {
switch v := v.(*SearchRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_knowledge_v1_knowledge_proto_msgTypes[6].Exporter = func(v any, i int) any {
switch v := v.(*SearchResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_knowledge_v1_knowledge_proto_msgTypes[7].Exporter = func(v any, i int) any {
switch v := v.(*ListIndexedFilesRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_knowledge_v1_knowledge_proto_msgTypes[8].Exporter = func(v any, i int) any {
switch v := v.(*ListIndexedFilesResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_knowledge_v1_knowledge_proto_rawDesc,
NumEnums: 0,
NumMessages: 9,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_knowledge_v1_knowledge_proto_goTypes,
DependencyIndexes: file_knowledge_v1_knowledge_proto_depIdxs,
MessageInfos: file_knowledge_v1_knowledge_proto_msgTypes,
}.Build()
File_knowledge_v1_knowledge_proto = out.File
file_knowledge_v1_knowledge_proto_rawDesc = nil
file_knowledge_v1_knowledge_proto_goTypes = nil
file_knowledge_v1_knowledge_proto_depIdxs = nil
}

View File

@@ -0,0 +1,261 @@
// Package knowledge is the Code Intelligence (RAG) bounded context:
// chunking, embedding (via the knowledge service's vLLM-backed embed client) and
// cosine-similarity search over workspace source files. System of
// record for the pgvector-backed `documents` table (see
// services/knowledge/migrations/0001_init.sql).
//
// Mirrors internal/rag/*.go. IndexDirectory (cmd/indexer) now walks the
// workspace through the workspace service instead of the local
// filesystem — see tools/indexer.
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc v3.21.12
// source: knowledge/v1/knowledge.proto
package knowledgev1
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
KnowledgeService_IndexFile_FullMethodName = "/enkly.knowledge.v1.KnowledgeService/IndexFile"
KnowledgeService_PruneMissing_FullMethodName = "/enkly.knowledge.v1.KnowledgeService/PruneMissing"
KnowledgeService_Search_FullMethodName = "/enkly.knowledge.v1.KnowledgeService/Search"
KnowledgeService_ListIndexedFiles_FullMethodName = "/enkly.knowledge.v1.KnowledgeService/ListIndexedFiles"
)
// KnowledgeServiceClient is the client API for KnowledgeService 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.
type KnowledgeServiceClient interface {
// IndexFile replaces rag.Store.IndexFile: chunks the given file
// content, embeds each new/changed chunk, and upserts it.
IndexFile(ctx context.Context, in *IndexFileRequest, opts ...grpc.CallOption) (*IndexFileResponse, error)
// PruneMissing replaces rag.Store.pruneMissing, called by the indexer
// after a full directory walk to drop rows for files no longer
// present.
PruneMissing(ctx context.Context, in *PruneMissingRequest, opts ...grpc.CallOption) (*PruneMissingResponse, error)
// Search replaces rag.Store.Search — the search_codebase agent tool.
Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*SearchResponse, error)
// ListIndexedFiles replaces db.ListIndexedFiles, used by the gateway's
// sidebar "indexed files" panel (Handlers.renderConversation).
ListIndexedFiles(ctx context.Context, in *ListIndexedFilesRequest, opts ...grpc.CallOption) (*ListIndexedFilesResponse, error)
}
type knowledgeServiceClient struct {
cc grpc.ClientConnInterface
}
func NewKnowledgeServiceClient(cc grpc.ClientConnInterface) KnowledgeServiceClient {
return &knowledgeServiceClient{cc}
}
func (c *knowledgeServiceClient) IndexFile(ctx context.Context, in *IndexFileRequest, opts ...grpc.CallOption) (*IndexFileResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(IndexFileResponse)
err := c.cc.Invoke(ctx, KnowledgeService_IndexFile_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *knowledgeServiceClient) PruneMissing(ctx context.Context, in *PruneMissingRequest, opts ...grpc.CallOption) (*PruneMissingResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(PruneMissingResponse)
err := c.cc.Invoke(ctx, KnowledgeService_PruneMissing_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *knowledgeServiceClient) Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*SearchResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(SearchResponse)
err := c.cc.Invoke(ctx, KnowledgeService_Search_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *knowledgeServiceClient) ListIndexedFiles(ctx context.Context, in *ListIndexedFilesRequest, opts ...grpc.CallOption) (*ListIndexedFilesResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ListIndexedFilesResponse)
err := c.cc.Invoke(ctx, KnowledgeService_ListIndexedFiles_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// KnowledgeServiceServer is the server API for KnowledgeService service.
// All implementations must embed UnimplementedKnowledgeServiceServer
// for forward compatibility.
type KnowledgeServiceServer interface {
// IndexFile replaces rag.Store.IndexFile: chunks the given file
// content, embeds each new/changed chunk, and upserts it.
IndexFile(context.Context, *IndexFileRequest) (*IndexFileResponse, error)
// PruneMissing replaces rag.Store.pruneMissing, called by the indexer
// after a full directory walk to drop rows for files no longer
// present.
PruneMissing(context.Context, *PruneMissingRequest) (*PruneMissingResponse, error)
// Search replaces rag.Store.Search — the search_codebase agent tool.
Search(context.Context, *SearchRequest) (*SearchResponse, error)
// ListIndexedFiles replaces db.ListIndexedFiles, used by the gateway's
// sidebar "indexed files" panel (Handlers.renderConversation).
ListIndexedFiles(context.Context, *ListIndexedFilesRequest) (*ListIndexedFilesResponse, error)
mustEmbedUnimplementedKnowledgeServiceServer()
}
// UnimplementedKnowledgeServiceServer 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.
type UnimplementedKnowledgeServiceServer struct{}
func (UnimplementedKnowledgeServiceServer) IndexFile(context.Context, *IndexFileRequest) (*IndexFileResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method IndexFile not implemented")
}
func (UnimplementedKnowledgeServiceServer) PruneMissing(context.Context, *PruneMissingRequest) (*PruneMissingResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method PruneMissing not implemented")
}
func (UnimplementedKnowledgeServiceServer) Search(context.Context, *SearchRequest) (*SearchResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Search not implemented")
}
func (UnimplementedKnowledgeServiceServer) ListIndexedFiles(context.Context, *ListIndexedFilesRequest) (*ListIndexedFilesResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListIndexedFiles not implemented")
}
func (UnimplementedKnowledgeServiceServer) mustEmbedUnimplementedKnowledgeServiceServer() {}
func (UnimplementedKnowledgeServiceServer) testEmbeddedByValue() {}
// UnsafeKnowledgeServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to KnowledgeServiceServer will
// result in compilation errors.
type UnsafeKnowledgeServiceServer interface {
mustEmbedUnimplementedKnowledgeServiceServer()
}
func RegisterKnowledgeServiceServer(s grpc.ServiceRegistrar, srv KnowledgeServiceServer) {
// If the following call pancis, it indicates UnimplementedKnowledgeServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&KnowledgeService_ServiceDesc, srv)
}
func _KnowledgeService_IndexFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(IndexFileRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(KnowledgeServiceServer).IndexFile(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: KnowledgeService_IndexFile_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(KnowledgeServiceServer).IndexFile(ctx, req.(*IndexFileRequest))
}
return interceptor(ctx, in, info, handler)
}
func _KnowledgeService_PruneMissing_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(PruneMissingRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(KnowledgeServiceServer).PruneMissing(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: KnowledgeService_PruneMissing_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(KnowledgeServiceServer).PruneMissing(ctx, req.(*PruneMissingRequest))
}
return interceptor(ctx, in, info, handler)
}
func _KnowledgeService_Search_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SearchRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(KnowledgeServiceServer).Search(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: KnowledgeService_Search_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(KnowledgeServiceServer).Search(ctx, req.(*SearchRequest))
}
return interceptor(ctx, in, info, handler)
}
func _KnowledgeService_ListIndexedFiles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListIndexedFilesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(KnowledgeServiceServer).ListIndexedFiles(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: KnowledgeService_ListIndexedFiles_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(KnowledgeServiceServer).ListIndexedFiles(ctx, req.(*ListIndexedFilesRequest))
}
return interceptor(ctx, in, info, handler)
}
// KnowledgeService_ServiceDesc is the grpc.ServiceDesc for KnowledgeService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var KnowledgeService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "enkly.knowledge.v1.KnowledgeService",
HandlerType: (*KnowledgeServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "IndexFile",
Handler: _KnowledgeService_IndexFile_Handler,
},
{
MethodName: "PruneMissing",
Handler: _KnowledgeService_PruneMissing_Handler,
},
{
MethodName: "Search",
Handler: _KnowledgeService_Search_Handler,
},
{
MethodName: "ListIndexedFiles",
Handler: _KnowledgeService_ListIndexedFiles_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "knowledge/v1/knowledge.proto",
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,554 @@
// Package workspace is the Workspace (agent sandbox / files) bounded
// context: the single shared ENKLY_WORKSPACE directory the coding agent
// reads, writes and runs commands in, and that the "Files" panel in the
// UI lets a human upload into / download from. Every path-jailing rule
// from internal/llm/sandbox.go (ResolvePath, the bash allowlist, the
// filesystem guards) is enforced here and nowhere else — no other
// service is allowed to touch the workspace volume directly.
//
// Mirrors internal/llm/tools.go (filesystem + bash tools) and
// internal/handlers/files.go / ui.go (upload, download, tree).
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc v3.21.12
// source: workspace/v1/workspace.proto
package workspacev1
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
WorkspaceService_ReadFile_FullMethodName = "/enkly.workspace.v1.WorkspaceService/ReadFile"
WorkspaceService_WriteFile_FullMethodName = "/enkly.workspace.v1.WorkspaceService/WriteFile"
WorkspaceService_EditFile_FullMethodName = "/enkly.workspace.v1.WorkspaceService/EditFile"
WorkspaceService_MultiEditFile_FullMethodName = "/enkly.workspace.v1.WorkspaceService/MultiEditFile"
WorkspaceService_ListDirectory_FullMethodName = "/enkly.workspace.v1.WorkspaceService/ListDirectory"
WorkspaceService_GlobSearch_FullMethodName = "/enkly.workspace.v1.WorkspaceService/GlobSearch"
WorkspaceService_Grep_FullMethodName = "/enkly.workspace.v1.WorkspaceService/Grep"
WorkspaceService_RunBashCommand_FullMethodName = "/enkly.workspace.v1.WorkspaceService/RunBashCommand"
WorkspaceService_UploadFile_FullMethodName = "/enkly.workspace.v1.WorkspaceService/UploadFile"
WorkspaceService_DownloadFile_FullMethodName = "/enkly.workspace.v1.WorkspaceService/DownloadFile"
WorkspaceService_Tree_FullMethodName = "/enkly.workspace.v1.WorkspaceService/Tree"
WorkspaceService_StatFile_FullMethodName = "/enkly.workspace.v1.WorkspaceService/StatFile"
)
// WorkspaceServiceClient is the client API for WorkspaceService 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.
type WorkspaceServiceClient interface {
// --- agent filesystem/bash tools (internal/llm/tools.go, sandbox.go) ---
ReadFile(ctx context.Context, in *ReadFileRequest, opts ...grpc.CallOption) (*ReadFileResponse, error)
WriteFile(ctx context.Context, in *WriteFileRequest, opts ...grpc.CallOption) (*WriteFileResponse, error)
EditFile(ctx context.Context, in *EditFileRequest, opts ...grpc.CallOption) (*EditFileResponse, error)
MultiEditFile(ctx context.Context, in *MultiEditFileRequest, opts ...grpc.CallOption) (*MultiEditFileResponse, error)
ListDirectory(ctx context.Context, in *ListDirectoryRequest, opts ...grpc.CallOption) (*ListDirectoryResponse, error)
GlobSearch(ctx context.Context, in *GlobSearchRequest, opts ...grpc.CallOption) (*GlobSearchResponse, error)
Grep(ctx context.Context, in *GrepRequest, opts ...grpc.CallOption) (*GrepResponse, error)
RunBashCommand(ctx context.Context, in *RunBashCommandRequest, opts ...grpc.CallOption) (*RunBashCommandResponse, error)
// --- human-facing files panel (internal/handlers/files.go, ui.go) ---
UploadFile(ctx context.Context, in *UploadFileRequest, opts ...grpc.CallOption) (*UploadFileResponse, error)
DownloadFile(ctx context.Context, in *DownloadFileRequest, opts ...grpc.CallOption) (*DownloadFileResponse, error)
Tree(ctx context.Context, in *TreeRequest, opts ...grpc.CallOption) (*TreeResponse, error)
StatFile(ctx context.Context, in *StatFileRequest, opts ...grpc.CallOption) (*StatFileResponse, error)
}
type workspaceServiceClient struct {
cc grpc.ClientConnInterface
}
func NewWorkspaceServiceClient(cc grpc.ClientConnInterface) WorkspaceServiceClient {
return &workspaceServiceClient{cc}
}
func (c *workspaceServiceClient) ReadFile(ctx context.Context, in *ReadFileRequest, opts ...grpc.CallOption) (*ReadFileResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ReadFileResponse)
err := c.cc.Invoke(ctx, WorkspaceService_ReadFile_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *workspaceServiceClient) WriteFile(ctx context.Context, in *WriteFileRequest, opts ...grpc.CallOption) (*WriteFileResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(WriteFileResponse)
err := c.cc.Invoke(ctx, WorkspaceService_WriteFile_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *workspaceServiceClient) EditFile(ctx context.Context, in *EditFileRequest, opts ...grpc.CallOption) (*EditFileResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(EditFileResponse)
err := c.cc.Invoke(ctx, WorkspaceService_EditFile_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *workspaceServiceClient) MultiEditFile(ctx context.Context, in *MultiEditFileRequest, opts ...grpc.CallOption) (*MultiEditFileResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(MultiEditFileResponse)
err := c.cc.Invoke(ctx, WorkspaceService_MultiEditFile_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *workspaceServiceClient) ListDirectory(ctx context.Context, in *ListDirectoryRequest, opts ...grpc.CallOption) (*ListDirectoryResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ListDirectoryResponse)
err := c.cc.Invoke(ctx, WorkspaceService_ListDirectory_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *workspaceServiceClient) GlobSearch(ctx context.Context, in *GlobSearchRequest, opts ...grpc.CallOption) (*GlobSearchResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GlobSearchResponse)
err := c.cc.Invoke(ctx, WorkspaceService_GlobSearch_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *workspaceServiceClient) Grep(ctx context.Context, in *GrepRequest, opts ...grpc.CallOption) (*GrepResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GrepResponse)
err := c.cc.Invoke(ctx, WorkspaceService_Grep_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *workspaceServiceClient) RunBashCommand(ctx context.Context, in *RunBashCommandRequest, opts ...grpc.CallOption) (*RunBashCommandResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(RunBashCommandResponse)
err := c.cc.Invoke(ctx, WorkspaceService_RunBashCommand_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *workspaceServiceClient) UploadFile(ctx context.Context, in *UploadFileRequest, opts ...grpc.CallOption) (*UploadFileResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(UploadFileResponse)
err := c.cc.Invoke(ctx, WorkspaceService_UploadFile_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *workspaceServiceClient) DownloadFile(ctx context.Context, in *DownloadFileRequest, opts ...grpc.CallOption) (*DownloadFileResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(DownloadFileResponse)
err := c.cc.Invoke(ctx, WorkspaceService_DownloadFile_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *workspaceServiceClient) Tree(ctx context.Context, in *TreeRequest, opts ...grpc.CallOption) (*TreeResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(TreeResponse)
err := c.cc.Invoke(ctx, WorkspaceService_Tree_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *workspaceServiceClient) StatFile(ctx context.Context, in *StatFileRequest, opts ...grpc.CallOption) (*StatFileResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StatFileResponse)
err := c.cc.Invoke(ctx, WorkspaceService_StatFile_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// WorkspaceServiceServer is the server API for WorkspaceService service.
// All implementations must embed UnimplementedWorkspaceServiceServer
// for forward compatibility.
type WorkspaceServiceServer interface {
// --- agent filesystem/bash tools (internal/llm/tools.go, sandbox.go) ---
ReadFile(context.Context, *ReadFileRequest) (*ReadFileResponse, error)
WriteFile(context.Context, *WriteFileRequest) (*WriteFileResponse, error)
EditFile(context.Context, *EditFileRequest) (*EditFileResponse, error)
MultiEditFile(context.Context, *MultiEditFileRequest) (*MultiEditFileResponse, error)
ListDirectory(context.Context, *ListDirectoryRequest) (*ListDirectoryResponse, error)
GlobSearch(context.Context, *GlobSearchRequest) (*GlobSearchResponse, error)
Grep(context.Context, *GrepRequest) (*GrepResponse, error)
RunBashCommand(context.Context, *RunBashCommandRequest) (*RunBashCommandResponse, error)
// --- human-facing files panel (internal/handlers/files.go, ui.go) ---
UploadFile(context.Context, *UploadFileRequest) (*UploadFileResponse, error)
DownloadFile(context.Context, *DownloadFileRequest) (*DownloadFileResponse, error)
Tree(context.Context, *TreeRequest) (*TreeResponse, error)
StatFile(context.Context, *StatFileRequest) (*StatFileResponse, error)
mustEmbedUnimplementedWorkspaceServiceServer()
}
// UnimplementedWorkspaceServiceServer 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.
type UnimplementedWorkspaceServiceServer struct{}
func (UnimplementedWorkspaceServiceServer) ReadFile(context.Context, *ReadFileRequest) (*ReadFileResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ReadFile not implemented")
}
func (UnimplementedWorkspaceServiceServer) WriteFile(context.Context, *WriteFileRequest) (*WriteFileResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method WriteFile not implemented")
}
func (UnimplementedWorkspaceServiceServer) EditFile(context.Context, *EditFileRequest) (*EditFileResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method EditFile not implemented")
}
func (UnimplementedWorkspaceServiceServer) MultiEditFile(context.Context, *MultiEditFileRequest) (*MultiEditFileResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method MultiEditFile not implemented")
}
func (UnimplementedWorkspaceServiceServer) ListDirectory(context.Context, *ListDirectoryRequest) (*ListDirectoryResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListDirectory not implemented")
}
func (UnimplementedWorkspaceServiceServer) GlobSearch(context.Context, *GlobSearchRequest) (*GlobSearchResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GlobSearch not implemented")
}
func (UnimplementedWorkspaceServiceServer) Grep(context.Context, *GrepRequest) (*GrepResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Grep not implemented")
}
func (UnimplementedWorkspaceServiceServer) RunBashCommand(context.Context, *RunBashCommandRequest) (*RunBashCommandResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method RunBashCommand not implemented")
}
func (UnimplementedWorkspaceServiceServer) UploadFile(context.Context, *UploadFileRequest) (*UploadFileResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method UploadFile not implemented")
}
func (UnimplementedWorkspaceServiceServer) DownloadFile(context.Context, *DownloadFileRequest) (*DownloadFileResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method DownloadFile not implemented")
}
func (UnimplementedWorkspaceServiceServer) Tree(context.Context, *TreeRequest) (*TreeResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Tree not implemented")
}
func (UnimplementedWorkspaceServiceServer) StatFile(context.Context, *StatFileRequest) (*StatFileResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method StatFile not implemented")
}
func (UnimplementedWorkspaceServiceServer) mustEmbedUnimplementedWorkspaceServiceServer() {}
func (UnimplementedWorkspaceServiceServer) testEmbeddedByValue() {}
// UnsafeWorkspaceServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to WorkspaceServiceServer will
// result in compilation errors.
type UnsafeWorkspaceServiceServer interface {
mustEmbedUnimplementedWorkspaceServiceServer()
}
func RegisterWorkspaceServiceServer(s grpc.ServiceRegistrar, srv WorkspaceServiceServer) {
// If the following call pancis, it indicates UnimplementedWorkspaceServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&WorkspaceService_ServiceDesc, srv)
}
func _WorkspaceService_ReadFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ReadFileRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WorkspaceServiceServer).ReadFile(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: WorkspaceService_ReadFile_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WorkspaceServiceServer).ReadFile(ctx, req.(*ReadFileRequest))
}
return interceptor(ctx, in, info, handler)
}
func _WorkspaceService_WriteFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(WriteFileRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WorkspaceServiceServer).WriteFile(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: WorkspaceService_WriteFile_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WorkspaceServiceServer).WriteFile(ctx, req.(*WriteFileRequest))
}
return interceptor(ctx, in, info, handler)
}
func _WorkspaceService_EditFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(EditFileRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WorkspaceServiceServer).EditFile(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: WorkspaceService_EditFile_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WorkspaceServiceServer).EditFile(ctx, req.(*EditFileRequest))
}
return interceptor(ctx, in, info, handler)
}
func _WorkspaceService_MultiEditFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MultiEditFileRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WorkspaceServiceServer).MultiEditFile(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: WorkspaceService_MultiEditFile_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WorkspaceServiceServer).MultiEditFile(ctx, req.(*MultiEditFileRequest))
}
return interceptor(ctx, in, info, handler)
}
func _WorkspaceService_ListDirectory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListDirectoryRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WorkspaceServiceServer).ListDirectory(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: WorkspaceService_ListDirectory_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WorkspaceServiceServer).ListDirectory(ctx, req.(*ListDirectoryRequest))
}
return interceptor(ctx, in, info, handler)
}
func _WorkspaceService_GlobSearch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GlobSearchRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WorkspaceServiceServer).GlobSearch(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: WorkspaceService_GlobSearch_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WorkspaceServiceServer).GlobSearch(ctx, req.(*GlobSearchRequest))
}
return interceptor(ctx, in, info, handler)
}
func _WorkspaceService_Grep_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GrepRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WorkspaceServiceServer).Grep(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: WorkspaceService_Grep_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WorkspaceServiceServer).Grep(ctx, req.(*GrepRequest))
}
return interceptor(ctx, in, info, handler)
}
func _WorkspaceService_RunBashCommand_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(RunBashCommandRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WorkspaceServiceServer).RunBashCommand(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: WorkspaceService_RunBashCommand_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WorkspaceServiceServer).RunBashCommand(ctx, req.(*RunBashCommandRequest))
}
return interceptor(ctx, in, info, handler)
}
func _WorkspaceService_UploadFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UploadFileRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WorkspaceServiceServer).UploadFile(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: WorkspaceService_UploadFile_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WorkspaceServiceServer).UploadFile(ctx, req.(*UploadFileRequest))
}
return interceptor(ctx, in, info, handler)
}
func _WorkspaceService_DownloadFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DownloadFileRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WorkspaceServiceServer).DownloadFile(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: WorkspaceService_DownloadFile_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WorkspaceServiceServer).DownloadFile(ctx, req.(*DownloadFileRequest))
}
return interceptor(ctx, in, info, handler)
}
func _WorkspaceService_Tree_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(TreeRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WorkspaceServiceServer).Tree(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: WorkspaceService_Tree_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WorkspaceServiceServer).Tree(ctx, req.(*TreeRequest))
}
return interceptor(ctx, in, info, handler)
}
func _WorkspaceService_StatFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(StatFileRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WorkspaceServiceServer).StatFile(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: WorkspaceService_StatFile_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WorkspaceServiceServer).StatFile(ctx, req.(*StatFileRequest))
}
return interceptor(ctx, in, info, handler)
}
// WorkspaceService_ServiceDesc is the grpc.ServiceDesc for WorkspaceService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var WorkspaceService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "enkly.workspace.v1.WorkspaceService",
HandlerType: (*WorkspaceServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "ReadFile",
Handler: _WorkspaceService_ReadFile_Handler,
},
{
MethodName: "WriteFile",
Handler: _WorkspaceService_WriteFile_Handler,
},
{
MethodName: "EditFile",
Handler: _WorkspaceService_EditFile_Handler,
},
{
MethodName: "MultiEditFile",
Handler: _WorkspaceService_MultiEditFile_Handler,
},
{
MethodName: "ListDirectory",
Handler: _WorkspaceService_ListDirectory_Handler,
},
{
MethodName: "GlobSearch",
Handler: _WorkspaceService_GlobSearch_Handler,
},
{
MethodName: "Grep",
Handler: _WorkspaceService_Grep_Handler,
},
{
MethodName: "RunBashCommand",
Handler: _WorkspaceService_RunBashCommand_Handler,
},
{
MethodName: "UploadFile",
Handler: _WorkspaceService_UploadFile_Handler,
},
{
MethodName: "DownloadFile",
Handler: _WorkspaceService_DownloadFile_Handler,
},
{
MethodName: "Tree",
Handler: _WorkspaceService_Tree_Handler,
},
{
MethodName: "StatFile",
Handler: _WorkspaceService_StatFile_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "workspace/v1/workspace.proto",
}