@peterwangze/claude-trigger-router 1.1.1 → 1.2.0
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/README.md +100 -10
- package/config/deploy/README.md +36 -0
- package/config/deploy/docker-compose.server.yaml +29 -0
- package/config/deploy/systemd/claude-trigger-router.service +33 -0
- package/config/trigger.advanced.yaml +11 -0
- package/dist/cli.js +3774 -207
- package/dist/cli.js.map +4 -4
- package/docs/cli-test-matrix.md +175 -0
- package/docs/configuration-guide.md +415 -0
- package/docs/configuration-roles.md +42 -0
- package/docs/models-migration-guide.md +266 -0
- package/docs/release-notes-v1.2.0.md +40 -0
- package/docs/releasing.md +313 -0
- package/docs/remote-client-guide.md +67 -0
- package/docs/server-maintainer-guide.md +81 -0
- package/package.json +2 -1
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Server maintainer guide
|
|
2
|
+
|
|
3
|
+
This guide is for the person who owns a self-hosted Claude Trigger Router server.
|
|
4
|
+
|
|
5
|
+
If you are choosing between local use, server maintenance and remote service use, start with `docs/configuration-roles.md`.
|
|
6
|
+
|
|
7
|
+
## 1. Prepare the server profile
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
ctr deploy init --target server
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Fresh machines can also run `ctr setup` and choose `部署为远程服务端`; setup writes the same server profile shape and intentionally does not start the service.
|
|
14
|
+
|
|
15
|
+
The command creates a server-oriented config with:
|
|
16
|
+
|
|
17
|
+
- `HOST: "0.0.0.0"`
|
|
18
|
+
- `Runtime.mode: "server"`
|
|
19
|
+
- a bootstrap `APIKEY`
|
|
20
|
+
- logging enabled
|
|
21
|
+
- editable `Models` and `Router.default`
|
|
22
|
+
|
|
23
|
+
Edit `Models[].key`, `Models[].api`, `Models[].interface` and `Models[].model` before exposing the service.
|
|
24
|
+
|
|
25
|
+
## 2. Diagnose and start
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
ctr doctor
|
|
29
|
+
ctr start --daemon
|
|
30
|
+
ctr status
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
`ctr status` and `ctr doctor` should show:
|
|
34
|
+
|
|
35
|
+
- current role: `server (router_service)`
|
|
36
|
+
- listener: `0.0.0.0:<port>` or the host you configured
|
|
37
|
+
- auth state: bootstrap and active managed key counts
|
|
38
|
+
- remote client connection hint: `ANTHROPIC_BASE_URL=http://<server-host>:<port>`
|
|
39
|
+
|
|
40
|
+
## 3. Issue client keys
|
|
41
|
+
|
|
42
|
+
Keep the bootstrap `APIKEY` for service owners. Use it only to open `/ui`, save config, and manage auth.
|
|
43
|
+
|
|
44
|
+
Create a managed key for remote users:
|
|
45
|
+
|
|
46
|
+
```text
|
|
47
|
+
POST /api/auth/keys
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Recommended remote-user scopes:
|
|
51
|
+
|
|
52
|
+
```json
|
|
53
|
+
["client", "read-only"]
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
`client` allows model calls. `read-only` allows ready/status checks such as `/api/health`, `/api/service-info`, compiled model summaries and governance GET endpoints. `operator` is for day-to-day maintenance writes such as restart, governance snapshots, schedules, anomaly thresholds and archive deletion; it cannot read or save config and cannot manage auth keys. Generated secrets are returned once.
|
|
57
|
+
|
|
58
|
+
## 4. Expose safely
|
|
59
|
+
|
|
60
|
+
Prefer one of these deployment envelopes:
|
|
61
|
+
|
|
62
|
+
- `config/deploy/docker-compose.server.yaml`
|
|
63
|
+
- `config/deploy/systemd/claude-trigger-router.service`
|
|
64
|
+
|
|
65
|
+
Before exposing the service to other machines:
|
|
66
|
+
|
|
67
|
+
- keep auth enabled with bootstrap or active managed keys
|
|
68
|
+
- put public deployments behind HTTPS reverse proxy or private network access
|
|
69
|
+
- give remote users managed `client + read-only` keys, not admin/bootstrap keys
|
|
70
|
+
|
|
71
|
+
## 5. Daily maintenance
|
|
72
|
+
|
|
73
|
+
Use:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
ctr status
|
|
77
|
+
ctr doctor
|
|
78
|
+
ctr ui
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
`ctr ui` opens the workbench. The maintainer area shows security status, auth scope guidance, quota usage, governance health and routing outcome summaries.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@peterwangze/claude-trigger-router",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Intelligent trigger-based router for Claude Code with automatic task type detection and model routing",
|
|
5
5
|
"bin": {
|
|
6
6
|
"ctr": "dist/cli.js"
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"files": [
|
|
9
9
|
"dist",
|
|
10
10
|
"config",
|
|
11
|
+
"docs/*.md",
|
|
11
12
|
"README.md"
|
|
12
13
|
],
|
|
13
14
|
"repository": {
|