@musistudio/claude-code-router 1.0.11 → 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.
Files changed (3) hide show
  1. package/README.md +4 -3
  2. package/dist/cli.js +23 -23
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -115,6 +115,8 @@ ccr code
115
115
  - [x] Support change models
116
116
  - [x] Github Actions
117
117
  - [ ] More detailed logs
118
+ - [ ] Support image
119
+ - [ ] Support web search
118
120
 
119
121
  ## Github Actions
120
122
 
@@ -223,16 +225,15 @@ If you find this project helpful, you can choose to sponsor the author with a cu
223
225
 
224
226
  ## Sponsors
225
227
 
226
- Thanks to the following sponsors:
228
+ Thanks to the following sponsors for supporting the continued development of this project:
227
229
 
228
230
  @Simon Leischnig (If you see this, feel free to contact me and I can update it with your GitHub information)
229
231
  [@duanshuaimin](https://github.com/duanshuaimin)
230
232
  [@vrgitadmin](https://github.com/vrgitadmin)
231
233
  @\*o (可通过主页邮箱联系我修改 github 用户名)
232
- @\*\*聪 (可通过主页邮箱联系我修改 github 用户名)
234
+ [@ceilwoo](https://github.com/ceilwoo)
233
235
  @\*说 (可通过主页邮箱联系我修改 github 用户名)
234
236
  @\*更 (可通过主页邮箱联系我修改 github 用户名)
235
- @\*更 (可通过主页邮箱联系我修改 github 用户名)
236
237
  @K\*g (可通过主页邮箱联系我修改 github 用户名)
237
238
  @R\*R (可通过主页邮箱联系我修改 github 用户名)
238
239
  @[@bobleer](https://github.com/bobleer) (可通过主页邮箱联系我修改 github 用户名)
package/dist/cli.js CHANGED
@@ -24515,19 +24515,19 @@ var require_range = __commonJS({
24515
24515
  var replaceCaret = (comp, options) => {
24516
24516
  debug("caret", comp, options);
24517
24517
  const r = options.loose ? re2[t.CARETLOOSE] : re2[t.CARET];
24518
- const z = options.includePrerelease ? "-0" : "";
24518
+ const z2 = options.includePrerelease ? "-0" : "";
24519
24519
  return comp.replace(r, (_, M, m, p, pr) => {
24520
24520
  debug("caret", comp, _, M, m, p, pr);
24521
24521
  let ret;
24522
24522
  if (isX(M)) {
24523
24523
  ret = "";
24524
24524
  } else if (isX(m)) {
24525
- ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
24525
+ ret = `>=${M}.0.0${z2} <${+M + 1}.0.0-0`;
24526
24526
  } else if (isX(p)) {
24527
24527
  if (M === "0") {
24528
- ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
24528
+ ret = `>=${M}.${m}.0${z2} <${M}.${+m + 1}.0-0`;
24529
24529
  } else {
24530
- ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
24530
+ ret = `>=${M}.${m}.0${z2} <${+M + 1}.0.0-0`;
24531
24531
  }
24532
24532
  } else if (pr) {
24533
24533
  debug("replaceCaret pr", pr);
@@ -24544,9 +24544,9 @@ var require_range = __commonJS({
24544
24544
  debug("no pr");
24545
24545
  if (M === "0") {
24546
24546
  if (m === "0") {
24547
- ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`;
24547
+ ret = `>=${M}.${m}.${p}${z2} <${M}.${m}.${+p + 1}-0`;
24548
24548
  } else {
24549
- ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`;
24549
+ ret = `>=${M}.${m}.${p}${z2} <${M}.${+m + 1}.0-0`;
24550
24550
  }
24551
24551
  } else {
24552
24552
  ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
@@ -38306,11 +38306,11 @@ var require_util4 = __commonJS({
38306
38306
  }
38307
38307
  function tryUpgradeRequestToAPotentiallyTrustworthyURL(request) {
38308
38308
  }
38309
- function sameOrigin(A, B2) {
38310
- if (A.origin === B2.origin && A.origin === "null") {
38309
+ function sameOrigin(A, B) {
38310
+ if (A.origin === B.origin && A.origin === "null") {
38311
38311
  return true;
38312
38312
  }
38313
- if (A.protocol === B2.protocol && A.hostname === B2.hostname && A.port === B2.port) {
38313
+ if (A.protocol === B.protocol && A.hostname === B.hostname && A.port === B.port) {
38314
38314
  return true;
38315
38315
  }
38316
38316
  return false;
@@ -50552,9 +50552,9 @@ var require_util5 = __commonJS({
50552
50552
  var assert = require("node:assert");
50553
50553
  var { URLSerializer } = require_data_url();
50554
50554
  var { isValidHeaderName } = require_util4();
50555
- function urlEquals(A, B2, excludeFragment = false) {
50555
+ function urlEquals(A, B, excludeFragment = false) {
50556
50556
  const serializedA = URLSerializer(A, excludeFragment);
50557
- const serializedB = URLSerializer(B2, excludeFragment);
50557
+ const serializedB = URLSerializer(B, excludeFragment);
50558
50558
  return serializedA === serializedB;
50559
50559
  }
50560
50560
  function getFieldValues(header) {
@@ -54957,7 +54957,7 @@ var initConfig = async () => {
54957
54957
  return config;
54958
54958
  };
54959
54959
 
54960
- // node_modules/.pnpm/@musistudio+llms@1.0.0_ws@8.18.3_zod@3.25.67/node_modules/@musistudio/llms/dist/esm/server.mjs
54960
+ // node_modules/.pnpm/@musistudio+llms@1.0.1_ws@8.18.3_zod@3.25.67/node_modules/@musistudio/llms/dist/esm/server.mjs
54961
54961
  var import_fastify = __toESM(require_fastify(), 1);
54962
54962
  var import_cors = __toESM(require_cors(), 1);
54963
54963
  var import_fs = require("fs");
@@ -55330,16 +55330,16 @@ var L = class {
55330
55330
  let { done: te, value: ne } = await $.read();
55331
55331
  if (te) break;
55332
55332
  C += x.decode(ne, { stream: true });
55333
- let V = C.split(`
55333
+ let B = C.split(`
55334
55334
  `);
55335
- C = V.pop() || "";
55336
- for (let W of V) {
55335
+ C = B.pop() || "";
55336
+ for (let V of B) {
55337
55337
  if (c || i) break;
55338
- if (W.startsWith("data: ")) {
55339
- let z = W.slice(6);
55340
- if (z === "[DONE]") continue;
55338
+ if (V.startsWith("data: ")) {
55339
+ let W = V.slice(6);
55340
+ if (W === "[DONE]") continue;
55341
55341
  try {
55342
- let A = JSON.parse(z);
55342
+ let A = JSON.parse(W);
55343
55343
  if (_.originalChunks++, v++, f("Original Response:", JSON.stringify(A, null, 2)), a = A.model || a, !d && !c && !i) {
55344
55344
  d = true;
55345
55345
  let k = { type: "message_start", message: { id: r, type: "message", role: "assistant", content: [], model: a, stop_reason: null, stop_sequence: null, usage: { input_tokens: 1, output_tokens: 1 } } };
@@ -55560,7 +55560,7 @@ var N = class {
55560
55560
  })), Array.isArray(n.tool_calls) && r.push(...n.tool_calls.map((a) => ({ functionCall: { id: a.id || `tool_${Math.random().toString(36).substring(2, 15)}`, name: a.function.name, args: JSON.parse(a.function.arguments || "{}") } }))), { role: o, parts: r };
55561
55561
  }), tools: [{ functionDeclarations: e.tools?.map((n) => (delete n.function.parameters?.$schema, delete n.function.parameters?.additionalProperties, n.function.parameters?.properties && Object.keys(n.function.parameters.properties).forEach((o) => {
55562
55562
  delete n.function.parameters.properties[o].$schema, delete n.function.parameters.properties[o].additionalProperties, n.function.parameters.properties[o].items && typeof n.function.parameters.properties[o].items == "object" && (delete n.function.parameters.properties[o].items.$schema, delete n.function.parameters.properties[o].items.additionalProperties), n.function.parameters.properties[o].type === "string" && (["enum", "date-time"].includes(n.function.parameters.properties[o].format) || delete n.function.parameters.properties[o].format);
55563
- }), { name: n.function.name, description: n.function.description, parameters: n.function.parameters })) || [] }] }, config: { url: new URL(`./${e.model}:${e.stream ? "streamGenerateContent?alt=sse" : "generateContent"}`, t.baseUrl), headers: { "x-goog-api-key": t.apiKey } } };
55563
+ }), { name: n.function.name, description: n.function.description, parameters: n.function.parameters })) || [] }] }, config: { url: new URL(`./${e.model}:${e.stream ? "streamGenerateContent?alt=sse" : "generateContent"}`, t.baseUrl), headers: { "x-goog-api-key": t.apiKey, Authorization: void 0 } } };
55564
55564
  }
55565
55565
  transformRequestOut(e) {
55566
55566
  let t = e.contents, n = e.tools, o = e.model, r = e.max_tokens, a = e.temperature, d = e.stream, p = e.tool_choice, i = { messages: [], model: o, max_tokens: r, temperature: a, stream: d, tool_choice: p };
@@ -55825,7 +55825,7 @@ function pe() {
55825
55825
  let s = (0, import_fastify.default)({});
55826
55826
  return s.setErrorHandler(X), s.register(import_cors.default), s;
55827
55827
  }
55828
- var B = class {
55828
+ var z = class {
55829
55829
  app;
55830
55830
  configService;
55831
55831
  llmService;
@@ -55864,7 +55864,7 @@ var B = class {
55864
55864
  }
55865
55865
  }
55866
55866
  };
55867
- var Rt = B;
55867
+ var Rt = z;
55868
55868
 
55869
55869
  // src/server.ts
55870
55870
  var createServer = (config) => {
@@ -56182,7 +56182,7 @@ async function executeCodeCommand(args = []) {
56182
56182
  }
56183
56183
 
56184
56184
  // package.json
56185
- var version = "1.0.11";
56185
+ var version = "1.0.12";
56186
56186
 
56187
56187
  // src/cli.ts
56188
56188
  var import_child_process2 = require("child_process");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@musistudio/claude-code-router",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
4
4
  "description": "Use Claude Code without an Anthropics account and route it to another LLM provider",
5
5
  "bin": {
6
6
  "ccr": "./dist/cli.js"
@@ -18,7 +18,7 @@
18
18
  "author": "musistudio",
19
19
  "license": "MIT",
20
20
  "dependencies": {
21
- "@musistudio/llms": "^1.0.0",
21
+ "@musistudio/llms": "^1.0.1",
22
22
  "dotenv": "^16.4.7",
23
23
  "tiktoken": "^1.0.21",
24
24
  "uuid": "^11.1.0"