From 7de163067eef5047dabd75df726218f93b69f6b3 Mon Sep 17 00:00:00 2001 From: Autumn brown <35852011+AutumnsGrove@users.noreply.github.com> Date: Sun, 12 Apr 2026 18:54:09 -0400 Subject: [PATCH 1/6] feat(chunker): add .svelte support with two-phase TS injection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Index .svelte files by parsing the outer Svelte grammar to locate + +
{greet('world')}
+`) + +func TestSvelteChunker_ScriptSymbols(t *testing.T) { + langs := chunker.DefaultLanguages(512) + c, ok := langs[".svelte"] + if !ok { + t.Fatal("no chunker registered for .svelte") + } + + chunks, err := c.Chunk("src/routes/+page.svelte", sampleSvelte) + if err != nil { + t.Fatalf("Chunk: %v", err) + } + + bySymbol := make(map[string]chunker.Chunk) + for _, ch := range chunks { + bySymbol[ch.Symbol] = ch + } + + // Functions and types from the TS script block + checkChunk(t, bySymbol, "greet", "function", 0, 0, "src/routes/+page.svelte", "function greet") + checkChunk(t, bySymbol, "Props", "interface", 0, 0, "src/routes/+page.svelte", "interface Props") + checkChunk(t, bySymbol, "Counter", "type", 0, 0, "src/routes/+page.svelte", "class Counter") + + // Line numbers must be file-relative (1-based), not script-block-relative. + // greet is on line 10 of the file (first line of script is line 1, content + // starts on line 2, greet starts on the 10th line of the file). + if chunks[0].StartLine < 2 { + t.Errorf("expected file-relative line numbers (>= 2), got StartLine=%d for first chunk", chunks[0].StartLine) + } +} + +func TestSvelteChunker_EmptyScript(t *testing.T) { + empty := []byte(` +hello
+`) + langs := chunker.DefaultLanguages(512) + c := langs[".svelte"] + chunks, err := c.Chunk("empty.svelte", empty) + if err != nil { + t.Fatalf("Chunk: %v", err) + } + if len(chunks) != 0 { + t.Errorf("expected 0 chunks for empty script, got %d", len(chunks)) + } +} + +func TestSvelteChunker_NoScript(t *testing.T) { + noScript := []byte(`No script block here.
+`) + langs := chunker.DefaultLanguages(512) + c := langs[".svelte"] + chunks, err := c.Chunk("static.svelte", noScript) + if err != nil { + t.Fatalf("Chunk: %v", err) + } + if len(chunks) != 0 { + t.Errorf("expected 0 chunks for file with no script, got %d", len(chunks)) + } +} diff --git a/internal/chunker/treesitter_test.go b/internal/chunker/treesitter_test.go index 601ec91e..31ba82c4 100644 --- a/internal/chunker/treesitter_test.go +++ b/internal/chunker/treesitter_test.go @@ -818,7 +818,8 @@ func TestDefaultLanguages_AllExtensionsPresent(t *testing.T) { ".hpp": []byte("void foo() {}"), ".php": []byte("\nfunction hello(): string { return 'hi'; }\n\nhi
\n"), ".md": []byte("# Introduction\nSome content here.\n"), ".mdx": []byte("# Introduction\nSome content here.\n"), ".yaml": []byte("foo: bar\n"), diff --git a/internal/models/models.go b/internal/models/models.go index 8a276160..b72f57be 100644 --- a/internal/models/models.go +++ b/internal/models/models.go @@ -59,12 +59,13 @@ func DimensionAwareMinScore(dims int) float64 { // KnownModels maps model names to their specifications. var KnownModels = map[string]ModelSpec{ - "ordis/jina-embeddings-v2-base-code": {Dims: 768, CtxLength: 8192, Backend: "ollama", MinScore: 0.35}, - "nomic-embed-text": {Dims: 768, CtxLength: 8192, Backend: "ollama", MinScore: 0.30}, - "nomic-ai/nomic-embed-code-GGUF": {Dims: 3584, CtxLength: 8192, Backend: "lmstudio", MinScore: 0.15}, - "qwen3-embedding:8b": {Dims: 4096, CtxLength: 40960, Backend: "ollama", MinScore: 0.30}, - "qwen3-embedding:4b": {Dims: 2560, CtxLength: 40960, Backend: "ollama", MinScore: 0.30}, - "qwen3-embedding:0.6b": {Dims: 1024, CtxLength: 32768, Backend: "ollama", MinScore: 0.30}, - "all-minilm": {Dims: 384, CtxLength: 512, Backend: "ollama", MinScore: 0.20}, - "manutic/nomic-embed-code:7b": {Dims: 3584, CtxLength: 32768, Backend: "ollama", MinScore: 0.15}, + "ordis/jina-embeddings-v2-base-code": {Dims: 768, CtxLength: 8192, Backend: "ollama", MinScore: 0.35}, + "nomic-embed-text": {Dims: 768, CtxLength: 8192, Backend: "ollama", MinScore: 0.30}, + "nomic-ai/nomic-embed-code-GGUF": {Dims: 3584, CtxLength: 8192, Backend: "lmstudio", MinScore: 0.15}, + "qwen3-embedding:8b": {Dims: 4096, CtxLength: 40960, Backend: "ollama", MinScore: 0.30}, + "qwen3-embedding:4b": {Dims: 2560, CtxLength: 40960, Backend: "ollama", MinScore: 0.30}, + "qwen3-embedding:0.6b": {Dims: 1024, CtxLength: 32768, Backend: "ollama", MinScore: 0.30}, + "all-minilm": {Dims: 384, CtxLength: 512, Backend: "ollama", MinScore: 0.20}, + "manutic/nomic-embed-code:7b": {Dims: 3584, CtxLength: 32768, Backend: "ollama", MinScore: 0.15}, + "text-embedding-voyage-4-nano": {Dims: 1024, CtxLength: 2048, Backend: "lmstudio", MinScore: 0.30}, } diff --git a/internal/models/models_test.go b/internal/models/models_test.go index b279aa7a..6d923874 100644 --- a/internal/models/models_test.go +++ b/internal/models/models_test.go @@ -26,6 +26,7 @@ func TestKnownModels(t *testing.T) { "qwen3-embedding:0.6b": {Dims: 1024, CtxLength: 32768, Backend: "ollama", MinScore: 0.30}, "all-minilm": {Dims: 384, CtxLength: 512, Backend: "ollama", MinScore: 0.20}, "manutic/nomic-embed-code:7b": {Dims: 3584, CtxLength: 32768, Backend: "ollama", MinScore: 0.15}, + "text-embedding-voyage-4-nano": {Dims: 1024, CtxLength: 2048, Backend: "lmstudio", MinScore: 0.30}, } for name, want := range expected { From 04ca9b151508027d3fe842576005bafbf691d212 Mon Sep 17 00:00:00 2001 From: Autumn brown <35852011+AutumnsGrove@users.noreply.github.com> Date: Mon, 13 Apr 2026 18:47:50 -0400 Subject: [PATCH 2/6] refactor(models): remove text-embedding-voyage-4-nano from KnownModels MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This model is LM Studio-only (served via Voyage AI's local inference) and not available in Ollama. The project defaults to Ollama and runs e2e tests against it, so registering an LM Studio-exclusive model here is misleading. Users who want voyage-4-nano can still configure it manually via LUMEN_EMBED_MODEL — it just won't have pre-registered dims/ctx/min-score. Co-Authored-By: Claude Sonnet 4.6No headers configured
+ {:else} + {#each headers as header, i} +
+ Common examples:
+ • Bearer token:
+ Authorization: Bearer YOUR_TOKEN
+ • API key:
+ X-API-Key: YOUR_KEY
+
Be careful with custom MCP servers.
++ They receive your requests (including conversation context and any headers you add) and + can run powerful tools on your behalf. Only add servers you trust and review their source. + Never share confidental informations. +
+{error}
++ {server.url} +
++ {#if currentView === "list"} + Manage MCP servers to extend {publicConfig.PUBLIC_APP_NAME} with external tools. + {:else} + Add a custom MCP server to {publicConfig.PUBLIC_APP_NAME}. + {/if} +
++ {$allMcpServers.length} + {$allMcpServers.length === 1 ? "server" : "servers"} configured +
++ {enabledCount} enabled +
++ No custom servers yet +
++ Add your own MCP servers with custom tools +
+ +Loading…
{/if} + {#if error}{error}
{/if} + {#each activity as entry (entry.id)} +Loading…
{/if} - {#if error}{error}
{/if} - {#each activity as entry (entry.id)} -+ {server.url} +
+