pi-yun 0.1.2 → 0.1.4

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 (52) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +11 -11
  3. package/.next/build-manifest.json +2 -2
  4. package/.next/required-server-files.js +2 -1
  5. package/.next/required-server-files.json +2 -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 +2 -2
  15. package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  16. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  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/api/cwd/browse/route.js.nft.json +2 -2
  20. package/.next/server/app/api/cwd/validate/route.js.nft.json +2 -2
  21. package/.next/server/app/api/models/default/route.js.nft.json +2 -2
  22. package/.next/server/app/api/models/enabled/route.js.nft.json +2 -2
  23. package/.next/server/app/api/terminal/[id]/events/route.js +2 -2
  24. package/.next/server/app/api/terminal/[id]/route.js +1 -1
  25. package/.next/server/app/api/terminal/route.js +1 -1
  26. package/.next/server/app/index.html +1 -1
  27. package/.next/server/app/index.rsc +2 -2
  28. package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  29. package/.next/server/app/index.segments/_full.segment.rsc +2 -2
  30. package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  31. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  32. package/.next/server/app/login.html +1 -1
  33. package/.next/server/app/login.rsc +2 -2
  34. package/.next/server/app/login.segments/_full.segment.rsc +2 -2
  35. package/.next/server/app/login.segments/_tree.segment.rsc +1 -1
  36. package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  37. package/.next/server/app/page_client-reference-manifest.js +1 -1
  38. package/.next/server/app-paths-manifest.json +11 -11
  39. package/.next/server/chunks/2243.js +1 -1
  40. package/.next/server/middleware-build-manifest.js +1 -1
  41. package/.next/server/pages/404.html +1 -1
  42. package/.next/server/pages/500.html +1 -1
  43. package/.next/static/chunks/app/{layout-3dc3a778fc61244e.js → layout-cc62c2969905e754.js} +1 -1
  44. package/.next/trace +8 -8
  45. package/.next/trace-build +1 -1
  46. package/README.md +9 -9
  47. package/bin/pi-web-update.js +16 -10
  48. package/next.config.ts +2 -1
  49. package/package.json +1 -2
  50. package/bin/prepare-terminal.js +0 -14
  51. /package/.next/static/{4JhGgJa7UiD-aIZf7gQtM → KEEELqca_YKVETbSzuCc-}/_buildManifest.js +0 -0
  52. /package/.next/static/{4JhGgJa7UiD-aIZf7gQtM → KEEELqca_YKVETbSzuCc-}/_ssgManifest.js +0 -0
