@cremini/skillpack 1.0.9-im.3 → 1.0.9-im.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cremini/skillpack",
3
- "version": "1.0.9-im.3",
3
+ "version": "1.0.9-im.4",
4
4
  "description": "Turn Skills into a Standalone App with UI",
5
5
  "type": "module",
6
6
  "repository": {
package/runtime/README.md CHANGED
@@ -17,24 +17,23 @@ Double-click `start.bat` or run:
17
17
  start.bat
18
18
  ```
19
19
 
20
- After the server starts, your browser opens [http://127.0.0.1:26313](http://127.0.0.1:26313) automatically.
20
+ Both launchers install server dependencies locally if needed, then start the app under the bundled PM2 runtime. After the server starts, your browser opens [http://127.0.0.1:26313](http://127.0.0.1:26313) automatically.
21
21
 
22
22
  By default, the server only listens on `127.0.0.1` so the API key you enter stays on the local machine and is not exposed to your LAN.
23
23
 
24
24
  ## Managed Restart with PM2
25
25
 
26
- If you want the web UI and bot commands to support in-app restart, run the server under PM2:
26
+ `start.sh` and `start.bat` already use PM2. If you want to launch it manually, use the local PM2 binary inside `server/node_modules`:
27
27
 
28
28
  ```bash
29
- npm install -g pm2
30
- pm2 start ecosystem.config.cjs
29
+ ./server/node_modules/.bin/pm2 startOrRestart ecosystem.config.cjs --update-env
31
30
  ```
32
31
 
33
32
  Behavior:
34
33
 
35
34
  - `/restart` or the web restart button exits with restart code `75`; PM2 brings the process back up
36
35
  - `/shutdown` exits with code `64`; PM2 treats it as a stop and does not auto-restart
37
- - When started via `start.sh` or `start.bat`, restart is manual only
36
+ - The PM2 app name is derived from `skillpack.json.name`, falling back to the folder name
38
37
 
39
38
  ## First Use
40
39
 
@@ -1,9 +1,25 @@
1
1
  const path = require("node:path");
2
+ const fs = require("node:fs");
3
+
4
+ const fallbackName = path.basename(__dirname) || "skillpack";
5
+ let appName = fallbackName;
6
+
7
+ try {
8
+ const skillpackPath = path.join(__dirname, "skillpack.json");
9
+ if (fs.existsSync(skillpackPath)) {
10
+ const parsed = JSON.parse(fs.readFileSync(skillpackPath, "utf-8"));
11
+ if (typeof parsed.name === "string" && parsed.name.trim()) {
12
+ appName = parsed.name.trim();
13
+ }
14
+ }
15
+ } catch (err) {
16
+ console.warn("[PM2] Failed to read skillpack.json for app name:", err);
17
+ }
2
18
 
3
19
  module.exports = {
4
20
  apps: [
5
21
  {
6
- name: "skillpack",
22
+ name: appName,
7
23
  cwd: path.join(__dirname, "server"),
8
24
  script: "dist/index.js",
9
25
  autorestart: true,