dsh-agy 0.4.1 → 0.4.3
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/README.md +5 -1
- package/lib/{accounts-BjdDqUq1.mjs → accounts-CB4blXpP.mjs} +10 -10
- package/lib/{accounts-BjdDqUq1.mjs.map → accounts-CB4blXpP.mjs.map} +1 -1
- package/lib/{catalog-BgdDVJEB.mjs → catalog-BRHHLLd5.mjs} +13 -3
- package/lib/{catalog-BgdDVJEB.mjs.map → catalog-BRHHLLd5.mjs.map} +1 -1
- package/lib/cli/index.mjs +6 -6
- package/lib/client.js +1479 -170
- package/lib/{constants-BpyRirvk.mjs → constants-CmA9wXNe.mjs} +3 -3
- package/lib/{constants-BpyRirvk.mjs.map → constants-CmA9wXNe.mjs.map} +1 -1
- package/lib/{exchange-LzEyxve1.mjs → exchange-C-tndv7j.mjs} +3 -3
- package/lib/{exchange-LzEyxve1.mjs.map → exchange-C-tndv7j.mjs.map} +1 -1
- package/lib/{import-CotRHNDk.mjs → import-SxPDjH3u.mjs} +4 -4
- package/lib/{import-CotRHNDk.mjs.map → import-SxPDjH3u.mjs.map} +1 -1
- package/lib/index.mjs +2 -2
- package/lib/{models-Qn0-sh6X.mjs → models-CjB0rXtI.mjs} +4 -4
- package/lib/{models-Qn0-sh6X.mjs.map → models-CjB0rXtI.mjs.map} +1 -1
- package/lib/parse-38V1zT1B.mjs +270 -0
- package/lib/parse-38V1zT1B.mjs.map +1 -0
- package/lib/{plugin-common-B7OSfnyl.mjs → plugin-common-D2NWMsX6.mjs} +10 -9
- package/lib/plugin-common-D2NWMsX6.mjs.map +1 -0
- package/lib/{proxy-DfaL73mL.mjs → proxy-BbuQX5U9.mjs} +28 -8
- package/lib/proxy-BbuQX5U9.mjs.map +1 -0
- package/lib/{quota-summary-adID82I2.mjs → quota-summary-DEA3P3Zh.mjs} +3 -3
- package/lib/{quota-summary-adID82I2.mjs.map → quota-summary-DEA3P3Zh.mjs.map} +1 -1
- package/lib/{translate-YhGDUuVa.mjs → translate-B9ZOauqw.mjs} +2 -2
- package/lib/{translate-YhGDUuVa.mjs.map → translate-B9ZOauqw.mjs.map} +1 -1
- package/lib/web/plugin.mjs +102 -8
- package/lib/web/plugin.mjs.map +1 -1
- package/package.json +4 -5
- package/lib/parse-Bs4rPkHA.mjs +0 -190
- package/lib/parse-Bs4rPkHA.mjs.map +0 -1
- package/lib/plugin-common-B7OSfnyl.mjs.map +0 -1
- package/lib/proxy-DfaL73mL.mjs.map +0 -1
|
@@ -170,9 +170,19 @@ function formatTieredModelName(modelId) {
|
|
|
170
170
|
return part.charAt(0).toUpperCase() + part.slice(1);
|
|
171
171
|
}).join(" ");
|
|
172
172
|
}
|
|
173
|
-
/**
|
|
173
|
+
/**
|
|
174
|
+
* Ids the picker must not offer: tab-completion helpers and the per-tab session
|
|
175
|
+
* ids that ride the same role lists.
|
|
176
|
+
*
|
|
177
|
+
* Both shapes are discoverable — they appear in \`models\` — but neither is an
|
|
178
|
+
* agent chat model. The \`tab_\` prefix is the older shape; \`chat_<digits>\` is
|
|
179
|
+
* the live one (\`chat_20706\`), and upstream names those under \`tabModelIds\`
|
|
180
|
+
* rather than by prefix, so an account whose discovery omits the role list would
|
|
181
|
+
* otherwise render a raw id with no metadata. Deciding it from the id here keeps
|
|
182
|
+
* the catalog-only fallback and the role-based hiding in agreement.
|
|
183
|
+
*/
|
|
174
184
|
function isChatCallableModelId(modelId) {
|
|
175
|
-
return !modelId.startsWith("tab_");
|
|
185
|
+
return !modelId.startsWith("tab_") && !/^chat_\d+$/.test(modelId);
|
|
176
186
|
}
|
|
177
187
|
function catalogModel(modelId) {
|
|
178
188
|
const existing = CATALOG_BY_ID.get(modelId);
|
|
@@ -211,4 +221,4 @@ function isLevelThinkingModel(modelId) {
|
|
|
211
221
|
//#endregion
|
|
212
222
|
export { isLevelThinkingModel as i, catalogModel as n, isChatCallableModelId as r, AGY_PUBLIC_MODELS as t };
|
|
213
223
|
|
|
214
|
-
//# sourceMappingURL=catalog-
|
|
224
|
+
//# sourceMappingURL=catalog-BRHHLLd5.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog-
|
|
1
|
+
{"version":3,"file":"catalog-BRHHLLd5.mjs","names":[],"sources":["../src/adapter/catalog.ts"],"sourcesContent":["/**\n * Pinned agy model catalog (metadata only — dynamic discovery is primary).\n *\n * Adapted from OmniRoute's `AGY_PUBLIC_MODELS` (MIT, see NOTICE.md), which was\n * pinned from the live `v1internal:fetchAvailableModels` endpoint. The dynamic\n * endpoint supplies ids + quotaInfo; this catalog supplies the capability\n * metadata the endpoint omits (context length, output cap, reasoning/vision/\n * tool-calling). Tab-completion models are intentionally excluded.\n */\n\nexport interface CatalogModel {\n id: string\n name: string\n contextLength: number\n maxOutputTokens: number\n supportsReasoning?: boolean\n supportsVision?: boolean\n toolCalling?: boolean\n /** Level-thinking: 'level' means single id + selectable low/medium/high via thinkingLevel. Omit = level bound to id. */\n thinking?: 'level'\n}\n\nexport const AGY_PUBLIC_MODELS: readonly CatalogModel[] = [\n { id: 'gemini-3.8-flash-tiered', name: 'Gemini 3.8 Flash', contextLength: 1048576, maxOutputTokens: 65536, supportsReasoning: true, supportsVision: true, toolCalling: true, thinking: 'level' },\n { id: 'gemini-3.7-flash-tiered', name: 'Gemini 3.7 Flash', contextLength: 1048576, maxOutputTokens: 65536, supportsReasoning: true, supportsVision: true, toolCalling: true, thinking: 'level' },\n { id: 'gemini-3.6-flash-tiered', name: 'Gemini 3.6 Flash (Tiered)', contextLength: 1048576, maxOutputTokens: 65536, supportsReasoning: true, supportsVision: true, toolCalling: true, thinking: 'level' },\n { id: 'gemini-3.6-flash-high', name: 'Gemini 3.6 Flash (High)', contextLength: 1048576, maxOutputTokens: 65536, supportsReasoning: true, supportsVision: true, toolCalling: true },\n { id: 'gemini-3.6-flash-medium', name: 'Gemini 3.6 Flash (Medium)', contextLength: 1048576, maxOutputTokens: 65536, supportsReasoning: true, supportsVision: true, toolCalling: true },\n { id: 'gemini-3.6-flash-low', name: 'Gemini 3.6 Flash (Low)', contextLength: 1048576, maxOutputTokens: 65536, supportsReasoning: true, supportsVision: true, toolCalling: true },\n // Claude family: this channel rejects maxOutputTokens above 64000 for these\n // ids (64001+ -> 400 INVALID_ARGUMENT; 64000 passes). Measured, not derived\n // from Anthropic's public limits — see translate.ts AGY_CLAUDE_MAX_OUTPUT_TOKENS.\n // This value is the harness-injected default, so it must stay at or under the\n // cap or every Claude request fails.\n { id: 'claude-opus-4-6-thinking', name: 'Claude Opus 4.6 (Thinking)', contextLength: 1048576, maxOutputTokens: 64000, supportsReasoning: true, supportsVision: true, toolCalling: true },\n { id: 'claude-sonnet-4-6', name: 'Claude Sonnet 4.6 (Thinking)', contextLength: 1048576, maxOutputTokens: 64000, supportsReasoning: true, supportsVision: true, toolCalling: true },\n { id: 'gemini-pro-agent', name: 'Gemini 3.1 Pro (High)', contextLength: 1048576, maxOutputTokens: 65535, supportsReasoning: true, supportsVision: true, toolCalling: true },\n { id: 'gemini-3.1-pro-low', name: 'Gemini 3.1 Pro (Low)', contextLength: 1048576, maxOutputTokens: 65535, supportsReasoning: true, supportsVision: true, toolCalling: true },\n { id: 'gemini-3-flash-agent', name: 'Gemini 3.5 Flash (High)', contextLength: 1048576, maxOutputTokens: 65536, supportsReasoning: true, supportsVision: true, toolCalling: true },\n { id: 'gemini-3.5-flash-low', name: 'Gemini 3.5 Flash (Medium)', contextLength: 1048576, maxOutputTokens: 65536, supportsReasoning: true, supportsVision: true, toolCalling: true },\n { id: 'gemini-3.5-flash-extra-low', name: 'Gemini 3.5 Flash (Low)', contextLength: 1048576, maxOutputTokens: 65536, supportsReasoning: true, supportsVision: true, toolCalling: true },\n { id: 'gemini-3.1-flash-lite', name: 'Gemini 3.1 Flash Lite', contextLength: 1048576, maxOutputTokens: 65535, supportsVision: true, toolCalling: true },\n { id: 'gemini-2.5-flash-thinking', name: 'Gemini 2.5 Flash Thinking', contextLength: 1048576, maxOutputTokens: 65535, supportsReasoning: true, supportsVision: true, toolCalling: true },\n { id: 'gemini-2.5-flash', name: 'Gemini 2.5 Flash', contextLength: 1048576, maxOutputTokens: 65535, supportsVision: true, toolCalling: true },\n { id: 'gemini-2.5-flash-lite', name: 'Gemini 2.5 Flash Lite', contextLength: 1048576, maxOutputTokens: 65535, supportsVision: true, toolCalling: true },\n { id: 'gpt-oss-120b-medium', name: 'GPT-OSS 120B (Medium)', contextLength: 131072, maxOutputTokens: 32768, supportsReasoning: true, toolCalling: true },\n]\n\nconst CATALOG_BY_ID = new Map(AGY_PUBLIC_MODELS.map((m) => [m.id, m]))\n\n/** Format dynamic tiered model id to display name (e.g. 'gemini-3.8-flash-tiered' -> 'Gemini 3.8 Flash'). */\nexport function formatTieredModelName(modelId: string): string {\n const base = modelId.replace(/-tiered$/, '')\n return base\n .split('-')\n .map((part) => {\n if (/^\\d+(\\.\\d+)*$/.test(part)) return part\n return part.charAt(0).toUpperCase() + part.slice(1)\n })\n .join(' ')\n}\n\n/**\n * Ids the picker must not offer: tab-completion helpers and the per-tab session\n * ids that ride the same role lists.\n *\n * Both shapes are discoverable — they appear in \\`models\\` — but neither is an\n * agent chat model. The \\`tab_\\` prefix is the older shape; \\`chat_<digits>\\` is\n * the live one (\\`chat_20706\\`), and upstream names those under \\`tabModelIds\\`\n * rather than by prefix, so an account whose discovery omits the role list would\n * otherwise render a raw id with no metadata. Deciding it from the id here keeps\n * the catalog-only fallback and the role-based hiding in agreement.\n */\nexport function isChatCallableModelId(modelId: string): boolean {\n return !modelId.startsWith('tab_') && !/^chat_\\d+$/.test(modelId)\n}\n\nexport function catalogModel(modelId: string): CatalogModel | undefined {\n const existing = CATALOG_BY_ID.get(modelId)\n if (existing) return existing\n if (typeof modelId === 'string' && modelId.endsWith('-tiered')) {\n return {\n id: modelId,\n name: formatTieredModelName(modelId),\n contextLength: 1048576,\n maxOutputTokens: 65536,\n supportsReasoning: true,\n supportsVision: true,\n toolCalling: true,\n thinking: 'level',\n }\n }\n return undefined\n}\n\n/**\n * Level-thinking models: a single id with selectable tiers via `thinkingLevel`.\n *\n * KNOWN GAP (tracked in issue #47, with the measurements): upstream publishes the\n * authoritative grouping as `tieredModelIds` in every `fetchAvailableModels`\n * response — `{ flashLite: [...], flash: [...], pro: ['gemini-3.1-pro-low'] }` —\n * and this rule ignores it. The `-tiered` suffix is a NAMING COINCIDENCE that\n * happens to hold for the three Flash ids, so:\n * - upstream-tiered `gemini-3.1-pro-low` (which does accept `thinkingLevel`,\n * measured) is treated as id-bound and never shows a tier selector;\n * - a tiered model added under any other name is silently excluded — no log,\n * no warning, it simply appears without tiers.\n * The fix is to consult `tieredModelIds` with this function as the offline\n * fallback, and to let the budget card render the tiers a family actually has\n * (Flash: low/medium/high; Pro: low/high only).\n */\nexport function isLevelThinkingModel(modelId: string): boolean {\n if (catalogModel(modelId)?.thinking === 'level') return true\n return typeof modelId === 'string' && modelId.endsWith('-tiered')\n}\n"],"mappings":";AAsBA,MAAa,oBAA6C;CACxD;EAAE,IAAI;EAA2B,MAAM;EAAoB,eAAe;EAAS,iBAAiB;EAAO,mBAAmB;EAAM,gBAAgB;EAAM,aAAa;EAAM,UAAU;CAAQ;CAC/L;EAAE,IAAI;EAA2B,MAAM;EAAoB,eAAe;EAAS,iBAAiB;EAAO,mBAAmB;EAAM,gBAAgB;EAAM,aAAa;EAAM,UAAU;CAAQ;CAC/L;EAAE,IAAI;EAA2B,MAAM;EAA6B,eAAe;EAAS,iBAAiB;EAAO,mBAAmB;EAAM,gBAAgB;EAAM,aAAa;EAAM,UAAU;CAAQ;CACxM;EAAE,IAAI;EAAyB,MAAM;EAA2B,eAAe;EAAS,iBAAiB;EAAO,mBAAmB;EAAM,gBAAgB;EAAM,aAAa;CAAK;CACjL;EAAE,IAAI;EAA2B,MAAM;EAA6B,eAAe;EAAS,iBAAiB;EAAO,mBAAmB;EAAM,gBAAgB;EAAM,aAAa;CAAK;CACrL;EAAE,IAAI;EAAwB,MAAM;EA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EAAyB,eAAe;EAAQ,iBAAiB;EAAO,mBAAmB;EAAM,aAAa;CAAK;AACxJ;AAEA,MAAM,gBAAgB,IAAI,IAAI,kBAAkB,KAAK,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;;AAGrE,SAAgB,sBAAsB,SAAyB;CAE7D,OADa,QAAQ,QAAQ,YAAY,EAC/B,CAAC,CACR,MAAM,GAAG,CAAC,CACV,KAAK,SAAS;EACb,IAAI,gBAAgB,KAAK,IAAI,GAAG,OAAO;EACvC,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,KAAK,MAAM,CAAC;CACpD,CAAC,CAAC,CACD,KAAK,GAAG;AACb;;;;;;;;;;;;AAaA,SAAgB,sBAAsB,SAA0B;CAC9D,OAAO,CAAC,QAAQ,WAAW,MAAM,KAAK,CAAC,aAAa,KAAK,OAAO;AAClE;AAEA,SAAgB,aAAa,SAA2C;CACtE,MAAM,WAAW,cAAc,IAAI,OAAO;CAC1C,IAAI,UAAU,OAAO;CACrB,IAAI,OAAO,YAAY,YAAY,QAAQ,SAAS,SAAS,GAC3D,OAAO;EACL,IAAI;EACJ,MAAM,sBAAsB,OAAO;EACnC,eAAe;EACf,iBAAiB;EACjB,mBAAmB;EACnB,gBAAgB;EAChB,aAAa;EACb,UAAU;CACZ;AAGJ;;;;;;;;;;;;;;;;;AAkBA,SAAgB,qBAAqB,SAA0B;CAC7D,IAAI,aAAa,OAAO,CAAC,EAAE,aAAa,SAAS,OAAO;CACxD,OAAO,OAAO,YAAY,YAAY,QAAQ,SAAS,SAAS;AAClE"}
|
package/lib/cli/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { n as AGY_DEFAULT_REDIRECT_URI } from "../constants-
|
|
2
|
-
import { i as normalizeProxyUrl, n as isProxyReachable, o as proxiedFetch, t as accountFetch } from "../proxy-
|
|
3
|
-
import {
|
|
4
|
-
import { t as exchangeAntigravity } from "../exchange-
|
|
5
|
-
import { n as upsertImportedAccount, r as authorizeAntigravity, t as importManySources } from "../import-
|
|
1
|
+
import { n as AGY_DEFAULT_REDIRECT_URI } from "../constants-CmA9wXNe.mjs";
|
|
2
|
+
import { i as normalizeProxyUrl, n as isProxyReachable, o as proxiedFetch, t as accountFetch } from "../proxy-BbuQX5U9.mjs";
|
|
3
|
+
import { c as resolveAntigravityVersionBounded, f as migrateToAgyDir, g as loadMasterKey, h as deriveKey, i as isAgyDisabled, m as createAesGcmCodec, n as maskProxyUrl, r as AgySessionManager, t as JsonAccountStore, v as resolveDshHome, y as resolveMasterKeyCodec } from "../accounts-CB4blXpP.mjs";
|
|
4
|
+
import { t as exchangeAntigravity } from "../exchange-C-tndv7j.mjs";
|
|
5
|
+
import { n as upsertImportedAccount, r as authorizeAntigravity, t as importManySources } from "../import-SxPDjH3u.mjs";
|
|
6
6
|
import { r as encodeCredentialBlob } from "../blob-D1e7_uT1.mjs";
|
|
7
7
|
import { readFileSync, writeFileSync } from "node:fs";
|
|
8
8
|
import { join } from "node:path";
|
|
@@ -256,7 +256,7 @@ async function statusCommand() {
|
|
|
256
256
|
console.log(` ${marker} [${index}] ${account.email ?? "(no email)"} — ${state}${account.projectId ? ` (project: ${account.projectId})` : ""}${maskedProxy ? ` proxy: ${maskedProxy}` : ""}`);
|
|
257
257
|
const session = await sessions.getSession().catch(() => void 0);
|
|
258
258
|
if (session && session.index === index) try {
|
|
259
|
-
const { fetchAvailableModels } = await import("../models-
|
|
259
|
+
const { fetchAvailableModels } = await import("../models-CjB0rXtI.mjs").then((n) => n.r);
|
|
260
260
|
const discovered = await fetchAvailableModels(session.auth.access, session.account.projectId, accountFetch({ proxyUrl: session.account.proxy }));
|
|
261
261
|
const entries = Object.entries(discovered.models ?? {});
|
|
262
262
|
if (entries.length > 0) {
|