From b9d556ff1b0834a8249a09c590294f4bb2754dcd Mon Sep 17 00:00:00 2001 From: musi Date: Mon, 21 Jul 2025 16:48:30 +0800 Subject: [PATCH] add release command --- package.json | 7 ++++--- src/utils/router.ts | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 1249db4..722c29a 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,13 @@ { "name": "@musistudio/claude-code-router", - "version": "1.0.24", + "version": "1.0.25", "description": "Use Claude Code without an Anthropics account and route it to another LLM provider", "bin": { "ccr": "./dist/cli.js" }, "scripts": { - "build": "esbuild src/cli.ts --bundle --platform=node --outfile=dist/cli.js && shx cp node_modules/tiktoken/tiktoken_bg.wasm dist/tiktoken_bg.wasm" + "build": "esbuild src/cli.ts --bundle --platform=node --outfile=dist/cli.js && shx cp node_modules/tiktoken/tiktoken_bg.wasm dist/tiktoken_bg.wasm", + "release": "npm run build && npm publish" }, "keywords": [ "claude", @@ -37,4 +38,4 @@ "screenshots/" ] } -} +} \ No newline at end of file diff --git a/src/utils/router.ts b/src/utils/router.ts index 251b4ae..00098d6 100644 --- a/src/utils/router.ts +++ b/src/utils/router.ts @@ -64,7 +64,7 @@ const calculateTokenCount = ( return tokenCount; }; -const getUseModel = (req: any, tokenCount: number, config: any) => { +const getUseModel = async (req: any, tokenCount: number, config: any) => { if (req.body.model.includes(",")) { return req.body.model; } @@ -115,7 +115,7 @@ export const router = async (req: any, _res: any, config: any) => { } } if (!model) { - model = getUseModel(req, tokenCount, config); + model = await getUseModel(req, tokenCount, config); } req.body.model = model; } catch (error: any) {