@vibeapi/api-helper 0.0.95 → 0.0.97

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.
Files changed (60) hide show
  1. package/client-config.snapshot.json +123 -10
  2. package/dist/brand.json +76 -0
  3. package/dist/cli.js +1 -1
  4. package/dist/client-config.snapshot.json +123 -10
  5. package/dist/commands/base.js +1 -1
  6. package/dist/commands/completion.js +1 -1
  7. package/dist/commands/setup.d.ts +2 -0
  8. package/dist/commands/setup.js +1 -1
  9. package/dist/commands/update.d.ts +2 -1
  10. package/dist/commands/update.js +1 -1
  11. package/dist/lib/api-validator.js +1 -1
  12. package/dist/lib/auto-update.js +1 -1
  13. package/dist/lib/brand.d.ts +82 -8
  14. package/dist/lib/brand.js +1 -1
  15. package/dist/lib/cli-help.d.ts +1 -1
  16. package/dist/lib/cli-help.js +1 -1
  17. package/dist/lib/client-config-sync.js +1 -1
  18. package/dist/lib/client-config.d.ts +5 -4
  19. package/dist/lib/client-config.js +1 -1
  20. package/dist/lib/codex-sessions.js +1 -1
  21. package/dist/lib/command-docs.js +1 -1
  22. package/dist/lib/command.js +1 -1
  23. package/dist/lib/config.d.ts +1 -1
  24. package/dist/lib/config.js +1 -1
  25. package/dist/lib/errors.d.ts +10 -10
  26. package/dist/lib/errors.js +1 -1
  27. package/dist/lib/gateway-models.js +1 -1
  28. package/dist/lib/gateway-protocol.d.ts +13 -0
  29. package/dist/lib/gateway-protocol.js +1 -0
  30. package/dist/lib/i18n.js +1 -1
  31. package/dist/lib/model-refresh.js +1 -1
  32. package/dist/lib/model-registry.d.ts +2 -4
  33. package/dist/lib/model-registry.js +1 -1
  34. package/dist/lib/persistent-env.js +1 -1
  35. package/dist/lib/program.js +1 -1
  36. package/dist/lib/secret-store.js +1 -1
  37. package/dist/lib/tool-manager.d.ts +8 -0
  38. package/dist/lib/tool-manager.js +1 -1
  39. package/dist/lib/tools/antigravity.js +1 -1
  40. package/dist/lib/tools/claude-code.js +1 -1
  41. package/dist/lib/tools/claude-desktop.js +1 -1
  42. package/dist/lib/tools/claude-plugins.d.ts +8 -13
  43. package/dist/lib/tools/claude-plugins.js +1 -1
  44. package/dist/lib/tools/codex-catalog.d.ts +1 -1
  45. package/dist/lib/tools/codex-catalog.js +1 -1
  46. package/dist/lib/tools/codex.js +1 -1
  47. package/dist/lib/tools/elevated-reg.js +1 -1
  48. package/dist/lib/tools/grok.js +1 -1
  49. package/dist/lib/tools/openclaw.js +1 -1
  50. package/dist/lib/tools/tool-installs.d.ts +2 -2
  51. package/dist/lib/tools/tool-installs.js +1 -1
  52. package/dist/lib/tools/types.js +1 -1
  53. package/dist/lib/windows-env.js +1 -1
  54. package/dist/lib/wizard.js +1 -1
  55. package/dist/locales/en_US.json +105 -97
  56. package/dist/locales/zh_CN.json +105 -97
  57. package/dist/models.json +1 -27
  58. package/dist/utils/logger.js +1 -1
  59. package/models.json +1 -27
  60. package/package.json +2 -1
package/dist/models.json CHANGED
@@ -297,31 +297,5 @@
297
297
  "claude-code": "2.1.291",
298
298
  "claude-desktop": "2.2553.0",
299
299
  "agy": "1.3.5"
300
- },
301
- "gatewayAddresses": [
302
- {
303
- "url": "https://www.vibeapi.cn",
304
- "label": "主站"
305
- },
306
- {
307
- "url": "https://www.vibeapi.si",
308
- "label": "主站备用域名(证书报错时用)"
309
- },
310
- {
311
- "url": "https://hk.vibeapi.cn",
312
- "label": "香港线路"
313
- },
314
- {
315
- "url": "https://us13-www.vibeapi.cn",
316
- "label": "US13 线路"
317
- },
318
- {
319
- "url": "https://cf.vibeapi.cn",
320
- "label": "Cloudflare 线路"
321
- },
322
- {
323
- "url": "https://token.nfeyre.top",
324
- "label": "全球加速(兜底)"
325
- }
326
- ]
300
+ }
327
301
  }