package/.next/trace-build CHANGED
@@ -1 +1 @@
1
- [{"name":"run-webpack","duration":162298394,"timestamp":269166353904,"id":14,"parentId":1,"tags":{},"startTime":1792641162217,"traceId":"0870f70473624400"},{"name":"run-typescript","duration":13372343,"timestamp":269328663608,"id":782,"parentId":1,"tags":{},"startTime":1792641324527,"traceId":"0870f70473624400"},{"name":"static-check","duration":20501805,"timestamp":269342219075,"id":785,"parentId":1,"tags":{},"startTime":1792641338082,"traceId":"0870f70473624400"},{"name":"static-generation","duration":6297735,"timestamp":269362878806,"id":937,"parentId":1,"tags":{},"startTime":1792641358742,"traceId":"0870f70473624400"},{"name":"collect-build-traces","duration":37184296,"timestamp":269362725351,"id":934,"parentId":1,"tags":{},"startTime":1792641358589,"traceId":"0870f70473624400"},{"name":"telemetry-flush","duration":65,"timestamp":269399916439,"id":946,"parentId":1,"tags":{},"startTime":1792641395776,"traceId":"0870f70473624400"},{"name":"next-build","duration":233775985,"timestamp":269166140527,"id":1,"tags":{"buildMode":"default","version":"16.3.8","bundler":"webpack","has-custom-webpack-config":"true","use-build-worker":"false"},"startTime":1792641162003,"traceId":"0870f70473624400"}]
1
+ [{"name":"run-webpack","duration":252477190,"timestamp":283416410681,"id":14,"parentId":1,"tags":{},"startTime":1792655412409,"traceId":"2cf1a54c41b30c1d"},{"name":"run-typescript","duration":24746416,"timestamp":283669032033,"id":789,"parentId":1,"tags":{},"startTime":1792655665030,"traceId":"2cf1a54c41b30c1d"},{"name":"static-check","duration":30053318,"timestamp":283693935581,"id":792,"parentId":1,"tags":{},"startTime":1792655689934,"traceId":"2cf1a54c41b30c1d"},{"name":"static-generation","duration":6557672,"timestamp":283724210317,"id":944,"parentId":1,"tags":{},"startTime":1792655720208,"traceId":"2cf1a54c41b30c1d"},{"name":"collect-build-traces","duration":37089407,"timestamp":283724007381,"id":941,"parentId":1,"tags":{},"startTime":1792655720005,"traceId":"2cf1a54c41b30c1d"},{"name":"telemetry-flush","duration":70,"timestamp":283761111004,"id":953,"parentId":1,"tags":{},"startTime":1792655757109,"traceId":"2cf1a54c41b30c1d"},{"name":"next-build","duration":347092440,"timestamp":283414018641,"id":1,"tags":{"buildMode":"default","version":"16.3.8","bundler":"webpack","has-custom-webpack-config":"true","use-build-worker":"false"},"startTime":1792655410017,"traceId":"2cf1a54c41b30c1d"}]
package/README.md CHANGED
@@ -29,24 +29,24 @@ The CLI opens a browser after the server is ready. If it does not, open [http://
29
29
 
30
30
  If no model provider is configured yet, open the **Models** panel to sign in or add an API key.
31
31
 
32
- To install the `pi-web-yun` command globally:
32
+ To install the `pi-yun` command globally:
33
33
 
34
34
  ```bash
35
- npm install -g pi-web-yun@latest
36
- pi-web
35
+ npm install -g pi-yun@latest
36
+ pi-yun
37
37
  ```
38
38
 
39
39
  Commands:
40
40
 
41
41
  ```bash
42
- pi-web version # print the installed version
43
- pi-web status # list running servers
44
- pi-web stop [--port N] # stop a running server
45
- pi-web open [--port N] # open a running server in the browser
46
- pi-web update [--check] # update a global npm install
42
+ pi-yun version # print the installed version
43
+ pi-yun status # list running servers
44
+ pi-yun stop [--port N] # stop a running server
45
+ pi-yun open [--port N] # open a running server in the browser
46
+ pi-yun update [--check] # update a global npm install
47
47
  ```
48
48
 
49
- To update, run `pi-web-yun stop`, then `pi-web-yun update` (or run the same install command again). To uninstall, run `npm uninstall -g pi-web-yun`.
49
+ To update, run `pi-yun stop`, then `pi-yun update` (or run the same install command again). To uninstall, run `npm uninstall -g pi-yun`.
50
50
 
51
51
  ## Configuration
52
52
 
@@ -7,9 +7,15 @@ const fs = require("fs");
7
7
  // eslint-disable-next-line @typescript-eslint/no-require-imports
8
8
  const path = require("path");
9
9
 
10
- const NPM_LATEST_URL = "https://registry.npmjs.org/@agegr%2Fpi-web/latest";
10
+ // This fork publishes under its own package name, so the update check and the
11
+ // install command both follow package.json: a rename stays a one-line change.
12
+ const PACKAGE_NAME =
13
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
14
+ require("../package.json").name;
15
+ const PACKAGE_BASENAME = PACKAGE_NAME.split("/").pop();
16
+ const NPM_LATEST_URL = `https://registry.npmjs.org/${PACKAGE_NAME.replace("/", "%2F")}/latest`;
11
17
  const FETCH_TIMEOUT_MS = 10_000;
12
- const MANUAL_COMMAND = "npm install -g pi-web-yun@latest";
18
+ const MANUAL_COMMAND = `npm install -g ${PACKAGE_NAME}@latest`;
13
19
 
14
20
  // Port of lib/app-update.ts (bin cannot import TypeScript).
15
21
  function parseStableVersion(version) {
@@ -64,13 +70,13 @@ function realpathOrSelf(target, realpath = fs.realpathSync) {
64
70
  }
65
71
  }
66
72
 
67
- // "global": pkgDir is <npm root -g>/pi-web-yun (unscoped); "npx": an npx cache; else "other".
73
+ // "global": pkgDir is <npm root -g>/<package name>; "npx": an npx cache; else "other".
68
74
  function getInstallKind({ pkgDir, npmRoot, realpath = fs.realpathSync }) {
69
75
  const realPkgDir = realpathOrSelf(pkgDir, realpath);
70
76
  if (realPkgDir.split(/[\\/]/).includes("_npx")) return "npx";
71
77
  if (!npmRoot) return "other";
72
78
  const inGlobalRoot =
73
- path.basename(realPkgDir) === "pi-web-yun" &&
79
+ path.basename(realPkgDir) === PACKAGE_BASENAME &&
74
80
  realpathOrSelf(path.dirname(realPkgDir), realpath) === realpathOrSelf(npmRoot, realpath);
75
81
  return inGlobalRoot ? "global" : "other";
76
82
  }
@@ -86,7 +92,7 @@ function getGlobalNpmRoot() {
86
92
  }
87
93
 
88
94
  function runNpmInstall(version) {
89
- const invocation = findNpmInvocation(["install", "-g", `pi-web-yun@${version}`]);
95
+ const invocation = findNpmInvocation(["install", "-g", `${PACKAGE_NAME}@${version}`]);
90
96
  if (!invocation) return null;
91
97
  const result = spawnSync(invocation.command, invocation.args, { stdio: "inherit" });
92
98
  return result.status ?? 1;
@@ -113,26 +119,26 @@ async function runUpdate({
113
119
  return 1;
114
120
  }
115
121
  if (!isNewerStableVersion(latest, currentVersion)) {
116
- log(`pi-web ${currentVersion} is up to date.`);
122
+ log(`${PACKAGE_NAME} ${currentVersion} is up to date.`);
117
123
  return 0;
118
124
  }
119
- log(`pi-web ${latest} is available (installed: ${currentVersion}).`);
125
+ log(`${PACKAGE_NAME} ${latest} is available (installed: ${currentVersion}).`);
120
126
  if (check) return 0;
121
127
 
122
128
  // A running `next start` has .next/ open; never replace it underneath.
123
129
  const running = await listRecords();
124
130
  if (running.length > 0) {
125
- error(`pi-web is running:\n${running.map(formatRecord).join("\n")}\nRun \`pi-web stop\` first, then update.`);
131
+ error(`${PACKAGE_NAME} is running:\n${running.map(formatRecord).join("\n")}\nRun \`${PACKAGE_BASENAME} stop\` first, then update.`);
126
132
  return 1;
127
133
  }
128
134
 
129
135
  const kind = getInstallKind({ pkgDir, npmRoot: getNpmRoot(), realpath });
130
136
  if (kind === "npx") {
131
- error("This pi-web runs from the npx cache. Run `npx pi-web-yun@latest` instead.");
137
+ error(`This ${PACKAGE_BASENAME} runs from the npx cache. Run \`npx ${PACKAGE_NAME}@latest\` instead.`);
132
138
  return 1;
133
139
  }
134
140
  if (kind !== "global") {
135
- error(`This pi-web is not a global npm install. Update it yourself, for example: ${MANUAL_COMMAND}`);
141
+ error(`This ${PACKAGE_BASENAME} is not a global npm install. Update it yourself, for example: ${MANUAL_COMMAND}`);
136
142
  return 1;
137
143
  }
138
144
 
package/next.config.ts CHANGED
@@ -4,7 +4,7 @@ import { dirname, join } from "path";
4
4
  import { fileURLToPath } from "url";
5
5
 
6
6
  const configDir = dirname(fileURLToPath(import.meta.url));
7
- const { version } = JSON.parse(readFileSync(join(configDir, "package.json"), "utf8")) as { version: string };
7
+ const { version, name } = JSON.parse(readFileSync(join(configDir, "package.json"), "utf8")) as { version: string; name: string };
8
8
  let piVersion = "unknown";
9
9
  try {
10
10
  const piPkgPath = join(configDir, "node_modules/@earendil-works/pi-coding-agent/package.json");
@@ -104,6 +104,7 @@ const nextConfig: NextConfig = {
104
104
  },
105
105
  env: {
106
106
  NEXT_PUBLIC_APP_VERSION: version,
107
+ NEXT_PUBLIC_APP_NAME: name,
107
108
  NEXT_PUBLIC_PI_VERSION: piVersion,
108
109
  },
109
110
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-yun",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Web UI for the pi coding agent (fork of @agegr/pi-web)",
5
5
  "homepage": "https://github.com/Jason-24/pi-web-yun#readme",
6
6
  "repository": {
@@ -35,7 +35,6 @@
35
35
  "package.json"
36
36
  ],
37
37
  "scripts": {
38
- "postinstall": "node bin/prepare-terminal.js",
39
38
  "dev": "next dev -H 127.0.0.1 -p 30141",
40
39
  "dev:lan": "next dev -H 0.0.0.0 -p 30141",
41
40
  "build": "next build --webpack",
@@ -1,14 +0,0 @@
1
- // node-pty 1.1.0 ships macOS spawn-helper binaries without executable bits.
2
- // Remove this workaround once the upstream package preserves those modes.
3
- /* eslint-disable @typescript-eslint/no-require-imports */
4
- const { chmodSync, statSync } = require("node:fs");
5
- const { dirname, join } = require("node:path");
6
-
7
- if (process.platform === "darwin") {
8
- const root = dirname(require.resolve("node-pty/package.json"));
9
- for (const directory of ["build/Release", "build/Debug", `prebuilds/darwin-${process.arch}`]) {
10
- const helper = join(root, directory, "spawn-helper");
11
- const stat = statSync(helper, { throwIfNoEntry: false });
12
- if (stat?.isFile() && (stat.mode & 0o111) !== 0o111) chmodSync(helper, stat.mode | 0o111);
13
- }
14
- }