@evandu/super-pi-server 0.1.259 → 0.1.260
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
CHANGED
|
@@ -17,7 +17,9 @@ npm install -g @evandu/super-pi
|
|
|
17
17
|
super_pi desktop
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
The first desktop launch
|
|
20
|
+
The first desktop launch prepares the Electron runtime automatically, with progress, retries,
|
|
21
|
+
an alternate mirror, and official checksum verification. It caches the runtime in the user's
|
|
22
|
+
data directory across npm upgrades; users do not need to configure a mirror. Closing the window
|
|
21
23
|
keeps the app in the system tray. Settings → Desktop and background provides optional startup
|
|
22
24
|
at sign-in. Browser access remains available; both interfaces use the same local service.
|
|
23
25
|
|
package/bin/super-pi.js
CHANGED
|
@@ -297,7 +297,7 @@ const command = implicitStart ? "start" : raw?.toLowerCase();
|
|
|
297
297
|
const args = implicitStart ? [raw, ...rest] : rest;
|
|
298
298
|
try {
|
|
299
299
|
if (command === "help" || command === "--help" || command === "-h") { usage(); process.exit(0); }
|
|
300
|
-
if (command === "desktop" || command === "app") { if (!existsSync(join(root, "desktop", "launch.cjs"))) throw new Error("纯服务包不包含桌面端,请在自己的电脑安装完整包 @evandu/super-pi"); await import(pathToFileURL(join(root, "desktop", "launch.cjs")).href); process.exit(
|
|
300
|
+
if (command === "desktop" || command === "app") { if (!existsSync(join(root, "desktop", "launch.cjs"))) throw new Error("纯服务包不包含桌面端,请在自己的电脑安装完整包 @evandu/super-pi"); const launcher = await import(pathToFileURL(join(root, "desktop", "launch.cjs")).href); await launcher.default.launchDesktop(args); process.exit(0); }
|
|
301
301
|
else if (!command) { const value = options(args); await start(value); const url = `http://127.0.0.1:${value.port}`; if (value.browser) openBrowser(url); console.log(value.browser ? `Opened ${url}\n${runningBanner(url)}` : runningBanner(url)); process.exit(0); }
|
|
302
302
|
if (command === "autostart" || command === "startup") { const action = args.shift()?.toLowerCase() ?? "status"; const value = options(args); if (action === "enable") await enable(value); else if (action === "disable") await disable(); else if (action === "status") await status(); else throw new Error("Autostart action must be enable, disable, or status."); process.exit(0); }
|
|
303
303
|
if (command === "diagnose" || command === "diagnose-latency") {
|
|
@@ -78,5 +78,5 @@
|
|
|
78
78
|
"src/client/vite-env.d.ts": "65996936fbb042915f7b74a200fcdde7e410f32a669b1ab9597cfaa4b0faddb5",
|
|
79
79
|
"src/client/workbench-navigation.ts": "3b229752a8ce4a45eba7aeff040eb33001413190141f1e9b8e5f38246a1761e2"
|
|
80
80
|
},
|
|
81
|
-
"recordedAt": "2026-11-
|
|
81
|
+
"recordedAt": "2026-11-20T04:26:14.502Z"
|
|
82
82
|
}
|
|
@@ -53,11 +53,15 @@ export class ManagedServers {
|
|
|
53
53
|
}
|
|
54
54
|
this.gatewayServer = createServer((request, response) => {
|
|
55
55
|
const value = request.headers.authorization?.replace(/^Bearer /, "") ?? "";
|
|
56
|
+
const supplied = Buffer.from(value);
|
|
56
57
|
const valid = [...this.records.values()].some(entry => {
|
|
57
58
|
if (!entry.profile.enabled)
|
|
58
59
|
return false;
|
|
59
60
|
const token = this.secrets.get(entry.profile.id)?.modelToken;
|
|
60
|
-
|
|
61
|
+
if (!token)
|
|
62
|
+
return false;
|
|
63
|
+
const expected = Buffer.from(token);
|
|
64
|
+
return supplied.length === expected.length && timingSafeEqual(supplied, expected);
|
|
61
65
|
});
|
|
62
66
|
if (request.url !== "/model" || !valid) {
|
|
63
67
|
response.writeHead(403).end();
|
package/dist/server/runtime.js
CHANGED
|
@@ -2582,13 +2582,13 @@ export class PiRpcRuntime {
|
|
|
2582
2582
|
if (!transcript)
|
|
2583
2583
|
throw new Error("这个会话还没有内容,无法据此生成标题");
|
|
2584
2584
|
if (selectedModel?.provider && selectedModel.modelId) {
|
|
2585
|
-
const modelResponse = await channel.request({ id: "autotitle_model", type: "set_model", provider: selectedModel.provider, modelId: selectedModel.modelId }, Math.min(
|
|
2585
|
+
const modelResponse = await channel.request({ id: "autotitle_model", type: "set_model", provider: selectedModel.provider, modelId: selectedModel.modelId }, Math.max(1, Math.min(30_000, deadline - Date.now())));
|
|
2586
2586
|
if (modelResponse.success !== true)
|
|
2587
2587
|
throw new Error(modelResponse.error || `Pi 无法使用当前会话模型 ${selectedModel.provider}/${selectedModel.modelId}`);
|
|
2588
2588
|
}
|
|
2589
2589
|
// Reasoning adds latency without improving a short session label. Keep this one-shot call fast
|
|
2590
2590
|
// even when the user's normal default thinking level is high.
|
|
2591
|
-
const thinkingResponse = await channel.request({ id: "autotitle_thinking", type: "set_thinking_level", level: "off" }, Math.min(
|
|
2591
|
+
const thinkingResponse = await channel.request({ id: "autotitle_thinking", type: "set_thinking_level", level: "off" }, Math.max(1, Math.min(30_000, deadline - Date.now())));
|
|
2592
2592
|
if (thinkingResponse.success !== true)
|
|
2593
2593
|
throw new Error(thinkingResponse.error || "Pi 未能关闭标题生成的思考等级");
|
|
2594
2594
|
channel.write({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@evandu/super-pi-server",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.260",
|
|
4
4
|
"description": "Super Pi remote execution service, without the desktop runtime",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -30,6 +30,8 @@
|
|
|
30
30
|
"node": ">=22.19.0"
|
|
31
31
|
},
|
|
32
32
|
"check:logic": [
|
|
33
|
+
"scripts/title-cold-start.test.mjs",
|
|
34
|
+
"scripts/desktop-runtime.test.mjs",
|
|
33
35
|
"scripts/managed-ssh.test.mjs",
|
|
34
36
|
"scripts/managed-model.test.mjs",
|
|
35
37
|
"scripts/multi-server.test.mjs",
|