@prismshadow/penguin-server 0.2.11 → 0.2.15
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/README.md +1 -1
- package/dist/api/types.d.ts +3650 -85
- package/dist/api/types.js +9 -0
- package/dist/auth-token.d.ts +22 -1
- package/dist/auth-token.js +7 -5
- package/dist/auth-token.js.map +1 -1
- package/dist/benchmark-package.d.ts +39 -0
- package/dist/benchmark-package.js +97 -0
- package/dist/benchmark-package.js.map +1 -0
- package/dist/chunk-54E64LWB.js +63 -0
- package/dist/chunk-54E64LWB.js.map +1 -0
- package/dist/{chunk-Q65VPAQS.js → chunk-5Z4UCHDB.js} +172 -108
- package/dist/chunk-5Z4UCHDB.js.map +1 -0
- package/dist/chunk-B5IP37ZQ.js +56 -0
- package/dist/chunk-HX3WBUYX.js +18 -0
- package/dist/chunk-HX3WBUYX.js.map +1 -0
- package/dist/chunk-JKJXQTHH.js +19 -0
- package/dist/chunk-JKJXQTHH.js.map +1 -0
- package/dist/chunk-LPPVGHYD.js +83 -0
- package/dist/chunk-LPPVGHYD.js.map +1 -0
- package/dist/chunk-NVWAYYRX.js +981 -0
- package/dist/chunk-NVWAYYRX.js.map +1 -0
- package/dist/chunk-Q4ON2L6E.js +52 -0
- package/dist/chunk-Q4ON2L6E.js.map +1 -0
- package/dist/chunk-QFV3ERQO.js +20 -0
- package/dist/chunk-QFV3ERQO.js.map +1 -0
- package/dist/{chunk-HOS3W3UP.js → chunk-TOOTEEM4.js} +50 -8
- package/dist/chunk-TOOTEEM4.js.map +1 -0
- package/dist/hmr/manifest.d.ts +1 -77
- package/dist/hmr/manifest.js +6 -1
- package/dist/index.js +86336 -22980
- package/dist/index.js.map +1 -1
- package/dist/initial-password.js +1 -0
- package/dist/install.ps1 +16 -6
- package/dist/install.sh +24 -10
- package/dist/lock.js +1 -0
- package/dist/machine-status.js +2 -1
- package/dist/machine-status.js.map +1 -1
- package/dist/plugin/index.d.ts +3384 -0
- package/dist/plugin/index.js.map +1 -0
- package/dist/reset-admin-password.js +8 -5
- package/dist/reset-admin-password.js.map +1 -1
- package/dist/secret-file.js +4 -13
- package/dist/secret-file.js.map +1 -1
- package/dist/version-report.d.ts +3 -0
- package/dist/version-report.js +3 -2
- package/package.json +19 -11
- package/web-dist/assets/KaTeX_Size3-Regular-gV2CO0n9.woff2 +0 -0
- package/web-dist/assets/abnfDiagram-VCTEODGH-CKWh4hoA.js +1 -0
- package/web-dist/assets/{addon-clipboard-1cARCaK9.js → addon-clipboard-DxLqat7q.js} +1 -1
- package/web-dist/assets/{addon-fit-BWdzl8Er.js → addon-fit-B8oPGPkW.js} +1 -1
- package/web-dist/assets/{addon-web-links-DjXuvn4Z.js → addon-web-links-C0W5TcK0.js} +1 -1
- package/web-dist/assets/arc-Dp9EkaAH.js +1 -0
- package/web-dist/assets/architectureDiagram-5GKGNRK7-BQ3LUcle.js +36 -0
- package/web-dist/assets/blockDiagram-I7D4REHJ-CZzyU0Jj.js +129 -0
- package/web-dist/assets/c-BG-tZi7o.js +1 -0
- package/web-dist/assets/c4Diagram-7LVT6UL2-Qps3jeAu.js +38 -0
- package/web-dist/assets/channel--PblgLlC.js +1 -0
- package/web-dist/assets/chunk-2Q5K7J3B-CQMntzuX.js +1 -0
- package/web-dist/assets/chunk-5VM5RSS4-2H2ZJAte.js +15 -0
- package/web-dist/assets/chunk-F27PBJKO-B30xCNBv.js +1 -0
- package/web-dist/assets/chunk-IMKFNOWR-Cyfx4zDs.js +231 -0
- package/web-dist/assets/chunk-JWPE2WC7-DADUytTh.js +1 -0
- package/web-dist/assets/chunk-POPQ4Y6H-9bjsAxLS.js +1 -0
- package/web-dist/assets/chunk-SVP7TREG-B9xO1VpN.js +88 -0
- package/web-dist/assets/chunk-TICWLB2K-B6oDkrep.js +206 -0
- package/web-dist/assets/chunk-XXDRQBXY-BbU8DR4B.js +1 -0
- package/web-dist/assets/classDiagram-ZZMXUADV-mn8tbuqa.js +1 -0
- package/web-dist/assets/classDiagram-v2-VYDZK3BY-mn8tbuqa.js +1 -0
- package/web-dist/assets/cose-bilkent-JH36ORCC-pkbuyec-.js +1 -0
- package/web-dist/assets/cpp-CaeG3uDQ.js +1 -0
- package/web-dist/assets/css-Br67jR8j.js +1 -0
- package/web-dist/assets/cynefin-OW5HDTMX-DU9YQQnc.js +166 -0
- package/web-dist/assets/cynefinDiagram-5FMLGOSQ-3a3XuhQq.js +62 -0
- package/web-dist/assets/cytoscape.esm-BB4DxJjf.js +321 -0
- package/web-dist/assets/dagre-GXQ25YYZ-BfZ9C5CZ.js +4 -0
- package/web-dist/assets/defaultLocale-DX6XiGOO.js +1 -0
- package/web-dist/assets/diagram-S7CK7UJ4-BoGhVBMn.js +30 -0
- package/web-dist/assets/diagram-UQ7AKVKN-zE67quty.js +41 -0
- package/web-dist/assets/diagram-VSXAHHWV-NihoXeXm.js +3 -0
- package/web-dist/assets/diagram-VX7I27RA-1627np0S.js +24 -0
- package/web-dist/assets/diagram-Z3DM3KII-Ddg_bUan.js +24 -0
- package/web-dist/assets/diff-jW5kmiru.js +1 -0
- package/web-dist/assets/ebnfDiagram-PWID7BFC-CmPUOM4j.js +1 -0
- package/web-dist/assets/erDiagram-RLTQ6QDP-DiTnEK72.js +99 -0
- package/web-dist/assets/flowDiagram-HODETNUW-mGQ38tRM.js +168 -0
- package/web-dist/assets/ganttDiagram-EL5Y4UJY-DU7MlzpW.js +292 -0
- package/web-dist/assets/gitGraphDiagram-WWUBYQGX-CRE_3vjl.js +106 -0
- package/web-dist/assets/github-dark-BQV5ugrc.js +1 -0
- package/web-dist/assets/github-light-Rcb2q3L5.js +1 -0
- package/web-dist/assets/go-B7VTfpnm.js +1 -0
- package/web-dist/assets/highlighter-CzfXQ6yd.js +2 -0
- package/web-dist/assets/{highlighter-Cu43iYr8.js → highlighter-core-B5CvXcEK.js} +7 -7
- package/web-dist/assets/highlighter.worker-D6D9fPma.js +152 -0
- package/web-dist/assets/html-BW_6VhB7.js +1 -0
- package/web-dist/assets/ibm-plex-sans-condensed-latin-600-normal-CRd5VyFf.woff2 +0 -0
- package/web-dist/assets/ibm-plex-sans-condensed-latin-ext-600-normal-CBdNZ9Ci.woff2 +0 -0
- package/web-dist/assets/ibm-plex-sans-latin-ext-wght-normal-CIII54If.woff2 +0 -0
- package/web-dist/assets/ibm-plex-sans-latin-wght-normal-IvpUvPa2.woff2 +0 -0
- package/web-dist/assets/index-BdG4qRyI.js +1275 -0
- package/web-dist/assets/index-W-xYFoIm.css +1 -0
- package/web-dist/assets/infoDiagram-27XIBGKW-Cdo6Ar-a.js +2 -0
- package/web-dist/assets/ini-Dix3pTmg.js +1 -0
- package/web-dist/assets/init-Gi6I4Gst.js +1 -0
- package/web-dist/assets/ishikawaDiagram-5VMMS53U-C27pgect.js +70 -0
- package/web-dist/assets/java-BTDmaRNO.js +1 -0
- package/web-dist/assets/javascript-WyGyM1wV.js +1 -0
- package/web-dist/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
- package/web-dist/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
- package/web-dist/assets/journeyDiagram-3NMN7TZE-CVxtKpLG.js +139 -0
- package/web-dist/assets/json-B8JryHcM.js +1 -0
- package/web-dist/assets/jsx-8cLv2Six.js +1 -0
- package/web-dist/assets/kanban-definition-UXKFOSKX-DWA31Da7.js +89 -0
- package/web-dist/assets/layout-DWKCU9PO.js +1 -0
- package/web-dist/assets/linear-BwCthj_k.js +1 -0
- package/web-dist/assets/log-CcaF_xNv.js +1 -0
- package/web-dist/assets/markdown-DX-TNHnc.js +1 -0
- package/web-dist/assets/mermaid.core-BcTrmPOv.js +310 -0
- package/web-dist/assets/mindmap-definition-YA3MSWOX-BLEDhbn1.js +96 -0
- package/web-dist/assets/misans-400-100-DHkMCix2.woff2 +0 -0
- package/web-dist/assets/misans-400-101-CwgSLsmc.woff2 +0 -0
- package/web-dist/assets/misans-400-102-BQgefHPQ.woff2 +0 -0
- package/web-dist/assets/misans-400-103-CP58Mc_T.woff2 +0 -0
- package/web-dist/assets/misans-400-104-Ta_Xu1gd.woff2 +0 -0
- package/web-dist/assets/misans-400-105-CDop11AR.woff2 +0 -0
- package/web-dist/assets/misans-400-106-Dv8y0ubk.woff2 +0 -0
- package/web-dist/assets/misans-400-107-CjnHtp9E.woff2 +0 -0
- package/web-dist/assets/misans-400-108-BA8nQUBw.woff2 +0 -0
- package/web-dist/assets/misans-400-109-B6uEN0pG.woff2 +0 -0
- package/web-dist/assets/misans-400-110-BQqnShrY.woff2 +0 -0
- package/web-dist/assets/misans-400-111-CHB-Jj5X.woff2 +0 -0
- package/web-dist/assets/misans-400-112-D1dh4Cjx.woff2 +0 -0
- package/web-dist/assets/misans-400-113-Bw_wNCFp.woff2 +0 -0
- package/web-dist/assets/misans-400-114-CUb-5IzE.woff2 +0 -0
- package/web-dist/assets/misans-400-115-BICOatsO.woff2 +0 -0
- package/web-dist/assets/misans-400-116-B3_gmYW6.woff2 +0 -0
- package/web-dist/assets/misans-400-117-B8k_y3cv.woff2 +0 -0
- package/web-dist/assets/misans-400-118-C-2Cf5C6.woff2 +0 -0
- package/web-dist/assets/misans-400-119-CmLP7xnX.woff2 +0 -0
- package/web-dist/assets/misans-400-21-DsSSD_Zj.woff2 +0 -0
- package/web-dist/assets/misans-400-22-rtkxWOv4.woff2 +0 -0
- package/web-dist/assets/misans-400-23-CDDB4M1H.woff2 +0 -0
- package/web-dist/assets/misans-400-24-Dqf_XeOL.woff2 +0 -0
- package/web-dist/assets/misans-400-25-C4U1tJ5J.woff2 +0 -0
- package/web-dist/assets/misans-400-26-CEXOK-nT.woff2 +0 -0
- package/web-dist/assets/misans-400-27-BrNOAScF.woff2 +0 -0
- package/web-dist/assets/misans-400-28-CPpEnCkG.woff2 +0 -0
- package/web-dist/assets/misans-400-29-C9JMVw8g.woff2 +0 -0
- package/web-dist/assets/misans-400-30-CD-QimXa.woff2 +0 -0
- package/web-dist/assets/misans-400-31-S4k06NbS.woff2 +0 -0
- package/web-dist/assets/misans-400-32-zRMBDkz6.woff2 +0 -0
- package/web-dist/assets/misans-400-33-sQ_tNZSM.woff2 +0 -0
- package/web-dist/assets/misans-400-34-8LEGljja.woff2 +0 -0
- package/web-dist/assets/misans-400-35-CxSPyuiU.woff2 +0 -0
- package/web-dist/assets/misans-400-36-BY1i4WtO.woff2 +0 -0
- package/web-dist/assets/misans-400-37-C0oF42pu.woff2 +0 -0
- package/web-dist/assets/misans-400-38-y7xcB90w.woff2 +0 -0
- package/web-dist/assets/misans-400-39-C307YgZx.woff2 +0 -0
- package/web-dist/assets/misans-400-40-ByZr736f.woff2 +0 -0
- package/web-dist/assets/misans-400-41-ChKEw5zV.woff2 +0 -0
- package/web-dist/assets/misans-400-42-CD__zJu5.woff2 +0 -0
- package/web-dist/assets/misans-400-43-CqNV6_TG.woff2 +0 -0
- package/web-dist/assets/misans-400-44-zE-akmW8.woff2 +0 -0
- package/web-dist/assets/misans-400-45-Du98otwc.woff2 +0 -0
- package/web-dist/assets/misans-400-46-B6JXbEy2.woff2 +0 -0
- package/web-dist/assets/misans-400-47-DpqW0kSq.woff2 +0 -0
- package/web-dist/assets/misans-400-48-BprON5Q_.woff2 +0 -0
- package/web-dist/assets/misans-400-49-N-ct3sN6.woff2 +0 -0
- package/web-dist/assets/misans-400-5-ton_4jCN.woff2 +0 -0
- package/web-dist/assets/misans-400-50-JgU49P0U.woff2 +0 -0
- package/web-dist/assets/misans-400-51-DSS3Moge.woff2 +0 -0
- package/web-dist/assets/misans-400-52-BMoXFmwE.woff2 +0 -0
- package/web-dist/assets/misans-400-53-BaLMGl4z.woff2 +0 -0
- package/web-dist/assets/misans-400-54-CaeSn3OR.woff2 +0 -0
- package/web-dist/assets/misans-400-55-BBqrtLxN.woff2 +0 -0
- package/web-dist/assets/misans-400-56-DAZ5BnbO.woff2 +0 -0
- package/web-dist/assets/misans-400-57-F-n3b0gI.woff2 +0 -0
- package/web-dist/assets/misans-400-58-DEUuPQAq.woff2 +0 -0
- package/web-dist/assets/misans-400-59-DXP5rhCL.woff2 +0 -0
- package/web-dist/assets/misans-400-6-DWCCUO_c.woff2 +0 -0
- package/web-dist/assets/misans-400-60-BE6IO6zJ.woff2 +0 -0
- package/web-dist/assets/misans-400-61-5Qb1gaxK.woff2 +0 -0
- package/web-dist/assets/misans-400-62-D_tJKNAj.woff2 +0 -0
- package/web-dist/assets/misans-400-63-hwmne8yB.woff2 +0 -0
- package/web-dist/assets/misans-400-64-BGedxReM.woff2 +0 -0
- package/web-dist/assets/misans-400-65-BaKPsugb.woff2 +0 -0
- package/web-dist/assets/misans-400-66-IdaOMzCz.woff2 +0 -0
- package/web-dist/assets/misans-400-67-BdWyS83H.woff2 +0 -0
- package/web-dist/assets/misans-400-68-DrZ_1swq.woff2 +0 -0
- package/web-dist/assets/misans-400-69-B3jsSD92.woff2 +0 -0
- package/web-dist/assets/misans-400-70-D6UZI2Ua.woff2 +0 -0
- package/web-dist/assets/misans-400-71-HFxyMCYg.woff2 +0 -0
- package/web-dist/assets/misans-400-72-CP5A-yQP.woff2 +0 -0
- package/web-dist/assets/misans-400-73-BoD_bu6s.woff2 +0 -0
- package/web-dist/assets/misans-400-74-CbJlhZlZ.woff2 +0 -0
- package/web-dist/assets/misans-400-75-BsbWuELX.woff2 +0 -0
- package/web-dist/assets/misans-400-76-DkwiQhof.woff2 +0 -0
- package/web-dist/assets/misans-400-77-6pVHXHnF.woff2 +0 -0
- package/web-dist/assets/misans-400-78-CfUF6pih.woff2 +0 -0
- package/web-dist/assets/misans-400-79-BCS3Dx4e.woff2 +0 -0
- package/web-dist/assets/misans-400-80-BEYSdQ_N.woff2 +0 -0
- package/web-dist/assets/misans-400-81-BzL-Gncx.woff2 +0 -0
- package/web-dist/assets/misans-400-82-CaENmdUU.woff2 +0 -0
- package/web-dist/assets/misans-400-83-Bvq1eBcA.woff2 +0 -0
- package/web-dist/assets/misans-400-84-Ctd90hiP.woff2 +0 -0
- package/web-dist/assets/misans-400-85-DWuOxfL1.woff2 +0 -0
- package/web-dist/assets/misans-400-86-D5niZS5c.woff2 +0 -0
- package/web-dist/assets/misans-400-87-DkOIADQJ.woff2 +0 -0
- package/web-dist/assets/misans-400-88-CGY4WTcC.woff2 +0 -0
- package/web-dist/assets/misans-400-89-CA3eoMTt.woff2 +0 -0
- package/web-dist/assets/misans-400-90-CzxR9MYb.woff2 +0 -0
- package/web-dist/assets/misans-400-91-Dyr85txc.woff2 +0 -0
- package/web-dist/assets/misans-400-97-qEZrCUNe.woff2 +0 -0
- package/web-dist/assets/misans-400-cyrillic--hFcG0Xp.woff2 +0 -0
- package/web-dist/assets/misans-400-extra-ZRI9n2Hu.woff2 +0 -0
- package/web-dist/assets/misans-400-latin-BRDR1WaL.woff2 +0 -0
- package/web-dist/assets/misans-400-latin-ext-6xS-MvHW.woff2 +0 -0
- package/web-dist/assets/misans-400-vietnamese-D7xD7kBB.woff2 +0 -0
- package/web-dist/assets/misans-500-100-BHuGA96E.woff2 +0 -0
- package/web-dist/assets/misans-500-101-CDMYUz0c.woff2 +0 -0
- package/web-dist/assets/misans-500-102-CWcqYYCV.woff2 +0 -0
- package/web-dist/assets/misans-500-103-BE1QSEzY.woff2 +0 -0
- package/web-dist/assets/misans-500-104-CDp743BV.woff2 +0 -0
- package/web-dist/assets/misans-500-105-y7dY6Foi.woff2 +0 -0
- package/web-dist/assets/misans-500-106-CP-kGZ6j.woff2 +0 -0
- package/web-dist/assets/misans-500-107-CUc8Hvle.woff2 +0 -0
- package/web-dist/assets/misans-500-108-ItN_x8jX.woff2 +0 -0
- package/web-dist/assets/misans-500-109-CEtf3R4D.woff2 +0 -0
- package/web-dist/assets/misans-500-110-BSZSHYRL.woff2 +0 -0
- package/web-dist/assets/misans-500-111-DfdArrjn.woff2 +0 -0
- package/web-dist/assets/misans-500-112-DRtNyrQw.woff2 +0 -0
- package/web-dist/assets/misans-500-113-CDT7tKuB.woff2 +0 -0
- package/web-dist/assets/misans-500-114-CCh4jwL8.woff2 +0 -0
- package/web-dist/assets/misans-500-115-DplUgPp0.woff2 +0 -0
- package/web-dist/assets/misans-500-116-C7eCklyK.woff2 +0 -0
- package/web-dist/assets/misans-500-117-BA0KabyT.woff2 +0 -0
- package/web-dist/assets/misans-500-118-V_M0eu2q.woff2 +0 -0
- package/web-dist/assets/misans-500-119-Cgf3Hszt.woff2 +0 -0
- package/web-dist/assets/misans-500-21-Di6DyR6O.woff2 +0 -0
- package/web-dist/assets/misans-500-22-CSnXvtL-.woff2 +0 -0
- package/web-dist/assets/misans-500-23-A06Hm9a6.woff2 +0 -0
- package/web-dist/assets/misans-500-24-Df97RCik.woff2 +0 -0
- package/web-dist/assets/misans-500-25-bOSJ6YXH.woff2 +0 -0
- package/web-dist/assets/misans-500-26-C65icgBb.woff2 +0 -0
- package/web-dist/assets/misans-500-27-C_GRm0va.woff2 +0 -0
- package/web-dist/assets/misans-500-28-CzZkqO0l.woff2 +0 -0
- package/web-dist/assets/misans-500-29-BReyeRyX.woff2 +0 -0
- package/web-dist/assets/misans-500-30-DzfjlROz.woff2 +0 -0
- package/web-dist/assets/misans-500-31-B2nLpgdU.woff2 +0 -0
- package/web-dist/assets/misans-500-32-Bz3rHm8X.woff2 +0 -0
- package/web-dist/assets/misans-500-33-AU3lZ1vY.woff2 +0 -0
- package/web-dist/assets/misans-500-34-CBAWkH-I.woff2 +0 -0
- package/web-dist/assets/misans-500-35-VgnGd14P.woff2 +0 -0
- package/web-dist/assets/misans-500-36-B2kfXv6A.woff2 +0 -0
- package/web-dist/assets/misans-500-37-DhKo8ykb.woff2 +0 -0
- package/web-dist/assets/misans-500-38-D8tTxFuc.woff2 +0 -0
- package/web-dist/assets/misans-500-39-DTm3aqJQ.woff2 +0 -0
- package/web-dist/assets/misans-500-40-C_akwj8_.woff2 +0 -0
- package/web-dist/assets/misans-500-41-RVM1JHQW.woff2 +0 -0
- package/web-dist/assets/misans-500-42-MVWIN_il.woff2 +0 -0
- package/web-dist/assets/misans-500-43-BtLZYNyD.woff2 +0 -0
- package/web-dist/assets/misans-500-44-D0QHMl6G.woff2 +0 -0
- package/web-dist/assets/misans-500-45-DRlclX7-.woff2 +0 -0
- package/web-dist/assets/misans-500-46-BEWswL4N.woff2 +0 -0
- package/web-dist/assets/misans-500-47-COSoxWaW.woff2 +0 -0
- package/web-dist/assets/misans-500-48-DZAISq3n.woff2 +0 -0
- package/web-dist/assets/misans-500-49-KSfi7MW0.woff2 +0 -0
- package/web-dist/assets/misans-500-5-h1SBcwuW.woff2 +0 -0
- package/web-dist/assets/misans-500-50-CIVMfG11.woff2 +0 -0
- package/web-dist/assets/misans-500-51-BdeNBhBL.woff2 +0 -0
- package/web-dist/assets/misans-500-52-CEW4e7ex.woff2 +0 -0
- package/web-dist/assets/misans-500-53-lmPCsEnt.woff2 +0 -0
- package/web-dist/assets/misans-500-54-B_7AqKQW.woff2 +0 -0
- package/web-dist/assets/misans-500-55-B-3RtUnH.woff2 +0 -0
- package/web-dist/assets/misans-500-56-g6D0e0cW.woff2 +0 -0
- package/web-dist/assets/misans-500-57-D5hp5Yqr.woff2 +0 -0
- package/web-dist/assets/misans-500-58-ilnDgEKt.woff2 +0 -0
- package/web-dist/assets/misans-500-59-DJYXz8tr.woff2 +0 -0
- package/web-dist/assets/misans-500-6-uCdpdDQy.woff2 +0 -0
- package/web-dist/assets/misans-500-60-B3Iaqx0p.woff2 +0 -0
- package/web-dist/assets/misans-500-61-CMxqg5hc.woff2 +0 -0
- package/web-dist/assets/misans-500-62-7FY8O2NQ.woff2 +0 -0
- package/web-dist/assets/misans-500-63-JP6vEuJf.woff2 +0 -0
- package/web-dist/assets/misans-500-64-Cdub62jh.woff2 +0 -0
- package/web-dist/assets/misans-500-65-DVHk_mlC.woff2 +0 -0
- package/web-dist/assets/misans-500-66-BX39wRtF.woff2 +0 -0
- package/web-dist/assets/misans-500-67-BcsepI3X.woff2 +0 -0
- package/web-dist/assets/misans-500-68-etUIUjrh.woff2 +0 -0
- package/web-dist/assets/misans-500-69-DfhVmnuA.woff2 +0 -0
- package/web-dist/assets/misans-500-70-D6dgy6-B.woff2 +0 -0
- package/web-dist/assets/misans-500-71-PkeKjcVn.woff2 +0 -0
- package/web-dist/assets/misans-500-72-D66Fnb30.woff2 +0 -0
- package/web-dist/assets/misans-500-73-jr9z9870.woff2 +0 -0
- package/web-dist/assets/misans-500-74-DsCkPKwe.woff2 +0 -0
- package/web-dist/assets/misans-500-75-Dkooq6KM.woff2 +0 -0
- package/web-dist/assets/misans-500-76-B0sfieHl.woff2 +0 -0
- package/web-dist/assets/misans-500-77-8tflq1ji.woff2 +0 -0
- package/web-dist/assets/misans-500-78-COKdMbdp.woff2 +0 -0
- package/web-dist/assets/misans-500-79-Bm0rBjSF.woff2 +0 -0
- package/web-dist/assets/misans-500-80-B9OoAnyy.woff2 +0 -0
- package/web-dist/assets/misans-500-81-DsQ9tpfX.woff2 +0 -0
- package/web-dist/assets/misans-500-82-VKsL2Tk2.woff2 +0 -0
- package/web-dist/assets/misans-500-83-Ce6mfHYD.woff2 +0 -0
- package/web-dist/assets/misans-500-84-D7kPSZLm.woff2 +0 -0
- package/web-dist/assets/misans-500-85-W5L0cEfd.woff2 +0 -0
- package/web-dist/assets/misans-500-86-DukGOEET.woff2 +0 -0
- package/web-dist/assets/misans-500-87-BJ_Lok6j.woff2 +0 -0
- package/web-dist/assets/misans-500-88-DbJ11zcA.woff2 +0 -0
- package/web-dist/assets/misans-500-89-LNKcEq6M.woff2 +0 -0
- package/web-dist/assets/misans-500-90-DNDDgSCd.woff2 +0 -0
- package/web-dist/assets/misans-500-91-rT8Q0evu.woff2 +0 -0
- package/web-dist/assets/misans-500-97-c8zW_WRq.woff2 +0 -0
- package/web-dist/assets/misans-500-cyrillic-CLHOGwgx.woff2 +0 -0
- package/web-dist/assets/misans-500-extra-CTAMEQ59.woff2 +0 -0
- package/web-dist/assets/misans-500-latin-Be606ott.woff2 +0 -0
- package/web-dist/assets/misans-500-latin-ext-BzDyL4sU.woff2 +0 -0
- package/web-dist/assets/misans-500-vietnamese-DBOLOqZH.woff2 +0 -0
- package/web-dist/assets/mona-sans-latin-ext-wght-normal-BqSk0Z3x.woff2 +0 -0
- package/web-dist/assets/mona-sans-latin-wght-normal-Pz49MTQZ.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-100-wght-normal-DrqXJETY.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-101-wght-normal-c94LAl5p.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-102-wght-normal-C1RtbCZr.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-103-wght-normal-DGHo20nu.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-104-wght-normal-CJT2ioDJ.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-105-wght-normal-BFoiJwz2.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-106-wght-normal-D6uUHw3w.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-107-wght-normal-kFQzJDLH.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-108-wght-normal-7aXvqIa2.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-109-wght-normal-CnjNbNmw.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-110-wght-normal-D2JBr045.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-111-wght-normal-ClFr5QXM.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-112-wght-normal-CiZxJMyY.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-113-wght-normal-OgQXOX6x.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-114-wght-normal-CRH9SDZu.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-115-wght-normal-BN__2iBG.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-116-wght-normal-vdFVzbO2.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-117-wght-normal-Dsz3vkzU.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-118-wght-normal-BPEb0gM9.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-119-wght-normal-BfzSEbFz.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-21-wght-normal-DIu_1ZBI.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-22-wght-normal-VXjdYcT-.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-23-wght-normal-4HrHKhpL.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-24-wght-normal-B58DWgHS.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-25-wght-normal-C3Jm6l7O.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-26-wght-normal-YNOygvr_.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-27-wght-normal-BP2pEGQH.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-28-wght-normal-BWPKDbtH.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-29-wght-normal-45aVmHn_.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-30-wght-normal-B8_s30jZ.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-31-wght-normal-DW0t445S.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-32-wght-normal-ShbWPcei.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-33-wght-normal-BOTZYTjM.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-34-wght-normal-BF1rqDSt.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-35-wght-normal-Bosspiyr.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-36-wght-normal-CtU9CyKw.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-37-wght-normal-ghDiyiuv.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-38-wght-normal-4Nz8k_dt.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-39-wght-normal-Ddtm1XVC.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-4-wght-normal-BRbPMj-C.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-40-wght-normal-BVn4-kgX.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-41-wght-normal-CZqajZnl.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-42-wght-normal-CQ4lY28u.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-43-wght-normal-psppu0d8.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-44-wght-normal-cbKJlTUe.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-45-wght-normal-MKIEVRIC.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-46-wght-normal-CErGc6Mt.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-47-wght-normal-C5Kgg1_m.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-48-wght-normal-DFMjDDY6.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-49-wght-normal-B7l_3BZr.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-5-wght-normal-DI846rD9.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-50-wght-normal-C5KfAmFp.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-51-wght-normal-C2bq6hC8.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-52-wght-normal-P18e_Y0j.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-53-wght-normal-Bgkuo2tF.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-54-wght-normal-DL5lmlUd.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-55-wght-normal-BV_Oy6IF.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-56-wght-normal-B4L7Hj8f.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-57-wght-normal-DU8YBsDj.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-58-wght-normal-CE0BKS9u.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-59-wght-normal-Azv2Ku9_.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-6-wght-normal-ozUCEY9O.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-60-wght-normal-C1lngC61.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-61-wght-normal-BxWkGF5M.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-62-wght-normal-CXXMAq-5.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-63-wght-normal-4La5uKvS.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-64-wght-normal-CbIuD2Eg.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-65-wght-normal-BGqvKda2.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-66-wght-normal-BvNozWOY.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-67-wght-normal-CC-WRBV-.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-68-wght-normal-c0FjfUaj.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-69-wght-normal-D596Jjl2.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-70-wght-normal-ColEcmtJ.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-71-wght-normal-ChZfXpdg.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-72-wght-normal-D1VyfEG3.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-73-wght-normal-DwSJRYPJ.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-74-wght-normal-Cte7o1QG.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-75-wght-normal-B0qL41rF.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-76-wght-normal-BPLMO_2x.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-77-wght-normal-Dkbi3pye.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-78-wght-normal-BFUXeSw6.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-79-wght-normal-DoJG4UTB.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-80-wght-normal-BEFypWOO.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-81-wght-normal-ed_TZlfo.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-82-wght-normal-DcxfR5OJ.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-83-wght-normal-C9UjAcMM.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-84-wght-normal-C7NxT478.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-85-wght-normal-DBcDBu1n.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-86-wght-normal-CLJIoPpl.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-87-wght-normal-DYfJ-vGE.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-88-wght-normal-ClNDOCGW.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-89-wght-normal-IQU_KQA8.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-90-wght-normal-BWcrRNoG.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-91-wght-normal-CGekvDdH.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-97-wght-normal-BsBHkXi3.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-98-wght-normal-BZqSA1r_.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-99-wght-normal-Q_IptJM5.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-cyrillic-wght-normal-CRA5_Pf1.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-latin-ext-wght-normal-CqPqLCfe.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-latin-wght-normal-DYAKOyvl.woff2 +0 -0
- package/web-dist/assets/noto-sans-sc-vietnamese-wght-normal-y5SU35Rl.woff2 +0 -0
- package/web-dist/assets/ordinal-Cboi1Yqb.js +1 -0
- package/web-dist/assets/pegDiagram-XKGWAZYB-CLEM1SDU.js +1 -0
- package/web-dist/assets/php-CNeTOyEV.js +1 -0
- package/web-dist/assets/pieDiagram-E7YTZNPT-B__g6eF0.js +39 -0
- package/web-dist/assets/python-B6Ihcp-E.js +1 -0
- package/web-dist/assets/quadrantDiagram-AXDQQJYC-C7VQ2LMY.js +7 -0
- package/web-dist/assets/railroadDiagram-O6MQD6OU-eWNnzjwS.js +1 -0
- package/web-dist/assets/requirementDiagram-BXWQKSXE-Bi5qeD4b.js +84 -0
- package/web-dist/assets/ruby-CYiNE6ps.js +1 -0
- package/web-dist/assets/rust-CxuBE0J8.js +1 -0
- package/web-dist/assets/sankeyDiagram-P5KCCOFB-DG1VOpXX.js +40 -0
- package/web-dist/assets/sequenceDiagram-WJ2MYXX4-Fhkw73Th.js +162 -0
- package/web-dist/assets/shellscript-DgJyDXW6.js +1 -0
- package/web-dist/assets/sizeCapture-INFHLROL-D9E_17SF.js +1 -0
- package/web-dist/assets/sql-Dq2MiB0T.js +1 -0
- package/web-dist/assets/stateDiagram-D77RDMKH-Cs5Y0xhW.js +1 -0
- package/web-dist/assets/stateDiagram-v2-MP3YSRHH-CEM51fAf.js +1 -0
- package/web-dist/assets/swimlanes-42K2YHIH-t-EocvKZ.js +1 -0
- package/web-dist/assets/swimlanesDiagram-VR7AAH4N-BrR66vrK.js +8 -0
- package/web-dist/assets/timeline-definition-24CTP7MA-CozGCxuA.js +120 -0
- package/web-dist/assets/toml-Ms459DBw.js +1 -0
- package/web-dist/assets/tsx-D6116Ycy.js +1 -0
- package/web-dist/assets/typescript-BqvgUolh.js +1 -0
- package/web-dist/assets/vennDiagram-4TSXK5OY-ewU8ycSa.js +34 -0
- package/web-dist/assets/wardleyDiagram-VM6X3IG4-DuAhDu-0.js +78 -0
- package/web-dist/assets/xml-BkAJuBCc.js +1 -0
- package/web-dist/assets/{xterm-DKcY6q-I.js → xterm-v5e56GC9.js} +1 -1
- package/web-dist/assets/xychartDiagram-S5SC5T6Z-BxGuZO23.js +7 -0
- package/web-dist/assets/yaml-Bopit2L3.js +1 -0
- package/web-dist/fonts-licenses/ibm-plex-sans-condensed.txt +93 -0
- package/web-dist/fonts-licenses/ibm-plex-sans.txt +93 -0
- package/web-dist/fonts-licenses/jetbrains-mono.txt +93 -0
- package/web-dist/fonts-licenses/misans.txt +119 -0
- package/web-dist/fonts-licenses/mona-sans.txt +93 -0
- package/web-dist/fonts-licenses/noto-sans-sc.txt +93 -0
- package/web-dist/index.html +18 -4
- package/web-dist/workflow-ui.css +261 -0
- package/dist/chunk-4SXGU7RO.js +0 -50
- package/dist/chunk-4SXGU7RO.js.map +0 -1
- package/dist/chunk-ADZJYDNC.js +0 -421
- package/dist/chunk-ADZJYDNC.js.map +0 -1
- package/dist/chunk-HOS3W3UP.js.map +0 -1
- package/dist/chunk-Q65VPAQS.js.map +0 -1
- package/dist/chunk-TTGGJDNA.js +0 -14
- package/dist/chunk-TTGGJDNA.js.map +0 -1
- package/dist/extension/index.d.ts +0 -212
- package/web-dist/assets/index-Bm9n7ZV-.js +0 -457
- package/web-dist/assets/index-DR4PrRzS.css +0 -1
- /package/dist/{extension/index.js.map → chunk-B5IP37ZQ.js.map} +0 -0
- /package/dist/{extension → plugin}/index.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/auth/password.ts","../src/auth/service.ts","../src/auth/api-token.ts","../src/http/errors.ts"],"sourcesContent":["/**\n * Password hashing (slow-hash storage).\n *\n * Uses node:crypto's scrypt (built-in, no extra dependency, meets the same\n * slow-hash requirement as bcrypt/argon2). Storage format:\n * `scrypt$N$r$p$<salt b64>$<hash b64>` — parameters are stored alongside the hash,\n * so old hashes remain verifiable after future parameter tuning; comparison uses\n * timingSafeEqual to guard against timing side-channels.\n */\nimport { randomBytes, scrypt, timingSafeEqual } from \"node:crypto\";\n\n/**\n * Work factor for new hashes. `hashPassword` takes it as a defaulted argument so the server's\n * own test suite can hash at a token cost: almost every case there seeds an admin, provisions\n * users and logs them in, and one derivation at this strength costs on the order of 100ms.\n * Nothing on the production path passes the argument, and no configuration reaches it —\n * `buildAppDeps`, which carries the test override, is not part of this package's exports.\n */\nexport const SCRYPT_COST = 16384;\nconst SCRYPT_R = 8;\nconst SCRYPT_P = 1;\nconst SALT_BYTES = 16;\nconst KEY_BYTES = 64;\n\nfunction scryptAsync(\n password: string,\n salt: Buffer,\n keyLen: number,\n n: number,\n r: number,\n p: number,\n): Promise<Buffer> {\n return new Promise((resolve, reject) => {\n scrypt(password, salt, keyLen, { N: n, r, p, maxmem: 128 * 1024 * 1024 }, (err, key) => {\n if (err) reject(err);\n else resolve(key);\n });\n });\n}\n\n/**\n * Generates a password hash in `scrypt$N$r$p$salt$hash` format. `cost` is scrypt's N and\n * is recorded in the hash, so `verifyPassword` re-derives at whatever cost produced the\n * stored string.\n */\nexport async function hashPassword(password: string, cost: number = SCRYPT_COST): Promise<string> {\n const salt = randomBytes(SALT_BYTES);\n const key = await scryptAsync(password, salt, KEY_BYTES, cost, SCRYPT_R, SCRYPT_P);\n return [\n \"scrypt\",\n String(cost),\n String(SCRYPT_R),\n String(SCRYPT_P),\n salt.toString(\"base64\"),\n key.toString(\"base64\"),\n ].join(\"$\");\n}\n\n/** Verifies a password; returns false if the stored string has an invalid format (never throws, so the login path can uniformly treat it as a credential error). */\nexport async function verifyPassword(password: string, stored: string): Promise<boolean> {\n const parts = stored.split(\"$\");\n if (parts.length !== 6 || parts[0] !== \"scrypt\") return false;\n const n = Number(parts[1]);\n const r = Number(parts[2]);\n const p = Number(parts[3]);\n if (!Number.isInteger(n) || !Number.isInteger(r) || !Number.isInteger(p)) return false;\n let salt: Buffer;\n let expected: Buffer;\n try {\n salt = Buffer.from(parts[4]!, \"base64\");\n expected = Buffer.from(parts[5]!, \"base64\");\n } catch {\n return false;\n }\n if (salt.length === 0 || expected.length === 0) return false;\n let actual: Buffer;\n try {\n actual = await scryptAsync(password, salt, expected.length, n, r, p);\n } catch {\n return false;\n }\n return actual.length === expected.length && timingSafeEqual(actual, expected);\n}\n","/**\n * Auth service: admin seeding / login / logout / password change / session validation.\n *\n * No open registration: an empty users table seeds `admin` with a random password hashed and\n * discarded unseen, claimed through the first-login link; every other user is created by an\n * admin. Sessions are rows in auth_sessions (cookie holds the token, the row its sha256), so\n * they outlive a restart and renew in place.\n */\nimport { randomBytes } from \"node:crypto\";\nimport { tokensEqual } from \"./api-token.js\";\nimport type { UserInfo } from \"../api/types.js\";\nimport { HttpError } from \"../http/errors.js\";\nimport type { UserRow, UsersRepo } from \"../db/repos/users.js\";\nimport { sessionTokenHash } from \"../db/repos/auth-sessions.js\";\nimport type { SessionViaValue, AuthSessionsRepo } from \"../db/repos/auth-sessions.js\";\nimport type { AuthRuntimeState } from \"./runtime-state.js\";\nimport { SCRYPT_COST, hashPassword, verifyPassword } from \"./password.js\";\n\nexport const MIN_PASSWORD_LENGTH = 8;\n\n/** Built-in admin user_id. */\nexport const ADMIN_USER_ID = \"admin\";\n\n/**\n * Login throttling, per userId. After LOGIN_FREE_ATTEMPTS failures each attempt waits an\n * exponentially growing delay (1s doubling to a 60s cap), settling at a guess per minute.\n * Kept for nonexistent userIds too, so it is not an account-existence oracle. Deliberately NOT\n * covered: a concurrent burst before the first failure lands, and guesses spread across many\n * accounts.\n */\nconst LOGIN_FREE_ATTEMPTS = 5;\nconst LOGIN_BACKOFF_START_MS = 1000;\nconst LOGIN_BACKOFF_CAP_MS = 60_000;\n/** Failure entries idle longer than this are swept (bounds the map; far above the cap). */\nconst LOGIN_FAILURE_IDLE_MS = 15 * 60_000;\n\n/** Characters of base64url in a seeded password — 18 random bytes, 144 bits. */\nconst SEED_PASSWORD_CHARS = 24;\n\n/**\n * Never read or typed — hashed at once and discarded — which is what lets it be long enough\n * that the login endpoint, reachable the moment the account exists, has no search space.\n */\nexport function generateInitialAdminPassword(): string {\n return randomBytes(SEED_PASSWORD_CHARS).toString(\"base64url\").slice(0, SEED_PASSWORD_CHARS);\n}\n\n/**\n * \"desktop\" and \"setup\" may set a password without the old one (theirs is random and was never\n * shown); desktop-only routes open to \"desktop\" alone. \"token\" is the local API token's Bearer\n * header — per request, never a stored row. Anything else reads as \"password\".\n */\nexport type SessionVia = \"password\" | \"desktop\" | \"setup\" | \"token\";\n\nexport function toUserInfo(row: UserRow): UserInfo {\n return {\n userId: row.userId,\n isAdmin: row.isAdmin,\n passwordIsInitial: row.passwordIsInitial,\n createdAt: row.createdAt,\n };\n}\n\nexport interface AuthServiceDeps {\n users: UsersRepo;\n authSessions: AuthSessionsRepo;\n /**\n * Process-scoped auth values (runtime-state.ts). Held by the RUNTIME so the link a boot\n * printed survives a platform push; everything else about auth is rebuilt with the App.\n */\n state: AuthRuntimeState;\n /** Provisions the initial Project at signup (injected by project-service, to avoid a circular dependency). */\n provisionInitialProject: (user: UserRow, isAdmin: boolean) => Promise<void>;\n /** Fixed initial password for the seeded admin (config.seedAdminPassword); null generates a random one at seed time. */\n seedAdminPassword: string | null;\n sessionTtlMs: number;\n sessionRenewMs: number;\n /** Test double: scrypt work factor for hashes this service writes (SCRYPT_COST in production). */\n passwordHashCost?: number;\n now?: () => Date;\n}\n\nexport class AuthService {\n private readonly now: () => Date;\n private readonly hashCost: number;\n /** Session lifetime, for the cookie that must expire WITH the session, not before it. */\n get sessionTtlMs(): number {\n return this.deps.sessionTtlMs;\n }\n\n constructor(private readonly deps: AuthServiceDeps) {\n this.now = deps.now ?? (() => new Date());\n this.hashCost = deps.passwordHashCost ?? SCRYPT_COST;\n this.deps.authSessions.deleteExpired(this.now().toISOString());\n }\n\n /**\n * Null once the server is claimed, so the only setup session that exists is a printed one.\n * On demand rather than in the constructor: seedAdmin() runs after it, so \"claimed?\" has no\n * answer there. A cached link whose row is gone is re-minted, not handed out dead.\n */\n mintFirstLogin(): string | null {\n if (!this.adminPasswordIsInitial()) return null;\n if (\n this.deps.state.firstLoginToken !== null &&\n this.authenticateWithMeta(this.deps.state.firstLoginToken) === null\n ) {\n this.deps.state.firstLoginToken = null;\n }\n this.deps.state.firstLoginToken ??= this.issueSession(ADMIN_USER_ID, \"setup\");\n return this.deps.state.firstLoginToken;\n }\n\n /**\n * For the startup notice's pinned-seed gate (index.ts): a pin usually means the operator\n * knows the password, but an offline reset makes it stale, and the gate must see through\n * that or the rescue link stays suppressed.\n */\n async adminPasswordIs(password: string): Promise<boolean> {\n const row = this.deps.users.findById(ADMIN_USER_ID);\n return row !== null && (await verifyPassword(password, row.passwordHash));\n }\n\n /**\n * Startup seeding (idempotent): creates the built-in admin and adopts default_project when\n * the users table is empty; if the initial Project fails, the user row is rolled back and\n * the server retries on next startup.\n */\n async seedAdmin(): Promise<void> {\n if (this.deps.users.count() > 0) return;\n const password = this.deps.seedAdminPassword ?? generateInitialAdminPassword();\n // A pinned override must meet the same policy as every other password — rejected before\n // any insert, so a configuration typo cannot create a trivially weak privileged account.\n if (password.length < MIN_PASSWORD_LENGTH) {\n throw new Error(\n `PENGUIN_SEED_ADMIN_PASSWORD must be at least ${MIN_PASSWORD_LENGTH} characters.`,\n );\n }\n const user: UserRow = {\n userId: ADMIN_USER_ID,\n passwordHash: await hashPassword(password, this.hashCost),\n isAdmin: true,\n passwordIsInitial: true,\n createdAt: this.now().toISOString(),\n };\n this.deps.users.insert(user);\n try {\n await this.deps.provisionInitialProject(user, true);\n } catch (err) {\n this.deps.users.delete(user.userId);\n throw err;\n }\n }\n\n /**\n * Compared against the printed value, not merely verified: a cookie made out of ANY valid\n * token would let one person hand another a link into the sender's account. Not single-use,\n * because a prefetching browser would burn it before its reader clicked.\n */\n redeemFirstLogin(given: string): string | null {\n const expected = this.deps.state.firstLoginToken;\n if (expected === null || given === \"\" || !tokensEqual(given, expected)) return null;\n return this.authenticateWithMeta(expected) === null ? null : expected;\n }\n\n /** Whether the built-in admin still runs on its initial password (gates the first-login link). */\n adminPasswordIsInitial(): boolean {\n return this.deps.users.findById(ADMIN_USER_ID)?.passwordIsInitial === true;\n }\n\n /** Consecutive login failures per userId (see the throttling comment on the constants). */\n private readonly loginFailures = new Map<string, { failures: number; lastFailureAt: number }>();\n\n /** The wait imposed after `failures` consecutive failures (0 while within the free attempts). */\n private loginDelayMs(failures: number): number {\n const excess = failures - LOGIN_FREE_ATTEMPTS;\n if (excess <= 0) return 0;\n return Math.min(LOGIN_BACKOFF_START_MS * 2 ** (excess - 1), LOGIN_BACKOFF_CAP_MS);\n }\n\n async login(userId: string, password: string): Promise<{ user: UserInfo; token: string }> {\n const nowMs = this.now().getTime();\n for (const [key, entry] of this.loginFailures) {\n if (nowMs - entry.lastFailureAt > LOGIN_FAILURE_IDLE_MS) this.loginFailures.delete(key);\n }\n const failed = this.loginFailures.get(userId);\n if (failed) {\n const readyAt = failed.lastFailureAt + this.loginDelayMs(failed.failures);\n if (nowMs < readyAt) {\n throw new HttpError(\n 429,\n \"too_many_attempts\",\n `Too many failed sign-in attempts. Try again in ${Math.ceil((readyAt - nowMs) / 1000)}s.`,\n );\n }\n }\n const row = this.deps.users.findById(userId);\n const ok = row !== null && (await verifyPassword(password, row.passwordHash));\n if (!row || !ok) {\n this.loginFailures.set(userId, {\n failures: (failed?.failures ?? 0) + 1,\n lastFailureAt: this.now().getTime(),\n });\n throw new HttpError(401, \"invalid_credentials\", \"Incorrect username or password.\");\n }\n this.loginFailures.delete(userId);\n this.deps.authSessions.deleteExpired(this.now().toISOString());\n return { user: toUserInfo(row), token: this.issueSession(row.userId, \"password\") };\n }\n\n /**\n * Desktop-mode sign-in: an admin session with no password check — the claim route already\n * redeemed the shell's one-shot token, which is the credential here. Throws only on a\n * broken deployment (seeding runs before the route exists).\n */\n loginDesktop(): { user: UserInfo; token: string } {\n const row = this.deps.users.findById(ADMIN_USER_ID);\n if (!row) {\n throw new HttpError(500, \"internal\", \"Built-in admin has not been seeded.\");\n }\n return { user: toUserInfo(row), token: this.issueSession(row.userId, \"desktop\") };\n }\n\n /** Self password change (user settings): validates the old password first; the current session stays valid. */\n async changePassword(userId: string, oldPassword: string, newPassword: string): Promise<void> {\n const row = this.deps.users.findById(userId);\n if (!row || !(await verifyPassword(oldPassword, row.passwordHash))) {\n throw new HttpError(400, \"password_mismatch\", \"Current password is incorrect.\");\n }\n await this.setPassword(userId, newPassword);\n }\n\n /** No old-password check; the me route gates which sessions may call this. */\n async setInitialPassword(userId: string, newPassword: string): Promise<void> {\n await this.setPassword(userId, newPassword);\n }\n\n /**\n * Validation comes FIRST, so a rejected password leaves the first-login link alive: burning\n * it on a typo would strand the claimer until a restart.\n */\n private async setPassword(userId: string, newPassword: string): Promise<void> {\n if (newPassword.length < MIN_PASSWORD_LENGTH) {\n throw new HttpError(400, \"invalid_password\", \"Password must be at least 8 characters.\");\n }\n this.deps.users.updatePassword(userId, await hashPassword(newPassword, this.hashCost), false);\n // A successful set proves at least what the successful login that resets the counter\n // proves (the old password, or a desktop/setup session), so it resets it too. Without\n // this, anyone spamming the login endpoint holds the backoff window open, and the sign-in\n // that follows a first-login claim (routes/me.ts) would 429 AFTER the password committed —\n // reporting failure for a change that took, with the claimer's setup session already gone.\n this.loginFailures.delete(userId);\n // EVERY first-login session for this account, not just the link this process printed: an\n // earlier boot's link can still be live in a terminal scrollback, and a `setup` session is\n // allowed to change the password without knowing the old one — so one left behind is an\n // account takeover waiting to happen.\n if (userId === ADMIN_USER_ID) {\n this.deps.authSessions.deleteByUserAndVia(userId, \"setup\");\n this.deps.state.firstLoginToken = null;\n }\n }\n\n /** Ends a session: the row is the session, so logout deletes it. Unknown token is a no-op. */\n logout(token: string): void {\n this.deps.authSessions.delete(sessionTokenHash(token));\n }\n\n /**\n * The current boot's local API token (what control-env injection hands to tool\n * subprocesses); null when none was minted. It lives on the runtime state, not on this\n * service: the token was written to `<root>/api-token` by the process, so it must\n * outlive the App a push replaces (auth/runtime-state.ts).\n */\n localApiToken(): string | null {\n return this.deps.state.apiToken;\n }\n\n /**\n * Validates a Bearer token against the boot's local API token (constant-time compare):\n * a match authenticates as the built-in admin — holding the token proves filesystem\n * access to the data root, which is admin authority (see auth/api-token.ts). Returns\n * null on mismatch, when no token was minted, or when the admin row is missing.\n */\n authenticateApiToken(token: string): { user: UserRow; via: SessionVia } | null {\n const apiToken = this.deps.state.apiToken;\n if (apiToken === null || token.length === 0) return null;\n if (!tokensEqual(token, apiToken)) return null;\n const user = this.deps.users.findById(ADMIN_USER_ID);\n return user === null ? null : { user, via: \"token\" };\n }\n\n /**\n * Validates the cookie token. Sliding renewal tops the expiry up IN PLACE, so the cookie\n * value never changes and there is no second identity to revoke. Only a session whose own\n * span reaches the renewal window slides — a one-hour minted token must expire at its hour,\n * not stretch by being used.\n */\n authenticateWithMeta(token: string): { user: UserRow; via: SessionVia; renewed: boolean } | null {\n const tokenHash = sessionTokenHash(token);\n const session = this.deps.authSessions.findByTokenHash(tokenHash);\n if (!session) return null;\n const now = this.now();\n const expiresAt = Date.parse(session.expiresAt);\n if (expiresAt <= now.getTime()) {\n this.deps.authSessions.delete(tokenHash);\n return null;\n }\n const user = this.deps.users.findById(session.userId);\n if (!user) return null;\n const renewable = expiresAt - Date.parse(session.createdAt) >= this.deps.sessionRenewMs;\n let renewed = false;\n if (renewable && expiresAt - now.getTime() < this.deps.sessionRenewMs) {\n this.deps.authSessions.touch(\n tokenHash,\n new Date(now.getTime() + this.deps.sessionTtlMs).toISOString(),\n );\n renewed = true;\n }\n const via: SessionVia =\n session.via === \"desktop\" ? \"desktop\" : session.via === \"setup\" ? \"setup\" : \"password\";\n return { user, via, renewed };\n }\n\n private issueSession(userId: string, via: SessionViaValue): string {\n return this.deps.authSessions.issue({\n userId,\n via,\n now: this.now(),\n ttlMs: this.deps.sessionTtlMs,\n }).token;\n }\n}\n","/**\n * Local API token (`<root>/api-token`): the machine-local credential behind\n * `Authorization: Bearer`.\n *\n * Minted fresh at every server boot (same recipe as auth-session tokens) and written to\n * the data root with owner-only permissions, so anything that can read the file can call\n * the API as the admin. That equivalence is the authorization model, not an accident:\n * local filesystem access to the data root already IS admin authority — the same rule\n * `penguin server reset-admin-password` stands on (whoever can run it owns web.db\n * anyway) — and agents driving their own harness through the CLI is the product feature\n * this token exists for (server-driven Sessions hand it to tool subprocesses as\n * PENGUIN_API_TOKEN). Rotation per boot bounds the life of any leaked copy to the\n * process that minted it.\n */\nimport { createHash, randomBytes, timingSafeEqual } from \"node:crypto\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\n\nexport function apiTokenPath(root: string): string {\n return path.join(root, \"api-token\");\n}\n\n/** Mints a boot-scoped local API token (the auth-session token recipe). */\nexport function mintApiToken(): string {\n return randomBytes(32).toString(\"base64url\");\n}\n\n/**\n * Persists the boot token (owner-only file, tmp + rename so a concurrent reader never\n * sees a partial write). Best-effort like the initial-password file: an exotic read-only\n * root must not stop the server — local CLI callers then fall back to\n * PENGUIN_API_TOKEN.\n */\nexport function storeApiToken(root: string, token: string): void {\n try {\n fs.mkdirSync(root, { recursive: true });\n const target = apiTokenPath(root);\n const tmp = `${target}.${process.pid}.tmp`;\n fs.writeFileSync(tmp, `${token}\\n`, { mode: 0o600 });\n fs.renameSync(tmp, target);\n } catch {\n // Best-effort: Bearer auth still works for callers holding the token some other way.\n }\n}\n\n/** The stored token, or null when absent/unreadable/empty (shared with the CLI's file fallback). */\nexport function readApiToken(root: string): string | null {\n try {\n const value = fs.readFileSync(apiTokenPath(root), \"utf8\").trim();\n return value === \"\" ? null : value;\n } catch {\n return null;\n }\n}\n\n/**\n * Constant-time equality for token checks: both sides are reduced to fixed-size sha256\n * digests first, so the comparison's timing depends on neither the content nor the\n * length of an attacker-supplied value.\n */\nexport function tokensEqual(a: string, b: string): boolean {\n const digest = (v: string): Buffer => createHash(\"sha256\").update(v).digest();\n return timingSafeEqual(digest(a), digest(b));\n}\n","/**\n * Unified HTTP error: `{error: {code, message}}` response body,\n * with message in English.\n *\n * Routes and services express business errors via throw HttpError; app-level onError\n * uniformly converges these into a JSON response, with unknown errors converged to 500\n * (never leaking internal details to the client).\n */\nimport type { Context } from \"hono\";\nimport type { ErrorBody } from \"../api/types.js\";\n\nexport class HttpError extends Error {\n constructor(\n readonly status: number,\n readonly code: string,\n message: string,\n ) {\n super(message);\n this.name = \"HttpError\";\n }\n}\n\nexport function errorBody(code: string, message: string): ErrorBody {\n return { error: { code, message } };\n}\n\n/**\n * Model missing a credential: the provider SDK throws this at **client-construction\n * time** (hit by both creating a Session and resuming a Session); the original message\n * is full of environment variable names, meaningless to a user — uniformly replaced\n * with a single actionable sentence. The frontend produces localized text by code\n * (message is only a fallback); see web's lib/api-error.ts.\n */\nexport function isMissingCredential(err: unknown): boolean {\n const message = err instanceof Error ? err.message : String(err);\n return /missing credentials|api[_ ]?key/i.test(message);\n}\n\nexport function modelCredentialMissing(modelId: string): HttpError {\n return new HttpError(\n 400,\n \"model_credential_missing\",\n `Model ${modelId} has no API key yet. Configure it on the Models page first.`,\n );\n}\n\n/** app.onError handler: maps HttpError through as-is; everything else is logged and converged to 500. */\nexport function handleError(err: Error, c: Context): Response {\n if (err instanceof HttpError) {\n return c.json(errorBody(err.code, err.message), err.status as 400);\n }\n // Unknown error: print the stack for diagnosis, but never expose details externally.\n console.error(`[server] Unhandled exception: ${err.stack ?? err.message}`);\n return c.json(errorBody(\"internal\", \"Internal server error.\"), 500);\n}\n"],"mappings":";;;;;AASA,SAAS,aAAa,QAAQ,uBAAuB;AAS9C,IAAM,cAAc;AAC3B,IAAM,WAAW;AACjB,IAAM,WAAW;AACjB,IAAM,aAAa;AACnB,IAAM,YAAY;AAElB,SAAS,YACP,UACA,MACA,QACA,GACA,GACA,GACiB;AACjB,SAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AACtC,WAAO,UAAU,MAAM,QAAQ,EAAE,GAAG,GAAG,GAAG,GAAG,QAAQ,MAAM,OAAO,KAAK,GAAG,CAAC,KAAK,QAAQ;AACtF,UAAI,IAAK,QAAO,GAAG;AAAA,UACd,SAAQ,GAAG;AAAA,IAClB,CAAC;AAAA,EACH,CAAC;AACH;AAOA,eAAsB,aAAa,UAAkB,OAAe,aAA8B;AAChG,QAAM,OAAO,YAAY,UAAU;AACnC,QAAM,MAAM,MAAM,YAAY,UAAU,MAAM,WAAW,MAAM,UAAU,QAAQ;AACjF,SAAO;AAAA,IACL;AAAA,IACA,OAAO,IAAI;AAAA,IACX,OAAO,QAAQ;AAAA,IACf,OAAO,QAAQ;AAAA,IACf,KAAK,SAAS,QAAQ;AAAA,IACtB,IAAI,SAAS,QAAQ;AAAA,EACvB,EAAE,KAAK,GAA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I,CAAC,QAAS,QAAO;AACrB,UAAM,MAAM,KAAK,IAAI;AACrB,UAAM,YAAY,KAAK,MAAM,QAAQ,SAAS;AAC9C,QAAI,aAAa,IAAI,QAAQ,GAAG;AAC9B,WAAK,KAAK,aAAa,OAAO,SAAS;AACvC,aAAO;AAAA,IACT;AACA,UAAM,OAAO,KAAK,KAAK,MAAM,SAAS,QAAQ,MAAM;AACpD,QAAI,CAAC,KAAM,QAAO;AAClB,UAAM,YAAY,YAAY,KAAK,MAAM,QAAQ,SAAS,KAAK,KAAK,KAAK;AACzE,QAAI,UAAU;AACd,QAAI,aAAa,YAAY,IAAI,QAAQ,IAAI,KAAK,KAAK,gBAAgB;AACrE,WAAK,KAAK,aAAa;AAAA,QACrB;AAAA,QACA,IAAI,KAAK,IAAI,QAAQ,IAAI,KAAK,KAAK,YAAY,EAAE,YAAY;AAAA,MAC/D;AACA,gBAAU;AAAA,IACZ;AACA,UAAM,MACJ,QAAQ,QAAQ,YAAY,YAAY,QAAQ,QAAQ,UAAU,UAAU;AAC9E,WAAO,EAAE,MAAM,KAAK,QAAQ;AAAA,EAC9B;AAAA,EAEQ,aAAa,QAAgB,KAA8B;AACjE,WAAO,KAAK,KAAK,aAAa,MAAM;AAAA,MAClC;AAAA,MACA;AAAA,MACA,KAAK,KAAK,IAAI;AAAA,MACd,OAAO,KAAK,KAAK;AAAA,IACnB,CAAC,EAAE;AAAA,EACL;AACF;","names":["randomBytes","randomBytes","timingSafeEqual","timingSafeEqual","randomBytes"]}
|
package/dist/chunk-TTGGJDNA.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
readHarnessInfo
|
|
3
|
-
} from "./chunk-4SXGU7RO.js";
|
|
4
|
-
|
|
5
|
-
// src/version-report.ts
|
|
6
|
-
import { buildInfo } from "@prismshadow/penguin-core";
|
|
7
|
-
async function versionReport(root) {
|
|
8
|
-
return { ...buildInfo(), harness: await readHarnessInfo(root) };
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export {
|
|
12
|
-
versionReport
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=chunk-TTGGJDNA.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/version-report.ts"],"sourcesContent":["/**\n * The one assembler behind `penguin version --json` and GET /api/version.\n *\n * The report has two halves that no single layer can produce. Core knows the artifact this\n * process is executing and nothing about data roots; the HMR store knows what harness was\n * pushed to a root and nothing about the process reading it. Joining them here — rather\n * than in each caller — is what makes \"the CLI and the API report the same thing\" a\n * structural fact instead of two spreads that have to be kept in step.\n *\n * It lives in the server package because that is where the harness.json format is owned\n * (see ./hmr/manifest.ts), and is exported as its own entry point so the CLI can reach it\n * without pulling in a server: the module graph here is core plus a `node:fs` read.\n */\nimport { buildInfo } from \"@prismshadow/penguin-core\";\nimport type { VersionReport } from \"@prismshadow/penguin-core\";\nimport { readHarnessInfo } from \"./hmr/manifest.js\";\n\n/**\n * The running build's identity plus the harness committed to `root`'s HMR store.\n *\n * Never throws: an unreadable or malformed store reports `harness: null`, which is also\n * what a root with nothing ever pushed to it reports. Version reporting degrades to fewer\n * facts, never to a failure.\n */\nexport async function versionReport(root: string): Promise<VersionReport> {\n return { ...buildInfo(), harness: await readHarnessInfo(root) };\n}\n"],"mappings":";;;;;AAaA,SAAS,iBAAiB;AAW1B,eAAsB,cAAc,MAAsC;AACxE,SAAO,EAAE,GAAG,UAAU,GAAG,SAAS,MAAM,gBAAgB,IAAI,EAAE;AAChE;","names":[]}
|
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
import { Resources } from '@prismshadow/penguin-core/kernel';
|
|
2
|
-
export { Disposable, Extension, ExtensionContext, ExtensionEvents, PenguinContext, PenguinInterface, ToolFactory, WorkflowFactory, WorkflowInstance, WorkflowInstances } from '@prismshadow/penguin-core/extension';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Screen snapshot -> ANSI restore stream, plus plain-text capture.
|
|
6
|
-
*
|
|
7
|
-
* This is what makes a browser refresh (or a reconnect from a second device) show the
|
|
8
|
-
* terminal exactly as it was: the daemon keeps an authoritative headless xterm per pty, and
|
|
9
|
-
* on attach it *re-renders* that grid as an escape-sequence stream the client's real xterm
|
|
10
|
-
* replays into an identical screen. That beats the two obvious alternatives:
|
|
11
|
-
*
|
|
12
|
-
* - Replaying the raw pty byte log: unbounded, and full-screen programs (vim, top) replay
|
|
13
|
-
* as a flicker of stale frames.
|
|
14
|
-
* - Sending a JSON cell grid: a 200k-object payload per attach, parsed on the UI thread.
|
|
15
|
-
*
|
|
16
|
-
* Cursor alignment is the subtle part. The restore writes `scrollback + rows` lines, so the
|
|
17
|
-
* client's viewport ends up holding exactly the server's viewport, and only then is the
|
|
18
|
-
* cursor placed with a viewport-relative CUP. Trailing blank rows are therefore written on
|
|
19
|
-
* purpose — dropping them would shift every subsequent row and land the cursor in the wrong
|
|
20
|
-
* place.
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
interface CaptureLinesOptions {
|
|
24
|
-
/** Line index into scrollback+viewport; negative counts from the end (-1 = last line). */
|
|
25
|
-
start?: number;
|
|
26
|
-
end?: number;
|
|
27
|
-
}
|
|
28
|
-
interface CaptureLinesResult {
|
|
29
|
-
lines: string[];
|
|
30
|
-
totalLines: number;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
interface TerminalExitInfo {
|
|
34
|
-
exitCode: number;
|
|
35
|
-
signal: number | null;
|
|
36
|
-
lastOutputLines: string[];
|
|
37
|
-
}
|
|
38
|
-
interface CreateTerminalSessionOptions {
|
|
39
|
-
id?: string;
|
|
40
|
-
/** Absolute working directory (already resolved and validated by the manager). */
|
|
41
|
-
cwd: string;
|
|
42
|
-
/** Owning user id — a shell is the most privileged thing this server hands out. */
|
|
43
|
-
ownerUserId: string;
|
|
44
|
-
/**
|
|
45
|
-
* Stable per-user display number (tmux-style), assigned by the manager at creation. It
|
|
46
|
-
* travels with the terminal for its whole life — UI numbering must never depend on list
|
|
47
|
-
* position, which changes under user-reordered tabs.
|
|
48
|
-
*/
|
|
49
|
-
seq?: number;
|
|
50
|
-
name?: string;
|
|
51
|
-
shell?: string;
|
|
52
|
-
cols?: number;
|
|
53
|
-
rows?: number;
|
|
54
|
-
env?: Record<string, string>;
|
|
55
|
-
/**
|
|
56
|
-
* Where a pushed bundle's node-pty assets live (the hmr capability's assetsDir);
|
|
57
|
-
* absent falls back to the packaged require (see pty-module.ts).
|
|
58
|
-
*/
|
|
59
|
-
assets?: () => string | null;
|
|
60
|
-
}
|
|
61
|
-
interface TerminalSessionInfo {
|
|
62
|
-
id: string;
|
|
63
|
-
seq: number;
|
|
64
|
-
name: string;
|
|
65
|
-
cwd: string;
|
|
66
|
-
ownerUserId: string;
|
|
67
|
-
title: string | null;
|
|
68
|
-
cols: number;
|
|
69
|
-
rows: number;
|
|
70
|
-
pid: number;
|
|
71
|
-
createdAt: string;
|
|
72
|
-
alive: boolean;
|
|
73
|
-
exit: TerminalExitInfo | null;
|
|
74
|
-
}
|
|
75
|
-
type TerminalOutputListener = (data: string) => void;
|
|
76
|
-
type TerminalExitListener = (info: TerminalExitInfo) => void;
|
|
77
|
-
type TerminalTitleListener = (title: string | null) => void;
|
|
78
|
-
declare class TerminalSession {
|
|
79
|
-
readonly id: string;
|
|
80
|
-
readonly seq: number;
|
|
81
|
-
readonly cwd: string;
|
|
82
|
-
readonly ownerUserId: string;
|
|
83
|
-
readonly createdAt: Date;
|
|
84
|
-
private name;
|
|
85
|
-
private readonly terminal;
|
|
86
|
-
private readonly ptyProcess;
|
|
87
|
-
private readonly inputMode;
|
|
88
|
-
private readonly outputListeners;
|
|
89
|
-
private readonly exitListeners;
|
|
90
|
-
private readonly titleListeners;
|
|
91
|
-
private title;
|
|
92
|
-
private pendingTitle;
|
|
93
|
-
private titleTimer;
|
|
94
|
-
private sizeState;
|
|
95
|
-
private exitInfo;
|
|
96
|
-
private disposed;
|
|
97
|
-
constructor(options: CreateTerminalSessionOptions);
|
|
98
|
-
/** DA1 / DSR / OSC colour queries — see OSC_COLOR_QUERY_RESPONSES. */
|
|
99
|
-
private registerCapabilityResponders;
|
|
100
|
-
get alive(): boolean;
|
|
101
|
-
get exit(): TerminalExitInfo | null;
|
|
102
|
-
info(): TerminalSessionInfo;
|
|
103
|
-
rename(name: string): void;
|
|
104
|
-
write(data: string): void;
|
|
105
|
-
/**
|
|
106
|
-
* Applies a size request under the claim/update ownership rule, resizing both the pty and
|
|
107
|
-
* the daemon's emulator so snapshots keep matching what the shell laid out.
|
|
108
|
-
*/
|
|
109
|
-
resize(request: {
|
|
110
|
-
connectionId: string;
|
|
111
|
-
cols: number;
|
|
112
|
-
rows: number;
|
|
113
|
-
intent: "claim" | "update";
|
|
114
|
-
}): boolean;
|
|
115
|
-
releaseSize(connectionId: string): void;
|
|
116
|
-
get size(): {
|
|
117
|
-
cols: number;
|
|
118
|
-
rows: number;
|
|
119
|
-
};
|
|
120
|
-
/** The attach payload: the whole screen as an ANSI stream (see snapshot.ts). */
|
|
121
|
-
restoreStream(options?: {
|
|
122
|
-
scrollbackLines?: number;
|
|
123
|
-
}): string;
|
|
124
|
-
capture(options?: CaptureLinesOptions): CaptureLinesResult;
|
|
125
|
-
onOutput(listener: TerminalOutputListener): () => void;
|
|
126
|
-
onExit(listener: TerminalExitListener): () => void;
|
|
127
|
-
onTitleChange(listener: TerminalTitleListener): () => void;
|
|
128
|
-
kill(signal?: string): void;
|
|
129
|
-
dispose(): void;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
interface CreateTerminalRequest {
|
|
133
|
-
cwd: string;
|
|
134
|
-
ownerUserId: string;
|
|
135
|
-
name?: string;
|
|
136
|
-
cols?: number;
|
|
137
|
-
rows?: number;
|
|
138
|
-
shell?: string;
|
|
139
|
-
}
|
|
140
|
-
declare class TerminalManager {
|
|
141
|
-
private readonly resources;
|
|
142
|
-
private readonly opts;
|
|
143
|
-
/**
|
|
144
|
-
* The kernel's resource registry, threaded to every session it creates: a native module
|
|
145
|
-
* reaches the platform through it (pty-module.ts), and live ptys are registered in it so
|
|
146
|
-
* a hot swap hands them to the next platform instead of killing them.
|
|
147
|
-
*/
|
|
148
|
-
constructor(resources: Resources, opts?: {
|
|
149
|
-
graceMs?: number;
|
|
150
|
-
/** Where a pushed bundle's node-pty assets live (hmr.assetsDir); absent falls back to the packaged require. */
|
|
151
|
-
assets?: () => string | null;
|
|
152
|
-
});
|
|
153
|
-
private get graceMs();
|
|
154
|
-
private readonly sessions;
|
|
155
|
-
private readonly reapTimers;
|
|
156
|
-
/** Exit-listener unsubscribers, so quiesce() can detach this manager from delivered ptys. */
|
|
157
|
-
private readonly exitUnsubs;
|
|
158
|
-
/** Paired unregister per pty (register's return): the only way an entry leaves the registry. */
|
|
159
|
-
private readonly unregisters;
|
|
160
|
-
create(request: CreateTerminalRequest): Promise<TerminalSession>;
|
|
161
|
-
/**
|
|
162
|
-
* Takes a session into this manager AND into the runtime's resource registry. The
|
|
163
|
-
* registry is what makes a pty outlive a platform swap: it sits outside the reloadable
|
|
164
|
-
* tree, so the shell keeps running and the next instance claims it back (see
|
|
165
|
-
* hmr/resources.ts). The parked context carries only these ids.
|
|
166
|
-
*/
|
|
167
|
-
private track;
|
|
168
|
-
/**
|
|
169
|
-
* Reclaims the sessions a previous instance parked. An id the registry no longer knows
|
|
170
|
-
* is simply dropped: its shell died with the process that owned it, and a manager
|
|
171
|
-
* holding a handle to nothing would only fail later, further from the cause.
|
|
172
|
-
*/
|
|
173
|
-
adopt(ids: readonly string[]): void;
|
|
174
|
-
/**
|
|
175
|
-
* Park-side detach (hot swap only — never process exit): the ptys are DELIVERED to the
|
|
176
|
-
* next App through the registry, so this manager must stop acting on them. Exit
|
|
177
|
-
* listeners are unsubscribed (the successor adopts and re-listens), and every pending
|
|
178
|
-
* reap — each targeting an already-dead session that was therefore NOT parked for
|
|
179
|
-
* adoption — runs immediately instead of firing later from a dead generation, where it
|
|
180
|
-
* would release a registry id out from under whoever owns it next.
|
|
181
|
-
*/
|
|
182
|
-
quiesce(): void;
|
|
183
|
-
/** Handle ids for the parked context document — live sessions only. */
|
|
184
|
-
handleIds(): string[];
|
|
185
|
-
/** Looks up a session, enforcing ownership. Unknown and not-yours are both 404 — no probing. */
|
|
186
|
-
require(id: string, userId: string): TerminalSession;
|
|
187
|
-
get(id: string): TerminalSession | undefined;
|
|
188
|
-
list(userId: string): TerminalSession[];
|
|
189
|
-
listInfo(userId: string): TerminalSessionInfo[];
|
|
190
|
-
kill(id: string, userId: string): void;
|
|
191
|
-
/** Drops the session once nothing can usefully be read from it any more. */
|
|
192
|
-
private scheduleReap;
|
|
193
|
-
/** Server shutdown: every pty is a child process and must not outlive us. */
|
|
194
|
-
disposeAll(): void;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
* The harness's extension surface — the `@prismshadow/penguin-server/extension` subpath.
|
|
199
|
-
*
|
|
200
|
-
* The contract itself lives in `@prismshadow/penguin-core/extension`; what this module adds
|
|
201
|
-
* is the harness's own members, contributed by AUGMENTING that contract rather than by
|
|
202
|
-
* redeclaring it. Core names nothing it cannot reach, this layer names what it owns, and
|
|
203
|
-
* an extension sees one `PenguinContext` either way.
|
|
204
|
-
*
|
|
205
|
-
* Re-exported here so an extension package has one import site for both halves.
|
|
206
|
-
*/
|
|
207
|
-
|
|
208
|
-
declare module "@prismshadow/penguin-core/extension" {
|
|
209
|
-
interface PenguinContext {
|
|
210
|
-
terminals: TerminalManager;
|
|
211
|
-
}
|
|
212
|
-
}
|