@wengine-ai/claude-code-router 2.0.29 → 2.0.31
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/dist/cli.js +989 -1875
- package/dist/index.html +23 -23
- package/package.json +26 -30
- package/.github/workflows/docker-publish.yml +0 -85
- package/.github/workflows/docs.yml +0 -55
- package/README_zh.md +0 -677
- package/pnpm-workspace.yaml +0 -7
- package/tsconfig.base.json +0 -17
- package/tsconfig.json +0 -20
package/package.json
CHANGED
|
@@ -1,25 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wengine-ai/claude-code-router",
|
|
3
|
-
"version": "2.0.
|
|
4
|
-
"description": "
|
|
5
|
-
"scripts": {
|
|
6
|
-
"build": "pnpm build:shared && pnpm build:core && pnpm build:server && pnpm build:cli && pnpm build:ui",
|
|
7
|
-
"build:core": "pnpm --filter @wengine-ai/llms build",
|
|
8
|
-
"build:shared": "pnpm --filter @wengine-ai/claude-code-router-shared build",
|
|
9
|
-
"build:cli": "pnpm --filter @wengine-ai/claude-code-router-cli build",
|
|
10
|
-
"build:server": "pnpm --filter @wengine-ai/claude-code-router-server build",
|
|
11
|
-
"build:ui": "pnpm --filter @wengine-ai/claude-code-router-ui build",
|
|
12
|
-
"build:docs": "pnpm --filter claude-code-router-docs build",
|
|
13
|
-
"release": "pnpm build && bash scripts/release.sh all",
|
|
14
|
-
"release:npm": "bash scripts/release.sh npm",
|
|
15
|
-
"release:docker": "bash scripts/release.sh docker",
|
|
16
|
-
"dev:cli": "pnpm --filter @wengine-ai/claude-code-router-cli dev",
|
|
17
|
-
"dev:server": "pnpm --filter @wengine-ai/claude-code-router-server dev",
|
|
18
|
-
"dev:ui": "pnpm --filter @wengine-ai/claude-code-router-ui dev",
|
|
19
|
-
"dev:core": "pnpm --filter @wengine-ai/llms dev",
|
|
20
|
-
"dev:docs": "pnpm --filter claude-code-router-docs start",
|
|
21
|
-
"serve:docs": "pnpm --filter claude-code-router-docs serve"
|
|
22
|
-
},
|
|
3
|
+
"version": "2.0.31",
|
|
4
|
+
"description": "CLI for Claude Code Router",
|
|
23
5
|
"bin": {
|
|
24
6
|
"ccr": "dist/cli.js"
|
|
25
7
|
},
|
|
@@ -27,24 +9,38 @@
|
|
|
27
9
|
"claude",
|
|
28
10
|
"code",
|
|
29
11
|
"router",
|
|
30
|
-
"
|
|
31
|
-
"anthropic"
|
|
12
|
+
"cli"
|
|
32
13
|
],
|
|
33
14
|
"author": "musistudio",
|
|
34
15
|
"license": "MIT",
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@wengine-ai/llms": "^2.0.31",
|
|
18
|
+
"lru-cache": "^11.2.2"
|
|
19
|
+
},
|
|
35
20
|
"devDependencies": {
|
|
21
|
+
"@wengine-ai/claude-code-router-server": "workspace:*",
|
|
22
|
+
"@wengine-ai/claude-code-router-shared": "workspace:*",
|
|
23
|
+
"@inquirer/prompts": "^5.0.0",
|
|
24
|
+
"@types/archiver": "^7.0.0",
|
|
36
25
|
"@types/node": "^24.0.15",
|
|
26
|
+
"adm-zip": "^0.5.16",
|
|
27
|
+
"archiver": "^7.0.1",
|
|
37
28
|
"esbuild": "^0.25.1",
|
|
38
|
-
"
|
|
29
|
+
"find-process": "^2.0.0",
|
|
30
|
+
"minimist": "^1.2.8",
|
|
31
|
+
"openurl": "^1.1.1",
|
|
32
|
+
"ts-node": "^10.9.2",
|
|
39
33
|
"typescript": "^5.8.2"
|
|
40
34
|
},
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
|
|
35
|
+
"files": [
|
|
36
|
+
"dist/*",
|
|
37
|
+
"README.md",
|
|
38
|
+
"LICENSE"
|
|
39
|
+
],
|
|
40
|
+
"peerDependencies": {
|
|
41
|
+
"node": ">=18.0.0"
|
|
45
42
|
},
|
|
46
43
|
"engines": {
|
|
47
|
-
"node": ">=
|
|
48
|
-
"pnpm": ">=8.0.0"
|
|
44
|
+
"node": ">=18.0.0"
|
|
49
45
|
}
|
|
50
|
-
}
|
|
46
|
+
}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
name: Build and Publish Docker Image
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
tags:
|
|
6
|
-
- 'v*.*.*'
|
|
7
|
-
workflow_dispatch:
|
|
8
|
-
|
|
9
|
-
env:
|
|
10
|
-
DOCKER_IMAGE: musistudio/claude-code-router
|
|
11
|
-
|
|
12
|
-
jobs:
|
|
13
|
-
build-and-push:
|
|
14
|
-
runs-on: ubuntu-latest
|
|
15
|
-
permissions:
|
|
16
|
-
contents: read
|
|
17
|
-
packages: write
|
|
18
|
-
id-token: write
|
|
19
|
-
|
|
20
|
-
steps:
|
|
21
|
-
- name: Checkout repository
|
|
22
|
-
uses: actions/checkout@v4
|
|
23
|
-
|
|
24
|
-
- name: Setup Node.js
|
|
25
|
-
uses: actions/setup-node@v4
|
|
26
|
-
with:
|
|
27
|
-
node-version: 20
|
|
28
|
-
|
|
29
|
-
- name: Install pnpm
|
|
30
|
-
uses: pnpm/action-setup@v4
|
|
31
|
-
with:
|
|
32
|
-
version: latest
|
|
33
|
-
|
|
34
|
-
- name: Get version
|
|
35
|
-
id: version
|
|
36
|
-
run: |
|
|
37
|
-
if [[ $GITHUB_REF == refs/tags/* ]]; then
|
|
38
|
-
VERSION=${GITHUB_REF#refs/tags/}
|
|
39
|
-
else
|
|
40
|
-
VERSION=$(node -p "require('./package.json').version")
|
|
41
|
-
fi
|
|
42
|
-
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
43
|
-
echo "Docker image version: $VERSION"
|
|
44
|
-
|
|
45
|
-
- name: Install dependencies
|
|
46
|
-
run: pnpm install --frozen-lockfile
|
|
47
|
-
|
|
48
|
-
- name: Build packages
|
|
49
|
-
run: |
|
|
50
|
-
pnpm build
|
|
51
|
-
|
|
52
|
-
- name: Set up Docker Buildx
|
|
53
|
-
uses: docker/setup-buildx-action@v3
|
|
54
|
-
|
|
55
|
-
- name: Login to Docker Hub
|
|
56
|
-
uses: docker/login-action@v3
|
|
57
|
-
with:
|
|
58
|
-
username: ${{ secrets.DOCKER_USERNAME }}
|
|
59
|
-
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
60
|
-
|
|
61
|
-
- name: Extract metadata
|
|
62
|
-
id: meta
|
|
63
|
-
uses: docker/metadata-action@v5
|
|
64
|
-
with:
|
|
65
|
-
images: ${{ env.DOCKER_IMAGE }}
|
|
66
|
-
tags: |
|
|
67
|
-
type=semver,pattern={{version}},value=${{ steps.version.outputs.version }}
|
|
68
|
-
type=semver,pattern={{major}}.{{minor}},value=${{ steps.version.outputs.version }}
|
|
69
|
-
type=raw,value=latest
|
|
70
|
-
type=sha
|
|
71
|
-
|
|
72
|
-
- name: Build and push Docker image
|
|
73
|
-
uses: docker/build-push-action@v5
|
|
74
|
-
with:
|
|
75
|
-
context: .
|
|
76
|
-
file: ./packages/server/Dockerfile
|
|
77
|
-
platforms: linux/amd64,linux/arm64
|
|
78
|
-
push: true
|
|
79
|
-
tags: ${{ steps.meta.outputs.tags }}
|
|
80
|
-
labels: ${{ steps.meta.outputs.labels }}
|
|
81
|
-
cache-from: type=gha
|
|
82
|
-
cache-to: type=gha,mode=max
|
|
83
|
-
|
|
84
|
-
- name: Image digest
|
|
85
|
-
run: echo "Image pushed with digest ${{ steps.meta.outputs.digest }}"
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
name: Deploy Docs to GitHub Pages
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- main
|
|
7
|
-
paths:
|
|
8
|
-
- 'docs/**'
|
|
9
|
-
- '.github/workflows/docs.yml'
|
|
10
|
-
workflow_dispatch:
|
|
11
|
-
|
|
12
|
-
permissions:
|
|
13
|
-
contents: read
|
|
14
|
-
pages: write
|
|
15
|
-
id-token: write
|
|
16
|
-
|
|
17
|
-
concurrency:
|
|
18
|
-
group: pages
|
|
19
|
-
cancel-in-progress: false
|
|
20
|
-
|
|
21
|
-
jobs:
|
|
22
|
-
build:
|
|
23
|
-
runs-on: ubuntu-latest
|
|
24
|
-
steps:
|
|
25
|
-
- name: Checkout
|
|
26
|
-
uses: actions/checkout@v4
|
|
27
|
-
|
|
28
|
-
- name: Setup Node.js
|
|
29
|
-
uses: actions/setup-node@v4
|
|
30
|
-
with:
|
|
31
|
-
node-version: 20
|
|
32
|
-
|
|
33
|
-
- name: Install dependencies
|
|
34
|
-
working-directory: ./docs
|
|
35
|
-
run: npm install
|
|
36
|
-
|
|
37
|
-
- name: Build Docusaurus
|
|
38
|
-
working-directory: ./docs
|
|
39
|
-
run: npm run build
|
|
40
|
-
|
|
41
|
-
- name: Upload artifact
|
|
42
|
-
uses: actions/upload-pages-artifact@v3
|
|
43
|
-
with:
|
|
44
|
-
path: ./docs/build
|
|
45
|
-
|
|
46
|
-
deploy:
|
|
47
|
-
environment:
|
|
48
|
-
name: github-pages
|
|
49
|
-
url: ${{ steps.deployment.outputs.page_url }}
|
|
50
|
-
runs-on: ubuntu-latest
|
|
51
|
-
needs: build
|
|
52
|
-
steps:
|
|
53
|
-
- name: Deploy to GitHub Pages
|
|
54
|
-
id: deployment
|
|
55
|
-
uses: actions/deploy-pages@v4
|