opencode-kilocode-auth 1.0.10 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/plugin.ts +42 -5
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-kilocode-auth",
|
|
3
3
|
"module": "index.ts",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.12",
|
|
5
5
|
"author": "ported from Kilo Code",
|
|
6
6
|
"description": "OpenCode plugin for Kilo Code authentication with support for various models including Giga Potato",
|
|
7
7
|
"files": [
|
package/src/plugin.ts
CHANGED
|
@@ -222,16 +222,53 @@ export async function KilocodeAuthPlugin(input: PluginInput): Promise<Hooks> {
|
|
|
222
222
|
}
|
|
223
223
|
|
|
224
224
|
if (payload.messages && Array.isArray(payload.messages)) {
|
|
225
|
-
// Find system message and prepend Kilo Code
|
|
225
|
+
// Find system message and prepend Kilo Code system prompt
|
|
226
226
|
const systemIdx = payload.messages.findIndex((m: any) => m.role === "system")
|
|
227
|
-
|
|
227
|
+
|
|
228
|
+
// EXACT Kilo Code system prompt structure (without tool definitions - OpenCode handles those)
|
|
229
|
+
const kiloCodeSystemPrompt = `You are Kilo Code, a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.
|
|
230
|
+
|
|
231
|
+
====
|
|
232
|
+
|
|
233
|
+
MARKDOWN RULES
|
|
234
|
+
|
|
235
|
+
ALL responses MUST show ANY \`language construct\` OR filename reference as clickable, exactly as [\`filename OR language.declaration()\`](relative/file/path.ext:line); line is required for \`syntax\` and optional for filename links. This applies to ALL markdown responses.
|
|
236
|
+
|
|
237
|
+
====
|
|
238
|
+
|
|
239
|
+
SYSTEM INFORMATION
|
|
240
|
+
|
|
241
|
+
Operating System: ${process.platform === 'win32' ? 'Windows' : process.platform === 'darwin' ? 'MacOS' : 'Linux'}
|
|
242
|
+
Default Shell: ${process.env.SHELL || process.env.COMSPEC || '/bin/bash'}
|
|
243
|
+
Home Directory: ${process.env.HOME || process.env.USERPROFILE || '~'}
|
|
244
|
+
|
|
245
|
+
====
|
|
246
|
+
|
|
247
|
+
OBJECTIVE
|
|
248
|
+
|
|
249
|
+
You accomplish a given task iteratively, breaking it down into clear steps and working through them methodically.
|
|
250
|
+
|
|
251
|
+
1. Analyze the user's task and set clear, achievable goals to accomplish it. Prioritize these goals in a logical order.
|
|
252
|
+
2. Work through these goals sequentially, utilizing available tools one at a time as necessary. Each goal should correspond to a distinct step in your problem-solving process. You will be informed on the work completed and what's remaining as you go.
|
|
253
|
+
3. Once you've completed the user's task, present the result of the task to the user.
|
|
254
|
+
4. The user may provide feedback, which you can use to make improvements and try again. But DO NOT continue in pointless back and forth conversations, i.e. don't end your responses with questions or offers for further assistance.
|
|
255
|
+
|
|
256
|
+
====
|
|
257
|
+
|
|
258
|
+
RULES
|
|
259
|
+
|
|
260
|
+
- Be concise, direct, and to the point.
|
|
261
|
+
- Output text to communicate with the user; all text you output outside of tool use is displayed to the user.
|
|
262
|
+
- Only use emojis if the user explicitly requests it.
|
|
263
|
+
- When making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.
|
|
264
|
+
- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library.`
|
|
228
265
|
|
|
229
266
|
if (systemIdx >= 0) {
|
|
230
|
-
// Prepend Kilo Code
|
|
231
|
-
payload.messages[systemIdx].content =
|
|
267
|
+
// Prepend Kilo Code prompt to existing system message
|
|
268
|
+
payload.messages[systemIdx].content = kiloCodeSystemPrompt + "\n\n====\n\nADDITIONAL INSTRUCTIONS\n\n" + payload.messages[systemIdx].content
|
|
232
269
|
} else {
|
|
233
270
|
// Add system message at the beginning
|
|
234
|
-
payload.messages.unshift({ role: "system", content:
|
|
271
|
+
payload.messages.unshift({ role: "system", content: kiloCodeSystemPrompt })
|
|
235
272
|
}
|
|
236
273
|
}
|
|
237
274
|
|