aihezu 2.0.1 → 2.1.0
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/commands/install.js +16 -0
- package/package.json +1 -1
package/commands/install.js
CHANGED
|
@@ -56,7 +56,23 @@ async function installCommand(service, args = []) {
|
|
|
56
56
|
const apiUrlInput = await askQuestion(rl, '请输入 API 地址 (直接回车使用默认地址): ');
|
|
57
57
|
let apiUrl = apiUrlInput || defaultUrl;
|
|
58
58
|
|
|
59
|
+
// Determine service-specific suffix
|
|
60
|
+
let suffix = '';
|
|
61
|
+
if (service.name === 'claude') {
|
|
62
|
+
suffix = '/api';
|
|
63
|
+
} else if (service.name === 'codex') {
|
|
64
|
+
suffix = '/openai';
|
|
65
|
+
} else if (service.name === 'gemini') {
|
|
66
|
+
suffix = '/gemini';
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Append suffix if apiUrl does not already end with it
|
|
70
|
+
if (suffix && !apiUrl.endsWith(suffix)) {
|
|
71
|
+
apiUrl = apiUrl.replace(/\/+$/, '') + suffix; // Remove any trailing slash and add suffix
|
|
72
|
+
}
|
|
73
|
+
|
|
59
74
|
// Basic URL validation/normalization
|
|
75
|
+
// This part should handle http/https prefixing.
|
|
60
76
|
if (!/^https?:\/\//i.test(apiUrl)) {
|
|
61
77
|
apiUrl = 'https://' + apiUrl;
|
|
62
78
|
}
|