integrated and tested sequence logging with dev data schemas
This commit is contained in:
parent
e387c0ac49
commit
ecca49b34a
4 changed files with 29 additions and 18 deletions
|
|
@ -108,19 +108,22 @@ export const processNextEditData = async ({
|
|||
);
|
||||
}
|
||||
|
||||
void DataLogger.getInstance().logDevData({
|
||||
name: "nextEditWithHistory",
|
||||
data: {
|
||||
previousEdits: filenamesAndDiffs,
|
||||
fileURI: filePath,
|
||||
workspaceDirURI: workspaceDir,
|
||||
beforeContent,
|
||||
afterContent,
|
||||
beforeCursorPos: cursorPosBeforeEdit,
|
||||
afterCursorPos: cursorPosAfterPrevEdit,
|
||||
context: autocompleteContext,
|
||||
},
|
||||
});
|
||||
if (filenamesAndDiffs.length > 0) {
|
||||
// if there are previous edits, log
|
||||
void DataLogger.getInstance().logDevData({
|
||||
name: "nextEditWithHistory",
|
||||
data: {
|
||||
previousEdits: filenamesAndDiffs,
|
||||
fileURI: filePath,
|
||||
workspaceDirURI: workspaceDir,
|
||||
beforeContent,
|
||||
afterContent,
|
||||
beforeCursorPos: cursorPosBeforeEdit,
|
||||
afterCursorPos: cursorPosAfterPrevEdit,
|
||||
context: autocompleteContext,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// add current edit to history
|
||||
const thisEdit: prevEdit = {
|
||||
|
|
|
|||
|
|
@ -33,11 +33,11 @@ import {
|
|||
editOutcomeEventSchema_0_2_0,
|
||||
editOutcomeEventSchema_0_2_0_noCode,
|
||||
} from "./editOutcome/v0.2.0.js";
|
||||
import { nextEditEventAllSchema } from "./nextEdit/index.js";
|
||||
import { nextEditEventAllSchema } from "./nextEditWithHistory/index.js";
|
||||
import {
|
||||
nextEditEventSchema_0_2_0,
|
||||
nextEditEventSchema_0_2_0_noCode,
|
||||
} from "./nextEdit/v0.2.0.js";
|
||||
} from "./nextEditWithHistory/v0.2.0.js";
|
||||
import { quickEditEventAllSchema } from "./quickEdit/index.js";
|
||||
import {
|
||||
quickEditEventSchema_0_1_0,
|
||||
|
|
@ -88,7 +88,7 @@ const devEventAllVersionDataSchemas = z.object({
|
|||
chatInteraction: chatInteractionEventAllSchema,
|
||||
editInteraction: editInteractionEventAllSchema,
|
||||
editOutcome: editOutcomeEventAllSchema,
|
||||
nextEdit: nextEditEventAllSchema,
|
||||
nextEditWithHistory: nextEditEventAllSchema,
|
||||
toolUsage: toolUsageEventAllSchema,
|
||||
});
|
||||
|
||||
|
|
@ -116,7 +116,7 @@ export const devDataVersionedSchemas = {
|
|||
chatInteraction: chatInteractionEventSchema_0_2_0,
|
||||
editInteraction: editInteractionEventSchema_0_2_0,
|
||||
editOutcome: editOutcomeEventSchema_0_2_0,
|
||||
nextEdit: nextEditEventSchema_0_2_0,
|
||||
nextEditWithHistory: nextEditEventSchema_0_2_0,
|
||||
toolUsage: toolUsageEventSchema_0_2_0,
|
||||
},
|
||||
noCode: {
|
||||
|
|
@ -126,7 +126,7 @@ export const devDataVersionedSchemas = {
|
|||
chatInteraction: chatInteractionEventSchema_0_2_0_noCode,
|
||||
editInteraction: editInteractionEventSchema_0_2_0_noCode,
|
||||
editOutcome: editOutcomeEventSchema_0_2_0_noCode,
|
||||
nextEdit: nextEditEventSchema_0_2_0_noCode,
|
||||
nextEditWithHistory: nextEditEventSchema_0_2_0_noCode,
|
||||
toolUsage: toolUsageEventSchema_0_2_0_noCode,
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -2,6 +2,12 @@ import { z } from "zod";
|
|||
import { baseDevDataAllSchema } from "../base.js";
|
||||
|
||||
export const nextEditEventAllSchema = baseDevDataAllSchema.extend({
|
||||
previousEdits: z.array(
|
||||
z.object({
|
||||
filename: z.string(),
|
||||
diff: z.string(),
|
||||
}),
|
||||
),
|
||||
fileURI: z.string(),
|
||||
workspaceDirURI: z.string(),
|
||||
beforeContent: z.string(),
|
||||
|
|
@ -10,6 +10,7 @@ export const nextEditEventSchema_0_2_0 = nextEditEventAllSchema.pick({
|
|||
schema: true,
|
||||
|
||||
// nextedit-specific
|
||||
previousEdits: true,
|
||||
fileURI: true,
|
||||
workspaceDirURI: true,
|
||||
beforeContent: true,
|
||||
|
|
@ -20,6 +21,7 @@ export const nextEditEventSchema_0_2_0 = nextEditEventAllSchema.pick({
|
|||
});
|
||||
|
||||
export const nextEditEventSchema_0_2_0_noCode = nextEditEventSchema_0_2_0.omit({
|
||||
previousEdits: true,
|
||||
fileURI: true,
|
||||
workspaceDirURI: true,
|
||||
beforeContent: true,
|
||||
Loading…
Add table
Reference in a new issue