fix tsc errs
This commit is contained in:
parent
e6d431d1c5
commit
4e57b76139
13 changed files with 24 additions and 27 deletions
|
|
@ -32,7 +32,11 @@ import { getConfigJsonPath } from "../util/paths.js";
|
|||
import AutocompleteLruCache from "./AutocompleteLruCache.js";
|
||||
import { ImportDefinitionsService } from "./context/ImportDefinitionsService.js";
|
||||
import { BracketMatchingService } from "./filtering/BracketMatchingService.js";
|
||||
import { stopAtStopTokens } from "./filtering/streamTransforms/charStream.js";
|
||||
import {
|
||||
noFirstCharNewline,
|
||||
onlyWhitespaceAfterEndOfLine,
|
||||
stopAtStopTokens,
|
||||
} from "./filtering/streamTransforms/charStream.js";
|
||||
import {
|
||||
avoidPathLineAndEmptyComments,
|
||||
noTopLevelKeywordsMidline,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { BranchAndDir, Chunk } from "../index.js";
|
||||
import { FullTextSearchCodebaseIndex } from "../indexing/FullTextSearchCodebaseIndex.js";
|
||||
import { BranchAndDir, Chunk } from "../..";
|
||||
import { FullTextSearchCodebaseIndex } from "../../indexing/FullTextSearchCodebaseIndex";
|
||||
|
||||
export async function fullTextRetrieve(
|
||||
prefix: string,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { stopAtStopTokens } from "./streamTransforms/charStream";
|
||||
import { stopAtStopTokens } from "./charStream";
|
||||
|
||||
describe("stopAtStopTokens", () => {
|
||||
async function* createMockStream(chunks: string[]): AsyncGenerator<string> {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { jest } from "@jest/globals";
|
||||
import * as lineStream from "./streamTransforms/lineStream";
|
||||
import * as lineStream from "./lineStream";
|
||||
|
||||
describe("lineStream", () => {
|
||||
let mockFullStop: jest.Mock;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { distance } from "fastest-levenshtein";
|
||||
import { DiffLine } from "../..";
|
||||
import { LineStream } from "../../diff/util";
|
||||
import { DiffLine } from "../../..";
|
||||
import { LineStream } from "../../../diff/util";
|
||||
|
||||
export type LineFilter = (args: {
|
||||
lines: LineStream;
|
||||
|
|
|
|||
|
|
@ -2,10 +2,8 @@ import fs from "node:fs";
|
|||
import path from "node:path";
|
||||
import Mock from "../../../llm/llms/Mock";
|
||||
import { testConfigHandler, testIde } from "../../../test/util/fixtures";
|
||||
import {
|
||||
AutocompleteInput,
|
||||
CompletionProvider,
|
||||
} from "../../CompletionProvider";
|
||||
import { CompletionProvider } from "../../completionProvider";
|
||||
import { AutocompleteInput } from "../../types";
|
||||
|
||||
const FIM_DELIMITER = "<|fim|>";
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import {
|
|||
fixCodeLlamaFirstLineIndentation,
|
||||
stopAtLines,
|
||||
streamWithNewLines,
|
||||
} from "../../autocomplete/streamTransforms/lineStream";
|
||||
} from "../../autocomplete/filtering/streamTransforms/lineStream";
|
||||
import { streamLines } from "../../diff/util";
|
||||
import { stripImages } from "../../llm/images";
|
||||
import {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { v4 as uuidv4 } from "uuid";
|
||||
import type { ContextItemId, IDE, IndexingProgressUpdate } from ".";
|
||||
import { CompletionProvider } from "./autocomplete/CompletionProvider";
|
||||
import { CompletionProvider } from "./autocomplete/completionProvider";
|
||||
import { ConfigHandler } from "./config/ConfigHandler";
|
||||
import {
|
||||
setupBestConfig,
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { ILLM } from "../..";
|
|||
import {
|
||||
filterLeadingNewline,
|
||||
stopAtLines,
|
||||
} from "../../autocomplete/streamTransforms/lineStream";
|
||||
} from "../../autocomplete/filtering/streamTransforms/lineStream";
|
||||
import { streamLines } from "../../diff/util";
|
||||
import { dedent } from "../../util";
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import {
|
|||
filterLeadingAndTrailingNewLineInsertion,
|
||||
filterLeadingNewline,
|
||||
stopAtLines,
|
||||
} from "../../autocomplete/streamTransforms/lineStream";
|
||||
} from "../../autocomplete/filtering/streamTransforms/lineStream.js";
|
||||
import { streamDiff } from "../../diff/streamDiff.js";
|
||||
import { LineStream, streamLines } from "../../diff/util.js";
|
||||
import { DiffLine, ILLM } from "../../index.js";
|
||||
|
|
@ -43,7 +43,7 @@ export async function* streamLazyApply(
|
|||
let lazyCompletionLines = streamLines(lazyCompletion, true);
|
||||
// Process line output
|
||||
// lazyCompletionLines = filterEnglishLinesAtStart(lazyCompletionLines);
|
||||
lazyCompletionLines = stopAtLines(lazyCompletionLines, () => { }, ["```"]);
|
||||
lazyCompletionLines = stopAtLines(lazyCompletionLines, () => {}, ["```"]);
|
||||
lazyCompletionLines = filterLeadingNewline(lazyCompletionLines);
|
||||
|
||||
// Fill in unchanged code
|
||||
|
|
|
|||
|
|
@ -5,15 +5,10 @@ import {
|
|||
filterLeadingAndTrailingNewLineInsertion,
|
||||
skipLines,
|
||||
stopAtLines,
|
||||
} from "../autocomplete/streamTransforms/lineStream.js";
|
||||
} from "../autocomplete/filtering/streamTransforms/lineStream.js";
|
||||
import { streamDiff } from "../diff/streamDiff.js";
|
||||
import { streamLines } from "../diff/util.js";
|
||||
import {
|
||||
ChatMessage,
|
||||
DiffLine,
|
||||
ILLM,
|
||||
LLMFullCompletionOptions,
|
||||
} from "../index.js";
|
||||
import { ChatMessage, DiffLine, ILLM } from "../index.js";
|
||||
import { gptEditPrompt } from "../llm/templates/edit.js";
|
||||
import { Telemetry } from "../util/posthog.js";
|
||||
|
||||
|
|
|
|||
|
|
@ -2,14 +2,14 @@ import { ChatMessage, CompletionOptions, ModelProvider } from "../../index.js";
|
|||
import { BaseLLM } from "../index.js";
|
||||
|
||||
class Mock extends BaseLLM {
|
||||
static Completion = "Test Completion";
|
||||
completion = "Test Completion";
|
||||
static providerName: ModelProvider = "mock";
|
||||
|
||||
protected async *_streamComplete(
|
||||
prompt: string,
|
||||
options: CompletionOptions,
|
||||
): AsyncGenerator<string> {
|
||||
yield Mock.Completion;
|
||||
yield this.completion;
|
||||
}
|
||||
|
||||
protected async *_streamChat(
|
||||
|
|
@ -18,7 +18,7 @@ class Mock extends BaseLLM {
|
|||
): AsyncGenerator<ChatMessage> {
|
||||
yield {
|
||||
role: "assistant",
|
||||
content: Mock.Completion,
|
||||
content: this.completion,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import type {
|
|||
SessionInfo,
|
||||
SiteIndexingConfig,
|
||||
} from "../";
|
||||
import type { AutocompleteInput } from "../autocomplete/CompletionProvider";
|
||||
import { AutocompleteInput } from "../autocomplete/types";
|
||||
import { ProfileDescription } from "../config/ConfigHandler";
|
||||
|
||||
export type ProtocolGeneratorType<T> = AsyncGenerator<{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue