@prismshadow/penguin-server 0.2.0 → 0.2.2

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.
@@ -0,0 +1,17 @@
1
+ declare function initialAdminPasswordPath(root: string): string;
2
+ /** Persists the seeded plaintext (owner-only file). Best-effort: the seed itself must not fail on an exotic filesystem — the reminder just degrades to first-start-only. */
3
+ declare function storeInitialAdminPassword(root: string, password: string): void;
4
+ /** The stored plaintext, or null when absent/unreadable/empty. */
5
+ declare function readInitialAdminPassword(root: string): string | null;
6
+ /** Removes the stored plaintext (idempotent, best-effort). */
7
+ declare function clearInitialAdminPassword(root: string): void;
8
+ /**
9
+ * The framed reminder block, ready for console.log. Plain ASCII (`+`/`-`/`|`) rather
10
+ * than box-drawing characters: the server may run under terminals and log collectors
11
+ * with non-UTF-8 code pages (legacy Windows consoles above all), and a misrendered frame
12
+ * would bury exactly the line it exists to highlight. Width follows the longest line, so
13
+ * a long pinned password widens the frame instead of breaking it.
14
+ */
15
+ declare function renderInitialPasswordNotice(userId: string, password: string): string;
16
+
17
+ export { clearInitialAdminPassword, initialAdminPasswordPath, readInitialAdminPassword, renderInitialPasswordNotice, storeInitialAdminPassword };
@@ -0,0 +1,15 @@
1
+ import {
2
+ clearInitialAdminPassword,
3
+ initialAdminPasswordPath,
4
+ readInitialAdminPassword,
5
+ renderInitialPasswordNotice,
6
+ storeInitialAdminPassword
7
+ } from "./chunk-UUJCF46V.js";
8
+ export {
9
+ clearInitialAdminPassword,
10
+ initialAdminPasswordPath,
11
+ readInitialAdminPassword,
12
+ renderInitialPasswordNotice,
13
+ storeInitialAdminPassword
14
+ };
15
+ //# sourceMappingURL=initial-password.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/dist/lock.d.ts ADDED
@@ -0,0 +1,18 @@
1
+ interface ServerLock {
2
+ pid: number;
3
+ port: number;
4
+ startedAt: string;
5
+ }
6
+ declare function serverLockPath(root: string): string;
7
+ /** Reads the lock file; a missing or malformed file reads as "no lock". */
8
+ declare function readServerLock(root: string): ServerLock | null;
9
+ /** True when the lock's process is alive AND its port accepts connections. */
10
+ declare function isServerLockAlive(lock: ServerLock): Promise<boolean>;
11
+ /** Convenience for pre-checks: the live lock on this root, or null (absent or stale). */
12
+ declare function liveServerLock(root: string): Promise<ServerLock | null>;
13
+ /** Writes the lock atomically (tmp + rename; the parent directory must already exist). */
14
+ declare function acquireServerLock(root: string, lock: ServerLock): void;
15
+ /** Removes the lock if it is still ours (best-effort; never throws on shutdown paths). */
16
+ declare function releaseServerLock(root: string): void;
17
+
18
+ export { type ServerLock, acquireServerLock, isServerLockAlive, liveServerLock, readServerLock, releaseServerLock, serverLockPath };
package/dist/lock.js ADDED
@@ -0,0 +1,17 @@
1
+ import {
2
+ acquireServerLock,
3
+ isServerLockAlive,
4
+ liveServerLock,
5
+ readServerLock,
6
+ releaseServerLock,
7
+ serverLockPath
8
+ } from "./chunk-OMBFPEGQ.js";
9
+ export {
10
+ acquireServerLock,
11
+ isServerLockAlive,
12
+ liveServerLock,
13
+ readServerLock,
14
+ releaseServerLock,
15
+ serverLockPath
16
+ };
17
+ //# sourceMappingURL=lock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prismshadow/penguin-server",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "type": "module",
5
5
  "description": "PenguinHarness web server: multi-user authentication and authorization, Session execution with SSE streaming, and usage accounting, built on @prismshadow/penguin-core.",
6
6
  "license": "Apache-2.0",
@@ -17,6 +17,14 @@
17
17
  "./api": {
18
18
  "types": "./dist/api/types.d.ts",
19
19
  "import": "./dist/api/types.js"
20
+ },
21
+ "./lock": {
22
+ "types": "./dist/lock.d.ts",
23
+ "import": "./dist/lock.js"
24
+ },
25
+ "./initial-password": {
26
+ "types": "./dist/initial-password.d.ts",
27
+ "import": "./dist/initial-password.js"
20
28
  }
21
29
  },
22
30
  "main": "./dist/index.js",
@@ -27,12 +35,14 @@
27
35
  "dependencies": {
28
36
  "@hono/node-server": "^2.0.5",
29
37
  "dotenv": "^17.0.0",
30
- "hono": "^4.8.0",
38
+ "fflate": "^0.8.3",
39
+ "hono": "^4.12.34",
31
40
  "smol-toml": "^1.3.0",
32
41
  "tar": "^7.5.21",
42
+ "undici": "^7.29.0",
33
43
  "yaml": "^2.5.0",
34
- "@prismshadow/penguin-core": "0.2.0",
35
- "@prismshadow/penguin-skills": "0.2.0"
44
+ "@prismshadow/penguin-core": "0.2.2",
45
+ "@prismshadow/penguin-skills": "0.2.2"
36
46
  },
37
47
  "devDependencies": {
38
48
  "@types/node": "^24.0.0",