@peterwangze/claude-trigger-router 1.14.0 → 1.15.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 +5 -5
- package/dist/cli.js +36 -4
- package/dist/cli.js.map +2 -2
- package/docs/configuration-guide.md +1 -1
- package/docs/release-notes-v1.15.0.md +45 -0
- package/docs/releasing.md +8 -7
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -47,7 +47,7 @@ ctr code
|
|
|
47
47
|
ctr ui
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
第一次使用时,`ctr setup`
|
|
50
|
+
第一次使用时,`ctr setup` 会先复用当前配置或迁移旧 `claude-code-router` 配置;确实需要新建时,再按 `Models[].id` 创建默认模型和 `Router.default`。它也能连接远程服务,或生成服务端部署 profile。
|
|
51
51
|
|
|
52
52
|
## 最小配置长什么样
|
|
53
53
|
|
|
@@ -224,14 +224,14 @@ ANTHROPIC_AUTH_TOKEN=<managed-key>
|
|
|
224
224
|
- 配置指南:[docs/configuration-guide.md](docs/configuration-guide.md)
|
|
225
225
|
- Models 迁移:[docs/models-migration-guide.md](docs/models-migration-guide.md)
|
|
226
226
|
- CLI 测试矩阵:[docs/cli-test-matrix.md](docs/cli-test-matrix.md)
|
|
227
|
-
- 发布说明:[docs/release-notes-v1.
|
|
227
|
+
- 发布说明:[docs/release-notes-v1.15.0.md](docs/release-notes-v1.15.0.md)
|
|
228
228
|
- 发布验证:[docs/releasing.md](docs/releasing.md)
|
|
229
229
|
|
|
230
|
-
## v1.
|
|
230
|
+
## v1.15.0 发布定位
|
|
231
231
|
|
|
232
|
-
`v1.
|
|
232
|
+
`v1.15.0` 是 CLI/setup UX 重设计收口版。它把重点放在用户第一次和日常最容易遇到的入口:`ctr setup` 继续先复用或迁移配置,fresh setup 才按 `Models[].id` 创建默认模型和 `Router.default`,并能在最小配置后引导复杂任务模型、`Router.think/longContext` 和 SmartRouter 起步模板。
|
|
233
233
|
|
|
234
|
-
|
|
234
|
+
本地、远程客户端和服务端部署三类完成页都明确下一步,短入口 smoke 也纳入 packaged help 文案,避免 help、setup next steps 和 README 主路径再次漂移。完整发布边界见 [docs/release-notes-v1.15.0.md](docs/release-notes-v1.15.0.md)。
|
|
235
235
|
|
|
236
236
|
## License
|
|
237
237
|
|
package/dist/cli.js
CHANGED
|
@@ -13945,6 +13945,21 @@ function applyRoutingBootstrap(draft, choice, specializedModelId) {
|
|
|
13945
13945
|
};
|
|
13946
13946
|
return nextDraft;
|
|
13947
13947
|
}
|
|
13948
|
+
function applyRoutingSlotBootstrap(draft, choice, modelId) {
|
|
13949
|
+
if (choice === "\u5148\u4E0D\u8BBE\u7F6E\u57FA\u7840\u69FD\u4F4D") {
|
|
13950
|
+
return draft;
|
|
13951
|
+
}
|
|
13952
|
+
const nextDraft = {
|
|
13953
|
+
...draft,
|
|
13954
|
+
Router: { ...draft.Router ?? {} }
|
|
13955
|
+
};
|
|
13956
|
+
nextDraft.Router.think = modelId;
|
|
13957
|
+
if (choice === "\u8BBE\u4E3A Router.think + Router.longContext") {
|
|
13958
|
+
nextDraft.Router.longContext = modelId;
|
|
13959
|
+
nextDraft.Router.longContextThreshold = nextDraft.Router.longContextThreshold ?? 6e4;
|
|
13960
|
+
}
|
|
13961
|
+
return nextDraft;
|
|
13962
|
+
}
|
|
13948
13963
|
function createSetupBootstrapApiKey() {
|
|
13949
13964
|
return `ctr_bootstrap_${(0, import_crypto3.randomBytes)(24).toString("base64url")}`;
|
|
13950
13965
|
}
|
|
@@ -14024,6 +14039,15 @@ async function buildFreshConfig(io) {
|
|
|
14024
14039
|
suggestedModelId: suggestedSecondModelId
|
|
14025
14040
|
});
|
|
14026
14041
|
draft = appendModelToDraft(draft, specializedModel);
|
|
14042
|
+
const slotChoice = await io.choose("\u8FD9\u4E2A\u6A21\u578B\u8981\u4E0D\u8981\u540C\u65F6\u63A5\u5230\u57FA\u7840\u8DEF\u7531\u69FD\u4F4D\uFF1F", [
|
|
14043
|
+
"\u5148\u4E0D\u8BBE\u7F6E\u57FA\u7840\u69FD\u4F4D",
|
|
14044
|
+
"\u8BBE\u4E3A Router.think",
|
|
14045
|
+
"\u8BBE\u4E3A Router.think + Router.longContext"
|
|
14046
|
+
]);
|
|
14047
|
+
draft = applyRoutingSlotBootstrap(draft, slotChoice, specializedModel.model_id);
|
|
14048
|
+
if (slotChoice !== "\u5148\u4E0D\u8BBE\u7F6E\u57FA\u7840\u69FD\u4F4D") {
|
|
14049
|
+
io.info(`\u5DF2\u628A ${specializedModel.model_id} \u5199\u5165 ${slotChoice === "\u8BBE\u4E3A Router.think" ? "Router.think" : "Router.think \u548C Router.longContext"}\uFF0C\u9ED8\u8BA4\u6A21\u578B\u4ECD\u662F ${primaryModel.model_id}\u3002`);
|
|
14050
|
+
}
|
|
14027
14051
|
const routingChoice = await io.choose("\u73B0\u5728\u8981\u4E0D\u8981\u5F00\u542F\u9AD8\u7EA7\u8DEF\u7531\uFF1F", [
|
|
14028
14052
|
"\u5148\u4FDD\u6301\u6700\u5C0F\u914D\u7F6E",
|
|
14029
14053
|
"\u5F00\u542F\u590D\u6742\u4EFB\u52A1\u89C4\u5219\u6A21\u677F",
|
|
@@ -14129,12 +14153,19 @@ function printRemoteClientNextSteps(io, action) {
|
|
|
14129
14153
|
io.info("\u5982\u679C\u8FDC\u7AEF\u4E0D\u53EF\u7528\uFF0C\u8BF7\u786E\u8BA4 Runtime.remote_service.base_url \u548C managed client + read-only key\u3002");
|
|
14130
14154
|
}
|
|
14131
14155
|
function printLocalClientNextSteps(io, action) {
|
|
14132
|
-
io.info(`${formatSetupServiceReadyMessage(action)}\
|
|
14156
|
+
io.info(`${formatSetupServiceReadyMessage(action)}\u4E0B\u4E00\u6B65\uFF1A\u8FD0\u884C ctr doctor \u6216 ctr status \u786E\u8BA4\u672C\u5730\u4EE3\u7406\u72B6\u6001\u3002`);
|
|
14157
|
+
io.info("\u65E5\u5E38\u4F7F\u7528\uFF1A\u8FD0\u884C ctr code \u8FDB\u5165 Claude Code\uFF1B\u9700\u8981\u67E5\u770B\u914D\u7F6E\u3001\u8DEF\u7531\u539F\u56E0\u6216\u5065\u5EB7\u72B6\u6001\u65F6\u8FD0\u884C ctr ui\u3002");
|
|
14133
14158
|
printRoutingNextSteps(io);
|
|
14134
14159
|
}
|
|
14135
14160
|
function isRemoteServiceClientConfig(config) {
|
|
14136
14161
|
return config.Runtime?.mode === "local" && Boolean(config.Runtime.remote_service?.enabled);
|
|
14137
14162
|
}
|
|
14163
|
+
function toSetupPersistedConfig(config) {
|
|
14164
|
+
return {
|
|
14165
|
+
...config,
|
|
14166
|
+
Models: Array.isArray(config.Models) ? config.Models.map((item) => toExternalModelConfig(item)) : config.Models
|
|
14167
|
+
};
|
|
14168
|
+
}
|
|
14138
14169
|
async function runSetupCli(customDeps) {
|
|
14139
14170
|
const defaults = createDefaultDeps(customDeps?.io);
|
|
14140
14171
|
const deps = { ...defaults, ...customDeps };
|
|
@@ -14207,7 +14238,7 @@ async function runSetupCli(customDeps) {
|
|
|
14207
14238
|
}
|
|
14208
14239
|
}
|
|
14209
14240
|
const persisted = await persistSetupConfig({
|
|
14210
|
-
config: normalized.config,
|
|
14241
|
+
config: toSetupPersistedConfig(normalized.config),
|
|
14211
14242
|
currentConfigPath,
|
|
14212
14243
|
hasExistingConfig,
|
|
14213
14244
|
validateConfig: (inputConfig) => normalizeAndValidateConfig(inputConfig).errors,
|
|
@@ -14279,6 +14310,7 @@ var init_setup2 = __esm({
|
|
|
14279
14310
|
init_utils();
|
|
14280
14311
|
init_validation_contract();
|
|
14281
14312
|
init_processCheck();
|
|
14313
|
+
init_schema();
|
|
14282
14314
|
init_service();
|
|
14283
14315
|
init_repair();
|
|
14284
14316
|
init_migrate();
|
|
@@ -15572,7 +15604,7 @@ Claude Trigger Router - \u667A\u80FD\u89E6\u53D1\u8DEF\u7531\u5668
|
|
|
15572
15604
|
\u7528\u6CD5\uFF1Actr <\u547D\u4EE4> [\u9009\u9879]
|
|
15573
15605
|
|
|
15574
15606
|
\u547D\u4EE4\uFF1A
|
|
15575
|
-
setup \
|
|
15607
|
+
setup \u590D\u7528\u6216\u8FC1\u79FB\u914D\u7F6E\uFF1B\u9996\u6B21\u4F7F\u7528\u6309 Models[].id \u521B\u5EFA\u9ED8\u8BA4\u8DEF\u7531
|
|
15576
15608
|
doctor \u8BCA\u65AD\u5E76\u4FEE\u590D\u5F53\u524D\u914D\u7F6E\uFF0C\u6309\u9700\u63A2\u6D4B\u6A21\u578B\u53EF\u7528\u6027
|
|
15577
15609
|
eval \u79BB\u7EBF\u8BC4\u6D4B\u56FA\u5B9A\u4EFB\u52A1\u96C6\u8F93\u51FA\uFF08--input / --tasks / --run / --judge-model\uFF09
|
|
15578
15610
|
init \u521D\u59CB\u5316\u6700\u5C0F\u914D\u7F6E\u6A21\u677F
|
|
@@ -15593,7 +15625,7 @@ Claude Trigger Router - \u667A\u80FD\u89E6\u53D1\u8DEF\u7531\u5668
|
|
|
15593
15625
|
--force \u5F3A\u5236\u8986\u76D6\u5DF2\u6709\u914D\u7F6E\uFF08\u914D\u5408 init/deploy init \u4F7F\u7528\uFF09
|
|
15594
15626
|
|
|
15595
15627
|
\u4F7F\u7528\u793A\u4F8B\uFF1A
|
|
15596
|
-
ctr setup # \u590D\u7528\
|
|
15628
|
+
ctr setup # \u590D\u7528/\u8FC1\u79FB\u4F18\u5148\uFF1B\u9996\u6B21\u6309 Models[].id \u521B\u5EFA\u9ED8\u8BA4\u8DEF\u7531
|
|
15597
15629
|
ctr doctor # \u8BCA\u65AD\u914D\u7F6E / \u4FEE\u590D\u683C\u5F0F\u95EE\u9898 / \u6309\u9700\u63A2\u6D4B\u6A21\u578B\u53EF\u7528\u6027
|
|
15598
15630
|
ctr doctor --route-preview --route-text "\u8BF7\u505A\u67B6\u6784\u8BBE\u8BA1" # \u9884\u6F14\u5F53\u524D\u8BF7\u6C42\u4F1A\u8D70\u54EA\u4E2A\u6A21\u578B
|
|
15599
15631
|
ctr eval --tasks # \u67E5\u770B\u56FA\u5B9A\u8BC4\u6D4B\u4EFB\u52A1\u3001prompt \u548C rubric
|