diff --git a/core/data/schemas.ts b/core/data/schemas.ts index 402d236025..549dd80c46 100644 --- a/core/data/schemas.ts +++ b/core/data/schemas.ts @@ -33,6 +33,7 @@ export const chatDevDataSchema = z.object({ }); export const autocompleteDevDataSchema = z.object({ + // Tab autocomplete options - TODO - old json version? disable: z.boolean(), useFileSuffix: z.boolean(), maxPromptTokens: z.number(), @@ -49,10 +50,27 @@ export const autocompleteDevDataSchema = z.object({ useRecentlyEdited: z.boolean(), disableInFiles: z.array(z.string()).optional(), useImports: z.boolean().optional(), + + // Other + accepted: z.boolean().optional(), + time: z.number(), + prefix: z.string(), + suffix: z.string(), + prompt: z.string(), + completion: z.string(), + modelProvider: z.string(), + modelName: z.string(), + completionOptions: z.unknown(), // Using z.unknown() for `any` type + cacheHit: z.boolean(), + filepath: z.string(), + gitRepo: z.string().optional(), + completionId: z.string(), + uniqueId: z.string(), + timestamp: z.number(), }); export const devDataSchemas = z.object({ - tokens_generated: tokensGeneratedDevDataSchema, + tokensGenerated: tokensGeneratedDevDataSchema, chat: chatDevDataSchema, quickEdit: quickEditDevDataSchema, autocomplete: autocompleteDevDataSchema, @@ -68,3 +86,11 @@ export type DevDataLogEvent = { data: DevDataSchemas[K]; }; }[DevDataSchemaName]; + +// This is because of tokens_generated snake case file name +export const localDevDataFileNamesMap: Record = { + tokensGenerated: "tokens_generated", + chat: "chat", + quickEdit: "quickEdit", + autocomplete: "autocomplete", +}; diff --git a/core/llm/index.ts b/core/llm/index.ts index f928b93d4f..1de67058f3 100644 --- a/core/llm/index.ts +++ b/core/llm/index.ts @@ -340,7 +340,7 @@ export abstract class BaseLLM implements ILLM { ); void DataLogger.getInstance().logDevData({ - schema: "tokens_generated", + schema: "tokensGenerated", data: { model: model, provider: this.providerName, diff --git a/core/package.json b/core/package.json index 10ac6e4ad7..477290c9bc 100644 --- a/core/package.json +++ b/core/package.json @@ -46,7 +46,7 @@ "@aws-sdk/client-sagemaker-runtime": "^3.621.0", "@aws-sdk/credential-providers": "^3.620.1", "@continuedev/config-types": "^1.0.13", - "@continuedev/config-yaml": "file:///Users/dallin/Documents/code/continuedev/continue/packages/config-yaml/dist", + "@continuedev/config-yaml": "^1.0.16", "@continuedev/fetch": "^1.0.4", "@continuedev/llm-info": "^1.0.2", "@continuedev/openai-adapters": "^1.0.10", diff --git a/core/util/paths.ts b/core/util/paths.ts index 836bc84b93..1f147419b9 100644 --- a/core/util/paths.ts +++ b/core/util/paths.ts @@ -8,6 +8,7 @@ import dotenv from "dotenv"; import { IdeType, SerializedContinueConfig } from "../"; import { defaultConfig, defaultConfigJetBrains } from "../config/default"; import Types from "../config/types"; +import { DevDataSchemaName, localDevDataFileNamesMap } from "../data/schemas"; dotenv.config(); @@ -210,8 +211,8 @@ export function getDevDataSqlitePath(): string { return path.join(devDataPath(), "devdata.sqlite"); } -export function getDevDataFilePath(fileName: string): string { - return path.join(devDataPath(), `${fileName}.jsonl`); +export function getDevDataFilePath(schema: DevDataSchemaName): string { + return path.join(devDataPath(), `${localDevDataFileNamesMap[schema]}.jsonl`); } export function editConfigJson( @@ -374,11 +375,11 @@ export function getEsbuildBinaryPath(): string { } export function setupInitialDotContinueDirectory() { - const devDataTypes = [ + const devDataTypes: DevDataSchemaName[] = [ "chat", "autocomplete", "quickEdit", - "tokens_generated", + "tokensGenerated", ]; devDataTypes.forEach((p) => { const devDataPath = getDevDataFilePath(p); diff --git a/extensions/vscode/src/quickEdit/QuickEditQuickPick.ts b/extensions/vscode/src/quickEdit/QuickEditQuickPick.ts index eb42fbe1ff..cd6a6553a2 100644 --- a/extensions/vscode/src/quickEdit/QuickEditQuickPick.ts +++ b/extensions/vscode/src/quickEdit/QuickEditQuickPick.ts @@ -227,8 +227,7 @@ export class QuickEdit { } let model = await this.getCurModelTitle(); - const logger = DataLogger.getInstance(); - void logger.logDevData({ + void DataLogger.getInstance().logDevData({ schema: "quickEdit", data: { prompt,