@agentproto/runtime 3.3.0 → 3.5.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.
@@ -1,5 +1,5 @@
1
1
  import { AuthProfile } from '@agentproto/auth';
2
- import { A as AdapterAuthDescriptor } from './spawn-defaults-D4W661ui.js';
2
+ import { A as AdapterAuthDescriptor } from './spawn-defaults-CwI9Puwy.js';
3
3
  import { R as RouteSpec } from './session-config-DbWP9RRj.js';
4
4
  import '@agentproto/model-catalog';
5
5
  import './context-continuity-ib9_bVYM.js';
@@ -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 three route-identity widens, `route-identity/
43
- * index.ts:54-59`. Exported so `model-wire.ts` can reuse the SAME set when
44
- * deciding whether a wire model needs a literal router-prefix (never a
45
- * second hand-maintained list). */
46
- declare const WIDENING_ROUTES: readonly ["openrouter", "requesty", "huggingface"];
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. */
@@ -36,7 +36,13 @@ function subscriptionSurfaceFor(sub, endpoint) {
36
36
  }
37
37
 
38
38
  // src/catalog-models.ts
39
- var WIDENING_ROUTES = ["openrouter", "requesty", "huggingface"];
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) {