Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/forge_domain/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,9 @@ pub struct WorkspaceInfo {
/// Working directory path
pub working_dir: String,
/// Number of nodes created
pub node_count: u64,
pub node_count: Option<u64>,
/// Number of relations between nodes
pub relation_count: u64,
pub relation_count: Option<u64>,
/// Last updated timestamp
pub last_updated: Option<chrono::DateTime<chrono::Utc>>,
/// Workspace created time.
Expand Down
2 changes: 0 additions & 2 deletions crates/forge_main/src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3027,8 +3027,6 @@ impl<A: API + 'static, F: Fn() -> A + Send + Sync> UI<A, F> {

info.add_key_value("ID", workspace.workspace_id.to_string())
.add_key_value("Path", workspace.working_dir.to_string())
.add_key_value("Files", workspace.node_count.to_string())
.add_key_value("Relations", workspace.relation_count.to_string())
.add_key_value("Created At", humanize_time(workspace.created_at))
.add_key_value("Updated At", updated_time)
}
Expand Down
178 changes: 89 additions & 89 deletions crates/forge_repo/proto/forge.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,67 +8,67 @@ package forge.v1;
service ForgeService {
// Searches for nodes matching a query
rpc Search(SearchRequest) returns (SearchResponse);

// Uploads files to the context engine
rpc UploadFiles(UploadFilesRequest) returns (UploadFilesResponse);

// Deletes files from the context engine
rpc DeleteFiles(DeleteFilesRequest) returns (DeleteFilesResponse);

// Lists all files in a workspace
rpc ListFiles(ListFilesRequest) returns (ListFilesResponse);

// Splits files into chunks without uploading them
rpc ChunkFiles(ChunkFilesRequest) returns (ChunkFilesResponse);

// Health check endpoint
rpc HealthCheck(HealthCheckRequest) returns (HealthCheckResponse);

// Creates a new workspace
rpc CreateWorkspace(CreateWorkspaceRequest) returns (CreateWorkspaceResponse);

// Lists all workspaces for a user
rpc ListWorkspaces(ListWorkspacesRequest) returns (ListWorkspacesResponse);

// Retrieves workspace info for a specific workspace
rpc GetWorkspaceInfo(GetWorkspaceInfoRequest) returns (GetWorkspaceInfoResponse);

// Deletes a workspace
rpc DeleteWorkspace(DeleteWorkspaceRequest) returns (DeleteWorkspaceResponse);

// Creates a new API key for a user
rpc CreateApiKey(CreateApiKeyRequest) returns (CreateApiKeyResponse);

// Validates syntax for a batch of files
rpc ValidateFiles(ValidateFilesRequest) returns (ValidateFilesResponse);

// Selects relevant skills based on user prompt
rpc SelectSkill(SelectSkillRequest) returns (SelectSkillResponse);
}

// Node types
enum NodeKind {
NODE_KIND_UNSPECIFIED = 0;
NODE_KIND_FILE = 1;
NODE_KIND_FILE_CHUNK = 2;
NODE_KIND_FILE_REF = 3;
NODE_KIND_NOTE = 4;
NODE_KIND_TASK = 5;
NODE_KIND_FILE = 1;
NODE_KIND_FILE_CHUNK = 2;
NODE_KIND_FILE_REF = 3;
NODE_KIND_NOTE = 4;
NODE_KIND_TASK = 5;
}

// Relation types
enum RelationType {
RELATION_TYPE_UNSPECIFIED = 0;
RELATION_TYPE_CALLS = 1;
RELATION_TYPE_EXTENDS = 2;
RELATION_TYPE_IMPLEMENTS = 3;
RELATION_TYPE_USES = 4;
RELATION_TYPE_DEFINES = 5;
RELATION_TYPE_REFERENCES = 6;
RELATION_TYPE_CONTAINS = 7;
RELATION_TYPE_DEPENDS_ON = 8;
RELATION_TYPE_RELATED_TO = 9;
RELATION_TYPE_INVERSE = 10;
RELATION_TYPE_CALLS = 1;
RELATION_TYPE_EXTENDS = 2;
RELATION_TYPE_IMPLEMENTS = 3;
RELATION_TYPE_USES = 4;
RELATION_TYPE_DEFINES = 5;
RELATION_TYPE_REFERENCES = 6;
RELATION_TYPE_CONTAINS = 7;
RELATION_TYPE_DEPENDS_ON = 8;
RELATION_TYPE_RELATED_TO = 9;
RELATION_TYPE_INVERSE = 10;
}

// Messages
Expand All @@ -89,18 +89,18 @@ message UserId {
}

message Workspace {
WorkspaceId workspace_id = 1;
string working_dir = 2;
uint64 node_count = 3;
uint64 relation_count = 4;
optional google.protobuf.Timestamp last_updated = 5;
uint32 min_chunk_size = 6;
uint32 max_chunk_size = 7;
google.protobuf.Timestamp created_at = 8;
WorkspaceId workspace_id = 1;
string working_dir = 2;
optional uint64 node_count = 3;
optional uint64 relation_count = 4;
optional google.protobuf.Timestamp last_updated = 5;
uint32 min_chunk_size = 6;
uint32 max_chunk_size = 7;
google.protobuf.Timestamp created_at = 8;
}

