Commit Graph

11 Commits

Author SHA1 Message Date
Giancarlo Erra be5184338e Merge pull request #9 from pineapplestrikesback/feat/svelte-import-parsing
feat: add Svelte and Vue import parsing to dependency graph

Thanks pineapplestrikesback, nice idea and nicely implemented with zero-dependencies.
2026-03-18 13:45:28 +00:00
Giancarlo Erra 0c45ed9906 Merge pull request #10 from midweste/midweste-dotfiles
feat: add env support for controlling indexing of dotfiles
2026-03-18 12:32:13 +00:00
Giancarlo Erra 2e0cdbbd08 Merge pull request #11 from midweste/midweste-qdrantport
feat: auto-infer port from QDRANT_URL for reverse proxy support
2026-03-18 12:23:50 +00:00
Giancarlo Erra 4d255f50ee fix: only call ensureOllamaReady when using Ollama provider (#8)
ensureOllamaReady() was called unconditionally on every search and context
operation, causing failures for OpenAI and Google embedding users. Now only
called when embeddingProvider is ollama; otherwise the configured provider
is initialized via getEmbeddingProvider().

Fixes #7

Co-authored-by: pineapplestrikesback <pineapplestrikesback@users.noreply.github.com>
2026-03-17 17:46:51 +00:00
midwestE 507d823336 feat: auto-infer port from QDRANT_URL for reverse proxy support 2026-03-17 07:20:56 -05:00
midwestE 7265247d83 feat: add env support for controlling indexing of dotfiles 2026-03-17 07:11:25 -05:00
pineapplestrikesback 4c2bd0cc53 feat: add Svelte and Vue import parsing to dependency graph
Svelte and Vue files were included in the graph as leaf nodes (targets
of import edges) but their own imports were never extracted because
no ast-grep grammar exists for these languages.

This adds support by parsing .svelte/.vue files as HTML (built-in
grammar), extracting <script> block content, and re-parsing it as
TypeScript to extract imports using the existing JS/TS logic.

Changes:
- code-graph.ts: register .svelte and .vue in getAstGrepLang()
- graph-imports.ts: add Svelte/Vue script extraction handler; refactor
  JS/TS import extraction into shared extractJsTsImportsFromNode()
  helper to avoid duplication
- graph-resolution.ts: add "svelte" and "vue" cases to resolveImport(),
  with .svelte/.vue as first-priority extension resolution
- graph-imports.test.ts: add tests for Svelte (static, dynamic, module,
  no-script, JS-only) and Vue import extraction

Zero new dependencies — uses the built-in Lang.Html and Lang.TypeScript
grammars from @ast-grep/napi.

Known limitation: path aliases ($lib/, @/) are not resolved and will be
treated as external packages (same as current JS/TS behavior).
2026-03-16 16:23:18 +01:00
Csaba Tuncsik 505fbd722b fix: use relative paths for index keys to support shared worktree indexes
When SOCRATICODE_PROJECT_ID is set to share a Qdrant collection across
git worktrees, the indexer still used absolute paths as keys in the file
hash map, chunk IDs, and for deleting file chunks. This caused every
worktree to see all files as "new" and trigger a full re-index, defeating
the purpose of the shared project ID feature.

Switch all internal keying from absolute paths to relative paths:
- chunkId() now hashes on relativePath for stable IDs across worktrees
- File hash map (change detection) keyed by relativePath
- deleteFileChunks() filters on relativePath Qdrant field
- Deleted file detection uses relative path sets

Absolute paths are now only used for actual file I/O (stat, readFile).
2026-03-16 08:39:22 +01:00
Csaba Tuncsik fadfd8a80e feat: add SOCRATICODE_PROJECT_ID env var for shared indexes across directories
When working with git worktrees (or any setup where the same codebase lives
in multiple directories), each path currently gets its own Qdrant collection.
This means the same codebase is indexed multiple times.

This change adds a SOCRATICODE_PROJECT_ID environment variable that, when set,
overrides the path-based project ID generation. All directories sharing the
same SOCRATICODE_PROJECT_ID will use the same Qdrant collections (codebase,
codegraph, context), eliminating redundant indexing.

The value must match [a-zA-Z0-9_-]+ to remain Qdrant-friendly. An error is
thrown at startup if the value contains invalid characters.
2026-03-15 10:58:58 +01:00
Giancarlo Erra 88c0e8fee3 fix: add mcpName and read version dynamically from package.json 2026-03-04 18:06:36 +00:00
Giancarlo Erra 3f0ed5a286 feat: SocratiCode v1.0.0 — initial release 2026-02-28 17:06:21 +00:00