Sprint 0-2: TS plugin scaffolding, LanceDB utils, tooling updates

- Add index-tool.ts command implementation
- Wire lancedb.ts vector search into plugin
- Update src/tools/index.ts exports
- Bump package deps (ts-jest, jest, typescript, lancedb)
- Add .claude/settings.local.json

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-11 13:24:26 -04:00
parent 83a54b2af6
commit 208531d28d
9 changed files with 10297 additions and 53 deletions

View File

@@ -79,6 +79,9 @@ def create_table_if_not_exists(db: Any) -> Any:
)
tbl = db.create_table(TABLE_NAME, schema=schema, exist_ok=True)
# Create FTS index on chunk_text for DEGRADED mode fallback (Ollama down)
# replace=True makes this idempotent — safe to call on existing tables
tbl.create_fts_index("chunk_text", replace=True)
return tbl
@@ -153,11 +156,11 @@ def search_chunks(
chunk_text=r["chunk_text"],
source_file=r["source_file"],
source_directory=r["source_directory"],
section=r.get("section"),
date=r.get("date"),
tags=r.get("tags", []),
chunk_index=r.get("chunk_index", 0),
score=r.get("_score", 0.0),
section=r.get("section") if r.get("section") not in (None, "None") else None,
date=r.get("date") if r.get("date") not in (None, "None") else None,
tags=r.get("tags") or [],
chunk_index=r.get("chunk_index") or 0,
score=r.get("_distance") or 0.0,
)
for r in results
]