@agentproto/runtime 3.2.0 → 3.4.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/dist/catalog-models.d.ts +15 -5
- package/dist/catalog-models.mjs +12 -3
- package/dist/catalog-models.mjs.map +1 -1
- package/dist/index.d.ts +34 -10
- package/dist/index.mjs +112 -30
- package/dist/index.mjs.map +1 -1
- package/package.json +28 -28
package/dist/catalog-models.d.ts
CHANGED
|
@@ -39,11 +39,21 @@ import './context-continuity-ib9_bVYM.js';
|
|
|
39
39
|
*/
|
|
40
40
|
|
|
41
41
|
/** Routers the catalog probes to widen beyond any adapter's declared model
|
|
42
|
-
* list (SPEC §5.1) — same
|
|
43
|
-
* index.ts
|
|
44
|
-
* deciding whether a wire model needs a literal
|
|
45
|
-
* second hand-maintained list).
|
|
46
|
-
|
|
42
|
+
* list (SPEC §5.1) — the same routes route-identity resolves from generated
|
|
43
|
+
* tables (`route-identity/index.ts`'s imports). Exported so `model-wire.ts`
|
|
44
|
+
* can reuse the SAME set when deciding whether a wire model needs a literal
|
|
45
|
+
* router-prefix (never a second hand-maintained list).
|
|
46
|
+
*
|
|
47
|
+
* `opencode-go` / `opencode` (OpenCode Go and Zen) widen just like the other
|
|
48
|
+
* three, but their tables are keyed `<provider>/<bare-id>` rather than
|
|
49
|
+
* `<vendor>/<product>`, so a probe of `${vendor}/${product}@opencode-go` can
|
|
50
|
+
* only ever hit when the vendor segment IS `opencode-go` — no other model can
|
|
51
|
+
* pick up a spurious OpenCode route. What this buys: `serviceableModelRoutes`
|
|
52
|
+
* answers `["opencode-go"]` for `opencode-go/glm-5.3` instead of `[]`, so the
|
|
53
|
+
* Configuration Lab / VS Code pickers resolve its route (and don't flag it
|
|
54
|
+
* unroutable), and `normalizeModelForWire` keeps the provider as the literal
|
|
55
|
+
* leading wire segment opencode itself requires. */
|
|
56
|
+
declare const WIDENING_ROUTES: readonly ["openrouter", "requesty", "huggingface", "opencode-go", "opencode"];
|
|
47
57
|
/** One model entry as declared in an adapter's `models.allowed`
|
|
48
58
|
* (`AdapterModelInfo`, `packages/cli/src/registry/resolve.ts:134-142`) —
|
|
49
59
|
* the subset this module needs. */
|
package/dist/catalog-models.mjs
CHANGED
|
@@ -36,7 +36,13 @@ function subscriptionSurfaceFor(sub, endpoint) {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
// src/catalog-models.ts
|
|
39
|
-
var WIDENING_ROUTES = [
|
|
39
|
+
var WIDENING_ROUTES = [
|
|
40
|
+
"openrouter",
|
|
41
|
+
"requesty",
|
|
42
|
+
"huggingface",
|
|
43
|
+
"opencode-go",
|
|
44
|
+
"opencode"
|
|
45
|
+
];
|
|
40
46
|
var VENDOR_COMPATIBILITY_ROUTES = {
|
|
41
47
|
xai: ["xai", "xai-anthropic"]
|
|
42
48
|
};
|
|
@@ -375,9 +381,12 @@ function reconcileModelRoute(input) {
|
|
|
375
381
|
}
|
|
376
382
|
function serviceableModelRoutes(model) {
|
|
377
383
|
const routes = /* @__PURE__ */ new Set();
|
|
378
|
-
const provider = getModelProvider(model);
|
|
379
|
-
if (provider) routes.add(provider);
|
|
380
384
|
const parsed = tryParseModelRef(normalizeRouterPrefixedId(model));
|
|
385
|
+
const selfRouted = parsed !== void 0 && parsed.route === parsed.vendor && WIDENING_ROUTES.includes(parsed.vendor) && tryResolveLlmModelRoute(`${parsed.vendor}/${parsed.product}`)?.pricing.provider === parsed.vendor;
|
|
386
|
+
if (!selfRouted) {
|
|
387
|
+
const provider = getModelProvider(model);
|
|
388
|
+
if (provider) routes.add(provider);
|
|
389
|
+
}
|
|
381
390
|
if (parsed) {
|
|
382
391
|
if (parsed.route !== parsed.vendor) routes.add(parsed.route);
|
|
383
392
|
if (resolvePricingExact(parsed.product)?.provider === parsed.vendor) {
|