@vibeapi/api-helper 0.0.90 → 0.0.91
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.
|
@@ -62,6 +62,14 @@ export interface CodexRules {
|
|
|
62
62
|
/** Window every model is capped to when the user turns 1M context off. */
|
|
63
63
|
standardContextWindow: number;
|
|
64
64
|
}
|
|
65
|
+
/** Antigravity CLI rules. */
|
|
66
|
+
export interface AgyRules {
|
|
67
|
+
/**
|
|
68
|
+
* Models offered through agy's gateway mode (`AGY_LLM_GATEWAY_MODELS`), in menu order; the first
|
|
69
|
+
* reachable one is agy's default. Only ids in agy's built-in catalog: anything else gets no native tools.
|
|
70
|
+
*/
|
|
71
|
+
gatewayModels: string[];
|
|
72
|
+
}
|
|
65
73
|
export interface ModelRegistryData {
|
|
66
74
|
defaultModels: Models;
|
|
67
75
|
/** Earlier `defaultModels` values per slot; a profile still holding one follows the current default. */
|
|
@@ -75,6 +83,7 @@ export interface ModelRegistryData {
|
|
|
75
83
|
claudeDesktop?: Partial<ClaudeDesktopRules>;
|
|
76
84
|
gatewayModels?: Partial<GatewayModelRules>;
|
|
77
85
|
codex?: Partial<CodexRules>;
|
|
86
|
+
agy?: Partial<AgyRules>;
|
|
78
87
|
/** Oldest tool release vibecli's written config works with (tool id → semver). */
|
|
79
88
|
toolMinVersions?: Record<string, string>;
|
|
80
89
|
/** Addresses the gateway answers on, in the operator's order; used until the gateway's own list is cached. */
|
|
@@ -103,6 +112,7 @@ export declare function getClaudeDesktopRules(): ClaudeDesktopRules;
|
|
|
103
112
|
export declare function getGatewayModelRules(): GatewayModelRules;
|
|
104
113
|
export declare function getBuiltinGatewayAddresses(): GatewayAddress[];
|
|
105
114
|
export declare function getCodexRules(): CodexRules;
|
|
115
|
+
export declare function getAgyRules(): AgyRules;
|
|
106
116
|
/** Compare dotted numeric versions (`2.1.9` < `2.1.10`); missing parts count as 0. */
|
|
107
117
|
export declare function compareVersions(a: string, b: string): number;
|
|
108
118
|
export declare function getToolMinVersion(toolName: string): string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{dirname as e,join as t}from"path";import{fileURLToPath as o}from"url";import{existsSync as n,readFileSync as r}from"fs";const l=e(o(import.meta.url));let s=null;function
|
|
1
|
+
import{dirname as e,join as t}from"path";import{fileURLToPath as o}from"url";import{existsSync as n,readFileSync as r}from"fs";const l=e(o(import.meta.url));let s=null;function u(){return s||(s=function(){const e=[t(l,"..","..","models.json"),t(l,"..","models.json"),t(l,"models.json")];for(const t of e)if(n(t))return JSON.parse(r(t,"utf-8"));throw new Error(`models.json not found, searched: ${e.join(", ")}`)}()),s}export function getDefaultModels(){return{...u().defaultModels}}export function isRetiredDefaultModel(e,t){return u().retiredDefaultModels?.[e]?.includes(t)??!1}export function getDefaultToolModel(){return u().defaultToolModel?.trim()||"gpt-5.5"}export function getToolDefaultModel(e){const t=u().toolDefaults;return t&&Object.prototype.hasOwnProperty.call(t,e)?(t[e]??"").trim():getDefaultToolModel()}export function getPresets(){return[...u().presets]}export function resolvePreset(e){return e.models?{...e.models}:e.model?{haiku:e.model,sonnet:e.model,opus:e.model,reasoning:e.model}:getDefaultModels()}export function getClaudeCodeTierChains(){const e=u().claudeCode?.tierChains??{};return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,[...t]]))}export function getClaudeDesktopRules(){const e=u().claudeDesktop??{};return{oneMillionFallback:[...e.oneMillionFallback??[]],oneMillionExclusions:(e.oneMillionExclusions??[]).map(e=>({...e,models:[...e.models]}))}}export function getGatewayModelRules(){const e=u().gatewayModels??{};return{autoCompactRatio:e.autoCompactRatio??.8,models:(e.models??[]).map(e=>({...e})),retired:[...e.retired??[]]}}export function getBuiltinGatewayAddresses(){return(u().gatewayAddresses??[]).map(e=>({...e}))}export function getCodexRules(){return{standardContextWindow:u().codex?.standardContextWindow??272e3}}export function getAgyRules(){return{gatewayModels:[...u().agy?.gatewayModels??[]]}}export function compareVersions(e,t){const o=e.split(".").map(e=>parseInt(e,10)||0),n=t.split(".").map(e=>parseInt(e,10)||0);for(let e=0;e<Math.max(o.length,n.length);e++){const t=(o[e]??0)-(n[e]??0);if(0!==t)return t}return 0}export function getToolMinVersion(e){return u().toolMinVersions?.[e]?.trim()||null}export function reloadRegistry(){s=null}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{existsSync as t,readFileSync as r}from"fs";import{join as
|
|
1
|
+
import{existsSync as t,readFileSync as r}from"fs";import{join as e}from"path";import{i18n as n}from"../i18n.js";import{prettyModelName as o}from"../gateway-models.js";import{getAgyRules as i}from"../model-registry.js";import{logger as a}from"../../utils/logger.js";import{readPersistentEnvFile as s,removePersistentEnv as l,writePersistentEnv as c}from"../persistent-env.js";import{backupBeforeWrite as p,atomicWriteFile as g}from"./backup.js";import{mirrorInstallCommand as m}from"./tool-installs.js";import{toolHome as u}from"./types.js";const d="GEMINI_API_KEY",f="GOOGLE_GEMINI_BASE_URL",y="AGY_LLM_GATEWAY_URL",v="AGY_LLM_GATEWAY_API_KEY",h="AGY_LLM_GATEWAY_MODELS",A=[d,f,y,v,h],_="gemini",j=()=>e(u(),".gemini","antigravity-cli"),b=()=>e(j(),"settings.json"),E=()=>e(j(),"vibeapi.env"),w="https://cnb.cool/vibeapi/agy/-/releases/latest/download",P={command:"agy",native:{binDir:"win32"===process.platform?["AppData","Local","agy","bin"]:[".local","bin"],updateArgs:["update"],dataDirs:[]},mirrorScript:{sh:`${w}/install.sh`,ps1:`${w}/install.ps1`}};function C(){if(!t(b()))return{};const e=r(b(),"utf-8");if(!e.trim())return{};try{const t=JSON.parse(e);if(!(n=t)||"object"!=typeof n||Array.isArray(n))throw new Error("settings.json root must be an object");return t}catch(t){throw new Error(`Existing ~/.gemini/antigravity-cli/settings.json cannot be parsed, back it up and fix it first: ${t instanceof Error?t.message:String(t)}`)}var n}function L(t){p(b()),g(b(),JSON.stringify(t,null,2)+"\n")}function M(t){return(t||"").replace(/\/+$/,"").replace(/\/v1(beta)?$/,"")}function G(t){const r=i().gatewayModels,e=t?r.filter(r=>t.models.includes(r)):[];return e.length>0?e:r}function K(t,r,e){return c("agy",E(),{[d]:t,[f]:r,[y]:r,[v]:t,[h]:e.join(",")}).rcFiles}const S=t=>o(t.replace(/-preview$/,""));let Y=null,k=null;export const antigravityAdapter={name:"agy",displayName:"Antigravity CLI",command:"agy",installCommand:m(P),installSpec:P,configPath:b(),wantsModelCatalog:!0,loadPrivateConfig(t){const r=C(),e=G(t.catalog);Y=K(t.apiKey,M(t.baseUrl),e),k=e,r.modelProvider!==_&&(r.modelProvider=_,L(r))},unloadPrivateConfig(){try{const t=C();t.modelProvider===_&&(delete t.modelProvider,L(t))}catch(t){a.logError("antigravityAdapter.unloadPrivateConfig",t)}l("agy",E(),A)},listedModels(){if(null===antigravityAdapter.detectCurrentConfig().apiKey)return null;const t=s(E())[h];return t?t.split(",").filter(Boolean):[]},refreshModelMenu(t){const r=s(E()),e=G(t.catalog),n=r[f]||M(t.baseUrl),o=r[d]||t.apiKey;r[h]===e.join(",")&&r[y]===n&&r[v]===o||K(o,n,e)},detectCurrentConfig(){try{if(C().modelProvider!==_)return{apiKey:null}}catch{return{apiKey:null}}const t=s(E())[d];return{apiKey:t&&t.trim()?t:null}},getConfig(){try{return C()}catch(t){return a.logError("antigravityAdapter.getConfig",t),null}},applyNotes(){const t=[];if(k&&k.length>0){const r=k.map(S);t.push({kind:"summary",text:n.t("tools.agy.menu_written",{count:String(r.length),list:r.join(n.t("tools.grok.list_separator")),default:r[0]})})}return null===Y||(0===Y.length?t.push({kind:"action",text:n.t("tools.agy.reopen_terminal_windows")}):t.push({kind:"action",text:n.t("tools.agy.reopen_terminal",{rc:Y.join(", ")})})),t},backupPaths:()=>[b(),E()],forceResetPaths:()=>[E()]};
|
package/dist/locales/en_US.json
CHANGED
|
@@ -359,6 +359,7 @@
|
|
|
359
359
|
"tools": {
|
|
360
360
|
"version_outdated": "version {{current}} is too old (needs {{min}} or later); upgrade with {{upgrade}}",
|
|
361
361
|
"agy": {
|
|
362
|
+
"menu_written": "{{count}} models in the menu ({{list}}), default {{default}}",
|
|
362
363
|
"reopen_terminal": "Key and address were added to {{rc}}; open a new terminal before running agy",
|
|
363
364
|
"reopen_terminal_windows": "Key and address were saved as user environment variables; reopen the terminal before running agy"
|
|
364
365
|
},
|
package/dist/locales/zh_CN.json
CHANGED
|
@@ -359,6 +359,7 @@
|
|
|
359
359
|
"tools": {
|
|
360
360
|
"version_outdated": "版本 {{current}} 过旧,需要 {{min}} 及以上,运行 {{upgrade}} 升级",
|
|
361
361
|
"agy": {
|
|
362
|
+
"menu_written": "模型菜单 {{count}} 个({{list}}),默认 {{default}}",
|
|
362
363
|
"reopen_terminal": "Key 与地址已写入 {{rc}},新开一个终端再运行 agy",
|
|
363
364
|
"reopen_terminal_windows": "Key 与地址已写入用户环境变量,重新打开终端再运行 agy"
|
|
364
365
|
},
|
package/dist/models.json
CHANGED
|
@@ -283,6 +283,15 @@
|
|
|
283
283
|
"codex": {
|
|
284
284
|
"standardContextWindow": 272000
|
|
285
285
|
},
|
|
286
|
+
"agy": {
|
|
287
|
+
"gatewayModels": [
|
|
288
|
+
"gemini-4-argon",
|
|
289
|
+
"gemini-3.8-flash",
|
|
290
|
+
"gemini-3.7-flash",
|
|
291
|
+
"gemini-3.6-flash",
|
|
292
|
+
"gemini-3.1-pro-preview"
|
|
293
|
+
]
|
|
294
|
+
},
|
|
286
295
|
"toolMinVersions": {
|
|
287
296
|
"codex": "0.122.0",
|
|
288
297
|
"claude-code": "2.1.291",
|
package/models.json
CHANGED
|
@@ -283,6 +283,15 @@
|
|
|
283
283
|
"codex": {
|
|
284
284
|
"standardContextWindow": 272000
|
|
285
285
|
},
|
|
286
|
+
"agy": {
|
|
287
|
+
"gatewayModels": [
|
|
288
|
+
"gemini-4-argon",
|
|
289
|
+
"gemini-3.8-flash",
|
|
290
|
+
"gemini-3.7-flash",
|
|
291
|
+
"gemini-3.6-flash",
|
|
292
|
+
"gemini-3.1-pro-preview"
|
|
293
|
+
]
|
|
294
|
+
},
|
|
286
295
|
"toolMinVersions": {
|
|
287
296
|
"codex": "0.122.0",
|
|
288
297
|
"claude-code": "2.1.291",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibeapi/api-helper",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.91",
|
|
4
4
|
"description": "CLI tool for managing AI coding assistants (Claude Code, Codex, OpenClaw, Hermes, AtomCode, Grok Build) with one unified config",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|