@@ -1 +1 @@
1
- import{existsSync as e,mkdirSync as t,appendFileSync as i,readdirSync as o,statSync as r,unlinkSync as s}from"fs";import{join as g}from"path";import{homedir as n}from"os";export var LogLevel;!function(e){e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR"}(LogLevel||(LogLevel={}));const l=["token","apikey","api_key","api-key","auth_token","auth-token","authorization","password","secret","credential","anthropic_auth_token","anthropic_api_key","z_ai_api_key"],a=[/eyJ[A-Za-z0-9_-]+\.eyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g,/\b[a-zA-Z0-9]{32,}\b/g,/Bearer\s+[A-Za-z0-9._-]+/gi];export class Logger{static instance;logLevel=LogLevel.INFO;fileLogLevel=LogLevel.WARN;logDir;fileLoggingEnabled=!0;retentionDays=14;constructor(){this.logDir=g(n(),".vibecli"),this.ensureLogDir(),this.rotateOldLogs()}static getInstance(){return Logger.instance||(Logger.instance=new Logger),Logger.instance}ensureLogDir(){try{e(this.logDir)||t(this.logDir,{recursive:!0})}catch{this.fileLoggingEnabled=!1}}getLogFilePath(){const e=(new Date).toISOString().split("T")[0];return g(this.logDir,`${e}.log`)}rotateOldLogs(){if(this.fileLoggingEnabled&&e(this.logDir))try{const e=Date.now()-24*this.retentionDays*60*60*1e3,t=o(this.logDir).filter(e=>/^\d{4}-\d{2}-\d{2}\.log$/.test(e));for(const i of t){const t=g(this.logDir,i);try{r(t).mtimeMs<e&&s(t)}catch{}}}catch{}}setRetentionDays(e){e>=0&&Number.isFinite(e)&&(this.retentionDays=Math.floor(e),this.rotateOldLogs())}sanitizeValue(e){if(null==e)return e;if("string"==typeof e){let t=e;for(const e of a)t=t.replace(e,"[REDACTED]");return t}if(Array.isArray(e))return e.map(e=>this.sanitizeValue(e));if("object"==typeof e){const t={};for(const[i,o]of Object.entries(e)){const e=i.toLowerCase(),r=l.some(t=>e.includes(t));t[i]=r?"[REDACTED]":this.sanitizeValue(o)}return t}return e}sanitize(e,t){return{message:this.sanitizeValue(e),args:t.map(e=>this.sanitizeValue(e))}}formatArgs(e){return 0===e.length?"":" "+e.map(e=>{if("object"==typeof e)try{return JSON.stringify(e)}catch{return String(e)}return String(e)}).join(" ")}writeToFile(e,t,o){if(this.fileLoggingEnabled)try{const{message:r,args:s}=this.sanitize(t,o),g=`${(new Date).toISOString()} [${e}] ${r}${this.formatArgs(s)}\n`;i(this.getLogFilePath(),g,"utf-8")}catch{}}setLogLevel(e){this.logLevel=e}setFileLogLevel(e){this.fileLogLevel=e}setFileLoggingEnabled(e){this.fileLoggingEnabled=e}debug(e,...t){this.logLevel<=LogLevel.DEBUG&&console.debug(`[DEBUG] ${e}`,...t),this.fileLoggingEnabled&&this.fileLogLevel<=LogLevel.DEBUG&&this.writeToFile("DEBUG",e,t)}record(e){this.fileLoggingEnabled&&this.writeToFile("INFO",e,[])}info(e,...t){this.logLevel<=LogLevel.INFO&&console.info(`[INFO] ${e}`,...t),this.fileLoggingEnabled&&this.fileLogLevel<=LogLevel.INFO&&this.writeToFile("INFO",e,t)}warn(e,...t){this.logLevel<=LogLevel.WARN&&console.warn(`[WARN] ${e}`,...t),this.fileLoggingEnabled&&this.fileLogLevel<=LogLevel.WARN&&this.writeToFile("WARN",e,t)}error(e,...t){this.logLevel<=LogLevel.ERROR&&console.error(`[ERROR] ${e}`,...t),this.fileLoggingEnabled&&this.fileLogLevel<=LogLevel.ERROR&&this.writeToFile("ERROR",e,t)}logError(e,t){const i=t instanceof Error?t.message:String(t),o=t instanceof Error?t.stack:void 0;this.writeToFile("ERROR",`[${e}] ${i}`,o?[{stack:o}]:[])}getLogDir(){return this.logDir}}export const logger=Logger.getInstance();
1
+ import{existsSync as e,mkdirSync as t,appendFileSync as i,readdirSync as o,statSync as r,unlinkSync as s}from"fs";import{join as g}from"path";import{homedir as n}from"os";import{brand as l}from"../lib/brand.js";export var LogLevel;!function(e){e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR"}(LogLevel||(LogLevel={}));const a=["token","apikey","api_key","api-key","auth_token","auth-token","authorization","password","secret","credential","anthropic_auth_token","anthropic_api_key","z_ai_api_key"],L=[/eyJ[A-Za-z0-9_-]+\.eyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g,/\b[a-zA-Z0-9]{32,}\b/g,/Bearer\s+[A-Za-z0-9._-]+/gi];export class Logger{static instance;logLevel=LogLevel.INFO;fileLogLevel=LogLevel.WARN;logDir;fileLoggingEnabled=!0;retentionDays=14;constructor(){this.logDir=g(n(),l().configDirName),this.ensureLogDir(),this.rotateOldLogs()}static getInstance(){return Logger.instance||(Logger.instance=new Logger),Logger.instance}ensureLogDir(){try{e(this.logDir)||t(this.logDir,{recursive:!0})}catch{this.fileLoggingEnabled=!1}}getLogFilePath(){const e=(new Date).toISOString().split("T")[0];return g(this.logDir,`${e}.log`)}rotateOldLogs(){if(this.fileLoggingEnabled&&e(this.logDir))try{const e=Date.now()-24*this.retentionDays*60*60*1e3,t=o(this.logDir).filter(e=>/^\d{4}-\d{2}-\d{2}\.log$/.test(e));for(const i of t){const t=g(this.logDir,i);try{r(t).mtimeMs<e&&s(t)}catch{}}}catch{}}setRetentionDays(e){e>=0&&Number.isFinite(e)&&(this.retentionDays=Math.floor(e),this.rotateOldLogs())}sanitizeValue(e){if(null==e)return e;if("string"==typeof e){let t=e;for(const e of L)t=t.replace(e,"[REDACTED]");return t}if(Array.isArray(e))return e.map(e=>this.sanitizeValue(e));if("object"==typeof e){const t={};for(const[i,o]of Object.entries(e)){const e=i.toLowerCase(),r=a.some(t=>e.includes(t));t[i]=r?"[REDACTED]":this.sanitizeValue(o)}return t}return e}sanitize(e,t){return{message:this.sanitizeValue(e),args:t.map(e=>this.sanitizeValue(e))}}formatArgs(e){return 0===e.length?"":" "+e.map(e=>{if("object"==typeof e)try{return JSON.stringify(e)}catch{return String(e)}return String(e)}).join(" ")}writeToFile(e,t,o){if(this.fileLoggingEnabled)try{const{message:r,args:s}=this.sanitize(t,o),g=`${(new Date).toISOString()} [${e}] ${r}${this.formatArgs(s)}\n`;i(this.getLogFilePath(),g,"utf-8")}catch{}}setLogLevel(e){this.logLevel=e}setFileLogLevel(e){this.fileLogLevel=e}setFileLoggingEnabled(e){this.fileLoggingEnabled=e}debug(e,...t){this.logLevel<=LogLevel.DEBUG&&console.debug(`[DEBUG] ${e}`,...t),this.fileLoggingEnabled&&this.fileLogLevel<=LogLevel.DEBUG&&this.writeToFile("DEBUG",e,t)}record(e){this.fileLoggingEnabled&&this.writeToFile("INFO",e,[])}info(e,...t){this.logLevel<=LogLevel.INFO&&console.info(`[INFO] ${e}`,...t),this.fileLoggingEnabled&&this.fileLogLevel<=LogLevel.INFO&&this.writeToFile("INFO",e,t)}warn(e,...t){this.logLevel<=LogLevel.WARN&&console.warn(`[WARN] ${e}`,...t),this.fileLoggingEnabled&&this.fileLogLevel<=LogLevel.WARN&&this.writeToFile("WARN",e,t)}error(e,...t){this.logLevel<=LogLevel.ERROR&&console.error(`[ERROR] ${e}`,...t),this.fileLoggingEnabled&&this.fileLogLevel<=LogLevel.ERROR&&this.writeToFile("ERROR",e,t)}logError(e,t){const i=t instanceof Error?t.message:String(t),o=t instanceof Error?t.stack:void 0;this.writeToFile("ERROR",`[${e}] ${i}`,o?[{stack:o}]:[])}getLogDir(){return this.logDir}}export const logger=Logger.getInstance();
package/models.json CHANGED
@@ -297,31 +297,5 @@
297
297
  "claude-code": "2.1.291",
298
298
  "claude-desktop": "2.2553.0",
299
299
  "agy": "1.3.5"
300
- },
301
- "gatewayAddresses": [
302
- {
303
- "url": "https://www.vibeapi.cn",
304
- "label": "主站"
305
- },
306
- {
307
- "url": "https://www.vibeapi.si",
308
- "label": "主站备用域名(证书报错时用)"
309
- },
310
- {
311
- "url": "https://hk.vibeapi.cn",
312
- "label": "香港线路"
313
- },
314
- {
315
- "url": "https://us13-www.vibeapi.cn",
316
- "label": "US13 线路"
317
- },
318
- {
319
- "url": "https://cf.vibeapi.cn",
320
- "label": "Cloudflare 线路"
321
- },
322
- {
323
- "url": "https://token.nfeyre.top",
324
- "label": "全球加速(兜底)"
325
- }
326
- ]
300
+ }
327
301
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibeapi/api-helper",
3
- "version": "0.0.95",
3
+ "version": "0.0.97",
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",
@@ -91,6 +91,7 @@
91
91
  "typecheck": "tsc --noEmit",
92
92
  "gen:docs": "tsx scripts/gen-command-docs.mjs",
93
93
  "sync:client-config": "node scripts/sync-client-config.mjs",
94
+ "build:brand": "node scripts/brands.mjs build",
94
95
  "lint": "eslint .",
95
96
  "lint:fix": "eslint . --fix",
96
97
  "format": "prettier --write .",