diff --git a/CLAUDE.md b/CLAUDE.md index d564b6c3..56249263 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -113,7 +113,7 @@ Every agent implements four interfaces via gRPC: 1. **Agent** — `Load()` identity and settings 2. **Builder** — `Load() → Init() → Create() → Update() → Sync() → Build() → Deploy()` 3. **Runtime** — `Load() → Init() → Start() → Stop() → Destroy()` + `Information()`, `Test()` -4. **Code** — file/edit/shell/project/dependency operations. Semantic code intelligence belongs in Mind, not the Codefly plugin proto. +4. **Code + Tooling** — Code owns file/edit/shell/project/dependency operations; Tooling owns typed semantic inspection. Project bytes and language parsers stay inside Codefly agents. Orchestration brains such as Mind consume typed facts through the Gateway and never read or parse project source directly. ### Network Mapping Flow 1. Agent declares endpoints in `service.codefly.yaml` diff --git a/code/semantic_index.go b/code/semantic_index.go new file mode 100644 index 00000000..92d00a4c --- /dev/null +++ b/code/semantic_index.go @@ -0,0 +1,613 @@ +package code + +// ARCHITECTURE: semantic projection executes inside Codefly because only the +// agent boundary may inspect project bytes. The result is deliberately +// language-neutral and body-free so orchestration clients can reconcile graph +// facts without acquiring a parser, choosing extensions, or caching source. + +import ( + "context" + "crypto/sha256" + "encoding/hex" + "fmt" + "go/parser" + "go/token" + "io/fs" + "path/filepath" + "sort" + "strconv" + "strings" + "unicode" + + basev0 "github.com/codefly-dev/core/generated/go/codefly/base/v0" + codev0 "github.com/codefly-dev/core/generated/go/codefly/services/code/v0" + sitter "github.com/smacker/go-tree-sitter" + tscsharp "github.com/smacker/go-tree-sitter/csharp" + tsgo "github.com/smacker/go-tree-sitter/golang" + tsjava "github.com/smacker/go-tree-sitter/java" + tskotlin "github.com/smacker/go-tree-sitter/kotlin" + tspython "github.com/smacker/go-tree-sitter/python" + tstsx "github.com/smacker/go-tree-sitter/typescript/tsx" +) + +const semanticAnalyzerVersion = "codefly.semantic-index/v1" + +type semanticLanguage struct { + name string + grammar *sitter.Language + extensions map[string]struct{} +} + +var semanticLanguages = []semanticLanguage{ + {name: "go", grammar: tsgo.GetLanguage(), extensions: extensionSet(".go")}, + {name: "python", grammar: tspython.GetLanguage(), extensions: extensionSet(".py")}, + {name: "typescript", grammar: tstsx.GetLanguage(), extensions: extensionSet(".ts", ".tsx", ".mts", ".cts", ".js", ".jsx", ".mjs", ".cjs")}, + {name: "java", grammar: tsjava.GetLanguage(), extensions: extensionSet(".java")}, + {name: "kotlin", grammar: tskotlin.GetLanguage(), extensions: extensionSet(".kt", ".kts")}, + {name: "csharp", grammar: tscsharp.GetLanguage(), extensions: extensionSet(".cs")}, +} + +const ( + semanticFunction = basev0.SemanticSymbolKind_SEMANTIC_SYMBOL_KIND_FUNCTION + semanticMethod = basev0.SemanticSymbolKind_SEMANTIC_SYMBOL_KIND_METHOD + semanticClass = basev0.SemanticSymbolKind_SEMANTIC_SYMBOL_KIND_CLASS + semanticStruct = basev0.SemanticSymbolKind_SEMANTIC_SYMBOL_KIND_STRUCT + semanticInterface = basev0.SemanticSymbolKind_SEMANTIC_SYMBOL_KIND_INTERFACE + semanticEnum = basev0.SemanticSymbolKind_SEMANTIC_SYMBOL_KIND_ENUM + semanticVariable = basev0.SemanticSymbolKind_SEMANTIC_SYMBOL_KIND_VARIABLE + semanticConstant = basev0.SemanticSymbolKind_SEMANTIC_SYMBOL_KIND_CONSTANT + semanticAlias = basev0.SemanticSymbolKind_SEMANTIC_SYMBOL_KIND_TYPE_ALIAS +) + +var semanticDeclarationKinds = map[string]map[string]basev0.SemanticSymbolKind{ + "go": {"function_declaration": semanticFunction, "method_declaration": semanticMethod, "type_spec": semanticAlias, "const_spec": semanticConstant, "var_spec": semanticVariable}, + "python": {"function_definition": semanticFunction, "class_definition": semanticClass, "assignment": semanticVariable}, + "typescript": {"function_declaration": semanticFunction, "method_definition": semanticMethod, "class_declaration": semanticClass, "abstract_class_declaration": semanticClass, "interface_declaration": semanticInterface, "enum_declaration": semanticEnum, "type_alias_declaration": semanticAlias, "lexical_declaration": semanticVariable, "variable_declaration": semanticVariable}, + "java": {"method_declaration": semanticMethod, "constructor_declaration": semanticMethod, "class_declaration": semanticClass, "record_declaration": semanticClass, "interface_declaration": semanticInterface, "enum_declaration": semanticEnum, "field_declaration": semanticVariable}, + "kotlin": {"function_declaration": semanticMethod, "class_declaration": semanticClass, "object_declaration": semanticClass, "property_declaration": semanticVariable, "type_alias": semanticAlias}, + "csharp": {"method_declaration": semanticMethod, "constructor_declaration": semanticMethod, "class_declaration": semanticClass, "record_declaration": semanticClass, "interface_declaration": semanticInterface, "struct_declaration": semanticStruct, "enum_declaration": semanticEnum, "field_declaration": semanticVariable, "property_declaration": semanticVariable}, +} + +// getSemanticIndex performs one deterministic scan through the server VFS. +// Parse failures degrade individual files while retaining valid evidence from +// the rest of the code unit. An unsupported unit is explicit, never an empty +// response that a caller could mistake for complete coverage. +func (s *DefaultCodeServer) getSemanticIndex(ctx context.Context, _ *codev0.GetSemanticIndexRequest) (*codev0.CodeResponse, error) { + index := &basev0.SemanticIndex{ + State: basev0.SemanticIndexState_SEMANTIC_INDEX_STATE_NOT_ATTEMPTED, + Analyzer: "codefly-core/tree-sitter", + AnalyzerVersion: semanticAnalyzerVersion, + } + err := s.FS.WalkDir(s.SourceDir, func(filename string, entry fs.DirEntry, walkErr error) error { + if walkErr != nil { + return walkErr + } + if err := ctx.Err(); err != nil { + return err + } + if entry.IsDir() { + if filename != s.SourceDir && skipSourceInspectionDir(entry.Name()) { + return filepath.SkipDir + } + return nil + } + definition, ok := semanticLanguageForExtension(strings.ToLower(filepath.Ext(entry.Name()))) + if !ok { + return nil + } + relative, err := filepath.Rel(s.SourceDir, filename) + if err != nil { + return err + } + relative = filepath.ToSlash(relative) + info, err := s.FS.Stat(filename) + if err != nil { + return err + } + if info.Size() > maxHashFileSize { + index.Issues = append(index.Issues, semanticIssue("file_too_large", relative, fmt.Sprintf("source file exceeds %d-byte semantic inspection limit", maxHashFileSize))) + return nil + } + body, err := s.FS.ReadFile(filename) + if err != nil { + index.Issues = append(index.Issues, semanticIssue("read_failed", relative, err.Error())) + return nil + } + file, symbols, err := projectSemanticFile(ctx, definition, relative, body) + if file != nil { + index.Files = append(index.Files, file) + } + if err != nil { + index.Issues = append(index.Issues, semanticIssue("parse_failed", relative, err.Error())) + return nil + } + index.Symbols = append(index.Symbols, symbols...) + return nil + }) + if err != nil { + return nil, fmt.Errorf("semantic index: %w", err) + } + seenLanguages := make(map[string]struct{}) + for _, file := range index.Files { + seenLanguages[file.GetLanguage()] = struct{}{} + } + for language := range seenLanguages { + index.Languages = append(index.Languages, language) + } + sort.Strings(index.Languages) + sort.Slice(index.Files, func(i, j int) bool { return index.Files[i].GetPath() < index.Files[j].GetPath() }) + sort.Slice(index.Symbols, func(i, j int) bool { + left, right := index.Symbols[i], index.Symbols[j] + if left.GetLocation().GetPath() != right.GetLocation().GetPath() { + return left.GetLocation().GetPath() < right.GetLocation().GetPath() + } + if left.GetLocation().GetStartLine() != right.GetLocation().GetStartLine() { + return left.GetLocation().GetStartLine() < right.GetLocation().GetStartLine() + } + return left.GetQualifiedName() < right.GetQualifiedName() + }) + sort.Slice(index.Issues, func(i, j int) bool { + if index.Issues[i].GetPath() != index.Issues[j].GetPath() { + return index.Issues[i].GetPath() < index.Issues[j].GetPath() + } + return index.Issues[i].GetCode() < index.Issues[j].GetCode() + }) + switch { + case len(index.Files) == 0 && len(index.Issues) == 0: + index.Issues = append(index.Issues, semanticIssue("unsupported_source", "", "no supported semantic source files were found")) + case len(index.Issues) > 0: + index.State = basev0.SemanticIndexState_SEMANTIC_INDEX_STATE_DEGRADED + default: + index.State = basev0.SemanticIndexState_SEMANTIC_INDEX_STATE_COMPLETE + } + return &codev0.CodeResponse{Result: &codev0.CodeResponse_GetSemanticIndex{GetSemanticIndex: index}}, nil +} + +func semanticLanguageForExtension(extension string) (semanticLanguage, bool) { + for _, definition := range semanticLanguages { + if _, ok := definition.extensions[extension]; ok { + return definition, true + } + } + return semanticLanguage{}, false +} + +func semanticIssue(code, path, message string) *basev0.SemanticIssue { + return &basev0.SemanticIssue{Code: code, Path: path, Message: message} +} + +func projectSemanticFile(ctx context.Context, definition semanticLanguage, path string, body []byte) (*basev0.SemanticFile, []*basev0.SemanticSymbol, error) { + file := &basev0.SemanticFile{ + Path: path, ContentSha256: semanticHash(body), ByteSize: int64(len(body)), Language: definition.name, + } + parser := sitter.NewParser() + defer parser.Close() + parser.SetLanguage(definition.grammar) + tree, err := parser.ParseCtx(ctx, nil, body) + if err != nil { + return file, nil, err + } + defer tree.Close() + root := tree.RootNode() + file.Imports = semanticImports(definition.name, path, root, body) + if root.HasError() { + return file, nil, fmt.Errorf("syntax tree contains errors") + } + packageName := semanticPackage(definition.name, path, root, body) + var symbols []*basev0.SemanticSymbol + projectSemanticDeclarations(definition.name, path, packageName, "", root, body, &symbols) + return file, symbols, nil +} + +func projectSemanticDeclarations(language, path, packageName, parent string, node *sitter.Node, body []byte, out *[]*basev0.SemanticSymbol) { + if node == nil || node.IsNull() { + return + } + declarations := semanticDeclarations(language, node, body) + nextParent := parent + for _, declaration := range declarations { + name := strings.TrimSpace(declaration.name) + if name == "" { + continue + } + qualified := qualifySemanticName(packageName, parent, name) + if language == "go" && declaration.kind == basev0.SemanticSymbolKind_SEMANTIC_SYMBOL_KIND_METHOD { + if receiver := goReceiverName(node, body); receiver != "" { + qualified = qualifySemanticName(packageName, "", receiver+"."+name) + } + } + bodyNode := semanticBodyNode(node) + signatureBytes := semanticSignatureBytes(node, bodyNode, body, declaration.kind, name) + bodyBytes := []byte(nil) + if bodyNode != nil && !bodyNode.IsNull() { + bodyBytes = nodeBytes(bodyNode, body) + } else if semanticDataDeclaration(declaration.kind) { + bodyBytes = nodeBytes(node, body) + } + symbol := &basev0.SemanticSymbol{ + Name: name, QualifiedName: qualified, Kind: declaration.kind, + Location: semanticLocation(path, node), Package: packageName, + ParentQualifiedName: parent, Signature: boundedSignature(signatureBytes), + SignatureSha256: semanticHash(signatureBytes), + } + if len(bodyBytes) > 0 { + symbol.BodySha256 = semanticHash(bodyBytes) + } + if semanticCallable(declaration.kind) { + symbol.Calls = semanticUses(language, path, node, body, true) + symbol.References = semanticUses(language, path, node, body, false) + } + *out = append(*out, symbol) + if semanticContainer(declaration.kind) { + nextParent = qualified + } + } + for index := 0; index < int(node.NamedChildCount()); index++ { + child := node.NamedChild(index) + if len(declarations) > 0 && isNestedSemanticBody(node, child) { + projectSemanticDeclarations(language, path, packageName, nextParent, child, body, out) + continue + } + projectSemanticDeclarations(language, path, packageName, parent, child, body, out) + } +} + +type semanticDeclaration struct { + name string + kind basev0.SemanticSymbolKind +} + +func semanticDeclarations(language string, node *sitter.Node, body []byte) []semanticDeclaration { + kind, ok := semanticDeclarationKind(language, node.Type()) + if !ok { + return nil + } + if (node.Type() == "lexical_declaration" || node.Type() == "variable_declaration" || node.Type() == "field_declaration" || node.Type() == "property_declaration" || node.Type() == "const_declaration" || node.Type() == "assignment") && insideCallable(node) { + return nil + } + if language == "go" && node.Type() == "type_spec" { + if declaredType := node.ChildByFieldName("type"); declaredType != nil && !declaredType.IsNull() { + switch declaredType.Type() { + case "struct_type": + kind = basev0.SemanticSymbolKind_SEMANTIC_SYMBOL_KIND_STRUCT + case "interface_type": + kind = basev0.SemanticSymbolKind_SEMANTIC_SYMBOL_KIND_INTERFACE + } + } + } + if language == "python" && node.Type() == "function_definition" && insideSemanticContainer(node) { + kind = basev0.SemanticSymbolKind_SEMANTIC_SYMBOL_KIND_METHOD + } + if language == "kotlin" && node.Type() == "function_declaration" && !insideSemanticContainer(node) { + kind = basev0.SemanticSymbolKind_SEMANTIC_SYMBOL_KIND_FUNCTION + } + names := semanticDeclarationNames(node, body) + result := make([]semanticDeclaration, 0, len(names)) + for _, name := range names { + result = append(result, semanticDeclaration{name: name, kind: kind}) + } + return result +} + +func semanticDeclarationKind(language, nodeType string) (basev0.SemanticSymbolKind, bool) { + kind, ok := semanticDeclarationKinds[language][nodeType] + return kind, ok +} + +func semanticDeclarationNames(node *sitter.Node, body []byte) []string { + if name := node.ChildByFieldName("name"); name != nil && !name.IsNull() { + return []string{strings.TrimSpace(name.Content(body))} + } + if node.Type() == "assignment" { + if left := node.ChildByFieldName("left"); left != nil && !left.IsNull() && (left.Type() == "identifier" || left.Type() == "attribute") { + return []string{strings.TrimSpace(left.Content(body))} + } + } + // Older tree-sitter Kotlin grammars expose declaration identifiers as an + // unnamed direct simple_identifier rather than a named field. + for index := 0; index < int(node.NamedChildCount()); index++ { + candidate := node.NamedChild(index) + if candidate.Type() == "simple_identifier" || candidate.Type() == "type_identifier" || candidate.Type() == "identifier" { + return []string{strings.TrimSpace(candidate.Content(body))} + } + } + var names []string + walkSyntax(node, func(candidate *sitter.Node) { + if candidate == node { + return + } + switch candidate.Type() { + case "variable_declarator", "variable_declaration", "const_spec", "var_spec": + if name := candidate.ChildByFieldName("name"); name != nil && !name.IsNull() { + names = append(names, strings.TrimSpace(name.Content(body))) + } + } + }) + return canonicalImports(names) +} + +func semanticBodyNode(node *sitter.Node) *sitter.Node { + for _, field := range []string{"body", "value"} { + if child := node.ChildByFieldName(field); child != nil && !child.IsNull() { + return child + } + } + if node.Type() == "type_spec" { + if child := node.ChildByFieldName("type"); child != nil && !child.IsNull() { + return child + } + } + return nil +} + +func semanticSignatureBytes(node, bodyNode *sitter.Node, body []byte, kind basev0.SemanticSymbolKind, name string) []byte { + if semanticDataDeclaration(kind) || (semanticCallable(kind) && (bodyNode == nil || bodyNode.IsNull())) { + return []byte(name) + } + start, end := int(node.StartByte()), int(node.EndByte()) + if bodyNode != nil && !bodyNode.IsNull() { + end = int(bodyNode.StartByte()) + } + if start < 0 || end < start || end > len(body) { + return nil + } + return []byte(strings.TrimSpace(string(body[start:end]))) +} + +func nodeBytes(node *sitter.Node, body []byte) []byte { + start, end := int(node.StartByte()), int(node.EndByte()) + if start < 0 || end < start || end > len(body) { + return nil + } + return body[start:end] +} + +func boundedSignature(value []byte) string { + const maxSignatureBytes = 16 * 1024 + if len(value) > maxSignatureBytes { + value = value[:maxSignatureBytes] + } + return string(value) +} + +func semanticHash(value []byte) string { + digest := sha256.Sum256(value) + return hex.EncodeToString(digest[:]) +} + +func semanticLocation(path string, node *sitter.Node) *basev0.SemanticLocation { + start, end := node.StartPoint(), node.EndPoint() + return &basev0.SemanticLocation{ + Path: path, StartLine: int32(start.Row + 1), StartColumn: int32(start.Column + 1), + EndLine: int32(end.Row + 1), EndColumn: int32(end.Column + 1), + } +} + +func semanticPackage(language, path string, root *sitter.Node, body []byte) string { + var packageName string + walkSyntax(root, func(node *sitter.Node) { + if packageName != "" { + return + } + switch node.Type() { + case "package_clause", "package_declaration", "package_header", "namespace_declaration", "file_scoped_namespace_declaration": + if name := node.ChildByFieldName("name"); name != nil && !name.IsNull() { + packageName = strings.TrimSpace(name.Content(body)) + return + } + value := strings.TrimSpace(node.Content(body)) + for _, prefix := range []string{"package", "namespace"} { + value = strings.TrimSpace(strings.TrimPrefix(value, prefix)) + } + packageName = strings.TrimSuffix(value, ";") + } + }) + if packageName != "" { + return packageName + } + module := strings.TrimSuffix(filepath.ToSlash(path), filepath.Ext(path)) + module = strings.TrimSuffix(module, "/index") + return strings.ReplaceAll(module, "/", ".") +} + +func qualifySemanticName(packageName, parent, name string) string { + if parent != "" { + return parent + "." + name + } + if packageName != "" { + return packageName + "." + name + } + return name +} + +func semanticCallable(kind basev0.SemanticSymbolKind) bool { + return kind == basev0.SemanticSymbolKind_SEMANTIC_SYMBOL_KIND_FUNCTION || kind == basev0.SemanticSymbolKind_SEMANTIC_SYMBOL_KIND_METHOD +} + +func semanticDataDeclaration(kind basev0.SemanticSymbolKind) bool { + switch kind { + case basev0.SemanticSymbolKind_SEMANTIC_SYMBOL_KIND_FIELD, + basev0.SemanticSymbolKind_SEMANTIC_SYMBOL_KIND_VARIABLE, + basev0.SemanticSymbolKind_SEMANTIC_SYMBOL_KIND_CONSTANT: + return true + default: + return false + } +} + +func semanticContainer(kind basev0.SemanticSymbolKind) bool { + switch kind { + case basev0.SemanticSymbolKind_SEMANTIC_SYMBOL_KIND_CLASS, + basev0.SemanticSymbolKind_SEMANTIC_SYMBOL_KIND_STRUCT, + basev0.SemanticSymbolKind_SEMANTIC_SYMBOL_KIND_INTERFACE, + basev0.SemanticSymbolKind_SEMANTIC_SYMBOL_KIND_ENUM: + return true + default: + return false + } +} + +func isNestedSemanticBody(parent, child *sitter.Node) bool { + body := semanticBodyNode(parent) + return body != nil && !body.IsNull() && body.StartByte() == child.StartByte() && body.EndByte() == child.EndByte() +} + +func insideCallable(node *sitter.Node) bool { + for parent := node.Parent(); parent != nil && !parent.IsNull(); parent = parent.Parent() { + switch parent.Type() { + case "function_declaration", "function_definition", "method_declaration", "method_definition", "constructor_declaration": + return true + } + } + return false +} + +func insideSemanticContainer(node *sitter.Node) bool { + for parent := node.Parent(); parent != nil && !parent.IsNull(); parent = parent.Parent() { + if kind, ok := semanticDeclarationKind("python", parent.Type()); ok && semanticContainer(kind) { + return true + } + if kind, ok := semanticDeclarationKind("kotlin", parent.Type()); ok && semanticContainer(kind) { + return true + } + } + return false +} + +func goReceiverName(node *sitter.Node, body []byte) string { + receiver := node.ChildByFieldName("receiver") + if receiver == nil || receiver.IsNull() { + return "" + } + result := "" + walkSyntax(receiver, func(candidate *sitter.Node) { + if candidate.Type() == "type_identifier" { + result = strings.TrimSpace(candidate.Content(body)) + } + }) + return result +} + +func semanticUses(language, path string, declaration *sitter.Node, body []byte, calls bool) []*basev0.SemanticUse { + seen := make(map[string]struct{}) + var result []*basev0.SemanticUse + var visit func(*sitter.Node, bool) + visit = func(node *sitter.Node, root bool) { + if node == nil || node.IsNull() { + return + } + if !root { + if _, nested := semanticDeclarationKind(language, node.Type()); nested { + return + } + } + var name string + if calls { + name = semanticCallName(node, body) + } else if semanticTypeNode(node.Type()) { + name = cleanSemanticName(node.Content(body)) + } + if name == "" { + for index := 0; index < int(node.NamedChildCount()); index++ { + visit(node.NamedChild(index), false) + } + return + } + key := name + "\x00" + strconv.FormatUint(uint64(node.StartByte()), 10) + if _, duplicate := seen[key]; !duplicate { + seen[key] = struct{}{} + result = append(result, &basev0.SemanticUse{Name: name, Location: semanticLocation(path, node)}) + } + for index := 0; index < int(node.NamedChildCount()); index++ { + visit(node.NamedChild(index), false) + } + } + visit(declaration, true) + sort.Slice(result, func(i, j int) bool { + if result[i].GetLocation().GetStartLine() != result[j].GetLocation().GetStartLine() { + return result[i].GetLocation().GetStartLine() < result[j].GetLocation().GetStartLine() + } + return result[i].GetName() < result[j].GetName() + }) + return result +} + +func semanticCallName(node *sitter.Node, body []byte) string { + var target *sitter.Node + switch node.Type() { + case "call", "call_expression", "invocation_expression": + target = node.ChildByFieldName("function") + if target == nil || target.IsNull() { + target = node.NamedChild(0) + } + case "method_invocation": + name := node.ChildByFieldName("name") + object := node.ChildByFieldName("object") + if name == nil || name.IsNull() { + return "" + } + value := strings.TrimSpace(name.Content(body)) + if object != nil && !object.IsNull() { + value = strings.TrimSpace(object.Content(body)) + "." + value + } + return cleanSemanticName(value) + default: + return "" + } + if target == nil || target.IsNull() { + return "" + } + return cleanSemanticName(target.Content(body)) +} + +func cleanSemanticName(value string) string { + value = strings.TrimSpace(value) + value = strings.TrimPrefix(value, "new ") + var out strings.Builder + for _, r := range value { + if unicode.IsLetter(r) || unicode.IsDigit(r) || r == '_' || r == '.' || r == ':' { + out.WriteRune(r) + continue + } + if out.Len() > 0 { + break + } + } + return strings.Trim(out.String(), ".:") +} + +func semanticTypeNode(nodeType string) bool { + switch nodeType { + case "type_identifier", "generic_type", "user_type", "nullable_type", "predefined_type": + return true + default: + return false + } +} + +func semanticImports(language, path string, root *sitter.Node, body []byte) []string { + switch language { + case "go": + parsed, err := parser.ParseFile(token.NewFileSet(), path, body, parser.ImportsOnly) + if err != nil { + return nil + } + imports := make([]string, 0, len(parsed.Imports)) + for _, declaration := range parsed.Imports { + if value, err := strconv.Unquote(declaration.Path.Value); err == nil { + imports = append(imports, value) + } + } + return canonicalImports(imports) + case "python": + return canonicalImports(extractPythonImports(root, body)) + case "typescript": + return canonicalImports(extractTypeScriptImports(root, body)) + case "java", "kotlin": + return canonicalImports(extractJVMImports(root, body)) + case "csharp": + return canonicalImports(extractCSharpImports(root, body)) + default: + return nil + } +} diff --git a/code/semantic_index_test.go b/code/semantic_index_test.go new file mode 100644 index 00000000..309ffa01 --- /dev/null +++ b/code/semantic_index_test.go @@ -0,0 +1,194 @@ +package code + +import ( + "os" + "path/filepath" + "slices" + "strings" + "testing" + + basev0 "github.com/codefly-dev/core/generated/go/codefly/base/v0" + codev0 "github.com/codefly-dev/core/generated/go/codefly/services/code/v0" + toolingv0 "github.com/codefly-dev/core/generated/go/codefly/services/tooling/v0" + "google.golang.org/protobuf/encoding/protojson" +) + +func TestSemanticIndexProjectsSupportedLanguagesWithoutBodies(t *testing.T) { + root := t.TempDir() + files := map[string]string{ + "go/main.go": `package api +import "fmt" +const DefaultPrefix = "prefix-body-must-not-cross" +var Current = DefaultPrefix +type Server struct{} +func (s *Server) Handle(value string) string { return fmt.Sprint(value) } +`, + "python/app.py": `import requests +class Client: + def fetch(self, url: str): + return requests.get(url, headers={"X-Body-Secret": "never-cross"}) +`, + "web/service.ts": `import {load} from "./loader"; +export class Service { run(id: string): string { return load(id); } } +`, + "jvm/Worker.java": `package demo.worker; +import java.time.Instant; +class Worker { Instant run() { return Instant.now(); } } +`, + "jvm/Queue.kt": `package demo.queue +import java.util.UUID +class Queue +`, + "dotnet/Cart.cs": `using System; +namespace Shop.Cart; +public class Cart { public string Id() { return Guid.NewGuid().ToString(); } } +`, + } + for name, body := range files { + path := filepath.Join(root, filepath.FromSlash(name)) + if err := os.MkdirAll(filepath.Dir(path), 0o755); err != nil { + t.Fatal(err) + } + if err := os.WriteFile(path, []byte(body), 0o644); err != nil { + t.Fatal(err) + } + } + + server := NewDefaultCodeServer(root) + response, err := server.Execute(t.Context(), &codev0.CodeRequest{Operation: &codev0.CodeRequest_GetSemanticIndex{GetSemanticIndex: &codev0.GetSemanticIndexRequest{}}}) + if err != nil { + t.Fatal(err) + } + index := response.GetGetSemanticIndex() + if index == nil || index.GetState() != basev0.SemanticIndexState_SEMANTIC_INDEX_STATE_COMPLETE { + encoded, _ := protojson.Marshal(index) + t.Fatalf("semantic index = %s, failure = %#v", encoded, response.GetFailure()) + } + wantLanguages := []string{"csharp", "go", "java", "kotlin", "python", "typescript"} + if !slices.Equal(index.GetLanguages(), wantLanguages) { + t.Fatalf("languages = %v, want %v", index.GetLanguages(), wantLanguages) + } + for _, file := range index.GetFiles() { + if file.GetPath() == "" || len(file.GetContentSha256()) != 64 || file.GetByteSize() == 0 { + t.Fatalf("invalid semantic file: %#v", file) + } + } + for _, want := range []string{"api.Server", "api.Server.Handle", "python.app.Client", "python.app.Client.fetch", "web.service.Service", "web.service.Service.run", "demo.worker.Worker", "demo.worker.Worker.run", "demo.queue.Queue", "Shop.Cart.Cart", "Shop.Cart.Cart.Id"} { + if !hasSemanticQualifiedName(index, want) { + t.Errorf("missing semantic symbol %q; got %v", want, semanticQualifiedNames(index)) + } + } + encoded, err := protojson.Marshal(index) + if err != nil { + t.Fatal(err) + } + if strings.Contains(string(encoded), "X-Body-Secret") || strings.Contains(string(encoded), "never-cross") { + t.Fatalf("implementation body crossed semantic boundary: %s", encoded) + } + if strings.Contains(string(encoded), "prefix-body-must-not-cross") { + t.Fatalf("data initializer crossed semantic boundary: %s", encoded) + } + for _, want := range []struct{ symbol, call string }{ + {symbol: "api.Server.Handle", call: "fmt.Sprint"}, + {symbol: "python.app.Client.fetch", call: "requests.get"}, + {symbol: "web.service.Service.run", call: "load"}, + {symbol: "demo.worker.Worker.run", call: "Instant.now"}, + {symbol: "Shop.Cart.Cart.Id", call: "Guid.NewGuid"}, + } { + if !semanticSymbolHasCall(index, want.symbol, want.call) { + t.Errorf("%s missing call %s", want.symbol, want.call) + } + } + if got := semanticFile(index, "go/main.go").GetImports(); !slices.Equal(got, []string{"fmt"}) { + t.Fatalf("Go imports = %v", got) + } + if got := semanticFile(index, "dotnet/Cart.cs").GetImports(); !slices.Equal(got, []string{"System"}) { + t.Fatalf("C# imports = %v", got) + } +} + +func TestSemanticIndexReportsDegradedAndNotAttemptedCoverage(t *testing.T) { + t.Run("degraded", func(t *testing.T) { + root := t.TempDir() + if err := os.WriteFile(filepath.Join(root, "broken.py"), []byte("def broken(:\n"), 0o644); err != nil { + t.Fatal(err) + } + response, err := NewDefaultCodeServer(root).Execute(t.Context(), &codev0.CodeRequest{Operation: &codev0.CodeRequest_GetSemanticIndex{GetSemanticIndex: &codev0.GetSemanticIndexRequest{}}}) + if err != nil { + t.Fatal(err) + } + index := response.GetGetSemanticIndex() + if index.GetState() != basev0.SemanticIndexState_SEMANTIC_INDEX_STATE_DEGRADED || len(index.GetIssues()) != 1 || len(index.GetFiles()) != 1 { + t.Fatalf("index = %#v", index) + } + }) + + t.Run("not attempted", func(t *testing.T) { + root := t.TempDir() + if err := os.WriteFile(filepath.Join(root, "main.rb"), []byte("puts 'hello'\n"), 0o644); err != nil { + t.Fatal(err) + } + response, err := NewDefaultCodeServer(root).Execute(t.Context(), &codev0.CodeRequest{Operation: &codev0.CodeRequest_GetSemanticIndex{GetSemanticIndex: &codev0.GetSemanticIndexRequest{}}}) + if err != nil { + t.Fatal(err) + } + index := response.GetGetSemanticIndex() + if index.GetState() != basev0.SemanticIndexState_SEMANTIC_INDEX_STATE_NOT_ATTEMPTED || index.GetIssues()[0].GetCode() != "unsupported_source" { + t.Fatalf("index = %#v", index) + } + }) +} + +func TestSourceToolingDelegatesSemanticIndex(t *testing.T) { + root := t.TempDir() + if err := os.WriteFile(filepath.Join(root, "main.go"), []byte("package main\nfunc main() {}\n"), 0o644); err != nil { + t.Fatal(err) + } + response, err := NewSourceTooling(NewDefaultCodeServer(root)).GetSemanticIndex(t.Context(), &toolingv0.GetSemanticIndexRequest{}) + if err != nil { + t.Fatal(err) + } + if response.GetFailure() != nil || response.GetIndex().GetState() != basev0.SemanticIndexState_SEMANTIC_INDEX_STATE_COMPLETE || !hasSemanticQualifiedName(response.GetIndex(), "main.main") { + t.Fatalf("tooling response = %#v", response) + } +} + +func semanticFile(index *basev0.SemanticIndex, path string) *basev0.SemanticFile { + for _, file := range index.GetFiles() { + if file.GetPath() == path { + return file + } + } + return nil +} + +func hasSemanticQualifiedName(index *basev0.SemanticIndex, name string) bool { + for _, symbol := range index.GetSymbols() { + if symbol.GetQualifiedName() == name { + return true + } + } + return false +} + +func semanticQualifiedNames(index *basev0.SemanticIndex) []string { + result := make([]string, 0, len(index.GetSymbols())) + for _, symbol := range index.GetSymbols() { + result = append(result, symbol.GetQualifiedName()) + } + return result +} + +func semanticSymbolHasCall(index *basev0.SemanticIndex, qualifiedName, call string) bool { + for _, symbol := range index.GetSymbols() { + if symbol.GetQualifiedName() != qualifiedName { + continue + } + for _, use := range symbol.GetCalls() { + if use.GetName() == call { + return true + } + } + } + return false +} diff --git a/code/server.go b/code/server.go index f4b0f5fa..1dc14a43 100644 --- a/code/server.go +++ b/code/server.go @@ -252,6 +252,8 @@ func (s *DefaultCodeServer) dispatch(ctx context.Context, req *codev0.CodeReques return s.getProjectInfo(ctx, op.GetProjectInfo) case *codev0.CodeRequest_DiscoverCodeUnits: return s.discoverCodeUnits(ctx, op.DiscoverCodeUnits) + case *codev0.CodeRequest_GetSemanticIndex: + return s.getSemanticIndex(ctx, op.GetSemanticIndex) case *codev0.CodeRequest_Fix: return s.fixDefault(ctx, op.Fix) @@ -1011,6 +1013,8 @@ func OperationName(req *codev0.CodeRequest) string { return "get_project_info" case *codev0.CodeRequest_DiscoverCodeUnits: return "discover_code_units" + case *codev0.CodeRequest_GetSemanticIndex: + return "get_semantic_index" case *codev0.CodeRequest_Fix: return "fix" // Dependency stubs diff --git a/code/server_test.go b/code/server_test.go index 13111d44..7b374e95 100644 --- a/code/server_test.go +++ b/code/server_test.go @@ -166,6 +166,7 @@ func TestOperationName(t *testing.T) { {&codev0.CodeRequest{Operation: &codev0.CodeRequest_ApplyEdit{}}, "apply_edit"}, {&codev0.CodeRequest{Operation: &codev0.CodeRequest_GetProjectInfo{}}, "get_project_info"}, {&codev0.CodeRequest{Operation: &codev0.CodeRequest_DiscoverCodeUnits{}}, "discover_code_units"}, + {&codev0.CodeRequest{Operation: &codev0.CodeRequest_GetSemanticIndex{}}, "get_semantic_index"}, {&codev0.CodeRequest{Operation: &codev0.CodeRequest_ListDependencies{}}, "list_dependencies"}, {&codev0.CodeRequest{}, ""}, } diff --git a/code/source_tooling.go b/code/source_tooling.go index 72a03b12..71c56d90 100644 --- a/code/source_tooling.go +++ b/code/source_tooling.go @@ -100,3 +100,18 @@ func (t *SourceTooling) GetProjectInfo(ctx context.Context, _ *toolingv0.GetProj FileHashes: info.GetFileHashes(), SourceFiles: sourceFiles, Failure: failures.Clone(response.GetFailure()), }, nil } + +// GetSemanticIndex delegates project inspection to Code and converts only the +// transport envelope. The shared semantic messages are not copied, parsed, or +// interpreted by the Tooling adapter. +func (t *SourceTooling) GetSemanticIndex(ctx context.Context, _ *toolingv0.GetSemanticIndexRequest) (*toolingv0.GetSemanticIndexResponse, error) { + response, err := t.code.Execute(ctx, &codev0.CodeRequest{Operation: &codev0.CodeRequest_GetSemanticIndex{GetSemanticIndex: &codev0.GetSemanticIndexRequest{}}}) + if err != nil { + return nil, fmt.Errorf("tooling get semantic index: %w", err) + } + index := response.GetGetSemanticIndex() + if index == nil { + return &toolingv0.GetSemanticIndexResponse{Failure: failures.Ensure(response.GetFailure(), basev0.FailureCode_FAILURE_CODE_INTERNAL, "tooling.get-semantic-index", "code service returned no semantic index")}, nil + } + return &toolingv0.GetSemanticIndexResponse{Index: index, Failure: failures.Clone(response.GetFailure())}, nil +} diff --git a/generated/go/codefly/base/v0/semantic.pb.go b/generated/go/codefly/base/v0/semantic.pb.go new file mode 100644 index 00000000..19429c66 --- /dev/null +++ b/generated/go/codefly/base/v0/semantic.pb.go @@ -0,0 +1,784 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.11 +// protoc (unknown) +// source: codefly/base/v0/semantic.proto + +package v0 + +import ( + reflect "reflect" + sync "sync" + unsafe "unsafe" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +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) +) + +// SemanticIndexState states how completely an agent inspected its attached +// source root. Consumers must never infer completeness from a non-empty list. +type SemanticIndexState int32 + +const ( + SemanticIndexState_SEMANTIC_INDEX_STATE_UNSPECIFIED SemanticIndexState = 0 + SemanticIndexState_SEMANTIC_INDEX_STATE_COMPLETE SemanticIndexState = 1 + SemanticIndexState_SEMANTIC_INDEX_STATE_DEGRADED SemanticIndexState = 2 + SemanticIndexState_SEMANTIC_INDEX_STATE_NOT_ATTEMPTED SemanticIndexState = 3 +) + +// Enum value maps for SemanticIndexState. +var ( + SemanticIndexState_name = map[int32]string{ + 0: "SEMANTIC_INDEX_STATE_UNSPECIFIED", + 1: "SEMANTIC_INDEX_STATE_COMPLETE", + 2: "SEMANTIC_INDEX_STATE_DEGRADED", + 3: "SEMANTIC_INDEX_STATE_NOT_ATTEMPTED", + } + SemanticIndexState_value = map[string]int32{ + "SEMANTIC_INDEX_STATE_UNSPECIFIED": 0, + "SEMANTIC_INDEX_STATE_COMPLETE": 1, + "SEMANTIC_INDEX_STATE_DEGRADED": 2, + "SEMANTIC_INDEX_STATE_NOT_ATTEMPTED": 3, + } +) + +func (x SemanticIndexState) Enum() *SemanticIndexState { + p := new(SemanticIndexState) + *p = x + return p +} + +func (x SemanticIndexState) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (SemanticIndexState) Descriptor() protoreflect.EnumDescriptor { + return file_codefly_base_v0_semantic_proto_enumTypes[0].Descriptor() +} + +func (SemanticIndexState) Type() protoreflect.EnumType { + return &file_codefly_base_v0_semantic_proto_enumTypes[0] +} + +func (x SemanticIndexState) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use SemanticIndexState.Descriptor instead. +func (SemanticIndexState) EnumDescriptor() ([]byte, []int) { + return file_codefly_base_v0_semantic_proto_rawDescGZIP(), []int{0} +} + +// SemanticSymbolKind is a language-neutral declaration category. +type SemanticSymbolKind int32 + +const ( + SemanticSymbolKind_SEMANTIC_SYMBOL_KIND_UNSPECIFIED SemanticSymbolKind = 0 + SemanticSymbolKind_SEMANTIC_SYMBOL_KIND_FUNCTION SemanticSymbolKind = 1 + SemanticSymbolKind_SEMANTIC_SYMBOL_KIND_METHOD SemanticSymbolKind = 2 + SemanticSymbolKind_SEMANTIC_SYMBOL_KIND_CLASS SemanticSymbolKind = 3 + SemanticSymbolKind_SEMANTIC_SYMBOL_KIND_STRUCT SemanticSymbolKind = 4 + SemanticSymbolKind_SEMANTIC_SYMBOL_KIND_INTERFACE SemanticSymbolKind = 5 + SemanticSymbolKind_SEMANTIC_SYMBOL_KIND_ENUM SemanticSymbolKind = 6 + SemanticSymbolKind_SEMANTIC_SYMBOL_KIND_FIELD SemanticSymbolKind = 7 + SemanticSymbolKind_SEMANTIC_SYMBOL_KIND_VARIABLE SemanticSymbolKind = 8 + SemanticSymbolKind_SEMANTIC_SYMBOL_KIND_CONSTANT SemanticSymbolKind = 9 + SemanticSymbolKind_SEMANTIC_SYMBOL_KIND_TYPE_ALIAS SemanticSymbolKind = 10 + SemanticSymbolKind_SEMANTIC_SYMBOL_KIND_MODULE SemanticSymbolKind = 11 +) + +// Enum value maps for SemanticSymbolKind. +var ( + SemanticSymbolKind_name = map[int32]string{ + 0: "SEMANTIC_SYMBOL_KIND_UNSPECIFIED", + 1: "SEMANTIC_SYMBOL_KIND_FUNCTION", + 2: "SEMANTIC_SYMBOL_KIND_METHOD", + 3: "SEMANTIC_SYMBOL_KIND_CLASS", + 4: "SEMANTIC_SYMBOL_KIND_STRUCT", + 5: "SEMANTIC_SYMBOL_KIND_INTERFACE", + 6: "SEMANTIC_SYMBOL_KIND_ENUM", + 7: "SEMANTIC_SYMBOL_KIND_FIELD", + 8: "SEMANTIC_SYMBOL_KIND_VARIABLE", + 9: "SEMANTIC_SYMBOL_KIND_CONSTANT", + 10: "SEMANTIC_SYMBOL_KIND_TYPE_ALIAS", + 11: "SEMANTIC_SYMBOL_KIND_MODULE", + } + SemanticSymbolKind_value = map[string]int32{ + "SEMANTIC_SYMBOL_KIND_UNSPECIFIED": 0, + "SEMANTIC_SYMBOL_KIND_FUNCTION": 1, + "SEMANTIC_SYMBOL_KIND_METHOD": 2, + "SEMANTIC_SYMBOL_KIND_CLASS": 3, + "SEMANTIC_SYMBOL_KIND_STRUCT": 4, + "SEMANTIC_SYMBOL_KIND_INTERFACE": 5, + "SEMANTIC_SYMBOL_KIND_ENUM": 6, + "SEMANTIC_SYMBOL_KIND_FIELD": 7, + "SEMANTIC_SYMBOL_KIND_VARIABLE": 8, + "SEMANTIC_SYMBOL_KIND_CONSTANT": 9, + "SEMANTIC_SYMBOL_KIND_TYPE_ALIAS": 10, + "SEMANTIC_SYMBOL_KIND_MODULE": 11, + } +) + +func (x SemanticSymbolKind) Enum() *SemanticSymbolKind { + p := new(SemanticSymbolKind) + *p = x + return p +} + +func (x SemanticSymbolKind) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (SemanticSymbolKind) Descriptor() protoreflect.EnumDescriptor { + return file_codefly_base_v0_semantic_proto_enumTypes[1].Descriptor() +} + +func (SemanticSymbolKind) Type() protoreflect.EnumType { + return &file_codefly_base_v0_semantic_proto_enumTypes[1] +} + +func (x SemanticSymbolKind) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use SemanticSymbolKind.Descriptor instead. +func (SemanticSymbolKind) EnumDescriptor() ([]byte, []int) { + return file_codefly_base_v0_semantic_proto_rawDescGZIP(), []int{1} +} + +// SemanticLocation identifies a declaration or use without exposing source +// bytes. Lines and columns are one-based and inclusive. +type SemanticLocation struct { + state protoimpl.MessageState `protogen:"open.v1"` + Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` + StartLine int32 `protobuf:"varint,2,opt,name=start_line,json=startLine,proto3" json:"start_line,omitempty"` + StartColumn int32 `protobuf:"varint,3,opt,name=start_column,json=startColumn,proto3" json:"start_column,omitempty"` + EndLine int32 `protobuf:"varint,4,opt,name=end_line,json=endLine,proto3" json:"end_line,omitempty"` + EndColumn int32 `protobuf:"varint,5,opt,name=end_column,json=endColumn,proto3" json:"end_column,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SemanticLocation) Reset() { + *x = SemanticLocation{} + mi := &file_codefly_base_v0_semantic_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SemanticLocation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SemanticLocation) ProtoMessage() {} + +func (x *SemanticLocation) ProtoReflect() protoreflect.Message { + mi := &file_codefly_base_v0_semantic_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SemanticLocation.ProtoReflect.Descriptor instead. +func (*SemanticLocation) Descriptor() ([]byte, []int) { + return file_codefly_base_v0_semantic_proto_rawDescGZIP(), []int{0} +} + +func (x *SemanticLocation) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +func (x *SemanticLocation) GetStartLine() int32 { + if x != nil { + return x.StartLine + } + return 0 +} + +func (x *SemanticLocation) GetStartColumn() int32 { + if x != nil { + return x.StartColumn + } + return 0 +} + +func (x *SemanticLocation) GetEndLine() int32 { + if x != nil { + return x.EndLine + } + return 0 +} + +func (x *SemanticLocation) GetEndColumn() int32 { + if x != nil { + return x.EndColumn + } + return 0 +} + +// SemanticUse is unresolved analyzer evidence attached to one declaration. +// Resolution across files and code units remains a brain concern. +type SemanticUse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Location *SemanticLocation `protobuf:"bytes,2,opt,name=location,proto3" json:"location,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SemanticUse) Reset() { + *x = SemanticUse{} + mi := &file_codefly_base_v0_semantic_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SemanticUse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SemanticUse) ProtoMessage() {} + +func (x *SemanticUse) ProtoReflect() protoreflect.Message { + mi := &file_codefly_base_v0_semantic_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SemanticUse.ProtoReflect.Descriptor instead. +func (*SemanticUse) Descriptor() ([]byte, []int) { + return file_codefly_base_v0_semantic_proto_rawDescGZIP(), []int{1} +} + +func (x *SemanticUse) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *SemanticUse) GetLocation() *SemanticLocation { + if x != nil { + return x.Location + } + return nil +} + +// SemanticFile is the typed projection of one source file. It intentionally +// contains no source body. +type SemanticFile struct { + state protoimpl.MessageState `protogen:"open.v1"` + Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` + ContentSha256 string `protobuf:"bytes,2,opt,name=content_sha256,json=contentSha256,proto3" json:"content_sha256,omitempty"` + ByteSize int64 `protobuf:"varint,3,opt,name=byte_size,json=byteSize,proto3" json:"byte_size,omitempty"` + Imports []string `protobuf:"bytes,4,rep,name=imports,proto3" json:"imports,omitempty"` + Language string `protobuf:"bytes,5,opt,name=language,proto3" json:"language,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SemanticFile) Reset() { + *x = SemanticFile{} + mi := &file_codefly_base_v0_semantic_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SemanticFile) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SemanticFile) ProtoMessage() {} + +func (x *SemanticFile) ProtoReflect() protoreflect.Message { + mi := &file_codefly_base_v0_semantic_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SemanticFile.ProtoReflect.Descriptor instead. +func (*SemanticFile) Descriptor() ([]byte, []int) { + return file_codefly_base_v0_semantic_proto_rawDescGZIP(), []int{2} +} + +func (x *SemanticFile) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +func (x *SemanticFile) GetContentSha256() string { + if x != nil { + return x.ContentSha256 + } + return "" +} + +func (x *SemanticFile) GetByteSize() int64 { + if x != nil { + return x.ByteSize + } + return 0 +} + +func (x *SemanticFile) GetImports() []string { + if x != nil { + return x.Imports + } + return nil +} + +func (x *SemanticFile) GetLanguage() string { + if x != nil { + return x.Language + } + return "" +} + +// SemanticSymbol is a declaration projected by the owning Codefly analyzer. +// Signature is bounded declaration evidence; implementation bodies never +// cross the agent boundary and are represented only by body_sha256. +type SemanticSymbol struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + QualifiedName string `protobuf:"bytes,2,opt,name=qualified_name,json=qualifiedName,proto3" json:"qualified_name,omitempty"` + Kind SemanticSymbolKind `protobuf:"varint,3,opt,name=kind,proto3,enum=codefly.base.v0.SemanticSymbolKind" json:"kind,omitempty"` + Location *SemanticLocation `protobuf:"bytes,4,opt,name=location,proto3" json:"location,omitempty"` + Package string `protobuf:"bytes,5,opt,name=package,proto3" json:"package,omitempty"` + ParentQualifiedName string `protobuf:"bytes,6,opt,name=parent_qualified_name,json=parentQualifiedName,proto3" json:"parent_qualified_name,omitempty"` + Signature string `protobuf:"bytes,7,opt,name=signature,proto3" json:"signature,omitempty"` + SignatureSha256 string `protobuf:"bytes,8,opt,name=signature_sha256,json=signatureSha256,proto3" json:"signature_sha256,omitempty"` + BodySha256 string `protobuf:"bytes,9,opt,name=body_sha256,json=bodySha256,proto3" json:"body_sha256,omitempty"` + Calls []*SemanticUse `protobuf:"bytes,10,rep,name=calls,proto3" json:"calls,omitempty"` + References []*SemanticUse `protobuf:"bytes,11,rep,name=references,proto3" json:"references,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SemanticSymbol) Reset() { + *x = SemanticSymbol{} + mi := &file_codefly_base_v0_semantic_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SemanticSymbol) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SemanticSymbol) ProtoMessage() {} + +func (x *SemanticSymbol) ProtoReflect() protoreflect.Message { + mi := &file_codefly_base_v0_semantic_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SemanticSymbol.ProtoReflect.Descriptor instead. +func (*SemanticSymbol) Descriptor() ([]byte, []int) { + return file_codefly_base_v0_semantic_proto_rawDescGZIP(), []int{3} +} + +func (x *SemanticSymbol) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *SemanticSymbol) GetQualifiedName() string { + if x != nil { + return x.QualifiedName + } + return "" +} + +func (x *SemanticSymbol) GetKind() SemanticSymbolKind { + if x != nil { + return x.Kind + } + return SemanticSymbolKind_SEMANTIC_SYMBOL_KIND_UNSPECIFIED +} + +func (x *SemanticSymbol) GetLocation() *SemanticLocation { + if x != nil { + return x.Location + } + return nil +} + +func (x *SemanticSymbol) GetPackage() string { + if x != nil { + return x.Package + } + return "" +} + +func (x *SemanticSymbol) GetParentQualifiedName() string { + if x != nil { + return x.ParentQualifiedName + } + return "" +} + +func (x *SemanticSymbol) GetSignature() string { + if x != nil { + return x.Signature + } + return "" +} + +func (x *SemanticSymbol) GetSignatureSha256() string { + if x != nil { + return x.SignatureSha256 + } + return "" +} + +func (x *SemanticSymbol) GetBodySha256() string { + if x != nil { + return x.BodySha256 + } + return "" +} + +func (x *SemanticSymbol) GetCalls() []*SemanticUse { + if x != nil { + return x.Calls + } + return nil +} + +func (x *SemanticSymbol) GetReferences() []*SemanticUse { + if x != nil { + return x.References + } + return nil +} + +// SemanticIssue preserves per-file analyzer failures without converting a +// partially useful index into an untyped transport error. +type SemanticIssue struct { + state protoimpl.MessageState `protogen:"open.v1"` + Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SemanticIssue) Reset() { + *x = SemanticIssue{} + mi := &file_codefly_base_v0_semantic_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SemanticIssue) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SemanticIssue) ProtoMessage() {} + +func (x *SemanticIssue) ProtoReflect() protoreflect.Message { + mi := &file_codefly_base_v0_semantic_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SemanticIssue.ProtoReflect.Descriptor instead. +func (*SemanticIssue) Descriptor() ([]byte, []int) { + return file_codefly_base_v0_semantic_proto_rawDescGZIP(), []int{4} +} + +func (x *SemanticIssue) GetCode() string { + if x != nil { + return x.Code + } + return "" +} + +func (x *SemanticIssue) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *SemanticIssue) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +// SemanticIndex is one deterministic, body-free projection of an attached +// source root. Analyzer provenance is part of the contract and cache key. +type SemanticIndex struct { + state protoimpl.MessageState `protogen:"open.v1"` + State SemanticIndexState `protobuf:"varint,1,opt,name=state,proto3,enum=codefly.base.v0.SemanticIndexState" json:"state,omitempty"` + Analyzer string `protobuf:"bytes,2,opt,name=analyzer,proto3" json:"analyzer,omitempty"` + AnalyzerVersion string `protobuf:"bytes,3,opt,name=analyzer_version,json=analyzerVersion,proto3" json:"analyzer_version,omitempty"` + Languages []string `protobuf:"bytes,4,rep,name=languages,proto3" json:"languages,omitempty"` + Files []*SemanticFile `protobuf:"bytes,5,rep,name=files,proto3" json:"files,omitempty"` + Symbols []*SemanticSymbol `protobuf:"bytes,6,rep,name=symbols,proto3" json:"symbols,omitempty"` + Issues []*SemanticIssue `protobuf:"bytes,7,rep,name=issues,proto3" json:"issues,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SemanticIndex) Reset() { + *x = SemanticIndex{} + mi := &file_codefly_base_v0_semantic_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SemanticIndex) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SemanticIndex) ProtoMessage() {} + +func (x *SemanticIndex) ProtoReflect() protoreflect.Message { + mi := &file_codefly_base_v0_semantic_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SemanticIndex.ProtoReflect.Descriptor instead. +func (*SemanticIndex) Descriptor() ([]byte, []int) { + return file_codefly_base_v0_semantic_proto_rawDescGZIP(), []int{5} +} + +func (x *SemanticIndex) GetState() SemanticIndexState { + if x != nil { + return x.State + } + return SemanticIndexState_SEMANTIC_INDEX_STATE_UNSPECIFIED +} + +func (x *SemanticIndex) GetAnalyzer() string { + if x != nil { + return x.Analyzer + } + return "" +} + +func (x *SemanticIndex) GetAnalyzerVersion() string { + if x != nil { + return x.AnalyzerVersion + } + return "" +} + +func (x *SemanticIndex) GetLanguages() []string { + if x != nil { + return x.Languages + } + return nil +} + +func (x *SemanticIndex) GetFiles() []*SemanticFile { + if x != nil { + return x.Files + } + return nil +} + +func (x *SemanticIndex) GetSymbols() []*SemanticSymbol { + if x != nil { + return x.Symbols + } + return nil +} + +func (x *SemanticIndex) GetIssues() []*SemanticIssue { + if x != nil { + return x.Issues + } + return nil +} + +var File_codefly_base_v0_semantic_proto protoreflect.FileDescriptor + +const file_codefly_base_v0_semantic_proto_rawDesc = "" + + "\n" + + "\x1ecodefly/base/v0/semantic.proto\x12\x0fcodefly.base.v0\"\xa2\x01\n" + + "\x10SemanticLocation\x12\x12\n" + + "\x04path\x18\x01 \x01(\tR\x04path\x12\x1d\n" + + "\n" + + "start_line\x18\x02 \x01(\x05R\tstartLine\x12!\n" + + "\fstart_column\x18\x03 \x01(\x05R\vstartColumn\x12\x19\n" + + "\bend_line\x18\x04 \x01(\x05R\aendLine\x12\x1d\n" + + "\n" + + "end_column\x18\x05 \x01(\x05R\tendColumn\"`\n" + + "\vSemanticUse\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12=\n" + + "\blocation\x18\x02 \x01(\v2!.codefly.base.v0.SemanticLocationR\blocation\"\x9c\x01\n" + + "\fSemanticFile\x12\x12\n" + + "\x04path\x18\x01 \x01(\tR\x04path\x12%\n" + + "\x0econtent_sha256\x18\x02 \x01(\tR\rcontentSha256\x12\x1b\n" + + "\tbyte_size\x18\x03 \x01(\x03R\bbyteSize\x12\x18\n" + + "\aimports\x18\x04 \x03(\tR\aimports\x12\x1a\n" + + "\blanguage\x18\x05 \x01(\tR\blanguage\"\xed\x03\n" + + "\x0eSemanticSymbol\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12%\n" + + "\x0equalified_name\x18\x02 \x01(\tR\rqualifiedName\x127\n" + + "\x04kind\x18\x03 \x01(\x0e2#.codefly.base.v0.SemanticSymbolKindR\x04kind\x12=\n" + + "\blocation\x18\x04 \x01(\v2!.codefly.base.v0.SemanticLocationR\blocation\x12\x18\n" + + "\apackage\x18\x05 \x01(\tR\apackage\x122\n" + + "\x15parent_qualified_name\x18\x06 \x01(\tR\x13parentQualifiedName\x12\x1c\n" + + "\tsignature\x18\a \x01(\tR\tsignature\x12)\n" + + "\x10signature_sha256\x18\b \x01(\tR\x0fsignatureSha256\x12\x1f\n" + + "\vbody_sha256\x18\t \x01(\tR\n" + + "bodySha256\x122\n" + + "\x05calls\x18\n" + + " \x03(\v2\x1c.codefly.base.v0.SemanticUseR\x05calls\x12<\n" + + "\n" + + "references\x18\v \x03(\v2\x1c.codefly.base.v0.SemanticUseR\n" + + "references\"Q\n" + + "\rSemanticIssue\x12\x12\n" + + "\x04code\x18\x01 \x01(\tR\x04code\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage\x12\x12\n" + + "\x04path\x18\x03 \x01(\tR\x04path\"\xd7\x02\n" + + "\rSemanticIndex\x129\n" + + "\x05state\x18\x01 \x01(\x0e2#.codefly.base.v0.SemanticIndexStateR\x05state\x12\x1a\n" + + "\banalyzer\x18\x02 \x01(\tR\banalyzer\x12)\n" + + "\x10analyzer_version\x18\x03 \x01(\tR\x0fanalyzerVersion\x12\x1c\n" + + "\tlanguages\x18\x04 \x03(\tR\tlanguages\x123\n" + + "\x05files\x18\x05 \x03(\v2\x1d.codefly.base.v0.SemanticFileR\x05files\x129\n" + + "\asymbols\x18\x06 \x03(\v2\x1f.codefly.base.v0.SemanticSymbolR\asymbols\x126\n" + + "\x06issues\x18\a \x03(\v2\x1e.codefly.base.v0.SemanticIssueR\x06issues*\xa8\x01\n" + + "\x12SemanticIndexState\x12$\n" + + " SEMANTIC_INDEX_STATE_UNSPECIFIED\x10\x00\x12!\n" + + "\x1dSEMANTIC_INDEX_STATE_COMPLETE\x10\x01\x12!\n" + + "\x1dSEMANTIC_INDEX_STATE_DEGRADED\x10\x02\x12&\n" + + "\"SEMANTIC_INDEX_STATE_NOT_ATTEMPTED\x10\x03*\xae\x03\n" + + "\x12SemanticSymbolKind\x12$\n" + + " SEMANTIC_SYMBOL_KIND_UNSPECIFIED\x10\x00\x12!\n" + + "\x1dSEMANTIC_SYMBOL_KIND_FUNCTION\x10\x01\x12\x1f\n" + + "\x1bSEMANTIC_SYMBOL_KIND_METHOD\x10\x02\x12\x1e\n" + + "\x1aSEMANTIC_SYMBOL_KIND_CLASS\x10\x03\x12\x1f\n" + + "\x1bSEMANTIC_SYMBOL_KIND_STRUCT\x10\x04\x12\"\n" + + "\x1eSEMANTIC_SYMBOL_KIND_INTERFACE\x10\x05\x12\x1d\n" + + "\x19SEMANTIC_SYMBOL_KIND_ENUM\x10\x06\x12\x1e\n" + + "\x1aSEMANTIC_SYMBOL_KIND_FIELD\x10\a\x12!\n" + + "\x1dSEMANTIC_SYMBOL_KIND_VARIABLE\x10\b\x12!\n" + + "\x1dSEMANTIC_SYMBOL_KIND_CONSTANT\x10\t\x12#\n" + + "\x1fSEMANTIC_SYMBOL_KIND_TYPE_ALIAS\x10\n" + + "\x12\x1f\n" + + "\x1bSEMANTIC_SYMBOL_KIND_MODULE\x10\vB\xbc\x01\n" + + "\x13com.codefly.base.v0B\rSemanticProtoP\x01Z8github.com/codefly-dev/core/generated/go/codefly/base/v0\xa2\x02\x03CBV\xaa\x02\x0fCodefly.Base.V0\xca\x02\x0fCodefly\\Base\\V0\xe2\x02\x1bCodefly\\Base\\V0\\GPBMetadata\xea\x02\x11Codefly::Base::V0b\x06proto3" + +var ( + file_codefly_base_v0_semantic_proto_rawDescOnce sync.Once + file_codefly_base_v0_semantic_proto_rawDescData []byte +) + +func file_codefly_base_v0_semantic_proto_rawDescGZIP() []byte { + file_codefly_base_v0_semantic_proto_rawDescOnce.Do(func() { + file_codefly_base_v0_semantic_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_codefly_base_v0_semantic_proto_rawDesc), len(file_codefly_base_v0_semantic_proto_rawDesc))) + }) + return file_codefly_base_v0_semantic_proto_rawDescData +} + +var file_codefly_base_v0_semantic_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_codefly_base_v0_semantic_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_codefly_base_v0_semantic_proto_goTypes = []any{ + (SemanticIndexState)(0), // 0: codefly.base.v0.SemanticIndexState + (SemanticSymbolKind)(0), // 1: codefly.base.v0.SemanticSymbolKind + (*SemanticLocation)(nil), // 2: codefly.base.v0.SemanticLocation + (*SemanticUse)(nil), // 3: codefly.base.v0.SemanticUse + (*SemanticFile)(nil), // 4: codefly.base.v0.SemanticFile + (*SemanticSymbol)(nil), // 5: codefly.base.v0.SemanticSymbol + (*SemanticIssue)(nil), // 6: codefly.base.v0.SemanticIssue + (*SemanticIndex)(nil), // 7: codefly.base.v0.SemanticIndex +} +var file_codefly_base_v0_semantic_proto_depIdxs = []int32{ + 2, // 0: codefly.base.v0.SemanticUse.location:type_name -> codefly.base.v0.SemanticLocation + 1, // 1: codefly.base.v0.SemanticSymbol.kind:type_name -> codefly.base.v0.SemanticSymbolKind + 2, // 2: codefly.base.v0.SemanticSymbol.location:type_name -> codefly.base.v0.SemanticLocation + 3, // 3: codefly.base.v0.SemanticSymbol.calls:type_name -> codefly.base.v0.SemanticUse + 3, // 4: codefly.base.v0.SemanticSymbol.references:type_name -> codefly.base.v0.SemanticUse + 0, // 5: codefly.base.v0.SemanticIndex.state:type_name -> codefly.base.v0.SemanticIndexState + 4, // 6: codefly.base.v0.SemanticIndex.files:type_name -> codefly.base.v0.SemanticFile + 5, // 7: codefly.base.v0.SemanticIndex.symbols:type_name -> codefly.base.v0.SemanticSymbol + 6, // 8: codefly.base.v0.SemanticIndex.issues:type_name -> codefly.base.v0.SemanticIssue + 9, // [9:9] is the sub-list for method output_type + 9, // [9:9] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name +} + +func init() { file_codefly_base_v0_semantic_proto_init() } +func file_codefly_base_v0_semantic_proto_init() { + if File_codefly_base_v0_semantic_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_codefly_base_v0_semantic_proto_rawDesc), len(file_codefly_base_v0_semantic_proto_rawDesc)), + NumEnums: 2, + NumMessages: 6, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_codefly_base_v0_semantic_proto_goTypes, + DependencyIndexes: file_codefly_base_v0_semantic_proto_depIdxs, + EnumInfos: file_codefly_base_v0_semantic_proto_enumTypes, + MessageInfos: file_codefly_base_v0_semantic_proto_msgTypes, + }.Build() + File_codefly_base_v0_semantic_proto = out.File + file_codefly_base_v0_semantic_proto_goTypes = nil + file_codefly_base_v0_semantic_proto_depIdxs = nil +} diff --git a/generated/go/codefly/services/code/v0/code.pb.go b/generated/go/codefly/services/code/v0/code.pb.go index e6570550..b4cd20a3 100644 --- a/generated/go/codefly/services/code/v0/code.pb.go +++ b/generated/go/codefly/services/code/v0/code.pb.go @@ -1979,6 +1979,45 @@ func (x *GetProjectInfoResponse) GetSourceFiles() []*SourceFileInfo { return nil } +// GetSemanticIndexRequest asks the attached Codefly agent to project its +// source root into language-neutral semantic facts. Project bytes never leave +// the agent boundary. +type GetSemanticIndexRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetSemanticIndexRequest) Reset() { + *x = GetSemanticIndexRequest{} + mi := &file_codefly_services_code_v0_code_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetSemanticIndexRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetSemanticIndexRequest) ProtoMessage() {} + +func (x *GetSemanticIndexRequest) ProtoReflect() protoreflect.Message { + mi := &file_codefly_services_code_v0_code_proto_msgTypes[31] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetSemanticIndexRequest.ProtoReflect.Descriptor instead. +func (*GetSemanticIndexRequest) Descriptor() ([]byte, []int) { + return file_codefly_services_code_v0_code_proto_rawDescGZIP(), []int{31} +} + // DiscoverCodeUnitsRequest asks the language-neutral Code boundary to identify // independently routable source roots. Detection is structural only: it never // executes a build tool or claims semantic support. @@ -1990,7 +2029,7 @@ type DiscoverCodeUnitsRequest struct { func (x *DiscoverCodeUnitsRequest) Reset() { *x = DiscoverCodeUnitsRequest{} - mi := &file_codefly_services_code_v0_code_proto_msgTypes[31] + mi := &file_codefly_services_code_v0_code_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2002,7 +2041,7 @@ func (x *DiscoverCodeUnitsRequest) String() string { func (*DiscoverCodeUnitsRequest) ProtoMessage() {} func (x *DiscoverCodeUnitsRequest) ProtoReflect() protoreflect.Message { - mi := &file_codefly_services_code_v0_code_proto_msgTypes[31] + mi := &file_codefly_services_code_v0_code_proto_msgTypes[32] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2015,7 +2054,7 @@ func (x *DiscoverCodeUnitsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DiscoverCodeUnitsRequest.ProtoReflect.Descriptor instead. func (*DiscoverCodeUnitsRequest) Descriptor() ([]byte, []int) { - return file_codefly_services_code_v0_code_proto_rawDescGZIP(), []int{31} + return file_codefly_services_code_v0_code_proto_rawDescGZIP(), []int{32} } // CodeUnitInfo describes one source boundary and the evidence that established @@ -2042,7 +2081,7 @@ type CodeUnitInfo struct { func (x *CodeUnitInfo) Reset() { *x = CodeUnitInfo{} - mi := &file_codefly_services_code_v0_code_proto_msgTypes[32] + mi := &file_codefly_services_code_v0_code_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2054,7 +2093,7 @@ func (x *CodeUnitInfo) String() string { func (*CodeUnitInfo) ProtoMessage() {} func (x *CodeUnitInfo) ProtoReflect() protoreflect.Message { - mi := &file_codefly_services_code_v0_code_proto_msgTypes[32] + mi := &file_codefly_services_code_v0_code_proto_msgTypes[33] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2067,7 +2106,7 @@ func (x *CodeUnitInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use CodeUnitInfo.ProtoReflect.Descriptor instead. func (*CodeUnitInfo) Descriptor() ([]byte, []int) { - return file_codefly_services_code_v0_code_proto_rawDescGZIP(), []int{32} + return file_codefly_services_code_v0_code_proto_rawDescGZIP(), []int{33} } func (x *CodeUnitInfo) GetPath() string { @@ -2123,7 +2162,7 @@ type DiscoverCodeUnitsResponse struct { func (x *DiscoverCodeUnitsResponse) Reset() { *x = DiscoverCodeUnitsResponse{} - mi := &file_codefly_services_code_v0_code_proto_msgTypes[33] + mi := &file_codefly_services_code_v0_code_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2135,7 +2174,7 @@ func (x *DiscoverCodeUnitsResponse) String() string { func (*DiscoverCodeUnitsResponse) ProtoMessage() {} func (x *DiscoverCodeUnitsResponse) ProtoReflect() protoreflect.Message { - mi := &file_codefly_services_code_v0_code_proto_msgTypes[33] + mi := &file_codefly_services_code_v0_code_proto_msgTypes[34] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2148,7 +2187,7 @@ func (x *DiscoverCodeUnitsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use DiscoverCodeUnitsResponse.ProtoReflect.Descriptor instead. func (*DiscoverCodeUnitsResponse) Descriptor() ([]byte, []int) { - return file_codefly_services_code_v0_code_proto_rawDescGZIP(), []int{33} + return file_codefly_services_code_v0_code_proto_rawDescGZIP(), []int{34} } func (x *DiscoverCodeUnitsResponse) GetCodeUnits() []*CodeUnitInfo { @@ -2175,7 +2214,7 @@ type GitLogRequest struct { func (x *GitLogRequest) Reset() { *x = GitLogRequest{} - mi := &file_codefly_services_code_v0_code_proto_msgTypes[34] + mi := &file_codefly_services_code_v0_code_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2187,7 +2226,7 @@ func (x *GitLogRequest) String() string { func (*GitLogRequest) ProtoMessage() {} func (x *GitLogRequest) ProtoReflect() protoreflect.Message { - mi := &file_codefly_services_code_v0_code_proto_msgTypes[34] + mi := &file_codefly_services_code_v0_code_proto_msgTypes[35] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2200,7 +2239,7 @@ func (x *GitLogRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GitLogRequest.ProtoReflect.Descriptor instead. func (*GitLogRequest) Descriptor() ([]byte, []int) { - return file_codefly_services_code_v0_code_proto_rawDescGZIP(), []int{34} + return file_codefly_services_code_v0_code_proto_rawDescGZIP(), []int{35} } func (x *GitLogRequest) GetMaxCount() int32 { @@ -2252,7 +2291,7 @@ type GitCommit struct { func (x *GitCommit) Reset() { *x = GitCommit{} - mi := &file_codefly_services_code_v0_code_proto_msgTypes[35] + mi := &file_codefly_services_code_v0_code_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2264,7 +2303,7 @@ func (x *GitCommit) String() string { func (*GitCommit) ProtoMessage() {} func (x *GitCommit) ProtoReflect() protoreflect.Message { - mi := &file_codefly_services_code_v0_code_proto_msgTypes[35] + mi := &file_codefly_services_code_v0_code_proto_msgTypes[36] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2277,7 +2316,7 @@ func (x *GitCommit) ProtoReflect() protoreflect.Message { // Deprecated: Use GitCommit.ProtoReflect.Descriptor instead. func (*GitCommit) Descriptor() ([]byte, []int) { - return file_codefly_services_code_v0_code_proto_rawDescGZIP(), []int{35} + return file_codefly_services_code_v0_code_proto_rawDescGZIP(), []int{36} } func (x *GitCommit) GetHash() string { @@ -2333,7 +2372,7 @@ type GitLogResponse struct { func (x *GitLogResponse) Reset() { *x = GitLogResponse{} - mi := &file_codefly_services_code_v0_code_proto_msgTypes[36] + mi := &file_codefly_services_code_v0_code_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2345,7 +2384,7 @@ func (x *GitLogResponse) String() string { func (*GitLogResponse) ProtoMessage() {} func (x *GitLogResponse) ProtoReflect() protoreflect.Message { - mi := &file_codefly_services_code_v0_code_proto_msgTypes[36] + mi := &file_codefly_services_code_v0_code_proto_msgTypes[37] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2358,7 +2397,7 @@ func (x *GitLogResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GitLogResponse.ProtoReflect.Descriptor instead. func (*GitLogResponse) Descriptor() ([]byte, []int) { - return file_codefly_services_code_v0_code_proto_rawDescGZIP(), []int{36} + return file_codefly_services_code_v0_code_proto_rawDescGZIP(), []int{37} } func (x *GitLogResponse) GetCommits() []*GitCommit { @@ -2387,7 +2426,7 @@ type GitDiffRequest struct { func (x *GitDiffRequest) Reset() { *x = GitDiffRequest{} - mi := &file_codefly_services_code_v0_code_proto_msgTypes[37] + mi := &file_codefly_services_code_v0_code_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2399,7 +2438,7 @@ func (x *GitDiffRequest) String() string { func (*GitDiffRequest) ProtoMessage() {} func (x *GitDiffRequest) ProtoReflect() protoreflect.Message { - mi := &file_codefly_services_code_v0_code_proto_msgTypes[37] + mi := &file_codefly_services_code_v0_code_proto_msgTypes[38] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2412,7 +2451,7 @@ func (x *GitDiffRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GitDiffRequest.ProtoReflect.Descriptor instead. func (*GitDiffRequest) Descriptor() ([]byte, []int) { - return file_codefly_services_code_v0_code_proto_rawDescGZIP(), []int{37} + return file_codefly_services_code_v0_code_proto_rawDescGZIP(), []int{38} } func (x *GitDiffRequest) GetBaseRef() string { @@ -2467,7 +2506,7 @@ type GitDiffFile struct { func (x *GitDiffFile) Reset() { *x = GitDiffFile{} - mi := &file_codefly_services_code_v0_code_proto_msgTypes[38] + mi := &file_codefly_services_code_v0_code_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2479,7 +2518,7 @@ func (x *GitDiffFile) String() string { func (*GitDiffFile) ProtoMessage() {} func (x *GitDiffFile) ProtoReflect() protoreflect.Message { - mi := &file_codefly_services_code_v0_code_proto_msgTypes[38] + mi := &file_codefly_services_code_v0_code_proto_msgTypes[39] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2492,7 +2531,7 @@ func (x *GitDiffFile) ProtoReflect() protoreflect.Message { // Deprecated: Use GitDiffFile.ProtoReflect.Descriptor instead. func (*GitDiffFile) Descriptor() ([]byte, []int) { - return file_codefly_services_code_v0_code_proto_rawDescGZIP(), []int{38} + return file_codefly_services_code_v0_code_proto_rawDescGZIP(), []int{39} } func (x *GitDiffFile) GetPath() string { @@ -2536,7 +2575,7 @@ type GitDiffResponse struct { func (x *GitDiffResponse) Reset() { *x = GitDiffResponse{} - mi := &file_codefly_services_code_v0_code_proto_msgTypes[39] + mi := &file_codefly_services_code_v0_code_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2548,7 +2587,7 @@ func (x *GitDiffResponse) String() string { func (*GitDiffResponse) ProtoMessage() {} func (x *GitDiffResponse) ProtoReflect() protoreflect.Message { - mi := &file_codefly_services_code_v0_code_proto_msgTypes[39] + mi := &file_codefly_services_code_v0_code_proto_msgTypes[40] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2561,7 +2600,7 @@ func (x *GitDiffResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GitDiffResponse.ProtoReflect.Descriptor instead. func (*GitDiffResponse) Descriptor() ([]byte, []int) { - return file_codefly_services_code_v0_code_proto_rawDescGZIP(), []int{39} + return file_codefly_services_code_v0_code_proto_rawDescGZIP(), []int{40} } func (x *GitDiffResponse) GetDiff() string { @@ -2591,7 +2630,7 @@ type GitShowRequest struct { func (x *GitShowRequest) Reset() { *x = GitShowRequest{} - mi := &file_codefly_services_code_v0_code_proto_msgTypes[40] + mi := &file_codefly_services_code_v0_code_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2603,7 +2642,7 @@ func (x *GitShowRequest) String() string { func (*GitShowRequest) ProtoMessage() {} func (x *GitShowRequest) ProtoReflect() protoreflect.Message { - mi := &file_codefly_services_code_v0_code_proto_msgTypes[40] + mi := &file_codefly_services_code_v0_code_proto_msgTypes[41] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2616,7 +2655,7 @@ func (x *GitShowRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GitShowRequest.ProtoReflect.Descriptor instead. func (*GitShowRequest) Descriptor() ([]byte, []int) { - return file_codefly_services_code_v0_code_proto_rawDescGZIP(), []int{40} + return file_codefly_services_code_v0_code_proto_rawDescGZIP(), []int{41} } func (x *GitShowRequest) GetRef() string { @@ -2646,7 +2685,7 @@ type GitShowResponse struct { func (x *GitShowResponse) Reset() { *x = GitShowResponse{} - mi := &file_codefly_services_code_v0_code_proto_msgTypes[41] + mi := &file_codefly_services_code_v0_code_proto_msgTypes[42] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2658,7 +2697,7 @@ func (x *GitShowResponse) String() string { func (*GitShowResponse) ProtoMessage() {} func (x *GitShowResponse) ProtoReflect() protoreflect.Message { - mi := &file_codefly_services_code_v0_code_proto_msgTypes[41] + mi := &file_codefly_services_code_v0_code_proto_msgTypes[42] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2671,7 +2710,7 @@ func (x *GitShowResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GitShowResponse.ProtoReflect.Descriptor instead. func (*GitShowResponse) Descriptor() ([]byte, []int) { - return file_codefly_services_code_v0_code_proto_rawDescGZIP(), []int{41} + return file_codefly_services_code_v0_code_proto_rawDescGZIP(), []int{42} } func (x *GitShowResponse) GetContent() string { @@ -2703,7 +2742,7 @@ type GitBlameRequest struct { func (x *GitBlameRequest) Reset() { *x = GitBlameRequest{} - mi := &file_codefly_services_code_v0_code_proto_msgTypes[42] + mi := &file_codefly_services_code_v0_code_proto_msgTypes[43] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2715,7 +2754,7 @@ func (x *GitBlameRequest) String() string { func (*GitBlameRequest) ProtoMessage() {} func (x *GitBlameRequest) ProtoReflect() protoreflect.Message { - mi := &file_codefly_services_code_v0_code_proto_msgTypes[42] + mi := &file_codefly_services_code_v0_code_proto_msgTypes[43] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2728,7 +2767,7 @@ func (x *GitBlameRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GitBlameRequest.ProtoReflect.Descriptor instead. func (*GitBlameRequest) Descriptor() ([]byte, []int) { - return file_codefly_services_code_v0_code_proto_rawDescGZIP(), []int{42} + return file_codefly_services_code_v0_code_proto_rawDescGZIP(), []int{43} } func (x *GitBlameRequest) GetPath() string { @@ -2771,7 +2810,7 @@ type GitBlameLine struct { func (x *GitBlameLine) Reset() { *x = GitBlameLine{} - mi := &file_codefly_services_code_v0_code_proto_msgTypes[43] + mi := &file_codefly_services_code_v0_code_proto_msgTypes[44] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2783,7 +2822,7 @@ func (x *GitBlameLine) String() string { func (*GitBlameLine) ProtoMessage() {} func (x *GitBlameLine) ProtoReflect() protoreflect.Message { - mi := &file_codefly_services_code_v0_code_proto_msgTypes[43] + mi := &file_codefly_services_code_v0_code_proto_msgTypes[44] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2796,7 +2835,7 @@ func (x *GitBlameLine) ProtoReflect() protoreflect.Message { // Deprecated: Use GitBlameLine.ProtoReflect.Descriptor instead. func (*GitBlameLine) Descriptor() ([]byte, []int) { - return file_codefly_services_code_v0_code_proto_rawDescGZIP(), []int{43} + return file_codefly_services_code_v0_code_proto_rawDescGZIP(), []int{44} } func (x *GitBlameLine) GetHash() string { @@ -2845,7 +2884,7 @@ type GitBlameResponse struct { func (x *GitBlameResponse) Reset() { *x = GitBlameResponse{} - mi := &file_codefly_services_code_v0_code_proto_msgTypes[44] + mi := &file_codefly_services_code_v0_code_proto_msgTypes[45] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2857,7 +2896,7 @@ func (x *GitBlameResponse) String() string { func (*GitBlameResponse) ProtoMessage() {} func (x *GitBlameResponse) ProtoReflect() protoreflect.Message { - mi := &file_codefly_services_code_v0_code_proto_msgTypes[44] + mi := &file_codefly_services_code_v0_code_proto_msgTypes[45] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2870,7 +2909,7 @@ func (x *GitBlameResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GitBlameResponse.ProtoReflect.Descriptor instead. func (*GitBlameResponse) Descriptor() ([]byte, []int) { - return file_codefly_services_code_v0_code_proto_rawDescGZIP(), []int{44} + return file_codefly_services_code_v0_code_proto_rawDescGZIP(), []int{45} } func (x *GitBlameResponse) GetLines() []*GitBlameLine { @@ -2913,7 +2952,7 @@ type ShellExecRequest struct { func (x *ShellExecRequest) Reset() { *x = ShellExecRequest{} - mi := &file_codefly_services_code_v0_code_proto_msgTypes[45] + mi := &file_codefly_services_code_v0_code_proto_msgTypes[46] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2925,7 +2964,7 @@ func (x *ShellExecRequest) String() string { func (*ShellExecRequest) ProtoMessage() {} func (x *ShellExecRequest) ProtoReflect() protoreflect.Message { - mi := &file_codefly_services_code_v0_code_proto_msgTypes[45] + mi := &file_codefly_services_code_v0_code_proto_msgTypes[46] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2938,7 +2977,7 @@ func (x *ShellExecRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ShellExecRequest.ProtoReflect.Descriptor instead. func (*ShellExecRequest) Descriptor() ([]byte, []int) { - return file_codefly_services_code_v0_code_proto_rawDescGZIP(), []int{45} + return file_codefly_services_code_v0_code_proto_rawDescGZIP(), []int{46} } func (x *ShellExecRequest) GetCommand() string { @@ -3000,7 +3039,7 @@ type ShellExecResponse struct { func (x *ShellExecResponse) Reset() { *x = ShellExecResponse{} - mi := &file_codefly_services_code_v0_code_proto_msgTypes[46] + mi := &file_codefly_services_code_v0_code_proto_msgTypes[47] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3012,7 +3051,7 @@ func (x *ShellExecResponse) String() string { func (*ShellExecResponse) ProtoMessage() {} func (x *ShellExecResponse) ProtoReflect() protoreflect.Message { - mi := &file_codefly_services_code_v0_code_proto_msgTypes[46] + mi := &file_codefly_services_code_v0_code_proto_msgTypes[47] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3025,7 +3064,7 @@ func (x *ShellExecResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ShellExecResponse.ProtoReflect.Descriptor instead. func (*ShellExecResponse) Descriptor() ([]byte, []int) { - return file_codefly_services_code_v0_code_proto_rawDescGZIP(), []int{46} + return file_codefly_services_code_v0_code_proto_rawDescGZIP(), []int{47} } func (x *ShellExecResponse) GetExitCode() int32 { @@ -3074,6 +3113,7 @@ type CodeRequest struct { // *CodeRequest_RemoveDependency // *CodeRequest_GetProjectInfo // *CodeRequest_DiscoverCodeUnits + // *CodeRequest_GetSemanticIndex // *CodeRequest_ReadFile // *CodeRequest_WriteFile // *CodeRequest_CreateFile @@ -3093,7 +3133,7 @@ type CodeRequest struct { func (x *CodeRequest) Reset() { *x = CodeRequest{} - mi := &file_codefly_services_code_v0_code_proto_msgTypes[47] + mi := &file_codefly_services_code_v0_code_proto_msgTypes[48] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3105,7 +3145,7 @@ func (x *CodeRequest) String() string { func (*CodeRequest) ProtoMessage() {} func (x *CodeRequest) ProtoReflect() protoreflect.Message { - mi := &file_codefly_services_code_v0_code_proto_msgTypes[47] + mi := &file_codefly_services_code_v0_code_proto_msgTypes[48] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3118,7 +3158,7 @@ func (x *CodeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CodeRequest.ProtoReflect.Descriptor instead. func (*CodeRequest) Descriptor() ([]byte, []int) { - return file_codefly_services_code_v0_code_proto_rawDescGZIP(), []int{47} + return file_codefly_services_code_v0_code_proto_rawDescGZIP(), []int{48} } func (x *CodeRequest) GetOperation() isCodeRequest_Operation { @@ -3191,6 +3231,15 @@ func (x *CodeRequest) GetDiscoverCodeUnits() *DiscoverCodeUnitsRequest { return nil } +func (x *CodeRequest) GetGetSemanticIndex() *GetSemanticIndexRequest { + if x != nil { + if x, ok := x.Operation.(*CodeRequest_GetSemanticIndex); ok { + return x.GetSemanticIndex + } + } + return nil +} + func (x *CodeRequest) GetReadFile() *ReadFileRequest { if x != nil { if x, ok := x.Operation.(*CodeRequest_ReadFile); ok { @@ -3339,6 +3388,12 @@ type CodeRequest_DiscoverCodeUnits struct { DiscoverCodeUnits *DiscoverCodeUnitsRequest `protobuf:"bytes,20,opt,name=discover_code_units,json=discoverCodeUnits,proto3,oneof"` } +type CodeRequest_GetSemanticIndex struct { + // get_semantic_index performs one read-only semantic projection inside the + // owning Codefly agent. + GetSemanticIndex *GetSemanticIndexRequest `protobuf:"bytes,21,opt,name=get_semantic_index,json=getSemanticIndex,proto3,oneof"` +} + type CodeRequest_ReadFile struct { // File and git operations — handled by the Code agent's default server // (pkg/code/DefaultCodeServer in codefly core) backed by the workspace's @@ -3417,6 +3472,8 @@ func (*CodeRequest_GetProjectInfo) isCodeRequest_Operation() {} func (*CodeRequest_DiscoverCodeUnits) isCodeRequest_Operation() {} +func (*CodeRequest_GetSemanticIndex) isCodeRequest_Operation() {} + func (*CodeRequest_ReadFile) isCodeRequest_Operation() {} func (*CodeRequest_WriteFile) isCodeRequest_Operation() {} @@ -3457,6 +3514,7 @@ type CodeResponse struct { // *CodeResponse_RemoveDependency // *CodeResponse_GetProjectInfo // *CodeResponse_DiscoverCodeUnits + // *CodeResponse_GetSemanticIndex // *CodeResponse_ReadFile // *CodeResponse_WriteFile // *CodeResponse_CreateFile @@ -3476,7 +3534,7 @@ type CodeResponse struct { func (x *CodeResponse) Reset() { *x = CodeResponse{} - mi := &file_codefly_services_code_v0_code_proto_msgTypes[48] + mi := &file_codefly_services_code_v0_code_proto_msgTypes[49] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3488,7 +3546,7 @@ func (x *CodeResponse) String() string { func (*CodeResponse) ProtoMessage() {} func (x *CodeResponse) ProtoReflect() protoreflect.Message { - mi := &file_codefly_services_code_v0_code_proto_msgTypes[48] + mi := &file_codefly_services_code_v0_code_proto_msgTypes[49] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3501,7 +3559,7 @@ func (x *CodeResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CodeResponse.ProtoReflect.Descriptor instead. func (*CodeResponse) Descriptor() ([]byte, []int) { - return file_codefly_services_code_v0_code_proto_rawDescGZIP(), []int{48} + return file_codefly_services_code_v0_code_proto_rawDescGZIP(), []int{49} } func (x *CodeResponse) GetFailure() *v0.Failure { @@ -3581,6 +3639,15 @@ func (x *CodeResponse) GetDiscoverCodeUnits() *DiscoverCodeUnitsResponse { return nil } +func (x *CodeResponse) GetGetSemanticIndex() *v0.SemanticIndex { + if x != nil { + if x, ok := x.Result.(*CodeResponse_GetSemanticIndex); ok { + return x.GetSemanticIndex + } + } + return nil +} + func (x *CodeResponse) GetReadFile() *ReadFileResponse { if x != nil { if x, ok := x.Result.(*CodeResponse_ReadFile); ok { @@ -3728,6 +3795,11 @@ type CodeResponse_DiscoverCodeUnits struct { DiscoverCodeUnits *DiscoverCodeUnitsResponse `protobuf:"bytes,20,opt,name=discover_code_units,json=discoverCodeUnits,proto3,oneof"` } +type CodeResponse_GetSemanticIndex struct { + // get_semantic_index returns body-free semantic facts and typed coverage. + GetSemanticIndex *v0.SemanticIndex `protobuf:"bytes,21,opt,name=get_semantic_index,json=getSemanticIndex,proto3,oneof"` +} + type CodeResponse_ReadFile struct { // File and git operation responses. ReadFile *ReadFileResponse `protobuf:"bytes,26,opt,name=read_file,json=readFile,proto3,oneof"` @@ -3802,6 +3874,8 @@ func (*CodeResponse_GetProjectInfo) isCodeResponse_Result() {} func (*CodeResponse_DiscoverCodeUnits) isCodeResponse_Result() {} +func (*CodeResponse_GetSemanticIndex) isCodeResponse_Result() {} + func (*CodeResponse_ReadFile) isCodeResponse_Result() {} func (*CodeResponse_WriteFile) isCodeResponse_Result() {} @@ -3830,7 +3904,7 @@ var File_codefly_services_code_v0_code_proto protoreflect.FileDescriptor const file_codefly_services_code_v0_code_proto_rawDesc = "" + "\n" + - "#codefly/services/code/v0/code.proto\x12\x18codefly.services.code.v0\x1a\x1dcodefly/base/v0/failure.proto\x1a\x1ccodefly/base/v0/source.proto\"%\n" + + "#codefly/services/code/v0/code.proto\x12\x18codefly.services.code.v0\x1a\x1dcodefly/base/v0/failure.proto\x1a\x1ecodefly/base/v0/semantic.proto\x1a\x1ccodefly/base/v0/source.proto\"%\n" + "\x0fReadFileRequest\x12\x12\n" + "\x04path\x18\x01 \x01(\tR\x04path\"D\n" + "\x10ReadFileResponse\x12\x18\n" + @@ -3964,7 +4038,8 @@ const file_codefly_services_code_v0_code_proto_rawDesc = "" + "\fsource_files\x18\b \x03(\v2(.codefly.services.code.v0.SourceFileInfoR\vsourceFiles\x1a=\n" + "\x0fFileHashesEntry\x12\x10\n" + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01J\x04\b\a\x10\bR\x05error\"\x1a\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01J\x04\b\a\x10\bR\x05error\"\x19\n" + + "\x17GetSemanticIndexRequest\"\x1a\n" + "\x18DiscoverCodeUnitsRequest\"\xcb\x01\n" + "\fCodeUnitInfo\x12\x12\n" + "\x04path\x18\x01 \x01(\tR\x04path\x12\x12\n" + @@ -4035,7 +4110,7 @@ const file_codefly_services_code_v0_code_proto_rawDesc = "" + "\texit_code\x18\x01 \x01(\x05R\bexitCode\x12\x16\n" + "\x06stdout\x18\x02 \x01(\tR\x06stdout\x12\x16\n" + "\x06stderr\x18\x03 \x01(\tR\x06stderr\x12\x1b\n" + - "\ttimed_out\x18\x04 \x01(\bR\btimedOutJ\x04\b\x05\x10\x06J\x04\b\x06\x10\aR\x05errorR\afailure\"\xfb\v\n" + + "\ttimed_out\x18\x04 \x01(\bR\btimedOutJ\x04\b\x05\x10\x06J\x04\b\x06\x10\aR\x05errorR\afailure\"\xde\f\n" + "\vCodeRequest\x128\n" + "\x03fix\x18\r \x01(\v2$.codefly.services.code.v0.FixRequestH\x00R\x03fix\x12K\n" + "\n" + @@ -4044,7 +4119,8 @@ const file_codefly_services_code_v0_code_proto_rawDesc = "" + "\x0eadd_dependency\x18\x11 \x01(\v2..codefly.services.code.v0.AddDependencyRequestH\x00R\raddDependency\x12`\n" + "\x11remove_dependency\x18\x12 \x01(\v21.codefly.services.code.v0.RemoveDependencyRequestH\x00R\x10removeDependency\x12[\n" + "\x10get_project_info\x18\x13 \x01(\v2/.codefly.services.code.v0.GetProjectInfoRequestH\x00R\x0egetProjectInfo\x12d\n" + - "\x13discover_code_units\x18\x14 \x01(\v22.codefly.services.code.v0.DiscoverCodeUnitsRequestH\x00R\x11discoverCodeUnits\x12H\n" + + "\x13discover_code_units\x18\x14 \x01(\v22.codefly.services.code.v0.DiscoverCodeUnitsRequestH\x00R\x11discoverCodeUnits\x12a\n" + + "\x12get_semantic_index\x18\x15 \x01(\v21.codefly.services.code.v0.GetSemanticIndexRequestH\x00R\x10getSemanticIndex\x12H\n" + "\tread_file\x18\x1a \x01(\v2).codefly.services.code.v0.ReadFileRequestH\x00R\breadFile\x12K\n" + "\n" + "write_file\x18\x1b \x01(\v2*.codefly.services.code.v0.WriteFileRequestH\x00R\twriteFile\x12N\n" + @@ -4062,7 +4138,7 @@ const file_codefly_services_code_v0_code_proto_rawDesc = "" + "\bgit_diff\x18$ \x01(\v2(.codefly.services.code.v0.GitDiffRequestH\x00R\agitDiff\x12K\n" + "\n" + "shell_exec\x18% \x01(\v2*.codefly.services.code.v0.ShellExecRequestH\x00R\tshellExecB\v\n" + - "\toperation\"\xc0\f\n" + + "\toperation\"\x90\r\n" + "\fCodeResponse\x122\n" + "\afailure\x18\x01 \x01(\v2\x18.codefly.base.v0.FailureR\afailure\x129\n" + "\x03fix\x18\r \x01(\v2%.codefly.services.code.v0.FixResponseH\x00R\x03fix\x12L\n" + @@ -4072,7 +4148,8 @@ const file_codefly_services_code_v0_code_proto_rawDesc = "" + "\x0eadd_dependency\x18\x11 \x01(\v2/.codefly.services.code.v0.AddDependencyResponseH\x00R\raddDependency\x12a\n" + "\x11remove_dependency\x18\x12 \x01(\v22.codefly.services.code.v0.RemoveDependencyResponseH\x00R\x10removeDependency\x12\\\n" + "\x10get_project_info\x18\x13 \x01(\v20.codefly.services.code.v0.GetProjectInfoResponseH\x00R\x0egetProjectInfo\x12e\n" + - "\x13discover_code_units\x18\x14 \x01(\v23.codefly.services.code.v0.DiscoverCodeUnitsResponseH\x00R\x11discoverCodeUnits\x12I\n" + + "\x13discover_code_units\x18\x14 \x01(\v23.codefly.services.code.v0.DiscoverCodeUnitsResponseH\x00R\x11discoverCodeUnits\x12N\n" + + "\x12get_semantic_index\x18\x15 \x01(\v2\x1e.codefly.base.v0.SemanticIndexH\x00R\x10getSemanticIndex\x12I\n" + "\tread_file\x18\x1a \x01(\v2*.codefly.services.code.v0.ReadFileResponseH\x00R\breadFile\x12L\n" + "\n" + "write_file\x18\x1b \x01(\v2+.codefly.services.code.v0.WriteFileResponseH\x00R\twriteFile\x12O\n" + @@ -4107,7 +4184,7 @@ func file_codefly_services_code_v0_code_proto_rawDescGZIP() []byte { return file_codefly_services_code_v0_code_proto_rawDescData } -var file_codefly_services_code_v0_code_proto_msgTypes = make([]protoimpl.MessageInfo, 50) +var file_codefly_services_code_v0_code_proto_msgTypes = make([]protoimpl.MessageInfo, 51) var file_codefly_services_code_v0_code_proto_goTypes = []any{ (*ReadFileRequest)(nil), // 0: codefly.services.code.v0.ReadFileRequest (*ReadFileResponse)(nil), // 1: codefly.services.code.v0.ReadFileResponse @@ -4140,88 +4217,92 @@ var file_codefly_services_code_v0_code_proto_goTypes = []any{ (*SourceFileInfo)(nil), // 28: codefly.services.code.v0.SourceFileInfo (*GetProjectInfoRequest)(nil), // 29: codefly.services.code.v0.GetProjectInfoRequest (*GetProjectInfoResponse)(nil), // 30: codefly.services.code.v0.GetProjectInfoResponse - (*DiscoverCodeUnitsRequest)(nil), // 31: codefly.services.code.v0.DiscoverCodeUnitsRequest - (*CodeUnitInfo)(nil), // 32: codefly.services.code.v0.CodeUnitInfo - (*DiscoverCodeUnitsResponse)(nil), // 33: codefly.services.code.v0.DiscoverCodeUnitsResponse - (*GitLogRequest)(nil), // 34: codefly.services.code.v0.GitLogRequest - (*GitCommit)(nil), // 35: codefly.services.code.v0.GitCommit - (*GitLogResponse)(nil), // 36: codefly.services.code.v0.GitLogResponse - (*GitDiffRequest)(nil), // 37: codefly.services.code.v0.GitDiffRequest - (*GitDiffFile)(nil), // 38: codefly.services.code.v0.GitDiffFile - (*GitDiffResponse)(nil), // 39: codefly.services.code.v0.GitDiffResponse - (*GitShowRequest)(nil), // 40: codefly.services.code.v0.GitShowRequest - (*GitShowResponse)(nil), // 41: codefly.services.code.v0.GitShowResponse - (*GitBlameRequest)(nil), // 42: codefly.services.code.v0.GitBlameRequest - (*GitBlameLine)(nil), // 43: codefly.services.code.v0.GitBlameLine - (*GitBlameResponse)(nil), // 44: codefly.services.code.v0.GitBlameResponse - (*ShellExecRequest)(nil), // 45: codefly.services.code.v0.ShellExecRequest - (*ShellExecResponse)(nil), // 46: codefly.services.code.v0.ShellExecResponse - (*CodeRequest)(nil), // 47: codefly.services.code.v0.CodeRequest - (*CodeResponse)(nil), // 48: codefly.services.code.v0.CodeResponse - nil, // 49: codefly.services.code.v0.GetProjectInfoResponse.FileHashesEntry - (v0.FixMode)(0), // 50: codefly.base.v0.FixMode - (*v0.Failure)(nil), // 51: codefly.base.v0.Failure + (*GetSemanticIndexRequest)(nil), // 31: codefly.services.code.v0.GetSemanticIndexRequest + (*DiscoverCodeUnitsRequest)(nil), // 32: codefly.services.code.v0.DiscoverCodeUnitsRequest + (*CodeUnitInfo)(nil), // 33: codefly.services.code.v0.CodeUnitInfo + (*DiscoverCodeUnitsResponse)(nil), // 34: codefly.services.code.v0.DiscoverCodeUnitsResponse + (*GitLogRequest)(nil), // 35: codefly.services.code.v0.GitLogRequest + (*GitCommit)(nil), // 36: codefly.services.code.v0.GitCommit + (*GitLogResponse)(nil), // 37: codefly.services.code.v0.GitLogResponse + (*GitDiffRequest)(nil), // 38: codefly.services.code.v0.GitDiffRequest + (*GitDiffFile)(nil), // 39: codefly.services.code.v0.GitDiffFile + (*GitDiffResponse)(nil), // 40: codefly.services.code.v0.GitDiffResponse + (*GitShowRequest)(nil), // 41: codefly.services.code.v0.GitShowRequest + (*GitShowResponse)(nil), // 42: codefly.services.code.v0.GitShowResponse + (*GitBlameRequest)(nil), // 43: codefly.services.code.v0.GitBlameRequest + (*GitBlameLine)(nil), // 44: codefly.services.code.v0.GitBlameLine + (*GitBlameResponse)(nil), // 45: codefly.services.code.v0.GitBlameResponse + (*ShellExecRequest)(nil), // 46: codefly.services.code.v0.ShellExecRequest + (*ShellExecResponse)(nil), // 47: codefly.services.code.v0.ShellExecResponse + (*CodeRequest)(nil), // 48: codefly.services.code.v0.CodeRequest + (*CodeResponse)(nil), // 49: codefly.services.code.v0.CodeResponse + nil, // 50: codefly.services.code.v0.GetProjectInfoResponse.FileHashesEntry + (v0.FixMode)(0), // 51: codefly.base.v0.FixMode + (*v0.Failure)(nil), // 52: codefly.base.v0.Failure + (*v0.SemanticIndex)(nil), // 53: codefly.base.v0.SemanticIndex } var file_codefly_services_code_v0_code_proto_depIdxs = []int32{ 5, // 0: codefly.services.code.v0.ListFilesResponse.files:type_name -> codefly.services.code.v0.FileInfo - 50, // 1: codefly.services.code.v0.FixRequest.mode:type_name -> codefly.base.v0.FixMode - 50, // 2: codefly.services.code.v0.ApplyEditRequest.fix_mode:type_name -> codefly.base.v0.FixMode + 51, // 1: codefly.services.code.v0.FixRequest.mode:type_name -> codefly.base.v0.FixMode + 51, // 2: codefly.services.code.v0.ApplyEditRequest.fix_mode:type_name -> codefly.base.v0.FixMode 12, // 3: codefly.services.code.v0.SearchResponse.matches:type_name -> codefly.services.code.v0.SearchMatch 20, // 4: codefly.services.code.v0.ListDependenciesResponse.dependencies:type_name -> codefly.services.code.v0.Dependency 27, // 5: codefly.services.code.v0.GetProjectInfoResponse.packages:type_name -> codefly.services.code.v0.PackageInfo 20, // 6: codefly.services.code.v0.GetProjectInfoResponse.dependencies:type_name -> codefly.services.code.v0.Dependency - 49, // 7: codefly.services.code.v0.GetProjectInfoResponse.file_hashes:type_name -> codefly.services.code.v0.GetProjectInfoResponse.FileHashesEntry + 50, // 7: codefly.services.code.v0.GetProjectInfoResponse.file_hashes:type_name -> codefly.services.code.v0.GetProjectInfoResponse.FileHashesEntry 28, // 8: codefly.services.code.v0.GetProjectInfoResponse.source_files:type_name -> codefly.services.code.v0.SourceFileInfo - 32, // 9: codefly.services.code.v0.DiscoverCodeUnitsResponse.code_units:type_name -> codefly.services.code.v0.CodeUnitInfo - 35, // 10: codefly.services.code.v0.GitLogResponse.commits:type_name -> codefly.services.code.v0.GitCommit - 38, // 11: codefly.services.code.v0.GitDiffResponse.files:type_name -> codefly.services.code.v0.GitDiffFile - 43, // 12: codefly.services.code.v0.GitBlameResponse.lines:type_name -> codefly.services.code.v0.GitBlameLine + 33, // 9: codefly.services.code.v0.DiscoverCodeUnitsResponse.code_units:type_name -> codefly.services.code.v0.CodeUnitInfo + 36, // 10: codefly.services.code.v0.GitLogResponse.commits:type_name -> codefly.services.code.v0.GitCommit + 39, // 11: codefly.services.code.v0.GitDiffResponse.files:type_name -> codefly.services.code.v0.GitDiffFile + 44, // 12: codefly.services.code.v0.GitBlameResponse.lines:type_name -> codefly.services.code.v0.GitBlameLine 7, // 13: codefly.services.code.v0.CodeRequest.fix:type_name -> codefly.services.code.v0.FixRequest 9, // 14: codefly.services.code.v0.CodeRequest.apply_edit:type_name -> codefly.services.code.v0.ApplyEditRequest 21, // 15: codefly.services.code.v0.CodeRequest.list_dependencies:type_name -> codefly.services.code.v0.ListDependenciesRequest 23, // 16: codefly.services.code.v0.CodeRequest.add_dependency:type_name -> codefly.services.code.v0.AddDependencyRequest 25, // 17: codefly.services.code.v0.CodeRequest.remove_dependency:type_name -> codefly.services.code.v0.RemoveDependencyRequest 29, // 18: codefly.services.code.v0.CodeRequest.get_project_info:type_name -> codefly.services.code.v0.GetProjectInfoRequest - 31, // 19: codefly.services.code.v0.CodeRequest.discover_code_units:type_name -> codefly.services.code.v0.DiscoverCodeUnitsRequest - 0, // 20: codefly.services.code.v0.CodeRequest.read_file:type_name -> codefly.services.code.v0.ReadFileRequest - 2, // 21: codefly.services.code.v0.CodeRequest.write_file:type_name -> codefly.services.code.v0.WriteFileRequest - 18, // 22: codefly.services.code.v0.CodeRequest.create_file:type_name -> codefly.services.code.v0.CreateFileRequest - 14, // 23: codefly.services.code.v0.CodeRequest.delete_file:type_name -> codefly.services.code.v0.DeleteFileRequest - 16, // 24: codefly.services.code.v0.CodeRequest.move_file:type_name -> codefly.services.code.v0.MoveFileRequest - 4, // 25: codefly.services.code.v0.CodeRequest.list_files:type_name -> codefly.services.code.v0.ListFilesRequest - 11, // 26: codefly.services.code.v0.CodeRequest.search:type_name -> codefly.services.code.v0.SearchRequest - 34, // 27: codefly.services.code.v0.CodeRequest.git_log:type_name -> codefly.services.code.v0.GitLogRequest - 40, // 28: codefly.services.code.v0.CodeRequest.git_show:type_name -> codefly.services.code.v0.GitShowRequest - 42, // 29: codefly.services.code.v0.CodeRequest.git_blame:type_name -> codefly.services.code.v0.GitBlameRequest - 37, // 30: codefly.services.code.v0.CodeRequest.git_diff:type_name -> codefly.services.code.v0.GitDiffRequest - 45, // 31: codefly.services.code.v0.CodeRequest.shell_exec:type_name -> codefly.services.code.v0.ShellExecRequest - 51, // 32: codefly.services.code.v0.CodeResponse.failure:type_name -> codefly.base.v0.Failure - 8, // 33: codefly.services.code.v0.CodeResponse.fix:type_name -> codefly.services.code.v0.FixResponse - 10, // 34: codefly.services.code.v0.CodeResponse.apply_edit:type_name -> codefly.services.code.v0.ApplyEditResponse - 22, // 35: codefly.services.code.v0.CodeResponse.list_dependencies:type_name -> codefly.services.code.v0.ListDependenciesResponse - 24, // 36: codefly.services.code.v0.CodeResponse.add_dependency:type_name -> codefly.services.code.v0.AddDependencyResponse - 26, // 37: codefly.services.code.v0.CodeResponse.remove_dependency:type_name -> codefly.services.code.v0.RemoveDependencyResponse - 30, // 38: codefly.services.code.v0.CodeResponse.get_project_info:type_name -> codefly.services.code.v0.GetProjectInfoResponse - 33, // 39: codefly.services.code.v0.CodeResponse.discover_code_units:type_name -> codefly.services.code.v0.DiscoverCodeUnitsResponse - 1, // 40: codefly.services.code.v0.CodeResponse.read_file:type_name -> codefly.services.code.v0.ReadFileResponse - 3, // 41: codefly.services.code.v0.CodeResponse.write_file:type_name -> codefly.services.code.v0.WriteFileResponse - 19, // 42: codefly.services.code.v0.CodeResponse.create_file:type_name -> codefly.services.code.v0.CreateFileResponse - 15, // 43: codefly.services.code.v0.CodeResponse.delete_file:type_name -> codefly.services.code.v0.DeleteFileResponse - 17, // 44: codefly.services.code.v0.CodeResponse.move_file:type_name -> codefly.services.code.v0.MoveFileResponse - 6, // 45: codefly.services.code.v0.CodeResponse.list_files:type_name -> codefly.services.code.v0.ListFilesResponse - 13, // 46: codefly.services.code.v0.CodeResponse.search:type_name -> codefly.services.code.v0.SearchResponse - 36, // 47: codefly.services.code.v0.CodeResponse.git_log:type_name -> codefly.services.code.v0.GitLogResponse - 41, // 48: codefly.services.code.v0.CodeResponse.git_show:type_name -> codefly.services.code.v0.GitShowResponse - 44, // 49: codefly.services.code.v0.CodeResponse.git_blame:type_name -> codefly.services.code.v0.GitBlameResponse - 39, // 50: codefly.services.code.v0.CodeResponse.git_diff:type_name -> codefly.services.code.v0.GitDiffResponse - 46, // 51: codefly.services.code.v0.CodeResponse.shell_exec:type_name -> codefly.services.code.v0.ShellExecResponse - 47, // 52: codefly.services.code.v0.Code.Execute:input_type -> codefly.services.code.v0.CodeRequest - 48, // 53: codefly.services.code.v0.Code.Execute:output_type -> codefly.services.code.v0.CodeResponse - 53, // [53:54] is the sub-list for method output_type - 52, // [52:53] is the sub-list for method input_type - 52, // [52:52] is the sub-list for extension type_name - 52, // [52:52] is the sub-list for extension extendee - 0, // [0:52] is the sub-list for field type_name + 32, // 19: codefly.services.code.v0.CodeRequest.discover_code_units:type_name -> codefly.services.code.v0.DiscoverCodeUnitsRequest + 31, // 20: codefly.services.code.v0.CodeRequest.get_semantic_index:type_name -> codefly.services.code.v0.GetSemanticIndexRequest + 0, // 21: codefly.services.code.v0.CodeRequest.read_file:type_name -> codefly.services.code.v0.ReadFileRequest + 2, // 22: codefly.services.code.v0.CodeRequest.write_file:type_name -> codefly.services.code.v0.WriteFileRequest + 18, // 23: codefly.services.code.v0.CodeRequest.create_file:type_name -> codefly.services.code.v0.CreateFileRequest + 14, // 24: codefly.services.code.v0.CodeRequest.delete_file:type_name -> codefly.services.code.v0.DeleteFileRequest + 16, // 25: codefly.services.code.v0.CodeRequest.move_file:type_name -> codefly.services.code.v0.MoveFileRequest + 4, // 26: codefly.services.code.v0.CodeRequest.list_files:type_name -> codefly.services.code.v0.ListFilesRequest + 11, // 27: codefly.services.code.v0.CodeRequest.search:type_name -> codefly.services.code.v0.SearchRequest + 35, // 28: codefly.services.code.v0.CodeRequest.git_log:type_name -> codefly.services.code.v0.GitLogRequest + 41, // 29: codefly.services.code.v0.CodeRequest.git_show:type_name -> codefly.services.code.v0.GitShowRequest + 43, // 30: codefly.services.code.v0.CodeRequest.git_blame:type_name -> codefly.services.code.v0.GitBlameRequest + 38, // 31: codefly.services.code.v0.CodeRequest.git_diff:type_name -> codefly.services.code.v0.GitDiffRequest + 46, // 32: codefly.services.code.v0.CodeRequest.shell_exec:type_name -> codefly.services.code.v0.ShellExecRequest + 52, // 33: codefly.services.code.v0.CodeResponse.failure:type_name -> codefly.base.v0.Failure + 8, // 34: codefly.services.code.v0.CodeResponse.fix:type_name -> codefly.services.code.v0.FixResponse + 10, // 35: codefly.services.code.v0.CodeResponse.apply_edit:type_name -> codefly.services.code.v0.ApplyEditResponse + 22, // 36: codefly.services.code.v0.CodeResponse.list_dependencies:type_name -> codefly.services.code.v0.ListDependenciesResponse + 24, // 37: codefly.services.code.v0.CodeResponse.add_dependency:type_name -> codefly.services.code.v0.AddDependencyResponse + 26, // 38: codefly.services.code.v0.CodeResponse.remove_dependency:type_name -> codefly.services.code.v0.RemoveDependencyResponse + 30, // 39: codefly.services.code.v0.CodeResponse.get_project_info:type_name -> codefly.services.code.v0.GetProjectInfoResponse + 34, // 40: codefly.services.code.v0.CodeResponse.discover_code_units:type_name -> codefly.services.code.v0.DiscoverCodeUnitsResponse + 53, // 41: codefly.services.code.v0.CodeResponse.get_semantic_index:type_name -> codefly.base.v0.SemanticIndex + 1, // 42: codefly.services.code.v0.CodeResponse.read_file:type_name -> codefly.services.code.v0.ReadFileResponse + 3, // 43: codefly.services.code.v0.CodeResponse.write_file:type_name -> codefly.services.code.v0.WriteFileResponse + 19, // 44: codefly.services.code.v0.CodeResponse.create_file:type_name -> codefly.services.code.v0.CreateFileResponse + 15, // 45: codefly.services.code.v0.CodeResponse.delete_file:type_name -> codefly.services.code.v0.DeleteFileResponse + 17, // 46: codefly.services.code.v0.CodeResponse.move_file:type_name -> codefly.services.code.v0.MoveFileResponse + 6, // 47: codefly.services.code.v0.CodeResponse.list_files:type_name -> codefly.services.code.v0.ListFilesResponse + 13, // 48: codefly.services.code.v0.CodeResponse.search:type_name -> codefly.services.code.v0.SearchResponse + 37, // 49: codefly.services.code.v0.CodeResponse.git_log:type_name -> codefly.services.code.v0.GitLogResponse + 42, // 50: codefly.services.code.v0.CodeResponse.git_show:type_name -> codefly.services.code.v0.GitShowResponse + 45, // 51: codefly.services.code.v0.CodeResponse.git_blame:type_name -> codefly.services.code.v0.GitBlameResponse + 40, // 52: codefly.services.code.v0.CodeResponse.git_diff:type_name -> codefly.services.code.v0.GitDiffResponse + 47, // 53: codefly.services.code.v0.CodeResponse.shell_exec:type_name -> codefly.services.code.v0.ShellExecResponse + 48, // 54: codefly.services.code.v0.Code.Execute:input_type -> codefly.services.code.v0.CodeRequest + 49, // 55: codefly.services.code.v0.Code.Execute:output_type -> codefly.services.code.v0.CodeResponse + 55, // [55:56] is the sub-list for method output_type + 54, // [54:55] is the sub-list for method input_type + 54, // [54:54] is the sub-list for extension type_name + 54, // [54:54] is the sub-list for extension extendee + 0, // [0:54] is the sub-list for field type_name } func init() { file_codefly_services_code_v0_code_proto_init() } @@ -4229,7 +4310,7 @@ func file_codefly_services_code_v0_code_proto_init() { if File_codefly_services_code_v0_code_proto != nil { return } - file_codefly_services_code_v0_code_proto_msgTypes[47].OneofWrappers = []any{ + file_codefly_services_code_v0_code_proto_msgTypes[48].OneofWrappers = []any{ (*CodeRequest_Fix)(nil), (*CodeRequest_ApplyEdit)(nil), (*CodeRequest_ListDependencies)(nil), @@ -4237,6 +4318,7 @@ func file_codefly_services_code_v0_code_proto_init() { (*CodeRequest_RemoveDependency)(nil), (*CodeRequest_GetProjectInfo)(nil), (*CodeRequest_DiscoverCodeUnits)(nil), + (*CodeRequest_GetSemanticIndex)(nil), (*CodeRequest_ReadFile)(nil), (*CodeRequest_WriteFile)(nil), (*CodeRequest_CreateFile)(nil), @@ -4250,7 +4332,7 @@ func file_codefly_services_code_v0_code_proto_init() { (*CodeRequest_GitDiff)(nil), (*CodeRequest_ShellExec)(nil), } - file_codefly_services_code_v0_code_proto_msgTypes[48].OneofWrappers = []any{ + file_codefly_services_code_v0_code_proto_msgTypes[49].OneofWrappers = []any{ (*CodeResponse_Fix)(nil), (*CodeResponse_ApplyEdit)(nil), (*CodeResponse_ListDependencies)(nil), @@ -4258,6 +4340,7 @@ func file_codefly_services_code_v0_code_proto_init() { (*CodeResponse_RemoveDependency)(nil), (*CodeResponse_GetProjectInfo)(nil), (*CodeResponse_DiscoverCodeUnits)(nil), + (*CodeResponse_GetSemanticIndex)(nil), (*CodeResponse_ReadFile)(nil), (*CodeResponse_WriteFile)(nil), (*CodeResponse_CreateFile)(nil), @@ -4277,7 +4360,7 @@ func file_codefly_services_code_v0_code_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_codefly_services_code_v0_code_proto_rawDesc), len(file_codefly_services_code_v0_code_proto_rawDesc)), NumEnums: 0, - NumMessages: 50, + NumMessages: 51, NumExtensions: 0, NumServices: 1, }, diff --git a/generated/go/codefly/services/tooling/v0/tooling.pb.go b/generated/go/codefly/services/tooling/v0/tooling.pb.go index 5130ece4..c030dec7 100644 --- a/generated/go/codefly/services/tooling/v0/tooling.pb.go +++ b/generated/go/codefly/services/tooling/v0/tooling.pb.go @@ -1253,6 +1253,98 @@ func (x *GetProjectInfoResponse) GetSourceFiles() []*SourceFileInfo { return nil } +// GetSemanticIndexRequest asks the language tooling attached to this service +// for one complete, body-free semantic projection. +type GetSemanticIndexRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetSemanticIndexRequest) Reset() { + *x = GetSemanticIndexRequest{} + mi := &file_codefly_services_tooling_v0_tooling_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetSemanticIndexRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetSemanticIndexRequest) ProtoMessage() {} + +func (x *GetSemanticIndexRequest) ProtoReflect() protoreflect.Message { + mi := &file_codefly_services_tooling_v0_tooling_proto_msgTypes[16] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetSemanticIndexRequest.ProtoReflect.Descriptor instead. +func (*GetSemanticIndexRequest) Descriptor() ([]byte, []int) { + return file_codefly_services_tooling_v0_tooling_proto_rawDescGZIP(), []int{16} +} + +// GetSemanticIndexResponse returns typed facts even when some files degrade; +// failure is reserved for capability or infrastructure failure. +type GetSemanticIndexResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Index *v0.SemanticIndex `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"` + Failure *v0.Failure `protobuf:"bytes,2,opt,name=failure,proto3" json:"failure,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetSemanticIndexResponse) Reset() { + *x = GetSemanticIndexResponse{} + mi := &file_codefly_services_tooling_v0_tooling_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetSemanticIndexResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetSemanticIndexResponse) ProtoMessage() {} + +func (x *GetSemanticIndexResponse) ProtoReflect() protoreflect.Message { + mi := &file_codefly_services_tooling_v0_tooling_proto_msgTypes[17] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetSemanticIndexResponse.ProtoReflect.Descriptor instead. +func (*GetSemanticIndexResponse) Descriptor() ([]byte, []int) { + return file_codefly_services_tooling_v0_tooling_proto_rawDescGZIP(), []int{17} +} + +func (x *GetSemanticIndexResponse) GetIndex() *v0.SemanticIndex { + if x != nil { + return x.Index + } + return nil +} + +func (x *GetSemanticIndexResponse) GetFailure() *v0.Failure { + if x != nil { + return x.Failure + } + return nil +} + // BuildRequest asks the agent to run the native build command. type BuildRequest struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -1262,7 +1354,7 @@ type BuildRequest struct { func (x *BuildRequest) Reset() { *x = BuildRequest{} - mi := &file_codefly_services_tooling_v0_tooling_proto_msgTypes[16] + mi := &file_codefly_services_tooling_v0_tooling_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1274,7 +1366,7 @@ func (x *BuildRequest) String() string { func (*BuildRequest) ProtoMessage() {} func (x *BuildRequest) ProtoReflect() protoreflect.Message { - mi := &file_codefly_services_tooling_v0_tooling_proto_msgTypes[16] + mi := &file_codefly_services_tooling_v0_tooling_proto_msgTypes[18] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1287,7 +1379,7 @@ func (x *BuildRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use BuildRequest.ProtoReflect.Descriptor instead. func (*BuildRequest) Descriptor() ([]byte, []int) { - return file_codefly_services_tooling_v0_tooling_proto_rawDescGZIP(), []int{16} + return file_codefly_services_tooling_v0_tooling_proto_rawDescGZIP(), []int{18} } // BuildResponse returns build output and diagnostics from the native toolchain. @@ -1307,7 +1399,7 @@ type BuildResponse struct { func (x *BuildResponse) Reset() { *x = BuildResponse{} - mi := &file_codefly_services_tooling_v0_tooling_proto_msgTypes[17] + mi := &file_codefly_services_tooling_v0_tooling_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1319,7 +1411,7 @@ func (x *BuildResponse) String() string { func (*BuildResponse) ProtoMessage() {} func (x *BuildResponse) ProtoReflect() protoreflect.Message { - mi := &file_codefly_services_tooling_v0_tooling_proto_msgTypes[17] + mi := &file_codefly_services_tooling_v0_tooling_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1332,7 +1424,7 @@ func (x *BuildResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use BuildResponse.ProtoReflect.Descriptor instead. func (*BuildResponse) Descriptor() ([]byte, []int) { - return file_codefly_services_tooling_v0_tooling_proto_rawDescGZIP(), []int{17} + return file_codefly_services_tooling_v0_tooling_proto_rawDescGZIP(), []int{19} } func (x *BuildResponse) GetSuccess() bool { @@ -1376,7 +1468,7 @@ type TestRequest struct { func (x *TestRequest) Reset() { *x = TestRequest{} - mi := &file_codefly_services_tooling_v0_tooling_proto_msgTypes[18] + mi := &file_codefly_services_tooling_v0_tooling_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1388,7 +1480,7 @@ func (x *TestRequest) String() string { func (*TestRequest) ProtoMessage() {} func (x *TestRequest) ProtoReflect() protoreflect.Message { - mi := &file_codefly_services_tooling_v0_tooling_proto_msgTypes[18] + mi := &file_codefly_services_tooling_v0_tooling_proto_msgTypes[20] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1401,7 +1493,7 @@ func (x *TestRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use TestRequest.ProtoReflect.Descriptor instead. func (*TestRequest) Descriptor() ([]byte, []int) { - return file_codefly_services_tooling_v0_tooling_proto_rawDescGZIP(), []int{18} + return file_codefly_services_tooling_v0_tooling_proto_rawDescGZIP(), []int{20} } func (x *TestRequest) GetPath() string { @@ -1445,7 +1537,7 @@ type TestResponse struct { func (x *TestResponse) Reset() { *x = TestResponse{} - mi := &file_codefly_services_tooling_v0_tooling_proto_msgTypes[19] + mi := &file_codefly_services_tooling_v0_tooling_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1457,7 +1549,7 @@ func (x *TestResponse) String() string { func (*TestResponse) ProtoMessage() {} func (x *TestResponse) ProtoReflect() protoreflect.Message { - mi := &file_codefly_services_tooling_v0_tooling_proto_msgTypes[19] + mi := &file_codefly_services_tooling_v0_tooling_proto_msgTypes[21] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1470,7 +1562,7 @@ func (x *TestResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use TestResponse.ProtoReflect.Descriptor instead. func (*TestResponse) Descriptor() ([]byte, []int) { - return file_codefly_services_tooling_v0_tooling_proto_rawDescGZIP(), []int{19} + return file_codefly_services_tooling_v0_tooling_proto_rawDescGZIP(), []int{21} } func (x *TestResponse) GetSuccess() bool { @@ -1547,7 +1639,7 @@ type LintRequest struct { func (x *LintRequest) Reset() { *x = LintRequest{} - mi := &file_codefly_services_tooling_v0_tooling_proto_msgTypes[20] + mi := &file_codefly_services_tooling_v0_tooling_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1559,7 +1651,7 @@ func (x *LintRequest) String() string { func (*LintRequest) ProtoMessage() {} func (x *LintRequest) ProtoReflect() protoreflect.Message { - mi := &file_codefly_services_tooling_v0_tooling_proto_msgTypes[20] + mi := &file_codefly_services_tooling_v0_tooling_proto_msgTypes[22] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1572,7 +1664,7 @@ func (x *LintRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use LintRequest.ProtoReflect.Descriptor instead. func (*LintRequest) Descriptor() ([]byte, []int) { - return file_codefly_services_tooling_v0_tooling_proto_rawDescGZIP(), []int{20} + return file_codefly_services_tooling_v0_tooling_proto_rawDescGZIP(), []int{22} } func (x *LintRequest) GetFile() string { @@ -1599,7 +1691,7 @@ type LintResponse struct { func (x *LintResponse) Reset() { *x = LintResponse{} - mi := &file_codefly_services_tooling_v0_tooling_proto_msgTypes[21] + mi := &file_codefly_services_tooling_v0_tooling_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1611,7 +1703,7 @@ func (x *LintResponse) String() string { func (*LintResponse) ProtoMessage() {} func (x *LintResponse) ProtoReflect() protoreflect.Message { - mi := &file_codefly_services_tooling_v0_tooling_proto_msgTypes[21] + mi := &file_codefly_services_tooling_v0_tooling_proto_msgTypes[23] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1624,7 +1716,7 @@ func (x *LintResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use LintResponse.ProtoReflect.Descriptor instead. func (*LintResponse) Descriptor() ([]byte, []int) { - return file_codefly_services_tooling_v0_tooling_proto_rawDescGZIP(), []int{21} + return file_codefly_services_tooling_v0_tooling_proto_rawDescGZIP(), []int{23} } func (x *LintResponse) GetSuccess() bool { @@ -1659,7 +1751,7 @@ var File_codefly_services_tooling_v0_tooling_proto protoreflect.FileDescriptor const file_codefly_services_tooling_v0_tooling_proto_rawDesc = "" + "\n" + - ")codefly/services/tooling/v0/tooling.proto\x12\x1bcodefly.services.tooling.v0\x1a\x1dcodefly/base/v0/failure.proto\x1a\x1ccodefly/base/v0/source.proto\"\x99\x02\n" + + ")codefly/services/tooling/v0/tooling.proto\x12\x1bcodefly.services.tooling.v0\x1a\x1dcodefly/base/v0/failure.proto\x1a\x1ecodefly/base/v0/semantic.proto\x1a\x1ccodefly/base/v0/source.proto\"\x99\x02\n" + "\n" + "Diagnostic\x12\x12\n" + "\x04file\x18\x01 \x01(\tR\x04file\x12\x12\n" + @@ -1750,7 +1842,11 @@ const file_codefly_services_tooling_v0_tooling_proto_rawDesc = "" + "\fsource_files\x18\t \x03(\v2+.codefly.services.tooling.v0.SourceFileInfoR\vsourceFiles\x1a=\n" + "\x0fFileHashesEntry\x12\x10\n" + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01J\x04\b\a\x10\bR\x05error\"\x0e\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01J\x04\b\a\x10\bR\x05error\"\x19\n" + + "\x17GetSemanticIndexRequest\"\x84\x01\n" + + "\x18GetSemanticIndexResponse\x124\n" + + "\x05index\x18\x01 \x01(\v2\x1e.codefly.base.v0.SemanticIndexR\x05index\x122\n" + + "\afailure\x18\x02 \x01(\v2\x18.codefly.base.v0.FailureR\afailure\"\x0e\n" + "\fBuildRequest\"\xc0\x01\n" + "\rBuildResponse\x12\x18\n" + "\asuccess\x18\x01 \x01(\bR\asuccess\x12\x16\n" + @@ -1782,14 +1878,15 @@ const file_codefly_services_tooling_v0_tooling_proto_rawDesc = "" + "\x19DIAGNOSTIC_SEVERITY_ERROR\x10\x01\x12\x1f\n" + "\x1bDIAGNOSTIC_SEVERITY_WARNING\x10\x02\x12#\n" + "\x1fDIAGNOSTIC_SEVERITY_INFORMATION\x10\x03\x12\x1c\n" + - "\x18DIAGNOSTIC_SEVERITY_HINT\x10\x042\xde\a\n" + + "\x18DIAGNOSTIC_SEVERITY_HINT\x10\x042\xdf\b\n" + "\aTooling\x12X\n" + "\x03Fix\x12'.codefly.services.tooling.v0.FixRequest\x1a(.codefly.services.tooling.v0.FixResponse\x12j\n" + "\tApplyEdit\x12-.codefly.services.tooling.v0.ApplyEditRequest\x1a..codefly.services.tooling.v0.ApplyEditResponse\x12\x7f\n" + "\x10ListDependencies\x124.codefly.services.tooling.v0.ListDependenciesRequest\x1a5.codefly.services.tooling.v0.ListDependenciesResponse\x12v\n" + "\rAddDependency\x121.codefly.services.tooling.v0.AddDependencyRequest\x1a2.codefly.services.tooling.v0.AddDependencyResponse\x12\x7f\n" + "\x10RemoveDependency\x124.codefly.services.tooling.v0.RemoveDependencyRequest\x1a5.codefly.services.tooling.v0.RemoveDependencyResponse\x12y\n" + - "\x0eGetProjectInfo\x122.codefly.services.tooling.v0.GetProjectInfoRequest\x1a3.codefly.services.tooling.v0.GetProjectInfoResponse\x12^\n" + + "\x0eGetProjectInfo\x122.codefly.services.tooling.v0.GetProjectInfoRequest\x1a3.codefly.services.tooling.v0.GetProjectInfoResponse\x12\x7f\n" + + "\x10GetSemanticIndex\x124.codefly.services.tooling.v0.GetSemanticIndexRequest\x1a5.codefly.services.tooling.v0.GetSemanticIndexResponse\x12^\n" + "\x05Build\x12).codefly.services.tooling.v0.BuildRequest\x1a*.codefly.services.tooling.v0.BuildResponse\x12[\n" + "\x04Test\x12(.codefly.services.tooling.v0.TestRequest\x1a).codefly.services.tooling.v0.TestResponse\x12[\n" + "\x04Lint\x12(.codefly.services.tooling.v0.LintRequest\x1a).codefly.services.tooling.v0.LintResponseB\x85\x02\n" + @@ -1808,7 +1905,7 @@ func file_codefly_services_tooling_v0_tooling_proto_rawDescGZIP() []byte { } var file_codefly_services_tooling_v0_tooling_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_codefly_services_tooling_v0_tooling_proto_msgTypes = make([]protoimpl.MessageInfo, 23) +var file_codefly_services_tooling_v0_tooling_proto_msgTypes = make([]protoimpl.MessageInfo, 25) var file_codefly_services_tooling_v0_tooling_proto_goTypes = []any{ (DiagnosticSeverity)(0), // 0: codefly.services.tooling.v0.DiagnosticSeverity (*Diagnostic)(nil), // 1: codefly.services.tooling.v0.Diagnostic @@ -1827,59 +1924,66 @@ var file_codefly_services_tooling_v0_tooling_proto_goTypes = []any{ (*SourceFileInfo)(nil), // 14: codefly.services.tooling.v0.SourceFileInfo (*GetProjectInfoRequest)(nil), // 15: codefly.services.tooling.v0.GetProjectInfoRequest (*GetProjectInfoResponse)(nil), // 16: codefly.services.tooling.v0.GetProjectInfoResponse - (*BuildRequest)(nil), // 17: codefly.services.tooling.v0.BuildRequest - (*BuildResponse)(nil), // 18: codefly.services.tooling.v0.BuildResponse - (*TestRequest)(nil), // 19: codefly.services.tooling.v0.TestRequest - (*TestResponse)(nil), // 20: codefly.services.tooling.v0.TestResponse - (*LintRequest)(nil), // 21: codefly.services.tooling.v0.LintRequest - (*LintResponse)(nil), // 22: codefly.services.tooling.v0.LintResponse - nil, // 23: codefly.services.tooling.v0.GetProjectInfoResponse.FileHashesEntry - (v0.FixMode)(0), // 24: codefly.base.v0.FixMode - (*v0.Failure)(nil), // 25: codefly.base.v0.Failure + (*GetSemanticIndexRequest)(nil), // 17: codefly.services.tooling.v0.GetSemanticIndexRequest + (*GetSemanticIndexResponse)(nil), // 18: codefly.services.tooling.v0.GetSemanticIndexResponse + (*BuildRequest)(nil), // 19: codefly.services.tooling.v0.BuildRequest + (*BuildResponse)(nil), // 20: codefly.services.tooling.v0.BuildResponse + (*TestRequest)(nil), // 21: codefly.services.tooling.v0.TestRequest + (*TestResponse)(nil), // 22: codefly.services.tooling.v0.TestResponse + (*LintRequest)(nil), // 23: codefly.services.tooling.v0.LintRequest + (*LintResponse)(nil), // 24: codefly.services.tooling.v0.LintResponse + nil, // 25: codefly.services.tooling.v0.GetProjectInfoResponse.FileHashesEntry + (v0.FixMode)(0), // 26: codefly.base.v0.FixMode + (*v0.Failure)(nil), // 27: codefly.base.v0.Failure + (*v0.SemanticIndex)(nil), // 28: codefly.base.v0.SemanticIndex } var file_codefly_services_tooling_v0_tooling_proto_depIdxs = []int32{ 0, // 0: codefly.services.tooling.v0.Diagnostic.severity:type_name -> codefly.services.tooling.v0.DiagnosticSeverity - 24, // 1: codefly.services.tooling.v0.FixRequest.mode:type_name -> codefly.base.v0.FixMode - 25, // 2: codefly.services.tooling.v0.FixResponse.failure:type_name -> codefly.base.v0.Failure - 24, // 3: codefly.services.tooling.v0.ApplyEditRequest.fix_mode:type_name -> codefly.base.v0.FixMode - 25, // 4: codefly.services.tooling.v0.ApplyEditResponse.failure:type_name -> codefly.base.v0.Failure + 26, // 1: codefly.services.tooling.v0.FixRequest.mode:type_name -> codefly.base.v0.FixMode + 27, // 2: codefly.services.tooling.v0.FixResponse.failure:type_name -> codefly.base.v0.Failure + 26, // 3: codefly.services.tooling.v0.ApplyEditRequest.fix_mode:type_name -> codefly.base.v0.FixMode + 27, // 4: codefly.services.tooling.v0.ApplyEditResponse.failure:type_name -> codefly.base.v0.Failure 2, // 5: codefly.services.tooling.v0.ListDependenciesResponse.dependencies:type_name -> codefly.services.tooling.v0.Dependency - 25, // 6: codefly.services.tooling.v0.ListDependenciesResponse.failure:type_name -> codefly.base.v0.Failure - 25, // 7: codefly.services.tooling.v0.AddDependencyResponse.failure:type_name -> codefly.base.v0.Failure - 25, // 8: codefly.services.tooling.v0.RemoveDependencyResponse.failure:type_name -> codefly.base.v0.Failure + 27, // 6: codefly.services.tooling.v0.ListDependenciesResponse.failure:type_name -> codefly.base.v0.Failure + 27, // 7: codefly.services.tooling.v0.AddDependencyResponse.failure:type_name -> codefly.base.v0.Failure + 27, // 8: codefly.services.tooling.v0.RemoveDependencyResponse.failure:type_name -> codefly.base.v0.Failure 3, // 9: codefly.services.tooling.v0.GetProjectInfoResponse.packages:type_name -> codefly.services.tooling.v0.PackageInfo 2, // 10: codefly.services.tooling.v0.GetProjectInfoResponse.dependencies:type_name -> codefly.services.tooling.v0.Dependency - 23, // 11: codefly.services.tooling.v0.GetProjectInfoResponse.file_hashes:type_name -> codefly.services.tooling.v0.GetProjectInfoResponse.FileHashesEntry - 25, // 12: codefly.services.tooling.v0.GetProjectInfoResponse.failure:type_name -> codefly.base.v0.Failure + 25, // 11: codefly.services.tooling.v0.GetProjectInfoResponse.file_hashes:type_name -> codefly.services.tooling.v0.GetProjectInfoResponse.FileHashesEntry + 27, // 12: codefly.services.tooling.v0.GetProjectInfoResponse.failure:type_name -> codefly.base.v0.Failure 14, // 13: codefly.services.tooling.v0.GetProjectInfoResponse.source_files:type_name -> codefly.services.tooling.v0.SourceFileInfo - 1, // 14: codefly.services.tooling.v0.BuildResponse.diagnostics:type_name -> codefly.services.tooling.v0.Diagnostic - 25, // 15: codefly.services.tooling.v0.BuildResponse.failure:type_name -> codefly.base.v0.Failure - 25, // 16: codefly.services.tooling.v0.TestResponse.failure:type_name -> codefly.base.v0.Failure - 1, // 17: codefly.services.tooling.v0.LintResponse.diagnostics:type_name -> codefly.services.tooling.v0.Diagnostic - 25, // 18: codefly.services.tooling.v0.LintResponse.failure:type_name -> codefly.base.v0.Failure - 4, // 19: codefly.services.tooling.v0.Tooling.Fix:input_type -> codefly.services.tooling.v0.FixRequest - 6, // 20: codefly.services.tooling.v0.Tooling.ApplyEdit:input_type -> codefly.services.tooling.v0.ApplyEditRequest - 8, // 21: codefly.services.tooling.v0.Tooling.ListDependencies:input_type -> codefly.services.tooling.v0.ListDependenciesRequest - 10, // 22: codefly.services.tooling.v0.Tooling.AddDependency:input_type -> codefly.services.tooling.v0.AddDependencyRequest - 12, // 23: codefly.services.tooling.v0.Tooling.RemoveDependency:input_type -> codefly.services.tooling.v0.RemoveDependencyRequest - 15, // 24: codefly.services.tooling.v0.Tooling.GetProjectInfo:input_type -> codefly.services.tooling.v0.GetProjectInfoRequest - 17, // 25: codefly.services.tooling.v0.Tooling.Build:input_type -> codefly.services.tooling.v0.BuildRequest - 19, // 26: codefly.services.tooling.v0.Tooling.Test:input_type -> codefly.services.tooling.v0.TestRequest - 21, // 27: codefly.services.tooling.v0.Tooling.Lint:input_type -> codefly.services.tooling.v0.LintRequest - 5, // 28: codefly.services.tooling.v0.Tooling.Fix:output_type -> codefly.services.tooling.v0.FixResponse - 7, // 29: codefly.services.tooling.v0.Tooling.ApplyEdit:output_type -> codefly.services.tooling.v0.ApplyEditResponse - 9, // 30: codefly.services.tooling.v0.Tooling.ListDependencies:output_type -> codefly.services.tooling.v0.ListDependenciesResponse - 11, // 31: codefly.services.tooling.v0.Tooling.AddDependency:output_type -> codefly.services.tooling.v0.AddDependencyResponse - 13, // 32: codefly.services.tooling.v0.Tooling.RemoveDependency:output_type -> codefly.services.tooling.v0.RemoveDependencyResponse - 16, // 33: codefly.services.tooling.v0.Tooling.GetProjectInfo:output_type -> codefly.services.tooling.v0.GetProjectInfoResponse - 18, // 34: codefly.services.tooling.v0.Tooling.Build:output_type -> codefly.services.tooling.v0.BuildResponse - 20, // 35: codefly.services.tooling.v0.Tooling.Test:output_type -> codefly.services.tooling.v0.TestResponse - 22, // 36: codefly.services.tooling.v0.Tooling.Lint:output_type -> codefly.services.tooling.v0.LintResponse - 28, // [28:37] is the sub-list for method output_type - 19, // [19:28] is the sub-list for method input_type - 19, // [19:19] is the sub-list for extension type_name - 19, // [19:19] is the sub-list for extension extendee - 0, // [0:19] is the sub-list for field type_name + 28, // 14: codefly.services.tooling.v0.GetSemanticIndexResponse.index:type_name -> codefly.base.v0.SemanticIndex + 27, // 15: codefly.services.tooling.v0.GetSemanticIndexResponse.failure:type_name -> codefly.base.v0.Failure + 1, // 16: codefly.services.tooling.v0.BuildResponse.diagnostics:type_name -> codefly.services.tooling.v0.Diagnostic + 27, // 17: codefly.services.tooling.v0.BuildResponse.failure:type_name -> codefly.base.v0.Failure + 27, // 18: codefly.services.tooling.v0.TestResponse.failure:type_name -> codefly.base.v0.Failure + 1, // 19: codefly.services.tooling.v0.LintResponse.diagnostics:type_name -> codefly.services.tooling.v0.Diagnostic + 27, // 20: codefly.services.tooling.v0.LintResponse.failure:type_name -> codefly.base.v0.Failure + 4, // 21: codefly.services.tooling.v0.Tooling.Fix:input_type -> codefly.services.tooling.v0.FixRequest + 6, // 22: codefly.services.tooling.v0.Tooling.ApplyEdit:input_type -> codefly.services.tooling.v0.ApplyEditRequest + 8, // 23: codefly.services.tooling.v0.Tooling.ListDependencies:input_type -> codefly.services.tooling.v0.ListDependenciesRequest + 10, // 24: codefly.services.tooling.v0.Tooling.AddDependency:input_type -> codefly.services.tooling.v0.AddDependencyRequest + 12, // 25: codefly.services.tooling.v0.Tooling.RemoveDependency:input_type -> codefly.services.tooling.v0.RemoveDependencyRequest + 15, // 26: codefly.services.tooling.v0.Tooling.GetProjectInfo:input_type -> codefly.services.tooling.v0.GetProjectInfoRequest + 17, // 27: codefly.services.tooling.v0.Tooling.GetSemanticIndex:input_type -> codefly.services.tooling.v0.GetSemanticIndexRequest + 19, // 28: codefly.services.tooling.v0.Tooling.Build:input_type -> codefly.services.tooling.v0.BuildRequest + 21, // 29: codefly.services.tooling.v0.Tooling.Test:input_type -> codefly.services.tooling.v0.TestRequest + 23, // 30: codefly.services.tooling.v0.Tooling.Lint:input_type -> codefly.services.tooling.v0.LintRequest + 5, // 31: codefly.services.tooling.v0.Tooling.Fix:output_type -> codefly.services.tooling.v0.FixResponse + 7, // 32: codefly.services.tooling.v0.Tooling.ApplyEdit:output_type -> codefly.services.tooling.v0.ApplyEditResponse + 9, // 33: codefly.services.tooling.v0.Tooling.ListDependencies:output_type -> codefly.services.tooling.v0.ListDependenciesResponse + 11, // 34: codefly.services.tooling.v0.Tooling.AddDependency:output_type -> codefly.services.tooling.v0.AddDependencyResponse + 13, // 35: codefly.services.tooling.v0.Tooling.RemoveDependency:output_type -> codefly.services.tooling.v0.RemoveDependencyResponse + 16, // 36: codefly.services.tooling.v0.Tooling.GetProjectInfo:output_type -> codefly.services.tooling.v0.GetProjectInfoResponse + 18, // 37: codefly.services.tooling.v0.Tooling.GetSemanticIndex:output_type -> codefly.services.tooling.v0.GetSemanticIndexResponse + 20, // 38: codefly.services.tooling.v0.Tooling.Build:output_type -> codefly.services.tooling.v0.BuildResponse + 22, // 39: codefly.services.tooling.v0.Tooling.Test:output_type -> codefly.services.tooling.v0.TestResponse + 24, // 40: codefly.services.tooling.v0.Tooling.Lint:output_type -> codefly.services.tooling.v0.LintResponse + 31, // [31:41] is the sub-list for method output_type + 21, // [21:31] is the sub-list for method input_type + 21, // [21:21] is the sub-list for extension type_name + 21, // [21:21] is the sub-list for extension extendee + 0, // [0:21] is the sub-list for field type_name } func init() { file_codefly_services_tooling_v0_tooling_proto_init() } @@ -1893,7 +1997,7 @@ func file_codefly_services_tooling_v0_tooling_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_codefly_services_tooling_v0_tooling_proto_rawDesc), len(file_codefly_services_tooling_v0_tooling_proto_rawDesc)), NumEnums: 1, - NumMessages: 23, + NumMessages: 25, NumExtensions: 0, NumServices: 1, }, diff --git a/generated/go/codefly/services/tooling/v0/tooling_grpc.pb.go b/generated/go/codefly/services/tooling/v0/tooling_grpc.pb.go index 880af984..7780b609 100644 --- a/generated/go/codefly/services/tooling/v0/tooling_grpc.pb.go +++ b/generated/go/codefly/services/tooling/v0/tooling_grpc.pb.go @@ -26,6 +26,7 @@ const ( Tooling_AddDependency_FullMethodName = "/codefly.services.tooling.v0.Tooling/AddDependency" Tooling_RemoveDependency_FullMethodName = "/codefly.services.tooling.v0.Tooling/RemoveDependency" Tooling_GetProjectInfo_FullMethodName = "/codefly.services.tooling.v0.Tooling/GetProjectInfo" + Tooling_GetSemanticIndex_FullMethodName = "/codefly.services.tooling.v0.Tooling/GetSemanticIndex" Tooling_Build_FullMethodName = "/codefly.services.tooling.v0.Tooling/Build" Tooling_Test_FullMethodName = "/codefly.services.tooling.v0.Tooling/Test" Tooling_Lint_FullMethodName = "/codefly.services.tooling.v0.Tooling/Lint" @@ -39,7 +40,8 @@ const ( // Every language agent (go-grpc, python-fastapi, etc.) implements this service. // // NOTE: File operations (read, write, list, search) and git operations are -// NOT part of this service. Mind handles those directly via its VFS. +// part of Code/Gateway, not this service. Mind reaches those typed capabilities +// through the Gateway and never owns a project VFS. type ToolingClient interface { // Code modification Fix(ctx context.Context, in *FixRequest, opts ...grpc.CallOption) (*FixResponse, error) @@ -53,6 +55,8 @@ type ToolingClient interface { RemoveDependency(ctx context.Context, in *RemoveDependencyRequest, opts ...grpc.CallOption) (*RemoveDependencyResponse, error) // Analysis GetProjectInfo(ctx context.Context, in *GetProjectInfoRequest, opts ...grpc.CallOption) (*GetProjectInfoResponse, error) + // GetSemanticIndex keeps project parsing and project bytes inside Codefly. + GetSemanticIndex(ctx context.Context, in *GetSemanticIndexRequest, opts ...grpc.CallOption) (*GetSemanticIndexResponse, error) // Dev validation Build(ctx context.Context, in *BuildRequest, opts ...grpc.CallOption) (*BuildResponse, error) // Test runs native tests and returns structured counts. @@ -129,6 +133,16 @@ func (c *toolingClient) GetProjectInfo(ctx context.Context, in *GetProjectInfoRe return out, nil } +func (c *toolingClient) GetSemanticIndex(ctx context.Context, in *GetSemanticIndexRequest, opts ...grpc.CallOption) (*GetSemanticIndexResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetSemanticIndexResponse) + err := c.cc.Invoke(ctx, Tooling_GetSemanticIndex_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *toolingClient) Build(ctx context.Context, in *BuildRequest, opts ...grpc.CallOption) (*BuildResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(BuildResponse) @@ -167,7 +181,8 @@ func (c *toolingClient) Lint(ctx context.Context, in *LintRequest, opts ...grpc. // Every language agent (go-grpc, python-fastapi, etc.) implements this service. // // NOTE: File operations (read, write, list, search) and git operations are -// NOT part of this service. Mind handles those directly via its VFS. +// part of Code/Gateway, not this service. Mind reaches those typed capabilities +// through the Gateway and never owns a project VFS. type ToolingServer interface { // Code modification Fix(context.Context, *FixRequest) (*FixResponse, error) @@ -181,6 +196,8 @@ type ToolingServer interface { RemoveDependency(context.Context, *RemoveDependencyRequest) (*RemoveDependencyResponse, error) // Analysis GetProjectInfo(context.Context, *GetProjectInfoRequest) (*GetProjectInfoResponse, error) + // GetSemanticIndex keeps project parsing and project bytes inside Codefly. + GetSemanticIndex(context.Context, *GetSemanticIndexRequest) (*GetSemanticIndexResponse, error) // Dev validation Build(context.Context, *BuildRequest) (*BuildResponse, error) // Test runs native tests and returns structured counts. @@ -215,6 +232,9 @@ func (UnimplementedToolingServer) RemoveDependency(context.Context, *RemoveDepen func (UnimplementedToolingServer) GetProjectInfo(context.Context, *GetProjectInfoRequest) (*GetProjectInfoResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetProjectInfo not implemented") } +func (UnimplementedToolingServer) GetSemanticIndex(context.Context, *GetSemanticIndexRequest) (*GetSemanticIndexResponse, error) { + return nil, status.Error(codes.Unimplemented, "method GetSemanticIndex not implemented") +} func (UnimplementedToolingServer) Build(context.Context, *BuildRequest) (*BuildResponse, error) { return nil, status.Error(codes.Unimplemented, "method Build not implemented") } @@ -353,6 +373,24 @@ func _Tooling_GetProjectInfo_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } +func _Tooling_GetSemanticIndex_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetSemanticIndexRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ToolingServer).GetSemanticIndex(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Tooling_GetSemanticIndex_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ToolingServer).GetSemanticIndex(ctx, req.(*GetSemanticIndexRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Tooling_Build_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(BuildRequest) if err := dec(in); err != nil { @@ -438,6 +476,10 @@ var Tooling_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetProjectInfo", Handler: _Tooling_GetProjectInfo_Handler, }, + { + MethodName: "GetSemanticIndex", + Handler: _Tooling_GetSemanticIndex_Handler, + }, { MethodName: "Build", Handler: _Tooling_Build_Handler, diff --git a/generated/go/codefly/services/tooling/v0/v0connect/tooling.connect.go b/generated/go/codefly/services/tooling/v0/v0connect/tooling.connect.go index a4b0c28c..1f0d5467 100644 --- a/generated/go/codefly/services/tooling/v0/v0connect/tooling.connect.go +++ b/generated/go/codefly/services/tooling/v0/v0connect/tooling.connect.go @@ -48,6 +48,9 @@ const ( ToolingRemoveDependencyProcedure = "/codefly.services.tooling.v0.Tooling/RemoveDependency" // ToolingGetProjectInfoProcedure is the fully-qualified name of the Tooling's GetProjectInfo RPC. ToolingGetProjectInfoProcedure = "/codefly.services.tooling.v0.Tooling/GetProjectInfo" + // ToolingGetSemanticIndexProcedure is the fully-qualified name of the Tooling's GetSemanticIndex + // RPC. + ToolingGetSemanticIndexProcedure = "/codefly.services.tooling.v0.Tooling/GetSemanticIndex" // ToolingBuildProcedure is the fully-qualified name of the Tooling's Build RPC. ToolingBuildProcedure = "/codefly.services.tooling.v0.Tooling/Build" // ToolingTestProcedure is the fully-qualified name of the Tooling's Test RPC. @@ -70,6 +73,8 @@ type ToolingClient interface { RemoveDependency(context.Context, *connect.Request[v0.RemoveDependencyRequest]) (*connect.Response[v0.RemoveDependencyResponse], error) // Analysis GetProjectInfo(context.Context, *connect.Request[v0.GetProjectInfoRequest]) (*connect.Response[v0.GetProjectInfoResponse], error) + // GetSemanticIndex keeps project parsing and project bytes inside Codefly. + GetSemanticIndex(context.Context, *connect.Request[v0.GetSemanticIndexRequest]) (*connect.Response[v0.GetSemanticIndexResponse], error) // Dev validation Build(context.Context, *connect.Request[v0.BuildRequest]) (*connect.Response[v0.BuildResponse], error) // Test runs native tests and returns structured counts. @@ -125,6 +130,12 @@ func NewToolingClient(httpClient connect.HTTPClient, baseURL string, opts ...con connect.WithSchema(toolingMethods.ByName("GetProjectInfo")), connect.WithClientOptions(opts...), ), + getSemanticIndex: connect.NewClient[v0.GetSemanticIndexRequest, v0.GetSemanticIndexResponse]( + httpClient, + baseURL+ToolingGetSemanticIndexProcedure, + connect.WithSchema(toolingMethods.ByName("GetSemanticIndex")), + connect.WithClientOptions(opts...), + ), build: connect.NewClient[v0.BuildRequest, v0.BuildResponse]( httpClient, baseURL+ToolingBuildProcedure, @@ -154,6 +165,7 @@ type toolingClient struct { addDependency *connect.Client[v0.AddDependencyRequest, v0.AddDependencyResponse] removeDependency *connect.Client[v0.RemoveDependencyRequest, v0.RemoveDependencyResponse] getProjectInfo *connect.Client[v0.GetProjectInfoRequest, v0.GetProjectInfoResponse] + getSemanticIndex *connect.Client[v0.GetSemanticIndexRequest, v0.GetSemanticIndexResponse] build *connect.Client[v0.BuildRequest, v0.BuildResponse] test *connect.Client[v0.TestRequest, v0.TestResponse] lint *connect.Client[v0.LintRequest, v0.LintResponse] @@ -189,6 +201,11 @@ func (c *toolingClient) GetProjectInfo(ctx context.Context, req *connect.Request return c.getProjectInfo.CallUnary(ctx, req) } +// GetSemanticIndex calls codefly.services.tooling.v0.Tooling.GetSemanticIndex. +func (c *toolingClient) GetSemanticIndex(ctx context.Context, req *connect.Request[v0.GetSemanticIndexRequest]) (*connect.Response[v0.GetSemanticIndexResponse], error) { + return c.getSemanticIndex.CallUnary(ctx, req) +} + // Build calls codefly.services.tooling.v0.Tooling.Build. func (c *toolingClient) Build(ctx context.Context, req *connect.Request[v0.BuildRequest]) (*connect.Response[v0.BuildResponse], error) { return c.build.CallUnary(ctx, req) @@ -218,6 +235,8 @@ type ToolingHandler interface { RemoveDependency(context.Context, *connect.Request[v0.RemoveDependencyRequest]) (*connect.Response[v0.RemoveDependencyResponse], error) // Analysis GetProjectInfo(context.Context, *connect.Request[v0.GetProjectInfoRequest]) (*connect.Response[v0.GetProjectInfoResponse], error) + // GetSemanticIndex keeps project parsing and project bytes inside Codefly. + GetSemanticIndex(context.Context, *connect.Request[v0.GetSemanticIndexRequest]) (*connect.Response[v0.GetSemanticIndexResponse], error) // Dev validation Build(context.Context, *connect.Request[v0.BuildRequest]) (*connect.Response[v0.BuildResponse], error) // Test runs native tests and returns structured counts. @@ -269,6 +288,12 @@ func NewToolingHandler(svc ToolingHandler, opts ...connect.HandlerOption) (strin connect.WithSchema(toolingMethods.ByName("GetProjectInfo")), connect.WithHandlerOptions(opts...), ) + toolingGetSemanticIndexHandler := connect.NewUnaryHandler( + ToolingGetSemanticIndexProcedure, + svc.GetSemanticIndex, + connect.WithSchema(toolingMethods.ByName("GetSemanticIndex")), + connect.WithHandlerOptions(opts...), + ) toolingBuildHandler := connect.NewUnaryHandler( ToolingBuildProcedure, svc.Build, @@ -301,6 +326,8 @@ func NewToolingHandler(svc ToolingHandler, opts ...connect.HandlerOption) (strin toolingRemoveDependencyHandler.ServeHTTP(w, r) case ToolingGetProjectInfoProcedure: toolingGetProjectInfoHandler.ServeHTTP(w, r) + case ToolingGetSemanticIndexProcedure: + toolingGetSemanticIndexHandler.ServeHTTP(w, r) case ToolingBuildProcedure: toolingBuildHandler.ServeHTTP(w, r) case ToolingTestProcedure: @@ -340,6 +367,10 @@ func (UnimplementedToolingHandler) GetProjectInfo(context.Context, *connect.Requ return nil, connect.NewError(connect.CodeUnimplemented, errors.New("codefly.services.tooling.v0.Tooling.GetProjectInfo is not implemented")) } +func (UnimplementedToolingHandler) GetSemanticIndex(context.Context, *connect.Request[v0.GetSemanticIndexRequest]) (*connect.Response[v0.GetSemanticIndexResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("codefly.services.tooling.v0.Tooling.GetSemanticIndex is not implemented")) +} + func (UnimplementedToolingHandler) Build(context.Context, *connect.Request[v0.BuildRequest]) (*connect.Response[v0.BuildResponse], error) { return nil, connect.NewError(connect.CodeUnimplemented, errors.New("codefly.services.tooling.v0.Tooling.Build is not implemented")) } diff --git a/generated/go/mind/gateway/v1/gateway.pb.go b/generated/go/mind/gateway/v1/gateway.pb.go index 8392f6a6..74165246 100644 --- a/generated/go/mind/gateway/v1/gateway.pb.go +++ b/generated/go/mind/gateway/v1/gateway.pb.go @@ -9085,6 +9085,121 @@ func (x *GetProjectInfoResponse) GetCodeUnit() *CodeUnitTarget { return nil } +// GetSemanticIndexRequest identifies one production-agent source boundary. +type GetSemanticIndexRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` + CodeUnit *CodeUnitTarget `protobuf:"bytes,2,opt,name=code_unit,json=codeUnit,proto3" json:"code_unit,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetSemanticIndexRequest) Reset() { + *x = GetSemanticIndexRequest{} + mi := &file_mind_gateway_v1_gateway_proto_msgTypes[119] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetSemanticIndexRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetSemanticIndexRequest) ProtoMessage() {} + +func (x *GetSemanticIndexRequest) ProtoReflect() protoreflect.Message { + mi := &file_mind_gateway_v1_gateway_proto_msgTypes[119] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetSemanticIndexRequest.ProtoReflect.Descriptor instead. +func (*GetSemanticIndexRequest) Descriptor() ([]byte, []int) { + return file_mind_gateway_v1_gateway_proto_rawDescGZIP(), []int{119} +} + +func (x *GetSemanticIndexRequest) GetService() string { + if x != nil { + return x.Service + } + return "" +} + +func (x *GetSemanticIndexRequest) GetCodeUnit() *CodeUnitTarget { + if x != nil { + return x.CodeUnit + } + return nil +} + +// GetSemanticIndexResponse preserves typed analyzer coverage and the exact +// inspected boundary. Paths in index are repository-relative. +type GetSemanticIndexResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Index *v0.SemanticIndex `protobuf:"bytes,1,opt,name=index,proto3" json:"index,omitempty"` + Failure *v0.Failure `protobuf:"bytes,2,opt,name=failure,proto3" json:"failure,omitempty"` + CodeUnit *CodeUnitTarget `protobuf:"bytes,3,opt,name=code_unit,json=codeUnit,proto3" json:"code_unit,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetSemanticIndexResponse) Reset() { + *x = GetSemanticIndexResponse{} + mi := &file_mind_gateway_v1_gateway_proto_msgTypes[120] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetSemanticIndexResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetSemanticIndexResponse) ProtoMessage() {} + +func (x *GetSemanticIndexResponse) ProtoReflect() protoreflect.Message { + mi := &file_mind_gateway_v1_gateway_proto_msgTypes[120] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetSemanticIndexResponse.ProtoReflect.Descriptor instead. +func (*GetSemanticIndexResponse) Descriptor() ([]byte, []int) { + return file_mind_gateway_v1_gateway_proto_rawDescGZIP(), []int{120} +} + +func (x *GetSemanticIndexResponse) GetIndex() *v0.SemanticIndex { + if x != nil { + return x.Index + } + return nil +} + +func (x *GetSemanticIndexResponse) GetFailure() *v0.Failure { + if x != nil { + return x.Failure + } + return nil +} + +func (x *GetSemanticIndexResponse) GetCodeUnit() *CodeUnitTarget { + if x != nil { + return x.CodeUnit + } + return nil +} + // DiscoverCodeUnitsRequest identifies the service whose rooted source tree is // inspected. Empty service selects the gateway's attached source behavior. type DiscoverCodeUnitsRequest struct { @@ -9096,7 +9211,7 @@ type DiscoverCodeUnitsRequest struct { func (x *DiscoverCodeUnitsRequest) Reset() { *x = DiscoverCodeUnitsRequest{} - mi := &file_mind_gateway_v1_gateway_proto_msgTypes[119] + mi := &file_mind_gateway_v1_gateway_proto_msgTypes[121] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9108,7 +9223,7 @@ func (x *DiscoverCodeUnitsRequest) String() string { func (*DiscoverCodeUnitsRequest) ProtoMessage() {} func (x *DiscoverCodeUnitsRequest) ProtoReflect() protoreflect.Message { - mi := &file_mind_gateway_v1_gateway_proto_msgTypes[119] + mi := &file_mind_gateway_v1_gateway_proto_msgTypes[121] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9121,7 +9236,7 @@ func (x *DiscoverCodeUnitsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DiscoverCodeUnitsRequest.ProtoReflect.Descriptor instead. func (*DiscoverCodeUnitsRequest) Descriptor() ([]byte, []int) { - return file_mind_gateway_v1_gateway_proto_rawDescGZIP(), []int{119} + return file_mind_gateway_v1_gateway_proto_rawDescGZIP(), []int{121} } func (x *DiscoverCodeUnitsRequest) GetService() string { @@ -9147,7 +9262,7 @@ type CodeUnitInfo struct { func (x *CodeUnitInfo) Reset() { *x = CodeUnitInfo{} - mi := &file_mind_gateway_v1_gateway_proto_msgTypes[120] + mi := &file_mind_gateway_v1_gateway_proto_msgTypes[122] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9159,7 +9274,7 @@ func (x *CodeUnitInfo) String() string { func (*CodeUnitInfo) ProtoMessage() {} func (x *CodeUnitInfo) ProtoReflect() protoreflect.Message { - mi := &file_mind_gateway_v1_gateway_proto_msgTypes[120] + mi := &file_mind_gateway_v1_gateway_proto_msgTypes[122] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9172,7 +9287,7 @@ func (x *CodeUnitInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use CodeUnitInfo.ProtoReflect.Descriptor instead. func (*CodeUnitInfo) Descriptor() ([]byte, []int) { - return file_mind_gateway_v1_gateway_proto_rawDescGZIP(), []int{120} + return file_mind_gateway_v1_gateway_proto_rawDescGZIP(), []int{122} } func (x *CodeUnitInfo) GetPath() string { @@ -9228,7 +9343,7 @@ type DiscoverCodeUnitsResponse struct { func (x *DiscoverCodeUnitsResponse) Reset() { *x = DiscoverCodeUnitsResponse{} - mi := &file_mind_gateway_v1_gateway_proto_msgTypes[121] + mi := &file_mind_gateway_v1_gateway_proto_msgTypes[123] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9240,7 +9355,7 @@ func (x *DiscoverCodeUnitsResponse) String() string { func (*DiscoverCodeUnitsResponse) ProtoMessage() {} func (x *DiscoverCodeUnitsResponse) ProtoReflect() protoreflect.Message { - mi := &file_mind_gateway_v1_gateway_proto_msgTypes[121] + mi := &file_mind_gateway_v1_gateway_proto_msgTypes[123] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9253,7 +9368,7 @@ func (x *DiscoverCodeUnitsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use DiscoverCodeUnitsResponse.ProtoReflect.Descriptor instead. func (*DiscoverCodeUnitsResponse) Descriptor() ([]byte, []int) { - return file_mind_gateway_v1_gateway_proto_rawDescGZIP(), []int{121} + return file_mind_gateway_v1_gateway_proto_rawDescGZIP(), []int{123} } func (x *DiscoverCodeUnitsResponse) GetCodeUnits() []*CodeUnitInfo { @@ -9293,7 +9408,7 @@ type AvailableCommand struct { func (x *AvailableCommand) Reset() { *x = AvailableCommand{} - mi := &file_mind_gateway_v1_gateway_proto_msgTypes[122] + mi := &file_mind_gateway_v1_gateway_proto_msgTypes[124] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9305,7 +9420,7 @@ func (x *AvailableCommand) String() string { func (*AvailableCommand) ProtoMessage() {} func (x *AvailableCommand) ProtoReflect() protoreflect.Message { - mi := &file_mind_gateway_v1_gateway_proto_msgTypes[122] + mi := &file_mind_gateway_v1_gateway_proto_msgTypes[124] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9318,7 +9433,7 @@ func (x *AvailableCommand) ProtoReflect() protoreflect.Message { // Deprecated: Use AvailableCommand.ProtoReflect.Descriptor instead. func (*AvailableCommand) Descriptor() ([]byte, []int) { - return file_mind_gateway_v1_gateway_proto_rawDescGZIP(), []int{122} + return file_mind_gateway_v1_gateway_proto_rawDescGZIP(), []int{124} } func (x *AvailableCommand) GetName() string { @@ -9379,7 +9494,7 @@ type ListAllCommandsRequest struct { func (x *ListAllCommandsRequest) Reset() { *x = ListAllCommandsRequest{} - mi := &file_mind_gateway_v1_gateway_proto_msgTypes[123] + mi := &file_mind_gateway_v1_gateway_proto_msgTypes[125] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9391,7 +9506,7 @@ func (x *ListAllCommandsRequest) String() string { func (*ListAllCommandsRequest) ProtoMessage() {} func (x *ListAllCommandsRequest) ProtoReflect() protoreflect.Message { - mi := &file_mind_gateway_v1_gateway_proto_msgTypes[123] + mi := &file_mind_gateway_v1_gateway_proto_msgTypes[125] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9404,7 +9519,7 @@ func (x *ListAllCommandsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListAllCommandsRequest.ProtoReflect.Descriptor instead. func (*ListAllCommandsRequest) Descriptor() ([]byte, []int) { - return file_mind_gateway_v1_gateway_proto_rawDescGZIP(), []int{123} + return file_mind_gateway_v1_gateway_proto_rawDescGZIP(), []int{125} } // ListAllCommandsResponse returns the gateway command catalog. @@ -9418,7 +9533,7 @@ type ListAllCommandsResponse struct { func (x *ListAllCommandsResponse) Reset() { *x = ListAllCommandsResponse{} - mi := &file_mind_gateway_v1_gateway_proto_msgTypes[124] + mi := &file_mind_gateway_v1_gateway_proto_msgTypes[126] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9430,7 +9545,7 @@ func (x *ListAllCommandsResponse) String() string { func (*ListAllCommandsResponse) ProtoMessage() {} func (x *ListAllCommandsResponse) ProtoReflect() protoreflect.Message { - mi := &file_mind_gateway_v1_gateway_proto_msgTypes[124] + mi := &file_mind_gateway_v1_gateway_proto_msgTypes[126] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9443,7 +9558,7 @@ func (x *ListAllCommandsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListAllCommandsResponse.ProtoReflect.Descriptor instead. func (*ListAllCommandsResponse) Descriptor() ([]byte, []int) { - return file_mind_gateway_v1_gateway_proto_rawDescGZIP(), []int{124} + return file_mind_gateway_v1_gateway_proto_rawDescGZIP(), []int{126} } func (x *ListAllCommandsResponse) GetCommands() []*AvailableCommand { @@ -9472,7 +9587,7 @@ type OpenTerminalRequest struct { func (x *OpenTerminalRequest) Reset() { *x = OpenTerminalRequest{} - mi := &file_mind_gateway_v1_gateway_proto_msgTypes[125] + mi := &file_mind_gateway_v1_gateway_proto_msgTypes[127] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9484,7 +9599,7 @@ func (x *OpenTerminalRequest) String() string { func (*OpenTerminalRequest) ProtoMessage() {} func (x *OpenTerminalRequest) ProtoReflect() protoreflect.Message { - mi := &file_mind_gateway_v1_gateway_proto_msgTypes[125] + mi := &file_mind_gateway_v1_gateway_proto_msgTypes[127] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9497,7 +9612,7 @@ func (x *OpenTerminalRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use OpenTerminalRequest.ProtoReflect.Descriptor instead. func (*OpenTerminalRequest) Descriptor() ([]byte, []int) { - return file_mind_gateway_v1_gateway_proto_rawDescGZIP(), []int{125} + return file_mind_gateway_v1_gateway_proto_rawDescGZIP(), []int{127} } func (x *OpenTerminalRequest) GetShell() string { @@ -9550,7 +9665,7 @@ type OpenTerminalResponse struct { func (x *OpenTerminalResponse) Reset() { *x = OpenTerminalResponse{} - mi := &file_mind_gateway_v1_gateway_proto_msgTypes[126] + mi := &file_mind_gateway_v1_gateway_proto_msgTypes[128] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9562,7 +9677,7 @@ func (x *OpenTerminalResponse) String() string { func (*OpenTerminalResponse) ProtoMessage() {} func (x *OpenTerminalResponse) ProtoReflect() protoreflect.Message { - mi := &file_mind_gateway_v1_gateway_proto_msgTypes[126] + mi := &file_mind_gateway_v1_gateway_proto_msgTypes[128] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9575,7 +9690,7 @@ func (x *OpenTerminalResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use OpenTerminalResponse.ProtoReflect.Descriptor instead. func (*OpenTerminalResponse) Descriptor() ([]byte, []int) { - return file_mind_gateway_v1_gateway_proto_rawDescGZIP(), []int{126} + return file_mind_gateway_v1_gateway_proto_rawDescGZIP(), []int{128} } func (x *OpenTerminalResponse) GetTerminalId() string { @@ -9613,7 +9728,7 @@ type TerminalInput struct { func (x *TerminalInput) Reset() { *x = TerminalInput{} - mi := &file_mind_gateway_v1_gateway_proto_msgTypes[127] + mi := &file_mind_gateway_v1_gateway_proto_msgTypes[129] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9625,7 +9740,7 @@ func (x *TerminalInput) String() string { func (*TerminalInput) ProtoMessage() {} func (x *TerminalInput) ProtoReflect() protoreflect.Message { - mi := &file_mind_gateway_v1_gateway_proto_msgTypes[127] + mi := &file_mind_gateway_v1_gateway_proto_msgTypes[129] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9638,7 +9753,7 @@ func (x *TerminalInput) ProtoReflect() protoreflect.Message { // Deprecated: Use TerminalInput.ProtoReflect.Descriptor instead. func (*TerminalInput) Descriptor() ([]byte, []int) { - return file_mind_gateway_v1_gateway_proto_rawDescGZIP(), []int{127} + return file_mind_gateway_v1_gateway_proto_rawDescGZIP(), []int{129} } func (x *TerminalInput) GetTerminalId() string { @@ -9673,7 +9788,7 @@ type TerminalOutput struct { func (x *TerminalOutput) Reset() { *x = TerminalOutput{} - mi := &file_mind_gateway_v1_gateway_proto_msgTypes[128] + mi := &file_mind_gateway_v1_gateway_proto_msgTypes[130] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9685,7 +9800,7 @@ func (x *TerminalOutput) String() string { func (*TerminalOutput) ProtoMessage() {} func (x *TerminalOutput) ProtoReflect() protoreflect.Message { - mi := &file_mind_gateway_v1_gateway_proto_msgTypes[128] + mi := &file_mind_gateway_v1_gateway_proto_msgTypes[130] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9698,7 +9813,7 @@ func (x *TerminalOutput) ProtoReflect() protoreflect.Message { // Deprecated: Use TerminalOutput.ProtoReflect.Descriptor instead. func (*TerminalOutput) Descriptor() ([]byte, []int) { - return file_mind_gateway_v1_gateway_proto_rawDescGZIP(), []int{128} + return file_mind_gateway_v1_gateway_proto_rawDescGZIP(), []int{130} } func (x *TerminalOutput) GetTerminalId() string { @@ -9744,7 +9859,7 @@ type ResizeTerminalRequest struct { func (x *ResizeTerminalRequest) Reset() { *x = ResizeTerminalRequest{} - mi := &file_mind_gateway_v1_gateway_proto_msgTypes[129] + mi := &file_mind_gateway_v1_gateway_proto_msgTypes[131] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9756,7 +9871,7 @@ func (x *ResizeTerminalRequest) String() string { func (*ResizeTerminalRequest) ProtoMessage() {} func (x *ResizeTerminalRequest) ProtoReflect() protoreflect.Message { - mi := &file_mind_gateway_v1_gateway_proto_msgTypes[129] + mi := &file_mind_gateway_v1_gateway_proto_msgTypes[131] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9769,7 +9884,7 @@ func (x *ResizeTerminalRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ResizeTerminalRequest.ProtoReflect.Descriptor instead. func (*ResizeTerminalRequest) Descriptor() ([]byte, []int) { - return file_mind_gateway_v1_gateway_proto_rawDescGZIP(), []int{129} + return file_mind_gateway_v1_gateway_proto_rawDescGZIP(), []int{131} } func (x *ResizeTerminalRequest) GetTerminalId() string { @@ -9802,7 +9917,7 @@ type ResizeTerminalResponse struct { func (x *ResizeTerminalResponse) Reset() { *x = ResizeTerminalResponse{} - mi := &file_mind_gateway_v1_gateway_proto_msgTypes[130] + mi := &file_mind_gateway_v1_gateway_proto_msgTypes[132] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9814,7 +9929,7 @@ func (x *ResizeTerminalResponse) String() string { func (*ResizeTerminalResponse) ProtoMessage() {} func (x *ResizeTerminalResponse) ProtoReflect() protoreflect.Message { - mi := &file_mind_gateway_v1_gateway_proto_msgTypes[130] + mi := &file_mind_gateway_v1_gateway_proto_msgTypes[132] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9827,7 +9942,7 @@ func (x *ResizeTerminalResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ResizeTerminalResponse.ProtoReflect.Descriptor instead. func (*ResizeTerminalResponse) Descriptor() ([]byte, []int) { - return file_mind_gateway_v1_gateway_proto_rawDescGZIP(), []int{130} + return file_mind_gateway_v1_gateway_proto_rawDescGZIP(), []int{132} } // CloseTerminalRequest terminates and removes one terminal session. @@ -9841,7 +9956,7 @@ type CloseTerminalRequest struct { func (x *CloseTerminalRequest) Reset() { *x = CloseTerminalRequest{} - mi := &file_mind_gateway_v1_gateway_proto_msgTypes[131] + mi := &file_mind_gateway_v1_gateway_proto_msgTypes[133] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9853,7 +9968,7 @@ func (x *CloseTerminalRequest) String() string { func (*CloseTerminalRequest) ProtoMessage() {} func (x *CloseTerminalRequest) ProtoReflect() protoreflect.Message { - mi := &file_mind_gateway_v1_gateway_proto_msgTypes[131] + mi := &file_mind_gateway_v1_gateway_proto_msgTypes[133] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9866,7 +9981,7 @@ func (x *CloseTerminalRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CloseTerminalRequest.ProtoReflect.Descriptor instead. func (*CloseTerminalRequest) Descriptor() ([]byte, []int) { - return file_mind_gateway_v1_gateway_proto_rawDescGZIP(), []int{131} + return file_mind_gateway_v1_gateway_proto_rawDescGZIP(), []int{133} } func (x *CloseTerminalRequest) GetTerminalId() string { @@ -9885,7 +10000,7 @@ type CloseTerminalResponse struct { func (x *CloseTerminalResponse) Reset() { *x = CloseTerminalResponse{} - mi := &file_mind_gateway_v1_gateway_proto_msgTypes[132] + mi := &file_mind_gateway_v1_gateway_proto_msgTypes[134] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9897,7 +10012,7 @@ func (x *CloseTerminalResponse) String() string { func (*CloseTerminalResponse) ProtoMessage() {} func (x *CloseTerminalResponse) ProtoReflect() protoreflect.Message { - mi := &file_mind_gateway_v1_gateway_proto_msgTypes[132] + mi := &file_mind_gateway_v1_gateway_proto_msgTypes[134] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9910,7 +10025,7 @@ func (x *CloseTerminalResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CloseTerminalResponse.ProtoReflect.Descriptor instead. func (*CloseTerminalResponse) Descriptor() ([]byte, []int) { - return file_mind_gateway_v1_gateway_proto_rawDescGZIP(), []int{132} + return file_mind_gateway_v1_gateway_proto_rawDescGZIP(), []int{134} } // ListTerminalsRequest requests every terminal visible to this gateway session. @@ -9922,7 +10037,7 @@ type ListTerminalsRequest struct { func (x *ListTerminalsRequest) Reset() { *x = ListTerminalsRequest{} - mi := &file_mind_gateway_v1_gateway_proto_msgTypes[133] + mi := &file_mind_gateway_v1_gateway_proto_msgTypes[135] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9934,7 +10049,7 @@ func (x *ListTerminalsRequest) String() string { func (*ListTerminalsRequest) ProtoMessage() {} func (x *ListTerminalsRequest) ProtoReflect() protoreflect.Message { - mi := &file_mind_gateway_v1_gateway_proto_msgTypes[133] + mi := &file_mind_gateway_v1_gateway_proto_msgTypes[135] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9947,7 +10062,7 @@ func (x *ListTerminalsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListTerminalsRequest.ProtoReflect.Descriptor instead. func (*ListTerminalsRequest) Descriptor() ([]byte, []int) { - return file_mind_gateway_v1_gateway_proto_rawDescGZIP(), []int{133} + return file_mind_gateway_v1_gateway_proto_rawDescGZIP(), []int{135} } // TerminalInfo describes one terminal session without exposing its PTY stream. @@ -9967,7 +10082,7 @@ type TerminalInfo struct { func (x *TerminalInfo) Reset() { *x = TerminalInfo{} - mi := &file_mind_gateway_v1_gateway_proto_msgTypes[134] + mi := &file_mind_gateway_v1_gateway_proto_msgTypes[136] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9979,7 +10094,7 @@ func (x *TerminalInfo) String() string { func (*TerminalInfo) ProtoMessage() {} func (x *TerminalInfo) ProtoReflect() protoreflect.Message { - mi := &file_mind_gateway_v1_gateway_proto_msgTypes[134] + mi := &file_mind_gateway_v1_gateway_proto_msgTypes[136] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9992,7 +10107,7 @@ func (x *TerminalInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use TerminalInfo.ProtoReflect.Descriptor instead. func (*TerminalInfo) Descriptor() ([]byte, []int) { - return file_mind_gateway_v1_gateway_proto_rawDescGZIP(), []int{134} + return file_mind_gateway_v1_gateway_proto_rawDescGZIP(), []int{136} } func (x *TerminalInfo) GetTerminalId() string { @@ -10034,7 +10149,7 @@ type ListTerminalsResponse struct { func (x *ListTerminalsResponse) Reset() { *x = ListTerminalsResponse{} - mi := &file_mind_gateway_v1_gateway_proto_msgTypes[135] + mi := &file_mind_gateway_v1_gateway_proto_msgTypes[137] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -10046,7 +10161,7 @@ func (x *ListTerminalsResponse) String() string { func (*ListTerminalsResponse) ProtoMessage() {} func (x *ListTerminalsResponse) ProtoReflect() protoreflect.Message { - mi := &file_mind_gateway_v1_gateway_proto_msgTypes[135] + mi := &file_mind_gateway_v1_gateway_proto_msgTypes[137] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -10059,7 +10174,7 @@ func (x *ListTerminalsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListTerminalsResponse.ProtoReflect.Descriptor instead. func (*ListTerminalsResponse) Descriptor() ([]byte, []int) { - return file_mind_gateway_v1_gateway_proto_rawDescGZIP(), []int{135} + return file_mind_gateway_v1_gateway_proto_rawDescGZIP(), []int{137} } func (x *ListTerminalsResponse) GetTerminals() []*TerminalInfo { @@ -10073,7 +10188,7 @@ var File_mind_gateway_v1_gateway_proto protoreflect.FileDescriptor const file_mind_gateway_v1_gateway_proto_rawDesc = "" + "\n" + - "\x1dmind/gateway/v1/gateway.proto\x12\x0fmind.gateway.v1\x1a\x1ccodefly/base/v0/source.proto\x1a\x1dcodefly/base/v0/failure.proto\x1a)codefly/services/builder/v0/builder.proto\x1a)codefly/services/runtime/v0/runtime.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x15\n" + + "\x1dmind/gateway/v1/gateway.proto\x12\x0fmind.gateway.v1\x1a\x1ccodefly/base/v0/source.proto\x1a\x1dcodefly/base/v0/failure.proto\x1a\x1ecodefly/base/v0/semantic.proto\x1a)codefly/services/builder/v0/builder.proto\x1a)codefly/services/runtime/v0/runtime.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x15\n" + "\x13ListServicesRequest\"e\n" + "\vServiceInfo\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12\x1a\n" + @@ -10711,7 +10826,14 @@ const file_mind_gateway_v1_gateway_proto_rawDesc = "" + " \x01(\v2\x1f.mind.gateway.v1.CodeUnitTargetR\bcodeUnit\x1a=\n" + "\x0fFileHashesEntry\x12\x10\n" + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01J\x04\b\a\x10\bR\x05error\"4\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01J\x04\b\a\x10\bR\x05error\"q\n" + + "\x17GetSemanticIndexRequest\x12\x18\n" + + "\aservice\x18\x01 \x01(\tR\aservice\x12<\n" + + "\tcode_unit\x18\x02 \x01(\v2\x1f.mind.gateway.v1.CodeUnitTargetR\bcodeUnit\"\xc2\x01\n" + + "\x18GetSemanticIndexResponse\x124\n" + + "\x05index\x18\x01 \x01(\v2\x1e.codefly.base.v0.SemanticIndexR\x05index\x122\n" + + "\afailure\x18\x02 \x01(\v2\x18.codefly.base.v0.FailureR\afailure\x12<\n" + + "\tcode_unit\x18\x03 \x01(\v2\x1f.mind.gateway.v1.CodeUnitTargetR\bcodeUnit\"4\n" + "\x18DiscoverCodeUnitsRequest\x12\x18\n" + "\aservice\x18\x01 \x01(\tR\aservice\"\xcb\x01\n" + "\fCodeUnitInfo\x12\x12\n" + @@ -10825,7 +10947,7 @@ const file_mind_gateway_v1_gateway_proto_rawDesc = "" + "\x1cFORGE_EVENT_KIND_UNSPECIFIED\x10\x00\x12!\n" + "\x1dFORGE_EVENT_KIND_PULL_REQUEST\x10\x01\x12\x1a\n" + "\x16FORGE_EVENT_KIND_CHECK\x10\x02\x12\x1b\n" + - "\x17FORGE_EVENT_KIND_REVIEW\x10\x032\xe3%\n" + + "\x17FORGE_EVENT_KIND_REVIEW\x10\x032\xcc&\n" + "\aGateway\x12[\n" + "\fListServices\x12$.mind.gateway.v1.ListServicesRequest\x1a%.mind.gateway.v1.ListServicesResponse\x12O\n" + "\bReadFile\x12 .mind.gateway.v1.ReadFileRequest\x1a!.mind.gateway.v1.ReadFileResponse\x12R\n" + @@ -10874,7 +10996,8 @@ const file_mind_gateway_v1_gateway_proto_rawDesc = "" + "\x10ListDependencies\x12(.mind.gateway.v1.ListDependenciesRequest\x1a).mind.gateway.v1.ListDependenciesResponse\x12^\n" + "\rAddDependency\x12%.mind.gateway.v1.AddDependencyRequest\x1a&.mind.gateway.v1.AddDependencyResponse\x12g\n" + "\x10RemoveDependency\x12(.mind.gateway.v1.RemoveDependencyRequest\x1a).mind.gateway.v1.RemoveDependencyResponse\x12a\n" + - "\x0eGetProjectInfo\x12&.mind.gateway.v1.GetProjectInfoRequest\x1a'.mind.gateway.v1.GetProjectInfoResponse\x12j\n" + + "\x0eGetProjectInfo\x12&.mind.gateway.v1.GetProjectInfoRequest\x1a'.mind.gateway.v1.GetProjectInfoResponse\x12g\n" + + "\x10GetSemanticIndex\x12(.mind.gateway.v1.GetSemanticIndexRequest\x1a).mind.gateway.v1.GetSemanticIndexResponse\x12j\n" + "\x11DiscoverCodeUnits\x12).mind.gateway.v1.DiscoverCodeUnitsRequest\x1a*.mind.gateway.v1.DiscoverCodeUnitsResponse\x12[\n" + "\fOpenTerminal\x12$.mind.gateway.v1.OpenTerminalRequest\x1a%.mind.gateway.v1.OpenTerminalResponse\x12U\n" + "\x0eAttachTerminal\x12\x1e.mind.gateway.v1.TerminalInput\x1a\x1f.mind.gateway.v1.TerminalOutput(\x010\x01\x12a\n" + @@ -10896,7 +11019,7 @@ func file_mind_gateway_v1_gateway_proto_rawDescGZIP() []byte { } var file_mind_gateway_v1_gateway_proto_enumTypes = make([]protoimpl.EnumInfo, 9) -var file_mind_gateway_v1_gateway_proto_msgTypes = make([]protoimpl.MessageInfo, 137) +var file_mind_gateway_v1_gateway_proto_msgTypes = make([]protoimpl.MessageInfo, 139) var file_mind_gateway_v1_gateway_proto_goTypes = []any{ (WorkspaceChangeOperation)(0), // 0: mind.gateway.v1.WorkspaceChangeOperation (PreparedFileOperation)(0), // 1: mind.gateway.v1.PreparedFileOperation @@ -11026,48 +11149,51 @@ var file_mind_gateway_v1_gateway_proto_goTypes = []any{ (*SourceFileInfo)(nil), // 125: mind.gateway.v1.SourceFileInfo (*GetProjectInfoRequest)(nil), // 126: mind.gateway.v1.GetProjectInfoRequest (*GetProjectInfoResponse)(nil), // 127: mind.gateway.v1.GetProjectInfoResponse - (*DiscoverCodeUnitsRequest)(nil), // 128: mind.gateway.v1.DiscoverCodeUnitsRequest - (*CodeUnitInfo)(nil), // 129: mind.gateway.v1.CodeUnitInfo - (*DiscoverCodeUnitsResponse)(nil), // 130: mind.gateway.v1.DiscoverCodeUnitsResponse - (*AvailableCommand)(nil), // 131: mind.gateway.v1.AvailableCommand - (*ListAllCommandsRequest)(nil), // 132: mind.gateway.v1.ListAllCommandsRequest - (*ListAllCommandsResponse)(nil), // 133: mind.gateway.v1.ListAllCommandsResponse - (*OpenTerminalRequest)(nil), // 134: mind.gateway.v1.OpenTerminalRequest - (*OpenTerminalResponse)(nil), // 135: mind.gateway.v1.OpenTerminalResponse - (*TerminalInput)(nil), // 136: mind.gateway.v1.TerminalInput - (*TerminalOutput)(nil), // 137: mind.gateway.v1.TerminalOutput - (*ResizeTerminalRequest)(nil), // 138: mind.gateway.v1.ResizeTerminalRequest - (*ResizeTerminalResponse)(nil), // 139: mind.gateway.v1.ResizeTerminalResponse - (*CloseTerminalRequest)(nil), // 140: mind.gateway.v1.CloseTerminalRequest - (*CloseTerminalResponse)(nil), // 141: mind.gateway.v1.CloseTerminalResponse - (*ListTerminalsRequest)(nil), // 142: mind.gateway.v1.ListTerminalsRequest - (*TerminalInfo)(nil), // 143: mind.gateway.v1.TerminalInfo - (*ListTerminalsResponse)(nil), // 144: mind.gateway.v1.ListTerminalsResponse - nil, // 145: mind.gateway.v1.GetProjectInfoResponse.FileHashesEntry - (*timestamppb.Timestamp)(nil), // 146: google.protobuf.Timestamp - (v0.FixMode)(0), // 147: codefly.base.v0.FixMode - (*v01.TestRequest)(nil), // 148: codefly.services.runtime.v0.TestRequest - (*v01.TestResponse)(nil), // 149: codefly.services.runtime.v0.TestResponse - (*v02.ConfigChange)(nil), // 150: codefly.services.builder.v0.ConfigChange - (*v02.ConfigureResponse)(nil), // 151: codefly.services.builder.v0.ConfigureResponse - (*v0.Failure)(nil), // 152: codefly.base.v0.Failure + (*GetSemanticIndexRequest)(nil), // 128: mind.gateway.v1.GetSemanticIndexRequest + (*GetSemanticIndexResponse)(nil), // 129: mind.gateway.v1.GetSemanticIndexResponse + (*DiscoverCodeUnitsRequest)(nil), // 130: mind.gateway.v1.DiscoverCodeUnitsRequest + (*CodeUnitInfo)(nil), // 131: mind.gateway.v1.CodeUnitInfo + (*DiscoverCodeUnitsResponse)(nil), // 132: mind.gateway.v1.DiscoverCodeUnitsResponse + (*AvailableCommand)(nil), // 133: mind.gateway.v1.AvailableCommand + (*ListAllCommandsRequest)(nil), // 134: mind.gateway.v1.ListAllCommandsRequest + (*ListAllCommandsResponse)(nil), // 135: mind.gateway.v1.ListAllCommandsResponse + (*OpenTerminalRequest)(nil), // 136: mind.gateway.v1.OpenTerminalRequest + (*OpenTerminalResponse)(nil), // 137: mind.gateway.v1.OpenTerminalResponse + (*TerminalInput)(nil), // 138: mind.gateway.v1.TerminalInput + (*TerminalOutput)(nil), // 139: mind.gateway.v1.TerminalOutput + (*ResizeTerminalRequest)(nil), // 140: mind.gateway.v1.ResizeTerminalRequest + (*ResizeTerminalResponse)(nil), // 141: mind.gateway.v1.ResizeTerminalResponse + (*CloseTerminalRequest)(nil), // 142: mind.gateway.v1.CloseTerminalRequest + (*CloseTerminalResponse)(nil), // 143: mind.gateway.v1.CloseTerminalResponse + (*ListTerminalsRequest)(nil), // 144: mind.gateway.v1.ListTerminalsRequest + (*TerminalInfo)(nil), // 145: mind.gateway.v1.TerminalInfo + (*ListTerminalsResponse)(nil), // 146: mind.gateway.v1.ListTerminalsResponse + nil, // 147: mind.gateway.v1.GetProjectInfoResponse.FileHashesEntry + (*timestamppb.Timestamp)(nil), // 148: google.protobuf.Timestamp + (v0.FixMode)(0), // 149: codefly.base.v0.FixMode + (*v01.TestRequest)(nil), // 150: codefly.services.runtime.v0.TestRequest + (*v01.TestResponse)(nil), // 151: codefly.services.runtime.v0.TestResponse + (*v02.ConfigChange)(nil), // 152: codefly.services.builder.v0.ConfigChange + (*v02.ConfigureResponse)(nil), // 153: codefly.services.builder.v0.ConfigureResponse + (*v0.Failure)(nil), // 154: codefly.base.v0.Failure + (*v0.SemanticIndex)(nil), // 155: codefly.base.v0.SemanticIndex } var file_mind_gateway_v1_gateway_proto_depIdxs = []int32{ 10, // 0: mind.gateway.v1.ListServicesResponse.services:type_name -> mind.gateway.v1.ServiceInfo 17, // 1: mind.gateway.v1.ListFilesResponse.files:type_name -> mind.gateway.v1.FileInfo 19, // 2: mind.gateway.v1.SubscribeWorkspaceChangesRequest.after:type_name -> mind.gateway.v1.WorkspaceChangeCursor 0, // 3: mind.gateway.v1.WorkspaceChange.operation:type_name -> mind.gateway.v1.WorkspaceChangeOperation - 146, // 4: mind.gateway.v1.WorkspaceChangeEvent.observed_at:type_name -> google.protobuf.Timestamp + 148, // 4: mind.gateway.v1.WorkspaceChangeEvent.observed_at:type_name -> google.protobuf.Timestamp 21, // 5: mind.gateway.v1.WorkspaceChangeEvent.changes:type_name -> mind.gateway.v1.WorkspaceChange - 147, // 6: mind.gateway.v1.FixRequest.mode:type_name -> codefly.base.v0.FixMode - 147, // 7: mind.gateway.v1.ApplyEditRequest.fix_mode:type_name -> codefly.base.v0.FixMode + 149, // 6: mind.gateway.v1.FixRequest.mode:type_name -> codefly.base.v0.FixMode + 149, // 7: mind.gateway.v1.ApplyEditRequest.fix_mode:type_name -> codefly.base.v0.FixMode 31, // 8: mind.gateway.v1.BatchApplyEditsRequest.edits:type_name -> mind.gateway.v1.ApplyEditRequest 34, // 9: mind.gateway.v1.BatchApplyEditsResponse.results:type_name -> mind.gateway.v1.EditResult 1, // 10: mind.gateway.v1.PreparedFileMutation.operation:type_name -> mind.gateway.v1.PreparedFileOperation 38, // 11: mind.gateway.v1.PreparedMutation.files:type_name -> mind.gateway.v1.PreparedFileMutation - 146, // 12: mind.gateway.v1.PreparedMutation.prepared_at:type_name -> google.protobuf.Timestamp - 146, // 13: mind.gateway.v1.PreparedMutation.expires_at:type_name -> google.protobuf.Timestamp - 147, // 14: mind.gateway.v1.PrepareApplyEditMutation.fix_mode:type_name -> codefly.base.v0.FixMode + 148, // 12: mind.gateway.v1.PreparedMutation.prepared_at:type_name -> google.protobuf.Timestamp + 148, // 13: mind.gateway.v1.PreparedMutation.expires_at:type_name -> google.protobuf.Timestamp + 149, // 14: mind.gateway.v1.PrepareApplyEditMutation.fix_mode:type_name -> codefly.base.v0.FixMode 40, // 15: mind.gateway.v1.PrepareMutationRequest.apply_edit:type_name -> mind.gateway.v1.PrepareApplyEditMutation 39, // 16: mind.gateway.v1.PrepareMutationResponse.prepared:type_name -> mind.gateway.v1.PreparedMutation 1, // 17: mind.gateway.v1.AppliedFileMutation.operation:type_name -> mind.gateway.v1.PreparedFileOperation @@ -11075,11 +11201,11 @@ var file_mind_gateway_v1_gateway_proto_depIdxs = []int32{ 47, // 19: mind.gateway.v1.SearchResponse.matches:type_name -> mind.gateway.v1.SearchMatch 50, // 20: mind.gateway.v1.BuildResponse.errors:type_name -> mind.gateway.v1.BuildError 50, // 21: mind.gateway.v1.LintResponse.errors:type_name -> mind.gateway.v1.BuildError - 148, // 22: mind.gateway.v1.TestRequest.runtime_request:type_name -> codefly.services.runtime.v0.TestRequest + 150, // 22: mind.gateway.v1.TestRequest.runtime_request:type_name -> codefly.services.runtime.v0.TestRequest 54, // 23: mind.gateway.v1.TestRequest.code_units:type_name -> mind.gateway.v1.CodeUnitTarget - 149, // 24: mind.gateway.v1.TestResponse.runtime_response:type_name -> codefly.services.runtime.v0.TestResponse - 150, // 25: mind.gateway.v1.ConfigureServiceRequest.changes:type_name -> codefly.services.builder.v0.ConfigChange - 151, // 26: mind.gateway.v1.ConfigureServiceResponse.response:type_name -> codefly.services.builder.v0.ConfigureResponse + 151, // 24: mind.gateway.v1.TestResponse.runtime_response:type_name -> codefly.services.runtime.v0.TestResponse + 152, // 25: mind.gateway.v1.ConfigureServiceRequest.changes:type_name -> codefly.services.builder.v0.ConfigChange + 153, // 26: mind.gateway.v1.ConfigureServiceResponse.response:type_name -> codefly.services.builder.v0.ConfigureResponse 50, // 27: mind.gateway.v1.FormatResponse.errors:type_name -> mind.gateway.v1.BuildError 81, // 28: mind.gateway.v1.FormatResponse.act:type_name -> mind.gateway.v1.ActReceipt 2, // 29: mind.gateway.v1.UnstructuredUse.command_class:type_name -> mind.gateway.v1.CommandClass @@ -11093,7 +11219,7 @@ var file_mind_gateway_v1_gateway_proto_depIdxs = []int32{ 69, // 37: mind.gateway.v1.RunChecksResponse.results:type_name -> mind.gateway.v1.CheckResult 72, // 38: mind.gateway.v1.GitStatusResponse.files:type_name -> mind.gateway.v1.GitFileStatus 77, // 39: mind.gateway.v1.GitLogResponse.commits:type_name -> mind.gateway.v1.GitCommitInfo - 146, // 40: mind.gateway.v1.ActReceipt.observed_at:type_name -> google.protobuf.Timestamp + 148, // 40: mind.gateway.v1.ActReceipt.observed_at:type_name -> google.protobuf.Timestamp 81, // 41: mind.gateway.v1.GitBranchResponse.act:type_name -> mind.gateway.v1.ActReceipt 81, // 42: mind.gateway.v1.GitCheckoutResponse.act:type_name -> mind.gateway.v1.ActReceipt 3, // 43: mind.gateway.v1.GitPushRequest.mode:type_name -> mind.gateway.v1.GitPushMode @@ -11107,11 +11233,11 @@ var file_mind_gateway_v1_gateway_proto_depIdxs = []int32{ 100, // 51: mind.gateway.v1.ReleaseRequest.units:type_name -> mind.gateway.v1.ReleaseUnit 81, // 52: mind.gateway.v1.ReleaseResponse.act:type_name -> mind.gateway.v1.ActReceipt 101, // 53: mind.gateway.v1.ReleaseResponse.units:type_name -> mind.gateway.v1.ReleasedUnit - 146, // 54: mind.gateway.v1.ForgeReview.submitted_at:type_name -> google.protobuf.Timestamp + 148, // 54: mind.gateway.v1.ForgeReview.submitted_at:type_name -> google.protobuf.Timestamp 104, // 55: mind.gateway.v1.ForgePullRequestStatus.repository:type_name -> mind.gateway.v1.ForgeRepository 105, // 56: mind.gateway.v1.ForgePullRequestStatus.checks:type_name -> mind.gateway.v1.ForgeCheck 106, // 57: mind.gateway.v1.ForgePullRequestStatus.reviews:type_name -> mind.gateway.v1.ForgeReview - 146, // 58: mind.gateway.v1.ForgePullRequestStatus.observed_at:type_name -> google.protobuf.Timestamp + 148, // 58: mind.gateway.v1.ForgePullRequestStatus.observed_at:type_name -> google.protobuf.Timestamp 104, // 59: mind.gateway.v1.ForgePullRequestStatusRequest.repository:type_name -> mind.gateway.v1.ForgeRepository 107, // 60: mind.gateway.v1.ForgePullRequestStatusResponse.status:type_name -> mind.gateway.v1.ForgePullRequestStatus 104, // 61: mind.gateway.v1.ForgeMergePullRequestRequest.repository:type_name -> mind.gateway.v1.ForgeRepository @@ -11123,127 +11249,133 @@ var file_mind_gateway_v1_gateway_proto_depIdxs = []int32{ 81, // 67: mind.gateway.v1.ForgeRequestReviewResponse.act:type_name -> mind.gateway.v1.ActReceipt 8, // 68: mind.gateway.v1.ForgeEvent.kind:type_name -> mind.gateway.v1.ForgeEventKind 104, // 69: mind.gateway.v1.ForgeEvent.repository:type_name -> mind.gateway.v1.ForgeRepository - 146, // 70: mind.gateway.v1.ForgeEvent.observed_at:type_name -> google.protobuf.Timestamp + 148, // 70: mind.gateway.v1.ForgeEvent.observed_at:type_name -> google.protobuf.Timestamp 114, // 71: mind.gateway.v1.ForgeNormalizeWebhookResponse.event:type_name -> mind.gateway.v1.ForgeEvent 117, // 72: mind.gateway.v1.ListDependenciesResponse.dependencies:type_name -> mind.gateway.v1.Dependency 54, // 73: mind.gateway.v1.GetProjectInfoRequest.code_unit:type_name -> mind.gateway.v1.CodeUnitTarget 124, // 74: mind.gateway.v1.GetProjectInfoResponse.packages:type_name -> mind.gateway.v1.PackageInfo 117, // 75: mind.gateway.v1.GetProjectInfoResponse.dependencies:type_name -> mind.gateway.v1.Dependency - 145, // 76: mind.gateway.v1.GetProjectInfoResponse.file_hashes:type_name -> mind.gateway.v1.GetProjectInfoResponse.FileHashesEntry - 152, // 77: mind.gateway.v1.GetProjectInfoResponse.failure:type_name -> codefly.base.v0.Failure + 147, // 76: mind.gateway.v1.GetProjectInfoResponse.file_hashes:type_name -> mind.gateway.v1.GetProjectInfoResponse.FileHashesEntry + 154, // 77: mind.gateway.v1.GetProjectInfoResponse.failure:type_name -> codefly.base.v0.Failure 125, // 78: mind.gateway.v1.GetProjectInfoResponse.source_files:type_name -> mind.gateway.v1.SourceFileInfo 54, // 79: mind.gateway.v1.GetProjectInfoResponse.code_unit:type_name -> mind.gateway.v1.CodeUnitTarget - 129, // 80: mind.gateway.v1.DiscoverCodeUnitsResponse.code_units:type_name -> mind.gateway.v1.CodeUnitInfo - 131, // 81: mind.gateway.v1.ListAllCommandsResponse.commands:type_name -> mind.gateway.v1.AvailableCommand - 61, // 82: mind.gateway.v1.OpenTerminalRequest.unstructured_use:type_name -> mind.gateway.v1.UnstructuredUse - 143, // 83: mind.gateway.v1.ListTerminalsResponse.terminals:type_name -> mind.gateway.v1.TerminalInfo - 9, // 84: mind.gateway.v1.Gateway.ListServices:input_type -> mind.gateway.v1.ListServicesRequest - 12, // 85: mind.gateway.v1.Gateway.ReadFile:input_type -> mind.gateway.v1.ReadFileRequest - 14, // 86: mind.gateway.v1.Gateway.WriteFile:input_type -> mind.gateway.v1.WriteFileRequest - 16, // 87: mind.gateway.v1.Gateway.ListFiles:input_type -> mind.gateway.v1.ListFilesRequest - 20, // 88: mind.gateway.v1.Gateway.SubscribeWorkspaceChanges:input_type -> mind.gateway.v1.SubscribeWorkspaceChangesRequest - 23, // 89: mind.gateway.v1.Gateway.DeleteFile:input_type -> mind.gateway.v1.DeleteFileRequest - 25, // 90: mind.gateway.v1.Gateway.MoveFile:input_type -> mind.gateway.v1.MoveFileRequest - 27, // 91: mind.gateway.v1.Gateway.CreateFile:input_type -> mind.gateway.v1.CreateFileRequest - 29, // 92: mind.gateway.v1.Gateway.Fix:input_type -> mind.gateway.v1.FixRequest - 31, // 93: mind.gateway.v1.Gateway.ApplyEdit:input_type -> mind.gateway.v1.ApplyEditRequest - 33, // 94: mind.gateway.v1.Gateway.BatchApplyEdits:input_type -> mind.gateway.v1.BatchApplyEditsRequest - 36, // 95: mind.gateway.v1.Gateway.ConfigureMutationAuthority:input_type -> mind.gateway.v1.ConfigureMutationAuthorityRequest - 41, // 96: mind.gateway.v1.Gateway.PrepareMutation:input_type -> mind.gateway.v1.PrepareMutationRequest - 43, // 97: mind.gateway.v1.Gateway.ApplyPreparedMutation:input_type -> mind.gateway.v1.ApplyPreparedMutationRequest - 46, // 98: mind.gateway.v1.Gateway.Search:input_type -> mind.gateway.v1.SearchRequest - 49, // 99: mind.gateway.v1.Gateway.Build:input_type -> mind.gateway.v1.BuildRequest - 52, // 100: mind.gateway.v1.Gateway.Lint:input_type -> mind.gateway.v1.LintRequest - 55, // 101: mind.gateway.v1.Gateway.Test:input_type -> mind.gateway.v1.TestRequest - 57, // 102: mind.gateway.v1.Gateway.ConfigureService:input_type -> mind.gateway.v1.ConfigureServiceRequest - 59, // 103: mind.gateway.v1.Gateway.Format:input_type -> mind.gateway.v1.FormatRequest - 62, // 104: mind.gateway.v1.Gateway.RunCommand:input_type -> mind.gateway.v1.RunCommandRequest - 132, // 105: mind.gateway.v1.Gateway.ListAllCommands:input_type -> mind.gateway.v1.ListAllCommandsRequest - 64, // 106: mind.gateway.v1.Gateway.RunChecks:input_type -> mind.gateway.v1.RunChecksRequest - 71, // 107: mind.gateway.v1.Gateway.GitStatus:input_type -> mind.gateway.v1.GitStatusRequest - 74, // 108: mind.gateway.v1.Gateway.GitDiff:input_type -> mind.gateway.v1.GitDiffRequest - 76, // 109: mind.gateway.v1.Gateway.GitLog:input_type -> mind.gateway.v1.GitLogRequest - 79, // 110: mind.gateway.v1.Gateway.GitCommit:input_type -> mind.gateway.v1.GitCommitRequest - 82, // 111: mind.gateway.v1.Gateway.GitBranch:input_type -> mind.gateway.v1.GitBranchRequest - 84, // 112: mind.gateway.v1.Gateway.GitCheckout:input_type -> mind.gateway.v1.GitCheckoutRequest - 86, // 113: mind.gateway.v1.Gateway.GitPush:input_type -> mind.gateway.v1.GitPushRequest - 88, // 114: mind.gateway.v1.Gateway.GitTag:input_type -> mind.gateway.v1.GitTagRequest - 90, // 115: mind.gateway.v1.Gateway.GitMerge:input_type -> mind.gateway.v1.GitMergeRequest - 92, // 116: mind.gateway.v1.Gateway.GitRevert:input_type -> mind.gateway.v1.GitRevertRequest - 94, // 117: mind.gateway.v1.Gateway.MaterializeRepositorySnapshot:input_type -> mind.gateway.v1.MaterializeRepositorySnapshotRequest - 96, // 118: mind.gateway.v1.Gateway.PrepareRepositoryCheckout:input_type -> mind.gateway.v1.PrepareRepositoryCheckoutRequest - 98, // 119: mind.gateway.v1.Gateway.ReleaseRepositorySnapshot:input_type -> mind.gateway.v1.ReleaseRepositorySnapshotRequest - 102, // 120: mind.gateway.v1.Gateway.Release:input_type -> mind.gateway.v1.ReleaseRequest - 108, // 121: mind.gateway.v1.Gateway.ForgePullRequestStatus:input_type -> mind.gateway.v1.ForgePullRequestStatusRequest - 110, // 122: mind.gateway.v1.Gateway.ForgeMergePullRequest:input_type -> mind.gateway.v1.ForgeMergePullRequestRequest - 112, // 123: mind.gateway.v1.Gateway.ForgeRequestReview:input_type -> mind.gateway.v1.ForgeRequestReviewRequest - 115, // 124: mind.gateway.v1.Gateway.ForgeNormalizeWebhook:input_type -> mind.gateway.v1.ForgeNormalizeWebhookRequest - 118, // 125: mind.gateway.v1.Gateway.ListDependencies:input_type -> mind.gateway.v1.ListDependenciesRequest - 120, // 126: mind.gateway.v1.Gateway.AddDependency:input_type -> mind.gateway.v1.AddDependencyRequest - 122, // 127: mind.gateway.v1.Gateway.RemoveDependency:input_type -> mind.gateway.v1.RemoveDependencyRequest - 126, // 128: mind.gateway.v1.Gateway.GetProjectInfo:input_type -> mind.gateway.v1.GetProjectInfoRequest - 128, // 129: mind.gateway.v1.Gateway.DiscoverCodeUnits:input_type -> mind.gateway.v1.DiscoverCodeUnitsRequest - 134, // 130: mind.gateway.v1.Gateway.OpenTerminal:input_type -> mind.gateway.v1.OpenTerminalRequest - 136, // 131: mind.gateway.v1.Gateway.AttachTerminal:input_type -> mind.gateway.v1.TerminalInput - 138, // 132: mind.gateway.v1.Gateway.ResizeTerminal:input_type -> mind.gateway.v1.ResizeTerminalRequest - 140, // 133: mind.gateway.v1.Gateway.CloseTerminal:input_type -> mind.gateway.v1.CloseTerminalRequest - 142, // 134: mind.gateway.v1.Gateway.ListTerminals:input_type -> mind.gateway.v1.ListTerminalsRequest - 11, // 135: mind.gateway.v1.Gateway.ListServices:output_type -> mind.gateway.v1.ListServicesResponse - 13, // 136: mind.gateway.v1.Gateway.ReadFile:output_type -> mind.gateway.v1.ReadFileResponse - 15, // 137: mind.gateway.v1.Gateway.WriteFile:output_type -> mind.gateway.v1.WriteFileResponse - 18, // 138: mind.gateway.v1.Gateway.ListFiles:output_type -> mind.gateway.v1.ListFilesResponse - 22, // 139: mind.gateway.v1.Gateway.SubscribeWorkspaceChanges:output_type -> mind.gateway.v1.WorkspaceChangeEvent - 24, // 140: mind.gateway.v1.Gateway.DeleteFile:output_type -> mind.gateway.v1.DeleteFileResponse - 26, // 141: mind.gateway.v1.Gateway.MoveFile:output_type -> mind.gateway.v1.MoveFileResponse - 28, // 142: mind.gateway.v1.Gateway.CreateFile:output_type -> mind.gateway.v1.CreateFileResponse - 30, // 143: mind.gateway.v1.Gateway.Fix:output_type -> mind.gateway.v1.FixResponse - 32, // 144: mind.gateway.v1.Gateway.ApplyEdit:output_type -> mind.gateway.v1.ApplyEditResponse - 35, // 145: mind.gateway.v1.Gateway.BatchApplyEdits:output_type -> mind.gateway.v1.BatchApplyEditsResponse - 37, // 146: mind.gateway.v1.Gateway.ConfigureMutationAuthority:output_type -> mind.gateway.v1.ConfigureMutationAuthorityResponse - 42, // 147: mind.gateway.v1.Gateway.PrepareMutation:output_type -> mind.gateway.v1.PrepareMutationResponse - 45, // 148: mind.gateway.v1.Gateway.ApplyPreparedMutation:output_type -> mind.gateway.v1.ApplyPreparedMutationResponse - 48, // 149: mind.gateway.v1.Gateway.Search:output_type -> mind.gateway.v1.SearchResponse - 51, // 150: mind.gateway.v1.Gateway.Build:output_type -> mind.gateway.v1.BuildResponse - 53, // 151: mind.gateway.v1.Gateway.Lint:output_type -> mind.gateway.v1.LintResponse - 56, // 152: mind.gateway.v1.Gateway.Test:output_type -> mind.gateway.v1.TestResponse - 58, // 153: mind.gateway.v1.Gateway.ConfigureService:output_type -> mind.gateway.v1.ConfigureServiceResponse - 60, // 154: mind.gateway.v1.Gateway.Format:output_type -> mind.gateway.v1.FormatResponse - 63, // 155: mind.gateway.v1.Gateway.RunCommand:output_type -> mind.gateway.v1.RunCommandResponse - 133, // 156: mind.gateway.v1.Gateway.ListAllCommands:output_type -> mind.gateway.v1.ListAllCommandsResponse - 70, // 157: mind.gateway.v1.Gateway.RunChecks:output_type -> mind.gateway.v1.RunChecksResponse - 73, // 158: mind.gateway.v1.Gateway.GitStatus:output_type -> mind.gateway.v1.GitStatusResponse - 75, // 159: mind.gateway.v1.Gateway.GitDiff:output_type -> mind.gateway.v1.GitDiffResponse - 78, // 160: mind.gateway.v1.Gateway.GitLog:output_type -> mind.gateway.v1.GitLogResponse - 80, // 161: mind.gateway.v1.Gateway.GitCommit:output_type -> mind.gateway.v1.GitCommitResponse - 83, // 162: mind.gateway.v1.Gateway.GitBranch:output_type -> mind.gateway.v1.GitBranchResponse - 85, // 163: mind.gateway.v1.Gateway.GitCheckout:output_type -> mind.gateway.v1.GitCheckoutResponse - 87, // 164: mind.gateway.v1.Gateway.GitPush:output_type -> mind.gateway.v1.GitPushResponse - 89, // 165: mind.gateway.v1.Gateway.GitTag:output_type -> mind.gateway.v1.GitTagResponse - 91, // 166: mind.gateway.v1.Gateway.GitMerge:output_type -> mind.gateway.v1.GitMergeResponse - 93, // 167: mind.gateway.v1.Gateway.GitRevert:output_type -> mind.gateway.v1.GitRevertResponse - 95, // 168: mind.gateway.v1.Gateway.MaterializeRepositorySnapshot:output_type -> mind.gateway.v1.MaterializeRepositorySnapshotResponse - 97, // 169: mind.gateway.v1.Gateway.PrepareRepositoryCheckout:output_type -> mind.gateway.v1.PrepareRepositoryCheckoutResponse - 99, // 170: mind.gateway.v1.Gateway.ReleaseRepositorySnapshot:output_type -> mind.gateway.v1.ReleaseRepositorySnapshotResponse - 103, // 171: mind.gateway.v1.Gateway.Release:output_type -> mind.gateway.v1.ReleaseResponse - 109, // 172: mind.gateway.v1.Gateway.ForgePullRequestStatus:output_type -> mind.gateway.v1.ForgePullRequestStatusResponse - 111, // 173: mind.gateway.v1.Gateway.ForgeMergePullRequest:output_type -> mind.gateway.v1.ForgeMergePullRequestResponse - 113, // 174: mind.gateway.v1.Gateway.ForgeRequestReview:output_type -> mind.gateway.v1.ForgeRequestReviewResponse - 116, // 175: mind.gateway.v1.Gateway.ForgeNormalizeWebhook:output_type -> mind.gateway.v1.ForgeNormalizeWebhookResponse - 119, // 176: mind.gateway.v1.Gateway.ListDependencies:output_type -> mind.gateway.v1.ListDependenciesResponse - 121, // 177: mind.gateway.v1.Gateway.AddDependency:output_type -> mind.gateway.v1.AddDependencyResponse - 123, // 178: mind.gateway.v1.Gateway.RemoveDependency:output_type -> mind.gateway.v1.RemoveDependencyResponse - 127, // 179: mind.gateway.v1.Gateway.GetProjectInfo:output_type -> mind.gateway.v1.GetProjectInfoResponse - 130, // 180: mind.gateway.v1.Gateway.DiscoverCodeUnits:output_type -> mind.gateway.v1.DiscoverCodeUnitsResponse - 135, // 181: mind.gateway.v1.Gateway.OpenTerminal:output_type -> mind.gateway.v1.OpenTerminalResponse - 137, // 182: mind.gateway.v1.Gateway.AttachTerminal:output_type -> mind.gateway.v1.TerminalOutput - 139, // 183: mind.gateway.v1.Gateway.ResizeTerminal:output_type -> mind.gateway.v1.ResizeTerminalResponse - 141, // 184: mind.gateway.v1.Gateway.CloseTerminal:output_type -> mind.gateway.v1.CloseTerminalResponse - 144, // 185: mind.gateway.v1.Gateway.ListTerminals:output_type -> mind.gateway.v1.ListTerminalsResponse - 135, // [135:186] is the sub-list for method output_type - 84, // [84:135] is the sub-list for method input_type - 84, // [84:84] is the sub-list for extension type_name - 84, // [84:84] is the sub-list for extension extendee - 0, // [0:84] is the sub-list for field type_name + 54, // 80: mind.gateway.v1.GetSemanticIndexRequest.code_unit:type_name -> mind.gateway.v1.CodeUnitTarget + 155, // 81: mind.gateway.v1.GetSemanticIndexResponse.index:type_name -> codefly.base.v0.SemanticIndex + 154, // 82: mind.gateway.v1.GetSemanticIndexResponse.failure:type_name -> codefly.base.v0.Failure + 54, // 83: mind.gateway.v1.GetSemanticIndexResponse.code_unit:type_name -> mind.gateway.v1.CodeUnitTarget + 131, // 84: mind.gateway.v1.DiscoverCodeUnitsResponse.code_units:type_name -> mind.gateway.v1.CodeUnitInfo + 133, // 85: mind.gateway.v1.ListAllCommandsResponse.commands:type_name -> mind.gateway.v1.AvailableCommand + 61, // 86: mind.gateway.v1.OpenTerminalRequest.unstructured_use:type_name -> mind.gateway.v1.UnstructuredUse + 145, // 87: mind.gateway.v1.ListTerminalsResponse.terminals:type_name -> mind.gateway.v1.TerminalInfo + 9, // 88: mind.gateway.v1.Gateway.ListServices:input_type -> mind.gateway.v1.ListServicesRequest + 12, // 89: mind.gateway.v1.Gateway.ReadFile:input_type -> mind.gateway.v1.ReadFileRequest + 14, // 90: mind.gateway.v1.Gateway.WriteFile:input_type -> mind.gateway.v1.WriteFileRequest + 16, // 91: mind.gateway.v1.Gateway.ListFiles:input_type -> mind.gateway.v1.ListFilesRequest + 20, // 92: mind.gateway.v1.Gateway.SubscribeWorkspaceChanges:input_type -> mind.gateway.v1.SubscribeWorkspaceChangesRequest + 23, // 93: mind.gateway.v1.Gateway.DeleteFile:input_type -> mind.gateway.v1.DeleteFileRequest + 25, // 94: mind.gateway.v1.Gateway.MoveFile:input_type -> mind.gateway.v1.MoveFileRequest + 27, // 95: mind.gateway.v1.Gateway.CreateFile:input_type -> mind.gateway.v1.CreateFileRequest + 29, // 96: mind.gateway.v1.Gateway.Fix:input_type -> mind.gateway.v1.FixRequest + 31, // 97: mind.gateway.v1.Gateway.ApplyEdit:input_type -> mind.gateway.v1.ApplyEditRequest + 33, // 98: mind.gateway.v1.Gateway.BatchApplyEdits:input_type -> mind.gateway.v1.BatchApplyEditsRequest + 36, // 99: mind.gateway.v1.Gateway.ConfigureMutationAuthority:input_type -> mind.gateway.v1.ConfigureMutationAuthorityRequest + 41, // 100: mind.gateway.v1.Gateway.PrepareMutation:input_type -> mind.gateway.v1.PrepareMutationRequest + 43, // 101: mind.gateway.v1.Gateway.ApplyPreparedMutation:input_type -> mind.gateway.v1.ApplyPreparedMutationRequest + 46, // 102: mind.gateway.v1.Gateway.Search:input_type -> mind.gateway.v1.SearchRequest + 49, // 103: mind.gateway.v1.Gateway.Build:input_type -> mind.gateway.v1.BuildRequest + 52, // 104: mind.gateway.v1.Gateway.Lint:input_type -> mind.gateway.v1.LintRequest + 55, // 105: mind.gateway.v1.Gateway.Test:input_type -> mind.gateway.v1.TestRequest + 57, // 106: mind.gateway.v1.Gateway.ConfigureService:input_type -> mind.gateway.v1.ConfigureServiceRequest + 59, // 107: mind.gateway.v1.Gateway.Format:input_type -> mind.gateway.v1.FormatRequest + 62, // 108: mind.gateway.v1.Gateway.RunCommand:input_type -> mind.gateway.v1.RunCommandRequest + 134, // 109: mind.gateway.v1.Gateway.ListAllCommands:input_type -> mind.gateway.v1.ListAllCommandsRequest + 64, // 110: mind.gateway.v1.Gateway.RunChecks:input_type -> mind.gateway.v1.RunChecksRequest + 71, // 111: mind.gateway.v1.Gateway.GitStatus:input_type -> mind.gateway.v1.GitStatusRequest + 74, // 112: mind.gateway.v1.Gateway.GitDiff:input_type -> mind.gateway.v1.GitDiffRequest + 76, // 113: mind.gateway.v1.Gateway.GitLog:input_type -> mind.gateway.v1.GitLogRequest + 79, // 114: mind.gateway.v1.Gateway.GitCommit:input_type -> mind.gateway.v1.GitCommitRequest + 82, // 115: mind.gateway.v1.Gateway.GitBranch:input_type -> mind.gateway.v1.GitBranchRequest + 84, // 116: mind.gateway.v1.Gateway.GitCheckout:input_type -> mind.gateway.v1.GitCheckoutRequest + 86, // 117: mind.gateway.v1.Gateway.GitPush:input_type -> mind.gateway.v1.GitPushRequest + 88, // 118: mind.gateway.v1.Gateway.GitTag:input_type -> mind.gateway.v1.GitTagRequest + 90, // 119: mind.gateway.v1.Gateway.GitMerge:input_type -> mind.gateway.v1.GitMergeRequest + 92, // 120: mind.gateway.v1.Gateway.GitRevert:input_type -> mind.gateway.v1.GitRevertRequest + 94, // 121: mind.gateway.v1.Gateway.MaterializeRepositorySnapshot:input_type -> mind.gateway.v1.MaterializeRepositorySnapshotRequest + 96, // 122: mind.gateway.v1.Gateway.PrepareRepositoryCheckout:input_type -> mind.gateway.v1.PrepareRepositoryCheckoutRequest + 98, // 123: mind.gateway.v1.Gateway.ReleaseRepositorySnapshot:input_type -> mind.gateway.v1.ReleaseRepositorySnapshotRequest + 102, // 124: mind.gateway.v1.Gateway.Release:input_type -> mind.gateway.v1.ReleaseRequest + 108, // 125: mind.gateway.v1.Gateway.ForgePullRequestStatus:input_type -> mind.gateway.v1.ForgePullRequestStatusRequest + 110, // 126: mind.gateway.v1.Gateway.ForgeMergePullRequest:input_type -> mind.gateway.v1.ForgeMergePullRequestRequest + 112, // 127: mind.gateway.v1.Gateway.ForgeRequestReview:input_type -> mind.gateway.v1.ForgeRequestReviewRequest + 115, // 128: mind.gateway.v1.Gateway.ForgeNormalizeWebhook:input_type -> mind.gateway.v1.ForgeNormalizeWebhookRequest + 118, // 129: mind.gateway.v1.Gateway.ListDependencies:input_type -> mind.gateway.v1.ListDependenciesRequest + 120, // 130: mind.gateway.v1.Gateway.AddDependency:input_type -> mind.gateway.v1.AddDependencyRequest + 122, // 131: mind.gateway.v1.Gateway.RemoveDependency:input_type -> mind.gateway.v1.RemoveDependencyRequest + 126, // 132: mind.gateway.v1.Gateway.GetProjectInfo:input_type -> mind.gateway.v1.GetProjectInfoRequest + 128, // 133: mind.gateway.v1.Gateway.GetSemanticIndex:input_type -> mind.gateway.v1.GetSemanticIndexRequest + 130, // 134: mind.gateway.v1.Gateway.DiscoverCodeUnits:input_type -> mind.gateway.v1.DiscoverCodeUnitsRequest + 136, // 135: mind.gateway.v1.Gateway.OpenTerminal:input_type -> mind.gateway.v1.OpenTerminalRequest + 138, // 136: mind.gateway.v1.Gateway.AttachTerminal:input_type -> mind.gateway.v1.TerminalInput + 140, // 137: mind.gateway.v1.Gateway.ResizeTerminal:input_type -> mind.gateway.v1.ResizeTerminalRequest + 142, // 138: mind.gateway.v1.Gateway.CloseTerminal:input_type -> mind.gateway.v1.CloseTerminalRequest + 144, // 139: mind.gateway.v1.Gateway.ListTerminals:input_type -> mind.gateway.v1.ListTerminalsRequest + 11, // 140: mind.gateway.v1.Gateway.ListServices:output_type -> mind.gateway.v1.ListServicesResponse + 13, // 141: mind.gateway.v1.Gateway.ReadFile:output_type -> mind.gateway.v1.ReadFileResponse + 15, // 142: mind.gateway.v1.Gateway.WriteFile:output_type -> mind.gateway.v1.WriteFileResponse + 18, // 143: mind.gateway.v1.Gateway.ListFiles:output_type -> mind.gateway.v1.ListFilesResponse + 22, // 144: mind.gateway.v1.Gateway.SubscribeWorkspaceChanges:output_type -> mind.gateway.v1.WorkspaceChangeEvent + 24, // 145: mind.gateway.v1.Gateway.DeleteFile:output_type -> mind.gateway.v1.DeleteFileResponse + 26, // 146: mind.gateway.v1.Gateway.MoveFile:output_type -> mind.gateway.v1.MoveFileResponse + 28, // 147: mind.gateway.v1.Gateway.CreateFile:output_type -> mind.gateway.v1.CreateFileResponse + 30, // 148: mind.gateway.v1.Gateway.Fix:output_type -> mind.gateway.v1.FixResponse + 32, // 149: mind.gateway.v1.Gateway.ApplyEdit:output_type -> mind.gateway.v1.ApplyEditResponse + 35, // 150: mind.gateway.v1.Gateway.BatchApplyEdits:output_type -> mind.gateway.v1.BatchApplyEditsResponse + 37, // 151: mind.gateway.v1.Gateway.ConfigureMutationAuthority:output_type -> mind.gateway.v1.ConfigureMutationAuthorityResponse + 42, // 152: mind.gateway.v1.Gateway.PrepareMutation:output_type -> mind.gateway.v1.PrepareMutationResponse + 45, // 153: mind.gateway.v1.Gateway.ApplyPreparedMutation:output_type -> mind.gateway.v1.ApplyPreparedMutationResponse + 48, // 154: mind.gateway.v1.Gateway.Search:output_type -> mind.gateway.v1.SearchResponse + 51, // 155: mind.gateway.v1.Gateway.Build:output_type -> mind.gateway.v1.BuildResponse + 53, // 156: mind.gateway.v1.Gateway.Lint:output_type -> mind.gateway.v1.LintResponse + 56, // 157: mind.gateway.v1.Gateway.Test:output_type -> mind.gateway.v1.TestResponse + 58, // 158: mind.gateway.v1.Gateway.ConfigureService:output_type -> mind.gateway.v1.ConfigureServiceResponse + 60, // 159: mind.gateway.v1.Gateway.Format:output_type -> mind.gateway.v1.FormatResponse + 63, // 160: mind.gateway.v1.Gateway.RunCommand:output_type -> mind.gateway.v1.RunCommandResponse + 135, // 161: mind.gateway.v1.Gateway.ListAllCommands:output_type -> mind.gateway.v1.ListAllCommandsResponse + 70, // 162: mind.gateway.v1.Gateway.RunChecks:output_type -> mind.gateway.v1.RunChecksResponse + 73, // 163: mind.gateway.v1.Gateway.GitStatus:output_type -> mind.gateway.v1.GitStatusResponse + 75, // 164: mind.gateway.v1.Gateway.GitDiff:output_type -> mind.gateway.v1.GitDiffResponse + 78, // 165: mind.gateway.v1.Gateway.GitLog:output_type -> mind.gateway.v1.GitLogResponse + 80, // 166: mind.gateway.v1.Gateway.GitCommit:output_type -> mind.gateway.v1.GitCommitResponse + 83, // 167: mind.gateway.v1.Gateway.GitBranch:output_type -> mind.gateway.v1.GitBranchResponse + 85, // 168: mind.gateway.v1.Gateway.GitCheckout:output_type -> mind.gateway.v1.GitCheckoutResponse + 87, // 169: mind.gateway.v1.Gateway.GitPush:output_type -> mind.gateway.v1.GitPushResponse + 89, // 170: mind.gateway.v1.Gateway.GitTag:output_type -> mind.gateway.v1.GitTagResponse + 91, // 171: mind.gateway.v1.Gateway.GitMerge:output_type -> mind.gateway.v1.GitMergeResponse + 93, // 172: mind.gateway.v1.Gateway.GitRevert:output_type -> mind.gateway.v1.GitRevertResponse + 95, // 173: mind.gateway.v1.Gateway.MaterializeRepositorySnapshot:output_type -> mind.gateway.v1.MaterializeRepositorySnapshotResponse + 97, // 174: mind.gateway.v1.Gateway.PrepareRepositoryCheckout:output_type -> mind.gateway.v1.PrepareRepositoryCheckoutResponse + 99, // 175: mind.gateway.v1.Gateway.ReleaseRepositorySnapshot:output_type -> mind.gateway.v1.ReleaseRepositorySnapshotResponse + 103, // 176: mind.gateway.v1.Gateway.Release:output_type -> mind.gateway.v1.ReleaseResponse + 109, // 177: mind.gateway.v1.Gateway.ForgePullRequestStatus:output_type -> mind.gateway.v1.ForgePullRequestStatusResponse + 111, // 178: mind.gateway.v1.Gateway.ForgeMergePullRequest:output_type -> mind.gateway.v1.ForgeMergePullRequestResponse + 113, // 179: mind.gateway.v1.Gateway.ForgeRequestReview:output_type -> mind.gateway.v1.ForgeRequestReviewResponse + 116, // 180: mind.gateway.v1.Gateway.ForgeNormalizeWebhook:output_type -> mind.gateway.v1.ForgeNormalizeWebhookResponse + 119, // 181: mind.gateway.v1.Gateway.ListDependencies:output_type -> mind.gateway.v1.ListDependenciesResponse + 121, // 182: mind.gateway.v1.Gateway.AddDependency:output_type -> mind.gateway.v1.AddDependencyResponse + 123, // 183: mind.gateway.v1.Gateway.RemoveDependency:output_type -> mind.gateway.v1.RemoveDependencyResponse + 127, // 184: mind.gateway.v1.Gateway.GetProjectInfo:output_type -> mind.gateway.v1.GetProjectInfoResponse + 129, // 185: mind.gateway.v1.Gateway.GetSemanticIndex:output_type -> mind.gateway.v1.GetSemanticIndexResponse + 132, // 186: mind.gateway.v1.Gateway.DiscoverCodeUnits:output_type -> mind.gateway.v1.DiscoverCodeUnitsResponse + 137, // 187: mind.gateway.v1.Gateway.OpenTerminal:output_type -> mind.gateway.v1.OpenTerminalResponse + 139, // 188: mind.gateway.v1.Gateway.AttachTerminal:output_type -> mind.gateway.v1.TerminalOutput + 141, // 189: mind.gateway.v1.Gateway.ResizeTerminal:output_type -> mind.gateway.v1.ResizeTerminalResponse + 143, // 190: mind.gateway.v1.Gateway.CloseTerminal:output_type -> mind.gateway.v1.CloseTerminalResponse + 146, // 191: mind.gateway.v1.Gateway.ListTerminals:output_type -> mind.gateway.v1.ListTerminalsResponse + 140, // [140:192] is the sub-list for method output_type + 88, // [88:140] is the sub-list for method input_type + 88, // [88:88] is the sub-list for extension type_name + 88, // [88:88] is the sub-list for extension extendee + 0, // [0:88] is the sub-list for field type_name } func init() { file_mind_gateway_v1_gateway_proto_init() } @@ -11267,7 +11399,7 @@ func file_mind_gateway_v1_gateway_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_mind_gateway_v1_gateway_proto_rawDesc), len(file_mind_gateway_v1_gateway_proto_rawDesc)), NumEnums: 9, - NumMessages: 137, + NumMessages: 139, NumExtensions: 0, NumServices: 1, }, diff --git a/generated/go/mind/gateway/v1/gateway_grpc.pb.go b/generated/go/mind/gateway/v1/gateway_grpc.pb.go index 00de5484..3b6f80e4 100644 --- a/generated/go/mind/gateway/v1/gateway_grpc.pb.go +++ b/generated/go/mind/gateway/v1/gateway_grpc.pb.go @@ -65,6 +65,7 @@ const ( Gateway_AddDependency_FullMethodName = "/mind.gateway.v1.Gateway/AddDependency" Gateway_RemoveDependency_FullMethodName = "/mind.gateway.v1.Gateway/RemoveDependency" Gateway_GetProjectInfo_FullMethodName = "/mind.gateway.v1.Gateway/GetProjectInfo" + Gateway_GetSemanticIndex_FullMethodName = "/mind.gateway.v1.Gateway/GetSemanticIndex" Gateway_DiscoverCodeUnits_FullMethodName = "/mind.gateway.v1.Gateway/DiscoverCodeUnits" Gateway_OpenTerminal_FullMethodName = "/mind.gateway.v1.Gateway/OpenTerminal" Gateway_AttachTerminal_FullMethodName = "/mind.gateway.v1.Gateway/AttachTerminal" @@ -182,6 +183,9 @@ type GatewayClient interface { RemoveDependency(ctx context.Context, in *RemoveDependencyRequest, opts ...grpc.CallOption) (*RemoveDependencyResponse, error) // GetProjectInfo returns rich project metadata: module, packages, deps, file hashes. GetProjectInfo(ctx context.Context, in *GetProjectInfoRequest, opts ...grpc.CallOption) (*GetProjectInfoResponse, error) + // GetSemanticIndex returns body-free semantic facts produced inside the + // production agent rooted at one exact code unit. + GetSemanticIndex(ctx context.Context, in *GetSemanticIndexRequest, opts ...grpc.CallOption) (*GetSemanticIndexResponse, error) // DiscoverCodeUnits returns Codefly-owned structural source boundaries, // including unsupported ecosystems that bind to the generic agent. DiscoverCodeUnits(ctx context.Context, in *DiscoverCodeUnitsRequest, opts ...grpc.CallOption) (*DiscoverCodeUnitsResponse, error) @@ -665,6 +669,16 @@ func (c *gatewayClient) GetProjectInfo(ctx context.Context, in *GetProjectInfoRe return out, nil } +func (c *gatewayClient) GetSemanticIndex(ctx context.Context, in *GetSemanticIndexRequest, opts ...grpc.CallOption) (*GetSemanticIndexResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetSemanticIndexResponse) + err := c.cc.Invoke(ctx, Gateway_GetSemanticIndex_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *gatewayClient) DiscoverCodeUnits(ctx context.Context, in *DiscoverCodeUnitsRequest, opts ...grpc.CallOption) (*DiscoverCodeUnitsResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(DiscoverCodeUnitsResponse) @@ -837,6 +851,9 @@ type GatewayServer interface { RemoveDependency(context.Context, *RemoveDependencyRequest) (*RemoveDependencyResponse, error) // GetProjectInfo returns rich project metadata: module, packages, deps, file hashes. GetProjectInfo(context.Context, *GetProjectInfoRequest) (*GetProjectInfoResponse, error) + // GetSemanticIndex returns body-free semantic facts produced inside the + // production agent rooted at one exact code unit. + GetSemanticIndex(context.Context, *GetSemanticIndexRequest) (*GetSemanticIndexResponse, error) // DiscoverCodeUnits returns Codefly-owned structural source boundaries, // including unsupported ecosystems that bind to the generic agent. DiscoverCodeUnits(context.Context, *DiscoverCodeUnitsRequest) (*DiscoverCodeUnitsResponse, error) @@ -996,6 +1013,9 @@ func (UnimplementedGatewayServer) RemoveDependency(context.Context, *RemoveDepen func (UnimplementedGatewayServer) GetProjectInfo(context.Context, *GetProjectInfoRequest) (*GetProjectInfoResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetProjectInfo not implemented") } +func (UnimplementedGatewayServer) GetSemanticIndex(context.Context, *GetSemanticIndexRequest) (*GetSemanticIndexResponse, error) { + return nil, status.Error(codes.Unimplemented, "method GetSemanticIndex not implemented") +} func (UnimplementedGatewayServer) DiscoverCodeUnits(context.Context, *DiscoverCodeUnitsRequest) (*DiscoverCodeUnitsResponse, error) { return nil, status.Error(codes.Unimplemented, "method DiscoverCodeUnits not implemented") } @@ -1838,6 +1858,24 @@ func _Gateway_GetProjectInfo_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } +func _Gateway_GetSemanticIndex_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetSemanticIndexRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GatewayServer).GetSemanticIndex(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Gateway_GetSemanticIndex_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GatewayServer).GetSemanticIndex(ctx, req.(*GetSemanticIndexRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Gateway_DiscoverCodeUnits_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(DiscoverCodeUnitsRequest) if err := dec(in); err != nil { @@ -2118,6 +2156,10 @@ var Gateway_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetProjectInfo", Handler: _Gateway_GetProjectInfo_Handler, }, + { + MethodName: "GetSemanticIndex", + Handler: _Gateway_GetSemanticIndex_Handler, + }, { MethodName: "DiscoverCodeUnits", Handler: _Gateway_DiscoverCodeUnits_Handler, diff --git a/generated/go/mind/gateway/v1/gatewayv1connect/gateway.connect.go b/generated/go/mind/gateway/v1/gatewayv1connect/gateway.connect.go index 7c77bb5b..02905e3d 100644 --- a/generated/go/mind/gateway/v1/gatewayv1connect/gateway.connect.go +++ b/generated/go/mind/gateway/v1/gatewayv1connect/gateway.connect.go @@ -137,6 +137,9 @@ const ( GatewayRemoveDependencyProcedure = "/mind.gateway.v1.Gateway/RemoveDependency" // GatewayGetProjectInfoProcedure is the fully-qualified name of the Gateway's GetProjectInfo RPC. GatewayGetProjectInfoProcedure = "/mind.gateway.v1.Gateway/GetProjectInfo" + // GatewayGetSemanticIndexProcedure is the fully-qualified name of the Gateway's GetSemanticIndex + // RPC. + GatewayGetSemanticIndexProcedure = "/mind.gateway.v1.Gateway/GetSemanticIndex" // GatewayDiscoverCodeUnitsProcedure is the fully-qualified name of the Gateway's DiscoverCodeUnits // RPC. GatewayDiscoverCodeUnitsProcedure = "/mind.gateway.v1.Gateway/DiscoverCodeUnits" @@ -256,6 +259,9 @@ type GatewayClient interface { RemoveDependency(context.Context, *connect.Request[v1.RemoveDependencyRequest]) (*connect.Response[v1.RemoveDependencyResponse], error) // GetProjectInfo returns rich project metadata: module, packages, deps, file hashes. GetProjectInfo(context.Context, *connect.Request[v1.GetProjectInfoRequest]) (*connect.Response[v1.GetProjectInfoResponse], error) + // GetSemanticIndex returns body-free semantic facts produced inside the + // production agent rooted at one exact code unit. + GetSemanticIndex(context.Context, *connect.Request[v1.GetSemanticIndexRequest]) (*connect.Response[v1.GetSemanticIndexResponse], error) // DiscoverCodeUnits returns Codefly-owned structural source boundaries, // including unsupported ecosystems that bind to the generic agent. DiscoverCodeUnits(context.Context, *connect.Request[v1.DiscoverCodeUnitsRequest]) (*connect.Response[v1.DiscoverCodeUnitsResponse], error) @@ -553,6 +559,12 @@ func NewGatewayClient(httpClient connect.HTTPClient, baseURL string, opts ...con connect.WithSchema(gatewayMethods.ByName("GetProjectInfo")), connect.WithClientOptions(opts...), ), + getSemanticIndex: connect.NewClient[v1.GetSemanticIndexRequest, v1.GetSemanticIndexResponse]( + httpClient, + baseURL+GatewayGetSemanticIndexProcedure, + connect.WithSchema(gatewayMethods.ByName("GetSemanticIndex")), + connect.WithClientOptions(opts...), + ), discoverCodeUnits: connect.NewClient[v1.DiscoverCodeUnitsRequest, v1.DiscoverCodeUnitsResponse]( httpClient, baseURL+GatewayDiscoverCodeUnitsProcedure, @@ -639,6 +651,7 @@ type gatewayClient struct { addDependency *connect.Client[v1.AddDependencyRequest, v1.AddDependencyResponse] removeDependency *connect.Client[v1.RemoveDependencyRequest, v1.RemoveDependencyResponse] getProjectInfo *connect.Client[v1.GetProjectInfoRequest, v1.GetProjectInfoResponse] + getSemanticIndex *connect.Client[v1.GetSemanticIndexRequest, v1.GetSemanticIndexResponse] discoverCodeUnits *connect.Client[v1.DiscoverCodeUnitsRequest, v1.DiscoverCodeUnitsResponse] openTerminal *connect.Client[v1.OpenTerminalRequest, v1.OpenTerminalResponse] attachTerminal *connect.Client[v1.TerminalInput, v1.TerminalOutput] @@ -872,6 +885,11 @@ func (c *gatewayClient) GetProjectInfo(ctx context.Context, req *connect.Request return c.getProjectInfo.CallUnary(ctx, req) } +// GetSemanticIndex calls mind.gateway.v1.Gateway.GetSemanticIndex. +func (c *gatewayClient) GetSemanticIndex(ctx context.Context, req *connect.Request[v1.GetSemanticIndexRequest]) (*connect.Response[v1.GetSemanticIndexResponse], error) { + return c.getSemanticIndex.CallUnary(ctx, req) +} + // DiscoverCodeUnits calls mind.gateway.v1.Gateway.DiscoverCodeUnits. func (c *gatewayClient) DiscoverCodeUnits(ctx context.Context, req *connect.Request[v1.DiscoverCodeUnitsRequest]) (*connect.Response[v1.DiscoverCodeUnitsResponse], error) { return c.discoverCodeUnits.CallUnary(ctx, req) @@ -1006,6 +1024,9 @@ type GatewayHandler interface { RemoveDependency(context.Context, *connect.Request[v1.RemoveDependencyRequest]) (*connect.Response[v1.RemoveDependencyResponse], error) // GetProjectInfo returns rich project metadata: module, packages, deps, file hashes. GetProjectInfo(context.Context, *connect.Request[v1.GetProjectInfoRequest]) (*connect.Response[v1.GetProjectInfoResponse], error) + // GetSemanticIndex returns body-free semantic facts produced inside the + // production agent rooted at one exact code unit. + GetSemanticIndex(context.Context, *connect.Request[v1.GetSemanticIndexRequest]) (*connect.Response[v1.GetSemanticIndexResponse], error) // DiscoverCodeUnits returns Codefly-owned structural source boundaries, // including unsupported ecosystems that bind to the generic agent. DiscoverCodeUnits(context.Context, *connect.Request[v1.DiscoverCodeUnitsRequest]) (*connect.Response[v1.DiscoverCodeUnitsResponse], error) @@ -1299,6 +1320,12 @@ func NewGatewayHandler(svc GatewayHandler, opts ...connect.HandlerOption) (strin connect.WithSchema(gatewayMethods.ByName("GetProjectInfo")), connect.WithHandlerOptions(opts...), ) + gatewayGetSemanticIndexHandler := connect.NewUnaryHandler( + GatewayGetSemanticIndexProcedure, + svc.GetSemanticIndex, + connect.WithSchema(gatewayMethods.ByName("GetSemanticIndex")), + connect.WithHandlerOptions(opts...), + ) gatewayDiscoverCodeUnitsHandler := connect.NewUnaryHandler( GatewayDiscoverCodeUnitsProcedure, svc.DiscoverCodeUnits, @@ -1427,6 +1454,8 @@ func NewGatewayHandler(svc GatewayHandler, opts ...connect.HandlerOption) (strin gatewayRemoveDependencyHandler.ServeHTTP(w, r) case GatewayGetProjectInfoProcedure: gatewayGetProjectInfoHandler.ServeHTTP(w, r) + case GatewayGetSemanticIndexProcedure: + gatewayGetSemanticIndexHandler.ServeHTTP(w, r) case GatewayDiscoverCodeUnitsProcedure: gatewayDiscoverCodeUnitsHandler.ServeHTTP(w, r) case GatewayOpenTerminalProcedure: @@ -1628,6 +1657,10 @@ func (UnimplementedGatewayHandler) GetProjectInfo(context.Context, *connect.Requ return nil, connect.NewError(connect.CodeUnimplemented, errors.New("mind.gateway.v1.Gateway.GetProjectInfo is not implemented")) } +func (UnimplementedGatewayHandler) GetSemanticIndex(context.Context, *connect.Request[v1.GetSemanticIndexRequest]) (*connect.Response[v1.GetSemanticIndexResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("mind.gateway.v1.Gateway.GetSemanticIndex is not implemented")) +} + func (UnimplementedGatewayHandler) DiscoverCodeUnits(context.Context, *connect.Request[v1.DiscoverCodeUnitsRequest]) (*connect.Response[v1.DiscoverCodeUnitsResponse], error) { return nil, connect.NewError(connect.CodeUnimplemented, errors.New("mind.gateway.v1.Gateway.DiscoverCodeUnits is not implemented")) } diff --git a/proto/codefly/base/v0/semantic.proto b/proto/codefly/base/v0/semantic.proto new file mode 100644 index 00000000..f0ffd87d --- /dev/null +++ b/proto/codefly/base/v0/semantic.proto @@ -0,0 +1,92 @@ +syntax = "proto3"; + +package codefly.base.v0; + +// SemanticIndexState states how completely an agent inspected its attached +// source root. Consumers must never infer completeness from a non-empty list. +enum SemanticIndexState { + SEMANTIC_INDEX_STATE_UNSPECIFIED = 0; + SEMANTIC_INDEX_STATE_COMPLETE = 1; + SEMANTIC_INDEX_STATE_DEGRADED = 2; + SEMANTIC_INDEX_STATE_NOT_ATTEMPTED = 3; +} + +// SemanticSymbolKind is a language-neutral declaration category. +enum SemanticSymbolKind { + SEMANTIC_SYMBOL_KIND_UNSPECIFIED = 0; + SEMANTIC_SYMBOL_KIND_FUNCTION = 1; + SEMANTIC_SYMBOL_KIND_METHOD = 2; + SEMANTIC_SYMBOL_KIND_CLASS = 3; + SEMANTIC_SYMBOL_KIND_STRUCT = 4; + SEMANTIC_SYMBOL_KIND_INTERFACE = 5; + SEMANTIC_SYMBOL_KIND_ENUM = 6; + SEMANTIC_SYMBOL_KIND_FIELD = 7; + SEMANTIC_SYMBOL_KIND_VARIABLE = 8; + SEMANTIC_SYMBOL_KIND_CONSTANT = 9; + SEMANTIC_SYMBOL_KIND_TYPE_ALIAS = 10; + SEMANTIC_SYMBOL_KIND_MODULE = 11; +} + +// SemanticLocation identifies a declaration or use without exposing source +// bytes. Lines and columns are one-based and inclusive. +message SemanticLocation { + string path = 1; + int32 start_line = 2; + int32 start_column = 3; + int32 end_line = 4; + int32 end_column = 5; +} + +// SemanticUse is unresolved analyzer evidence attached to one declaration. +// Resolution across files and code units remains a brain concern. +message SemanticUse { + string name = 1; + SemanticLocation location = 2; +} + +// SemanticFile is the typed projection of one source file. It intentionally +// contains no source body. +message SemanticFile { + string path = 1; + string content_sha256 = 2; + int64 byte_size = 3; + repeated string imports = 4; + string language = 5; +} + +// SemanticSymbol is a declaration projected by the owning Codefly analyzer. +// Signature is bounded declaration evidence; implementation bodies never +// cross the agent boundary and are represented only by body_sha256. +message SemanticSymbol { + string name = 1; + string qualified_name = 2; + SemanticSymbolKind kind = 3; + SemanticLocation location = 4; + string package = 5; + string parent_qualified_name = 6; + string signature = 7; + string signature_sha256 = 8; + string body_sha256 = 9; + repeated SemanticUse calls = 10; + repeated SemanticUse references = 11; +} + +// SemanticIssue preserves per-file analyzer failures without converting a +// partially useful index into an untyped transport error. +message SemanticIssue { + string code = 1; + string message = 2; + string path = 3; +} + +// SemanticIndex is one deterministic, body-free projection of an attached +// source root. Analyzer provenance is part of the contract and cache key. +message SemanticIndex { + SemanticIndexState state = 1; + string analyzer = 2; + string analyzer_version = 3; + repeated string languages = 4; + repeated SemanticFile files = 5; + repeated SemanticSymbol symbols = 6; + repeated SemanticIssue issues = 7; +} diff --git a/proto/codefly/services/code/v0/code.proto b/proto/codefly/services/code/v0/code.proto index 66c227c3..c9359b73 100644 --- a/proto/codefly/services/code/v0/code.proto +++ b/proto/codefly/services/code/v0/code.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package codefly.services.code.v0; import "codefly/base/v0/failure.proto"; +import "codefly/base/v0/semantic.proto"; import "codefly/base/v0/source.proto"; /* @@ -364,6 +365,11 @@ message GetProjectInfoResponse { repeated SourceFileInfo source_files = 8; } +// GetSemanticIndexRequest asks the attached Codefly agent to project its +// source root into language-neutral semantic facts. Project bytes never leave +// the agent boundary. +message GetSemanticIndexRequest {} + // --- DiscoverCodeUnits --- // DiscoverCodeUnitsRequest asks the language-neutral Code boundary to identify @@ -605,6 +611,9 @@ message CodeRequest { // discover_code_units asks the language-neutral Code boundary for rooted // source units and their manifest evidence. DiscoverCodeUnitsRequest discover_code_units = 20; + // get_semantic_index performs one read-only semantic projection inside the + // owning Codefly agent. + GetSemanticIndexRequest get_semantic_index = 21; // File and git operations — handled by the Code agent's default server // (pkg/code/DefaultCodeServer in codefly core) backed by the workspace's @@ -658,6 +667,8 @@ message CodeResponse { GetProjectInfoResponse get_project_info = 19; // discover_code_units returns structural source boundaries. DiscoverCodeUnitsResponse discover_code_units = 20; + // get_semantic_index returns body-free semantic facts and typed coverage. + codefly.base.v0.SemanticIndex get_semantic_index = 21; // File and git operation responses. ReadFileResponse read_file = 26; diff --git a/proto/codefly/services/tooling/v0/tooling.proto b/proto/codefly/services/tooling/v0/tooling.proto index d2c15ddf..a97cada2 100644 --- a/proto/codefly/services/tooling/v0/tooling.proto +++ b/proto/codefly/services/tooling/v0/tooling.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package codefly.services.tooling.v0; import "codefly/base/v0/failure.proto"; +import "codefly/base/v0/semantic.proto"; import "codefly/base/v0/source.proto"; /* @@ -9,18 +10,18 @@ Tooling service: command-oriented language tooling backed by a codefly agent. Separation of concerns: - Gateway/core owns file, git, shell, and web access through the VFS/tool boundary. - - Mind owns semantic code intelligence such as symbols, references, hover, and call graphs. - - Agent owns formatting, dependency management, project metadata, build, test, and lint. + - Agent owns semantic inspection, formatting, dependency management, project metadata, + build, test, and lint. Project bytes never cross into an orchestration brain. + - Mind consumes typed facts and decides how to reconcile, query, or act on them. The agent should use the workspace surface provided by Codefly rather than inventing its own filesystem contract. Each language agent (go-grpc, python-fastapi, nextjs) implements this service. -File/git operations are NOT in this service — they are in Mind's native tool system. -This is intentional: the Tooling agent does not need filesystem access for most operations. -For operations that need the workspace (build, test), the agent reads via VFS or the -workspace is committed to disk first. +File/git operations are NOT in this service; they are exposed by the Code service and +Gateway. Tooling implementations inspect the workspace internally through the Codefly +VFS or delegate to Code. Mind never reads project files directly. */ // ── Types ────────────────────────────────────────────── @@ -248,6 +249,17 @@ message GetProjectInfoResponse { repeated SourceFileInfo source_files = 9; } +// GetSemanticIndexRequest asks the language tooling attached to this service +// for one complete, body-free semantic projection. +message GetSemanticIndexRequest {} + +// GetSemanticIndexResponse returns typed facts even when some files degrade; +// failure is reserved for capability or infrastructure failure. +message GetSemanticIndexResponse { + codefly.base.v0.SemanticIndex index = 1; + codefly.base.v0.Failure failure = 2; +} + // ── Dev Validation (require toolchain) ────────────────── // BuildRequest asks the agent to run the native build command. @@ -319,7 +331,8 @@ message LintResponse { // Every language agent (go-grpc, python-fastapi, etc.) implements this service. // // NOTE: File operations (read, write, list, search) and git operations are -// NOT part of this service. Mind handles those directly via its VFS. +// part of Code/Gateway, not this service. Mind reaches those typed capabilities +// through the Gateway and never owns a project VFS. service Tooling { // Code modification rpc Fix(FixRequest) returns (FixResponse); @@ -335,6 +348,8 @@ service Tooling { // Analysis rpc GetProjectInfo(GetProjectInfoRequest) returns (GetProjectInfoResponse); + // GetSemanticIndex keeps project parsing and project bytes inside Codefly. + rpc GetSemanticIndex(GetSemanticIndexRequest) returns (GetSemanticIndexResponse); // Dev validation rpc Build(BuildRequest) returns (BuildResponse); diff --git a/proto/mind/gateway/v1/gateway.proto b/proto/mind/gateway/v1/gateway.proto index 666ac4df..f40abdda 100644 --- a/proto/mind/gateway/v1/gateway.proto +++ b/proto/mind/gateway/v1/gateway.proto @@ -3,6 +3,7 @@ package mind.gateway.v1; import "codefly/base/v0/source.proto"; import "codefly/base/v0/failure.proto"; +import "codefly/base/v0/semantic.proto"; import "codefly/services/builder/v0/builder.proto"; import "codefly/services/runtime/v0/runtime.proto"; import "google/protobuf/timestamp.proto"; @@ -190,6 +191,10 @@ service Gateway { // GetProjectInfo returns rich project metadata: module, packages, deps, file hashes. rpc GetProjectInfo(GetProjectInfoRequest) returns (GetProjectInfoResponse); + // GetSemanticIndex returns body-free semantic facts produced inside the + // production agent rooted at one exact code unit. + rpc GetSemanticIndex(GetSemanticIndexRequest) returns (GetSemanticIndexResponse); + // DiscoverCodeUnits returns Codefly-owned structural source boundaries, // including unsupported ecosystems that bind to the generic agent. rpc DiscoverCodeUnits(DiscoverCodeUnitsRequest) returns (DiscoverCodeUnitsResponse); @@ -1706,6 +1711,20 @@ message GetProjectInfoResponse { CodeUnitTarget code_unit = 10; } +// GetSemanticIndexRequest identifies one production-agent source boundary. +message GetSemanticIndexRequest { + string service = 1; + CodeUnitTarget code_unit = 2; +} + +// GetSemanticIndexResponse preserves typed analyzer coverage and the exact +// inspected boundary. Paths in index are repository-relative. +message GetSemanticIndexResponse { + codefly.base.v0.SemanticIndex index = 1; + codefly.base.v0.Failure failure = 2; + CodeUnitTarget code_unit = 3; +} + // DiscoverCodeUnitsRequest identifies the service whose rooted source tree is // inspected. Empty service selects the gateway's attached source behavior. message DiscoverCodeUnitsRequest { diff --git a/toolbox/lang/bridge.go b/toolbox/lang/bridge.go index e69c6854..1ed57215 100644 --- a/toolbox/lang/bridge.go +++ b/toolbox/lang/bridge.go @@ -41,21 +41,21 @@ func NewToolboxFromTooling(name, version string, t toolingv0.ToolingServer) *Too // language plugins that format and edit source but do not own dependency or // validation behavior yet. func NewSourceToolboxFromTooling(name, version string, t toolingv0.ToolingServer) *ToolboxFromTooling { - return newToolboxFromTooling(name, version, t, selectToolSpecs(ToolFix, ToolApplyEdit, ToolGetProjectInfo)) + return newToolboxFromTooling(name, version, t, selectToolSpecs(ToolFix, ToolApplyEdit, ToolGetProjectInfo, ToolGetSemanticIndex)) } // NewValidationToolboxFromTooling exposes source authoring plus build, test, // and lint for language plugins that do not implement dependency mutation. func NewValidationToolboxFromTooling(name, version string, t toolingv0.ToolingServer) *ToolboxFromTooling { return newToolboxFromTooling(name, version, t, selectToolSpecs( - ToolFix, ToolApplyEdit, ToolGetProjectInfo, ToolBuild, ToolTest, ToolLint, + ToolFix, ToolApplyEdit, ToolGetProjectInfo, ToolGetSemanticIndex, ToolBuild, ToolTest, ToolLint, )) } // NewEditToolboxFromTooling is the language-neutral subset for a plugin that // supports structured editing and metadata but has no language-aware fixer. func NewEditToolboxFromTooling(name, version string, t toolingv0.ToolingServer) *ToolboxFromTooling { - return newToolboxFromTooling(name, version, t, selectToolSpecs(ToolApplyEdit, ToolGetProjectInfo)) + return newToolboxFromTooling(name, version, t, selectToolSpecs(ToolApplyEdit, ToolGetProjectInfo, ToolGetSemanticIndex)) } func newToolboxFromTooling(name, version string, t toolingv0.ToolingServer, specs []toolSpec) *ToolboxFromTooling { @@ -131,6 +131,11 @@ var toolSpecs = []toolSpec{ description: "Get project metadata (module, language, packages, dependencies, file hashes).", tags: []string{"metadata"}, }, + { + name: ToolGetSemanticIndex, + description: "Project source into body-free semantic files, symbols, calls, references, hashes, and typed coverage.", + tags: []string{"metadata", "semantic", "analysis"}, + }, { name: ToolBuild, description: "Build the project.", @@ -234,6 +239,8 @@ func (b *ToolboxFromTooling) CallTool(ctx context.Context, req *toolboxv0.CallTo return bridgeCall[toolingv0.RemoveDependencyRequest, toolingv0.RemoveDependencyResponse](ctx, req, b.inner.RemoveDependency) case ToolGetProjectInfo: return bridgeCall[toolingv0.GetProjectInfoRequest, toolingv0.GetProjectInfoResponse](ctx, req, b.inner.GetProjectInfo) + case ToolGetSemanticIndex: + return bridgeCall[toolingv0.GetSemanticIndexRequest, toolingv0.GetSemanticIndexResponse](ctx, req, b.inner.GetSemanticIndex) case ToolBuild: return bridgeCall[toolingv0.BuildRequest, toolingv0.BuildResponse](ctx, req, b.inner.Build) case ToolTest: @@ -405,6 +412,9 @@ func (t *toolingFromToolbox) RemoveDependency(ctx context.Context, in *toolingv0 func (t *toolingFromToolbox) GetProjectInfo(ctx context.Context, in *toolingv0.GetProjectInfoRequest, _ ...grpc.CallOption) (*toolingv0.GetProjectInfoResponse, error) { return callBridge(ctx, t.c, ToolGetProjectInfo, in, &toolingv0.GetProjectInfoResponse{}) } +func (t *toolingFromToolbox) GetSemanticIndex(ctx context.Context, in *toolingv0.GetSemanticIndexRequest, _ ...grpc.CallOption) (*toolingv0.GetSemanticIndexResponse, error) { + return callBridge(ctx, t.c, ToolGetSemanticIndex, in, &toolingv0.GetSemanticIndexResponse{}) +} func (t *toolingFromToolbox) Build(ctx context.Context, in *toolingv0.BuildRequest, _ ...grpc.CallOption) (*toolingv0.BuildResponse, error) { return callBridge(ctx, t.c, ToolBuild, in, &toolingv0.BuildResponse{}) } diff --git a/toolbox/lang/bridge_test.go b/toolbox/lang/bridge_test.go index bb2c1e19..eaf923e5 100644 --- a/toolbox/lang/bridge_test.go +++ b/toolbox/lang/bridge_test.go @@ -102,8 +102,8 @@ func TestSourceBridgeAdvertisesOnlyImplementedSourceTools(t *testing.T) { bridge := lang.NewSourceToolboxFromTooling("source", "1.0.0", fakeTooling{}) listed, err := bridge.ListTools(context.Background(), &toolboxv0.ListToolsRequest{}) require.NoError(t, err) - require.Equal(t, []string{lang.ToolFix, lang.ToolApplyEdit, lang.ToolGetProjectInfo}, []string{ - listed.Tools[0].GetName(), listed.Tools[1].GetName(), listed.Tools[2].GetName(), + require.Equal(t, []string{lang.ToolFix, lang.ToolApplyEdit, lang.ToolGetProjectInfo, lang.ToolGetSemanticIndex}, []string{ + listed.Tools[0].GetName(), listed.Tools[1].GetName(), listed.Tools[2].GetName(), listed.Tools[3].GetName(), }) require.True(t, listed.Tools[0].GetDestructive()) properties := listed.Tools[0].GetInputSchema().GetFields()["properties"].GetStructValue().GetFields() diff --git a/toolbox/lang/names.go b/toolbox/lang/names.go index 22343196..ab0999d0 100644 --- a/toolbox/lang/names.go +++ b/toolbox/lang/names.go @@ -21,7 +21,8 @@ const ( ToolRemoveDependency = "lang.remove_dependency" // Project metadata - ToolGetProjectInfo = "lang.get_project_info" + ToolGetProjectInfo = "lang.get_project_info" + ToolGetSemanticIndex = "lang.get_semantic_index" // Dev validation (delegates to Runtime) ToolBuild = "lang.build"