MCPcopy Index your code
hub / github.com/continuedev/continue / addBaseValues

Method addBaseValues

core/data/log.ts:36–69  ·  view source on GitHub ↗
(
    body: Record<string, any>,
    eventName: string,
    schema: string,
    zodSchema: AnyZodObject,
  )

Source from the content-addressed store, hash-verified

34 }
35
36 async addBaseValues(
37 body: Record<string, any>,
38 eventName: string,
39 schema: string,
40 zodSchema: AnyZodObject,
41 ): Promise<Record<string, any>> {
42 const newBody = { ...body };
43 const ideSettings = await this.ideSettingsPromise;
44 const ideInfo = await this.ideInfoPromise;
45
46 if ("eventName" in zodSchema.shape) {
47 newBody.eventName = eventName;
48 }
49 if (!newBody.timestamp && "timestamp" in zodSchema.shape) {
50 newBody.timestamp = new Date().toISOString();
51 }
52 if ("schema" in zodSchema.shape) {
53 newBody.schema = schema;
54 }
55 if ("userAgent" in zodSchema.shape) {
56 newBody.userAgent = ideInfo
57 ? `${ideInfo.name}/${ideInfo.version} (Continue/${ideInfo.extensionVersion})`
58 : "Unknown/Unknown (Continue/Unknown)";
59 }
60 if ("selectedProfileId" in zodSchema.shape) {
61 newBody.selectedProfileId =
62 this.core?.configHandler.currentProfile?.profileDescription.id ?? "";
63 }
64 if ("userId" in zodSchema.shape) {
65 newBody.userId = ideSettings?.userToken ?? "";
66 }
67
68 return newBody;
69 }
70
71 async logLocalData(event: DevDataLogEvent) {
72 try {

Callers 3

logLocalDataMethod · 0.95
parseEventDataMethod · 0.95
log.vitest.tsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected