Skip to content

Commit 62fa541

Browse files
sestinjPatrick-ErichsenpriyashpatildevbyjonahYohannZe
authored
Dev (#1780)
* Nate/control plane client (#1691) * docs: add docs and schema for "OS" provider (#1536) * ignore .env * fix(gui): ctx rendering w/ renderInlineAs: "" (#1541) * ✨ use and cache imports for autocomplete (#1456) * ✨ use and cache imports for autocomplete * fix tsc * fix codeqwen autocomplete leading space * add voyage rerank-1 * feat: `--noEmit` for tsc checks in CI (#1559) * docs: update CustomContextProvider docs (#1557) * add stop tokens to qwen prompt * update docs to reflect 3.5 sonnet being best * docs: comment out unused providers (#1561) * import Handlebars * feat: toast notification for config updates (#1560) * feat: toast notification for config updates * feat: only trigger toast on config.json save * displayRawMarkdown option * feat: open pane on install (#1564) * feat: open pane on activation * comment out testing code * update to reflect 16 stop words limit for deepseek * feat: only trigger config update toast in vscode (#1571) * docs(prompt-files): fix typos + clarify (#1575) * doc: prompt file typo + clarifications * fix: add back correct docs * chore: add telemetry for pageviews (#1576) * feat: update onboarding w/ embeddings model (#1570) * chore(gui): remove unused pages * feat: add embeddings step * feat: update styles * feat: copy button updates * fix: correct pull command for embed model * fix: remove commented code * fix: remove commented code * feat: simplify copy btn props * chore: rename onboarding selection event * feat: add provider config * fix: undo msg name * remove dead code * fix: invalid mode check * fix: remove testing logic * docs(telemetry): add pageviews to tracking list (#1581) * Add reranker configuration options to codebase embedding docs (#1584) - Introduce reranker concept - List available reranker options - Provide configuration instructions - Update keywords to include "reranker" * chore: update pr template with screenshots (#1590) * Refactor ConfirmationDialog to use SecondaryButton for cancel action (#1586) * Added instructions for running docs server locally (#1578) - Added NPM script method - Added VS Code task method - Update contributing guidelines * Update branch policy (#1577) - Change PR target to `dev` branch - Update `CONTRIBUTING.md` instructions * Consolidate example configurations into the main configuration guide (#1579) - Moved examples to configuration.md - Deleted the separate examples.md file - Updated sidebar order and links - Improved readability and structure in configuration.md * fix: fullscreen gui retains context when hidden, fixed fullscreen focusing (#1582) * Update completionProvider.ts (warning tab-autocomplete models) (#1566) * feat: enhanced IndexingProgressBar with blinking dot feature - Integrated BlinkingDot component - Added STATUS_COLORS for various states - Replaced CircleDiv with BlinkingDot in UI - Updated status messages and layout * small UI tweaks * feat(gui): enhance ModelCard, ModelProviderTag, and Toggle components (#1595) - add styling and adjustments to ModelCard - update ModelProviderTag font size - remove box shadow from Toggle component - tweak icon styles in ModelCard - improve alignment and spacing * media query * feat: add best experience onboarding * fix: file rename * stop movement on button hover by keeping same border thickness * fix mistake in setting cursor: pointer * fix when free trial option is shown * Support Node.js versions below 20 for streaming response handling (#1591) - Add fallback for Node < 20 - Implement toAsyncIterable for streaming - Use TextDecoder for manual decoding - Maintain existing streaming for Node 20+ * small fixes * feat: add free trial card to onboarding (#1600) * feat: add free trial card to onboarding * add import * fix hasPassedFTL * fix /edit cancellation from UI * feat: add `applyCodeBlock` experimental prop (#1601) * feat: add new model styling improvements (#1609) * feat: add new model styling improvements * better gap size * feat: update bug_report.yml (#1610) * chore: update bug_report.yml * typo fix * feat: add labels to "Add docs" dialog (#1612) * feat: add labels to "Add docs" dialog * remove autofocus * don't double load config * small fixes * speed up directory traversal, and use correct native path module * option not to show config update toast * merge air-gapped and recommended setup pages * chore: add telemetry for full screen toggle (#1618) * Fix headings in codebase-embeddings.md (#1617) * mention jetbrains * docs: update changie (#1619) * feat: updated changie config * hide toc and autogenerate * Update changelog.mdx * link to deeper explanation of embeddings models * ensure target="_blank" for all links in sidebar * fix gif links in intellij README.md * don't require rust in dependency installation * chore: fix padding on gh button (#1620) * chore: adjust button padding * Update tasks.json * escape colons in diff path * smoother lancedb indexing reporting * smooth progress updates for indexing * fix tsc err * rerank-lite-1 * remove doccs * basic tests for VS Code extension * improved testing of VS Code extension * docs: add docs and schema for "OS" provider (#1536) * ignore .env * 🚑 fix constant warnings when onboarding with Ollama * ✨ use and cache imports for autocomplete (#1456) * ✨ use and cache imports for autocomplete * fix tsc * team analytics * apply control plane settings * workos auth * ide protocol get session info * UI for auth * profile switching * small fixes * updates * refresh tokens * updates * fix tsc errs * model select in toolbar to make room for profile selector * prod client id * link to prod URL * internal beta option * profiles change listener --------- Co-authored-by: Patrick Erichsen <[email protected]> Co-authored-by: Priyash <[email protected]> Co-authored-by: Jonah Wagner <[email protected]> Co-authored-by: YohannZe <[email protected]> Co-authored-by: Dan Dascalescu <[email protected]> * temporary patch for type errs * Dev (#1689) * Fix an issue where CMD+K does not clear the terminal when the terminal has focus (#1671) On MacOS, ⌘+K is bound, by default, to Terminal:Clear. Without this change ⌘+K does not clear the terminal but instead iniates a chord sequence and waits for the next stroke of the chord. Co-authored-by: Rob Leidle <[email protected]> * Change treeSitter to cache the Language objects it loads from wasm (#1672) Without this change, for a repository with 600 typescript files, the indexer would fail to finish correctly and there would be many of the following errors in the webview console log: 'Unable to load language for file ${path} RuntimeError: table index is out of bounds' The following bash will create a repo that reproduces the problem: current_path="." for ((i=1; i<=20; i++)); do new_folder="folder-$i" mkdir -p "$current_path/$new_folder" current_path="$current_path/$new_folder" for ((a=1; a<=30; a++)); do head -c 10000 /dev/urandom | base64 > "$current_path/file-$a.ts" done done Co-authored-by: Rob Leidle <[email protected]> * acknowledge sourcemap flag in esbuild.js * don't run jetbrains-release.yaml on vscode releases * further testing for walkDir * chore: add telemetry to commands (#1673) * test: Add basic unit test to baseLLM (#1668) * update version * test: Add basic unit test to baseLLM --------- Co-authored-by: Nate Sesti <[email protected]> Co-authored-by: inimaz <[email protected]> * feat: add Quick Actions CodeLens feature (#1674) * docs: add docs and schema for "OS" provider (#1536) * ignore .env * ✨ use and cache imports for autocomplete (#1456) * ✨ use and cache imports for autocomplete * fix tsc * add voyage rerank-1 * import Handlebars * feat: open pane on install (#1564) * feat: open pane on activation * comment out testing code * chore: add telemetry for pageviews (#1576) * feat: update onboarding w/ embeddings model (#1570) * chore(gui): remove unused pages * feat: add embeddings step * feat: update styles * feat: copy button updates * fix: correct pull command for embed model * fix: remove commented code * fix: remove commented code * feat: simplify copy btn props * chore: rename onboarding selection event * feat: add provider config * fix: undo msg name * remove dead code * fix: invalid mode check * fix: remove testing logic * fix: fullscreen gui retains context when hidden, fixed fullscreen focusing (#1582) * small UI tweaks * media query * feat: add best experience onboarding * small fixes * feat: add free trial card to onboarding (#1600) * feat: add free trial card to onboarding * add import * chore: add telemetry for full screen toggle (#1618) * rerank-lite-1 * remove doccs * basic tests for VS Code extension * improved testing of VS Code extension * manually implement stop tokens for hf inference api * chore: onboarding metrics (#1626) * fix: pageview tracking * feat: add onboarding telemetry * create single `onboardingStatus` type * improved var naming * remove console logs * fix windows performance issue * rename vscodeExtension.ts * migration of onboarding variables * "stash" instead of "delete" in indexing progress * fix preview.yaml * also fix main.yaml * Update troubleshooting.md (#1637) * feat: add quick actions * Update index.d.ts * quick actions mvp * update docs * subscribe to vscode change settings * Update commands.ts * cleanup * Update quick-actions.md * Update VerticalPerLineCodeLensProvider.ts * resolve feedback --------- Co-authored-by: Nate Sesti <[email protected]> Co-authored-by: Nate Sesti <[email protected]> Co-authored-by: Jonah Wagner <[email protected]> * chore: add `isCommandEvent` to command telemetry (#1675) * chore: add `isCommandEvent` to command telemetry * Update commands.ts * Nate/better retrieval (#1677) * deduplicatearray tests * break out separate retrieval pipelines * IConfigHandler * tests for codebase indexer * better .continueignore for continue * indexing fixes * ignore .gitignore and .continueignore when indexing * retrieval pipeline improvements * fix formatting err in out .continueignore * add necessary filter to lance_db_cache * update package.json version * skip unused tests * don't ignore .prompt files * update version * Update pull_request_template.md * don't use multi-media format when there are multiple text items * add free trial experience (#1685) * fix: add code range for quick actions/fixes (#1687) * fix: add code range for quick actions/fixes * Update test.js * add pathSep message type * docs improvements * jetbrains fix * update package.json version --------- Co-authored-by: Rob Leidle <[email protected]> Co-authored-by: Rob Leidle <[email protected]> Co-authored-by: Patrick Erichsen <[email protected]> Co-authored-by: inimaz <[email protected]> Co-authored-by: inimaz <[email protected]> Co-authored-by: Jonah Wagner <[email protected]> Co-authored-by: Priyash <[email protected]> * update package.json version * skip extension tests * update package.json version * handlebars import * don't push package.json version change from CI * fix: scroll issues w/ code blocks (#1688) * fix: scroll issues w/ code blocks * chore: name offset * chore: remove docs start * chore: update headings on troubleshooting.md (#1696) * ignore .svn folder for indexing (#1699) * chore: clearer naming for `useSuffix` (#1702) * chore: clearer naming for `useSuffix` * schema updates * fix: cmd+shft+l closes sidebar if focused (#1638) * docs: add docs and schema for "OS" provider (#1536) * ignore .env * ✨ use and cache imports for autocomplete (#1456) * ✨ use and cache imports for autocomplete * fix tsc * add voyage rerank-1 * import Handlebars * feat: open pane on install (#1564) * feat: open pane on activation * comment out testing code * chore: add telemetry for pageviews (#1576) * feat: update onboarding w/ embeddings model (#1570) * chore(gui): remove unused pages * feat: add embeddings step * feat: update styles * feat: copy button updates * fix: correct pull command for embed model * fix: remove commented code * fix: remove commented code * feat: simplify copy btn props * chore: rename onboarding selection event * feat: add provider config * fix: undo msg name * remove dead code * fix: invalid mode check * fix: remove testing logic * fix: fullscreen gui retains context when hidden, fixed fullscreen focusing (#1582) * small UI tweaks * media query * feat: add best experience onboarding * small fixes * feat: add free trial card to onboarding (#1600) * feat: add free trial card to onboarding * add import * chore: add telemetry for full screen toggle (#1618) * rerank-lite-1 * remove doccs * basic tests for VS Code extension * improved testing of VS Code extension * manually implement stop tokens for hf inference api * chore: onboarding metrics (#1626) * fix: pageview tracking * feat: add onboarding telemetry * create single `onboardingStatus` type * improved var naming * remove console logs * fix windows performance issue * rename vscodeExtension.ts * migration of onboarding variables * "stash" instead of "delete" in indexing progress * fix preview.yaml * also fix main.yaml * Update troubleshooting.md (#1637) * feat: close panel if main input is focused * add skip param * Update TipTapEditor.tsx * merge dev * Update commands.ts --------- Co-authored-by: Nate Sesti <[email protected]> Co-authored-by: Nate Sesti <[email protected]> Co-authored-by: Jonah Wagner <[email protected]> * bugfix: quick actions undefined array (#1704) * feat: add rich quick pick for quick edit (#1706) * feat: multistep quick pick * fix: multi step for context provider * Update test.js * Create deepseek.md (#1708) * style: add max height to model selector (#1712) * update styling * remove testing code * remove comments * feat: add tutorial card (#1716) * feat: create tutorial card * Update TutorialCard.tsx * feat: add file search to quick edit (#1714) * feat: multistep quick pick * fix: multi step for context provider * Update test.js * add file search * complete file search * remove unused import * add comments * Update utils.ts * update naming * chore: move quick pick instantiation (#1723) * Break out into NPM modules (#1726) * config.json types * export all schemas * break out request logic into packages * update openai adapters to export body types * update packaging of npm modules * update packages * continue proxy * mistral * Fix typo in documentation (#1722) In set-up-codestral.md "Trobleshooting" -> "Troubleshooting" * update package.json version * 🪄 model dropdown, control plane (#1692) * Nate/control plane client (#1691) * docs: add docs and schema for "OS" provider (#1536) * ignore .env * fix(gui): ctx rendering w/ renderInlineAs: "" (#1541) * ✨ use and cache imports for autocomplete (#1456) * ✨ use and cache imports for autocomplete * fix tsc * fix codeqwen autocomplete leading space * add voyage rerank-1 * feat: `--noEmit` for tsc checks in CI (#1559) * docs: update CustomContextProvider docs (#1557) * add stop tokens to qwen prompt * update docs to reflect 3.5 sonnet being best * docs: comment out unused providers (#1561) * import Handlebars * feat: toast notification for config updates (#1560) * feat: toast notification for config updates * feat: only trigger toast on config.json save * displayRawMarkdown option * feat: open pane on install (#1564) * feat: open pane on activation * comment out testing code * update to reflect 16 stop words limit for deepseek * feat: only trigger config update toast in vscode (#1571) * docs(prompt-files): fix typos + clarify (#1575) * doc: prompt file typo + clarifications * fix: add back correct docs * chore: add telemetry for pageviews (#1576) * feat: update onboarding w/ embeddings model (#1570) * chore(gui): remove unused pages * feat: add embeddings step * feat: update styles * feat: copy button updates * fix: correct pull command for embed model * fix: remove commented code * fix: remove commented code * feat: simplify copy btn props * chore: rename onboarding selection event * feat: add provider config * fix: undo msg name * remove dead code * fix: invalid mode check * fix: remove testing logic * docs(telemetry): add pageviews to tracking list (#1581) * Add reranker configuration options to codebase embedding docs (#1584) - Introduce reranker concept - List available reranker options - Provide configuration instructions - Update keywords to include "reranker" * chore: update pr template with screenshots (#1590) * Refactor ConfirmationDialog to use SecondaryButton for cancel action (#1586) * Added instructions for running docs server locally (#1578) - Added NPM script method - Added VS Code task method - Update contributing guidelines * Update branch policy (#1577) - Change PR target to `dev` branch - Update `CONTRIBUTING.md` instructions * Consolidate example configurations into the main configuration guide (#1579) - Moved examples to configuration.md - Deleted the separate examples.md file - Updated sidebar order and links - Improved readability and structure in configuration.md * fix: fullscreen gui retains context when hidden, fixed fullscreen focusing (#1582) * Update completionProvider.ts (warning tab-autocomplete models) (#1566) * feat: enhanced IndexingProgressBar with blinking dot feature - Integrated BlinkingDot component - Added STATUS_COLORS for various states - Replaced CircleDiv with BlinkingDot in UI - Updated status messages and layout * small UI tweaks * feat(gui): enhance ModelCard, ModelProviderTag, and Toggle components (#1595) - add styling and adjustments to ModelCard - update ModelProviderTag font size - remove box shadow from Toggle component - tweak icon styles in ModelCard - improve alignment and spacing * media query * feat: add best experience onboarding * fix: file rename * stop movement on button hover by keeping same border thickness * fix mistake in setting cursor: pointer * fix when free trial option is shown * Support Node.js versions below 20 for streaming response handling (#1591) - Add fallback for Node < 20 - Implement toAsyncIterable for streaming - Use TextDecoder for manual decoding - Maintain existing streaming for Node 20+ * small fixes * feat: add free trial card to onboarding (#1600) * feat: add free trial card to onboarding * add import * fix hasPassedFTL * fix /edit cancellation from UI * feat: add `applyCodeBlock` experimental prop (#1601) * feat: add new model styling improvements (#1609) * feat: add new model styling improvements * better gap size * feat: update bug_report.yml (#1610) * chore: update bug_report.yml * typo fix * feat: add labels to "Add docs" dialog (#1612) * feat: add labels to "Add docs" dialog * remove autofocus * don't double load config * small fixes * speed up directory traversal, and use correct native path module * option not to show config update toast * merge air-gapped and recommended setup pages * chore: add telemetry for full screen toggle (#1618) * Fix headings in codebase-embeddings.md (#1617) * mention jetbrains * docs: update changie (#1619) * feat: updated changie config * hide toc and autogenerate * Update changelog.mdx * link to deeper explanation of embeddings models * ensure target="_blank" for all links in sidebar * fix gif links in intellij README.md * don't require rust in dependency installation * chore: fix padding on gh button (#1620) * chore: adjust button padding * Update tasks.json * escape colons in diff path * smoother lancedb indexing reporting * smooth progress updates for indexing * fix tsc err * rerank-lite-1 * remove doccs * basic tests for VS Code extension * improved testing of VS Code extension * docs: add docs and schema for "OS" provider (#1536) * ignore .env * 🚑 fix constant warnings when onboarding with Ollama * ✨ use and cache imports for autocomplete (#1456) * ✨ use and cache imports for autocomplete * fix tsc * team analytics * apply control plane settings * workos auth * ide protocol get session info * UI for auth * profile switching * small fixes * updates * refresh tokens * updates * fix tsc errs * model select in toolbar to make room for profile selector * prod client id * link to prod URL * internal beta option * profiles change listener --------- Co-authored-by: Patrick Erichsen <[email protected]> Co-authored-by: Priyash <[email protected]> Co-authored-by: Jonah Wagner <[email protected]> Co-authored-by: YohannZe <[email protected]> Co-authored-by: Dan Dascalescu <[email protected]> * temporary patch for type errs --------- Co-authored-by: Patrick Erichsen <[email protected]> Co-authored-by: Priyash <[email protected]> Co-authored-by: Jonah Wagner <[email protected]> Co-authored-by: YohannZe <[email protected]> Co-authored-by: Dan Dascalescu <[email protected]> * skip extension tests * JetBrains status bar spinner for autocomplete * Remove unused images * partial accept jetbrains * fix double-rendering of jetbrains completions * fix offset of multi-line jetbrains completions * enable/disable actions * upgrade to version 0.0.54 * fix: wrap editor buttons when out of space (#1727) * Add .continuerc file to config directory on activation to prevent it's indexing. (#1733) * Updated the content links that were deprecated in the document (#1709) Co-authored-by: Ihe Fan <[email protected]> * Nate/dev (#1739) * JetBrains status bar spinner for autocomplete * Remove unused images * partial accept jetbrains * fix double-rendering of jetbrains completions * fix offset of multi-line jetbrains completions * enable/disable actions * upgrade to version 0.0.54 * llm-info package * small profile switching improvements * instruct cmd+I not to leave placeholders * @ files in context-providers docs * onboarding fix * update jetbrains ci to build gui * feat: single default quick pick to edit (#1743) * feat: single default quick pick to edit * Update quick-actions.md * Update quick-actions.md * use defaultQuickAction * quick fixes * fix: handle line removal diff (#1744) * fix: handle line removal diff * remove comments * Configurable `maxChunkSize` for embedding providers (#1746) * Add `maxChunkSize` to `EmbeddingsProvider` * Add `maxChunkSize` to schema * add support for docs via config (#1594) * mistral mamba (#1748) * 🐍 mistral mamba * autoscale retrieval based on context length * autoscale retrieval based on context length * fix input box movement * update jetbrains build * test: add myers diff tests (#1754) * feat: enhance help center (#1755) * feat: enhance help center * Update help.tsx * feat: add azure provider config (#1764) * autocomplete reload fix * logout of control plane * Update QuickEditQuickPick.ts (#1772) * Update QuickEditQuickPick.ts * updates * Update QuickEditQuickPick.ts * pass refreshed access token to continue-proxy model * test: add dir read check for walkDir (#1773) * test: add dir read check for walkDir * Update ignore.ts * Update walkDir.test.ts * Update walkDir.test.ts * gpt-4o-mini * gpt-4o-mini * gpt4omini to ui selector * fix: layout alignment (#1779) * fix: delete old docs index on force re-index (#1778) * add "Codebase Force Re-Index" command (#1757) * Add `HuggingFaceTEIReranker` (#1711) * Add `HuggingFaceTEIReranker` * Add `huggingface-tei` to `config_schema.json` * update package.json version * update config schemas --------- Co-authored-by: Patrick Erichsen <[email protected]> Co-authored-by: Priyash <[email protected]> Co-authored-by: Jonah Wagner <[email protected]> Co-authored-by: YohannZe <[email protected]> Co-authored-by: Dan Dascalescu <[email protected]> Co-authored-by: Rob Leidle <[email protected]> Co-authored-by: Rob Leidle <[email protected]> Co-authored-by: inimaz <[email protected]> Co-authored-by: inimaz <[email protected]> Co-authored-by: Anaël Bonnafous <[email protected]> Co-authored-by: Huy Tran <[email protected]> Co-authored-by: Gabriel Gordbegli <[email protected]> Co-authored-by: Raven-1027 <[email protected]> Co-authored-by: Ihe Fan <[email protected]> Co-authored-by: Lukas Kreussel <[email protected]>
1 parent 82ac619 commit 62fa541

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+746
-366
lines changed

core/config/types.ts

+1
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,7 @@ declare global {
523523
| "gpt-4-32k"
524524
| "gpt-4-turbo"
525525
| "gpt-4o"
526+
| "gpt-4o-mini"
526527
| "gpt-4-turbo-preview"
527528
| "gpt-4-vision-preview"
528529
// Mistral

core/context/rerankers/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ import { CohereReranker } from "./cohere.js";
33
import { FreeTrialReranker } from "./freeTrial.js";
44
import { LLMReranker } from "./llm.js";
55
import { VoyageReranker } from "./voyage.js";
6+
import {HuggingFaceTEIReranker} from "./tei.js"
67

78
export const AllRerankers: { [key in RerankerName]: any } = {
89
cohere: CohereReranker,
910
llm: LLMReranker,
1011
voyage: VoyageReranker,
1112
"free-trial": FreeTrialReranker,
13+
"huggingface-tei": HuggingFaceTEIReranker
1214
};

core/context/rerankers/tei.ts

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import fetch from "node-fetch";
2+
import { Chunk, Reranker } from "../../index.js";
3+
4+
export class HuggingFaceTEIReranker implements Reranker {
5+
name = "huggingface-tei";
6+
7+
static defaultOptions = {
8+
apiBase: "http://localhost:8080",
9+
truncate: true,
10+
truncation_direction: "Right"
11+
};
12+
13+
constructor(
14+
private readonly params: {
15+
apiBase?: string;
16+
truncate?: boolean;
17+
truncation_direction?: string;
18+
},
19+
) {}
20+
21+
async rerank(query: string, chunks: Chunk[]): Promise<number[]> {
22+
let apiBase = this.params.apiBase ?? HuggingFaceTEIReranker.defaultOptions.apiBase;
23+
if (!apiBase.endsWith("/")) {
24+
apiBase += "/";
25+
}
26+
27+
const resp = await fetch(new URL("rerank", apiBase), {
28+
method: "POST",
29+
headers: { 'Content-Type': 'application/json' },
30+
body: JSON.stringify({
31+
query: query,
32+
return_text: false,
33+
raw_scores: false,
34+
texts: chunks.map((chunk) => chunk.content),
35+
truncation_direction: this.params.truncation_direction ?? HuggingFaceTEIReranker.defaultOptions.truncation_direction,
36+
truncate: this.params.truncate ?? HuggingFaceTEIReranker.defaultOptions.truncate
37+
}),
38+
});
39+
40+
if (!resp.ok) {
41+
throw new Error(await resp.text());
42+
}
43+
44+
const data = (await resp.json()) as any;
45+
// Resort into original order and extract scores
46+
const results = data.sort((a: any, b: any) => a.index - b.index);
47+
return results.map((result: any) => result.score);
48+
}
49+
}

core/diff/streamDiff.ts

+14-12
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,37 @@
1-
import { DiffLine } from "../index.js";
1+
import { DiffLine, DiffLineType } from "../index.js";
22
import { LineStream, matchLine } from "./util.js";
33

44
/**
55
* https://blog.jcoglan.com/2017/02/12/the-myers-diff-algorithm-part-1/
66
* Invariants:
77
* - new + same = newLines.length
8-
* - old + same = oldLines.length
8+
* - old + same = oldLinesCopy.length
99
* ^ (above two guarantee that all lines get represented)
1010
* - Lines are always output in order, at least among old and new separately
1111
*/
1212
export async function* streamDiff(
1313
oldLines: string[],
1414
newLines: LineStream,
1515
): AsyncGenerator<DiffLine> {
16+
const oldLinesCopy = [...oldLines];
17+
1618
// If one indentation mistake is made, others are likely. So we are more permissive about matching
1719
let seenIndentationMistake = false;
1820

1921
let newLineResult = await newLines.next();
2022

21-
while (oldLines.length > 0 && !newLineResult.done) {
23+
while (oldLinesCopy.length > 0 && !newLineResult.done) {
2224
const { matchIndex, isPerfectMatch, newLine } = matchLine(
2325
newLineResult.value,
24-
oldLines,
26+
oldLinesCopy,
2527
seenIndentationMistake,
2628
);
2729

2830
if (!seenIndentationMistake && newLineResult.value !== newLine) {
2931
seenIndentationMistake = true;
3032
}
3133

32-
let type: DiffLine["type"];
34+
let type: DiffLineType;
3335

3436
let isLineRemoval = false;
3537
const isNewLine = matchIndex === -1;
@@ -39,7 +41,7 @@ export async function* streamDiff(
3941
} else {
4042
// Insert all deleted lines before match
4143
for (let i = 0; i < matchIndex; i++) {
42-
yield { type: "old", line: oldLines.shift()! };
44+
yield { type: "old", line: oldLinesCopy.shift()! };
4345
}
4446

4547
type = isPerfectMatch ? "same" : "old";
@@ -51,13 +53,13 @@ export async function* streamDiff(
5153
break;
5254

5355
case "same":
54-
yield { type, line: oldLines.shift()! };
56+
yield { type, line: oldLinesCopy.shift()! };
5557
break;
5658

5759
case "old":
58-
yield { type, line: oldLines.shift()! };
60+
yield { type, line: oldLinesCopy.shift()! };
5961

60-
if (oldLines[0] !== newLine) {
62+
if (oldLinesCopy[0] !== newLine) {
6163
yield { type: "new", line: newLine };
6264
} else {
6365
isLineRemoval = true;
@@ -75,13 +77,13 @@ export async function* streamDiff(
7577
}
7678

7779
// Once at the edge, only one choice
78-
if (newLineResult.done && oldLines.length > 0) {
79-
for (const oldLine of oldLines) {
80+
if (newLineResult.done && oldLinesCopy.length > 0) {
81+
for (const oldLine of oldLinesCopy) {
8082
yield { type: "old", line: oldLine };
8183
}
8284
}
8385

84-
if (!newLineResult.done && oldLines.length === 0) {
86+
if (!newLineResult.done && oldLinesCopy.length === 0) {
8587
yield { type: "new", line: newLineResult.value };
8688
for await (const newLine of newLines) {
8789
yield { type: "new", line: newLine };

core/diff/util.ts

+2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ function linesMatch(lineA: string, lineB: string, linesBetween = 0): boolean {
3838
}
3939

4040
/**
41+
* Used to find a match for a new line in an array of old lines.
42+
*
4143
* Return the index of the first match and whether it is a perfect match
4244
* Also return a version of the line with correct indentation if needs fixing
4345
*/

core/index.d.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -374,8 +374,10 @@ export type CustomLLM = RequireAtLeastOne<
374374

375375
// IDE
376376

377+
export type DiffLineType = "new" | "old" | "same";
378+
377379
export interface DiffLine {
378-
type: "new" | "old" | "same";
380+
type: DiffLineType;
379381
line: string;
380382
}
381383

@@ -596,6 +598,7 @@ export type ModelName =
596598
| "gpt-3.5-turbo-0613"
597599
| "gpt-4-32k"
598600
| "gpt-4o"
601+
| "gpt-4o-mini"
599602
| "gpt-4-turbo"
600603
| "gpt-4-turbo-preview"
601604
| "gpt-4-vision-preview"
@@ -756,7 +759,7 @@ export interface EmbeddingsProvider {
756759
embed(chunks: string[]): Promise<number[][]>;
757760
}
758761

759-
export type RerankerName = "cohere" | "voyage" | "llm" | "free-trial";
762+
export type RerankerName = "cohere" | "voyage" | "llm" | "free-trial" | "huggingface-tei";
760763

761764
export interface RerankerDescription {
762765
name: RerankerName;

core/indexing/docs/DocsService.ts

+13-5
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ export class DocsService {
214214
return;
215215
}
216216

217-
if (!reIndex && await this.has(startUrl.toString())) {
217+
if (!reIndex && (await this.has(startUrl.toString()))) {
218218
yield {
219219
progress: 1,
220220
desc: "Already indexed",
@@ -275,11 +275,13 @@ export class DocsService {
275275

276276
try {
277277
const subpathEmbeddings = await embeddingsProvider.embed(
278-
chunkArticle(article, embeddingsProvider.maxChunkSize).map((chunk) => {
279-
chunks.push(chunk);
278+
chunkArticle(article, embeddingsProvider.maxChunkSize).map(
279+
(chunk) => {
280+
chunks.push(chunk);
280281

281-
return chunk.content;
282-
}),
282+
return chunk.content;
283+
},
284+
),
283285
);
284286

285287
embeddings.push(...subpathEmbeddings);
@@ -296,6 +298,12 @@ export class DocsService {
296298
status: "indexing",
297299
};
298300

301+
// Clear old index if re-indexing.
302+
if (reIndex) {
303+
console.log("Deleting old embeddings");
304+
await this.delete(startUrl.toString());
305+
}
306+
299307
await this.add(siteIndexingConfig.title, startUrl, chunks, embeddings);
300308
this.docsIndexingQueue.delete(startUrl.toString());
301309

core/indexing/ignore.ts

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ export const DEFAULT_IGNORE_FILETYPES = [
6464
".gitkeep",
6565
".continueignore",
6666
"config.json",
67+
".csv",
6768
// "*.prompt", // can be incredibly confusing for the LLM to have another set of instructions injected into the prompt
6869
];
6970
export const defaultIgnoreFile = ignore().add(DEFAULT_IGNORE_FILETYPES);

core/indexing/walkDir.ts

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { EventEmitter } from "events";
22
import { Minimatch } from "minimatch";
33
import path from "node:path";
4-
import { FileType, IDE } from "..";
5-
import { DEFAULT_IGNORE_DIRS, DEFAULT_IGNORE_FILETYPES } from "./ignore";
4+
import { FileType, IDE } from "../index.js";
5+
import { DEFAULT_IGNORE_DIRS, DEFAULT_IGNORE_FILETYPES } from "./ignore.js";
66

77
export interface WalkerOptions {
88
isSymbolicLink?: boolean;
@@ -34,10 +34,7 @@ class Walker extends EventEmitter {
3434
sawError: boolean;
3535
exact: boolean | undefined;
3636
onlyDirs: boolean | undefined;
37-
constructor(
38-
opts: WalkerOptions = {},
39-
protected readonly ide: IDE,
40-
) {
37+
constructor(opts: WalkerOptions = {}, protected readonly ide: IDE) {
4138
super(opts as any);
4239
this.isSymbolicLink = opts.isSymbolicLink || false;
4340
this.path = opts.path || process.cwd();

core/llm/autodetect.ts

+1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ const MODEL_SUPPORTS_IMAGES: string[] = [
6161
"llava",
6262
"gpt-4-turbo",
6363
"gpt-4o",
64+
"gpt-4o-mini",
6465
"gpt-4-vision",
6566
"claude-3",
6667
"gemini-ultra",

core/llm/constants.ts

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const CONTEXT_LENGTH_FOR_MODEL: { [name: string]: number } = {
2020
"gpt-4-32k": GPT_4_CTX_LEN,
2121
"gpt-4-turbo-preview": GPT_4_CTX_LEN,
2222
"gpt-4o": GPT_4_CTX_LEN,
23+
"gpt-4o-mini": GPT_4_CTX_LEN,
2324
"gpt-4-vision": GPT_4_CTX_LEN,
2425
"gpt-4-0125-preview": GPT_4_CTX_LEN,
2526
"gpt-4-1106-preview": GPT_4_CTX_LEN,

core/llm/llms/Azure.ts

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { ModelProvider } from "../../index.js";
2+
import OpenAI from "./OpenAI.js";
3+
4+
class Azure extends OpenAI {
5+
static providerName: ModelProvider = "azure";
6+
}
7+
8+
export default Azure;

core/llm/llms/OpenAI.ts

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ const CHAT_ONLY_MODELS = [
3636
"gpt-4-vision",
3737
"gpt-4-0125-preview",
3838
"gpt-4-1106-preview",
39+
"gpt-4o-mini",
3940
];
4041

4142
class OpenAI extends BaseLLM {

core/llm/llms/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import LlamaCpp from "./LlamaCpp.js";
2727
import Llamafile from "./Llamafile.js";
2828
import Mistral from "./Mistral.js";
2929
import Msty from "./Msty.js";
30+
import Azure from "./Azure.js";
3031
import Ollama from "./Ollama.js";
3132
import OpenAI from "./OpenAI.js";
3233
import Replicate from "./Replicate.js";
@@ -124,6 +125,7 @@ const LLMs = [
124125
Cloudflare,
125126
Deepseek,
126127
Msty,
128+
Azure,
127129
];
128130

129131
export async function llmFromDescription(

core/llm/llms/stubs/ContinueProxy.ts

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class ContinueProxy extends OpenAI {
1818
static defaultOptions: Partial<LLMOptions> = {
1919
apiBase:
2020
"https://control-plane-api-service-i3dqylpbqa-uc.a.run.app/model-proxy/v1",
21+
useLegacyCompletionsEndpoint: false,
2122
};
2223

2324
supportsFim(): boolean {

core/package-lock.json

+10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"eslint": "^8",
2525
"eslint-plugin-import": "^2.29.1",
2626
"jest": "^29.7.0",
27+
"myers-diff": "^2.1.0",
2728
"onnxruntime-common": "1.14.0",
2829
"onnxruntime-web": "1.14.0",
2930
"ts-jest": "^29.1.1"

core/protocol/ide.ts

+1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ export type ToIdeFromWebviewOrCoreProtocol = {
8080
{ silent: boolean },
8181
ControlPlaneSessionInfo | undefined,
8282
];
83+
logoutOfControlPlane: [undefined, void];
8384
pathSep: [undefined, string];
8485
};
8586

0 commit comments

Comments
 (0)