tuxevil-rotator 4.1.0 → 4.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/CHANGELOG.md +25 -0
- package/README.md +3 -1
- package/package.json +1 -1
- package/src/config-overrides.ts +16 -0
- package/src/dashboard-types.ts +55 -0
- package/src/dashboard.ts +38 -0
- package/src/effort-levels.ts +43 -0
- package/src/effort-routing.ts +304 -0
- package/src/index.ts +2 -5
- package/src/model-catalog-revision.ts +3 -0
- package/src/model-catalog.ts +9 -7
- package/src/providers/google-antigravity/translators.ts +63 -14
- package/src/providers/openai-codex/catalog.ts +9 -4
- package/src/rotator.ts +77 -11
- package/src/types.ts +4 -0
- package/src/validators.ts +2 -1
- package/src/web/app.tsx +2 -1
- package/src/web/components/overlays.tsx +13 -1
- package/src/web/lib/effort.ts +407 -0
- package/src/web/lib/models.ts +6 -1
- package/src/web/pages/EffortRouting.tsx +1130 -0
- package/src/web/pages/Models.tsx +39 -3
- package/src/web/state/api.ts +13 -0
- package/src/web/state/router.ts +132 -9
- package/src/web/styles/app.css +560 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [4.2.0] - 2026-10-14
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- **Effort routing editor**: the Models page gains an **Effort routing** panel and editor, so effort aliases no longer need hand-edited JSON. ([PR #40](https://github.com/tuxevil/tuxevil-rotator/pull/40) by [@CyR1en](https://github.com/CyR1en))
|
|
10
|
+
- It suggests model families with effort variants, such as `gemini-3.6-flash-low`, `-medium` and `-high`, and sets them up in one step.
|
|
11
|
+
- Pick a model for each effort level and choose the default. The editor previews where every kind of request goes and what changes in `/v1/models`.
|
|
12
|
+
- An alias can be turned off, renamed or deleted, and the Models table tags the variants each alias uses. Leaving the editor with unsaved changes, including with Back or Forward, asks first.
|
|
13
|
+
- New `POST`, `PUT` and `DELETE /api/catalog/effort-routes` admin endpoints back it, and `/api/catalog` now reports effort routes and suggestions.
|
|
14
|
+
- **Claude-style effort routing**: `/v1/messages` requests now pick an effort alias's target. `output_config.effort` decides first. Without it, `thinking.budget_tokens` does (under 4,000 is `low`, under 16,000 is `medium`, otherwise `high`), and disabled thinking asks for `low`. Previously these requests always used the default.
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- **Configuration edits apply immediately**: `effortRouting`, `modelAliases` and `modelSpecs` saved from the dashboard now take effect without a restart. Previously the Settings editor reported "Saved and applied" while requests kept the old rules.
|
|
19
|
+
- **Switched-off effort aliases**: requests for an effort alias that is turned off now get `404 model_not_found` (`not_found_error` on `/v1/messages`) whatever its name looks like. Before, an alias whose name didn't look like a Gemini or Claude id was refused later with a generic upstream error.
|
|
20
|
+
- **Gemini 3.5 Flash Lite usage**: requests are now recorded under `gemini-3.5-flash-lite` instead of `gemini-3-flash`, so the Models page and effort routes show its traffic. Pricing is unchanged.
|
|
21
|
+
- **Automatic Codex model discovery**: send the required `client_version` query parameter, accept future numbered GPT versions including `gpt-6.1-sol`, and parse Codex catalog `slug` entries. Refresh discovery during quota polling with a five-minute cache and shared concurrent requests, retaining the last catalog when discovery fails.
|
|
22
|
+
- **Codex account catalogs**: merge model discoveries from all eligible accounts, with at most four concurrent queries, so a restricted first account does not hide models available through other plans.
|
|
23
|
+
- **Effort alias validation**: reject the reserved ID `auto` and URL dot segments `.` and `..`, with errors beside the model ID field.
|
|
24
|
+
- **Unsaved effort edits**: guard Back, Forward, in-app navigation and page unload; confirmed history navigation waits for restoration before proceeding, including immediate confirmations.
|
|
25
|
+
|
|
26
|
+
### Contributors
|
|
27
|
+
|
|
28
|
+
- Thanks to [@CyR1en](https://github.com/CyR1en) for the effort routing editor, Claude-style effort selection, live configuration updates, API and documentation, and regression coverage in [PR #40](https://github.com/tuxevil/tuxevil-rotator/pull/40), including the fixes and browser validation throughout review.
|
|
29
|
+
|
|
5
30
|
## [4.1.0] - 2026-10-13
|
|
6
31
|
|
|
7
32
|
### Added
|
package/README.md
CHANGED
|
@@ -53,6 +53,8 @@ Originally built as a multi-account rotator for Google Antigravity. It now gener
|
|
|
53
53
|
|
|
54
54
|
## Current Model Update
|
|
55
55
|
|
|
56
|
+
- **v4.2.0: Effort routing editor**: Create, edit, rename and disable effort aliases from the Models page, with route previews and unsaved-edit protection. Claude-style requests now select variants from `output_config.effort` or thinking budgets, and model configuration edits apply immediately. Includes automatic discovery of future Codex GPT models across account catalogs. ([Release notes](https://github.com/tuxevil/tuxevil-rotator/releases/tag/v4.2.0); [PR #40](https://github.com/tuxevil/tuxevil-rotator/pull/40) by [@CyR1en](https://github.com/CyR1en))
|
|
57
|
+
|
|
56
58
|
- **v4.1.0: Models and provider controls**: Manage provider order, provider and per-account switches, individual model availability, and review of newly discovered models at `/dashboard/models`. Controls apply to aliases, automatic routing, native requests, audio, benchmarks, and warm-up. Includes Ollama credit-balance polling and clearer Codex reauthentication status. ([Release notes](https://github.com/tuxevil/tuxevil-rotator/releases/tag/v4.1.0); [PR #39](https://github.com/tuxevil/tuxevil-rotator/pull/39) by [@CyR1en](https://github.com/CyR1en))
|
|
57
59
|
|
|
58
60
|
- **v4.0.0: Redesigned WebUI**: A complete dashboard refresh with live routing health, account management, request history, usage analytics, shareable views, and a responsive Preact interface. ([Release notes](https://github.com/tuxevil/tuxevil-rotator/releases/tag/v4.0.0); [PR #38](https://github.com/tuxevil/tuxevil-rotator/pull/38) by [@CyR1en](https://github.com/CyR1en))
|
|
@@ -377,7 +379,7 @@ Thanks to these amazing people who have contributed to the project:
|
|
|
377
379
|
|
|
378
380
|
- **[@CelestialCreator](https://github.com/CelestialCreator)** (Akshay) — Fixed admin token propagation on the hosted login landing page (`/login` to `/auth/antigravity/start`). ([PR #25](https://github.com/tuxevil/tuxevil-rotator/pull/25))
|
|
379
381
|
- **[@Codder-hermes](https://github.com/Codder-hermes)** — Fixed Claude Code tool-schema requests by stripping the unsupported JSON Schema `propertyNames` keyword for Gemini and Claude-via-Gemini routes, with regression coverage for both compatibility paths. ([PR #19](https://github.com/tuxevil/tuxevil-rotator/pull/19))
|
|
380
|
-
- **[@CyR1en](https://github.com/CyR1en)** (Ethan Bacurio) — Added Gemini 3.6, Gemini 3.7, and Gemini 3.8 Flash model families, shared quota-pool routing, pricing, dashboard support, integration documentation, effort-based model routing, the rebuilt WebUI, the Models page with provider/model controls and dispatch-time switch enforcement, and regression coverage. ([PR #18](https://github.com/tuxevil/tuxevil-rotator/pull/18), [PR #21](https://github.com/tuxevil/tuxevil-rotator/pull/21), [PR #28](https://github.com/tuxevil/tuxevil-rotator/pull/28), [PR #32](https://github.com/tuxevil/tuxevil-rotator/pull/32), [PR #38](https://github.com/tuxevil/tuxevil-rotator/pull/38), [PR #39](https://github.com/tuxevil/tuxevil-rotator/pull/39))
|
|
382
|
+
- **[@CyR1en](https://github.com/CyR1en)** (Ethan Bacurio) — Added Gemini 3.6, Gemini 3.7, and Gemini 3.8 Flash model families, shared quota-pool routing, pricing, dashboard support, integration documentation, effort-based model routing, the rebuilt WebUI, the Models page with provider/model controls and dispatch-time switch enforcement, the effort routing editor, Claude-style effort selection, live configuration updates, unsaved-edit navigation protection, and regression coverage. ([PR #18](https://github.com/tuxevil/tuxevil-rotator/pull/18), [PR #21](https://github.com/tuxevil/tuxevil-rotator/pull/21), [PR #28](https://github.com/tuxevil/tuxevil-rotator/pull/28), [PR #32](https://github.com/tuxevil/tuxevil-rotator/pull/32), [PR #38](https://github.com/tuxevil/tuxevil-rotator/pull/38), [PR #39](https://github.com/tuxevil/tuxevil-rotator/pull/39), [PR #40](https://github.com/tuxevil/tuxevil-rotator/pull/40))
|
|
381
383
|
- **[@josenicomaia](https://github.com/josenicomaia)** (José Nicodemos Maia Neto) — Modularized the compatibility layer architecture, added multimodal tool response support, fixed streaming pass-through for tool executions, and added PostgreSQL storage and weighted pool quota forecasting. ([PR #8](https://github.com/tuxevil/tuxevil-rotator/pull/8), [PR #9](https://github.com/tuxevil/tuxevil-rotator/pull/9), [PR #11](https://github.com/tuxevil/tuxevil-rotator/pull/11), [PR #13](https://github.com/tuxevil/tuxevil-rotator/pull/13), [PR #14](https://github.com/tuxevil/tuxevil-rotator/pull/14))
|
|
382
384
|
- **[@yashyadav711](https://github.com/yashyadav711)** (Yash) — Fixed Draft-2020-12 inline JSON-Schema union type mapping for Gemini tools support. ([PR #10](https://github.com/tuxevil/tuxevil-rotator/pull/10))
|
|
383
385
|
- **[@toRolex](https://github.com/toRolex)** (Rolex) — Added cached prompt-token extraction from Google Antigravity/Cloud Code usage and mapped it to OpenAI and Anthropic compatibility responses, with focused regression tests, plus transport-error retry recovery for single-account and exhausted-account pools. ([PR #34](https://github.com/tuxevil/tuxevil-rotator/pull/34), [PR #35](https://github.com/tuxevil/tuxevil-rotator/pull/35))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tuxevil-rotator",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "Multi-provider, multi-account AI proxy rotator with per-model routing, real-time quota tracking, and infringement detection (Google Antigravity, Ollama Cloud)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Model tables the compat layer reads from process-wide state: model specs,
|
|
2
|
+
// model-id aliases and effort routing. They come from the config, so apply
|
|
3
|
+
// them at startup and again whenever the config changes; otherwise an edit
|
|
4
|
+
// saved from the dashboard would only take effect after a restart.
|
|
5
|
+
|
|
6
|
+
import { setModelSpecsOverride } from "./compat/model-specs.js";
|
|
7
|
+
import type { Config } from "./types.js";
|
|
8
|
+
import { setEffortRoutingOverride, setModelAliasesOverride } from "./types.js";
|
|
9
|
+
|
|
10
|
+
export function applyConfigOverrides(
|
|
11
|
+
config: Pick<Config, "modelSpecs" | "modelAliases" | "effortRouting">,
|
|
12
|
+
): void {
|
|
13
|
+
setModelSpecsOverride(config.modelSpecs ?? null);
|
|
14
|
+
setModelAliasesOverride(config.modelAliases ?? null);
|
|
15
|
+
setEffortRoutingOverride(config.effortRouting ?? null);
|
|
16
|
+
}
|
package/src/dashboard-types.ts
CHANGED
|
@@ -217,6 +217,50 @@ export interface CatalogModelEntry {
|
|
|
217
217
|
modelSwitch: "on" | "off" | "review";
|
|
218
218
|
/** Requests for this id go to this provider. */
|
|
219
219
|
routed: boolean;
|
|
220
|
+
/** Set when an effort-routed model ID sends one of its effort levels here. */
|
|
221
|
+
effortRoute?: { alias: string; effort: string };
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/** One effort level of an effort-routed model ID. */
|
|
225
|
+
export interface CatalogEffortTarget {
|
|
226
|
+
/** Lower-cased level name, e.g. "high". */
|
|
227
|
+
effort: string;
|
|
228
|
+
/** Google Antigravity model the level routes to. */
|
|
229
|
+
model: string;
|
|
230
|
+
/** False when no provider lists the model right now. */
|
|
231
|
+
known: boolean;
|
|
232
|
+
/** False when a request for this level would be refused (model off or waiting for review). */
|
|
233
|
+
served: boolean;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* live: listed in /v1/models and every level is served.
|
|
238
|
+
* partial: listed, but some levels are refused.
|
|
239
|
+
* hidden: not listed (default model refused or missing, or another provider owns the ID).
|
|
240
|
+
* off: its own switch is off.
|
|
241
|
+
* provider-off: Google Antigravity is off.
|
|
242
|
+
*/
|
|
243
|
+
export type EffortRouteStatus = "live" | "partial" | "hidden" | "off" | "provider-off";
|
|
244
|
+
|
|
245
|
+
/** A model ID clients call that picks a target from the request's effort. */
|
|
246
|
+
export interface CatalogEffortRoute {
|
|
247
|
+
alias: string;
|
|
248
|
+
defaultEffort: string;
|
|
249
|
+
/** Standard levels first (minimal to max), then custom ones. */
|
|
250
|
+
targets: CatalogEffortTarget[];
|
|
251
|
+
/** Its own switch: off rejects every request for the ID. */
|
|
252
|
+
enabled: boolean;
|
|
253
|
+
/** Clients see it in /v1/models. */
|
|
254
|
+
listed: boolean;
|
|
255
|
+
/** Another provider lists the same ID and gets its requests instead. */
|
|
256
|
+
shadowedBy: string | null;
|
|
257
|
+
status: EffortRouteStatus;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/** Effort variants of one model family that no effort route uses yet. */
|
|
261
|
+
export interface CatalogEffortSuggestion {
|
|
262
|
+
alias: string;
|
|
263
|
+
targets: Array<{ effort: string; model: string }>;
|
|
220
264
|
}
|
|
221
265
|
|
|
222
266
|
export interface ModelCatalogResponse {
|
|
@@ -227,4 +271,15 @@ export interface ModelCatalogResponse {
|
|
|
227
271
|
models: CatalogModelEntry[];
|
|
228
272
|
/** False when models a provider adds later stay off until turned on. */
|
|
229
273
|
autoEnableNewModels: boolean;
|
|
274
|
+
/** Configured effort routes, in config order. */
|
|
275
|
+
effortRoutes: CatalogEffortRoute[];
|
|
276
|
+
/** Model families that could become effort routes. */
|
|
277
|
+
effortSuggestions: CatalogEffortSuggestion[];
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/** Body of a refused effort route change; field keys are "alias", "defaultEffort", "targets" or "targets.<level>". */
|
|
281
|
+
export interface EffortRouteErrorResponse {
|
|
282
|
+
ok: false;
|
|
283
|
+
error: string;
|
|
284
|
+
fieldErrors?: Record<string, string>;
|
|
230
285
|
}
|
package/src/dashboard.ts
CHANGED
|
@@ -35,6 +35,7 @@ import {
|
|
|
35
35
|
import { getSpendLogs, getDailySpendSummary, getSpendByKey } from "./spend-logger.js";
|
|
36
36
|
import { buildOpenAIModelCatalog } from "./compat.js";
|
|
37
37
|
import { getProviderOrder, isProviderTurnedOff, resolveModelRoute } from "./model-catalog.js";
|
|
38
|
+
import { describeEffortRoutes, effortRouteTargets, suggestEffortRoutes, type EffortRoutePlan } from "./effort-routing.js";
|
|
38
39
|
import { getProviderAdapter } from "./providers/registry.js";
|
|
39
40
|
import { logger } from "./logger.js";
|
|
40
41
|
|
|
@@ -271,6 +272,10 @@ export function buildModelCatalogResponse(rotator: AccountRotator): ModelCatalog
|
|
|
271
272
|
const route = resolveModelRoute(rotator, model.id);
|
|
272
273
|
routedTo.set(id, route.kind === "provider" ? route.providerId : null);
|
|
273
274
|
}
|
|
275
|
+
const effortTargets = effortRouteTargets(config);
|
|
276
|
+
const listed = config.effortRouting
|
|
277
|
+
? new Set(buildOpenAIModelCatalog(rotator).map((entry) => entry.id.toLowerCase()))
|
|
278
|
+
: new Set<string>();
|
|
274
279
|
return {
|
|
275
280
|
ok: true,
|
|
276
281
|
providers: getProviderOrder(rotator).map((id) => {
|
|
@@ -291,8 +296,13 @@ export function buildModelCatalogResponse(rotator: AccountRotator): ModelCatalog
|
|
|
291
296
|
offReason: model.offReason,
|
|
292
297
|
modelSwitch: model.modelSwitch,
|
|
293
298
|
routed: routedTo.get(model.id.toLowerCase()) === model.providerId,
|
|
299
|
+
...(model.providerId === "google-antigravity" && effortTargets.has(model.id.toLowerCase())
|
|
300
|
+
? { effortRoute: effortTargets.get(model.id.toLowerCase()) }
|
|
301
|
+
: {}),
|
|
294
302
|
})),
|
|
295
303
|
autoEnableNewModels: config.autoEnableNewModels ?? true,
|
|
304
|
+
effortRoutes: describeEffortRoutes(rotator, (alias) => listed.has(alias.toLowerCase())),
|
|
305
|
+
effortSuggestions: suggestEffortRoutes(rotator),
|
|
296
306
|
};
|
|
297
307
|
}
|
|
298
308
|
|
|
@@ -324,6 +334,8 @@ function catalogMethodFor(rest: string[]): string | null {
|
|
|
324
334
|
if (rest.length === 1 && rest[0] === "provider-order") return "PUT";
|
|
325
335
|
if (toggle && ((rest[0] === "providers" && rest.length === 3) || (rest[0] === "models" && rest.length === 2) ||
|
|
326
336
|
(rest[0] === "new-models" && rest.length === 2) || (rest[0] === "accounts" && rest.length === 4))) return "POST";
|
|
337
|
+
if (rest[0] === "effort-routes" && rest.length === 1) return "POST";
|
|
338
|
+
if (rest[0] === "effort-routes" && rest.length === 2) return "PUT, DELETE";
|
|
327
339
|
return null;
|
|
328
340
|
}
|
|
329
341
|
|
|
@@ -338,6 +350,10 @@ function catalogMethodFor(rest: string[]): string | null {
|
|
|
338
350
|
* POST /api/catalog/new-models/on|off
|
|
339
351
|
* POST /api/catalog/accounts/:accountId/:provider/on|off
|
|
340
352
|
* accountId is dashboard account.id; an unambiguous legacy email also works.
|
|
353
|
+
* POST /api/catalog/effort-routes { "alias", "defaultEffort", "targets": { "<level>": "<model>" } }
|
|
354
|
+
* PUT /api/catalog/effort-routes/:alias same body; "alias" renames the route
|
|
355
|
+
* DELETE /api/catalog/effort-routes/:alias
|
|
356
|
+
* A refused change answers { ok: false, error, fieldErrors? } (EffortRouteErrorResponse).
|
|
341
357
|
*/
|
|
342
358
|
export async function serveCatalogApi(
|
|
343
359
|
req: IncomingMessage,
|
|
@@ -393,6 +409,28 @@ export async function serveCatalogApi(
|
|
|
393
409
|
return done();
|
|
394
410
|
}
|
|
395
411
|
|
|
412
|
+
if (rest[0] === "effort-routes") {
|
|
413
|
+
const answer = (plan: EffortRoutePlan) =>
|
|
414
|
+
plan.ok
|
|
415
|
+
? done()
|
|
416
|
+
: sendCatalogJson(res, plan.status, {
|
|
417
|
+
ok: false,
|
|
418
|
+
error: plan.error,
|
|
419
|
+
...(plan.fieldErrors ? { fieldErrors: plan.fieldErrors } : {}),
|
|
420
|
+
});
|
|
421
|
+
if (method === "POST" && rest.length === 1) {
|
|
422
|
+
const body = await readJsonObject(req);
|
|
423
|
+
return answer(await rotator.saveEffortRoute(null, body));
|
|
424
|
+
}
|
|
425
|
+
if (method === "PUT" && rest.length === 2) {
|
|
426
|
+
const body = await readJsonObject(req);
|
|
427
|
+
return answer(await rotator.saveEffortRoute(rest[1], body));
|
|
428
|
+
}
|
|
429
|
+
if (method === "DELETE" && rest.length === 2) {
|
|
430
|
+
return answer(await rotator.deleteEffortRoute(rest[1]));
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
|
|
396
434
|
if (method === "POST" && rest[0] === "accounts" && rest.length === 4 && toggle !== null) {
|
|
397
435
|
if (!(await rotator.setAccountProviderEnabled(rest[1], rest[2], toggle))) {
|
|
398
436
|
return fail(404, `No unique account with a ${rest[2]} credential matches ${rest[1]}`);
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// Effort levels and alias rules shared by the effort router and the dashboard's editor.
|
|
2
|
+
// Keep this module free of imports: the browser bundle uses it too.
|
|
3
|
+
|
|
4
|
+
/** Standard effort levels, lowest first. Custom level names sort after these. */
|
|
5
|
+
export const EFFORT_LEVELS = ["minimal", "low", "medium", "high", "xhigh", "max"] as const;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* How an Anthropic Messages request without `output_config.effort` picks a
|
|
9
|
+
* level from `thinking.budget_tokens`: the first bucket whose bound the budget
|
|
10
|
+
* is below. Claude Code's "think" (4,000) lands on medium and "ultrathink"
|
|
11
|
+
* (31,999) on high.
|
|
12
|
+
*/
|
|
13
|
+
export const CLAUDE_THINKING_BUDGET_EFFORTS: ReadonlyArray<{ below: number; effort: string }> = [
|
|
14
|
+
{ below: 4_000, effort: "low" },
|
|
15
|
+
{ below: 16_000, effort: "medium" },
|
|
16
|
+
{ below: Number.POSITIVE_INFINITY, effort: "high" },
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
/** Level an Anthropic Messages request with `thinking: { type: "disabled" }` asks for. */
|
|
20
|
+
export const CLAUDE_THINKING_DISABLED_EFFORT = "low";
|
|
21
|
+
|
|
22
|
+
/** Standard levels first, in order, then custom names in their given order. */
|
|
23
|
+
export function orderEffortLevels(levels: Iterable<string>): string[] {
|
|
24
|
+
const all = [...levels];
|
|
25
|
+
const standard: readonly string[] = EFFORT_LEVELS;
|
|
26
|
+
return [
|
|
27
|
+
...EFFORT_LEVELS.filter((level) => all.includes(level)),
|
|
28
|
+
...all.filter((level) => !standard.includes(level)),
|
|
29
|
+
];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Why `alias` can never name an effort route, or null. The compatibility
|
|
34
|
+
* endpoints answer `auto` with automatic model selection before effort routing
|
|
35
|
+
* runs, and browsers resolve `.` and `..` out of the dashboard's URLs, so such
|
|
36
|
+
* a route could neither serve requests nor be edited.
|
|
37
|
+
*/
|
|
38
|
+
export function reservedEffortAlias(alias: string): string | null {
|
|
39
|
+
const id = alias.trim();
|
|
40
|
+
if (id.toLowerCase() === "auto") return `${id} is reserved for automatic model selection. Pick another ID.`;
|
|
41
|
+
if (id === "." || id === "..") return `“${id}” can't be a model ID. Pick another one.`;
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
// Effort routing as the dashboard's Models page sees it: which effort-routed
|
|
2
|
+
// model IDs exist and whether clients can use them, which model families
|
|
3
|
+
// could become one, and edits checked so the stored config always loads.
|
|
4
|
+
//
|
|
5
|
+
// Each planner returns a config patch instead of saving it, so the rotator
|
|
6
|
+
// and test stubs apply edits the same way as the other Models page switches.
|
|
7
|
+
|
|
8
|
+
import type {
|
|
9
|
+
CatalogEffortRoute,
|
|
10
|
+
CatalogEffortSuggestion,
|
|
11
|
+
CatalogEffortTarget,
|
|
12
|
+
EffortRouteStatus,
|
|
13
|
+
} from "./dashboard-types.js";
|
|
14
|
+
import { EFFORT_LEVELS, orderEffortLevels, reservedEffortAlias } from "./effort-levels.js";
|
|
15
|
+
import {
|
|
16
|
+
isProviderTurnedOff,
|
|
17
|
+
isRequestOff,
|
|
18
|
+
listCatalogModels,
|
|
19
|
+
modelKey,
|
|
20
|
+
resolveModelRoute,
|
|
21
|
+
type ModelCatalogSource,
|
|
22
|
+
} from "./model-catalog.js";
|
|
23
|
+
import { getProviderAdapter, isKnownProvider } from "./providers/registry.js";
|
|
24
|
+
import type { Config, EffortRoutingRule } from "./types.js";
|
|
25
|
+
import { applyModelAlias } from "./types.js";
|
|
26
|
+
import { isKnownNonGoogleModel, validateConfig } from "./validators.js";
|
|
27
|
+
|
|
28
|
+
const ANTIGRAVITY = "google-antigravity";
|
|
29
|
+
const EFFORT_SUFFIX = new RegExp(`^(.+)-(${EFFORT_LEVELS.join("|")})$`, "i");
|
|
30
|
+
|
|
31
|
+
const fold = (value: string) => value.trim().toLowerCase();
|
|
32
|
+
|
|
33
|
+
function providerName(providerId: string): string {
|
|
34
|
+
return isKnownProvider(providerId) ? getProviderAdapter(providerId).displayName : providerId;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function antigravityModels(source: ModelCatalogSource) {
|
|
38
|
+
return listCatalogModels(source).filter((model) => model.providerId === ANTIGRAVITY);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** Targets with lower-cased levels, standard levels first. */
|
|
42
|
+
function orderedTargets(rule: EffortRoutingRule): Array<{ effort: string; model: string }> {
|
|
43
|
+
const byLevel = new Map<string, string>();
|
|
44
|
+
for (const [level, model] of Object.entries(rule.targets ?? {})) {
|
|
45
|
+
if (typeof model === "string") byLevel.set(fold(level), model.trim());
|
|
46
|
+
}
|
|
47
|
+
return orderEffortLevels(byLevel.keys()).map((effort) => ({ effort, model: byLevel.get(effort)! }));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** The key that turns an effort-routed ID off, as the Models page switches store it. */
|
|
51
|
+
export function effortRouteKey(alias: string): string {
|
|
52
|
+
return modelKey(ANTIGRAVITY, alias);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Configured effort routes with what clients get from each. `isListed` says
|
|
57
|
+
* whether /v1/models shows the ID; the caller passes it so the answer comes
|
|
58
|
+
* from the same code that builds that list.
|
|
59
|
+
*/
|
|
60
|
+
export function describeEffortRoutes(
|
|
61
|
+
source: ModelCatalogSource,
|
|
62
|
+
isListed: (alias: string) => boolean,
|
|
63
|
+
): CatalogEffortRoute[] {
|
|
64
|
+
const config = source.getConfig?.();
|
|
65
|
+
const rules = config?.effortRouting ?? {};
|
|
66
|
+
const known = new Set(antigravityModels(source).map((model) => fold(model.id)));
|
|
67
|
+
const disabled = new Set((config?.disabledModels ?? []).map(fold));
|
|
68
|
+
const providerOff = isProviderTurnedOff(config, ANTIGRAVITY);
|
|
69
|
+
|
|
70
|
+
return Object.entries(rules).map(([rawAlias, rule]) => {
|
|
71
|
+
const alias = rawAlias.trim();
|
|
72
|
+
const targets: CatalogEffortTarget[] = orderedTargets(rule).map(({ effort, model }) => ({
|
|
73
|
+
effort,
|
|
74
|
+
model,
|
|
75
|
+
known: known.has(fold(model)),
|
|
76
|
+
served:
|
|
77
|
+
known.has(fold(model)) &&
|
|
78
|
+
!isRequestOff(source, { catalogModel: model, model: applyModelAlias(model), providerId: ANTIGRAVITY }),
|
|
79
|
+
}));
|
|
80
|
+
const route = resolveModelRoute(source, alias);
|
|
81
|
+
const shadowedBy = route.kind === "provider" && route.providerId !== ANTIGRAVITY ? route.providerId : null;
|
|
82
|
+
const enabled = !disabled.has(fold(effortRouteKey(alias)));
|
|
83
|
+
// When another provider owns the ID, /v1/models lists that provider's model instead.
|
|
84
|
+
const listed = shadowedBy === null && isListed(alias);
|
|
85
|
+
let status: EffortRouteStatus = "live";
|
|
86
|
+
if (providerOff) status = "provider-off";
|
|
87
|
+
else if (!enabled) status = "off";
|
|
88
|
+
else if (!listed) status = "hidden";
|
|
89
|
+
else if (targets.some((target) => !target.served)) status = "partial";
|
|
90
|
+
return {
|
|
91
|
+
alias,
|
|
92
|
+
defaultEffort: fold(rule.defaultEffort || "medium"),
|
|
93
|
+
targets,
|
|
94
|
+
enabled,
|
|
95
|
+
listed,
|
|
96
|
+
shadowedBy,
|
|
97
|
+
status,
|
|
98
|
+
};
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** Lower-cased target id to the effort route and level that use it. */
|
|
103
|
+
export function effortRouteTargets(config: Partial<Config> | undefined): Map<string, { alias: string; effort: string }> {
|
|
104
|
+
const out = new Map<string, { alias: string; effort: string }>();
|
|
105
|
+
for (const [alias, rule] of Object.entries(config?.effortRouting ?? {})) {
|
|
106
|
+
for (const { effort, model } of orderedTargets(rule)) {
|
|
107
|
+
const key = fold(model);
|
|
108
|
+
if (!out.has(key)) out.set(key, { alias: alias.trim(), effort });
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return out;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Why `alias` cannot name an effort route, or null when it is free. A route
|
|
116
|
+
* keeping its current name skips the model checks, so a route older configs
|
|
117
|
+
* allowed to share a model's ID can still be edited.
|
|
118
|
+
*/
|
|
119
|
+
function aliasConflict(source: ModelCatalogSource, alias: string, previousAlias: string | null): string | null {
|
|
120
|
+
const config = source.getConfig?.();
|
|
121
|
+
const wanted = fold(alias);
|
|
122
|
+
const others = Object.keys(config?.effortRouting ?? {}).filter(
|
|
123
|
+
(key) => previousAlias === null || fold(key) !== fold(previousAlias),
|
|
124
|
+
);
|
|
125
|
+
if (others.some((key) => fold(key) === wanted)) return `Another effort model already uses ${alias}.`;
|
|
126
|
+
if (previousAlias !== null && fold(previousAlias) === wanted) return null;
|
|
127
|
+
const listed = listCatalogModels(source).find((model) => fold(model.id) === wanted);
|
|
128
|
+
if (listed) return `${listed.id} is already a model from ${providerName(listed.providerId)}. Pick an ID that isn't in use.`;
|
|
129
|
+
// The startup validator refuses IDs other providers claim statically even
|
|
130
|
+
// while no account lists them; say so beside the field instead of in a toast.
|
|
131
|
+
if (isKnownNonGoogleModel(alias)) return `${alias} is a model ID of another provider. Pick an ID that isn't in use.`;
|
|
132
|
+
if (fold(applyModelAlias(alias)) !== wanted) {
|
|
133
|
+
return `${alias} is already a model alias for ${applyModelAlias(alias)}. Pick an ID that isn't in use.`;
|
|
134
|
+
}
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Antigravity model families with at least two effort-suffixed variants
|
|
140
|
+
* (`gemini-3.8-flash-low`, `-medium`, `-high`) that no effort route uses yet
|
|
141
|
+
* and whose base ID is free to become one.
|
|
142
|
+
*/
|
|
143
|
+
export function suggestEffortRoutes(source: ModelCatalogSource): CatalogEffortSuggestion[] {
|
|
144
|
+
const config = source.getConfig?.();
|
|
145
|
+
const used = effortRouteTargets(config);
|
|
146
|
+
const families = new Map<string, { alias: string; targets: Map<string, string> }>();
|
|
147
|
+
for (const model of antigravityModels(source)) {
|
|
148
|
+
const hit = EFFORT_SUFFIX.exec(model.id.trim());
|
|
149
|
+
if (!hit) continue;
|
|
150
|
+
const base = hit[1];
|
|
151
|
+
const family = families.get(fold(base)) ?? { alias: base, targets: new Map<string, string>() };
|
|
152
|
+
const level = hit[2].toLowerCase();
|
|
153
|
+
if (!family.targets.has(level)) family.targets.set(level, model.id);
|
|
154
|
+
families.set(fold(base), family);
|
|
155
|
+
}
|
|
156
|
+
return [...families.values()]
|
|
157
|
+
.filter(
|
|
158
|
+
(family) =>
|
|
159
|
+
family.targets.size >= 2 &&
|
|
160
|
+
![...family.targets.values()].some((id) => used.has(fold(id))) &&
|
|
161
|
+
aliasConflict(source, family.alias, null) === null,
|
|
162
|
+
)
|
|
163
|
+
.map((family) => ({
|
|
164
|
+
alias: family.alias,
|
|
165
|
+
targets: orderEffortLevels(family.targets.keys()).map((effort) => ({ effort, model: family.targets.get(effort)! })),
|
|
166
|
+
}));
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export type EffortRoutePlan =
|
|
170
|
+
| { ok: true; alias: string; patch: Partial<Config> }
|
|
171
|
+
| { ok: false; status: 400 | 404; error: string; fieldErrors?: Record<string, string> };
|
|
172
|
+
|
|
173
|
+
function findAlias(config: Partial<Config> | undefined, alias: string): string | null {
|
|
174
|
+
return Object.keys(config?.effortRouting ?? {}).find((key) => fold(key) === fold(alias)) ?? null;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/** Replaces one "<provider>/<model>" entry (any case) in a switch list, or drops it when `next` is null. */
|
|
178
|
+
function renameKey(list: string[] | undefined, previous: string, next: string | null): string[] | undefined {
|
|
179
|
+
if (!list) return list;
|
|
180
|
+
const wanted = fold(previous);
|
|
181
|
+
if (!list.some((key) => fold(key) === wanted)) return list;
|
|
182
|
+
const out = list.filter((key) => fold(key) !== wanted);
|
|
183
|
+
return next === null ? out : [...out, next];
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function invalid(error: string, fieldErrors?: Record<string, string>): EffortRoutePlan {
|
|
187
|
+
return { ok: false, status: 400, error, ...(fieldErrors ? { fieldErrors } : {}) };
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Plans creating (`previousAlias` null) or replacing an effort route from a
|
|
192
|
+
* request body `{ alias, defaultEffort, targets: { <level>: <model> } }`. On
|
|
193
|
+
* replace, `alias` may be omitted to keep the name, or changed to rename the
|
|
194
|
+
* route; its switch moves with it.
|
|
195
|
+
*/
|
|
196
|
+
export function planEffortRouteSave(
|
|
197
|
+
source: ModelCatalogSource,
|
|
198
|
+
previousAlias: string | null,
|
|
199
|
+
body: unknown,
|
|
200
|
+
): EffortRoutePlan {
|
|
201
|
+
const config = source.getConfig?.() ?? ({ accounts: [] } as unknown as Config);
|
|
202
|
+
const existing = previousAlias === null ? null : findAlias(config, previousAlias);
|
|
203
|
+
if (previousAlias !== null && existing === null) {
|
|
204
|
+
return { ok: false, status: 404, error: `No effort model is called ${previousAlias}` };
|
|
205
|
+
}
|
|
206
|
+
if (!body || typeof body !== "object" || Array.isArray(body)) {
|
|
207
|
+
return invalid('Send { "alias": "<model id>", "defaultEffort": "<level>", "targets": { "<level>": "<model id>" } }');
|
|
208
|
+
}
|
|
209
|
+
const input = body as Record<string, unknown>;
|
|
210
|
+
const fieldErrors: Record<string, string> = {};
|
|
211
|
+
|
|
212
|
+
const rawAlias = input.alias === undefined && existing !== null ? existing : input.alias;
|
|
213
|
+
const alias = typeof rawAlias === "string" ? rawAlias.trim() : "";
|
|
214
|
+
if (!alias) fieldErrors.alias = "Enter the model ID clients will call.";
|
|
215
|
+
else if (/\s/.test(alias)) fieldErrors.alias = "Model IDs can't contain spaces.";
|
|
216
|
+
else {
|
|
217
|
+
// Reserved IDs are refused even for a route that keeps its name: it can't work.
|
|
218
|
+
const conflict = reservedEffortAlias(alias) ?? aliasConflict(source, alias, existing);
|
|
219
|
+
if (conflict) fieldErrors.alias = conflict;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
const catalog = new Map(antigravityModels(source).map((model) => [fold(model.id), model.id]));
|
|
223
|
+
const targets: Record<string, string> = {};
|
|
224
|
+
if (!input.targets || typeof input.targets !== "object" || Array.isArray(input.targets)) {
|
|
225
|
+
fieldErrors.targets = "Choose a model for at least one effort level.";
|
|
226
|
+
} else {
|
|
227
|
+
for (const [rawLevel, rawModel] of Object.entries(input.targets as Record<string, unknown>)) {
|
|
228
|
+
const level = fold(rawLevel);
|
|
229
|
+
const field = `targets.${level || rawLevel}`;
|
|
230
|
+
if (!level) {
|
|
231
|
+
fieldErrors[field] = "Name this level.";
|
|
232
|
+
continue;
|
|
233
|
+
}
|
|
234
|
+
if (/\s/.test(level)) {
|
|
235
|
+
fieldErrors[field] = "Level names can't contain spaces.";
|
|
236
|
+
continue;
|
|
237
|
+
}
|
|
238
|
+
if (Object.hasOwn(targets, level)) {
|
|
239
|
+
fieldErrors[field] = `There's already a ${level} level.`;
|
|
240
|
+
continue;
|
|
241
|
+
}
|
|
242
|
+
const model = typeof rawModel === "string" ? catalog.get(fold(rawModel)) : undefined;
|
|
243
|
+
if (!model) {
|
|
244
|
+
fieldErrors[field] = typeof rawModel === "string" && rawModel.trim()
|
|
245
|
+
? `${rawModel.trim()} isn't a Google Antigravity model.`
|
|
246
|
+
: "Choose a model for this level.";
|
|
247
|
+
continue;
|
|
248
|
+
}
|
|
249
|
+
targets[level] = model;
|
|
250
|
+
}
|
|
251
|
+
if (Object.keys(targets).length === 0 && !Object.keys(fieldErrors).some((key) => key.startsWith("targets"))) {
|
|
252
|
+
fieldErrors.targets = "Choose a model for at least one effort level.";
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
// A default whose own target is refused is already reported on that target.
|
|
257
|
+
const defaultEffort = typeof input.defaultEffort === "string" ? fold(input.defaultEffort) : "";
|
|
258
|
+
const levels = new Set(
|
|
259
|
+
input.targets && typeof input.targets === "object" ? Object.keys(input.targets).map(fold) : [],
|
|
260
|
+
);
|
|
261
|
+
if (!defaultEffort) fieldErrors.defaultEffort = "Pick the level requests without an effort use.";
|
|
262
|
+
else if (!levels.has(defaultEffort)) fieldErrors.defaultEffort = `The default level ${defaultEffort} has no model.`;
|
|
263
|
+
|
|
264
|
+
const problems = Object.values(fieldErrors);
|
|
265
|
+
if (problems.length > 0) return invalid(problems.join(" "), fieldErrors);
|
|
266
|
+
|
|
267
|
+
const rule: EffortRoutingRule = {
|
|
268
|
+
defaultEffort,
|
|
269
|
+
targets: Object.fromEntries(orderEffortLevels(Object.keys(targets)).map((level) => [level, targets[level]])),
|
|
270
|
+
};
|
|
271
|
+
// Replace in place so the routes keep their order in the config file.
|
|
272
|
+
const entries = Object.entries(config.effortRouting ?? {});
|
|
273
|
+
const at = existing === null ? -1 : entries.findIndex(([key]) => key === existing);
|
|
274
|
+
if (at >= 0) entries[at] = [alias, rule];
|
|
275
|
+
else entries.push([alias, rule]);
|
|
276
|
+
const effortRouting = Object.fromEntries(entries);
|
|
277
|
+
|
|
278
|
+
const patch: Partial<Config> = { effortRouting };
|
|
279
|
+
if (existing !== null && existing !== alias) {
|
|
280
|
+
patch.disabledModels = renameKey(config.disabledModels, effortRouteKey(existing), effortRouteKey(alias));
|
|
281
|
+
patch.reviewedModels = renameKey(config.reviewedModels, effortRouteKey(existing), effortRouteKey(alias));
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
// The stored config must keep loading: run the same checks startup does.
|
|
285
|
+
const check = validateConfig({ accounts: [], modelAliases: config.modelAliases, effortRouting });
|
|
286
|
+
if (!check.ok) return invalid(check.errors.join("; "));
|
|
287
|
+
return { ok: true, alias, patch };
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/** Plans removing an effort route and its switch. */
|
|
291
|
+
export function planEffortRouteDelete(config: Partial<Config> | undefined, alias: string): EffortRoutePlan {
|
|
292
|
+
const existing = findAlias(config, alias);
|
|
293
|
+
if (existing === null) return { ok: false, status: 404, error: `No effort model is called ${alias}` };
|
|
294
|
+
const rest = Object.entries(config?.effortRouting ?? {}).filter(([key]) => key !== existing);
|
|
295
|
+
return {
|
|
296
|
+
ok: true,
|
|
297
|
+
alias: existing,
|
|
298
|
+
patch: {
|
|
299
|
+
effortRouting: rest.length > 0 ? Object.fromEntries(rest) : undefined,
|
|
300
|
+
disabledModels: renameKey(config?.disabledModels, effortRouteKey(existing), null),
|
|
301
|
+
reviewedModels: renameKey(config?.reviewedModels, effortRouteKey(existing), null),
|
|
302
|
+
},
|
|
303
|
+
};
|
|
304
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -16,11 +16,10 @@ import {
|
|
|
16
16
|
import { warnIfUsingFallbackOAuthCreds } from "./providers/google-antigravity/oauth.js";
|
|
17
17
|
import { warnIfInsecureTelemetryEndpoint } from "./telemetry.js";
|
|
18
18
|
import {
|
|
19
|
-
setModelSpecsOverride,
|
|
20
19
|
loadResponsesStore,
|
|
21
20
|
flushResponsesStore,
|
|
22
21
|
} from "./compat.js";
|
|
23
|
-
import {
|
|
22
|
+
import { applyConfigOverrides } from "./config-overrides.js";
|
|
24
23
|
import { readTextFile, writeTextFileAtomic } from "./storage.js";
|
|
25
24
|
import { initDb, isDbConfigured } from "./db-store.js";
|
|
26
25
|
import { runKeyMigrations } from "./key-migrations.js";
|
|
@@ -212,9 +211,7 @@ export async function main(): Promise<void> {
|
|
|
212
211
|
maybeWarnAboutProxyExposure(config);
|
|
213
212
|
warnIfUsingFallbackOAuthCreds();
|
|
214
213
|
warnIfInsecureTelemetryEndpoint();
|
|
215
|
-
|
|
216
|
-
setModelAliasesOverride(config.modelAliases ?? null);
|
|
217
|
-
setEffortRoutingOverride(config.effortRouting ?? null);
|
|
214
|
+
applyConfigOverrides(config);
|
|
218
215
|
void loadResponsesStore();
|
|
219
216
|
|
|
220
217
|
const rotator = new AccountRotator(config);
|
|
@@ -12,6 +12,9 @@ export function getModelCatalogRevision(source: ModelCatalogSource): string {
|
|
|
12
12
|
})),
|
|
13
13
|
models: listCatalogModels(source),
|
|
14
14
|
autoEnableNewModels: config?.autoEnableNewModels ?? true,
|
|
15
|
+
effortRouting: config?.effortRouting ?? null,
|
|
16
|
+
// The switch of an id no provider lists, such as an effort-routed id, is not in `models`.
|
|
17
|
+
disabledModels: (config?.disabledModels ?? []).map((key) => key.trim().toLowerCase()).sort(),
|
|
15
18
|
};
|
|
16
19
|
return createHash("sha256").update(JSON.stringify(state)).digest("hex").slice(0, 32);
|
|
17
20
|
}
|
package/src/model-catalog.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
// providers/registry.ts, so routing for them is unchanged.
|
|
9
9
|
|
|
10
10
|
import type { Config } from "./types.js";
|
|
11
|
-
import { applyModelAlias } from "./types.js";
|
|
11
|
+
import { applyModelAlias, getEffortRoutingRule } from "./types.js";
|
|
12
12
|
import type { ProviderModel } from "./providers/adapter.js";
|
|
13
13
|
import {
|
|
14
14
|
findProviderForModel,
|
|
@@ -175,12 +175,14 @@ export function resolveModelRoute(source: ModelCatalogSource, model: string): Mo
|
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
if (listed.length === 0) {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
178
|
+
// Effort aliases always dispatch to Antigravity, whatever their name looks like.
|
|
179
|
+
const ownerId =
|
|
180
|
+
findProviderForModel(model, {
|
|
181
|
+
ollamaModels: new Set(source.getOllamaModels?.() ?? []),
|
|
182
|
+
codexModels: new Set(source.getCodexModels?.() ?? []),
|
|
183
|
+
})?.id ?? (getEffortRoutingRule(model) ? "google-antigravity" : null);
|
|
184
|
+
if (ownerId && isTurnedOff(settings, catalog, ownerId, model)) {
|
|
185
|
+
return { kind: "off", providerIds: [ownerId] };
|
|
184
186
|
}
|
|
185
187
|
return { kind: "unlisted" };
|
|
186
188
|
}
|