opencode-kilocode-auth 1.0.3 → 1.0.5
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 +5 -4
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.5",
|
|
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
|
@@ -17,7 +17,7 @@ interface KilocodeAuth {
|
|
|
17
17
|
expires?: number
|
|
18
18
|
organizationId?: string
|
|
19
19
|
model?: string
|
|
20
|
-
|
|
20
|
+
key?: string // for api type (OpenCode uses "key" field)
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
/**
|
|
@@ -40,7 +40,7 @@ export async function KilocodeAuthPlugin(input: PluginInput): Promise<Hooks> {
|
|
|
40
40
|
const kilocodeAuth = auth as KilocodeAuth
|
|
41
41
|
// Support both OAuth (refresh token) and API key authentication
|
|
42
42
|
const token = kilocodeAuth.type === "api"
|
|
43
|
-
? kilocodeAuth.
|
|
43
|
+
? kilocodeAuth.key
|
|
44
44
|
: kilocodeAuth.refresh
|
|
45
45
|
|
|
46
46
|
if (!token) return {}
|
|
@@ -101,10 +101,11 @@ export async function KilocodeAuthPlugin(input: PluginInput): Promise<Hooks> {
|
|
|
101
101
|
|
|
102
102
|
// Set Kilo Code authorization and required headers
|
|
103
103
|
headers.set("Authorization", `Bearer ${currentToken}`)
|
|
104
|
+
headers.set("x-api-key", currentToken) // Kilo Code uses both
|
|
104
105
|
headers.set("HTTP-Referer", "https://kilocode.ai")
|
|
105
106
|
headers.set("X-Title", "Kilo Code")
|
|
106
|
-
headers.set("X-KiloCode-Version", "
|
|
107
|
-
headers.set("User-Agent", "Kilo-Code/
|
|
107
|
+
headers.set("X-KiloCode-Version", "4.151.0")
|
|
108
|
+
headers.set("User-Agent", "Kilo-Code/4.151.0")
|
|
108
109
|
headers.set("X-KiloCode-EditorName", "Visual Studio Code 1.96.0")
|
|
109
110
|
|
|
110
111
|
// Add organization header if present
|