@qt4798/pi-web 0.17.11 → 0.17.12

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.
Files changed (38) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +23 -23
  3. package/.next/build-manifest.json +2 -2
  4. package/.next/required-server-files.js +1 -1
  5. package/.next/required-server-files.json +1 -1
  6. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  7. package/.next/server/app/_global-error.html +1 -1
  8. package/.next/server/app/_global-error.rsc +1 -1
  9. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  12. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  13. package/.next/server/app/_not-found.html +1 -1
  14. package/.next/server/app/_not-found.rsc +1 -1
  15. package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  16. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  17. package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  18. package/.next/server/app/api/app-update/route.js +1 -1
  19. package/.next/server/app/index.html +1 -1
  20. package/.next/server/app/index.rsc +3 -3
  21. package/.next/server/app/index.segments/__PAGE__.segment.rsc +3 -3
  22. package/.next/server/app/index.segments/_full.segment.rsc +3 -3
  23. package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  24. package/.next/server/app/page.js +1 -1
  25. package/.next/server/app/page_client-reference-manifest.js +1 -1
  26. package/.next/server/app-paths-manifest.json +23 -23
  27. package/.next/server/chunks/4154.js +1 -1
  28. package/.next/server/chunks/7915.js +1 -1
  29. package/.next/server/middleware-build-manifest.js +1 -1
  30. package/.next/server/pages/404.html +1 -1
  31. package/.next/server/pages/500.html +1 -1
  32. package/.next/static/chunks/app/{page-efb679eaab3069c0.js → page-e61667f524c47df8.js} +1 -1
  33. package/.next/trace +7 -8
  34. package/.next/trace-build +1 -1
  35. package/bin/pi-web.js +52 -0
  36. package/package.json +1 -1
  37. /package/.next/static/{f4rH6foh7SRYPyydhuOoP → IuQAt7yMoZluQxU_dpzPh}/_buildManifest.js +0 -0
  38. /package/.next/static/{f4rH6foh7SRYPyydhuOoP → IuQAt7yMoZluQxU_dpzPh}/_ssgManifest.js +0 -0
