mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-09-24 16:02:55 +08:00
chore: add kilocode_change markers to shared opencode files
Mark editorContext additions in message-v2.ts, prompt.ts, and system.ts with kilocode_change markers to ease upstream merge conflict resolution.
This commit is contained in:
@@ -359,6 +359,7 @@ export namespace MessageV2 {
|
||||
system: z.string().optional(),
|
||||
tools: z.record(z.string(), z.boolean()).optional(),
|
||||
variant: z.string().optional(),
|
||||
// kilocode_change start
|
||||
editorContext: z
|
||||
.object({
|
||||
visibleFiles: z.array(z.string()).optional(),
|
||||
@@ -368,6 +369,7 @@ export namespace MessageV2 {
|
||||
timezone: z.string().optional(),
|
||||
})
|
||||
.optional(),
|
||||
// kilocode_change end
|
||||
}).meta({
|
||||
ref: "UserMessage",
|
||||
})
|
||||
|
||||
@@ -109,6 +109,7 @@ export namespace SessionPrompt {
|
||||
format: MessageV2.Format.optional(),
|
||||
system: z.string().optional(),
|
||||
variant: z.string().optional(),
|
||||
// kilocode_change start
|
||||
editorContext: z
|
||||
.object({
|
||||
visibleFiles: z.array(z.string()).optional(),
|
||||
@@ -118,6 +119,7 @@ export namespace SessionPrompt {
|
||||
timezone: z.string().optional(),
|
||||
})
|
||||
.optional(),
|
||||
// kilocode_change end
|
||||
parts: z.array(
|
||||
z.discriminatedUnion("type", [
|
||||
MessageV2.TextPart.omit({
|
||||
@@ -676,7 +678,7 @@ export namespace SessionPrompt {
|
||||
await Plugin.trigger("experimental.chat.messages.transform", {}, { messages: sessionMessages })
|
||||
|
||||
// Build system prompt, adding structured output instruction if needed
|
||||
const system = [...(await SystemPrompt.environment(model, lastUser.editorContext)), ...(await InstructionPrompt.system())]
|
||||
const system = [...(await SystemPrompt.environment(model, lastUser.editorContext)), ...(await InstructionPrompt.system())] // kilocode_change
|
||||
const format = lastUser.format ?? { type: "text" }
|
||||
if (format.type === "json_schema") {
|
||||
system.push(STRUCTURED_OUTPUT_SYSTEM_PROMPT)
|
||||
@@ -1003,7 +1005,7 @@ export namespace SessionPrompt {
|
||||
system: input.system,
|
||||
format: input.format,
|
||||
variant,
|
||||
editorContext: input.editorContext,
|
||||
editorContext: input.editorContext, // kilocode_change
|
||||
}
|
||||
using _ = defer(() => InstructionPrompt.clear(info.id))
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@ export namespace SystemPrompt {
|
||||
}
|
||||
// kilocode_change end
|
||||
|
||||
// kilocode_change start
|
||||
export async function environment(
|
||||
model: Provider.Model,
|
||||
editorContext?: {
|
||||
@@ -66,7 +67,7 @@ export namespace SystemPrompt {
|
||||
` Working directory: ${Instance.directory}`,
|
||||
` Is directory a git repo: ${project.vcs === "git" ? "yes" : "no"}`,
|
||||
` Platform: ${process.platform}`,
|
||||
...formatTime(editorContext?.timezone), // kilocode_change
|
||||
...formatTime(editorContext?.timezone),
|
||||
]
|
||||
if (editorContext?.shell) {
|
||||
envLines.push(` Default shell: ${editorContext.shell}`)
|
||||
@@ -80,6 +81,7 @@ export namespace SystemPrompt {
|
||||
if (editorContext?.openTabs?.length) {
|
||||
envLines.push(` Open tabs: ${editorContext.openTabs.join(", ")}`)
|
||||
}
|
||||
// kilocode_change end
|
||||
return [
|
||||
[
|
||||
`You are powered by the model named ${model.api.id}. The exact model ID is ${model.providerID}/${model.api.id}`,
|
||||
|
||||
Reference in New Issue
Block a user