opencode-claude-code-wrapper 0.0.3 → 0.0.4
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/index.mjs +8 -10
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -268,8 +268,14 @@ export async function ClaudeCodeWrapperPlugin({ client }) {
|
|
|
268
268
|
const auth = await getAuth();
|
|
269
269
|
|
|
270
270
|
// Claude Code CLI auth - zero cost, use CLI
|
|
271
|
-
// Detected by special key value
|
|
272
|
-
|
|
271
|
+
// Detected by special key value: user enters "cli" or "claude-code" as API key
|
|
272
|
+
const isClaudeCodeCLI =
|
|
273
|
+
auth.type === "api" &&
|
|
274
|
+
(auth.key === "claude-code-cli" ||
|
|
275
|
+
auth.key === "cli" ||
|
|
276
|
+
auth.key === "claude-code" ||
|
|
277
|
+
auth.key === "cc");
|
|
278
|
+
if (isClaudeCodeCLI) {
|
|
273
279
|
for (const model of Object.values(provider.models)) {
|
|
274
280
|
model.cost = {
|
|
275
281
|
input: 0,
|
|
@@ -477,14 +483,6 @@ export async function ClaudeCodeWrapperPlugin({ client }) {
|
|
|
477
483
|
return {};
|
|
478
484
|
},
|
|
479
485
|
methods: [
|
|
480
|
-
{
|
|
481
|
-
label: "Claude Code CLI",
|
|
482
|
-
type: "api",
|
|
483
|
-
authorize: async () => {
|
|
484
|
-
// Return immediately with special key marker
|
|
485
|
-
return { type: "success", key: "claude-code-cli" };
|
|
486
|
-
},
|
|
487
|
-
},
|
|
488
486
|
{
|
|
489
487
|
label: "Claude Pro/Max",
|
|
490
488
|
type: "oauth",
|