package/.next/trace-build CHANGED
@@ -1 +1 @@
1
- [{"name":"run-webpack","duration":13496225,"timestamp":304901346623,"id":14,"parentId":1,"tags":{},"startTime":1789150145132,"traceId":"5e98cd14d676697c"},{"name":"run-typescript","duration":3282889,"timestamp":304914845271,"id":916,"parentId":1,"tags":{},"startTime":1789150158630,"traceId":"5e98cd14d676697c"},{"name":"static-check","duration":1626527,"timestamp":304918133611,"id":919,"parentId":1,"tags":{},"startTime":1789150161919,"traceId":"5e98cd14d676697c"},{"name":"static-generation","duration":2121902,"timestamp":304919861746,"id":1119,"parentId":1,"tags":{},"startTime":1789150163648,"traceId":"5e98cd14d676697c"},{"name":"collect-build-traces","duration":16029596,"timestamp":304919761546,"id":1116,"parentId":1,"tags":{},"startTime":1789150163547,"traceId":"5e98cd14d676697c"},{"name":"output-standalone","duration":1552515,"timestamp":304935791415,"id":1127,"parentId":1,"tags":{},"startTime":1789150179579,"traceId":"5e98cd14d676697c"},{"name":"telemetry-flush","duration":14,"timestamp":304937345589,"id":1130,"parentId":1,"tags":{},"startTime":1789150181133,"traceId":"5e98cd14d676697c"},{"name":"next-build","duration":36353005,"timestamp":304900992601,"id":1,"tags":{"buildMode":"default","version":"16.3.1","bundler":"webpack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1789150144778,"traceId":"5e98cd14d676697c"}]
1
+ [{"name":"run-webpack","duration":14338442,"timestamp":332515778484,"id":14,"parentId":1,"tags":{},"startTime":1789177759529,"traceId":"2f72d34f606d37f4"},{"name":"run-typescript","duration":2970649,"timestamp":332530119189,"id":916,"parentId":1,"tags":{},"startTime":1789177773870,"traceId":"2f72d34f606d37f4"},{"name":"static-check","duration":1286373,"timestamp":332533096475,"id":919,"parentId":1,"tags":{},"startTime":1789177776847,"traceId":"2f72d34f606d37f4"},{"name":"static-generation","duration":2140316,"timestamp":332534486279,"id":1119,"parentId":1,"tags":{},"startTime":1789177778237,"traceId":"2f72d34f606d37f4"},{"name":"collect-build-traces","duration":15776393,"timestamp":332534385173,"id":1116,"parentId":1,"tags":{},"startTime":1789177778136,"traceId":"2f72d34f606d37f4"},{"name":"output-standalone","duration":1569130,"timestamp":332550189148,"id":1127,"parentId":1,"tags":{},"startTime":1789177793940,"traceId":"2f72d34f606d37f4"},{"name":"telemetry-flush","duration":13,"timestamp":332551759793,"id":1130,"parentId":1,"tags":{},"startTime":1789177795511,"traceId":"2f72d34f606d37f4"},{"name":"next-build","duration":36613802,"timestamp":332515146008,"id":1,"tags":{"buildMode":"default","version":"16.3.1","bundler":"webpack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1789177758896,"traceId":"2f72d34f606d37f4"}]
package/bin/pi-web.js CHANGED
@@ -8,6 +8,8 @@ const path = require("path");
8
8
  // eslint-disable-next-line @typescript-eslint/no-require-imports
9
9
  const fs = require("fs");
10
10
  // eslint-disable-next-line @typescript-eslint/no-require-imports
11
+ const os = require("os");
12
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
11
13
  const { parseLaunchOptions, assessLanExposure } = require("./pi-web-options");
12
14
  // eslint-disable-next-line @typescript-eslint/no-require-imports
13
15
  const { wireChildProcessLifecycle } = require("./process-lifecycle");
@@ -52,6 +54,51 @@ try {
52
54
  }
53
55
  }
54
56
 
57
+ /**
58
+ * Load configuration from the user's home, not the install directory.
59
+ *
60
+ * A `.env` next to the package is lost on every `npm install -g`
61
+ * (the install directory is replaced wholesale), which silently drops the
62
+ * password and host allowlist. Reading from `~/.pi/` keeps the settings across
63
+ * upgrades. Values already present in the environment win, so a supervisor can
64
+ * still override a single variable.
65
+ */
66
+ function loadUserEnv() {
67
+ const candidates = [
68
+ path.join(os.homedir(), ".pi", "agent", "pi-web.env"),
69
+ path.join(os.homedir(), ".pi", "pi-web.env"),
70
+ ];
71
+ const file = candidates.find((candidate) => fs.existsSync(candidate));
72
+ if (!file) return null;
73
+ let text;
74
+ try {
75
+ text = fs.readFileSync(file, "utf8");
76
+ } catch {
77
+ return null;
78
+ }
79
+ const applied = [];
80
+ for (const line of text.split(/\r?\n/)) {
81
+ const trimmed = line.trim();
82
+ if (!trimmed || trimmed.startsWith("#")) continue;
83
+ const separator = trimmed.indexOf("=");
84
+ if (separator === -1) continue;
85
+ const key = trimmed.slice(0, separator).trim();
86
+ let value = trimmed.slice(separator + 1).trim();
87
+ // Strip one layer of matching quotes, as dotenv does.
88
+ if (value.length >= 2 && ((value.startsWith('"') && value.endsWith('"')) || (value.startsWith("'") && value.endsWith("'")))) {
89
+ value = value.slice(1, -1);
90
+ }
91
+ if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(key)) continue;
92
+ if (process.env[key] !== undefined) continue;
93
+ process.env[key] = value;
94
+ applied.push(key);
95
+ }
96
+ return { file, applied };
97
+ }
98
+
99
+ // Before option parsing, so a port or host recorded in the file takes effect.
100
+ const userEnv = loadUserEnv();
101
+
55
102
  let launchOptions;
56
103
  try {
57
104
  launchOptions = parseLaunchOptions();
@@ -66,6 +113,11 @@ if (launchOptions.help) {
66
113
  }
67
114
  const { port, hostname, openBrowser } = launchOptions;
68
115
 
116
+ if (userEnv) {
117
+ // Names only — never echo values into a log that may be captured.
118
+ console.log(`Loaded ${userEnv.applied.length} setting(s) from ${userEnv.file}${userEnv.applied.length ? `: ${userEnv.applied.join(", ")}` : ""}`);
119
+ }
120
+
69
121
  // Apply the same heap cap as the npm scripts so `pi-web` (production entry)
70
122
  // never lets the V8 heap balloon to Next.js's auto 50%-of-RAM default.
71
123
  const { mergedNodeOptions } = require("./with-memory-limit");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qt4798/pi-web",
3
- "version": "0.17.11",
3
+ "version": "0.17.12",
4
4
  "description": "Web workspace for the pi coding agent",
5
5
  "homepage": "https://github.com/t479842598/pi-web-QT#readme",
6
6
  "repository": {