anygate 0.5.7 → 0.5.8
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/{chunk-BCPX3QLK.js → chunk-APLGXZWQ.js} +262 -40
- package/dist/chunk-APLGXZWQ.js.map +1 -0
- package/dist/cli.js +88 -33
- package/dist/cli.js.map +1 -1
- package/dist/{command-E7O6ZQWJ.js → command-O6JD4567.js} +292 -2
- package/dist/command-O6JD4567.js.map +1 -0
- package/dist/ui/dist/assets/index-3Jrdu_6p.js +6 -0
- package/dist/ui/dist/assets/{index-C4xd3r4v.css → index-DtRr0Wrk.css} +1 -1
- package/dist/ui/dist/index.html +2 -2
- package/package.json +1 -1
- package/dist/chunk-BCPX3QLK.js.map +0 -1
- package/dist/command-E7O6ZQWJ.js.map +0 -1
- package/dist/ui/dist/assets/index-3sdSv_1I.js +0 -5
package/dist/cli.js
CHANGED
|
@@ -170,7 +170,7 @@ import {
|
|
|
170
170
|
validateCustomEndpointUrl,
|
|
171
171
|
writeSecureLogLine,
|
|
172
172
|
zenRegistryStub
|
|
173
|
-
} from "./chunk-
|
|
173
|
+
} from "./chunk-APLGXZWQ.js";
|
|
174
174
|
import {
|
|
175
175
|
filterTemplates,
|
|
176
176
|
getTemplateById,
|
|
@@ -4006,6 +4006,14 @@ async function buildFavoritesList(starting, favorites, ctx, max = 20, options =
|
|
|
4006
4006
|
}
|
|
4007
4007
|
return { resolved: out, droppedFavorites, capacitySkippedFavorites };
|
|
4008
4008
|
}
|
|
4009
|
+
function resolveFirstAvailableFavorite(favorites, providers) {
|
|
4010
|
+
for (const fav of favorites) {
|
|
4011
|
+
const provider = providers.find((lp) => lp.id === fav.providerId);
|
|
4012
|
+
const model = provider?.models.find((m) => m.id === fav.modelId);
|
|
4013
|
+
if (provider && model) return { provider, model };
|
|
4014
|
+
}
|
|
4015
|
+
return void 0;
|
|
4016
|
+
}
|
|
4009
4017
|
|
|
4010
4018
|
// src/agents/codex/favorites-launch.ts
|
|
4011
4019
|
var identityProvider = (provider) => provider;
|
|
@@ -5178,7 +5186,7 @@ function mapFinishReason(reason) {
|
|
|
5178
5186
|
if (reason === "content-filter") return "SAFETY";
|
|
5179
5187
|
return "OTHER";
|
|
5180
5188
|
}
|
|
5181
|
-
function lookupGeminiRoute(routes, requestedModel) {
|
|
5189
|
+
function lookupGeminiRoute(routes, requestedModel, defaultRoute) {
|
|
5182
5190
|
const ids = [requestedModel, ...routeLookupIds(requestedModel)];
|
|
5183
5191
|
const slashIdx = requestedModel.indexOf("/");
|
|
5184
5192
|
if (slashIdx >= 0) {
|
|
@@ -5195,7 +5203,11 @@ function lookupGeminiRoute(routes, requestedModel) {
|
|
|
5195
5203
|
const route = routes.find((r) => r.aliasId === id || r.realModelId === id);
|
|
5196
5204
|
if (route) return route;
|
|
5197
5205
|
}
|
|
5198
|
-
|
|
5206
|
+
const fallback = defaultRoute ?? routes[0];
|
|
5207
|
+
if (requestedModel !== fallback.aliasId) {
|
|
5208
|
+
console.error(`[gemini-proxy] model '${requestedModel}' not in catalog \u2014 remapping to default route '${fallback.aliasId}' (upstream: ${fallback.realModelId})`);
|
|
5209
|
+
}
|
|
5210
|
+
return fallback;
|
|
5199
5211
|
}
|
|
5200
5212
|
function mergeConsecutiveMessages2(messages) {
|
|
5201
5213
|
const merged = [];
|
|
@@ -8899,6 +8911,9 @@ function buildAgyLaunchArgs(modelLabel, childArgs) {
|
|
|
8899
8911
|
function agyArgsAreNonInteractive(args) {
|
|
8900
8912
|
return args.some((arg) => arg === "-p" || arg === "--prompt" || arg.startsWith("--prompt="));
|
|
8901
8913
|
}
|
|
8914
|
+
function agyArgsIncludeFavoritesFlag(args) {
|
|
8915
|
+
return args.includes("--favorites");
|
|
8916
|
+
}
|
|
8902
8917
|
function formatAgyCapacityWarning(validatedSlotCount, skippedFavoriteCount) {
|
|
8903
8918
|
const slotWord = validatedSlotCount === 1 ? "slot" : "slots";
|
|
8904
8919
|
const favoritePhrase = skippedFavoriteCount === 1 ? "1 favorite was not exposed" : `${skippedFavoriteCount} favorites were not exposed`;
|
|
@@ -9101,8 +9116,34 @@ async function runAntigravityCommand(intro, tracePrefix, trace, boot, launch, op
|
|
|
9101
9116
|
p11.log.info("Tip: AGY uses its own favorites list. Run `anygate favorites --agy` to set up switching.");
|
|
9102
9117
|
savePreferences({ antigravityCliFavoritesHintShown: true });
|
|
9103
9118
|
}
|
|
9119
|
+
const agyFavorites = prefs.antigravityCliFavoriteModels ?? [];
|
|
9120
|
+
if (opts.useFavoritesCatalog && agyFavorites.length > 0) {
|
|
9121
|
+
const catalogSpinner = p11.spinner();
|
|
9122
|
+
catalogSpinner.start("Loading providers...");
|
|
9123
|
+
let catalog;
|
|
9124
|
+
try {
|
|
9125
|
+
catalog = await fetchProviderCatalog();
|
|
9126
|
+
} catch (err) {
|
|
9127
|
+
catalogSpinner.stop("");
|
|
9128
|
+
p11.log.error(String(err instanceof Error ? err.message : err));
|
|
9129
|
+
return 1;
|
|
9130
|
+
}
|
|
9131
|
+
catalogSpinner.stop("");
|
|
9132
|
+
const allProviders = providersForTarget(providersForPicker(catalog), "antigravity");
|
|
9133
|
+
const firstFavorite = resolveFirstAvailableFavorite(agyFavorites, allProviders);
|
|
9134
|
+
if (!firstFavorite) {
|
|
9135
|
+
p11.log.warn("No Antigravity CLI favorites are currently available.");
|
|
9136
|
+
p11.log.info(pc9.dim("Manage them with `anygate favorites --agy`."));
|
|
9137
|
+
return 1;
|
|
9138
|
+
}
|
|
9139
|
+
const selection2 = { provider: firstFavorite.provider, model: firstFavorite.model, allProviders };
|
|
9140
|
+
return await launchWithSelection(selection2, prefs, opts, trace, tracePrefix, boot, launch);
|
|
9141
|
+
}
|
|
9104
9142
|
const selection = await resolveAntigravityLaunch(prefs, boot);
|
|
9105
9143
|
if (!selection) return 1;
|
|
9144
|
+
return await launchWithSelection(selection, prefs, opts, trace, tracePrefix, boot, launch);
|
|
9145
|
+
}
|
|
9146
|
+
async function launchWithSelection(selection, prefs, opts, trace, tracePrefix, boot, launch) {
|
|
9106
9147
|
const { provider, model, allProviders } = selection;
|
|
9107
9148
|
const versionResult = opts.versionGuard ? readAntigravityCliVersion() : { version: "1.0.10" };
|
|
9108
9149
|
const compatibility = evaluateAgySwitchCompatibility({
|
|
@@ -9158,7 +9199,7 @@ async function runAgyCommand(childArgs, trace = false, boot) {
|
|
|
9158
9199
|
trace,
|
|
9159
9200
|
boot,
|
|
9160
9201
|
(env, routes) => launchAntigravityCli(env, buildAgyLaunchArgs(routes[0].displayName, childArgs)),
|
|
9161
|
-
{ childArgs, versionGuard: true, pauseForCapacityWarning: true }
|
|
9202
|
+
{ childArgs, versionGuard: true, pauseForCapacityWarning: true, useFavoritesCatalog: agyArgsIncludeFavoritesFlag(childArgs) }
|
|
9162
9203
|
);
|
|
9163
9204
|
}
|
|
9164
9205
|
async function runAntigravityAppCommand(childArgs, trace = false, boot) {
|
|
@@ -9206,7 +9247,7 @@ async function runAntigravityAppCommand(childArgs, trace = false, boot) {
|
|
|
9206
9247
|
}
|
|
9207
9248
|
return 0;
|
|
9208
9249
|
},
|
|
9209
|
-
{ childArgs, versionGuard: false, pauseForCapacityWarning: false }
|
|
9250
|
+
{ childArgs, versionGuard: false, pauseForCapacityWarning: false, useFavoritesCatalog: agyArgsIncludeFavoritesFlag(childArgs) }
|
|
9210
9251
|
);
|
|
9211
9252
|
}
|
|
9212
9253
|
async function runAntigravityIdeCommand(childArgs, trace = false, boot) {
|
|
@@ -9254,7 +9295,7 @@ async function runAntigravityIdeCommand(childArgs, trace = false, boot) {
|
|
|
9254
9295
|
}
|
|
9255
9296
|
return 0;
|
|
9256
9297
|
},
|
|
9257
|
-
{ childArgs, versionGuard: false, pauseForCapacityWarning: false }
|
|
9298
|
+
{ childArgs, versionGuard: false, pauseForCapacityWarning: false, useFavoritesCatalog: agyArgsIncludeFavoritesFlag(childArgs) }
|
|
9258
9299
|
);
|
|
9259
9300
|
}
|
|
9260
9301
|
|
|
@@ -10028,6 +10069,7 @@ async function runCodexAppCommand(args, opts = {}) {
|
|
|
10028
10069
|
const prefs = loadPreferences();
|
|
10029
10070
|
const favorites = prefs.favoriteModels ?? [];
|
|
10030
10071
|
const favoritesActive = favorites.length > 0;
|
|
10072
|
+
const useFavoritesCatalog = args.includes("--favorites");
|
|
10031
10073
|
if (favoritesActive && !configOnly) {
|
|
10032
10074
|
p12.log.info(
|
|
10033
10075
|
`Favorites mode active \u2014 Codex App picker will show ${favorites.length + 1} models (1 starting + ${favorites.length} favorites).`
|
|
@@ -10052,32 +10094,45 @@ async function runCodexAppCommand(args, opts = {}) {
|
|
|
10052
10094
|
activeProvider = bootSelection.provider;
|
|
10053
10095
|
selectedModel = bootSelection.model;
|
|
10054
10096
|
} else if (!configOnly) {
|
|
10055
|
-
|
|
10056
|
-
|
|
10057
|
-
|
|
10058
|
-
|
|
10059
|
-
|
|
10060
|
-
|
|
10061
|
-
|
|
10062
|
-
|
|
10063
|
-
|
|
10064
|
-
|
|
10065
|
-
|
|
10066
|
-
|
|
10067
|
-
|
|
10068
|
-
|
|
10069
|
-
|
|
10070
|
-
|
|
10071
|
-
|
|
10072
|
-
|
|
10073
|
-
|
|
10074
|
-
|
|
10075
|
-
|
|
10076
|
-
|
|
10097
|
+
if (useFavoritesCatalog && favoritesActive) {
|
|
10098
|
+
const firstFavorite = resolveFirstAvailableFavorite(
|
|
10099
|
+
favorites,
|
|
10100
|
+
compatible.map(providerForCodexPicker)
|
|
10101
|
+
);
|
|
10102
|
+
if (!firstFavorite) {
|
|
10103
|
+
p12.log.warn("No saved favorites are currently available.");
|
|
10104
|
+
return 0;
|
|
10105
|
+
}
|
|
10106
|
+
activeProvider = providerForCodexPicker(firstFavorite.provider);
|
|
10107
|
+
selectedModel = firstFavorite.model;
|
|
10108
|
+
} else {
|
|
10109
|
+
let currentInitialProvider = prefs.lastCodexProvider && compatible.some((o) => o.id === prefs.lastCodexProvider) ? prefs.lastCodexProvider : compatible[0].id;
|
|
10110
|
+
while (true) {
|
|
10111
|
+
const pickedProvider = await pickCodexProvider(compatible, prefs, favoritesActive, currentInitialProvider);
|
|
10112
|
+
if (!pickedProvider) return 0;
|
|
10113
|
+
if (pickedProvider === "__favorites__") {
|
|
10114
|
+
const favoritePick = await pickFavoriteStartingModel(
|
|
10115
|
+
compatible,
|
|
10116
|
+
favorites,
|
|
10117
|
+
"codex-app",
|
|
10118
|
+
"Codex App",
|
|
10119
|
+
providerForCodexPicker
|
|
10120
|
+
);
|
|
10121
|
+
if (favoritePick === "cancelled" || favoritePick === "unavailable") return 0;
|
|
10122
|
+
activeProvider = favoritePick.provider;
|
|
10123
|
+
selectedModel = favoritePick.model;
|
|
10124
|
+
break;
|
|
10125
|
+
} else {
|
|
10126
|
+
activeProvider = providerForCodexPicker(pickedProvider);
|
|
10127
|
+
const pickedModelResult = await pickCodexModel(activeProvider, prefs);
|
|
10128
|
+
if (pickedModelResult === "back") {
|
|
10129
|
+
currentInitialProvider = activeProvider.id;
|
|
10130
|
+
continue;
|
|
10131
|
+
}
|
|
10132
|
+
if (!pickedModelResult) return 0;
|
|
10133
|
+
selectedModel = pickedModelResult;
|
|
10134
|
+
break;
|
|
10077
10135
|
}
|
|
10078
|
-
if (!pickedModelResult) return 0;
|
|
10079
|
-
selectedModel = pickedModelResult;
|
|
10080
|
-
break;
|
|
10081
10136
|
}
|
|
10082
10137
|
}
|
|
10083
10138
|
}
|
|
@@ -10106,7 +10161,7 @@ async function runCodexAppCommand(args, opts = {}) {
|
|
|
10106
10161
|
}
|
|
10107
10162
|
if (!configOnly) {
|
|
10108
10163
|
const modelLabel = formatCodexModelLabel(selectedModel);
|
|
10109
|
-
const confirmed = await confirmCodexLaunch(
|
|
10164
|
+
const confirmed = useFavoritesCatalog || await confirmCodexLaunch(
|
|
10110
10165
|
activeProvider.name,
|
|
10111
10166
|
modelLabel,
|
|
10112
10167
|
selectedModel.id,
|
|
@@ -12887,7 +12942,7 @@ Error: ${parsed.error}
|
|
|
12887
12942
|
console.log("Usage: anygate ui [--trace]\n\nOpen the settings UI in your browser.");
|
|
12888
12943
|
return 0;
|
|
12889
12944
|
}
|
|
12890
|
-
const { runUiCommand } = await import("./command-
|
|
12945
|
+
const { runUiCommand } = await import("./command-O6JD4567.js");
|
|
12891
12946
|
return runUiCommand({ trace: parsed.trace });
|
|
12892
12947
|
}
|
|
12893
12948
|
if (parsed.command === "models") {
|