ompgui 0.5.6 → 0.5.9
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/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +5 -5
- package/.next/build-manifest.json +3 -3
- package/.next/prerender-manifest.json +6 -6
- package/.next/react-loadable-manifest.json +10 -10
- package/.next/required-server-files.js +2 -3
- package/.next/required-server-files.json +2 -3
- package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +2 -2
- package/.next/server/app/_global-error.segments/_full.segment.rsc +2 -2
- package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page.js +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +3 -3
- package/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +7 -7
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/api/agent/[id]/events/route.js +1 -1
- package/.next/server/app/api/app-update/route.js +1 -1
- package/.next/server/app/api/auth/all-providers/route.js +1 -1
- package/.next/server/app/api/auth/all-providers/route.js.nft.json +1 -1
- package/.next/server/app/api/auth/login/[provider]/route.js +2 -2
- package/.next/server/app/api/model-roles/route.js +1 -1
- package/.next/server/app/api/models/route.js +1 -1
- package/.next/server/app/api/models-config/route.js +1 -1
- package/.next/server/app/api/models-config/route.js.nft.json +1 -1
- package/.next/server/app/api/models-config/test/route.js +1 -1
- package/.next/server/app/api/models-config/test/route.js.nft.json +1 -1
- package/.next/server/app/api/omp-settings/route.js +1 -1
- package/.next/server/app/api/providers/enable/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/auto-name/route.js +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +4 -4
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +9 -7
- package/.next/server/app/index.segments/_full.segment.rsc +4 -4
- package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/login/page.js +1 -1
- package/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/server/app/login.html +1 -1
- package/.next/server/app/login.rsc +3 -3
- package/.next/server/app/login.segments/_full.segment.rsc +3 -3
- package/.next/server/app/login.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +7 -6
- package/.next/server/app/page.js +2 -2
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +5 -5
- package/.next/server/chunks/1448.js +1 -0
- package/.next/server/chunks/3100.js +1 -1
- package/.next/server/chunks/6209.js +2 -2
- package/.next/server/chunks/6465.js +1 -1
- package/.next/server/chunks/714.js +1 -1
- package/.next/server/chunks/8005.js +18 -0
- package/.next/server/chunks/8501.js +1 -1
- package/.next/server/chunks/933.js +2 -2
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/middleware.js +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/1133.c52cb85df8434dfe.js +1 -0
- package/.next/static/chunks/1441.83552e2540b12edf.js +1 -0
- package/.next/static/chunks/2041.4e10fe5e336c8426.js +17 -0
- package/.next/static/chunks/2201.46326eb058826eb2.js +1 -0
- package/.next/static/chunks/3274.90e0bf3b4004e4d8.js +1 -0
- package/.next/static/chunks/4315-89ce29b4967be748.js +1 -0
- package/.next/static/chunks/6338.d20f504e8890057e.js +1 -0
- package/.next/static/chunks/9668.b217cc6e8f550236.js +1 -0
- package/.next/static/chunks/9981.ba92f0b30bbf53e4.js +1 -0
- package/.next/static/chunks/app/page-77ea00b588788c0d.js +59 -0
- package/.next/static/chunks/webpack-167605108a414cd7.js +1 -0
- package/.next/static/css/{c6eda91f31526945.css → 45214e1537eb75a6.css} +1 -1
- package/README.ja.md +6 -5
- package/README.ko.md +2 -0
- package/README.md +3 -1
- package/README.zh-CN.md +6 -5
- package/bin/ompgui-options.js +7 -3
- package/bin/ompgui-update.js +108 -0
- package/bin/ompgui.js +15 -3
- package/next.config.ts +0 -1
- package/package.json +9 -6
- package/.next/server/chunks/9577.js +0 -18
- package/.next/static/chunks/1133.bacd2a00ac07e041.js +0 -1
- package/.next/static/chunks/2124.a08e97448f6509af.js +0 -17
- package/.next/static/chunks/2201.b0b6e40a6fc1628a.js +0 -1
- package/.next/static/chunks/3274.2faf978d45b29a27.js +0 -1
- package/.next/static/chunks/4315-e505812d4c93f5ca.js +0 -1
- package/.next/static/chunks/5199.9ec1359b9aa220ab.js +0 -1
- package/.next/static/chunks/9182.b3f6afd537f9c3fe.js +0 -1
- package/.next/static/chunks/9668.b606b2dc0af7c335.js +0 -1
- package/.next/static/chunks/9981.90f200903b3d454f.js +0 -1
- package/.next/static/chunks/app/page-411ca086f30ad190.js +0 -59
- package/.next/static/chunks/webpack-fd539a603cf2ea92.js +0 -1
- package/bin/omp-web-security.test.mjs +0 -12
- package/bin/ompgui-security.test.mjs +0 -8
- package/bin/process-lifecycle.test.mjs +0 -83
- /package/.next/static/{o-eXlQ3KD1-OgZu1FqtEN → say7tTKCMe35Qg-7bMRZ9}/_buildManifest.js +0 -0
- /package/.next/static/{o-eXlQ3KD1-OgZu1FqtEN → say7tTKCMe35Qg-7bMRZ9}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const { spawn } = require("child_process");
|
|
4
|
+
const fs = require("fs");
|
|
5
|
+
const os = require("os");
|
|
6
|
+
const path = require("path");
|
|
7
|
+
|
|
8
|
+
function normalizePath(value, platform) {
|
|
9
|
+
const normalized = path.normalize(value).replaceAll("\\", path.sep);
|
|
10
|
+
return platform === "win32" ? normalized.toLowerCase() : normalized;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function detectInstallMethod(packageDir, env = process.env, homeDir = os.homedir(), platform = process.platform) {
|
|
14
|
+
const normalized = normalizePath(packageDir, platform);
|
|
15
|
+
const bunRoots = [
|
|
16
|
+
env.BUN_INSTALL ? path.join(env.BUN_INSTALL, "install", "global", "node_modules") : null,
|
|
17
|
+
path.join(env.USERPROFILE || env.HOME || homeDir, "node_modules"),
|
|
18
|
+
path.join(homeDir, ".bun", "install", "global", "node_modules"),
|
|
19
|
+
].filter(Boolean).map((root) => normalizePath(root, platform));
|
|
20
|
+
return bunRoots.some((root) => normalized.startsWith(root + path.sep)) ? "bun" : "npm";
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function findNpmCli(nodePath = process.execPath, exists = fs.existsSync) {
|
|
24
|
+
const nodeDir = path.dirname(nodePath);
|
|
25
|
+
const candidates = [
|
|
26
|
+
path.join(nodeDir, "node_modules", "npm", "bin", "npm-cli.js"),
|
|
27
|
+
path.join(nodeDir, "..", "lib", "node_modules", "npm", "bin", "npm-cli.js"),
|
|
28
|
+
];
|
|
29
|
+
return candidates.find((candidate) => {
|
|
30
|
+
try {
|
|
31
|
+
return exists(candidate);
|
|
32
|
+
} catch {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
}) ?? null;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function getInstallCommand(method, platform = process.platform, nodePath = process.execPath, resolveNpmCli = findNpmCli) {
|
|
39
|
+
if (method === "bun") {
|
|
40
|
+
return { command: platform === "win32" ? "bun.exe" : "bun", args: ["add", "--global", "ompgui@latest"] };
|
|
41
|
+
}
|
|
42
|
+
if (platform === "win32") {
|
|
43
|
+
const npmCli = resolveNpmCli(nodePath);
|
|
44
|
+
if (!npmCli) throw new Error("Could not locate npm-cli.js beside the active Node.js installation.");
|
|
45
|
+
return { command: nodePath, args: [npmCli, "install", "--global", "ompgui@latest"] };
|
|
46
|
+
}
|
|
47
|
+
return { command: "npm", args: ["install", "--global", "ompgui@latest"] };
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function readInstalledVersion(packageDir) {
|
|
51
|
+
try {
|
|
52
|
+
const packageJson = JSON.parse(fs.readFileSync(path.join(packageDir, "package.json"), "utf8"));
|
|
53
|
+
return typeof packageJson.version === "string" ? packageJson.version : null;
|
|
54
|
+
} catch {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function runInstaller(command, args, env = process.env) {
|
|
60
|
+
return new Promise((resolve, reject) => {
|
|
61
|
+
const child = spawn(command, args, { env, stdio: "inherit", windowsHide: true });
|
|
62
|
+
child.once("error", reject);
|
|
63
|
+
child.once("exit", (code, signal) => {
|
|
64
|
+
if (code === 0) {
|
|
65
|
+
resolve();
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
reject(new Error(signal ? `${command} was terminated by ${signal}` : `${command} exited with code ${code ?? "unknown"}`));
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
async function updateOmpGui({
|
|
74
|
+
packageDir,
|
|
75
|
+
env = process.env,
|
|
76
|
+
platform = process.platform,
|
|
77
|
+
homeDir = os.homedir(),
|
|
78
|
+
install = runInstaller,
|
|
79
|
+
stdout = process.stdout,
|
|
80
|
+
} = {}) {
|
|
81
|
+
if (!packageDir) throw new Error("The ompgui package directory is unavailable.");
|
|
82
|
+
|
|
83
|
+
const beforeVersion = readInstalledVersion(packageDir);
|
|
84
|
+
const method = detectInstallMethod(packageDir, env, homeDir, platform);
|
|
85
|
+
const { command, args } = getInstallCommand(method, platform);
|
|
86
|
+
stdout.write(`Updating ompgui${beforeVersion ? ` v${beforeVersion}` : ""} with ${method}...\n`);
|
|
87
|
+
await install(command, args, env);
|
|
88
|
+
|
|
89
|
+
const afterVersion = readInstalledVersion(packageDir);
|
|
90
|
+
if (!afterVersion) {
|
|
91
|
+
throw new Error("The package manager finished, but the installed ompgui version could not be verified.");
|
|
92
|
+
}
|
|
93
|
+
if (beforeVersion && afterVersion && beforeVersion === afterVersion) {
|
|
94
|
+
stdout.write(`ompgui v${afterVersion} is already up to date.\n`);
|
|
95
|
+
} else {
|
|
96
|
+
stdout.write(`Updated ompgui${beforeVersion ? ` v${beforeVersion}` : ""} to v${afterVersion}.\n`);
|
|
97
|
+
}
|
|
98
|
+
return { method, command, args, beforeVersion, afterVersion };
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
module.exports = {
|
|
102
|
+
detectInstallMethod,
|
|
103
|
+
findNpmCli,
|
|
104
|
+
getInstallCommand,
|
|
105
|
+
readInstalledVersion,
|
|
106
|
+
runInstaller,
|
|
107
|
+
updateOmpGui,
|
|
108
|
+
};
|
package/bin/ompgui.js
CHANGED
|
@@ -6,14 +6,26 @@ const { spawn } = require("child_process");
|
|
|
6
6
|
const path = require("path");
|
|
7
7
|
const fs = require("fs");
|
|
8
8
|
const { parseLaunchOptions } = require("./ompgui-options");
|
|
9
|
+
const pkgDir = path.join(__dirname, "..");
|
|
10
|
+
const options = parseLaunchOptions();
|
|
11
|
+
if (options.help || options.version) process.exit(0);
|
|
12
|
+
if (options.command) {
|
|
13
|
+
if (options.command !== "update" || options.extraPositionals.length) {
|
|
14
|
+
console.error(`Unknown ompgui command: ${[options.command, ...options.extraPositionals].join(" ")}`);
|
|
15
|
+
process.exit(1);
|
|
16
|
+
}
|
|
17
|
+
const { updateOmpGui } = require("./ompgui-update");
|
|
18
|
+
updateOmpGui({ packageDir: pkgDir }).catch((error) => {
|
|
19
|
+
console.error(`Could not update ompgui: ${error.message}`);
|
|
20
|
+
process.exitCode = 1;
|
|
21
|
+
});
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
9
24
|
const { isPortAvailable } = require("./port-availability");
|
|
10
25
|
const { wireChildProcessLifecycle } = require("./process-lifecycle");
|
|
11
|
-
const pkgDir = path.join(__dirname, "..");
|
|
12
26
|
const nextDir = path.join(pkgDir, ".next");
|
|
13
27
|
let nextBin;
|
|
14
28
|
try { nextBin = require.resolve("next/dist/bin/next", { paths:[pkgDir] }); } catch { try { nextBin = path.join(path.dirname(require.resolve("next/package.json", {paths:[pkgDir]})), "dist", "bin", "next"); } catch { nextBin = path.join(pkgDir,"node_modules/next/dist/bin/next"); } }
|
|
15
|
-
const options = parseLaunchOptions();
|
|
16
|
-
if (options.help || options.version) process.exit(0);
|
|
17
29
|
const { port, hostname, password, openBrowser } = options;
|
|
18
30
|
if (password) { process.env.OMPGUI_PASSWORD = password; process.env.OMP_WEB_PASSWORD = password; }
|
|
19
31
|
const loopback = new Set(["127.0.0.1","localhost","::1","[::1]"]);
|
package/next.config.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ompgui",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.9",
|
|
4
4
|
"description": "Web UI & Browser GUI for the oh-my-pi (omp) coding agent",
|
|
5
5
|
"homepage": "https://github.com/dbc-hbin/ompgui#readme",
|
|
6
6
|
"repository": {
|
|
@@ -20,7 +20,14 @@
|
|
|
20
20
|
"ompweb": "bin/omp-web.js"
|
|
21
21
|
},
|
|
22
22
|
"files": [
|
|
23
|
-
"bin",
|
|
23
|
+
"bin/ompgui.js",
|
|
24
|
+
"bin/ompgui-update.js",
|
|
25
|
+
"bin/omp-web.js",
|
|
26
|
+
"bin/ompgui-options.js",
|
|
27
|
+
"bin/omp-web-options.js",
|
|
28
|
+
"bin/node-version.js",
|
|
29
|
+
"bin/port-availability.js",
|
|
30
|
+
"bin/process-lifecycle.js",
|
|
24
31
|
".next",
|
|
25
32
|
"!.next/cache",
|
|
26
33
|
"!.next/dev",
|
|
@@ -29,16 +36,13 @@
|
|
|
29
36
|
"!.next/trace",
|
|
30
37
|
"!.next/trace-build",
|
|
31
38
|
"!.next/**/*.map",
|
|
32
|
-
"public",
|
|
33
39
|
"next.config.ts",
|
|
34
40
|
"package.json"
|
|
35
41
|
],
|
|
36
42
|
"scripts": {
|
|
37
43
|
"dev": "next dev -H 127.0.0.1 -p 30178",
|
|
38
|
-
"dev:lan": "next dev -H 0.0.0.0 -p 30178",
|
|
39
44
|
"build": "next build --webpack",
|
|
40
45
|
"start": "next start -H 127.0.0.1 -p 30177",
|
|
41
|
-
"start:lan": "next start -H 0.0.0.0 -p 30177",
|
|
42
46
|
"test": "node --experimental-strip-types --test lib/*.test.mjs lib/omp/*.test.mjs components/*.test.mjs components/ui/*.test.mjs hooks/*.test.mjs bin/*.test.mjs",
|
|
43
47
|
"typecheck": "tsc --noEmit",
|
|
44
48
|
"lint": "eslint .",
|
|
@@ -80,7 +84,6 @@
|
|
|
80
84
|
"rehype-sanitize": "^6.0.0",
|
|
81
85
|
"remark-gfm": "^4.0.1",
|
|
82
86
|
"remark-math": "^6.0.0",
|
|
83
|
-
"tailwindcss": "^4.2.2",
|
|
84
87
|
"typescript": "^5"
|
|
85
88
|
}
|
|
86
89
|
}
|