@qt4798/pi-web 0.10.1 → 0.10.5
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 +18 -18
- package/.next/build-manifest.json +2 -2
- package/.next/next-server.js.nft.json +1 -1
- package/.next/prerender-manifest.json +3 -3
- package/.next/react-loadable-manifest.json +0 -1964
- package/.next/required-server-files.js +2 -1
- package/.next/required-server-files.json +2 -1
- package/.next/server/app/_global-error/page.js +3 -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 +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page.js +2 -2
- 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 +16 -15
- package/.next/server/app/_not-found.segments/_full.segment.rsc +16 -15
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +5 -4
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/api/agent/[id]/bash-output/route.js +1 -1
- package/.next/server/app/api/agent/[id]/events/route.js +2 -2
- package/.next/server/app/api/agent/[id]/route.js +1 -1
- package/.next/server/app/api/agent/new/route.js +1 -1
- package/.next/server/app/api/agent/running/events/route.js +1 -1
- package/.next/server/app/api/agent/running/route.js +1 -1
- package/.next/server/app/api/auth/all-providers/route.js +1 -1
- package/.next/server/app/api/auth/api-key/[provider]/route.js +1 -1
- package/.next/server/app/api/auth/combined/route.js +1 -1
- package/.next/server/app/api/auth/login/[provider]/route.js +2 -2
- package/.next/server/app/api/auth/logout/[provider]/route.js +1 -1
- package/.next/server/app/api/auth/providers/route.js +1 -1
- package/.next/server/app/api/backup/export/route.js +1 -1
- package/.next/server/app/api/backup/import/route.js +1 -1
- package/.next/server/app/api/cwd/browse/route.js +1 -1
- package/.next/server/app/api/cwd/validate/route.js +1 -1
- package/.next/server/app/api/deepseek/balance/route.js +1 -1
- package/.next/server/app/api/default-cwd/route.js +1 -1
- package/.next/server/app/api/events/route.js +2 -2
- package/.next/server/app/api/features/route.js +1 -1
- package/.next/server/app/api/file-index/route.js +1 -1
- package/.next/server/app/api/files/[...path]/route.js +1 -1
- package/.next/server/app/api/git/diff/route.js +1 -1
- package/.next/server/app/api/git/push/route.js +1 -1
- package/.next/server/app/api/git/stash/route.js +1 -1
- package/.next/server/app/api/git/status/route.js +2 -2
- package/.next/server/app/api/home/route.js +1 -1
- package/.next/server/app/api/import/discover/route.js +1 -1
- package/.next/server/app/api/import/execute/route.js +1 -1
- package/.next/server/app/api/import/status/route.js +1 -1
- package/.next/server/app/api/logs/route.js +1 -1
- package/.next/server/app/api/mcp/restart/route.js +1 -1
- package/.next/server/app/api/mcp/route.js +2 -2
- package/.next/server/app/api/models/route.js +1 -1
- package/.next/server/app/api/models-config/builtin/route.js +1 -1
- package/.next/server/app/api/models-config/catalog/route.js +1 -1
- package/.next/server/app/api/models-config/discover/route.js +1 -1
- package/.next/server/app/api/models-config/route.js +1 -1
- package/.next/server/app/api/models-config/test/route.js +1 -1
- package/.next/server/app/api/modes/route.js +1 -1
- package/.next/server/app/api/plugins/route.js +1 -1
- package/.next/server/app/api/project-aliases/route.js +1 -1
- package/.next/server/app/api/project-state/route.js +1 -1
- package/.next/server/app/api/project-trust/route.js +1 -1
- package/.next/server/app/api/proxy/route.js +1 -1
- package/.next/server/app/api/proxy/test/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/auto-name/route.js +2 -2
- package/.next/server/app/api/sessions/[id]/context/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/entries/[entryId]/thinking/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/export/route.js +2 -2
- package/.next/server/app/api/sessions/[id]/queue-recovery/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/state/route.js +1 -1
- package/.next/server/app/api/sessions/route.js +1 -1
- package/.next/server/app/api/settings/title-model/route.js +1 -1
- package/.next/server/app/api/skills/check/route.js +1 -1
- package/.next/server/app/api/skills/install/route.js +1 -1
- package/.next/server/app/api/skills/route.js +2 -2
- package/.next/server/app/api/skills/search/route.js +1 -1
- package/.next/server/app/api/skills/update/route.js +1 -1
- package/.next/server/app/api/snippets/[id]/route.js +1 -1
- package/.next/server/app/api/snippets/route.js +1 -1
- package/.next/server/app/api/subagents/agents/[name]/route.js +2 -2
- package/.next/server/app/api/subagents/route.js +2 -2
- package/.next/server/app/api/subagents/transcript/route.js +1 -1
- package/.next/server/app/api/tasks/[id]/[action]/route.js +1 -1
- package/.next/server/app/api/tasks/[id]/changed-files/route.js +1 -1
- package/.next/server/app/api/tasks/[id]/diff/route.js +2 -2
- package/.next/server/app/api/tasks/[id]/events/route.js +1 -1
- package/.next/server/app/api/tasks/[id]/route.js +1 -1
- package/.next/server/app/api/tasks/batch/route.js +1 -1
- package/.next/server/app/api/tasks/events/route.js +2 -2
- package/.next/server/app/api/tasks/route.js +1 -1
- package/.next/server/app/api/tasks/settings/route.js +1 -1
- package/.next/server/app/api/tasks/templates/route.js +1 -1
- package/.next/server/app/api/themes/[name]/route.js +1 -1
- package/.next/server/app/api/themes/route.js +1 -1
- package/.next/server/app/api/usage/route.js +1 -1
- package/.next/server/app/api/vision-config/route.js +2 -2
- package/.next/server/app/api/worktrees/route.js +1 -1
- package/.next/server/app/icon.ico/route.js +1 -1
- package/.next/server/app/icon.png/route.js +1 -1
- package/.next/server/app/icon.svg/route.js +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +16 -15
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +3 -3
- package/.next/server/app/index.segments/_full.segment.rsc +16 -15
- package/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/server/app/index.segments/_index.segment.rsc +5 -4
- package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/page.js +10 -10
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +18 -18
- package/.next/server/chunks/2498.js +1 -1
- package/.next/server/chunks/4253.js +3 -3
- package/.next/server/chunks/4564.js +1 -1
- package/.next/server/chunks/5582.js +1 -1
- package/.next/server/chunks/6429.js +2 -2
- package/.next/server/chunks/7915.js +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/middleware.js +2 -2
- 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/266-afbb4abec8f065f2.js +1 -0
- package/.next/static/chunks/app/layout-a5e7239bae5ff472.js +1 -0
- package/.next/static/chunks/app/{page-5c710e68640f3145.js → page-1f553bf2c117387b.js} +9 -9
- package/.next/static/css/11cd851a9acbcc96.css +1 -0
- package/.next/trace +9 -9
- package/.next/trace-build +1 -1
- package/bin/fix-pi-agent-undici.js +75 -30
- package/bin/with-memory-limit.js +2 -2
- package/next.config.ts +3 -0
- package/package.json +4 -2
- package/.next/static/chunks/4539-00fcad0fc9413ea5.js +0 -1
- package/.next/static/chunks/app/layout-7b635840991e69cb.js +0 -1
- package/.next/static/css/437ace30775068cf.css +0 -1
- /package/.next/static/{uSnMpPvz2vTZlLUkAmoxZ → kWqylj4DXUQD6uvs2QXWr}/_buildManifest.js +0 -0
- /package/.next/static/{uSnMpPvz2vTZlLUkAmoxZ → kWqylj4DXUQD6uvs2QXWr}/_ssgManifest.js +0 -0
package/.next/trace-build
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"name":"run-webpack","duration":
|
|
1
|
+
[{"name":"run-webpack","duration":57803718,"timestamp":601173715570,"id":14,"parentId":1,"tags":{},"startTime":1787227488514,"traceId":"c4e8cdc81c758c63"},{"name":"run-typescript","duration":6646529,"timestamp":601231520535,"id":996,"parentId":1,"tags":{},"startTime":1787227546317,"traceId":"c4e8cdc81c758c63"},{"name":"static-check","duration":1254069,"timestamp":601238187460,"id":999,"parentId":1,"tags":{},"startTime":1787227552983,"traceId":"c4e8cdc81c758c63"},{"name":"static-generation","duration":1941657,"timestamp":601239800716,"id":1177,"parentId":1,"tags":{},"startTime":1787227554597,"traceId":"c4e8cdc81c758c63"},{"name":"collect-build-traces","duration":17784999,"timestamp":601239443458,"id":1174,"parentId":1,"tags":{},"startTime":1787227554239,"traceId":"c4e8cdc81c758c63"},{"name":"output-standalone","duration":2229931,"timestamp":601257234824,"id":1185,"parentId":1,"tags":{},"startTime":1787227572030,"traceId":"c4e8cdc81c758c63"},{"name":"telemetry-flush","duration":14,"timestamp":601259466326,"id":1188,"parentId":1,"tags":{},"startTime":1787227574262,"traceId":"c4e8cdc81c758c63"},{"name":"next-build","duration":86277123,"timestamp":601173189221,"id":1,"tags":{"buildMode":"default","version":"16.2.12","bundler":"webpack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1787227487987,"traceId":"c4e8cdc81c758c63"}]
|
|
@@ -4,7 +4,17 @@
|
|
|
4
4
|
// that pins undici to 8.5.0, which has 7+ known CVEs. npm overrides cannot
|
|
5
5
|
// penetrate shrinkwrap. This script:
|
|
6
6
|
// 1. Removes the shrinkwrap (so future reinstalls respect overrides)
|
|
7
|
-
// 2.
|
|
7
|
+
// 2. Replaces the nested undici with the top-level undici@^8.10.0
|
|
8
|
+
//
|
|
9
|
+
// Two modes:
|
|
10
|
+
// - applyUndiciFix (runtime, dev/CLI): replaces the nested undici with a
|
|
11
|
+
// **symlink** to the top-level undici. The dir is writable here, and a
|
|
12
|
+
// symlink keeps future reinstalls pointing at the fixed version.
|
|
13
|
+
// - solidifyUndiciFix (build time, packaging): replaces the nested undici
|
|
14
|
+
// (whether a real dir or a symlink) with a **physical copy** of the fixed
|
|
15
|
+
// version so the standalone output (`.next/standalone`) is fully
|
|
16
|
+
// self-contained with no symlinks — the installed, read-only bundle never
|
|
17
|
+
// needs to write anything at runtime and survives NSIS/macOS bundle copying.
|
|
8
18
|
//
|
|
9
19
|
// Note: npm audit will still report undici CVEs because the lockfile
|
|
10
20
|
// references the old version. This is a cosmetic false positive — the
|
|
@@ -19,7 +29,16 @@
|
|
|
19
29
|
const fs = require("fs");
|
|
20
30
|
const path = require("path");
|
|
21
31
|
|
|
22
|
-
|
|
32
|
+
/**
|
|
33
|
+
* Apply the undici fix under `rootDir`.
|
|
34
|
+
* @param {string} [rootDir] package root (contains node_modules/)
|
|
35
|
+
* @param {{copy?: boolean, topUndici?: string}} [opts]
|
|
36
|
+
* - copy: when true, copy the fixed undici into place instead of symlinking
|
|
37
|
+
* - topUndici: explicit path to the fixed undici directory (defaults to
|
|
38
|
+
* <rootDir>/node_modules/undici)
|
|
39
|
+
*/
|
|
40
|
+
function applyUndiciFix(rootDir = path.join(__dirname, ".."), opts = {}) {
|
|
41
|
+
const copy = opts.copy === true;
|
|
23
42
|
const agentDir = path.join(
|
|
24
43
|
rootDir,
|
|
25
44
|
"node_modules",
|
|
@@ -30,7 +49,7 @@ function applyUndiciFix(rootDir = path.join(__dirname, "..")) {
|
|
|
30
49
|
|
|
31
50
|
const shrinkwrap = path.join(agentDir, "npm-shrinkwrap.json");
|
|
32
51
|
const nestedUndici = path.join(agentDir, "node_modules", "undici");
|
|
33
|
-
const topUndici = path.join(rootDir, "node_modules", "undici");
|
|
52
|
+
const topUndici = opts.topUndici || path.join(rootDir, "node_modules", "undici");
|
|
34
53
|
|
|
35
54
|
// 1. Remove shrinkwrap
|
|
36
55
|
if (fs.existsSync(shrinkwrap)) {
|
|
@@ -38,39 +57,65 @@ function applyUndiciFix(rootDir = path.join(__dirname, "..")) {
|
|
|
38
57
|
fs.rmSync(shrinkwrap);
|
|
39
58
|
}
|
|
40
59
|
|
|
41
|
-
// 2.
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
60
|
+
// 2. Inspect the nested undici (may be a real dir or an existing symlink)
|
|
61
|
+
let nestedIsSymlink = false;
|
|
62
|
+
let nestedIsDir = false;
|
|
63
|
+
try {
|
|
64
|
+
const st = fs.lstatSync(nestedUndici);
|
|
65
|
+
nestedIsSymlink = st.isSymbolicLink();
|
|
66
|
+
nestedIsDir = st.isDirectory();
|
|
67
|
+
} catch {
|
|
68
|
+
return; // nested undici missing — nothing to replace
|
|
69
|
+
}
|
|
70
|
+
if (!nestedIsSymlink && !nestedIsDir) return;
|
|
71
|
+
// Runtime symlink mode is idempotent: an existing symlink means already fixed.
|
|
72
|
+
if (nestedIsSymlink && !copy) return;
|
|
73
|
+
if (!fs.existsSync(topUndici)) return;
|
|
74
|
+
|
|
75
|
+
try {
|
|
76
|
+
const nestedVersion = require(path.join(nestedUndici, "package.json")).version;
|
|
77
|
+
const topVersion = require(path.join(topUndici, "package.json")).version;
|
|
78
|
+
// Already a real dir with the correct version → nothing to do.
|
|
79
|
+
if (!nestedIsSymlink && nestedVersion === topVersion) return;
|
|
52
80
|
|
|
53
|
-
|
|
54
|
-
console.log(
|
|
55
|
-
`[pi-web] Replacing pi-coding-agent's undici@${nestedVersion} ` +
|
|
56
|
-
`→ symlink to undici@${topVersion}`,
|
|
57
|
-
);
|
|
58
|
-
fs.rmSync(nestedUndici, { recursive: true, force: true });
|
|
81
|
+
fs.rmSync(nestedUndici, { recursive: true, force: true });
|
|
59
82
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
83
|
+
if (copy) {
|
|
84
|
+
fs.cpSync(topUndici, nestedUndici, { recursive: true });
|
|
85
|
+
console.log(
|
|
86
|
+
`[pi-web] Copied undici@${topVersion} into pi-coding-agent (solidified)`,
|
|
87
|
+
);
|
|
88
|
+
} else {
|
|
89
|
+
const rel = path.relative(path.dirname(nestedUndici), topUndici);
|
|
90
|
+
fs.symlinkSync(
|
|
91
|
+
rel,
|
|
92
|
+
nestedUndici,
|
|
93
|
+
process.platform === "win32" ? "junction" : "dir",
|
|
94
|
+
);
|
|
95
|
+
console.log(
|
|
96
|
+
`[pi-web] Replacing pi-coding-agent's undici@${nestedVersion} ` +
|
|
97
|
+
`→ symlink to undici@${topVersion}`,
|
|
98
|
+
);
|
|
69
99
|
}
|
|
100
|
+
} catch (err) {
|
|
101
|
+
console.warn("[pi-web] undici fix skipped:", err.message);
|
|
70
102
|
}
|
|
71
103
|
}
|
|
72
104
|
|
|
73
|
-
|
|
105
|
+
/**
|
|
106
|
+
* Build-time solidification for packaging: physically copy the fixed undici
|
|
107
|
+
* into the standalone output so the read-only installed bundle needs no
|
|
108
|
+
* runtime writes and contains no symlinks.
|
|
109
|
+
* @param {string} [rootDir] standalone root (contains node_modules/)
|
|
110
|
+
* @param {string} [topUndiciDir] path to the fixed undici to copy in
|
|
111
|
+
*/
|
|
112
|
+
function solidifyUndiciFix(rootDir = path.join(__dirname, ".."), topUndiciDir) {
|
|
113
|
+
const source = topUndiciDir || path.join(rootDir, "node_modules", "undici");
|
|
114
|
+
if (!fs.existsSync(source)) return; // nothing to copy from
|
|
115
|
+
applyUndiciFix(rootDir, { copy: true, topUndici: source });
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
module.exports = { applyUndiciFix, solidifyUndiciFix };
|
|
74
119
|
|
|
75
120
|
if (require.main === module) {
|
|
76
121
|
applyUndiciFix();
|
package/bin/with-memory-limit.js
CHANGED
|
@@ -5,10 +5,10 @@ const { spawnSync } = require("child_process");
|
|
|
5
5
|
|
|
6
6
|
/** Keep the V8 heap from ballooning during local runs. Next.js dev auto-sets
|
|
7
7
|
* --max-old-space-size to 50% of physical RAM (12GB on a 24GB machine)
|
|
8
|
-
* unless the user already capped it. A
|
|
8
|
+
* unless the user already capped it. A 3GB cap makes GC engage earlier and
|
|
9
9
|
* bounds RSS growth for both dev and production start.
|
|
10
10
|
*/
|
|
11
|
-
const MEMORY_LIMIT_MB =
|
|
11
|
+
const MEMORY_LIMIT_MB = 3072;
|
|
12
12
|
const SEMI_SPACE_MB = 128;
|
|
13
13
|
|
|
14
14
|
/**
|
package/next.config.ts
CHANGED
|
@@ -13,6 +13,9 @@ try {
|
|
|
13
13
|
} catch { /* package not found, use default */ }
|
|
14
14
|
|
|
15
15
|
const nextConfig: NextConfig = {
|
|
16
|
+
// M1 内置打包:产出 .next/standalone(自包含 server.js + 最小 node_modules),
|
|
17
|
+
// 桌面壳随包拉起 node <standalone/server.js>,免本机 npm/CLI。
|
|
18
|
+
output: "standalone",
|
|
16
19
|
allowedDevOrigins,
|
|
17
20
|
devIndicators: false,
|
|
18
21
|
// proxy.ts clones the request body for /api/*; the Next.js default of
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qt4798/pi-web",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.5",
|
|
4
4
|
"description": "Web workspace for the pi coding agent",
|
|
5
5
|
"homepage": "https://github.com/t479842598/pi-web-QT#readme",
|
|
6
6
|
"repository": {
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
".next",
|
|
23
23
|
"!.next/cache",
|
|
24
24
|
"!.next/dev",
|
|
25
|
+
"!.next/standalone",
|
|
25
26
|
"!.next/**/*.js.map",
|
|
26
27
|
"lib/theme",
|
|
27
28
|
"public",
|
|
@@ -31,7 +32,8 @@
|
|
|
31
32
|
"scripts": {
|
|
32
33
|
"dev": "node bin/fix-pi-agent-undici.js && node bin/with-memory-limit.js node_modules/.bin/next dev -H 127.0.0.1 -p 0 --turbopack",
|
|
33
34
|
"dev:lan": "node bin/fix-pi-agent-undici.js && node bin/with-memory-limit.js node_modules/.bin/next dev -H 0.0.0.0 -p 0 --turbopack",
|
|
34
|
-
"build": "env -u TURBOPACK next build --webpack",
|
|
35
|
+
"build": "env -u TURBOPACK -u __NEXT_PRIVATE_STANDALONE_CONFIG next build --webpack",
|
|
36
|
+
"bundle:backend": "node scripts/bundle-backend.mjs",
|
|
35
37
|
"start": "node bin/fix-pi-agent-undici.js && node bin/with-memory-limit.js node_modules/.bin/next start -H 127.0.0.1 -p 0",
|
|
36
38
|
"start:lan": "node bin/fix-pi-agent-undici.js && node bin/with-memory-limit.js node_modules/.bin/next start -H 0.0.0.0 -p 0",
|
|
37
39
|
"lint": "eslint .",
|