panrouter 1.0.2 → 1.0.4
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/{cli.js → cli.mjs} +5 -5
- package/package.json +3 -3
package/{cli.js → cli.mjs}
RENAMED
|
@@ -95,7 +95,7 @@ function writeConfig() {
|
|
|
95
95
|
|
|
96
96
|
// ─── 3. 启动代理服务器(后台运行) ───────────────────────────────────────
|
|
97
97
|
|
|
98
|
-
function startServer() {
|
|
98
|
+
async function startServer() {
|
|
99
99
|
const serverPath = path.join(__dirname, "server.mjs");
|
|
100
100
|
|
|
101
101
|
// 关掉旧的 Pan Router
|
|
@@ -111,7 +111,7 @@ function startServer() {
|
|
|
111
111
|
|
|
112
112
|
// Windows: 用 start 命令开新窗口,不依赖 node 后台进程
|
|
113
113
|
if (process.platform === "win32") {
|
|
114
|
-
execSync(`start "Pan Router" cmd /c "node
|
|
114
|
+
execSync(`start "Pan Router" cmd /c "node ${serverPath} & pause"`, { stdio: "pipe" });
|
|
115
115
|
} else {
|
|
116
116
|
const child = spawn("node", [serverPath], { cwd: __dirname, stdio: "ignore", detached: true });
|
|
117
117
|
child.unref();
|
|
@@ -143,7 +143,7 @@ function printBanner() {
|
|
|
143
143
|
`);
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
-
function main() {
|
|
146
|
+
async function main() {
|
|
147
147
|
const args = process.argv.slice(2);
|
|
148
148
|
|
|
149
149
|
if (args.includes("--help") || args.includes("-h")) {
|
|
@@ -172,7 +172,7 @@ function main() {
|
|
|
172
172
|
}
|
|
173
173
|
|
|
174
174
|
if (args.includes("--server") || args.includes("-s")) {
|
|
175
|
-
startServer();
|
|
175
|
+
await startServer();
|
|
176
176
|
return;
|
|
177
177
|
}
|
|
178
178
|
|
|
@@ -180,7 +180,7 @@ function main() {
|
|
|
180
180
|
printBanner();
|
|
181
181
|
if (!installClaudeCode()) process.exit(1);
|
|
182
182
|
writeConfig();
|
|
183
|
-
startServer();
|
|
183
|
+
await startServer();
|
|
184
184
|
}
|
|
185
185
|
|
|
186
186
|
main();
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "panrouter",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "让 Claude Code 免费使用 DeepSeek 等模型,无需 API Key",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
|
-
"panrouter": "cli.
|
|
7
|
+
"panrouter": "cli.mjs"
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
10
|
-
"cli.
|
|
10
|
+
"cli.mjs",
|
|
11
11
|
"server.mjs"
|
|
12
12
|
],
|
|
13
13
|
"license": "MIT"
|