refactor(extension): auto-index on tool call and skip registration when binary missing

- Only register tool if `codexis` binary is in PATH
- Run incremental index via `pi.exec` on each tool call to keep DB fresh
- Remove `findDatabase` helper; derive DB path from git root directly
- Replace `defineTool` with inline `pi.registerTool` call
- Update imports (`@sinclair/typebox`, lazy `execSync`)
- Fix output flag help text in main.go
This commit is contained in:
2026-04-10 15:56:47 -04:00
parent 39fcfc2968
commit dfd61f899a
2 changed files with 119 additions and 93 deletions

View File

@@ -20,7 +20,7 @@ const dbFileName = "index.db"
func main() {
force := flag.Bool("force", false, "Force full re-index (ignore file hashes)")
output := flag.String("o", "", "Output database path (default: <root>/.codexis.db)")
output := flag.String("o", "", "Output database path (default: <root>/.codexis/index.db)")
flag.Parse()
root := "."