mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-09-24 16:02:55 +08:00
refactor: remove timezone from editor context prompt options
This commit is contained in:
@@ -2334,15 +2334,11 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper
|
||||
// Shell
|
||||
const shell = vscode.env.shell || undefined
|
||||
|
||||
// Timezone
|
||||
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone || undefined
|
||||
|
||||
return {
|
||||
...(visibleFiles.length > 0 ? { visibleFiles } : {}),
|
||||
...(openTabs.length > 0 ? { openTabs } : {}),
|
||||
...(activeFile ? { activeFile } : {}),
|
||||
...(shell ? { shell } : {}),
|
||||
...(timezone ? { timezone } : {}),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -113,6 +113,4 @@ export interface EditorContext {
|
||||
activeFile?: string
|
||||
/** User's default shell (from vscode.env.shell) */
|
||||
shell?: string
|
||||
/** User's timezone (e.g. "Europe/Amsterdam") */
|
||||
timezone?: string
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ export interface EditorContext {
|
||||
openTabs?: string[]
|
||||
activeFile?: string
|
||||
shell?: string
|
||||
timezone?: string
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -12,15 +11,7 @@ export interface EditorContext {
|
||||
* so they benefit from prompt caching.
|
||||
*/
|
||||
export function staticEnvLines(ctx?: EditorContext): string[] {
|
||||
const now = new Date()
|
||||
const lines = [` Today's date: ${now.toDateString()}`]
|
||||
if (ctx?.timezone) {
|
||||
const offset = -now.getTimezoneOffset()
|
||||
const sign = offset >= 0 ? "+" : "-"
|
||||
const hours = Math.floor(Math.abs(offset) / 60)
|
||||
const mins = Math.abs(offset) % 60
|
||||
lines.push(` User timezone: ${ctx.timezone}, UTC${sign}${hours}:${mins.toString().padStart(2, "0")}`)
|
||||
}
|
||||
const lines = [` Today's date: ${new Date().toDateString()}`]
|
||||
if (ctx?.shell) {
|
||||
lines.push(` Default shell: ${ctx.shell}`)
|
||||
}
|
||||
|
||||
@@ -375,7 +375,6 @@ export namespace MessageV2 {
|
||||
openTabs: z.array(z.string()).optional(),
|
||||
activeFile: z.string().optional(),
|
||||
shell: z.string().optional(),
|
||||
timezone: z.string().optional(),
|
||||
})
|
||||
.optional(),
|
||||
// kilocode_change end
|
||||
|
||||
@@ -131,7 +131,6 @@ export namespace SessionPrompt {
|
||||
openTabs: z.array(z.string()).optional(),
|
||||
activeFile: z.string().optional(),
|
||||
shell: z.string().optional(),
|
||||
timezone: z.string().optional(),
|
||||
})
|
||||
.optional(),
|
||||
// kilocode_change end
|
||||
|
||||
@@ -1943,7 +1943,6 @@ export class Session2 extends HeyApiClient {
|
||||
openTabs?: Array<string>
|
||||
activeFile?: string
|
||||
shell?: string
|
||||
timezone?: string
|
||||
}
|
||||
parts?: Array<TextPartInput | FilePartInput | AgentPartInput | SubtaskPartInput>
|
||||
},
|
||||
@@ -2083,7 +2082,6 @@ export class Session2 extends HeyApiClient {
|
||||
openTabs?: Array<string>
|
||||
activeFile?: string
|
||||
shell?: string
|
||||
timezone?: string
|
||||
}
|
||||
parts?: Array<TextPartInput | FilePartInput | AgentPartInput | SubtaskPartInput>
|
||||
},
|
||||
|
||||
@@ -143,7 +143,6 @@ export type UserMessage = {
|
||||
openTabs?: Array<string>
|
||||
activeFile?: string
|
||||
shell?: string
|
||||
timezone?: string
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3428,7 +3427,6 @@ export type SessionPromptData = {
|
||||
openTabs?: Array<string>
|
||||
activeFile?: string
|
||||
shell?: string
|
||||
timezone?: string
|
||||
}
|
||||
parts: Array<TextPartInput | FilePartInput | AgentPartInput | SubtaskPartInput>
|
||||
}
|
||||
@@ -3668,7 +3666,6 @@ export type SessionPromptAsyncData = {
|
||||
openTabs?: Array<string>
|
||||
activeFile?: string
|
||||
shell?: string
|
||||
timezone?: string
|
||||
}
|
||||
parts: Array<TextPartInput | FilePartInput | AgentPartInput | SubtaskPartInput>
|
||||
}
|
||||
|
||||
@@ -3186,9 +3186,6 @@
|
||||
},
|
||||
"shell": {
|
||||
"type": "string"
|
||||
},
|
||||
"timezone": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -3696,9 +3693,6 @@
|
||||
},
|
||||
"shell": {
|
||||
"type": "string"
|
||||
},
|
||||
"timezone": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -8581,9 +8575,6 @@
|
||||
},
|
||||
"shell": {
|
||||
"type": "string"
|
||||
},
|
||||
"timezone": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12027,6 +12018,10 @@
|
||||
"description": "Enable the batch tool",
|
||||
"type": "boolean"
|
||||
},
|
||||
"codebase_search": {
|
||||
"description": "Enable AI-powered codebase search",
|
||||
"type": "boolean"
|
||||
},
|
||||
"openTelemetry": {
|
||||
"description": "Enable telemetry. Set to false to opt-out.",
|
||||
"default": true,
|
||||
|
||||
Reference in New Issue
Block a user