github-router 0.3.18 → 0.3.19
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/main.js +14 -2
- package/dist/main.js.map +1 -1
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -541,7 +541,11 @@ function normalizeModelId(id) {
|
|
|
541
541
|
* 2. Case-insensitive match
|
|
542
542
|
* 3. Family preference (opus→1m, codex→highest version)
|
|
543
543
|
* 4. Normalized match (dots→dashes, letter-digit boundaries)
|
|
544
|
-
* 5.
|
|
544
|
+
* 5. Anthropic dated-slug retry: if the input matches `claude-...-YYYYMMDD`,
|
|
545
|
+
* strip the date and re-run the cascade once. Family-guarded so non-claude
|
|
546
|
+
* 8-digit suffixes can't be mis-stripped; runs after Steps 1-4 so explicit
|
|
547
|
+
* version pinning (a dated catalog id matched at Step 1) always wins.
|
|
548
|
+
* 6. Return as-is with a warning
|
|
545
549
|
*/
|
|
546
550
|
function resolveModel(modelId) {
|
|
547
551
|
const models = state.models?.data;
|
|
@@ -567,6 +571,14 @@ function resolveModel(modelId) {
|
|
|
567
571
|
const normalized = normalizeModelId(modelId);
|
|
568
572
|
const normMatch = models.find((m) => normalizeModelId(m.id) === normalized);
|
|
569
573
|
if (normMatch) return normMatch.id;
|
|
574
|
+
const dateStripped = modelId.replace(/^(claude-[\w.-]+)-20\d{6}$/i, "$1");
|
|
575
|
+
if (dateStripped !== modelId) {
|
|
576
|
+
const retried = resolveModel(dateStripped);
|
|
577
|
+
if (retried !== dateStripped || models.some((m) => m.id === dateStripped)) {
|
|
578
|
+
consola.info(`Resolved Anthropic dated slug "${modelId}" → "${retried}" (stripped -YYYYMMDD; pass an explicit catalog id to pin a snapshot)`);
|
|
579
|
+
return retried;
|
|
580
|
+
}
|
|
581
|
+
}
|
|
570
582
|
consola.warn(`Model "${modelId}" not found in Copilot model list. Available: ${models.map((m) => m.id).join(", ")}`);
|
|
571
583
|
return modelId;
|
|
572
584
|
}
|
|
@@ -1771,7 +1783,7 @@ function initProxyFromEnv() {
|
|
|
1771
1783
|
//#endregion
|
|
1772
1784
|
//#region package.json
|
|
1773
1785
|
var name = "github-router";
|
|
1774
|
-
var version = "0.3.
|
|
1786
|
+
var version = "0.3.19";
|
|
1775
1787
|
|
|
1776
1788
|
//#endregion
|
|
1777
1789
|
//#region src/lib/approval.ts
|