@seqyuan/pidex 0.7.4 → 0.7.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 +3 -3
- package/.next/build-manifest.json +2 -2
- package/.next/prerender-manifest.json +3 -3
- package/.next/required-server-files.js +1 -1
- package/.next/required-server-files.json +1 -1
- 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_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +1 -1
- package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- 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 +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +2 -2
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/index.segments/_full.segment.rsc +2 -2
- package/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/.next/server/app/index.segments/_tree.segment.rsc +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 +1 -1
- package/.next/server/app/login.segments/_full.segment.rsc +1 -1
- package/.next/server/app/login.segments/_head.segment.rsc +1 -1
- package/.next/server/app/login.segments/_index.segment.rsc +1 -1
- package/.next/server/app/login.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/login.segments/login.segment.rsc +1 -1
- package/.next/server/app/page.js +2 -2
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +3 -3
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-manifest.json +5 -5
- 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/app/{page-f3f1306513a99a15.js → page-3a9b6a1dcc4f81e4.js} +2 -2
- package/.next/trace +32 -32
- package/.next/trace-build +1 -1
- package/bin/pi-web.js +74 -3
- package/package.json +1 -1
- /package/.next/static/{kMKtm_i-G3uIvEO8yPr6r → Uyfhd8CTitS0X-x3xci5m}/_buildManifest.js +0 -0
- /package/.next/static/{kMKtm_i-G3uIvEO8yPr6r → Uyfhd8CTitS0X-x3xci5m}/_ssgManifest.js +0 -0
package/.next/trace-build
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"name":"run-webpack","duration":
|
|
1
|
+
[{"name":"run-webpack","duration":19137813,"timestamp":71684424,"id":14,"parentId":1,"tags":{},"startTime":1780039888539,"traceId":"105be6f630b2de37"},{"name":"run-typescript","duration":6602334,"timestamp":90827235,"id":3255,"parentId":1,"tags":{},"startTime":1780039907682,"traceId":"105be6f630b2de37"},{"name":"static-check","duration":1812933,"timestamp":97445785,"id":3258,"parentId":1,"tags":{},"startTime":1780039914300,"traceId":"105be6f630b2de37"},{"name":"static-generation","duration":3308689,"timestamp":99887708,"id":3324,"parentId":1,"tags":{},"startTime":1780039916742,"traceId":"105be6f630b2de37"},{"name":"collect-build-traces","duration":40465033,"timestamp":99262208,"id":3321,"parentId":1,"tags":{},"startTime":1780039916117,"traceId":"105be6f630b2de37"},{"name":"telemetry-flush","duration":56,"timestamp":139729809,"id":3333,"parentId":1,"tags":{},"startTime":1780039956584,"traceId":"105be6f630b2de37"},{"name":"next-build","duration":68199276,"timestamp":71530600,"id":1,"tags":{"buildMode":"default","version":"16.2.1","bundler":"webpack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1780039888385,"traceId":"105be6f630b2de37"}]
|
package/bin/pi-web.js
CHANGED
|
@@ -16,6 +16,9 @@ const { parseArgs } = require("util");
|
|
|
16
16
|
|
|
17
17
|
const pkgDir = path.join(__dirname, "..");
|
|
18
18
|
const nextDir = path.join(pkgDir, ".next");
|
|
19
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(pkgDir, "package.json"), "utf8"));
|
|
20
|
+
const VERSION = pkg.version;
|
|
21
|
+
const PKG_NAME = pkg.name;
|
|
19
22
|
|
|
20
23
|
// Resolve next's CLI entry
|
|
21
24
|
let nextBin;
|
|
@@ -30,14 +33,81 @@ try {
|
|
|
30
33
|
}
|
|
31
34
|
}
|
|
32
35
|
|
|
33
|
-
const { values: cliArgs } = parseArgs({
|
|
36
|
+
const { values: cliArgs, positionals } = parseArgs({
|
|
34
37
|
options: {
|
|
35
38
|
port: { type: "string", short: "p" },
|
|
36
39
|
hostname: { type: "string", short: "H" },
|
|
40
|
+
version: { type: "boolean", short: "v" },
|
|
41
|
+
help: { type: "boolean", short: "h" },
|
|
37
42
|
},
|
|
38
43
|
strict: false,
|
|
44
|
+
allowPositionals: true,
|
|
39
45
|
});
|
|
40
46
|
|
|
47
|
+
// ── CLI commands ──
|
|
48
|
+
|
|
49
|
+
if (cliArgs.version) {
|
|
50
|
+
console.log(VERSION);
|
|
51
|
+
process.exit(0);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (cliArgs.help) {
|
|
55
|
+
console.log(`pidex v${VERSION} — Web UI for the pi coding agent
|
|
56
|
+
|
|
57
|
+
Usage:
|
|
58
|
+
pidex [options]
|
|
59
|
+
pidex update Update to the latest version
|
|
60
|
+
|
|
61
|
+
Options:
|
|
62
|
+
-p, --port <port> Port to listen on (default: 30141, env: PORT)
|
|
63
|
+
-H, --hostname <host> Hostname to bind to (default: localhost)
|
|
64
|
+
-v, --version Print version
|
|
65
|
+
-h, --help Show this help
|
|
66
|
+
|
|
67
|
+
Environment:
|
|
68
|
+
PORT Server port
|
|
69
|
+
PIDEX_PASSWORD Set password on first start
|
|
70
|
+
PI_CODING_AGENT_DIR Custom pi agent data directory
|
|
71
|
+
`);
|
|
72
|
+
process.exit(0);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const firstPos = positionals[0];
|
|
76
|
+
if (firstPos === "update") {
|
|
77
|
+
console.log(`\n Updating ${PKG_NAME} to latest version...\n`);
|
|
78
|
+
const child = spawn(process.execPath, [
|
|
79
|
+
require.resolve("npm/bin/npm-cli.js", { paths: [pkgDir] }) ||
|
|
80
|
+
path.join(path.dirname(process.execPath), "npm"),
|
|
81
|
+
"install", "-g", `${PKG_NAME}@latest`,
|
|
82
|
+
], { stdio: "inherit" });
|
|
83
|
+
child.on("exit", (code) => process.exit(code ?? 0));
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// ── Version check (async, non-blocking) ──
|
|
88
|
+
|
|
89
|
+
function checkVersion() {
|
|
90
|
+
const https = require("https");
|
|
91
|
+
const req = https.get(`https://registry.npmjs.org/${encodeURIComponent(PKG_NAME)}/latest`, { timeout: 5000 }, (res) => {
|
|
92
|
+
let data = "";
|
|
93
|
+
res.on("data", (chunk) => data += chunk);
|
|
94
|
+
res.on("end", () => {
|
|
95
|
+
try {
|
|
96
|
+
const json = JSON.parse(data);
|
|
97
|
+
const latest = json.version;
|
|
98
|
+
if (latest && latest !== VERSION) {
|
|
99
|
+
console.log(`\n ⚡ Update available: ${VERSION} → ${latest}`);
|
|
100
|
+
console.log(` Run: pidex update\n`);
|
|
101
|
+
}
|
|
102
|
+
} catch { /* ignore */ }
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
req.on("error", () => {});
|
|
106
|
+
req.on("timeout", () => req.destroy());
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// ── Normal startup ──
|
|
110
|
+
|
|
41
111
|
const port = cliArgs.port ?? process.env.PORT ?? "30141";
|
|
42
112
|
const hostname = cliArgs.hostname ?? process.env.HOSTNAME ?? null;
|
|
43
113
|
|
|
@@ -92,7 +162,7 @@ async function maybeSetupAuth() {
|
|
|
92
162
|
await promptPassword();
|
|
93
163
|
}
|
|
94
164
|
|
|
95
|
-
// ── Seed
|
|
165
|
+
// ── Seed defaults ──
|
|
96
166
|
const defaultSoulSrc = path.join(pkgDir, "lib", "default-soul.md");
|
|
97
167
|
const soulDest = path.join(os.homedir(), ".pi", "agent", "soul.md");
|
|
98
168
|
if (!fs.existsSync(soulDest) && fs.existsSync(defaultSoulSrc)) {
|
|
@@ -102,7 +172,6 @@ if (!fs.existsSync(soulDest) && fs.existsSync(defaultSoulSrc)) {
|
|
|
102
172
|
console.log(" 🖖 Default soul.md seeded to ~/.pi/agent/soul.md");
|
|
103
173
|
}
|
|
104
174
|
|
|
105
|
-
// ── Seed default harness.md ──
|
|
106
175
|
const defaultHarnessSrc = path.join(pkgDir, "lib", "visualization-harness.md");
|
|
107
176
|
const harnessDest = path.join(os.homedir(), ".pi", "agent", "harness.md");
|
|
108
177
|
if (!fs.existsSync(harnessDest) && fs.existsSync(defaultHarnessSrc)) {
|
|
@@ -119,6 +188,8 @@ if (!fs.existsSync(nextDir)) {
|
|
|
119
188
|
process.exit(1);
|
|
120
189
|
}
|
|
121
190
|
|
|
191
|
+
checkVersion();
|
|
192
|
+
|
|
122
193
|
const nextArgs = ["start", "-p", port];
|
|
123
194
|
if (hostname) nextArgs.push("-H", hostname);
|
|
124
195
|
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|