Changesets · Branches · Tags · Compare
| Changeset | 5aed8ce6ba7eecce7f8ce7f3641097d87e403db20504b754c8dba28981dd2c2f |
|---|---|
| Author | adarshramiyer <adarsh.r.iyer@gmail.com> · 2025-07-03 17:59 -07:00 |
| Committer | adarshramiyer <adarsh.r.iyer@gmail.com> · 2025-07-03 17:59 -07:00 |
| Parents | 772a6be82c3a |
6 files changed
modified core/nextEdit/context/processNextEditData.ts +16 −13
| @@ -108,19 +108,22 @@ | ||
| 108 | 108 | ); |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | - void DataLogger.getInstance().logDevData({ | |
| 112 | - name: "nextEditWithHistory", | |
| 113 | - data: { | |
| 114 | - previousEdits: filenamesAndDiffs, | |
| 115 | - fileURI: filePath, | |
| 116 | - workspaceDirURI: workspaceDir, | |
| 117 | - beforeContent, | |
| 118 | - afterContent, | |
| 119 | - beforeCursorPos: cursorPosBeforeEdit, | |
| 120 | - afterCursorPos: cursorPosAfterPrevEdit, | |
| 121 | - context: autocompleteContext, | |
| 122 | - }, | |
| 123 | - }); | |
| 111 | + if (filenamesAndDiffs.length > 0) { | |
| 112 | + // if there are previous edits, log | |
| 113 | + void DataLogger.getInstance().logDevData({ | |
| 114 | + name: "nextEditWithHistory", | |
| 115 | + data: { | |
| 116 | + previousEdits: filenamesAndDiffs, | |
| 117 | + fileURI: filePath, | |
| 118 | + workspaceDirURI: workspaceDir, | |
| 119 | + beforeContent, | |
| 120 | + afterContent, | |
| 121 | + beforeCursorPos: cursorPosBeforeEdit, | |
| 122 | + afterCursorPos: cursorPosAfterPrevEdit, | |
| 123 | + context: autocompleteContext, | |
| 124 | + }, | |
| 125 | + }); | |
| 126 | + } | |
| 124 | 127 | |
| 125 | 128 | // add current edit to history |
| 126 | 129 | const thisEdit: prevEdit = { |
modified packages/config-yaml/src/schemas/data/index.ts +5 −5
| @@ -33,11 +33,11 @@ | ||
| 33 | 33 | editOutcomeEventSchema_0_2_0, |
| 34 | 34 | editOutcomeEventSchema_0_2_0_noCode, |
| 35 | 35 | } from "./editOutcome/v0.2.0.js"; |
| 36 | -import { nextEditEventAllSchema } from "./nextEdit/index.js"; | |
| 36 | +import { nextEditEventAllSchema } from "./nextEditWithHistory/index.js"; | |
| 37 | 37 | import { |
| 38 | 38 | nextEditEventSchema_0_2_0, |
| 39 | 39 | nextEditEventSchema_0_2_0_noCode, |
| 40 | -} from "./nextEdit/v0.2.0.js"; | |
| 40 | +} from "./nextEditWithHistory/v0.2.0.js"; | |
| 41 | 41 | import { quickEditEventAllSchema } from "./quickEdit/index.js"; |
| 42 | 42 | import { |
| 43 | 43 | quickEditEventSchema_0_1_0, |
| @@ -88,7 +88,7 @@ | ||
| 88 | 88 | chatInteraction: chatInteractionEventAllSchema, |
| 89 | 89 | editInteraction: editInteractionEventAllSchema, |
| 90 | 90 | editOutcome: editOutcomeEventAllSchema, |
| 91 | - nextEdit: nextEditEventAllSchema, | |
| 91 | + nextEditWithHistory: nextEditEventAllSchema, | |
| 92 | 92 | toolUsage: toolUsageEventAllSchema, |
| 93 | 93 | }); |
| 94 | 94 | |
| @@ -116,7 +116,7 @@ | ||
| 116 | 116 | chatInteraction: chatInteractionEventSchema_0_2_0, |
| 117 | 117 | editInteraction: editInteractionEventSchema_0_2_0, |
| 118 | 118 | editOutcome: editOutcomeEventSchema_0_2_0, |
| 119 | - nextEdit: nextEditEventSchema_0_2_0, | |
| 119 | + nextEditWithHistory: nextEditEventSchema_0_2_0, | |
| 120 | 120 | toolUsage: toolUsageEventSchema_0_2_0, |
| 121 | 121 | }, |
| 122 | 122 | noCode: { |
| @@ -126,7 +126,7 @@ | ||
| 126 | 126 | chatInteraction: chatInteractionEventSchema_0_2_0_noCode, |
| 127 | 127 | editInteraction: editInteractionEventSchema_0_2_0_noCode, |
| 128 | 128 | editOutcome: editOutcomeEventSchema_0_2_0_noCode, |
| 129 | - nextEdit: nextEditEventSchema_0_2_0_noCode, | |
| 129 | + nextEditWithHistory: nextEditEventSchema_0_2_0_noCode, | |
| 130 | 130 | toolUsage: toolUsageEventSchema_0_2_0_noCode, |
| 131 | 131 | }, |
| 132 | 132 | }, |
deleted packages/config-yaml/src/schemas/data/nextEdit/index.ts +0 −12
| @@ -1,12 +0,0 @@ | ||
| 1 | -import { z } from "zod"; | |
| 2 | -import { baseDevDataAllSchema } from "../base.js"; | |
| 3 | - | |
| 4 | -export const nextEditEventAllSchema = baseDevDataAllSchema.extend({ | |
| 5 | - fileURI: z.string(), | |
| 6 | - workspaceDirURI: z.string(), | |
| 7 | - beforeContent: z.string(), | |
| 8 | - afterContent: z.string(), | |
| 9 | - beforeCursorPos: z.object({ line: z.number(), character: z.number() }), | |
| 10 | - afterCursorPos: z.object({ line: z.number(), character: z.number() }), | |
| 11 | - context: z.string(), | |
| 12 | -}); |
deleted packages/config-yaml/src/schemas/data/nextEdit/v0.2.0.ts +0 −28
| @@ -1,28 +0,0 @@ | ||
| 1 | -import { nextEditEventAllSchema } from "./index.js"; | |
| 2 | - | |
| 3 | -export const nextEditEventSchema_0_2_0 = nextEditEventAllSchema.pick({ | |
| 4 | - // base | |
| 5 | - timestamp: true, | |
| 6 | - userId: true, | |
| 7 | - userAgent: true, | |
| 8 | - selectedProfileId: true, | |
| 9 | - eventName: true, | |
| 10 | - schema: true, | |
| 11 | - | |
| 12 | - // nextedit-specific | |
| 13 | - fileURI: true, | |
| 14 | - workspaceDirURI: true, | |
| 15 | - beforeContent: true, | |
| 16 | - afterContent: true, | |
| 17 | - beforeCursorPos: true, | |
| 18 | - afterCursorPos: true, | |
| 19 | - context: true, | |
| 20 | -}); | |
| 21 | - | |
| 22 | -export const nextEditEventSchema_0_2_0_noCode = nextEditEventSchema_0_2_0.omit({ | |
| 23 | - fileURI: true, | |
| 24 | - workspaceDirURI: true, | |
| 25 | - beforeContent: true, | |
| 26 | - afterContent: true, | |
| 27 | - context: true, | |
| 28 | -}); |
added packages/config-yaml/src/schemas/data/nextEditWithHistory/index.ts +18 −0
| @@ -0,0 +1,18 @@ | ||
| 1 | +import { z } from "zod"; | |
| 2 | +import { baseDevDataAllSchema } from "../base.js"; | |
| 3 | + | |
| 4 | +export const nextEditEventAllSchema = baseDevDataAllSchema.extend({ | |
| 5 | + previousEdits: z.array( | |
| 6 | + z.object({ | |
| 7 | + filename: z.string(), | |
| 8 | + diff: z.string(), | |
| 9 | + }), | |
| 10 | + ), | |
| 11 | + fileURI: z.string(), | |
| 12 | + workspaceDirURI: z.string(), | |
| 13 | + beforeContent: z.string(), | |
| 14 | + afterContent: z.string(), | |
| 15 | + beforeCursorPos: z.object({ line: z.number(), character: z.number() }), | |
| 16 | + afterCursorPos: z.object({ line: z.number(), character: z.number() }), | |
| 17 | + context: z.string(), | |
| 18 | +}); |
added packages/config-yaml/src/schemas/data/nextEditWithHistory/v0.2.0.ts +30 −0
| @@ -0,0 +1,30 @@ | ||
| 1 | +import { nextEditEventAllSchema } from "./index.js"; | |
| 2 | + | |
| 3 | +export const nextEditEventSchema_0_2_0 = nextEditEventAllSchema.pick({ | |
| 4 | + // base | |
| 5 | + timestamp: true, | |
| 6 | + userId: true, | |
| 7 | + userAgent: true, | |
| 8 | + selectedProfileId: true, | |
| 9 | + eventName: true, | |
| 10 | + schema: true, | |
| 11 | + | |
| 12 | + // nextedit-specific | |
| 13 | + previousEdits: true, | |
| 14 | + fileURI: true, | |
| 15 | + workspaceDirURI: true, | |
| 16 | + beforeContent: true, | |
| 17 | + afterContent: true, | |
| 18 | + beforeCursorPos: true, | |
| 19 | + afterCursorPos: true, | |
| 20 | + context: true, | |
| 21 | +}); | |
| 22 | + | |
| 23 | +export const nextEditEventSchema_0_2_0_noCode = nextEditEventSchema_0_2_0.omit({ | |
| 24 | + previousEdits: true, | |
| 25 | + fileURI: true, | |
| 26 | + workspaceDirURI: true, | |
| 27 | + beforeContent: true, | |
| 28 | + afterContent: true, | |
| 29 | + context: true, | |
| 30 | +}); |