@vibeapi/cli 0.0.50 → 0.0.52
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 +2 -2
- package/THIRD_PARTY_NOTICES.md +10 -0
- package/codex-base-instructions.md +277 -0
- package/dist/commands/setup.js +1 -1
- package/dist/lib/api-validator.d.ts +17 -0
- package/dist/lib/api-validator.js +1 -1
- package/dist/lib/claude-code-manager.d.ts +11 -1
- package/dist/lib/claude-code-manager.js +1 -1
- package/dist/lib/gateway-models.d.ts +23 -0
- package/dist/lib/gateway-models.js +1 -0
- package/dist/lib/model-catalog.d.ts +6 -1
- package/dist/lib/model-catalog.js +1 -1
- package/dist/lib/model-registry.d.ts +31 -0
- package/dist/lib/model-registry.js +1 -1
- package/dist/lib/tool-manager.d.ts +9 -0
- package/dist/lib/tool-manager.js +1 -1
- package/dist/lib/tools/claude-code.js +1 -1
- package/dist/lib/tools/claude-desktop.d.ts +2 -0
- package/dist/lib/tools/claude-desktop.js +1 -1
- package/dist/lib/tools/codex-catalog.d.ts +34 -0
- package/dist/lib/tools/codex-catalog.js +1 -0
- package/dist/lib/tools/codex.d.ts +7 -2
- package/dist/lib/tools/codex.js +1 -1
- package/dist/lib/tools/types.d.ts +7 -0
- package/dist/locales/en_US.json +6 -0
- package/dist/locales/zh_CN.json +6 -0
- package/dist/models.json +155 -0
- package/models.json +155 -0
- package/package.json +3 -1
package/dist/lib/tool-manager.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{execSync as o}from"child_process";import{i18n as
|
|
1
|
+
import{execSync as o,spawnSync as n}from"child_process";import{i18n as t}from"./i18n.js";import l from"inquirer";import e from"chalk";import s from"terminal-link";import i from"ora";import{logger as r}from"../utils/logger.js";import{configManager as a}from"./config.js";import{getAdapter as c,listAdapters as d,TOOL_ADAPTERS as u}from"./tools/registry.js";import{backupBeforeWrite as g,listBackups as m,restoreBackup as p}from"./tools/backup.js";import{existsSync as f,rmSync as w}from"fs";import{resolveModelCatalog as h}from"./model-catalog.js";import{getToolMinVersion as _}from"./model-registry.js";function y(o){const n=u[o];return{name:n.name,command:n.command,installCommand:n.installCommand,configPath:n.configPath,displayName:n.displayName,...n.hidden?{hidden:!0}:{}}}export const SUPPORTED_TOOLS=Object.fromEntries(Object.keys(u).map(o=>[o,y(o)]));export class ToolManager{static instance;constructor(){}static getInstance(){return ToolManager.instance||(ToolManager.instance=new ToolManager),ToolManager.instance}isToolInstalled(n){const t=SUPPORTED_TOOLS[n];if(!t)return!1;const l=c(n);if(l?.isInstalled)try{return l.isInstalled()}catch{return!1}try{const n="win32"===process.platform?`where ${t.command}`:`which ${t.command}`;return o(n,{stdio:"pipe"}),!0}catch{return!1}}async installTool(n){const a=SUPPORTED_TOOLS[n];if(!a)throw new Error(`Unknown tool: ${n}`);const c=i(t.t("wizard.installing_tool")).start();try{c.info(e.gray("$ ")+e.white(a.installCommand)),c.stop(),o(a.installCommand,{stdio:"inherit"}),c.succeed(t.t("wizard.tool_installed"))}catch(i){c.fail(t.t("wizard.install_failed"));const d=(i.message||"")+(i.stderr?.toString()||"")+(i.stdout?.toString()||"");if(!(d.includes("EACCES")||d.includes("permission denied")||d.includes("EPERM")||243===i.status))throw new Error(`Failed to install ${a.displayName}: ${i}`);if(console.log("\n⚠️ "+t.t("install.permission_detected")+"\n"),"win32"===process.platform)try{const n=a.installCommand.replace("npm install -g","npm install -g --force");return console.log("🔧 "+t.t("install.trying_solution",{num:"1",desc:t.t("install.using_force")})),console.log(e.gray("$ ")+e.white(n)),o(n,{stdio:"inherit"}),void console.log("\n✅ "+t.t("install.permission_fixed"))}catch(o){r.warn("Retry install failed:",o),console.log("\n❌ "+t.t("install.auto_fix_failed")),console.log(e.yellow("\n📌 "+t.t("install.windows_solutions"))),console.log(""),console.log(e.cyan.bold(t.t("install.windows_solution_1_title"))),console.log(e.gray(" "+t.t("install.windows_solution_1_step1"))),console.log(e.gray(" "+t.t("install.windows_solution_1_step2"))),console.log(e.gray(" "+t.t("install.windows_solution_1_step3"))),console.log(e.white(` ${a.installCommand}`)),console.log(""),console.log(e.cyan.bold(t.t("install.windows_solution_2_title"))),console.log(e.gray(" "+t.t("install.windows_solution_2_command"))),console.log(e.white(` ${a.installCommand.replace("npm install -g","npm install -g --prefix=%APPDATA%\\npm")}`)),console.log("");const{action:s}=await l.prompt([{type:"list",name:"action",message:t.t("install.what_next"),choices:[{name:t.t("install.installed_continue"),value:"continue"},{name:t.t("install.cancel_install"),value:"cancel"}]}]);if("cancel"===s)throw new Error(t.t("install.user_cancelled"));if(!this.isToolInstalled(n))throw console.log(e.red("\n❌ "+t.t("install.still_not_installed",{tool:a.displayName}))),new Error(`${a.displayName} is not installed`);return void console.log(e.green("\n✅ "+t.t("install.verified_success",{tool:a.displayName})))}console.log(e.yellow("\n📌 "+t.t("install.unix_solutions"))),console.log(""),console.log(e.cyan.bold(t.t("install.unix_solution_1_title"))),console.log(e.gray(" "+t.t("install.unix_solution_1_desc"))),console.log(e.white(` sudo ${a.installCommand}`)),console.log("");const u="https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally",g=s(u,u,{fallback:()=>u});console.log(e.cyan.bold(t.t("install.unix_solution_2_title"))),console.log(e.gray(" "+t.t("install.unix_solution_2_desc"))),console.log(e.blue(" 📖 "+t.t("install.npm_docs_link")+": ")+g),console.log("");const{action:m}=await l.prompt([{type:"list",name:"action",message:t.t("install.what_next"),choices:[{name:t.t("install.installed_continue"),value:"continue"},{name:t.t("install.cancel_install"),value:"cancel"}]}]);if("cancel"===m)throw new Error(t.t("install.user_cancelled"));if(!this.isToolInstalled(n))throw console.log(e.red("\n❌ "+t.t("install.still_not_installed",{tool:a.displayName}))),new Error(`${a.displayName} is not installed`);console.log(e.green("\n✅ "+t.t("install.verified_success",{tool:a.displayName})))}}getToolConfig(o){const n=c(o);if(!n)throw new Error(`Unknown tool: ${o}`);try{return n.getConfig()}catch(n){return r.warn(`Failed to read config for ${o}:`,n),r.logError(`ToolManager.getToolConfig(${o})`,n),null}}updateToolConfig(o,n){const t=c(o);if(!t)throw new Error(`Unknown tool: ${o}`);if(!t.updateConfig)throw new Error(`Tool ${o} does not support raw config updates`);t.updateConfig(n)}forceResetConfig(o){const n=c(o);if(!n)throw new Error(`Unknown tool: ${o}`);const t=n.forceResetPaths?n.forceResetPaths():this.backupPathsFor(n),l=[];for(const o of t)f(o)&&(g(o),w(o,{force:!0}),l.push(o));return l}loadPrivateConfig(o,n,t,l,e={}){const s=c(o);if(!s)throw new Error(`Unknown tool: ${o}`);e.force&&this.forceResetConfig(o),s.loadPrivateConfig({apiKey:n,baseUrl:a.getBaseUrl(),models:t,settings:a.getToolSettings(o),...l?{catalog:l}:{}})}async applyPrivateConfig(o,n,t,l={}){const e=c(o);if(!e)throw new Error(`Unknown tool: ${o}`);const s=e.wantsModelCatalog?await h(n):null;l.force?this.loadPrivateConfig(o,n,t,s??void 0,{force:!0}):s?this.loadPrivateConfig(o,n,t,s):this.loadPrivateConfig(o,n,t)}applyNotes(o){const n=c(o);if(!n)return[];const l=[];try{n.applyNotes&&l.push(...n.applyNotes())}catch(n){r.logError(`ToolManager.applyNotes(${o})`,n)}const e=this.outdatedVersion(o);return e&&l.push(t.t("tools.version_outdated",{tool:n.displayName,current:e.current,min:e.min,upgrade:n.upgradeCommand||n.installCommand})),l}installedVersion(o){const t=c(o);if(!t)return null;if(t.installedVersion)try{return t.installedVersion()}catch(n){return r.logError(`ToolManager.installedVersion(${o})`,n),null}if(t.isInstalled)return null;try{const o=`${n(t.command,["--version"],{encoding:"utf-8",timeout:1e4,windowsHide:!0,shell:"win32"===process.platform,stdio:["ignore","pipe","pipe"]}).stdout??""}`.match(/(\d+)\.(\d+)\.(\d+)/);return o?o[0]:null}catch{return null}}outdatedVersion(o){const n=_(o);if(!n)return null;const t=this.installedVersion(o);return t&&compareVersions(t,n)<0?{current:t,min:n}:null}unloadPrivateConfig(o){const n=c(o);if(!n)throw new Error(`Unknown tool: ${o}`);n.unloadPrivateConfig()}async clearPinnedModels(o){const n=c(o);if(!n)throw new Error(`Unknown tool: ${o}`);if(a.setToolModel(o,null),!n.clearPinnedModels)return[];const t=a.getApiKeyForTool(o),l=n.wantsModelCatalog&&t?await h(t):null;return n.clearPinnedModels(l??void 0)}supportsClearPinnedModels(o){return Boolean(c(o)?.clearPinnedModels)}detectCurrentConfig(o){const n=c(o);if(!n)throw new Error(`Unknown tool: ${o}`);return n.detectCurrentConfig()}backupPathsFor(o){return o.backupPaths?o.backupPaths():[o.configPath]}listToolBackups(o){const n=c(o);if(!n)throw new Error(`Unknown tool: ${o}`);return this.backupPathsFor(n).map(o=>({file:o,backups:m(o)}))}restorePrivateConfig(o){const n=c(o);if(!n)throw new Error(`Unknown tool: ${o}`);return this.backupPathsFor(n).map(o=>({file:o,result:p(o)}))}getInstalledTools(){return Object.keys(SUPPORTED_TOOLS).filter(o=>this.isToolInstalled(o))}getSupportedTools(){return d().filter(o=>!o.hidden).map(o=>y(o.name))}isGitInstalled(){try{const n="win32"===process.platform?"where git":"which git";return o(n,{stdio:"pipe"}),!0}catch{return!1}}}export function compareVersions(o,n){const t=o.split(".").map(o=>parseInt(o,10)||0),l=n.split(".").map(o=>parseInt(o,10)||0);for(let o=0;o<Math.max(t.length,l.length);o++){const n=(t[o]??0)-(l[o]??0);if(0!==n)return n}return 0}export const toolManager=ToolManager.getInstance();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{join as e}from"path";import{homedir as
|
|
1
|
+
import{join as e}from"path";import{homedir as t}from"os";import{claudeCodeManager as o}from"../claude-code-manager.js";import{backupBeforeWrite as a}from"./backup.js";import{i18n as n}from"../i18n.js";import{gatewayModelSpecs as d,prettyModelName as i}from"../gateway-models.js";const l=e(t(),".claude","settings.json"),s=e(t(),".claude.json");let c;export const claudeCodeAdapter={name:"claude-code",displayName:"Claude Code",command:"claude",installCommand:"npm install -g @anthropic-ai/claude-code",upgradeCommand:"claude update",configPath:l,wantsModelCatalog:!0,loadPrivateConfig(e){a(l),a(s),c=function(e){if(!e)return;const t=new Set(e.models);return d("claude-code",e.clientModels).filter(e=>t.has(e.id))}(e.catalog),o.loadPrivateConfig(e.apiKey,e.models,e.catalog?.models,c)},unloadPrivateConfig(){a(l),o.unloadPrivateConfig()},detectCurrentConfig:()=>o.detectCurrentConfig(),getConfig:()=>({settings:o.getSettings(),mcp:o.getMCPConfig()}),updateConfig(e){const t=e||{};t.settings&&o.saveSettings(t.settings),t.mcp&&o.saveMCPConfig(t.mcp)},clearPinnedModels:e=>(a(l),o.clearPinnedModels(e?.models)),applyNotes(){const e=o.getLastTierFallbacks().map(e=>n.t("tools.claude_code.tier_fallback",{tier:e.tier,from:e.from,to:e.to}));return c&&c.length>0&&e.push(n.t("tools.claude_code.gateway_models",{list:c.map(e=>e.name||i(e.id)).join(", ")})),e},backupPaths:()=>[l,s],forceResetPaths:()=>[l]};
|
|
@@ -13,6 +13,8 @@ export interface InferenceModel {
|
|
|
13
13
|
name: string;
|
|
14
14
|
labelOverride: string;
|
|
15
15
|
supports1m?: boolean;
|
|
16
|
+
/** With `supports1m`: show one option that requests 1M instead of two. */
|
|
17
|
+
prefer1m?: boolean;
|
|
16
18
|
anthropicFamilyTier?: string;
|
|
17
19
|
isFamilyDefault?: boolean;
|
|
18
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{chmodSync as e,existsSync as t,mkdirSync as o,readFileSync as n,rmSync as r}from"fs";import{dirname as s}from"path";import{join as i}from"path";import{randomUUID as a}from"crypto";import{execFileSync as l}from"child_process";import{userInfo as c}from"os";import{logger as d}from"../../utils/logger.js";import{i18n as p}from"../i18n.js";import{BRAND_NAME as u}from"../brand.js";import{backupBeforeWrite as f,atomicWriteFile as m}from"./backup.js";import{toolHome as g}from"./types.js";import{baseModelId as y,isClaudeModel as h}from"../model-catalog.js";const C=u;export const CLAUDE_DESKTOP_HIDE_OFFICIAL_LOGIN_SETTING="hide_official_login";const k=["Claude_pzs8sxrjxfjjc","AnthropicPBC.Claude_fnn82j28hfe8t"],_=/^[a-f0-9-]{36}$/;function b(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}export function claudeDesktopUserDataDir(){const e=process.env.CLAUDE_USER_DATA_DIR?.trim();if(e)return e;const o=g(),n=Boolean(process.env.VIBECLI_TEST_HOME?.trim());switch(process.platform){case"darwin":return i(o,"Library","Application Support","Claude-3p");case"win32":{const e=!n&&process.env.LOCALAPPDATA?process.env.LOCALAPPDATA:i(o,"AppData","Local");return k.map(t=>i(e,"Packages",t,"LocalCache","Local","Claude-3p")).find(e=>t(e))??i(e,"Claude-3p")}default:{const e=!n&&process.env.XDG_CONFIG_HOME?process.env.XDG_CONFIG_HOME:i(o,".config");return i(e,"Claude-3p")}}}const D=()=>i(claudeDesktopUserDataDir(),"configLibrary"),A=()=>i(D(),"_meta.json"),w=e=>i(D(),`${e}.json`),M=()=>i(claudeDesktopUserDataDir(),"claude_desktop_config.json");function E(e){if(!t(e))return null;const o=n(e,"utf-8");if(!o.trim())return null;try{const e=JSON.parse(o);return b(e)?e:null}catch(t){throw new Error(`Existing ${e} cannot be parsed, back it up and fix it first: ${t instanceof Error?t.message:String(t)}`)}}function v(n,r){const i=s(n);t(i)||o(i,{recursive:!0,mode:448}),f(n),m(n,JSON.stringify(r,null,2)+"\n");try{e(n,384)}catch(e){d.logError("claude-desktop.writeJson.chmod",e)}}function I(){const e=E(A());if(!e)return null;const t=Array.isArray(e.entries)?e.entries.filter(e=>b(e)&&"string"==typeof e.id&&"string"==typeof e.name):[];return{...e,appliedId:"string"==typeof e.appliedId?e.appliedId:"",entries:t}}function P(e){return e?.entries.find(e=>e.name===C&&_.test(e.id))}const S={opus:0,fable:1,sonnet:2,haiku:3};function L(e){let t=/^claude-(opus|sonnet|haiku|fable)-(\d+(?:-\d+)*)/i.exec(e);return t?{family:t[1].toLowerCase(),version:t[2].split("-").map(Number)}:(t=/^claude-(\d+(?:-\d+)*)-(opus|sonnet|haiku)/i.exec(e),t?{family:t[2].toLowerCase(),version:t[1].split("-").map(Number)}:null)}export function humanizeModelId(e){const t=L(e);return t?`${t.family[0].toUpperCase()+t.family.slice(1)} ${t.version.filter(e=>e<1e7).slice(0,2).join(".")}`:e}function O(e){return L(e)?.family}export function buildInferenceModels(e,t){const{primary:o,bySlot:n}=function(e){const t=["opus","sonnet","haiku","reasoning"].map(t=>y(e[t]||"")).filter(Boolean);return{primary:t[0]??"",bySlot:t}}(e),r=new Set,s=t?.labels??{};let i;if(t&&t.models.some(h)){i=[...new Set(t.models.filter(h).map(y))];for(const e of t.oneMillion)r.add(e)}else{i=[];for(const t of["opus","sonnet","haiku","reasoning"]){const o=(e[t]||"").trim(),n=y(o);n&&(i.includes(n)||i.push(n),/\[1m\]/i.test(o)&&r.add(n))}}const a=e=>S[O(e)??""]??9;i.sort((e,t)=>{if(e===o)return-1;if(t===o)return 1;const n=a(e)-a(t);if(0!==n)return n;const r=L(e),s=L(t);return r&&s?function(e,t){const o=Math.max(e.length,t.length);for(let n=0;n<o;n++){const o=(t[n]??0)-(e[n]??0);if(0!==o)return o}return 0}(r.version,s.version):e.localeCompare(t)});const l=new Set,c=new Map;for(const e of n){const t=O(e);t&&i.includes(e)&&!c.has(t)&&c.set(t,e)}return i.map(e=>{const t=O(e),o={name:e,labelOverride:s[e]||humanizeModelId(e)};if(r.has(e)&&(o.supports1m=!0),t){o.anthropicFamilyTier=t;const n=c.get(t);n&&n!==e||l.has(t)||(o.isFamilyDefault=!0,l.add(t))}return o})}let j=null,x=null;function T(e){return{inferenceProvider:"gateway",inferenceCredentialKind:"static",inferenceGatewayBaseUrl:(e.baseUrl||"").trim().replace(/\/+$/,""),inferenceGatewayApiKey:e.apiKey,inferenceModels:buildInferenceModels(e.models,e.catalog),disableDeploymentModeChooser:!1!==e.settings?.hide_official_login,chatTabEnabled:!0,chatAdvancedFileAnalysisEnabled:!0,autoModeEnabled:!0,coworkEgressAllowedHosts:["*"],disableEssentialTelemetry:!0,disableNonessentialTelemetry:!0,disableNonessentialServices:!0}}const G="HKCU\\SOFTWARE\\Policies\\Claude",U="HKLM\\SOFTWARE\\Policies\\Claude",$="vibecli-claude-policy.reg",K=e=>l("reg",e,{stdio:["ignore","pipe","pipe"]}).toString();let N=K;export function setRegRunnerForTests(e){N=e??K}function R(){return"win32"===process.platform}function F(e){let t;try{t=N(["query",e])}catch{return null}const o=new Map;for(const e of t.split(/\r?\n/)){const t=/^\s{2,}(\S+)\s+(REG_[A-Z_]+)\s*(.*)$/.exec(e);t&&o.set(t[1],t[3])}return o}function H(){if(null===F(G))return;const e=i(claudeDesktopUserDataDir(),$);try{t(s(e))||o(s(e),{recursive:!0,mode:448}),f(e),N(["export",G,e,"/y"])}catch(e){d.logError("claude-desktop.snapshotPolicy",e)}}const B=Object.keys(T({apiKey:"",baseUrl:"",models:{haiku:"",sonnet:"",opus:"",reasoning:""}}));export function detectManagedConfig(){try{if("darwin"===process.platform){let e="";try{e=c().username}catch{}return[e?`/Library/Managed Preferences/${e}/com.anthropic.claudefordesktop.plist`:"","/Library/Managed Preferences/com.anthropic.claudefordesktop.plist"].filter(Boolean).find(e=>t(e))??null}if("win32"===process.platform)return F(U)?U:null;const e="/etc/claude-desktop/managed-settings.json";return t(e)?e:null}catch(e){return d.logError("claude-desktop.detectManagedConfig",e),null}}const z="darwin"===process.platform?"open -a Claude":"win32"===process.platform?"Claude":"claude-desktop",J="https://claude.ai/download",W="darwin"===process.platform?`open ${J}`:"win32"===process.platform?`start ${J}`:`xdg-open ${J}`;export const claudeDesktopAdapter={name:"claude-desktop",displayName:"Claude Desktop",command:z,installCommand:W,configPath:A(),isInstalled:function(){const e=g();let o;switch(process.platform){case"darwin":o=["/Applications/Claude.app",i(e,"Applications","Claude.app")];break;case"win32":{const t=process.env.LOCALAPPDATA||i(e,"AppData","Local");o=[i(t,"AnthropicClaude"),i(t,"Programs","Claude"),...k.map(e=>i(t,"Packages",e))];break}default:o=["/usr/lib/claude-desktop","/opt/Claude","/usr/bin/claude-desktop",i(e,".local","bin","claude-desktop")]}return o.push(claudeDesktopUserDataDir(),i(claudeDesktopUserDataDir(),"..","Claude")),o.some(e=>t(e))},wantsModelCatalog:!0,loadPrivateConfig(e){const t=I()??{appliedId:"",entries:[]};let o=P(t);o||(o={id:a(),name:C},t.entries.push(o));const n=T(e);x=!0===n.disableDeploymentModeChooser,j={models:n.inferenceModels,source:e.catalog?e.catalog.oneMillionSource:"slots",groups:e.catalog?.matchedGroups??[]};const r=E(w(o.id))??{};v(w(o.id),{...r,...n}),t.appliedId=o.id,v(A(),t);const s=E(M())??{};"3p"!==s.deploymentMode&&v(M(),{...s,deploymentMode:"3p"}),R()&&function(e){H();for(const[t,o]of Object.entries(e)){const[e,n]="boolean"==typeof o?["REG_DWORD",o?"1":"0"]:"string"==typeof o?["REG_SZ",o]:["REG_SZ",JSON.stringify(o)];N(["add",G,"/v",t,"/t",e,"/d",n,"/f"])}}(n)},unloadPrivateConfig(){R()&&function(e){const t=F(G);if(!t)return;H();let o=t.size;for(const n of e)t.has(n)&&(N(["delete",G,"/v",n,"/f"]),o-=1);o<=0&&N(["delete",G,"/f"])}(B);const e=I(),t=P(e);if(!e||!t)return;f(w(t.id)),r(w(t.id),{force:!0});const o=e.entries.filter(e=>e.id!==t.id);0===o.length?(f(A()),r(A(),{force:!0})):v(A(),{...e,entries:o,appliedId:e.appliedId===t.id?o[0].id:e.appliedId})},detectCurrentConfig(){try{if(R()){const e=F(G)?.get("inferenceGatewayApiKey");if(e)return{apiKey:e}}const e=P(I());if(!e)return{apiKey:null};const t=E(w(e.id)),o=t?.inferenceGatewayApiKey;return{apiKey:"string"==typeof o&&o?o:null}}catch(e){return d.logError("claude-desktop.detectCurrentConfig",e),{apiKey:null}}},getConfig(){try{const e=I(),t=P(e);return{meta:e,applied:t?E(w(t.id)):null,desktop:E(M()),...R()?{policy:Object.fromEntries(F(G)??[])}:{}}}catch(e){return d.logError("claude-desktop.getConfig",e),null}},clearPinnedModels(){let e=!1;R()&&F(G)?.has("inferenceModels")&&(H(),N(["delete",G,"/v","inferenceModels","/f"]),e=!0);const t=P(I()),o=t?E(w(t.id)):null;if(t&&o&&void 0!==o.inferenceModels){const{inferenceModels:n,...r}=o;v(w(t.id),r),e=!0}return e?["inferenceModels"]:[]},applyNotes(){const e=[];if(j){const t=j.models.map(e=>`${e.labelOverride}${e.supports1m?" (1M)":""}`).join(", ");e.push(p.t(`tools.claude_desktop.models_written_${j.source}`,{count:String(j.models.length),list:t,groups:j.groups.join(" / ")}))}null!==x&&e.push(p.t(x?"tools.claude_desktop.official_login_hidden":"tools.claude_desktop.official_login_shown")),e.push(p.t("tools.claude_desktop.restart_hint")),R()&&e.push(p.t("tools.claude_desktop.registry_written",{key:G}));const t=detectManagedConfig();return t&&e.push(p.t("tools.claude_desktop.managed_conflict",{path:t})),e},forceResetPaths(){const e=[A(),M()];try{const t=P(I());t&&e.push(w(t.id))}catch{}return e},backupPaths(){const e=[A(),M()];R()&&e.push(i(claudeDesktopUserDataDir(),$));try{const t=P(I());t&&e.push(w(t.id))}catch{}return e}};
|
|
1
|
+
import{chmodSync as e,existsSync as t,mkdirSync as o,readdirSync as n,readFileSync as r,rmSync as s}from"fs";import{dirname as i}from"path";import{join as a}from"path";import{randomUUID as l}from"crypto";import{execFileSync as c}from"child_process";import{userInfo as p}from"os";import{logger as d}from"../../utils/logger.js";import{i18n as u}from"../i18n.js";import{BRAND_NAME as f}from"../brand.js";import{backupBeforeWrite as m,atomicWriteFile as g}from"./backup.js";import{toolHome as h}from"./types.js";import{baseModelId as y,isClaudeModel as b}from"../model-catalog.js";const C=f;export const CLAUDE_DESKTOP_HIDE_OFFICIAL_LOGIN_SETTING="hide_official_login";const k=["Claude_pzs8sxrjxfjjc","AnthropicPBC.Claude_fnn82j28hfe8t"],A=/^[a-f0-9-]{36}$/;function _(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}export function claudeDesktopUserDataDir(){const e=process.env.CLAUDE_USER_DATA_DIR?.trim();if(e)return e;const o=h(),n=Boolean(process.env.VIBECLI_TEST_HOME?.trim());switch(process.platform){case"darwin":return a(o,"Library","Application Support","Claude-3p");case"win32":{const e=!n&&process.env.LOCALAPPDATA?process.env.LOCALAPPDATA:a(o,"AppData","Local");return k.map(t=>a(e,"Packages",t,"LocalCache","Local","Claude-3p")).find(e=>t(e))??a(e,"Claude-3p")}default:{const e=!n&&process.env.XDG_CONFIG_HOME?process.env.XDG_CONFIG_HOME:a(o,".config");return a(e,"Claude-3p")}}}const D=()=>a(claudeDesktopUserDataDir(),"configLibrary"),w=()=>a(D(),"_meta.json"),E=e=>a(D(),`${e}.json`),M=()=>a(claudeDesktopUserDataDir(),"claude_desktop_config.json");function v(e){if(!t(e))return null;const o=r(e,"utf-8");if(!o.trim())return null;try{const e=JSON.parse(o);return _(e)?e:null}catch(t){throw new Error(`Existing ${e} cannot be parsed, back it up and fix it first: ${t instanceof Error?t.message:String(t)}`)}}function P(n,r){const s=i(n);t(s)||o(s,{recursive:!0,mode:448}),m(n),g(n,JSON.stringify(r,null,2)+"\n");try{e(n,384)}catch(e){d.logError("claude-desktop.writeJson.chmod",e)}}function O(){const e=v(w());if(!e)return null;const t=Array.isArray(e.entries)?e.entries.filter(e=>_(e)&&"string"==typeof e.id&&"string"==typeof e.name):[];return{...e,appliedId:"string"==typeof e.appliedId?e.appliedId:"",entries:t}}function S(e){return e?.entries.find(e=>e.name===C&&A.test(e.id))}const j={opus:0,fable:1,sonnet:2,haiku:3};function I(e){let t=/^claude-(opus|sonnet|haiku|fable)-(\d+(?:-\d+)*)/i.exec(e);return t?{family:t[1].toLowerCase(),version:t[2].split("-").map(Number)}:(t=/^claude-(\d+(?:-\d+)*)-(opus|sonnet|haiku)/i.exec(e),t?{family:t[2].toLowerCase(),version:t[1].split("-").map(Number)}:null)}export function humanizeModelId(e){const t=I(e);return t?`${t.family[0].toUpperCase()+t.family.slice(1)} ${t.version.filter(e=>e<1e7).slice(0,2).join(".")}`:e}function x(e){return I(e)?.family}export function buildInferenceModels(e,t){const{primary:o,bySlot:n}=function(e){const t=["opus","sonnet","haiku","reasoning"].map(t=>y(e[t]||"")).filter(Boolean);return{primary:t[0]??"",bySlot:t}}(e),r=new Set,s=t?.labels??{};let i;if(t&&t.models.some(b)){i=[...new Set(t.models.filter(b).map(y))];for(const e of t.oneMillion)r.add(e)}else{i=[];for(const t of["opus","sonnet","haiku","reasoning"]){const o=(e[t]||"").trim(),n=y(o);n&&(i.includes(n)||i.push(n),/\[1m\]/i.test(o)&&r.add(n))}}const a=e=>j[x(e)??""]??9;i.sort((e,t)=>{if(e===o)return-1;if(t===o)return 1;const n=a(e)-a(t);if(0!==n)return n;const r=I(e),s=I(t);return r&&s?function(e,t){const o=Math.max(e.length,t.length);for(let n=0;n<o;n++){const o=(t[n]??0)-(e[n]??0);if(0!==o)return o}return 0}(r.version,s.version):e.localeCompare(t)});const l=new Set,c=new Map;for(const e of n){const t=x(e);t&&i.includes(e)&&!c.has(t)&&c.set(t,e)}return i.map(e=>{const t=x(e),o={name:e,labelOverride:s[e]||humanizeModelId(e)};if(r.has(e)&&(o.supports1m=!0,o.prefer1m=!0),t){o.anthropicFamilyTier=t;const n=c.get(t);n&&n!==e||l.has(t)||(o.isFamilyDefault=!0,l.add(t))}return o})}let L=null,T=null;function $(e){return{inferenceProvider:"gateway",inferenceCredentialKind:"static",inferenceGatewayBaseUrl:(e.baseUrl||"").trim().replace(/\/+$/,""),inferenceGatewayApiKey:e.apiKey,inferenceModels:buildInferenceModels(e.models,e.catalog),disableDeploymentModeChooser:!1!==e.settings?.hide_official_login,chatTabEnabled:!0,chatAdvancedFileAnalysisEnabled:!0,autoModeEnabled:!0,coworkEgressAllowedHosts:["*"],disableEssentialTelemetry:!0,disableNonessentialTelemetry:!0,disableNonessentialServices:!1}}const G={modelPrefer1mContext:!0,skipWebFetchPreflight:!0,toolSearchEnabled:!0,builtinBrowserEnabled:!0,isDesktopExtensionEnabled:!0,sshHostAllowlist:["*"],claudeAiImport:{enabled:!0,automatic3pImport:!0,exportEnabled:!0},coworkVmIpv6Enabled:!0,mcpToolTimeoutSec:3600,updateViaUpdatesHost:!0};function N(e){return Object.fromEntries(Object.entries(G).filter(([t])=>!e(t)))}const U="HKCU\\SOFTWARE\\Policies\\Claude",F="HKLM\\SOFTWARE\\Policies\\Claude",R="vibecli-claude-policy.reg",K=e=>c("reg",e,{stdio:["ignore","pipe","pipe"]}).toString();let H=K;export function setRegRunnerForTests(e){H=e??K}function B(){return"win32"===process.platform}function V(e){let t;try{t=H(["query",e])}catch{return null}const o=new Map;for(const e of t.split(/\r?\n/)){const t=/^\s{2,}(\S+)\s+(REG_[A-Z_]+)\s*(.*)$/.exec(e);t&&o.set(t[1],t[3])}return o}function W(){if(null===V(U))return;const e=a(claudeDesktopUserDataDir(),R);try{t(i(e))||o(i(e),{recursive:!0,mode:448}),m(e),H(["export",U,e,"/y"])}catch(e){d.logError("claude-desktop.snapshotPolicy",e)}}const z=[...Object.keys($({apiKey:"",baseUrl:"",models:{haiku:"",sonnet:"",opus:"",reasoning:""}})),...Object.keys(G)];export function detectManagedConfig(){try{if("darwin"===process.platform){let e="";try{e=p().username}catch{}return[e?`/Library/Managed Preferences/${e}/com.anthropic.claudefordesktop.plist`:"","/Library/Managed Preferences/com.anthropic.claudefordesktop.plist"].filter(Boolean).find(e=>t(e))??null}if("win32"===process.platform)return V(F)?F:null;const e="/etc/claude-desktop/managed-settings.json";return t(e)?e:null}catch(e){return d.logError("claude-desktop.detectManagedConfig",e),null}}const J=/\d+\.\d+\.\d+/;function Z(e){const t=e=>e.split(".").map(Number);return e.sort((e,o)=>{const[n,r]=[t(e),t(o)];for(let e=0;e<3;e++)if(n[e]!==r[e])return r[e]-n[e];return 0})[0]??null}const X="darwin"===process.platform?"open -a Claude":"win32"===process.platform?"Claude":"claude-desktop",q="darwin"===process.platform||"win32"===process.platform?"https://cnb.cool/vibeapi/claude-desktop/-/releases/latest":"https://claude.ai/download",Q="darwin"===process.platform?`open ${q}`:"win32"===process.platform?`start ${q}`:`xdg-open ${q}`;export const claudeDesktopAdapter={name:"claude-desktop",displayName:"Claude Desktop",command:X,installCommand:Q,configPath:w(),isInstalled:function(){const e=h();let o;switch(process.platform){case"darwin":o=["/Applications/Claude.app",a(e,"Applications","Claude.app")];break;case"win32":{const t=process.env.LOCALAPPDATA||a(e,"AppData","Local");o=[a(t,"AnthropicClaude"),a(t,"Programs","Claude"),...k.map(e=>a(t,"Packages",e))];break}default:o=["/usr/lib/claude-desktop","/opt/Claude","/usr/bin/claude-desktop",a(e,".local","bin","claude-desktop")]}return o.push(claudeDesktopUserDataDir(),a(claudeDesktopUserDataDir(),"..","Claude")),o.some(e=>t(e))},installedVersion:function(){if("darwin"===process.platform){for(const e of["/Applications/Claude.app",a(h(),"Applications","Claude.app")]){const o=a(e,"Contents","Info.plist");if(!t(o))continue;const n=/<key>CFBundleShortVersionString<\/key>\s*<string>([^<]+)<\/string>/.exec(r(o,"utf-8")),s=n?J.exec(n[1])?.[0]:void 0;if(s)return s}return null}if("win32"===process.platform){const e=a(process.env.LOCALAPPDATA||a(h(),"AppData","Local"),"AnthropicClaude");if(t(e)){const t=n(e).map(e=>/^app-(\d+\.\d+\.\d+)$/.exec(e)?.[1]).filter(e=>!!e);if(t.length>0)return Z(t)}const o=k.map(e=>`'${e}'`).join(",");return Z(c("powershell.exe",["-NoProfile","-Command",`Get-AppxPackage | Where-Object { @(${o}) -contains $_.PackageFamilyName } | ForEach-Object { $_.Version.ToString() }`],{encoding:"utf-8",timeout:15e3,windowsHide:!0,stdio:["ignore","pipe","ignore"]}).split(/\r?\n/).flatMap(e=>J.exec(e)?.[0]??[]))}return null},wantsModelCatalog:!0,loadPrivateConfig(e){const t=O()??{appliedId:"",entries:[]};let o=S(t);o||(o={id:l(),name:C},t.entries.push(o));const n=$(e);T=!0===n.disableDeploymentModeChooser,L={models:n.inferenceModels,source:e.catalog?e.catalog.oneMillionSource:"slots",groups:e.catalog?.matchedGroups??[]};const r=v(E(o.id))??{};P(E(o.id),{...N(e=>e in r),...r,...n}),t.appliedId=o.id,P(w(),t);const s=v(M())??{};if("3p"!==s.deploymentMode&&P(M(),{...s,deploymentMode:"3p"}),B()){const e=V(U);!function(e){W();for(const[t,o]of Object.entries(e)){const[e,n]="boolean"==typeof o?["REG_DWORD",o?"1":"0"]:"number"==typeof o?["REG_DWORD",String(o)]:"string"==typeof o?["REG_SZ",o]:["REG_SZ",JSON.stringify(o)];H(["add",U,"/v",t,"/t",e,"/d",n,"/f"])}}({...N(t=>e?.has(t)??!1),...n})}},unloadPrivateConfig(){B()&&function(e){const t=V(U);if(!t)return;W();let o=t.size;for(const n of e)t.has(n)&&(H(["delete",U,"/v",n,"/f"]),o-=1);o<=0&&H(["delete",U,"/f"])}(z);const e=O(),t=S(e);if(!e||!t)return;m(E(t.id)),s(E(t.id),{force:!0});const o=e.entries.filter(e=>e.id!==t.id);0===o.length?(m(w()),s(w(),{force:!0})):P(w(),{...e,entries:o,appliedId:e.appliedId===t.id?o[0].id:e.appliedId})},detectCurrentConfig(){try{if(B()){const e=V(U)?.get("inferenceGatewayApiKey");if(e)return{apiKey:e}}const e=S(O());if(!e)return{apiKey:null};const t=v(E(e.id)),o=t?.inferenceGatewayApiKey;return{apiKey:"string"==typeof o&&o?o:null}}catch(e){return d.logError("claude-desktop.detectCurrentConfig",e),{apiKey:null}}},getConfig(){try{const e=O(),t=S(e);return{meta:e,applied:t?v(E(t.id)):null,desktop:v(M()),...B()?{policy:Object.fromEntries(V(U)??[])}:{}}}catch(e){return d.logError("claude-desktop.getConfig",e),null}},clearPinnedModels(){let e=!1;B()&&V(U)?.has("inferenceModels")&&(W(),H(["delete",U,"/v","inferenceModels","/f"]),e=!0);const t=S(O()),o=t?v(E(t.id)):null;if(t&&o&&void 0!==o.inferenceModels){const{inferenceModels:n,...r}=o;P(E(t.id),r),e=!0}return e?["inferenceModels"]:[]},applyNotes(){const e=[];if(L){const t=L.models.map(e=>`${e.labelOverride}${e.supports1m?" (1M)":""}`).join(", ");e.push(u.t(`tools.claude_desktop.models_written_${L.source}`,{count:String(L.models.length),list:t,groups:L.groups.join(" / ")}))}null!==T&&e.push(u.t(T?"tools.claude_desktop.official_login_hidden":"tools.claude_desktop.official_login_shown")),e.push(u.t("tools.claude_desktop.restart_hint")),B()&&e.push(u.t("tools.claude_desktop.registry_written",{key:U}));const t=detectManagedConfig();return t&&e.push(u.t("tools.claude_desktop.managed_conflict",{path:t})),e},forceResetPaths(){const e=[w(),M()];try{const t=S(O());t&&e.push(E(t.id))}catch{}return e},backupPaths(){const e=[w(),M()];B()&&e.push(a(claudeDesktopUserDataDir(),R));try{const t=S(O());t&&e.push(E(t.id))}catch{}return e}};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type GatewayModelSpec } from '../model-registry.js';
|
|
2
|
+
type Dict = Record<string, unknown>;
|
|
3
|
+
export declare const CODEX_CATALOG_FILE = "vibeapi-model-catalog.json";
|
|
4
|
+
export declare const codexCatalogPath: () => string;
|
|
5
|
+
/** The catalog built into the installed Codex binary; null when no binary answers. */
|
|
6
|
+
export declare function loadBundledCodexModels(): Dict[] | null;
|
|
7
|
+
/**
|
|
8
|
+
* Codex's own entries from the catalog vibecli wrote last time — the fallback
|
|
9
|
+
* when no Codex binary can be run (e.g. it moved), so GPT models stay listed.
|
|
10
|
+
*/
|
|
11
|
+
export declare function loadPreviousCodexModels(): Dict[] | null;
|
|
12
|
+
/** Gateway models the previous catalog listed — what the key could reach last time it was checked. */
|
|
13
|
+
export declare function previousGatewayModelIds(): string[];
|
|
14
|
+
export interface BuildCodexCatalogOptions {
|
|
15
|
+
/** Codex's bundled entries (from the binary or the previous catalog). */
|
|
16
|
+
bundled: Dict[];
|
|
17
|
+
specs: GatewayModelSpec[];
|
|
18
|
+
/** Model ids the key can reach (`/v1/models`); absent offline, when Codex's own GPT entries all stay. */
|
|
19
|
+
keyModels?: string[];
|
|
20
|
+
/** Gateway models to list; normally `keyModels`, offline the ones listed last time. */
|
|
21
|
+
gatewayAvailable: string[];
|
|
22
|
+
oneMillion: boolean;
|
|
23
|
+
/** The model `config.toml` selects — always listed so the picker shows it. */
|
|
24
|
+
selectedModel: string;
|
|
25
|
+
/**
|
|
26
|
+
* Claude models the key's gateway group serves at 1M (from the console's group
|
|
27
|
+
* table). When set, other Claude models get 200K whatever `models.json` says.
|
|
28
|
+
*/
|
|
29
|
+
claudeOneMillion?: string[];
|
|
30
|
+
}
|
|
31
|
+
export declare function buildCodexCatalog(options: BuildCodexCatalogOptions): {
|
|
32
|
+
models: Dict[];
|
|
33
|
+
};
|
|
34
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{spawnSync as t}from"child_process";import{existsSync as e,readFileSync as o}from"fs";import{dirname as n,join as i}from"path";import{fileURLToPath as s}from"url";import{logger as r}from"../../utils/logger.js";import{getCodexRules as l}from"../model-registry.js";import{autoCompactTokens as u,prettyModelName as a}from"../gateway-models.js";import{toolHome as d}from"./types.js";const c=n(s(import.meta.url));export const CODEX_CATALOG_FILE="vibeapi-model-catalog.json";export const codexCatalogPath=()=>i(d(),".codex",CODEX_CATALOG_FILE);function p(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}function _(t){try{const e=JSON.parse(t),o=p(e)&&Array.isArray(e.models)?e.models.filter(p):[];return o.length>0?o:null}catch{return null}}export function loadBundledCodexModels(){for(const o of function(){const t=process.env.VIBECLI_CODEX_BIN;if(void 0!==t)return t.trim()?[t.trim()]:[];const e=["codex"];if("darwin"===process.platform)for(const t of["/Applications",i(d(),"Applications")])e.push(i(t,"ChatGPT.app/Contents/Resources/codex-cli/bin/codex")),e.push(i(t,"Codex.app/Contents/Resources/codex"));return e}()){if("codex"!==o&&!e(o))continue;const n=t(o,["debug","models","--bundled"],{encoding:"utf-8",timeout:2e4,maxBuffer:67108864,windowsHide:!0,shell:"win32"===process.platform&&"codex"===o,stdio:["ignore","pipe","pipe"]});if(0===n.status&&n.stdout){const t=_(n.stdout);if(t)return t}(n.error||0!==n.status)&&r.logError("loadBundledCodexModels",n.error??new Error(`${o} exited ${n.status}`))}return null}export function loadPreviousCodexModels(){const t=m()?.filter(t=>!f(t));return t&&t.length>0?t:null}export function previousGatewayModelIds(){return(m()??[]).filter(f).map(t=>String(t.slug))}function m(){return e(codexCatalogPath())?_(o(codexCatalogPath(),"utf-8")):null}function f(t){return"number"==typeof t.priority&&t.priority>=1e3}let x=null;function w(){if(null!==x)return x;const t=[i(c,"..","..","..","codex-base-instructions.md"),i(c,"..","..","codex-base-instructions.md"),i(c,"codex-base-instructions.md")],n=t.find(t=>e(t));if(!n)throw new Error(`codex-base-instructions.md not found, searched: ${t.join(", ")}`);return x=o(n,"utf-8"),x}function g(t){return"number"==typeof t&&Number.isFinite(t)&&t>0?t:void 0}function h(t,e,o,n){const i=o?t:Math.min(t,e);return{window:i,compact:u(i,n)}}function y(t,e,o,n){const{standardContextWindow:i}=l();let s=g(t.contextWindow)??i;n&&t.id.startsWith("claude-")&&(s=n.has(t.id)?Math.max(s,1e6):Math.min(s,2e5));const{window:r,compact:u}=h(s,i,o,g(t.autoCompactTokens));return{slug:t.id,display_name:t.name||a(t.id),description:t.description??null,supported_reasoning_levels:[],shell_type:"unified_exec",visibility:"list",supported_in_api:!0,priority:e,additional_speed_tiers:[],service_tiers:[],availability_nux:null,upgrade:null,model_messages:{instructions_template:w()},base_instructions:w(),supports_reasoning_summaries:!0,supports_parallel_tool_calls:!1,prefer_websockets:!1,include_skills_usage_instructions:!1,include_plugin_usage_instructions:!1,include_apps_usage_instructions:!1,default_reasoning_summary:"auto",support_verbosity:!1,default_verbosity:null,apply_patch_tool_type:null,web_search_tool_type:"text",truncation_policy:{mode:"bytes",limit:1e4},supports_image_detail_original:!1,context_window:r,max_context_window:r,auto_compact_token_limit:u,effective_context_window_percent:95,experimental_supported_tools:[],input_modalities:["text","image"],supports_search_tool:!1,supports_experimental_context:!1,use_responses_lite:!1,supports_reasoning_effort_updates:!1,node_repl_auto_review_required:!1,node_repl_disabled:!1}}function b(t,e,o){if("list"!==t.visibility)return t;const n=g(t.context_window);if(!n)return t;const i=g(t.max_context_window)??n,s=o?Math.min(g(e?.contextWindow)??i,i):n,{window:r,compact:l}=h(s,n,!0,g(e?.autoCompactTokens));return{...t,context_window:r,auto_compact_token_limit:l}}export function buildCodexCatalog(t){const{bundled:e,specs:o,oneMillion:n,selectedModel:i}=t,s=t.claudeOneMillion?new Set(t.claudeOneMillion):void 0,r=t.keyModels?new Set(t.keyModels):null,l=new Set(t.gatewayAvailable),u=t=>!r||r.has(t)||t===i,a=t=>l.has(t)||t===i,d=new Map(o.map(t=>[t.id,t])),c=[],p=new Set;for(const t of e){const e="string"==typeof t.slug?t.slug:"";e&&!p.has(e)&&("list"!==t.visibility||u(e))&&(p.add(e),c.push(b(t,d.get(e),n)))}const _=[...o];i&&!d.has(i)&&_.push({id:i});for(const t of _)!p.has(t.id)&&a(t.id)&&(p.add(t.id),c.push(y(t,1e3+c.length,n,s)));return{models:c}}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { type ToolAdapter } from './types.js';
|
|
2
|
+
import type { ModelCatalog } from '../model-catalog.js';
|
|
2
3
|
export declare const CODEX_ONE_MILLION_CONTEXT_SETTING = "one_million_context";
|
|
3
|
-
/**
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Re-apply only the context limits (model catalog + context keys) for the 1M
|
|
6
|
+
* switch. Credentials, provider and model selection are untouched; files are only
|
|
7
|
+
* rewritten when something changed.
|
|
8
|
+
*/
|
|
9
|
+
export declare function setCodexOneMillionContext(enabled: boolean, catalog?: ModelCatalog): void;
|
|
5
10
|
export declare const codexAdapter: ToolAdapter;
|
package/dist/lib/tools/codex.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{existsSync as
|
|
1
|
+
import{existsSync as o,readFileSync as e}from"fs";import{join as t}from"path";import*as n from"@iarna/toml";import{logger as r}from"../../utils/logger.js";import{i18n as i}from"../i18n.js";import{backupBeforeWrite as l,atomicWriteFile as a}from"./backup.js";import{pickModel as s,toolHome as d,withV1 as c}from"./types.js";import{getToolDefaultModel as m}from"../model-registry.js";import{buildCodexCatalog as p,codexCatalogPath as _,loadBundledCodexModels as u,loadPreviousCodexModels as f,previousGatewayModelIds as g}from"./codex-catalog.js";import{gatewayModelSpecs as x}from"../gateway-models.js";const y=()=>t(d(),".codex"),C=()=>t(y(),"config.toml"),w=()=>t(y(),"auth.json"),E="OPENAI_API_KEY",j="custom",h=1e6,v=9e5;export const CODEX_ONE_MILLION_CONTEXT_SETTING="one_million_context";function O(o){return!!o&&"object"==typeof o&&!Array.isArray(o)}function b(o,e){return O(o[e])||(o[e]={}),o[e]}function k(){if(!o(C()))return{};const t=e(C(),"utf-8");if(!t.trim())return{};try{const o=n.parse(t);if(!O(o))throw new Error("config.toml root must be a TOML table");return o}catch(o){throw new Error(`Existing ~/.codex/config.toml cannot be parsed, back it up and fix it first: ${o instanceof Error?o.message:String(o)}`)}}function N(){if(!o(w()))return{};try{const o=JSON.parse(e(w(),"utf-8"));return O(o)?o:{}}catch{return{}}}let M=null;function A(t,n,i){const s=!1!==n.settings?.one_million_context;!function(o){o.model_context_window===h&&delete o.model_context_window,o.model_auto_compact_token_limit===v&&delete o.model_auto_compact_token_limit}(t);const d=u()??f();if(!d)return r.logError("codexAdapter.writeModelCatalog",new Error("no Codex binary found; model catalog skipped")),M="skipped",t.model_catalog_json===_()&&delete t.model_catalog_json,void(s&&(t.model_context_window=h,t.model_auto_compact_token_limit=v));const c=n.catalog,m=p({bundled:d,specs:x("codex",c?.clientModels),...c?{keyModels:c.models}:{},gatewayAvailable:c?.models??g(),oneMillion:s,selectedModel:i,..."gateway"===c?.oneMillionSource?{claudeOneMillion:c.oneMillion}:{}});M={listed:m.models.filter(o=>"list"===o.visibility).map(o=>String(o.display_name??o.slug))};const y=JSON.stringify(m,null,2)+"\n",C=_();o(C)&&e(C,"utf-8")===y||(l(C),a(C,y)),t.model_catalog_json=C}export function setCodexOneMillionContext(o,e){const t=k(),r=n.stringify(t),i="string"==typeof t.model?t.model:m("codex");A(t,{settings:{[CODEX_ONE_MILLION_CONTEXT_SETTING]:o},catalog:e},i);const s=n.stringify(t);s!==r&&(l(C()),a(C(),s))}export const codexAdapter={name:"codex",displayName:"Codex",command:"codex",installCommand:"npm install -g @openai/codex",upgradeCommand:"npm install -g @openai/codex@latest",configPath:C(),wantsModelCatalog:!0,applyNotes:()=>"skipped"===M?[i.t("tools.codex.catalog_skipped")]:M?[i.t("tools.codex.catalog_written",{count:String(M.listed.length),list:M.listed.join(", ")})]:[],loadPrivateConfig(o){const e=m("codex"),t=s(o.models,e),r=function(o){return/(?:^|\/)claude(?:-|$)/i.test(o)}(t)?e:t,i=c(o.baseUrl),d=k();d.model=r,d.model_provider=j,d.model_reasoning_effort="xhigh",A(d,o,r);const p=b(d,"model_providers"),_=O(p[j])?{...p[j]}:{};delete _.env_key,p[j]={..._,name:"custom",wire_api:"responses",requires_openai_auth:!0,base_url:i};const u=b(d,"profiles"),f=O(u[r])?{...u[r]}:{};u[r]={...f,model_provider:j,model:r},b(b(d,"tui"),"model_availability_nux")[r]=4;const g=b(d,"features");g.goals=!0,g.js_repl=!1,l(C()),a(C(),n.stringify(d)),function(o){const e=o.trim();if(!e)return;const t={...N(),auth_mode:"apikey",[E]:e};l(w()),a(w(),JSON.stringify(t,null,2)+"\n")}(o.apiKey)},unloadPrivateConfig(){if(!o(C()))return;let e;try{e=k()}catch(o){return void r.logError("codexAdapter.unloadPrivateConfig",o)}const t=e.model_providers;O(t)&&(delete t[j],0===Object.keys(t).length&&delete e.model_providers),e.model_provider===j&&delete e.model_provider,e.model_catalog_json===_()&&delete e.model_catalog_json,l(C()),a(C(),n.stringify(e))},detectCurrentConfig(){const o=N()[E];return{apiKey:"string"==typeof o&&o.trim()?o.trim():null}},getConfig(){try{return k()}catch(o){return r.logError("codexAdapter.getConfig",o),null}},backupPaths:()=>[C(),w(),_()]};
|
|
@@ -38,6 +38,13 @@ export interface ToolAdapter {
|
|
|
38
38
|
command: string;
|
|
39
39
|
/** Shell command that installs the tool globally. */
|
|
40
40
|
installCommand: string;
|
|
41
|
+
/** Shell command that upgrades an installed copy; defaults to `installCommand`. */
|
|
42
|
+
upgradeCommand?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Installed version as `x.y.z`, for tools without a `--version` CLI (GUI
|
|
45
|
+
* apps); null when unknown. Checked against `models.json` → `toolMinVersions`.
|
|
46
|
+
*/
|
|
47
|
+
installedVersion?(): string | null;
|
|
41
48
|
/** Primary config file path (informational; used for status/doctor output). */
|
|
42
49
|
configPath: string;
|
|
43
50
|
/** Hidden tools are still usable by id but omitted from menus. */
|
package/dist/locales/en_US.json
CHANGED
|
@@ -340,6 +340,11 @@
|
|
|
340
340
|
"claude_official_invalid": "Invalid value for --claude-official: {{value}} (expected on or off)"
|
|
341
341
|
},
|
|
342
342
|
"tools": {
|
|
343
|
+
"version_outdated": "{{tool}} {{current}} is too old for this config (needs {{min}} or later); upgrade with {{upgrade}}",
|
|
344
|
+
"codex": {
|
|
345
|
+
"catalog_written": "Codex model list: {{count}} models ({{list}}), each auto-compacting at 80% of its window; quit and reopen the Codex desktop app to apply",
|
|
346
|
+
"catalog_skipped": "Could not read Codex's built-in model list (not installed, or older than 0.122), so the model menu was not updated (GPT models only); install or upgrade Codex and run the setup again to add Claude and other models"
|
|
347
|
+
},
|
|
343
348
|
"claude_desktop": {
|
|
344
349
|
"restart_hint": "Claude Desktop reads its configuration at launch only: fully quit it (⌘Q on macOS) and reopen for the change to take effect",
|
|
345
350
|
"managed_conflict": "Managed configuration found at {{path}}; Claude Desktop prefers it and ignores local settings. Remove that profile / policy first, then relaunch",
|
|
@@ -351,6 +356,7 @@
|
|
|
351
356
|
"official_login_shown": "The official Claude.ai sign-in entry stays visible, so users can switch between the gateway and their own account. Run vibecli setup --claude-official off to hide it"
|
|
352
357
|
},
|
|
353
358
|
"claude_code": {
|
|
359
|
+
"gateway_models": "Added to Claude Code's /model menu: {{list}} (each auto-compacts at 80% of its window; needs Claude Code 2.1.288 or later)",
|
|
354
360
|
"tier_fallback": "This key can't use Claude Code's default {{from}}; the {{tier}} alias now uses {{to}}"
|
|
355
361
|
}
|
|
356
362
|
}
|
package/dist/locales/zh_CN.json
CHANGED
|
@@ -340,6 +340,11 @@
|
|
|
340
340
|
"claude_official_invalid": "--claude-official 的值无效: {{value}}(只接受 on / off)"
|
|
341
341
|
},
|
|
342
342
|
"tools": {
|
|
343
|
+
"version_outdated": "{{tool}} 版本 {{current}} 过旧,至少需要 {{min}} 才能用上这份配置,请运行 {{upgrade}} 升级",
|
|
344
|
+
"codex": {
|
|
345
|
+
"catalog_written": "Codex 模型列表:{{count}} 个模型({{list}}),每个模型用到窗口的 80% 时自动压缩;Codex 桌面版需退出重开后生效",
|
|
346
|
+
"catalog_skipped": "没能从 Codex 读到自带的模型列表(未安装,或版本低于 0.122),模型菜单未更新(只有 GPT 模型);安装或升级 Codex 后再运行一次配置,即可加入 Claude 与国产模型"
|
|
347
|
+
},
|
|
343
348
|
"claude_desktop": {
|
|
344
349
|
"restart_hint": "Claude Desktop 只在启动时读取配置:请完全退出(macOS 按 ⌘Q)再重新打开才会生效",
|
|
345
350
|
"managed_conflict": "检测到托管配置 {{path}},Claude Desktop 会优先使用它并忽略本地配置;请先移除该描述文件 / 策略再重启",
|
|
@@ -351,6 +356,7 @@
|
|
|
351
356
|
"official_login_shown": "官方登录(Claude.ai 账号)入口保持可见,用户可在网关与官方账号间切换;要隐藏运行 vibecli setup --claude-official off"
|
|
352
357
|
},
|
|
353
358
|
"claude_code": {
|
|
359
|
+
"gateway_models": "Claude Code 的 /model 菜单已加入:{{list}}(用到窗口的 80% 时自动压缩,需要 Claude Code 2.1.288 及以上)",
|
|
354
360
|
"tier_fallback": "当前 Key 用不了 Claude Code 默认的 {{from}},{{tier}} 档已改用 {{to}}"
|
|
355
361
|
}
|
|
356
362
|
}
|
package/dist/models.json
CHANGED
|
@@ -55,7 +55,10 @@
|
|
|
55
55
|
"claude-opus-4-7",
|
|
56
56
|
"claude-opus-4-6",
|
|
57
57
|
"claude-opus-5",
|
|
58
|
+
"claude-opus-5-5",
|
|
58
59
|
"claude-sonnet-5",
|
|
60
|
+
"claude-sonnet-5-5",
|
|
61
|
+
"claude-haiku-5-5",
|
|
59
62
|
"claude-fable-5",
|
|
60
63
|
"claude-fable-5-1"
|
|
61
64
|
],
|
|
@@ -65,5 +68,157 @@
|
|
|
65
68
|
"models": ["claude-opus-4-6"]
|
|
66
69
|
}
|
|
67
70
|
]
|
|
71
|
+
},
|
|
72
|
+
"gatewayModels": {
|
|
73
|
+
"autoCompactRatio": 0.8,
|
|
74
|
+
"models": [
|
|
75
|
+
{
|
|
76
|
+
"id": "claude-opus-5-5",
|
|
77
|
+
"name": "Claude Opus 5.5",
|
|
78
|
+
"description": "100 万上下文 | 长时 Agent 编程 | 知识工作",
|
|
79
|
+
"contextWindow": 1000000
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"id": "claude-sonnet-5-5",
|
|
83
|
+
"name": "Claude Sonnet 5.5",
|
|
84
|
+
"description": "100 万上下文 | Agent 编程 | 速度与成本均衡",
|
|
85
|
+
"contextWindow": 1000000
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"id": "claude-fable-5-1",
|
|
89
|
+
"name": "Claude Fable 5.1",
|
|
90
|
+
"description": "100 万上下文 | 长时 Agent 与多步研究",
|
|
91
|
+
"contextWindow": 1000000
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"id": "claude-fable-5",
|
|
95
|
+
"name": "Claude Fable 5",
|
|
96
|
+
"description": "100 万上下文 | 高强度推理 | 长时 Agent",
|
|
97
|
+
"contextWindow": 1000000
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"id": "claude-opus-5",
|
|
101
|
+
"name": "Claude Opus 5",
|
|
102
|
+
"description": "100 万上下文 | Agent 编程",
|
|
103
|
+
"contextWindow": 1000000
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"id": "claude-sonnet-5",
|
|
107
|
+
"name": "Claude Sonnet 5",
|
|
108
|
+
"description": "100 万上下文 | Agent 编程 | 工具调用",
|
|
109
|
+
"contextWindow": 1000000
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"id": "claude-opus-4-8",
|
|
113
|
+
"name": "Claude Opus 4.8",
|
|
114
|
+
"description": "100 万上下文 | 推理 | 编程",
|
|
115
|
+
"contextWindow": 1000000
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"id": "claude-opus-4-7",
|
|
119
|
+
"name": "Claude Opus 4.7",
|
|
120
|
+
"description": "100 万上下文 | 推理 | 编程",
|
|
121
|
+
"contextWindow": 1000000
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"id": "claude-opus-4-6",
|
|
125
|
+
"name": "Claude Opus 4.6",
|
|
126
|
+
"description": "20 万上下文(部分分组无 1M)| 推理 | 编程",
|
|
127
|
+
"contextWindow": 200000
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"id": "claude-sonnet-4-6",
|
|
131
|
+
"name": "Claude Sonnet 4.6",
|
|
132
|
+
"description": "20 万上下文(部分分组无 1M)| Agent 编程",
|
|
133
|
+
"contextWindow": 200000
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"id": "deepseek-v4-pro",
|
|
137
|
+
"name": "DeepSeek V4 Pro",
|
|
138
|
+
"description": "100 万上下文 | 跨文件重构",
|
|
139
|
+
"contextWindow": 1000000
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"id": "deepseek-v4.1-flash",
|
|
143
|
+
"name": "DeepSeek V4.1 Flash",
|
|
144
|
+
"description": "100 万上下文 | 高速档",
|
|
145
|
+
"contextWindow": 1000000
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"id": "deepseek-v4-flash",
|
|
149
|
+
"name": "DeepSeek V4 Flash",
|
|
150
|
+
"description": "100 万上下文 | 高速档",
|
|
151
|
+
"contextWindow": 1000000
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"id": "glm-5.3",
|
|
155
|
+
"name": "GLM 5.3",
|
|
156
|
+
"description": "105 万上下文 | 代码 Agent",
|
|
157
|
+
"contextWindow": 1048576
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"id": "glm-5.3-flash",
|
|
161
|
+
"name": "GLM 5.3 Flash",
|
|
162
|
+
"description": "105 万上下文 | 高速档",
|
|
163
|
+
"contextWindow": 1048576
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"id": "glm-5.2",
|
|
167
|
+
"name": "GLM 5.2",
|
|
168
|
+
"description": "100 万上下文 | 编程",
|
|
169
|
+
"contextWindow": 1000000
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"id": "kimi-k3",
|
|
173
|
+
"name": "Kimi K3",
|
|
174
|
+
"description": "105 万上下文 | 前端编码",
|
|
175
|
+
"contextWindow": 1048576
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"id": "qwen3.8-max",
|
|
179
|
+
"name": "Qwen 3.8 Max",
|
|
180
|
+
"description": "100 万上下文 | 视觉理解",
|
|
181
|
+
"contextWindow": 1000000
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"id": "qwen3.8-flash",
|
|
185
|
+
"name": "Qwen 3.8 Flash",
|
|
186
|
+
"description": "100 万上下文 | 高速档",
|
|
187
|
+
"contextWindow": 1000000
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"id": "qwen3.7-max",
|
|
191
|
+
"name": "Qwen 3.7 Max",
|
|
192
|
+
"description": "100 万上下文 | 推理 | 编程",
|
|
193
|
+
"contextWindow": 1000000
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"id": "qwen3.7-plus",
|
|
197
|
+
"name": "Qwen 3.7 Plus",
|
|
198
|
+
"description": "100 万上下文 | 均衡档",
|
|
199
|
+
"contextWindow": 1000000
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"id": "MiniMax-M3",
|
|
203
|
+
"name": "MiniMax M3",
|
|
204
|
+
"description": "100 万上下文 | Agent 工作流",
|
|
205
|
+
"contextWindow": 1000000
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"id": "grok-4.7",
|
|
209
|
+
"name": "Grok 4.7",
|
|
210
|
+
"description": "50 万上下文 | 长时 Agent | 编码",
|
|
211
|
+
"contextWindow": 500000,
|
|
212
|
+
"claudeCode": false
|
|
213
|
+
}
|
|
214
|
+
]
|
|
215
|
+
},
|
|
216
|
+
"codex": {
|
|
217
|
+
"standardContextWindow": 272000
|
|
218
|
+
},
|
|
219
|
+
"toolMinVersions": {
|
|
220
|
+
"codex": "0.122.0",
|
|
221
|
+
"claude-code": "2.1.291",
|
|
222
|
+
"claude-desktop": "2.2553.0"
|
|
68
223
|
}
|
|
69
224
|
}
|
package/models.json
CHANGED
|
@@ -55,7 +55,10 @@
|
|
|
55
55
|
"claude-opus-4-7",
|
|
56
56
|
"claude-opus-4-6",
|
|
57
57
|
"claude-opus-5",
|
|
58
|
+
"claude-opus-5-5",
|
|
58
59
|
"claude-sonnet-5",
|
|
60
|
+
"claude-sonnet-5-5",
|
|
61
|
+
"claude-haiku-5-5",
|
|
59
62
|
"claude-fable-5",
|
|
60
63
|
"claude-fable-5-1"
|
|
61
64
|
],
|
|
@@ -65,5 +68,157 @@
|
|
|
65
68
|
"models": ["claude-opus-4-6"]
|
|
66
69
|
}
|
|
67
70
|
]
|
|
71
|
+
},
|
|
72
|
+
"gatewayModels": {
|
|
73
|
+
"autoCompactRatio": 0.8,
|
|
74
|
+
"models": [
|
|
75
|
+
{
|
|
76
|
+
"id": "claude-opus-5-5",
|
|
77
|
+
"name": "Claude Opus 5.5",
|
|
78
|
+
"description": "100 万上下文 | 长时 Agent 编程 | 知识工作",
|
|
79
|
+
"contextWindow": 1000000
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"id": "claude-sonnet-5-5",
|
|
83
|
+
"name": "Claude Sonnet 5.5",
|
|
84
|
+
"description": "100 万上下文 | Agent 编程 | 速度与成本均衡",
|
|
85
|
+
"contextWindow": 1000000
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"id": "claude-fable-5-1",
|
|
89
|
+
"name": "Claude Fable 5.1",
|
|
90
|
+
"description": "100 万上下文 | 长时 Agent 与多步研究",
|
|
91
|
+
"contextWindow": 1000000
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"id": "claude-fable-5",
|
|
95
|
+
"name": "Claude Fable 5",
|
|
96
|
+
"description": "100 万上下文 | 高强度推理 | 长时 Agent",
|
|
97
|
+
"contextWindow": 1000000
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"id": "claude-opus-5",
|
|
101
|
+
"name": "Claude Opus 5",
|
|
102
|
+
"description": "100 万上下文 | Agent 编程",
|
|
103
|
+
"contextWindow": 1000000
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"id": "claude-sonnet-5",
|
|
107
|
+
"name": "Claude Sonnet 5",
|
|
108
|
+
"description": "100 万上下文 | Agent 编程 | 工具调用",
|
|
109
|
+
"contextWindow": 1000000
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"id": "claude-opus-4-8",
|
|
113
|
+
"name": "Claude Opus 4.8",
|
|
114
|
+
"description": "100 万上下文 | 推理 | 编程",
|
|
115
|
+
"contextWindow": 1000000
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"id": "claude-opus-4-7",
|
|
119
|
+
"name": "Claude Opus 4.7",
|
|
120
|
+
"description": "100 万上下文 | 推理 | 编程",
|
|
121
|
+
"contextWindow": 1000000
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"id": "claude-opus-4-6",
|
|
125
|
+
"name": "Claude Opus 4.6",
|
|
126
|
+
"description": "20 万上下文(部分分组无 1M)| 推理 | 编程",
|
|
127
|
+
"contextWindow": 200000
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"id": "claude-sonnet-4-6",
|
|
131
|
+
"name": "Claude Sonnet 4.6",
|
|
132
|
+
"description": "20 万上下文(部分分组无 1M)| Agent 编程",
|
|
133
|
+
"contextWindow": 200000
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"id": "deepseek-v4-pro",
|
|
137
|
+
"name": "DeepSeek V4 Pro",
|
|
138
|
+
"description": "100 万上下文 | 跨文件重构",
|
|
139
|
+
"contextWindow": 1000000
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"id": "deepseek-v4.1-flash",
|
|
143
|
+
"name": "DeepSeek V4.1 Flash",
|
|
144
|
+
"description": "100 万上下文 | 高速档",
|
|
145
|
+
"contextWindow": 1000000
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"id": "deepseek-v4-flash",
|
|
149
|
+
"name": "DeepSeek V4 Flash",
|
|
150
|
+
"description": "100 万上下文 | 高速档",
|
|
151
|
+
"contextWindow": 1000000
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"id": "glm-5.3",
|
|
155
|
+
"name": "GLM 5.3",
|
|
156
|
+
"description": "105 万上下文 | 代码 Agent",
|
|
157
|
+
"contextWindow": 1048576
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"id": "glm-5.3-flash",
|
|
161
|
+
"name": "GLM 5.3 Flash",
|
|
162
|
+
"description": "105 万上下文 | 高速档",
|
|
163
|
+
"contextWindow": 1048576
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"id": "glm-5.2",
|
|
167
|
+
"name": "GLM 5.2",
|
|
168
|
+
"description": "100 万上下文 | 编程",
|
|
169
|
+
"contextWindow": 1000000
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"id": "kimi-k3",
|
|
173
|
+
"name": "Kimi K3",
|
|
174
|
+
"description": "105 万上下文 | 前端编码",
|
|
175
|
+
"contextWindow": 1048576
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"id": "qwen3.8-max",
|
|
179
|
+
"name": "Qwen 3.8 Max",
|
|
180
|
+
"description": "100 万上下文 | 视觉理解",
|
|
181
|
+
"contextWindow": 1000000
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"id": "qwen3.8-flash",
|
|
185
|
+
"name": "Qwen 3.8 Flash",
|
|
186
|
+
"description": "100 万上下文 | 高速档",
|
|
187
|
+
"contextWindow": 1000000
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"id": "qwen3.7-max",
|
|
191
|
+
"name": "Qwen 3.7 Max",
|
|
192
|
+
"description": "100 万上下文 | 推理 | 编程",
|
|
193
|
+
"contextWindow": 1000000
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"id": "qwen3.7-plus",
|
|
197
|
+
"name": "Qwen 3.7 Plus",
|
|
198
|
+
"description": "100 万上下文 | 均衡档",
|
|
199
|
+
"contextWindow": 1000000
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"id": "MiniMax-M3",
|
|
203
|
+
"name": "MiniMax M3",
|
|
204
|
+
"description": "100 万上下文 | Agent 工作流",
|
|
205
|
+
"contextWindow": 1000000
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"id": "grok-4.7",
|
|
209
|
+
"name": "Grok 4.7",
|
|
210
|
+
"description": "50 万上下文 | 长时 Agent | 编码",
|
|
211
|
+
"contextWindow": 500000,
|
|
212
|
+
"claudeCode": false
|
|
213
|
+
}
|
|
214
|
+
]
|
|
215
|
+
},
|
|
216
|
+
"codex": {
|
|
217
|
+
"standardContextWindow": 272000
|
|
218
|
+
},
|
|
219
|
+
"toolMinVersions": {
|
|
220
|
+
"codex": "0.122.0",
|
|
221
|
+
"claude-code": "2.1.291",
|
|
222
|
+
"claude-desktop": "2.2553.0"
|
|
68
223
|
}
|
|
69
224
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibeapi/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.52",
|
|
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",
|
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
"dist",
|
|
14
14
|
"models.json",
|
|
15
15
|
"settings-template.json",
|
|
16
|
+
"codex-base-instructions.md",
|
|
17
|
+
"THIRD_PARTY_NOTICES.md",
|
|
16
18
|
"README.md",
|
|
17
19
|
"LICENSE"
|
|
18
20
|
],
|