Elffuss BraidHub

kikocis/continue public

integrated and tested sequence logging with dev data schemas
Changeset5aed8ce6ba7eecce7f8ce7f3641097d87e403db20504b754c8dba28981dd2c2f
Authoradarshramiyer <adarsh.r.iyer@gmail.com> · 2025-07-03 17:59 -07:00
Committeradarshramiyer <adarsh.r.iyer@gmail.com> · 2025-07-03 17:59 -07:00
Parents772a6be82c3a

Browse the files at this changeset

6 files changed

modified core/nextEdit/context/processNextEditData.ts +16 −13
@@ -108,19 +108,22 @@
108108 );
109109 }
110110
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+ }
124127
125128 // add current edit to history
126129 const thisEdit: prevEdit = {
modified packages/config-yaml/src/schemas/data/index.ts +5 −5
@@ -33,11 +33,11 @@
3333 editOutcomeEventSchema_0_2_0,
3434 editOutcomeEventSchema_0_2_0_noCode,
3535 } from "./editOutcome/v0.2.0.js";
36-import { nextEditEventAllSchema } from "./nextEdit/index.js";
36+import { nextEditEventAllSchema } from "./nextEditWithHistory/index.js";
3737 import {
3838 nextEditEventSchema_0_2_0,
3939 nextEditEventSchema_0_2_0_noCode,
40-} from "./nextEdit/v0.2.0.js";
40+} from "./nextEditWithHistory/v0.2.0.js";
4141 import { quickEditEventAllSchema } from "./quickEdit/index.js";
4242 import {
4343 quickEditEventSchema_0_1_0,
@@ -88,7 +88,7 @@
8888 chatInteraction: chatInteractionEventAllSchema,
8989 editInteraction: editInteractionEventAllSchema,
9090 editOutcome: editOutcomeEventAllSchema,
91- nextEdit: nextEditEventAllSchema,
91+ nextEditWithHistory: nextEditEventAllSchema,
9292 toolUsage: toolUsageEventAllSchema,
9393 });
9494
@@ -116,7 +116,7 @@
116116 chatInteraction: chatInteractionEventSchema_0_2_0,
117117 editInteraction: editInteractionEventSchema_0_2_0,
118118 editOutcome: editOutcomeEventSchema_0_2_0,
119- nextEdit: nextEditEventSchema_0_2_0,
119+ nextEditWithHistory: nextEditEventSchema_0_2_0,
120120 toolUsage: toolUsageEventSchema_0_2_0,
121121 },
122122 noCode: {
@@ -126,7 +126,7 @@
126126 chatInteraction: chatInteractionEventSchema_0_2_0_noCode,
127127 editInteraction: editInteractionEventSchema_0_2_0_noCode,
128128 editOutcome: editOutcomeEventSchema_0_2_0_noCode,
129- nextEdit: nextEditEventSchema_0_2_0_noCode,
129+ nextEditWithHistory: nextEditEventSchema_0_2_0_noCode,
130130 toolUsage: toolUsageEventSchema_0_2_0_noCode,
131131 },
132132 },
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+});