@prismshadow/penguin-server 0.2.11 → 0.2.13

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 (80) hide show
  1. package/README.md +1 -1
  2. package/dist/api/types.d.ts +1014 -12
  3. package/dist/api/types.js +7 -0
  4. package/dist/auth-token.js +6 -4
  5. package/dist/auth-token.js.map +1 -1
  6. package/dist/{chunk-Q65VPAQS.js → chunk-3I2XOPJB.js} +102 -55
  7. package/dist/chunk-3I2XOPJB.js.map +1 -0
  8. package/dist/{chunk-ADZJYDNC.js → chunk-A3QANMU5.js} +293 -3
  9. package/dist/chunk-A3QANMU5.js.map +1 -0
  10. package/dist/chunk-B5IP37ZQ.js +56 -0
  11. package/dist/chunk-L2H3K4DT.js +7 -0
  12. package/dist/chunk-L2H3K4DT.js.map +1 -0
  13. package/dist/chunk-LPPVGHYD.js +83 -0
  14. package/dist/chunk-LPPVGHYD.js.map +1 -0
  15. package/dist/{chunk-TTGGJDNA.js → chunk-S3BI6R7I.js} +2 -2
  16. package/dist/{chunk-HOS3W3UP.js → chunk-TOOTEEM4.js} +50 -8
  17. package/dist/chunk-TOOTEEM4.js.map +1 -0
  18. package/dist/hmr/manifest.d.ts +1 -77
  19. package/dist/hmr/manifest.js +6 -1
  20. package/dist/index.js +50757 -20174
  21. package/dist/index.js.map +1 -1
  22. package/dist/initial-password.js +1 -0
  23. package/dist/lock.js +1 -0
  24. package/dist/machine-status.js +2 -1
  25. package/dist/machine-status.js.map +1 -1
  26. package/dist/plugin/index.d.ts +2595 -0
  27. package/dist/plugin/index.js.map +1 -0
  28. package/dist/reset-admin-password.js +7 -5
  29. package/dist/reset-admin-password.js.map +1 -1
  30. package/dist/secret-file.js +2 -0
  31. package/dist/secret-file.js.map +1 -1
  32. package/dist/version-report.js +3 -2
  33. package/package.json +11 -9
  34. package/web-dist/assets/{addon-clipboard-1cARCaK9.js → addon-clipboard-DrZY90Ks.js} +1 -1
  35. package/web-dist/assets/{addon-fit-BWdzl8Er.js → addon-fit-CtEAdAax.js} +1 -1
  36. package/web-dist/assets/{addon-web-links-DjXuvn4Z.js → addon-web-links-DJL13cYY.js} +1 -1
  37. package/web-dist/assets/c-BG-tZi7o.js +1 -0
  38. package/web-dist/assets/cpp-CaeG3uDQ.js +1 -0
  39. package/web-dist/assets/css-Br67jR8j.js +1 -0
  40. package/web-dist/assets/diff-jW5kmiru.js +1 -0
  41. package/web-dist/assets/github-dark-BQV5ugrc.js +1 -0
  42. package/web-dist/assets/github-light-Rcb2q3L5.js +1 -0
  43. package/web-dist/assets/go-B7VTfpnm.js +1 -0
  44. package/web-dist/assets/highlighter-CUb4XKtQ.js +2 -0
  45. package/web-dist/assets/{highlighter-Cu43iYr8.js → highlighter-core-CrBdruEx.js} +2 -2
  46. package/web-dist/assets/highlighter.worker-CL6f9Fzw.js +152 -0
  47. package/web-dist/assets/html-BW_6VhB7.js +1 -0
  48. package/web-dist/assets/index-CmfumtXy.js +570 -0
  49. package/web-dist/assets/index-Ywc2uM5u.css +1 -0
  50. package/web-dist/assets/ini-Dix3pTmg.js +1 -0
  51. package/web-dist/assets/java-BTDmaRNO.js +1 -0
  52. package/web-dist/assets/javascript-WyGyM1wV.js +1 -0
  53. package/web-dist/assets/json-B8JryHcM.js +1 -0
  54. package/web-dist/assets/jsx-8cLv2Six.js +1 -0
  55. package/web-dist/assets/log-CcaF_xNv.js +1 -0
  56. package/web-dist/assets/markdown-DX-TNHnc.js +1 -0
  57. package/web-dist/assets/php-CNeTOyEV.js +1 -0
  58. package/web-dist/assets/python-B6Ihcp-E.js +1 -0
  59. package/web-dist/assets/ruby-CYiNE6ps.js +1 -0
  60. package/web-dist/assets/rust-CxuBE0J8.js +1 -0
  61. package/web-dist/assets/shellscript-DgJyDXW6.js +1 -0
  62. package/web-dist/assets/sql-Dq2MiB0T.js +1 -0
  63. package/web-dist/assets/toml-Ms459DBw.js +1 -0
  64. package/web-dist/assets/tsx-D6116Ycy.js +1 -0
  65. package/web-dist/assets/typescript-BqvgUolh.js +1 -0
  66. package/web-dist/assets/xml-BkAJuBCc.js +1 -0
  67. package/web-dist/assets/{xterm-DKcY6q-I.js → xterm-B2oS8Mg8.js} +1 -1
  68. package/web-dist/assets/yaml-Bopit2L3.js +1 -0
  69. package/web-dist/index.html +2 -2
  70. package/dist/chunk-4SXGU7RO.js +0 -50
  71. package/dist/chunk-4SXGU7RO.js.map +0 -1
  72. package/dist/chunk-ADZJYDNC.js.map +0 -1
  73. package/dist/chunk-HOS3W3UP.js.map +0 -1
  74. package/dist/chunk-Q65VPAQS.js.map +0 -1
  75. package/dist/extension/index.d.ts +0 -212
  76. package/web-dist/assets/index-Bm9n7ZV-.js +0 -457
  77. package/web-dist/assets/index-DR4PrRzS.css +0 -1
  78. /package/dist/{extension/index.js.map → chunk-B5IP37ZQ.js.map} +0 -0
  79. /package/dist/{chunk-TTGGJDNA.js.map → chunk-S3BI6R7I.js.map} +0 -0
  80. /package/dist/{extension → plugin}/index.js +0 -0