message WorkspaceDefinition {
string working_dir = 1;
string working_dir = 1;
uint32 min_chunk_size = 2;
uint32 max_chunk_size = 3;
}
Expand All @@ -111,19 +111,19 @@ message GitInfo {
}

message File {
string path = 1;
string path = 1;
string content = 2;
}

message FileChunk {
string path = 1;
string content = 2;
string path = 1;
string content = 2;
uint32 start_line = 3;
uint32 end_line = 4;
uint32 end_line = 4;
}

message FileRef {
string path = 1;
string path = 1;
string file_hash = 2;
}

Expand All @@ -137,84 +137,84 @@ message Task {

message NodeData {
oneof kind {
File file = 1;
File file = 1;
FileChunk file_chunk = 2;
FileRef file_ref = 3;
Note note = 4;
Task task = 5;
FileRef file_ref = 3;
Note note = 4;
Task task = 5;
}
}

message Node {
NodeId node_id = 1;
WorkspaceId workspace_id = 2;
string hash = 3;
optional GitInfo git = 4;
NodeData data = 6;
NodeId node_id = 1;
WorkspaceId workspace_id = 2;
string hash = 3;
optional GitInfo git = 4;
NodeData data = 6;
}

message QueryItem {
Node node = 1;
optional float distance = 2;
optional uint64 rank = 4;
optional float relevance = 5;
Node node = 1;
optional float distance = 2;
optional uint64 rank = 4;
optional float relevance = 5;
}

message QueryResult {
repeated QueryItem data = 1;
}

message Query {
optional string prompt = 1;
optional float max_distance = 2;
optional uint32 limit = 3;
repeated NodeKind kinds = 4;
optional uint32 top_k = 5;
optional string relevance_query = 6;
repeated string starts_with = 7;
repeated string ends_with = 8;
optional string prompt = 1;
optional float max_distance = 2;
optional uint32 limit = 3;
repeated NodeKind kinds = 4;
optional uint32 top_k = 5;
optional string relevance_query = 6;
repeated string starts_with = 7;
repeated string ends_with = 8;
}

message FileUploadContent {
repeated File files = 1;
optional GitInfo git = 2;
repeated File files = 1;
optional GitInfo git = 2;
}

message RelationCreateResult {
RelationId relation_id = 1;
}

message UploadResult {
repeated string node_ids = 1;
repeated string node_ids = 1;
repeated RelationCreateResult relations = 2;
}

// Request/Response messages
message SearchRequest {
WorkspaceId workspace_id = 1;
optional Query query = 2;
WorkspaceId workspace_id = 1;
optional Query query = 2;
}

message SearchResponse {
QueryResult result = 1;
}

message UploadFilesRequest {
WorkspaceId workspace_id = 1;
FileUploadContent content = 2;
WorkspaceId workspace_id = 1;
FileUploadContent content = 2;
}

message UploadFilesResponse {
UploadResult result = 1;
}

message DeleteFilesRequest {
WorkspaceId workspace_id = 1;
repeated string file_paths = 2;
WorkspaceId workspace_id = 1;
repeated string file_paths = 2;
}

message DeleteFilesResponse {
uint32 deleted_nodes = 1;
uint32 deleted_nodes = 1;
uint32 deleted_relations = 2;
}

Expand All @@ -227,14 +227,14 @@ message ListFilesResponse {
}

message FileRefNode {
NodeId node_id = 1;
string hash = 2;
optional GitInfo git = 3;
FileRef data = 4;
NodeId node_id = 1;
string hash = 2;
optional GitInfo git = 3;
FileRef data = 4;
}

message ChunkFilesRequest {
repeated File files = 1;
repeated File files = 1;
optional uint32 min_chunk_size = 2;
optional uint32 max_chunk_size = 3;
}
Expand Down Expand Up @@ -286,25 +286,25 @@ message CreateApiKeyRequest {

message CreateApiKeyResponse {
UserId user_id = 1;
string key = 2;
string key = 2;
}

message ValidateFilesRequest {
repeated File files = 1;
}

message SyntaxError {
uint32 line = 1;
uint32 column = 2;
uint32 line = 1;
uint32 column = 2;
string message = 3;
}

message UnsupportedLanguage {}

message ValidationStatus {
oneof status {
bool valid = 1;
SyntaxErrorList errors = 2;
bool valid = 1;
SyntaxErrorList errors = 2;
UnsupportedLanguage unsupported_language = 3;
}
}
Expand All @@ -314,28 +314,28 @@ message SyntaxErrorList {
}

message FileValidationResult {
string file_path = 1;
ValidationStatus status = 2;
string file_path = 1;
ValidationStatus status = 2;
}

message ValidateFilesResponse {
repeated FileValidationResult results = 1;
}

message Skill {
string name = 1;
string name = 1;
string description = 2;
}

message SelectedSkill {
string name = 1;
float relevance = 2;
uint64 rank = 3;
string name = 1;
float relevance = 2;
uint64 rank = 3;
}

message SelectSkillRequest {
repeated Skill skills = 1;
string user_prompt = 2;
repeated Skill skills = 1;
string user_prompt = 2;
}

message SelectSkillResponse {
Expand Down
Loading
Loading