opencode-ufr 0.2.4 → 0.2.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/index.ts +6 -0
package/package.json
CHANGED
package/src/plugin/index.ts
CHANGED
|
@@ -10,6 +10,11 @@ import { toModelInfo } from "./model-info"
|
|
|
10
10
|
|
|
11
11
|
const DAEMON_ENTRY = fileURLToPath(new URL("../daemon/main.ts", import.meta.url))
|
|
12
12
|
|
|
13
|
+
// opencode takes a request's key from the provider's integration (default: the one with the provider's
|
|
14
|
+
// id), and a key credential there replaces settings.apiKey. The /connect credential on "unifreiburg"
|
|
15
|
+
// holds the UFR keys, not the gateway token — so link the provider to an integration with no credential.
|
|
16
|
+
const GATEWAY_INTEGRATION_ID = "opencode-ufr-gateway"
|
|
17
|
+
|
|
13
18
|
function log(msg: string): void {
|
|
14
19
|
console.warn(`[opencode-ufr] ${msg}`)
|
|
15
20
|
}
|
|
@@ -58,6 +63,7 @@ async function registerProvider(
|
|
|
58
63
|
info: {
|
|
59
64
|
id: providerId,
|
|
60
65
|
name: providerName,
|
|
66
|
+
integrationID: GATEWAY_INTEGRATION_ID,
|
|
61
67
|
activation: "enabled",
|
|
62
68
|
package: "@opencode/ai/providers/openai-compatible",
|
|
63
69
|
settings: { baseURL: `http://127.0.0.1:${conn.port}/v1`, apiKey: conn.token },
|