@@ -3,6 +3,7 @@ import {
3
3
  initialAdminPasswordPath,
4
4
  renderFirstLoginNotice
5
5
  } from "./chunk-K4ZSUT72.js";
6
+ import "./chunk-B5IP37ZQ.js";
6
7
  export {
7
8
  clearInitialAdminPassword,
8
9
  initialAdminPasswordPath,
package/dist/lock.js CHANGED
@@ -7,6 +7,7 @@ import {
7
7
  releaseServerLock,
8
8
  serverLockPath
9
9
  } from "./chunk-GOO5VUAB.js";
10
+ import "./chunk-B5IP37ZQ.js";
10
11
  export {
11
12
  acquireServerLock,
12
13
  isServerLockAlive,
@@ -6,7 +6,8 @@ import {
6
6
  } from "./chunk-GOO5VUAB.js";
7
7
  import {
8
8
  openDatabaseReadOnly
9
- } from "./chunk-ADZJYDNC.js";
9
+ } from "./chunk-A3QANMU5.js";
10
+ import "./chunk-B5IP37ZQ.js";
10
11
 
11
12
  // src/machine-status.ts
12
13
  import fs from "fs";
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/machine-status.ts"],"sourcesContent":["/**\n * \"Is a server running on this data root, and which machine is this?\" — answered from the\n * root itself, by whoever can read it, with no server needed and safely while one runs (the\n * same terms as `penguin auth token`, which writes to this database live).\n *\n * Exported as `@prismshadow/penguin-server/machine-status` for `penguin server status`, which\n * is how a CONTROLLER asks: it runs that one command over ssh and reads back JSON. The\n * question used to be asked in shell — `cat` the lock, `sed` the pid out of it, `kill -0`,\n * `cat` a second file for the id — which meant a parser on this side for a format with no\n * definition, and no answer at all from a Windows remote, `kill -0` having no cmd.exe\n * equivalent. Asking the machine's own CLI moves both problems to the side that has Node.\n *\n * Liveness is the local lock's own test (pid alive AND the port accepting), which the shell\n * version could not do: it only had `kill -0`, and a recycled pid reads as a live server.\n */\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport { openDatabaseReadOnly } from \"./db/database.js\";\nimport { MachinesRepo } from \"./db/repos/machines.js\";\nimport { liveServerLock } from \"./lock.js\";\n\n/** What `penguin server status` prints, as one line of JSON. */\nexport interface MachineStatus {\n /** A server owns this root right now: its pid is alive and its port answers. */\n running: boolean;\n /** The live server's port and pid; null when nothing is running. */\n port: number | null;\n pid: number | null;\n /**\n * This machine's own id, or null when it has none yet — the id is minted the first time a\n * server boots here, so an installed-but-never-run machine legitimately has none, and\n * saying null is better than minting one to answer a question.\n */\n machineId: string | null;\n}\n\n/** `dbPath` may be elsewhere (PENGUIN_WEB_DB), as everywhere else that reads this database. */\nexport async function readMachineStatus(\n root: string,\n dbPath: string = path.join(root, \"web.db\"),\n): Promise<MachineStatus> {\n const lock = await liveServerLock(root);\n return {\n running: lock !== null,\n port: lock?.port ?? null,\n pid: lock?.pid ?? null,\n machineId: readMachineId(dbPath),\n };\n}\n\n/**\n * Reads the id and changes nothing — and cannot: the connection is read-only.\n *\n * `openDatabaseReadOnly`, never `openDatabase`: the latter is the SCHEMA path — CREATE TABLE,\n * the ensureColumn list, an ALTER with a backfill, and the migrations. A controller asking a\n * machine what it is would then reshape that machine's database under the prepared statements\n * of the server running there, on a build that may be older than this question. A read-only\n * open makes that impossible rather than merely not done.\n *\n * Existence-checked first, because opening would create the file (and its directory) on a\n * root no server has ever used — a probe must not leave a data root behind it. A machine\n * whose database predates the `machine` table answers with no id rather than an error: it is\n * one that has never run a build that mints one, which is the truth about it.\n */\nfunction readMachineId(dbPath: string): string | null {\n if (!fs.existsSync(dbPath)) return null;\n const db = openDatabaseReadOnly(dbPath);\n try {\n return new MachinesRepo(db).peekOwnId();\n } catch {\n return null;\n } finally {\n db.close();\n }\n}\n"],"mappings":";;;;;;;;;;;AAeA,OAAO,QAAQ;AACf,OAAO,UAAU;AAqBjB,eAAsB,kBACpB,MACA,SAAiB,KAAK,KAAK,MAAM,QAAQ,GACjB;AACxB,QAAM,OAAO,MAAM,eAAe,IAAI;AACtC,SAAO;AAAA,IACL,SAAS,SAAS;AAAA,IAClB,MAAM,MAAM,QAAQ;AAAA,IACpB,KAAK,MAAM,OAAO;AAAA,IAClB,WAAW,cAAc,MAAM;AAAA,EACjC;AACF;AAgBA,SAAS,cAAc,QAA+B;AACpD,MAAI,CAAC,GAAG,WAAW,MAAM,EAAG,QAAO;AACnC,QAAM,KAAK,qBAAqB,MAAM;AACtC,MAAI;AACF,WAAO,IAAI,aAAa,EAAE,EAAE,UAAU;AAAA,EACxC,QAAQ;AACN,WAAO;AAAA,EACT,UAAE;AACA,OAAG,MAAM;AAAA,EACX;AACF;","names":[]}
1
+ {"version":3,"sources":["../src/machine-status.ts"],"sourcesContent":["/**\n * \"Is a server running on this data root, and which machine is this?\" — answered from the\n * root itself, by whoever can read it, with no server needed and safely while one runs (the\n * same terms as `penguin auth token`, which writes to this database live).\n *\n * Exported as `@prismshadow/penguin-server/machine-status` for `penguin server status`, which\n * is how a CONTROLLER asks: it runs that one command over ssh and reads back JSON. The\n * question used to be asked in shell — `cat` the lock, `sed` the pid out of it, `kill -0`,\n * `cat` a second file for the id — which meant a parser on this side for a format with no\n * definition, and no answer at all from a Windows remote, `kill -0` having no cmd.exe\n * equivalent. Asking the machine's own CLI moves both problems to the side that has Node.\n *\n * Liveness is the local lock's own test (pid alive AND the port accepting), which the shell\n * version could not do: it only had `kill -0`, and a recycled pid reads as a live server.\n */\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport { openDatabaseReadOnly } from \"./db/database.js\";\nimport { MachinesRepo } from \"./db/repos/machines.js\";\nimport { liveServerLock } from \"./lock.js\";\n\n/** What `penguin server status` prints, as one line of JSON. */\nexport interface MachineStatus {\n /** A server owns this root right now: its pid is alive and its port answers. */\n running: boolean;\n /** The live server's port and pid; null when nothing is running. */\n port: number | null;\n pid: number | null;\n /**\n * This machine's own id, or null when it has none yet — the id is minted the first time a\n * server boots here, so an installed-but-never-run machine legitimately has none, and\n * saying null is better than minting one to answer a question.\n */\n machineId: string | null;\n}\n\n/** `dbPath` may be elsewhere (PENGUIN_WEB_DB), as everywhere else that reads this database. */\nexport async function readMachineStatus(\n root: string,\n dbPath: string = path.join(root, \"web.db\"),\n): Promise<MachineStatus> {\n const lock = await liveServerLock(root);\n return {\n running: lock !== null,\n port: lock?.port ?? null,\n pid: lock?.pid ?? null,\n machineId: readMachineId(dbPath),\n };\n}\n\n/**\n * Reads the id and changes nothing — and cannot: the connection is read-only.\n *\n * `openDatabaseReadOnly`, never `openDatabase`: the latter is the SCHEMA path — CREATE TABLE,\n * the ensureColumn list, an ALTER with a backfill, and the migrations. A controller asking a\n * machine what it is would then reshape that machine's database under the prepared statements\n * of the server running there, on a build that may be older than this question. A read-only\n * open makes that impossible rather than merely not done.\n *\n * Existence-checked first, because opening would create the file (and its directory) on a\n * root no server has ever used — a probe must not leave a data root behind it. A machine\n * whose database predates the `machine` table answers with no id rather than an error: it is\n * one that has never run a build that mints one, which is the truth about it.\n */\nfunction readMachineId(dbPath: string): string | null {\n if (!fs.existsSync(dbPath)) return null;\n const db = openDatabaseReadOnly(dbPath);\n try {\n return new MachinesRepo(db).peekOwnId();\n } catch {\n return null;\n } finally {\n db.close();\n }\n}\n"],"mappings":";;;;;;;;;;;;AAeA,OAAO,QAAQ;AACf,OAAO,UAAU;AAqBjB,eAAsB,kBACpB,MACA,SAAiB,KAAK,KAAK,MAAM,QAAQ,GACjB;AACxB,QAAM,OAAO,MAAM,eAAe,IAAI;AACtC,SAAO;AAAA,IACL,SAAS,SAAS;AAAA,IAClB,MAAM,MAAM,QAAQ;AAAA,IACpB,KAAK,MAAM,OAAO;AAAA,IAClB,WAAW,cAAc,MAAM;AAAA,EACjC;AACF;AAgBA,SAAS,cAAc,QAA+B;AACpD,MAAI,CAAC,GAAG,WAAW,MAAM,EAAG,QAAO;AACnC,QAAM,KAAK,qBAAqB,MAAM;AACtC,MAAI;AACF,WAAO,IAAI,aAAa,EAAE,EAAE,UAAU;AAAA,EACxC,QAAQ;AACN,WAAO;AAAA,EACT,UAAE;AACA,OAAG,MAAM;AAAA,EACX;AACF;","names":[]}