Repository navigation
Expand file tree
/
Copy pathGraphTypes.cs
More file actions
148 lines (137 loc) · 3 KB
/
Copy pathGraphTypes.cs
File metadata and controls
148 lines (137 loc) · 3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
namespace CodeMesh.Domain.Graph;
public enum CodeNodeKind
{
Repository,
Document,
Section,
Solution,
Project,
Dockerfile,
DockerfileStage,
ComposeFile,
ComposeService,
Assembly,
Namespace,
File,
TestFile,
Declaration,
Class,
Interface,
Struct,
Enum,
Delegate,
Method,
Constructor,
Property,
Field,
Event,
TestCase,
Parameter,
Lambda,
Unknown
}
public enum CodeRelationshipKind
{
Contains,
Defines,
Invokes,
References,
UsesType,
Inherits,
Implements,
Returns,
HasParameter,
Reads,
Writes,
Overrides,
Unknown
}
public sealed record RepositoryRef(
string Id,
string RootPath,
string? RemoteUrl = null,
string? Branch = null,
string? Commit = null,
string? ProjectId = null,
string? CheckoutId = null,
string? SnapshotId = null);
public sealed record SourceSpan(
string FilePath,
int StartLine,
int StartColumn,
int EndLine,
int EndColumn)
{
public static SourceSpan Unknown(string filePath = "") => new(filePath, 0, 0, 0, 0);
}
public sealed record CodeNode(
string Id,
string StableKey,
CodeNodeKind Kind,
string Name,
string Language,
string Project,
SourceSpan Span,
string ContentHash,
IReadOnlyDictionary<string, string> Metadata);
public sealed record CodeRelationship(
string Id,
string SourceNodeId,
string TargetNodeId,
CodeRelationshipKind Kind,
string? Label,
IReadOnlyDictionary<string, string> Metadata);
public sealed record CodeContent(
string Hash,
string Text,
string MediaType,
DateTimeOffset CreatedAt,
DateTimeOffset UpdatedAt);
public sealed record EmbeddingRecord(
string Id,
string NodeId,
string ContentHash,
string Provider,
string Model,
int Dimensions,
IReadOnlyList<float> Vector,
IReadOnlyDictionary<string, string> Metadata);
public sealed record CodeNodeSummary(
string Id,
string RepositoryId,
string RepositoryRoot,
string IngestionRunId,
string NodeId,
string StableKey,
CodeNodeKind Kind,
string Name,
string Language,
string Project,
SourceSpan Span,
string ContentHash,
string SummaryKind,
string Summary,
IReadOnlyList<string> Tags,
string Confidence,
string Provider,
string Model,
string PromptVersion,
string GenerationConfigurationFingerprint,
string PromptHash,
DateTimeOffset GeneratedAt,
string Status,
string? Error,
IReadOnlyDictionary<string, string> Metadata);
public sealed record CodeGraphBatch(
string BatchId,
RepositoryRef Repository,
IReadOnlyList<CodeNode> Nodes,
IReadOnlyList<CodeRelationship> Relationships,
IReadOnlyList<CodeContent> Contents,
DateTimeOffset CreatedAt);
public sealed record VectorSearchMatch(
string NodeId,
string ContentHash,
double Score,
string? Preview,
IReadOnlyDictionary<string, string> Metadata);