aicodeswitch 1.4.1 → 1.5.1

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/CLAUDE.md CHANGED
@@ -190,3 +190,4 @@ aicos version # Show current version information
190
190
  * 使用yarn作为包管理器,请使用yarn安装依赖。
191
191
  * 前端依赖库安装在devDependencies中,请使用yarn install --dev安装。
192
192
  * 所有对话请使用中文。生成代码中的文案及相关注释根据代码原本的语言生成。
193
+ * 在服务端,直接使用 __dirname 来获取当前目录,不要使用 process.cwd()
@@ -702,6 +702,7 @@ class ProxyServer {
702
702
  return sourceType === 'openai-responses';
703
703
  }
704
704
  applyModelOverride(body, rule) {
705
+ // 如果 targetModel 为空或不存在,保留原始 model(透传)
705
706
  if (!rule.targetModel)
706
707
  return body;
707
708
  if (body && typeof body === 'object') {
@@ -34,8 +34,7 @@ exports.compareVersions = compareVersions;
34
34
  // 获取当前版本
35
35
  const getCurrentVersion = () => {
36
36
  try {
37
- // 在构建环境中,__dirname 可能不可用
38
- const packageJsonPath = path_1.default.resolve(process.cwd(), 'package.json');
37
+ const packageJsonPath = path_1.default.resolve(__dirname, '../../package.json');
39
38
  const packageJson = JSON.parse(fs_1.default.readFileSync(packageJsonPath, 'utf-8'));
40
39
  return packageJson.version;
41
40
  }