feat(code): tree-sitter symbol extraction + auto-indexing

Symbol extraction (symbols.rs):
- tree-sitter parsers for Rust, TypeScript, Python
- Extracts: functions, structs, enums, traits, classes, interfaces
- Signatures, docstrings, line ranges for each symbol
- extract_project_symbols() walks project directory
- Skips hidden/vendor/target/node_modules, files >100KB

Proto: IndexSymbols + SymbolEntry messages for client→server symbol relay

Client: after SessionReady, extracts symbols and sends IndexSymbols
to Sol for indexing into the code search index.

14 unit tests for symbol extraction across Rust/TS/Python.
This commit is contained in:
2026-03-24 00:42:03 +00:00
parent c6d6dbe5c8
commit 73d7d6c15b
6 changed files with 774 additions and 0 deletions

View File

@@ -16,9 +16,28 @@ message ClientMessage {
ToolResult tool_result = 3;
ToolApproval approval = 4;
EndSession end = 5;
IndexSymbols index_symbols = 6;
}
}
message IndexSymbols {
string project_name = 1;
string branch = 2;
repeated SymbolEntry symbols = 3;
}
message SymbolEntry {
string file_path = 1;
string name = 2;
string kind = 3;
string signature = 4;
string docstring = 5;
int32 start_line = 6;
int32 end_line = 7;
string language = 8;
string content = 9;
}
message StartSession {
string project_path = 1;
string prompt_md = 2;