@evandu/super-pi 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 +3 -1
- package/bin/super-pi.js +1 -1
- package/desktop/launch.cjs +7 -7
- package/desktop/login-item.cjs +7 -0
- package/desktop/main.cjs +11 -3
- package/desktop/runtime.cjs +107 -0
- package/dist/client/.super-pi-client-sources.json +1 -1
- package/dist/server/managed-servers.js +5 -1
- package/dist/server/runtime.js +2 -2
- package/package.json +5 -1
- package/scripts/pack-server.mjs +1 -1
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") {
|
package/desktop/launch.cjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
const { spawn } = require("node:child_process");
|
|
3
3
|
const { join } = require("node:path");
|
|
4
|
+
const { ensureDesktopRuntime } = require("./runtime.cjs");
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
const electron =
|
|
6
|
+
async function launchDesktop(args = process.argv.slice(2)) {
|
|
7
|
+
const electron = await ensureDesktopRuntime();
|
|
7
8
|
const env = { ...process.env }; delete env.ELECTRON_RUN_AS_NODE;
|
|
8
|
-
const child = spawn(electron, [join(__dirname, "main.cjs"), ...
|
|
9
|
-
child.once("
|
|
9
|
+
const child = spawn(electron, [join(__dirname, "main.cjs"), ...args], { detached: true, stdio: "ignore", windowsHide: true, env });
|
|
10
|
+
await new Promise((resolve, reject) => { child.once("spawn", resolve); child.once("error", () => reject(new Error("桌面运行时已准备好,但系统未能启动桌面进程,请检查系统执行权限"))); });
|
|
10
11
|
child.unref();
|
|
11
|
-
} catch {
|
|
12
|
-
console.error("当前安装不包含桌面运行时。请安装完整包:npm install -g @evandu/super-pi");
|
|
13
|
-
process.exitCode = 1;
|
|
14
12
|
}
|
|
13
|
+
module.exports = { launchDesktop };
|
|
14
|
+
if (require.main === module) launchDesktop().catch(error => { console.error(`Super Pi 桌面启动失败:${error.message}`); process.exitCode = 1; });
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
const escape = value => String(value).replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
2
|
+
function macLaunchAgent({ executable, script, node, dataDir, path }) {
|
|
3
|
+
const args = [executable, script, "--hidden"].map(value => `<string>${escape(value)}</string>`).join("");
|
|
4
|
+
const env = { PATH: path || "/usr/bin:/bin:/usr/sbin:/sbin", SUPER_PI_NODE_BINARY: node, SUPER_PI_DATA_DIR: dataDir };
|
|
5
|
+
return `<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">\n<plist version="1.0"><dict><key>Label</key><string>com.evandu.super-pi.desktop</string><key>ProgramArguments</key><array>${args}</array><key>EnvironmentVariables</key><dict>${Object.entries(env).map(([key, value]) => `<key>${key}</key><string>${escape(value)}</string>`).join("")}</dict><key>RunAtLoad</key><true/><key>LimitLoadToSessionType</key><string>Aqua</string></dict></plist>\n`;
|
|
6
|
+
}
|
|
7
|
+
module.exports = { macLaunchAgent };
|
package/desktop/main.cjs
CHANGED
|
@@ -5,6 +5,7 @@ const { readFile, writeFile, mkdir, rm, access } = require("node:fs/promises");
|
|
|
5
5
|
const { existsSync } = require("node:fs");
|
|
6
6
|
const { homedir } = require("node:os");
|
|
7
7
|
const { join, resolve } = require("node:path");
|
|
8
|
+
const { macLaunchAgent } = require("./login-item.cjs");
|
|
8
9
|
|
|
9
10
|
const exec = promisify(execFile), root = resolve(__dirname, "..");
|
|
10
11
|
const dataDir = process.env.SUPER_PI_DATA_DIR || join(homedir(), ".super-pi");
|
|
@@ -48,10 +49,16 @@ async function startManager() {
|
|
|
48
49
|
function trusted(event) {
|
|
49
50
|
if (!mainWindow || event.sender !== mainWindow.webContents || event.senderFrame !== mainWindow.webContents.mainFrame || !event.senderFrame.url.startsWith(`${origin}/`)) throw new Error("拒绝来自非主界面的桌面调用");
|
|
50
51
|
}
|
|
51
|
-
const startupFile = () => join(process.env.XDG_CONFIG_HOME || join(homedir(), ".config"), "autostart", "super-pi.desktop");
|
|
52
|
-
async function autoStartStatus() { return process.platform
|
|
52
|
+
const startupFile = () => process.platform === "darwin" ? join(homedir(), "Library", "LaunchAgents", "com.evandu.super-pi.desktop.plist") : join(process.env.XDG_CONFIG_HOME || join(homedir(), ".config"), "autostart", "super-pi.desktop");
|
|
53
|
+
async function autoStartStatus() { return process.platform !== "win32" ? existsSync(startupFile()) : app.getLoginItemSettings({ path: process.execPath, args: [__filename, "--hidden"] }).openAtLogin; }
|
|
53
54
|
async function setAutoStart(enabled) {
|
|
54
|
-
if (process.platform === "
|
|
55
|
+
if (process.platform === "darwin") {
|
|
56
|
+
if (!enabled) { await rm(startupFile(), { force: true }); return; }
|
|
57
|
+
const content = macLaunchAgent({ executable: process.execPath, script: __filename, node: await nodeBinary(), dataDir, path: process.env.PATH });
|
|
58
|
+
await exec("/bin/launchctl", ["enable", `gui/${process.getuid()}/com.evandu.super-pi.desktop`]);
|
|
59
|
+
await mkdir(resolve(startupFile(), ".."), { recursive: true });
|
|
60
|
+
await writeFile(startupFile(), content, { mode: 0o600 });
|
|
61
|
+
} else if (process.platform === "linux") {
|
|
55
62
|
if (!enabled) { await rm(startupFile(), { force: true }); return; }
|
|
56
63
|
const quote = value => `"${String(value).replace(/[\\"$`]/g, "\\$&")}"`;
|
|
57
64
|
await mkdir(resolve(startupFile(), ".."), { recursive: true });
|
|
@@ -62,6 +69,7 @@ function show() { if (mainWindow?.isMinimized()) mainWindow.restore(); mainWindo
|
|
|
62
69
|
function external(url) { try { const parsed = new URL(url); if (["http:", "https:", "mailto:"].includes(parsed.protocol) && !parsed.username && !parsed.password) void shell.openExternal(parsed.href); } catch {} }
|
|
63
70
|
async function createWindow() {
|
|
64
71
|
const image = nativeImage.createFromPath(join(__dirname, "icon.png"));
|
|
72
|
+
if (process.platform === "darwin") app.dock?.setIcon(image);
|
|
65
73
|
mainWindow = new BrowserWindow({ title: "Super Pi", width: 1500, height: 980, minWidth: 800, minHeight: 560, show: false, icon: image, webPreferences: { preload: join(__dirname, "preload.cjs"), contextIsolation: true, nodeIntegration: false, sandbox: true, webSecurity: true, backgroundThrottling: false } });
|
|
66
74
|
mainWindow.on("close", event => { if (!quitting) { event.preventDefault(); mainWindow.hide(); } });
|
|
67
75
|
mainWindow.webContents.on("will-navigate", (event, url) => { if (!url.startsWith(`${origin}/`)) { event.preventDefault(); external(url); } });
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
const fs = require("node:fs/promises");
|
|
2
|
+
const { existsSync } = require("node:fs");
|
|
3
|
+
const { join, dirname, resolve, sep } = require("node:path");
|
|
4
|
+
const { homedir } = require("node:os");
|
|
5
|
+
|
|
6
|
+
const delay = ms => new Promise(done => setTimeout(done, ms));
|
|
7
|
+
const executableFor = platform => platform === "darwin" ? "Electron.app/Contents/MacOS/Electron" : platform === "win32" ? "electron.exe" : "electron";
|
|
8
|
+
function runtimeSources(version, platform, arch, env = process.env) {
|
|
9
|
+
const file = `electron-v${version}-${platform}-${arch}.zip`;
|
|
10
|
+
const configured = env.ELECTRON_MIRROR || env.npm_config_electron_mirror;
|
|
11
|
+
const sources = [];
|
|
12
|
+
if (configured) {
|
|
13
|
+
const directory = (env.ELECTRON_CUSTOM_DIR || env.npm_config_electron_custom_dir || `v${version}`).replaceAll("{{ version }}", version);
|
|
14
|
+
sources.push({ name: "已配置下载源", url: `${configured.replace(/\/$/, "")}/${directory}/${file}` });
|
|
15
|
+
}
|
|
16
|
+
sources.push({ name: "Electron 官方源", url: `https://github.com/electron/electron/releases/download/v${version}/${file}` });
|
|
17
|
+
sources.push({ name: "Electron 国内镜像", url: `https://npmmirror.com/mirrors/electron/${version}/${file}` });
|
|
18
|
+
return sources.filter((source, index) => sources.findIndex(item => item.url === source.url) === index);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** Alternate sources still use the official checksums pinned by the Electron dependency. */
|
|
22
|
+
async function ensureDesktopRuntime(options = {}) {
|
|
23
|
+
const metadataPath = require.resolve("electron/package.json");
|
|
24
|
+
const metadata = options.metadata || JSON.parse(await fs.readFile(metadataPath, "utf8"));
|
|
25
|
+
const { downloadArtifact, getHostArch, initializeProxy } = require("@electron/get");
|
|
26
|
+
const { extract } = require("@electron-internal/extract-zip");
|
|
27
|
+
if (process.env.HTTP_PROXY || process.env.HTTPS_PROXY || process.env.http_proxy || process.env.https_proxy) initializeProxy();
|
|
28
|
+
const version = metadata.version, platform = options.platform || process.platform, arch = options.arch || getHostArch();
|
|
29
|
+
if (!/^\d+\.\d+\.\d+(?:-[\w.-]+)?$/.test(version) || !["darwin", "win32", "linux"].includes(platform) || !["x64", "arm64"].includes(arch)) throw new Error("此系统或 CPU 架构暂不支持桌面运行时");
|
|
30
|
+
const binary = executableFor(platform), dependencyRoot = dirname(metadataPath);
|
|
31
|
+
if (!options.metadata && !options.root && !process.env.SUPER_PI_DESKTOP_RUNTIME_DIR) {
|
|
32
|
+
try {
|
|
33
|
+
if ((await fs.readFile(join(dependencyRoot, "dist", "version"), "utf8")).trim().replace(/^v/, "") === version && (await fs.readFile(join(dependencyRoot, "path.txt"), "utf8")).trim() === binary && existsSync(join(dependencyRoot, "dist", binary))) return join(dependencyRoot, "dist", binary);
|
|
34
|
+
} catch { /* Missing dependency-side binaries are normal on the first launch. */ }
|
|
35
|
+
}
|
|
36
|
+
const root = resolve(options.root || process.env.SUPER_PI_DESKTOP_RUNTIME_DIR || join(process.env.SUPER_PI_DATA_DIR || join(homedir(), ".super-pi"), "desktop", "runtimes"));
|
|
37
|
+
const key = `${version}-${platform}-${arch}`, target = join(root, key), lock = join(root, `${key}.lock`);
|
|
38
|
+
const log = options.log || console.log;
|
|
39
|
+
const ready = async () => {
|
|
40
|
+
try { const marker = JSON.parse(await fs.readFile(join(target, ".super-pi-runtime.json"), "utf8")); return marker.version === version && marker.platform === platform && marker.arch === arch && existsSync(join(target, binary)); } catch { return false; }
|
|
41
|
+
};
|
|
42
|
+
if (await ready()) return join(target, binary);
|
|
43
|
+
await fs.mkdir(root, { recursive: true });
|
|
44
|
+
const removeOwned = async path => {
|
|
45
|
+
if (!resolve(path).startsWith(root + sep)) throw new Error("拒绝清理运行时缓存以外的路径");
|
|
46
|
+
await fs.rm(path, { recursive: true, force: true, maxRetries: 5, retryDelay: 200 });
|
|
47
|
+
};
|
|
48
|
+
const deadline = Date.now() + 20 * 60_000;
|
|
49
|
+
let waiting = false;
|
|
50
|
+
for (;;) {
|
|
51
|
+
try { await fs.mkdir(lock); await fs.writeFile(join(lock, "owner.json"), JSON.stringify({ pid: process.pid })); break; }
|
|
52
|
+
catch (error) {
|
|
53
|
+
if (error.code !== "EEXIST") throw error;
|
|
54
|
+
if (await ready()) return join(target, binary);
|
|
55
|
+
try { const owner = JSON.parse(await fs.readFile(join(lock, "owner.json"), "utf8")); try { process.kill(owner.pid, 0); } catch (error) { if (error.code === "ESRCH") { await removeOwned(lock); continue; } } }
|
|
56
|
+
catch { if (Date.now() - (await fs.stat(lock).catch(() => ({ mtimeMs: Date.now() }))).mtimeMs > 30_000) { await removeOwned(lock); continue; } }
|
|
57
|
+
if (Date.now() > deadline) throw new Error("另一个桌面启动仍在准备运行时,请稍后重新运行 super_pi desktop");
|
|
58
|
+
if (!waiting) { waiting = true; log("另一个启动正在准备桌面运行时,正在等待…"); }
|
|
59
|
+
await delay(500);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
let stage;
|
|
63
|
+
try {
|
|
64
|
+
if (await ready()) return join(target, binary);
|
|
65
|
+
log(`正在准备 Super Pi 桌面运行时 · ${platform}/${arch} · Electron ${version}`);
|
|
66
|
+
const checksums = options.checksums || JSON.parse(await fs.readFile(join(dependencyRoot, "checksums.json"), "utf8"));
|
|
67
|
+
let sources = options.sources || runtimeSources(version, platform, arch);
|
|
68
|
+
if (!options.sources && !process.env.ELECTRON_MIRROR && !process.env.npm_config_electron_mirror) {
|
|
69
|
+
const reachable = await Promise.all(sources.map(async source => { try { return (await fetch(source.url, { method: "HEAD", signal: AbortSignal.timeout(6000) })).ok; } catch { return false; } }));
|
|
70
|
+
sources = [...sources.filter((_, index) => reachable[index]), ...sources.filter((_, index) => !reachable[index])];
|
|
71
|
+
}
|
|
72
|
+
let archive;
|
|
73
|
+
for (const source of sources) {
|
|
74
|
+
for (let attempt = 1; attempt <= 2; attempt++) {
|
|
75
|
+
const abort = new AbortController(), total = setTimeout(() => abort.abort(), options.timeoutMs || 10 * 60_000);
|
|
76
|
+
let idle = setTimeout(() => abort.abort(), options.idleTimeoutMs || 45_000), lastProgress = 0;
|
|
77
|
+
log(`正在下载 · ${source.name}(${attempt}/2)`);
|
|
78
|
+
try {
|
|
79
|
+
archive = await downloadArtifact({ version, platform, arch, artifactName: "electron", checksums, cacheRoot: join(root, "downloads"), mirrorOptions: { resolveAssetURL: async () => source.url }, downloadOptions: { quiet: true, signal: abort.signal, getProgressCallback: ({ transferred, total: bytes }) => {
|
|
80
|
+
clearTimeout(idle); idle = setTimeout(() => abort.abort(), options.idleTimeoutMs || 45_000);
|
|
81
|
+
if (Date.now() - lastProgress > 5000 || transferred === bytes) { lastProgress = Date.now(); log(`桌面运行时 · 已下载 ${Math.round(transferred / 1024 / 1024)} MB${bytes ? ` / ${Math.round(bytes / 1024 / 1024)} MB` : ""}`); }
|
|
82
|
+
} } });
|
|
83
|
+
break;
|
|
84
|
+
} catch (error) {
|
|
85
|
+
const code = error.code || error.cause?.code || error.name || "NETWORK_ERROR";
|
|
86
|
+
log(`${source.name}未完成(${code}),${attempt < 2 ? "正在自动重试" : "正在自动切换下载源"}…`);
|
|
87
|
+
if (attempt < 2) await delay(options.retryDelayMs ?? 1000);
|
|
88
|
+
} finally { clearTimeout(total); clearTimeout(idle); }
|
|
89
|
+
}
|
|
90
|
+
if (archive) break;
|
|
91
|
+
}
|
|
92
|
+
if (!archive) throw new Error("桌面运行时下载失败,已自动尝试备用源。Super Pi 已正确安装,浏览器服务仍可使用;稍后重新运行 super_pi desktop 将继续准备,无需重装或手动配置镜像。");
|
|
93
|
+
log("校验已通过,正在安装桌面运行时…");
|
|
94
|
+
stage = await fs.mkdtemp(join(root, `${key}-install-`));
|
|
95
|
+
await extract(archive, { dir: stage });
|
|
96
|
+
await fs.access(join(stage, binary));
|
|
97
|
+
await fs.writeFile(join(stage, ".super-pi-runtime.json"), JSON.stringify({ version, platform, arch }));
|
|
98
|
+
await removeOwned(target);
|
|
99
|
+
await fs.rename(stage, target); stage = undefined;
|
|
100
|
+
log("桌面运行时已就绪,正在打开 Super Pi…");
|
|
101
|
+
return join(target, binary);
|
|
102
|
+
} finally {
|
|
103
|
+
if (stage) await removeOwned(stage);
|
|
104
|
+
await removeOwned(lock);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
module.exports = { ensureDesktopRuntime, runtimeSources, executableFor };
|
|
@@ -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",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.260",
|
|
4
4
|
"description": "Web control plane and companion for Pi",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -48,6 +48,8 @@
|
|
|
48
48
|
"pack:server": "npm run build && node scripts/pack-server.mjs"
|
|
49
49
|
},
|
|
50
50
|
"check:logic": [
|
|
51
|
+
"scripts/title-cold-start.test.mjs",
|
|
52
|
+
"scripts/desktop-runtime.test.mjs",
|
|
51
53
|
"scripts/managed-ssh.test.mjs",
|
|
52
54
|
"scripts/managed-model.test.mjs",
|
|
53
55
|
"scripts/multi-server.test.mjs",
|
|
@@ -444,6 +446,8 @@
|
|
|
444
446
|
"@codemirror/view": "^6.43.15",
|
|
445
447
|
"@earendil-works/pi-ai": "1.5.2",
|
|
446
448
|
"@earendil-works/pi-coding-agent": "1.5.2",
|
|
449
|
+
"@electron-internal/extract-zip": "1.0.8",
|
|
450
|
+
"@electron/get": "5.1.0",
|
|
447
451
|
"@git-diff-view/react": "^0.1.8",
|
|
448
452
|
"@types/diff": "^5.2.3",
|
|
449
453
|
"@xterm/addon-fit": "^0.11.0",
|
package/scripts/pack-server.mjs
CHANGED
|
@@ -24,7 +24,7 @@ export async function packServer(root, destination) {
|
|
|
24
24
|
const manifest = JSON.parse(await readFile(join(root, "package.json"), "utf8"));
|
|
25
25
|
const files = (manifest.files ?? []).filter(file => file !== "desktop" && file !== "scripts/pack-server.mjs");
|
|
26
26
|
for (const file of files) { try { await cp(join(root, file), join(staging, file), { recursive: true }); } catch (error) { if (error.code !== "ENOENT") throw error; } }
|
|
27
|
-
const dependencies = Object.fromEntries(Object.entries(manifest.dependencies ?? {}).filter(([name]) => !["electron", "ssh2"].includes(name)));
|
|
27
|
+
const dependencies = Object.fromEntries(Object.entries(manifest.dependencies ?? {}).filter(([name]) => !["electron", "ssh2", "@electron/get", "@electron-internal/extract-zip"].includes(name)));
|
|
28
28
|
const server = { ...manifest, name: "@evandu/super-pi-server", description: "Super Pi remote execution service, without the desktop runtime", files, dependencies, devDependencies: undefined, scripts: undefined, bin: { "super-pi": "bin/super-pi.js", super_pi: "bin/super-pi.js", "super-pi-server": "bin/super-pi.js" } };
|
|
29
29
|
await writeFile(join(staging, "package.json"), `${JSON.stringify(server, null, 2)}\n`);
|
|
30
30
|
await mkdir(destination, { recursive: true });
|