@selvajs/selva 4.20.1-beta.4 → 4.21.0-beta.10
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/build/adapter-node.js +1 -1
- package/build/client/_app/immutable/assets/0.CqqJCiiV.css +2 -0
- package/build/client/_app/immutable/assets/0.CqqJCiiV.css.br +0 -0
- package/build/client/_app/immutable/assets/0.CqqJCiiV.css.gz +0 -0
- package/build/client/_app/immutable/chunks/{CzfnuBzq.js → BAhtiTKe.js} +1 -1
- package/build/client/_app/immutable/chunks/BAhtiTKe.js.br +0 -0
- package/build/client/_app/immutable/chunks/BAhtiTKe.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{qi43d-TM.js → CKbHmAlc.js} +1 -1
- package/build/client/_app/immutable/chunks/CKbHmAlc.js.br +0 -0
- package/build/client/_app/immutable/chunks/CKbHmAlc.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{C6Y_BUwr.js → CmlXAF26.js} +1 -1
- package/build/client/_app/immutable/chunks/CmlXAF26.js.br +0 -0
- package/build/client/_app/immutable/chunks/CmlXAF26.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Cv7GBWJh.js +2 -0
- package/build/client/_app/immutable/chunks/Cv7GBWJh.js.br +0 -0
- package/build/client/_app/immutable/chunks/Cv7GBWJh.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{BDYCH-_Q.js → D5j4-ZO1.js} +1 -1
- package/build/client/_app/immutable/chunks/D5j4-ZO1.js.br +0 -0
- package/build/client/_app/immutable/chunks/D5j4-ZO1.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DW5EJMC7.js +1 -0
- package/build/client/_app/immutable/chunks/DW5EJMC7.js.br +0 -0
- package/build/client/_app/immutable/chunks/DW5EJMC7.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{D-uUm_OB.js → DptnDNFA.js} +61 -56
- package/build/client/_app/immutable/chunks/DptnDNFA.js.br +0 -0
- package/build/client/_app/immutable/chunks/{D-uUm_OB.js.gz → DptnDNFA.js.gz} +0 -0
- package/build/client/_app/immutable/chunks/DvJo0Zn0.js +1 -0
- package/build/client/_app/immutable/chunks/DvJo0Zn0.js.br +1 -0
- package/build/client/_app/immutable/chunks/DvJo0Zn0.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{DzxE3j6C.js → qXnHMKD9.js} +1 -1
- package/build/client/_app/immutable/chunks/qXnHMKD9.js.br +0 -0
- package/build/client/_app/immutable/chunks/qXnHMKD9.js.gz +0 -0
- package/build/client/_app/immutable/entry/{app.BpT6WkO1.js → app.DPbjEDd3.js} +2 -2
- package/build/client/_app/immutable/entry/app.DPbjEDd3.js.br +0 -0
- package/build/client/_app/immutable/entry/app.DPbjEDd3.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{1.D3kiiIk_.js → 1.DWd6YbcT.js} +1 -1
- package/build/client/_app/immutable/nodes/1.DWd6YbcT.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.DWd6YbcT.js.gz +0 -0
- package/build/client/_app/immutable/nodes/15._hpTnSzc.js +36 -0
- package/build/client/_app/immutable/nodes/15._hpTnSzc.js.br +0 -0
- package/build/client/_app/immutable/nodes/15._hpTnSzc.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{2.CUNbzjI_.js → 2.CS32Eh9m.js} +1 -1
- package/build/client/_app/immutable/nodes/2.CS32Eh9m.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.CS32Eh9m.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{20.9OIre0ah.js → 20.CVaxGEhZ.js} +1 -1
- package/build/client/_app/immutable/nodes/20.CVaxGEhZ.js.br +0 -0
- package/build/client/_app/immutable/nodes/20.CVaxGEhZ.js.gz +0 -0
- package/build/client/_app/immutable/nodes/21.DpKe0-GH.js +1 -0
- package/build/client/_app/immutable/nodes/21.DpKe0-GH.js.br +0 -0
- package/build/client/_app/immutable/nodes/21.DpKe0-GH.js.gz +0 -0
- package/build/client/_app/immutable/nodes/24.DkL5kHzA.js +3 -0
- package/build/client/_app/immutable/nodes/24.DkL5kHzA.js.br +0 -0
- package/build/client/_app/immutable/nodes/24.DkL5kHzA.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{25.DW1_vMxq.js → 25.DiYmTwXC.js} +2 -2
- package/build/client/_app/immutable/nodes/25.DiYmTwXC.js.br +0 -0
- package/build/client/_app/immutable/nodes/25.DiYmTwXC.js.gz +0 -0
- package/build/client/_app/immutable/nodes/26.7nAJpm5P.js +5 -0
- package/build/client/_app/immutable/nodes/26.7nAJpm5P.js.br +0 -0
- package/build/client/_app/immutable/nodes/26.7nAJpm5P.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{3.3Z4QUsQQ.js → 3.Ctd9OGCk.js} +1 -1
- package/build/client/_app/immutable/nodes/3.Ctd9OGCk.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.Ctd9OGCk.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{5.DmA9lTA-.js → 5.Wh_w3RkZ.js} +1 -1
- package/build/client/_app/immutable/nodes/5.Wh_w3RkZ.js.br +2 -0
- package/build/client/_app/immutable/nodes/5.Wh_w3RkZ.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{6.D6WLqCgl.js → 6.C-DiUI5R.js} +1 -1
- package/build/client/_app/immutable/nodes/6.C-DiUI5R.js.br +0 -0
- package/build/client/_app/immutable/nodes/6.C-DiUI5R.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{7.CNuRjkv2.js → 7.B8yubYrv.js} +1 -1
- package/build/client/_app/immutable/nodes/7.B8yubYrv.js.br +0 -0
- package/build/client/_app/immutable/nodes/7.B8yubYrv.js.gz +0 -0
- package/build/client/_app/version.json +1 -1
- package/build/client/_app/version.json.br +0 -0
- package/build/client/_app/version.json.gz +0 -0
- package/build/runtime-meta.json +1 -1
- package/build/server/.vite/manifest.json +35 -45
- package/build/server/_app/immutable/assets/_layout.CqqJCiiV.css +2 -0
- package/build/server/chunks/DefinitionCard.js +3 -0
- package/build/server/chunks/DefinitionCard.js.map +1 -1
- package/build/server/chunks/access.js +15 -3
- package/build/server/chunks/access.js.map +1 -1
- package/build/server/chunks/api-errors.js +18 -3
- package/build/server/chunks/api-errors.js.map +1 -1
- package/build/server/chunks/api.js +9 -2
- package/build/server/chunks/api.js.map +1 -1
- package/build/server/chunks/auth-bootstrap.server.js +63 -39
- package/build/server/chunks/auth-bootstrap.server.js.map +1 -1
- package/build/server/chunks/boot.server.js +1 -1
- package/build/server/chunks/bootHealth.server.js +23 -23
- package/build/server/chunks/bootHealth.server.js.map +1 -1
- package/build/server/chunks/computeRateLimit.server.js +2 -2
- package/build/server/chunks/delete-with-blobs.js +1 -1
- package/build/server/chunks/engine.server.js +52 -5
- package/build/server/chunks/engine.server.js.map +1 -1
- package/build/server/chunks/grasshopper.js +217 -162
- package/build/server/chunks/grasshopper.js.map +1 -1
- package/build/server/chunks/handlers.js +70 -60
- package/build/server/chunks/handlers.js.map +1 -1
- package/build/server/chunks/http.js +24 -24
- package/build/server/chunks/http.js.map +1 -1
- package/build/server/chunks/http2.js +1 -1
- package/build/server/chunks/instance.js +3 -3
- package/build/server/chunks/instanceAdmins.server.js +31 -16
- package/build/server/chunks/instanceAdmins.server.js.map +1 -1
- package/build/server/chunks/internal.js +1 -1
- package/build/server/chunks/{abort-Bfrdupaj.js → keepalive-vtcjhAV3.js} +6 -3
- package/build/server/chunks/keepalive-vtcjhAV3.js.map +1 -0
- package/build/server/chunks/liveSolve.server.js +1 -1
- package/build/server/chunks/localeContext.svelte.js +14 -0
- package/build/server/chunks/localeContext.svelte.js.map +1 -1
- package/build/server/chunks/oauth.js +70 -24
- package/build/server/chunks/oauth.js.map +1 -1
- package/build/server/chunks/{outcome-DNrffAXp.js → outcome-D28FgvFK.js} +9 -6
- package/build/server/chunks/outcome-D28FgvFK.js.map +1 -0
- package/build/server/chunks/package.js +2 -1
- package/build/server/chunks/package.js.map +1 -1
- package/build/server/chunks/permissions.server.js +1 -1
- package/build/server/chunks/presets.server.js +1 -1
- package/build/server/chunks/providers.server.js +324 -121
- package/build/server/chunks/providers.server.js.map +1 -1
- package/build/server/chunks/registry.js +1 -1
- package/build/server/chunks/resolve-server.js +1 -1
- package/build/server/chunks/schema-extraction.js +75 -8
- package/build/server/chunks/schema-extraction.js.map +1 -1
- package/build/server/chunks/schema.js +1 -1
- package/build/server/chunks/schema.js.map +1 -1
- package/build/server/chunks/server-config-write.js +6 -6
- package/build/server/chunks/server-config-write.js.map +1 -1
- package/build/server/chunks/server2.js +2 -2
- package/build/server/chunks/server2.js.map +1 -1
- package/build/server/chunks/serverStats.server.js +1 -1
- package/build/server/chunks/signInMaxAge.server.js +1 -1
- package/build/server/chunks/solve.server.js +34 -8
- package/build/server/chunks/solve.server.js.map +1 -1
- package/build/server/chunks/sveltekit.js +4 -5
- package/build/server/chunks/sveltekit.js.map +1 -1
- package/build/server/chunks/update-outcome.js +11 -0
- package/build/server/chunks/update-outcome.js.map +1 -1
- package/build/server/chunks/updateCheck.server.js +24 -12
- package/build/server/chunks/updateCheck.server.js.map +1 -1
- package/build/server/entries/endpoints/.well-known/oauth-authorization-server/_server.ts.js +6 -3
- package/build/server/entries/endpoints/.well-known/oauth-authorization-server/_server.ts.js.map +1 -1
- package/build/server/entries/endpoints/.well-known/oauth-protected-resource/_server.ts.js +6 -3
- package/build/server/entries/endpoints/.well-known/oauth-protected-resource/_server.ts.js.map +1 -1
- package/build/server/entries/endpoints/.well-known/oauth-protected-resource/mcp/_server.ts.js +6 -3
- package/build/server/entries/endpoints/.well-known/oauth-protected-resource/mcp/_server.ts.js.map +1 -1
- package/build/server/entries/endpoints/api/admin/compute/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/admin/compute/actions/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/admin/compute/status/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/admin/orgs/_id_/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/admin/orgs/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/admin/projects/_id_/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/admin/projects/_id_/grants/_grantId_/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/admin/projects/_id_/grants/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/admin/projects/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/admin/system/health/_server.ts.js +9 -2
- package/build/server/entries/endpoints/api/admin/system/health/_server.ts.js.map +1 -1
- package/build/server/entries/endpoints/api/admin/system/update/_server.ts.js +59 -15
- package/build/server/entries/endpoints/api/admin/system/update/_server.ts.js.map +1 -1
- package/build/server/entries/endpoints/api/admin/users/_id_/_server.ts.js +42 -16
- package/build/server/entries/endpoints/api/admin/users/_id_/_server.ts.js.map +1 -1
- package/build/server/entries/endpoints/api/admin/users/_id_/disable/_server.ts.js +24 -13
- package/build/server/entries/endpoints/api/admin/users/_id_/disable/_server.ts.js.map +1 -1
- package/build/server/entries/endpoints/api/admin/users/_server.ts.js +2 -2
- package/build/server/entries/endpoints/api/files/_...path_/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/compute/_server.ts.js +15 -6
- package/build/server/entries/endpoints/api/v1/compute/_server.ts.js.map +1 -1
- package/build/server/entries/endpoints/api/v1/compute/schema/_server.ts.js +3 -3
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/image/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/publish/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/schema/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/share-links/_linkId_/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/share-links/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/solve/_server.ts.js +5 -4
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/solve/_server.ts.js.map +1 -1
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/versions/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/versions/_versionId_/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/versions/_versionId_/schema/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/me/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/me/starred/_guid_/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/me/token/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/orgs/_orgId_/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/orgs/_orgId_/members/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/orgs/_orgId_/tokens/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/orgs/_orgId_/tokens/_tokenId_/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/projects/_id_/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/projects/_id_/members/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/projects/_id_/members/_userId_/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/projects/_id_/reclaim/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/solve/_solveId_/cancel/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/solve-events/_server.ts.js +1 -1
- package/build/server/entries/endpoints/auth/email/callback/_server.ts.js +2 -2
- package/build/server/entries/endpoints/auth/email/callback/_server.ts.js.map +1 -1
- package/build/server/entries/endpoints/auth/supabase/callback/_server.ts.js +2 -2
- package/build/server/entries/endpoints/auth/supabase/callback/_server.ts.js.map +1 -1
- package/build/server/entries/endpoints/docs/api/openapi.yaml/_server.ts.js +1 -1
- package/build/server/entries/endpoints/mcp/_server.ts.js +43 -13
- package/build/server/entries/endpoints/mcp/_server.ts.js.map +1 -1
- package/build/server/entries/endpoints/oauth/register/_server.ts.js +1 -1
- package/build/server/entries/endpoints/oauth/token/_server.ts.js +1 -1
- package/build/server/entries/hooks.server.js +25 -6
- package/build/server/entries/hooks.server.js.map +1 -1
- package/build/server/entries/pages/admin/compute/_page.server.ts.js +1 -2
- package/build/server/entries/pages/admin/compute/_page.server.ts.js.map +1 -1
- package/build/server/entries/pages/admin/system/_page.server.ts.js +8 -3
- package/build/server/entries/pages/admin/system/_page.server.ts.js.map +1 -1
- package/build/server/entries/pages/admin/system/_page.svelte.js +18 -2
- package/build/server/entries/pages/admin/system/_page.svelte.js.map +1 -1
- package/build/server/entries/pages/library/_guid_/_page.server.ts.js +198 -99
- package/build/server/entries/pages/library/_guid_/_page.server.ts.js.map +1 -1
- package/build/server/entries/pages/library/_guid_/_page.svelte.js +693 -40
- package/build/server/entries/pages/library/_guid_/_page.svelte.js.map +1 -1
- package/build/server/entries/pages/oauth/authorize/_page.server.ts.js +3 -2
- package/build/server/entries/pages/oauth/authorize/_page.server.ts.js.map +1 -1
- package/build/server/entries/pages/oauth/authorize/_page.svelte.js +8 -1
- package/build/server/entries/pages/oauth/authorize/_page.svelte.js.map +1 -1
- package/build/server/entries/pages/projects/_page.svelte.js +2 -0
- package/build/server/entries/pages/projects/_page.svelte.js.map +1 -1
- package/build/server/entries/pages/setup/_page.server.ts.js +62 -8
- package/build/server/entries/pages/setup/_page.server.ts.js.map +1 -1
- package/build/server/entries/pages/setup/_page.svelte.js +52 -33
- package/build/server/entries/pages/setup/_page.svelte.js.map +1 -1
- package/build/server/entries/pages/team/tokens/_page.server.ts.js +1 -1
- package/build/server/manifest-full.js +1 -1
- package/build/server/manifest.js +1 -1
- package/build/server/nodes/0.js +2 -2
- package/build/server/nodes/1.js +1 -1
- package/build/server/nodes/15.js +1 -1
- package/build/server/nodes/2.js +1 -1
- package/build/server/nodes/20.js +1 -1
- package/build/server/nodes/21.js +1 -1
- package/build/server/nodes/24.js +1 -1
- package/build/server/nodes/25.js +1 -1
- package/build/server/nodes/26.js +1 -1
- package/build/server/nodes/3.js +1 -1
- package/build/server/nodes/5.js +1 -1
- package/build/server/nodes/6.js +1 -1
- package/build/server/nodes/7.js +1 -1
- package/build/server/server.js +1 -1
- package/package.json +16 -13
- package/templates/.env.example +15 -7
- package/build/client/_app/immutable/assets/0.2jDm0bqh.css +0 -2
- package/build/client/_app/immutable/assets/0.2jDm0bqh.css.br +0 -0
- package/build/client/_app/immutable/assets/0.2jDm0bqh.css.gz +0 -0
- package/build/client/_app/immutable/chunks/BDYCH-_Q.js.br +0 -0
- package/build/client/_app/immutable/chunks/BDYCH-_Q.js.gz +0 -0
- package/build/client/_app/immutable/chunks/C6Y_BUwr.js.br +0 -0
- package/build/client/_app/immutable/chunks/C6Y_BUwr.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CzfnuBzq.js.br +0 -0
- package/build/client/_app/immutable/chunks/CzfnuBzq.js.gz +0 -0
- package/build/client/_app/immutable/chunks/D-uUm_OB.js.br +0 -0
- package/build/client/_app/immutable/chunks/D84F7w9g.js +0 -1
- package/build/client/_app/immutable/chunks/D84F7w9g.js.br +0 -1
- package/build/client/_app/immutable/chunks/D84F7w9g.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DQsP4nZb.js +0 -1
- package/build/client/_app/immutable/chunks/DQsP4nZb.js.br +0 -0
- package/build/client/_app/immutable/chunks/DQsP4nZb.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DzeQucGI.js +0 -2
- package/build/client/_app/immutable/chunks/DzeQucGI.js.br +0 -0
- package/build/client/_app/immutable/chunks/DzeQucGI.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DzxE3j6C.js.br +0 -0
- package/build/client/_app/immutable/chunks/DzxE3j6C.js.gz +0 -0
- package/build/client/_app/immutable/chunks/qi43d-TM.js.br +0 -0
- package/build/client/_app/immutable/chunks/qi43d-TM.js.gz +0 -0
- package/build/client/_app/immutable/entry/app.BpT6WkO1.js.br +0 -0
- package/build/client/_app/immutable/entry/app.BpT6WkO1.js.gz +0 -0
- package/build/client/_app/immutable/nodes/1.D3kiiIk_.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.D3kiiIk_.js.gz +0 -0
- package/build/client/_app/immutable/nodes/15.BXIV1QfS.js +0 -32
- package/build/client/_app/immutable/nodes/15.BXIV1QfS.js.br +0 -0
- package/build/client/_app/immutable/nodes/15.BXIV1QfS.js.gz +0 -0
- package/build/client/_app/immutable/nodes/2.CUNbzjI_.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.CUNbzjI_.js.gz +0 -0
- package/build/client/_app/immutable/nodes/20.9OIre0ah.js.br +0 -0
- package/build/client/_app/immutable/nodes/20.9OIre0ah.js.gz +0 -0
- package/build/client/_app/immutable/nodes/21.BkNlRItr.js +0 -1
- package/build/client/_app/immutable/nodes/21.BkNlRItr.js.br +0 -0
- package/build/client/_app/immutable/nodes/21.BkNlRItr.js.gz +0 -0
- package/build/client/_app/immutable/nodes/24.CPSunfJJ.js +0 -3
- package/build/client/_app/immutable/nodes/24.CPSunfJJ.js.br +0 -0
- package/build/client/_app/immutable/nodes/24.CPSunfJJ.js.gz +0 -0
- package/build/client/_app/immutable/nodes/25.DW1_vMxq.js.br +0 -0
- package/build/client/_app/immutable/nodes/25.DW1_vMxq.js.gz +0 -0
- package/build/client/_app/immutable/nodes/26.CqaMEm_t.js +0 -6
- package/build/client/_app/immutable/nodes/26.CqaMEm_t.js.br +0 -0
- package/build/client/_app/immutable/nodes/26.CqaMEm_t.js.gz +0 -0
- package/build/client/_app/immutable/nodes/3.3Z4QUsQQ.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.3Z4QUsQQ.js.gz +0 -0
- package/build/client/_app/immutable/nodes/5.DmA9lTA-.js.br +0 -1
- package/build/client/_app/immutable/nodes/5.DmA9lTA-.js.gz +0 -0
- package/build/client/_app/immutable/nodes/6.D6WLqCgl.js.br +0 -0
- package/build/client/_app/immutable/nodes/6.D6WLqCgl.js.gz +0 -0
- package/build/client/_app/immutable/nodes/7.CNuRjkv2.js.br +0 -0
- package/build/client/_app/immutable/nodes/7.CNuRjkv2.js.gz +0 -0
- package/build/server/_app/immutable/assets/_layout.2jDm0bqh.css +0 -2
- package/build/server/chunks/abort-Bfrdupaj.js.map +0 -1
- package/build/server/chunks/computeLimits.js +0 -33
- package/build/server/chunks/computeLimits.js.map +0 -1
- package/build/server/chunks/outcome-DNrffAXp.js.map +0 -1
- /package/build/client/_app/immutable/nodes/{0.CYdyv5To.js → 0.Ds0zeDAg.js} +0 -0
- /package/build/client/_app/immutable/nodes/{0.CYdyv5To.js.br → 0.Ds0zeDAg.js.br} +0 -0
- /package/build/client/_app/immutable/nodes/{0.CYdyv5To.js.gz → 0.Ds0zeDAg.js.gz} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_page.svelte.js","names":["__iconData","__iconNode","$.spread_props","__iconData","__iconNode","$.spread_props","__iconData","__iconNode","$.spread_props","__iconData","__iconNode","$.spread_props","__iconData","__iconNode","$.spread_props","$.spread_props","$.derived","CircleCheck","TriangleAlert","CircleX","RefreshCw","Card.Root","Card.Header","Card.Title","$.attr_class","$.escape","Card.Description","Card.Content","$.stringify","$.attr","AlertDialog.Root","AlertDialog.Content","AlertDialog.Header","AlertDialog.Title","AlertDialog.Description","AlertDialog.Footer","AlertDialog.Cancel","AlertDialog.Action","untrack","$.derived","Card.Root","Card.Header","Card.Title","$.attr_class","$.escape","Card.Description","Card.Content","$.attr","CircleCheck","TriangleAlert","CircleX","Card.Root","Card.Header","Card.Title","Card.Description","Card.Content","$.escape","$.attr_class","$.stringify","$.ensure_array_like","Card.Root","Card.Header","Card.Title","Card.Description","Card.Content","$.escape","$.ensure_array_like","$.derived","$.escape","$.attr_class","$.attr","$.ensure_array_like","$.stringify","$.derived","Tabs.Root","Tabs.List","$.ensure_array_like","Tabs.Trigger","$.escape","Tabs.Content","Card.Root","Card.Header","Card.Title","Card.Description","Card.Content","$.attr_class"],"sources":["../../../../../../../../node_modules/.pnpm/@lucide+svelte@1.66.0_svelte@5.57.3_@typescript-eslint+types@8.72.1_/node_modules/@lucide/svelte/dist/icons/arrow-down.svelte","../../../../../../../../node_modules/.pnpm/@lucide+svelte@1.66.0_svelte@5.57.3_@typescript-eslint+types@8.72.1_/node_modules/@lucide/svelte/dist/icons/arrow-up.svelte","../../../../../../../../node_modules/.pnpm/@lucide+svelte@1.66.0_svelte@5.57.3_@typescript-eslint+types@8.72.1_/node_modules/@lucide/svelte/dist/icons/circle-arrow-up.svelte","../../../../../../../../node_modules/.pnpm/@lucide+svelte@1.66.0_svelte@5.57.3_@typescript-eslint+types@8.72.1_/node_modules/@lucide/svelte/dist/icons/circle-x.svelte","../../../../../../../../node_modules/.pnpm/@lucide+svelte@1.66.0_svelte@5.57.3_@typescript-eslint+types@8.72.1_/node_modules/@lucide/svelte/dist/icons/flask-conical.svelte","../../../../../../../../node_modules/.pnpm/@lucide+svelte@1.66.0_svelte@5.57.3_@typescript-eslint+types@8.72.1_/node_modules/@lucide/svelte/dist/icons/stethoscope.svelte","../../../../../../src/routes/admin/system/UpdateSection.svelte","../../../../../../src/routes/admin/system/ChannelSection.svelte","../../../../../../src/routes/admin/system/HealthSection.svelte","../../../../../../src/routes/admin/system/NetworkSection.svelte","../../../../../../src/routes/admin/system/ConfigSection.svelte","../../../../../../src/lib/update-restart-poll.ts","../../../../../../src/routes/admin/system/+page.svelte"],"sourcesContent":["<!--\n@lucide/svelte v1.66.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script module lang=\"ts\">export const __iconData = { \"name\": \"arrow-down\", \"size\": 24, \"node\": [[\"path\", { \"d\": \"M12 5v14\" }], [\"path\", { \"d\": \"m19 12-7 7-7-7\" }]] };\n/**\n * @deprecated Access `__iconData` instead.\n */\nexport const __iconNode = __iconData.node;\n</script>\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/arrow-down\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={__iconData} />\n","<!--\n@lucide/svelte v1.66.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script module lang=\"ts\">export const __iconData = { \"name\": \"arrow-up\", \"size\": 24, \"node\": [[\"path\", { \"d\": \"m5 12 7-7 7 7\" }], [\"path\", { \"d\": \"M12 19V5\" }]] };\n/**\n * @deprecated Access `__iconData` instead.\n */\nexport const __iconNode = __iconData.node;\n</script>\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/arrow-up\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={__iconData} />\n","<!--\n@lucide/svelte v1.66.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script module lang=\"ts\">export const __iconData = { \"name\": \"circle-arrow-up\", \"size\": 24, \"node\": [[\"circle\", { \"cx\": \"12\", \"cy\": \"12\", \"r\": \"10\" }], [\"path\", { \"d\": \"m16 12-4-4-4 4\" }], [\"path\", { \"d\": \"M12 16V8\" }]], \"aliases\": [\"arrow-up-circle\"] };\n/**\n * @deprecated Access `__iconData` instead.\n */\nexport const __iconNode = __iconData.node;\n</script>\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/circle-arrow-up\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={__iconData} />\n","<!--\n@lucide/svelte v1.66.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script module lang=\"ts\">export const __iconData = { \"name\": \"circle-x\", \"size\": 24, \"node\": [[\"circle\", { \"cx\": \"12\", \"cy\": \"12\", \"r\": \"10\" }], [\"path\", { \"d\": \"m15 9-6 6\" }], [\"path\", { \"d\": \"m9 9 6 6\" }]], \"aliases\": [\"x-circle\"] };\n/**\n * @deprecated Access `__iconData` instead.\n */\nexport const __iconNode = __iconData.node;\n</script>\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/circle-x\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={__iconData} />\n","<!--\n@lucide/svelte v1.66.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script module lang=\"ts\">export const __iconData = { \"name\": \"flask-conical\", \"size\": 24, \"node\": [[\"path\", { \"d\": \"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2\" }], [\"path\", { \"d\": \"M6.453 15h11.094\" }], [\"path\", { \"d\": \"M8.5 2h7\" }]] };\n/**\n * @deprecated Access `__iconData` instead.\n */\nexport const __iconNode = __iconData.node;\n</script>\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/flask-conical\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={__iconData} />\n","<!--\n@lucide/svelte v1.66.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script module lang=\"ts\">export const __iconData = { \"name\": \"stethoscope\", \"size\": 24, \"node\": [[\"path\", { \"d\": \"M11 2v2\" }], [\"path\", { \"d\": \"M5 2v2\" }], [\"path\", { \"d\": \"M5 3H4a2 2 0 0 0-2 2v4a6 6 0 0 0 12 0V5a2 2 0 0 0-2-2h-1\" }], [\"path\", { \"d\": \"M8 15a6 6 0 0 0 12 0v-3\" }], [\"circle\", { \"cx\": \"20\", \"cy\": \"10\", \"r\": \"2\" }]] };\n/**\n * @deprecated Access `__iconData` instead.\n */\nexport const __iconNode = __iconData.node;\n</script>\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/stethoscope\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={__iconData} />\n","<script lang=\"ts\">\n\timport { Button, Card, AlertDialog } from '@selvajs/ui';\n\timport {\n\t\tRefreshCw,\n\t\tCircleCheck,\n\t\tInfo,\n\t\tTriangleAlert,\n\t\tCircleX,\n\t\tArrowUpCircle\n\t} from '@lucide/svelte';\n\timport { deriveOutcome, type OutcomeSeverity } from '#lib/update-outcome.js';\n\n\tinterface NodeCompatibility {\n\t\tcompatible: boolean | null;\n\t\trequired: string | null;\n\t\trunning: string;\n\t}\n\n\tinterface Props {\n\t\tcurrentVersion?: string;\n\t\tlatestVersion?: string | null;\n\t\tupdateAvailable?: boolean;\n\t\tchannel?: 'stable' | 'beta';\n\t\tisRunning?: boolean;\n\t\tisRestarting?: boolean;\n\t\tlogs?: string;\n\t\texitCode?: number | null;\n\t\tnodeCompatibility?: NodeCompatibility;\n\t\tonRun?: () => void;\n\t}\n\n\tlet {\n\t\tcurrentVersion,\n\t\tlatestVersion = null,\n\t\tupdateAvailable = false,\n\t\tchannel = 'stable',\n\t\tisRunning = false,\n\t\tisRestarting = false,\n\t\tlogs = '',\n\t\texitCode = null,\n\t\tnodeCompatibility = { compatible: null, required: null, running: '' },\n\t\tonRun\n\t}: Props = $props();\n\n\t// Only a definite `false` blocks. `null` means we couldn't determine the\n\t// requirement (registry down, no engines field, unparseable range) — never\n\t// strand an operator behind a check that couldn't run (issue #176).\n\tconst nodeBlocked = $derived(nodeCompatibility.compatible === false);\n\n\t// Typed override: the operator retypes the target version to proceed anyway.\n\t// A mismatched update will NOT self-roll-back — the health probe passes\n\t// regardless — so this needs more friction than a second click.\n\tlet overrideInput = $state('');\n\tlet overrideArmed = $state(false);\n\tconst overrideSatisfied = $derived(\n\t\toverrideArmed && !!latestVersion && overrideInput.trim() === latestVersion\n\t);\n\tconst runDisabled = $derived(isRunning || (nodeBlocked && !overrideSatisfied));\n\n\tconst channelLabel = $derived(channel === 'beta' ? 'beta' : 'stable');\n\n\tlet logEl = $state<HTMLPreElement>();\n\tlet showRunConfirm = $state(false);\n\n\t// Only classify once the run has finished (exitCode set). While running we\n\t// show live progress instead, so a transient mid-run log line can't be\n\t// misread as a final verdict.\n\tlet outcome = $derived(exitCode === null ? null : deriveOutcome(exitCode, logs));\n\n\tconst severityStyles: Record<\n\t\tOutcomeSeverity,\n\t\t{ text: string; border: string; bg: string; icon: typeof CircleCheck }\n\t> = {\n\t\tsuccess: {\n\t\t\ttext: 'text-success',\n\t\t\tborder: 'border-success/40',\n\t\t\tbg: 'bg-success/10',\n\t\t\ticon: CircleCheck\n\t\t},\n\t\tinfo: {\n\t\t\ttext: 'text-foreground',\n\t\t\tborder: 'border-border',\n\t\t\tbg: 'bg-muted',\n\t\t\ticon: Info\n\t\t},\n\t\twarning: {\n\t\t\ttext: 'text-warning',\n\t\t\tborder: 'border-warning/40',\n\t\t\tbg: 'bg-warning/10',\n\t\t\ticon: TriangleAlert\n\t\t},\n\t\tcritical: {\n\t\t\ttext: 'text-destructive',\n\t\t\tborder: 'border-destructive/40',\n\t\t\tbg: 'bg-destructive/10',\n\t\t\ticon: CircleX\n\t\t},\n\t\tpending: {\n\t\t\ttext: 'text-muted-foreground',\n\t\t\tborder: 'border-border',\n\t\t\tbg: 'bg-muted',\n\t\t\ticon: RefreshCw\n\t\t}\n\t};\n\n\t$effect(() => {\n\t\t// Auto-scroll to bottom whenever logs change\n\t\tif (logs && logEl) {\n\t\t\tlogEl.scrollTop = logEl.scrollHeight;\n\t\t}\n\t});\n\n\tfunction buttonLabel() {\n\t\tif (isRestarting) return 'Restarting & verifying…';\n\t\tif (isRunning) return 'Running…';\n\t\treturn 'Run Update';\n\t}\n\n\tfunction handleRunClick() {\n\t\tshowRunConfirm = true;\n\t}\n\n\tfunction confirmRun() {\n\t\tshowRunConfirm = false;\n\t\tonRun?.();\n\t}\n</script>\n\n<Card.Root>\n\t<Card.Header>\n\t\t<div class=\"flex items-start justify-between gap-3\">\n\t\t\t<Card.Title>Application Update</Card.Title>\n\t\t\t{#if currentVersion}\n\t\t\t\t<span\n\t\t\t\t\tclass=\"rounded-full border px-2 py-0.5 font-mono text-xs {updateAvailable\n\t\t\t\t\t\t? 'border-warning/40 bg-warning/10 text-warning'\n\t\t\t\t\t\t: 'border-border bg-muted text-muted-foreground'}\"\n\t\t\t\t\ttitle=\"Currently installed @selvajs/selva version\"\n\t\t\t\t>\n\t\t\t\t\tv{currentVersion}\n\t\t\t\t</span>\n\t\t\t{/if}\n\t\t</div>\n\t\t<Card.Description\n\t\t\t>Update @selvajs/* to the latest <span class=\"font-medium\">{channelLabel}</span> release and restart</Card.Description\n\t\t>\n\t</Card.Header>\n\t<Card.Content class=\"space-y-4\">\n\t\t{#if updateAvailable && latestVersion}\n\t\t\t<div\n\t\t\t\tclass=\"border-warning/40 bg-warning/10 text-warning flex items-center gap-2 rounded-md border px-3 py-2 text-sm\"\n\t\t\t\trole=\"status\"\n\t\t\t>\n\t\t\t\t<ArrowUpCircle class=\"h-4 w-4 shrink-0\" />\n\t\t\t\t<span>\n\t\t\t\t\t{channelLabel} release available — <span class=\"font-mono\">v{currentVersion}</span> →\n\t\t\t\t\t<span class=\"font-mono\">v{latestVersion}</span>\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t{:else if currentVersion && latestVersion}\n\t\t\t<p class=\"text-muted-foreground text-sm\">\n\t\t\t\tYou're on the latest {channelLabel} release (<span class=\"font-mono\">v{currentVersion}</span\n\t\t\t\t>).\n\t\t\t</p>\n\t\t{/if}\n\t\t{#if nodeBlocked}\n\t\t\t<div\n\t\t\t\tclass=\"border-destructive/40 bg-destructive/10 space-y-3 rounded-md border px-3 py-3 text-sm\"\n\t\t\t\trole=\"alert\"\n\t\t\t>\n\t\t\t\t<div class=\"text-destructive flex items-start gap-2\">\n\t\t\t\t\t<TriangleAlert class=\"mt-0.5 h-4 w-4 shrink-0\" />\n\t\t\t\t\t<div class=\"space-y-1\">\n\t\t\t\t\t\t<p class=\"font-medium\">Update blocked — this release needs a newer Node</p>\n\t\t\t\t\t\t<p class=\"text-muted-foreground text-xs\">\n\t\t\t\t\t\t\t<span class=\"font-mono\">v{latestVersion}</span> requires Node\n\t\t\t\t\t\t\t<span class=\"font-mono\">{nodeCompatibility.required}</span>, but this host runs\n\t\t\t\t\t\t\t<span class=\"font-mono\">v{nodeCompatibility.running}</span>. npm installs it anyway\n\t\t\t\t\t\t\tand the health check still passes, so a failed update would\n\t\t\t\t\t\t\t<span class=\"font-medium\">not</span> roll back automatically. Upgrade Node on the server\n\t\t\t\t\t\t\tfirst.\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t{#if !overrideArmed}\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tclass=\"text-muted-foreground hover:text-foreground text-xs underline underline-offset-2\"\n\t\t\t\t\t\tonclick={() => (overrideArmed = true)}\n\t\t\t\t\t>\n\t\t\t\t\t\tOverride anyway (advanced)\n\t\t\t\t\t</button>\n\t\t\t\t{:else}\n\t\t\t\t\t<div class=\"space-y-2\">\n\t\t\t\t\t\t<label class=\"text-muted-foreground block text-xs\" for=\"node-override\">\n\t\t\t\t\t\t\tType <span class=\"text-foreground font-mono\">{latestVersion}</span> to confirm you accept\n\t\t\t\t\t\t\ta deployment that may fail under real traffic:\n\t\t\t\t\t\t</label>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tid=\"node-override\"\n\t\t\t\t\t\t\tclass=\"border-input bg-background w-full rounded-md border px-2 py-1 font-mono text-xs\"\n\t\t\t\t\t\t\tbind:value={overrideInput}\n\t\t\t\t\t\t\tplaceholder={latestVersion ?? ''}\n\t\t\t\t\t\t\tautocomplete=\"off\"\n\t\t\t\t\t\t\tspellcheck=\"false\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t{/if}\n\t\t\t</div>\n\t\t{/if}\n\t\t<Button onclick={handleRunClick} disabled={runDisabled} variant=\"destructive\">\n\t\t\t{buttonLabel()}\n\t\t</Button>\n\t\t{#if isRestarting && exitCode === null}\n\t\t\t<div\n\t\t\t\tclass=\"border-border bg-muted text-muted-foreground flex items-center gap-2 rounded-md border px-3 py-2 text-sm\"\n\t\t\t>\n\t\t\t\t<RefreshCw class=\"h-4 w-4 animate-spin\" />\n\t\t\t\t<span>PM2 is restarting the app — waiting for the new process to come online…</span>\n\t\t\t</div>\n\t\t{/if}\n\t\t{#if outcome}\n\t\t\t{@const style = severityStyles[outcome.severity]}\n\t\t\t{@const Icon = style.icon}\n\t\t\t<div\n\t\t\t\tclass=\"flex items-start gap-3 rounded-md border px-3 py-3 {style.border} {style.bg}\"\n\t\t\t\trole={outcome.severity === 'critical' ? 'alert' : 'status'}\n\t\t\t\taria-live={outcome.severity === 'critical' ? 'assertive' : 'polite'}\n\t\t\t>\n\t\t\t\t<Icon class=\"mt-0.5 h-5 w-5 shrink-0 {style.text}\" />\n\t\t\t\t<div class=\"min-w-0 space-y-1\">\n\t\t\t\t\t<p class=\"text-sm font-medium {style.text}\">{outcome.title}</p>\n\t\t\t\t\t{#if outcome.from && outcome.to && outcome.from !== outcome.to}\n\t\t\t\t\t\t<p class=\"text-muted-foreground font-mono text-xs\">\n\t\t\t\t\t\t\t{outcome.from} → {outcome.to}\n\t\t\t\t\t\t</p>\n\t\t\t\t\t{/if}\n\t\t\t\t\t{#if outcome.detail}\n\t\t\t\t\t\t<p class=\"text-muted-foreground text-xs whitespace-pre-line\">{outcome.detail}</p>\n\t\t\t\t\t{/if}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t{/if}\n\n\t\t{#if logs}\n\t\t\t<div class=\"space-y-2\">\n\t\t\t\t<h4 class=\"text-sm font-medium\">Update Logs</h4>\n\t\t\t\t<pre\n\t\t\t\t\tbind:this={logEl}\n\t\t\t\t\tclass=\"bg-muted text-foreground max-h-96 overflow-auto rounded-md p-4 font-mono text-xs\">{logs}</pre>\n\t\t\t</div>\n\t\t{/if}\n\t</Card.Content>\n</Card.Root>\n\n<AlertDialog.Root open={showRunConfirm} onOpenChange={(o) => (showRunConfirm = o)}>\n\t<AlertDialog.Content>\n\t\t<AlertDialog.Header>\n\t\t\t<AlertDialog.Title>\n\t\t\t\t{nodeBlocked ? 'Run Update despite the Node mismatch?' : 'Run Update?'}\n\t\t\t</AlertDialog.Title>\n\t\t\t{#if nodeBlocked}\n\t\t\t\t<AlertDialog.Description class=\"text-destructive\">\n\t\t\t\t\tThis release requires Node {nodeCompatibility.required} and the host runs v{nodeCompatibility.running}.\n\t\t\t\t\tThe health check will pass regardless, so this update will not roll itself back if routes\n\t\t\t\t\tstart failing.\n\t\t\t\t</AlertDialog.Description>\n\t\t\t{/if}\n\t\t\t<AlertDialog.Description>\n\t\t\t\tThis will update @selvajs/* to the latest {channelLabel} release and restart the application.\n\t\t\t\tThe service will be temporarily unavailable.\n\t\t\t</AlertDialog.Description>\n\t\t</AlertDialog.Header>\n\t\t<AlertDialog.Footer>\n\t\t\t<AlertDialog.Cancel>Cancel</AlertDialog.Cancel>\n\t\t\t<AlertDialog.Action onclick={confirmRun} disabled={isRunning}>Continue</AlertDialog.Action>\n\t\t</AlertDialog.Footer>\n\t</AlertDialog.Content>\n</AlertDialog.Root>\n","<script lang=\"ts\">\n\timport { untrack } from 'svelte';\n\timport { Button, Callout, Card } from '@selvajs/ui';\n\timport { FlaskConical, ShieldCheck } from '@lucide/svelte';\n\timport { enhance } from '$app/forms';\n\n\tinterface Props {\n\t\t/** The persisted channel. */\n\t\tchannel: 'stable' | 'beta';\n\t\t/** Disable controls while an update is mid-flight. */\n\t\tdisabled?: boolean;\n\t}\n\n\tlet { channel, disabled = false }: Props = $props();\n\n\t// Local selection the radios mutate; the form submits it. Intentionally a\n\t// one-time snapshot of the persisted `channel` (untrack makes that explicit).\n\t// The parent keys this component on `channel` ({#key data.channel}), so a\n\t// confirmed switch remounts it and re-seeds the selection.\n\tlet selected = $state(untrack(() => channel));\n\n\tlet saving = $state(false);\n\n\tlet dirty = $derived(selected !== channel);\n</script>\n\n<Card.Root>\n\t<Card.Header>\n\t\t<div class=\"flex items-start justify-between gap-3\">\n\t\t\t<Card.Title>Release channel</Card.Title>\n\t\t\t<span\n\t\t\t\tclass=\"rounded-full border px-2 py-0.5 font-mono text-xs {channel === 'beta'\n\t\t\t\t\t? 'border-warning/40 bg-warning/10 text-warning'\n\t\t\t\t\t: 'border-border bg-muted text-muted-foreground'}\"\n\t\t\t\ttitle=\"The channel this deployment currently tracks\"\n\t\t\t>\n\t\t\t\t{channel === 'beta' ? 'Beta' : 'Stable'}\n\t\t\t</span>\n\t\t</div>\n\t\t<Card.Description>\n\t\t\tWhich published line of @selvajs/* this instance updates to. Switching here only changes the\n\t\t\tchannel — run an update afterwards to install from it.\n\t\t</Card.Description>\n\t</Card.Header>\n\t<Card.Content class=\"space-y-4\">\n\t\t<form\n\t\t\tmethod=\"POST\"\n\t\t\taction=\"?/setChannel\"\n\t\t\tuse:enhance={() => {\n\t\t\t\tsaving = true;\n\t\t\t\treturn async ({ update }) => {\n\t\t\t\t\tawait update({ reset: false });\n\t\t\t\t\tsaving = false;\n\t\t\t\t};\n\t\t\t}}\n\t\t>\n\t\t\t<div class=\"grid gap-3 sm:grid-cols-2\">\n\t\t\t\t<label\n\t\t\t\t\tclass=\"flex cursor-pointer items-start gap-3 rounded-lg border px-4 py-3 transition-colors {selected ===\n\t\t\t\t\t'stable'\n\t\t\t\t\t\t? 'border-primary bg-primary/5'\n\t\t\t\t\t\t: 'border-border hover:bg-hover'}\"\n\t\t\t\t>\n\t\t\t\t\t<input\n\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\tname=\"channel\"\n\t\t\t\t\t\tvalue=\"stable\"\n\t\t\t\t\t\tbind:group={selected}\n\t\t\t\t\t\t{disabled}\n\t\t\t\t\t\tclass=\"sr-only\"\n\t\t\t\t\t/>\n\t\t\t\t\t<ShieldCheck class=\"text-success mt-0.5 h-5 w-5 shrink-0\" />\n\t\t\t\t\t<div class=\"min-w-0\">\n\t\t\t\t\t\t<p class=\"text-sm font-medium\">Stable</p>\n\t\t\t\t\t\t<p class=\"text-muted-foreground mt-0.5 text-xs\">\n\t\t\t\t\t\t\tProduction releases (npm <code class=\"font-mono\">latest</code>). The default.\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</div>\n\t\t\t\t</label>\n\n\t\t\t\t<label\n\t\t\t\t\tclass=\"flex cursor-pointer items-start gap-3 rounded-lg border px-4 py-3 transition-colors {selected ===\n\t\t\t\t\t'beta'\n\t\t\t\t\t\t? 'border-primary bg-primary/5'\n\t\t\t\t\t\t: 'border-border hover:bg-hover'}\"\n\t\t\t\t>\n\t\t\t\t\t<input\n\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\tname=\"channel\"\n\t\t\t\t\t\tvalue=\"beta\"\n\t\t\t\t\t\tbind:group={selected}\n\t\t\t\t\t\t{disabled}\n\t\t\t\t\t\tclass=\"sr-only\"\n\t\t\t\t\t/>\n\t\t\t\t\t<FlaskConical class=\"text-warning mt-0.5 h-5 w-5 shrink-0\" />\n\t\t\t\t\t<div class=\"min-w-0\">\n\t\t\t\t\t\t<p class=\"text-sm font-medium\">Beta</p>\n\t\t\t\t\t\t<p class=\"text-muted-foreground mt-0.5 text-xs\">\n\t\t\t\t\t\t\tPre-release builds (npm <code class=\"font-mono\">beta</code>). Early features, less\n\t\t\t\t\t\t\ttested.\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</div>\n\t\t\t\t</label>\n\t\t\t</div>\n\n\t\t\t{#if selected === 'beta'}\n\t\t\t\t<Callout tone=\"warning\" class=\"mt-3\">\n\t\t\t\t\tBeta builds may be unstable. You can revert to Stable here at any time and run an update\n\t\t\t\t\tto roll back to the latest stable release.\n\t\t\t\t</Callout>\n\t\t\t{/if}\n\n\t\t\t<div class=\"mt-4 flex items-center gap-3\">\n\t\t\t\t<Button type=\"submit\" disabled={!dirty || saving || disabled}>\n\t\t\t\t\t{saving ? 'Saving…' : 'Save channel'}\n\t\t\t\t</Button>\n\t\t\t\t{#if dirty}\n\t\t\t\t\t<span class=\"text-muted-foreground text-xs\">\n\t\t\t\t\t\tSwitches to <span class=\"font-medium\">{selected === 'beta' ? 'Beta' : 'Stable'}</span> — run\n\t\t\t\t\t\tan update to apply.\n\t\t\t\t\t</span>\n\t\t\t\t{/if}\n\t\t\t</div>\n\t\t</form>\n\t</Card.Content>\n</Card.Root>\n","<script lang=\"ts\">\n\timport { Button, Callout, Card } from '@selvajs/ui';\n\timport { CircleCheck, TriangleAlert, CircleX, Minus, Stethoscope } from '@lucide/svelte';\n\n\ttype CheckStatus = 'ok' | 'degraded' | 'not_applicable' | 'error';\n\n\tinterface HealthCheck {\n\t\tid: string;\n\t\tlabel: string;\n\t\tstatus: CheckStatus;\n\t\tsummary: string;\n\t\tremediation?: string;\n\t}\n\n\tinterface HealthReport {\n\t\toverall: CheckStatus;\n\t\tcheckedAt: string;\n\t\tchecks: HealthCheck[];\n\t}\n\n\tlet running = $state(false);\n\tlet report = $state<HealthReport | null>(null);\n\tlet error = $state<string | null>(null);\n\n\tconst statusStyle: Record<\n\t\tCheckStatus,\n\t\t{ text: string; icon: typeof CircleCheck; label: string }\n\t> = {\n\t\tok: { text: 'text-success', icon: CircleCheck, label: 'OK' },\n\t\tdegraded: { text: 'text-warning', icon: TriangleAlert, label: 'Degraded' },\n\t\terror: { text: 'text-destructive', icon: CircleX, label: 'Error' },\n\t\tnot_applicable: { text: 'text-muted-foreground', icon: Minus, label: 'N/A' }\n\t};\n\n\tasync function runCheck() {\n\t\trunning = true;\n\t\terror = null;\n\t\ttry {\n\t\t\tconst res = await fetch('/api/admin/system/health', { cache: 'no-store' });\n\t\t\tif (!res.ok) {\n\t\t\t\terror = `Health check request failed (HTTP ${res.status}).`;\n\t\t\t\treport = null;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treport = (await res.json()) as HealthReport;\n\t\t} catch (err) {\n\t\t\terror = err instanceof Error ? err.message : 'Health check request failed.';\n\t\t\treport = null;\n\t\t} finally {\n\t\t\trunning = false;\n\t\t}\n\t}\n</script>\n\n<Card.Root>\n\t<Card.Header>\n\t\t<Card.Title class=\"text-sm font-medium\">System health</Card.Title>\n\t\t<Card.Description>\n\t\t\tTests the things that break solving: compute server keys, the database schema, whether the\n\t\t\tdefault compute server answers, whether the data folder is writable, and the reverse-proxy and\n\t\t\tupload-limit settings that fail silently at runtime. Runs the checks fresh each time — after\n\t\t\tfixing something, run it again to confirm. Config changes need a restart first.\n\t\t</Card.Description>\n\t</Card.Header>\n\t<Card.Content class=\"space-y-4\">\n\t\t<Button onclick={runCheck} disabled={running} variant=\"outline\">\n\t\t\t<Stethoscope class=\"mr-2 h-4 w-4 {running ? 'animate-pulse' : ''}\" />\n\t\t\t{running ? 'Checking…' : 'Run health check'}\n\t\t</Button>\n\n\t\t{#if error}\n\t\t\t<Callout tone=\"danger\">{error}</Callout>\n\t\t{/if}\n\n\t\t{#if report}\n\t\t\t{@const overall = statusStyle[report.overall]}\n\t\t\t{@const OverallIcon = overall.icon}\n\t\t\t<div class=\"space-y-3\">\n\t\t\t\t<div class=\"flex items-center gap-2 text-sm font-medium {overall.text}\">\n\t\t\t\t\t<OverallIcon class=\"h-5 w-5\" />\n\t\t\t\t\t<span>\n\t\t\t\t\t\t{report.overall === 'ok'\n\t\t\t\t\t\t\t? 'All checks passed'\n\t\t\t\t\t\t\t: report.overall === 'degraded'\n\t\t\t\t\t\t\t\t? 'Attention needed'\n\t\t\t\t\t\t\t\t: report.overall === 'error'\n\t\t\t\t\t\t\t\t\t? 'Check failed to run'\n\t\t\t\t\t\t\t\t\t: 'No applicable checks'}\n\t\t\t\t\t</span>\n\t\t\t\t\t<span class=\"text-muted-foreground ml-auto text-xs font-normal\">\n\t\t\t\t\t\t{new Date(report.checkedAt).toLocaleTimeString()}\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\n\t\t\t\t<div class=\"divide-y rounded-lg border\">\n\t\t\t\t\t{#each report.checks as check (check.id)}\n\t\t\t\t\t\t{@const style = statusStyle[check.status]}\n\t\t\t\t\t\t{@const Icon = style.icon}\n\t\t\t\t\t\t<div class=\"flex items-start gap-3 px-4 py-3\">\n\t\t\t\t\t\t\t<Icon class=\"mt-0.5 h-4 w-4 shrink-0 {style.text}\" />\n\t\t\t\t\t\t\t<div class=\"min-w-0 flex-1 space-y-1\">\n\t\t\t\t\t\t\t\t<div class=\"flex items-center justify-between gap-2\">\n\t\t\t\t\t\t\t\t\t<span class=\"text-sm font-medium\">{check.label}</span>\n\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\tclass=\"rounded-full border px-2 py-0.5 font-mono text-[10px] tracking-wide uppercase {style.text}\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{style.label}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<p class=\"text-muted-foreground text-xs\">{check.summary}</p>\n\t\t\t\t\t\t\t\t{#if check.remediation}\n\t\t\t\t\t\t\t\t\t<p class=\"text-foreground text-xs\">{check.remediation}</p>\n\t\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t{/each}\n\t\t\t\t</div>\n\n\t\t\t\t<p class=\"text-muted-foreground text-xs\">\n\t\t\t\t\tThis covers what the running app can see. Checks that need the host filesystem — that\n\t\t\t\t\t<span class=\"font-mono\">.env</span> and the pm2 boot unit are in place, that no migration\n\t\t\t\t\twas interrupted, that the signing keys are real keys and not the shipped placeholder —\n\t\t\t\t\tonly run from a shell on the server:\n\t\t\t\t\t<span class=\"text-foreground font-mono\">npx selva doctor</span>\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t{/if}\n\t</Card.Content>\n</Card.Root>\n","<script lang=\"ts\">\n\timport { Button, Card, FilterableDropdown } from '@selvajs/ui';\n\timport { ArrowDown, ArrowUp, Gauge } from '@lucide/svelte';\n\n\tinterface RunResult {\n\t\tdirection: 'download' | 'upload';\n\t\tmb: number;\n\t\tms: number;\n\t\tmbps: number;\n\t\t/** Upload only: the server's own receive-side measurement. */\n\t\tserverMbps?: number | null;\n\t\tat: string;\n\t}\n\n\tconst SIZES = [10, 25, 50, 100, 200] as const;\n\tlet sizeMb = $state<number>(25);\n\tlet running = $state<'download' | 'upload' | null>(null);\n\tlet error = $state<string | null>(null);\n\tlet results = $state<RunResult[]>([]);\n\n\tfunction record(result: RunResult) {\n\t\tresults = [result, ...results].slice(0, 8);\n\t}\n\n\t// Incompressible payload so proxy compression can't fake a fast upload.\n\t// crypto.getRandomValues caps at 64 KiB per call, so fill in slices. Returns\n\t// the raw ArrayBuffer — a directly valid fetch BodyInit.\n\tfunction randomBytes(totalBytes: number): ArrayBuffer {\n\t\tconst buffer = new ArrayBuffer(totalBytes);\n\t\tconst view = new Uint8Array(buffer);\n\t\tconst step = 65536;\n\t\tfor (let offset = 0; offset < totalBytes; offset += step) {\n\t\t\tcrypto.getRandomValues(view.subarray(offset, Math.min(offset + step, totalBytes)));\n\t\t}\n\t\treturn buffer;\n\t}\n\n\tasync function runDownload() {\n\t\trunning = 'download';\n\t\terror = null;\n\t\ttry {\n\t\t\tconst start = performance.now();\n\t\t\tconst res = await fetch(`/api/admin/system/throughput?mb=${sizeMb}`, {\n\t\t\t\tcache: 'no-store'\n\t\t\t});\n\t\t\tif (!res.ok || !res.body) {\n\t\t\t\terror = `Download test failed (HTTP ${res.status}).`;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Stream-read so we measure arrival, not a buffered copy at the end.\n\t\t\tconst reader = res.body.getReader();\n\t\t\tlet bytes = 0;\n\t\t\twhile (true) {\n\t\t\t\tconst { done, value } = await reader.read();\n\t\t\t\tif (done) break;\n\t\t\t\tbytes += value.byteLength;\n\t\t\t}\n\t\t\tconst ms = performance.now() - start;\n\t\t\trecord({\n\t\t\t\tdirection: 'download',\n\t\t\t\tmb: bytes / (1024 * 1024),\n\t\t\t\tms: Math.round(ms),\n\t\t\t\tmbps: bytes / (1024 * 1024) / (ms / 1000),\n\t\t\t\tat: new Date().toLocaleTimeString()\n\t\t\t});\n\t\t} catch (err) {\n\t\t\terror = err instanceof Error ? err.message : 'Download test failed.';\n\t\t} finally {\n\t\t\trunning = null;\n\t\t}\n\t}\n\n\tasync function runUpload() {\n\t\trunning = 'upload';\n\t\terror = null;\n\t\ttry {\n\t\t\tconst body = randomBytes(sizeMb * 1024 * 1024);\n\t\t\tconst start = performance.now();\n\t\t\tconst res = await fetch('/api/admin/system/throughput', {\n\t\t\t\tmethod: 'POST',\n\t\t\t\theaders: { 'Content-Type': 'application/octet-stream' },\n\t\t\t\tbody\n\t\t\t});\n\t\t\tconst ms = performance.now() - start;\n\t\t\tif (!res.ok) {\n\t\t\t\terror =\n\t\t\t\t\tres.status === 413\n\t\t\t\t\t\t? `Upload rejected (HTTP 413) — a body-size limit in the chain is below ${sizeMb} MB ` +\n\t\t\t\t\t\t\t`(adapter-node BODY_SIZE_LIMIT, or a proxy request cap).`\n\t\t\t\t\t\t: `Upload test failed (HTTP ${res.status}).`;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst server = (await res.json()) as { mbps: number | null };\n\t\t\trecord({\n\t\t\t\tdirection: 'upload',\n\t\t\t\tmb: sizeMb,\n\t\t\t\tms: Math.round(ms),\n\t\t\t\tmbps: sizeMb / (ms / 1000),\n\t\t\t\tserverMbps: server.mbps,\n\t\t\t\tat: new Date().toLocaleTimeString()\n\t\t\t});\n\t\t} catch (err) {\n\t\t\terror = err instanceof Error ? err.message : 'Upload test failed.';\n\t\t} finally {\n\t\t\trunning = null;\n\t\t}\n\t}\n</script>\n\n<Card.Root>\n\t<Card.Header>\n\t\t<Card.Title class=\"text-sm font-medium\">Network throughput</Card.Title>\n\t\t<Card.Description>\n\t\t\tTransfers incompressible random data between this browser and the server — through every\n\t\t\tproxy/tunnel on the path — to measure real transport speed in each direction. No compute\n\t\t\tinvolvement; large solve transfers can't go faster than these numbers.\n\t\t</Card.Description>\n\t</Card.Header>\n\t<Card.Content class=\"space-y-4\">\n\t\t<div class=\"flex flex-wrap items-center gap-2\">\n\t\t\t<label class=\"text-muted-foreground text-sm\" for=\"throughput-size\">Test size</label>\n\t\t\t<FilterableDropdown\n\t\t\t\tid=\"throughput-size\"\n\t\t\t\titems={SIZES.map((size) => ({ id: String(size), label: `${size} MB` }))}\n\t\t\t\tvalue={String(sizeMb)}\n\t\t\t\tonChange={(v) => (sizeMb = Number(v))}\n\t\t\t\tdisabled={running !== null}\n\t\t\t\tsize=\"sm\"\n\t\t\t\tclass=\"w-28\"\n\t\t\t/>\n\t\t\t<Button size=\"sm\" variant=\"outline\" onclick={runDownload} disabled={running !== null}>\n\t\t\t\t<ArrowDown class=\"mr-1 size-4\" />\n\t\t\t\t{running === 'download' ? 'Downloading…' : 'Download test'}\n\t\t\t</Button>\n\t\t\t<Button size=\"sm\" variant=\"outline\" onclick={runUpload} disabled={running !== null}>\n\t\t\t\t<ArrowUp class=\"mr-1 size-4\" />\n\t\t\t\t{running === 'upload' ? 'Uploading…' : 'Upload test'}\n\t\t\t</Button>\n\t\t</div>\n\n\t\t{#if error}\n\t\t\t<p class=\"text-destructive text-sm\">{error}</p>\n\t\t{/if}\n\n\t\t{#if results.length > 0}\n\t\t\t<ul class=\"space-y-1\">\n\t\t\t\t{#each results as r (r.at + r.direction + r.ms)}\n\t\t\t\t\t<li class=\"flex items-center gap-2 font-mono text-sm\">\n\t\t\t\t\t\t<Gauge class=\"text-muted-foreground size-4\" />\n\t\t\t\t\t\t<span class=\"text-muted-foreground\">{r.at}</span>\n\t\t\t\t\t\t<span>{r.direction === 'download' ? '↓' : '↑'} {r.mb.toFixed(0)} MB</span>\n\t\t\t\t\t\t<span class=\"font-semibold\">{r.mbps.toFixed(1)} MB/s</span>\n\t\t\t\t\t\t<span class=\"text-muted-foreground\">({(r.ms / 1000).toFixed(1)}s)</span>\n\t\t\t\t\t\t{#if r.serverMbps != null}\n\t\t\t\t\t\t\t<span class=\"text-muted-foreground\">· server-side {r.serverMbps.toFixed(1)} MB/s</span\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t{/if}\n\t\t\t\t\t</li>\n\t\t\t\t{/each}\n\t\t\t</ul>\n\t\t{/if}\n\t</Card.Content>\n</Card.Root>\n","<script lang=\"ts\">\n\timport { Callout, Search, Switch } from '@selvajs/ui';\n\timport { Check, ChevronRight, Copy } from '@lucide/svelte';\n\timport type {\n\t\tConfigChange,\n\t\tConfigReport,\n\t\tKeyRotation,\n\t\tReportRow\n\t} from '@selvajs/platform/config';\n\timport type { ConfigCheck } from '#lib/server/config/checks.js';\n\n\tlet {\n\t\treport,\n\t\tchanges,\n\t\trotation,\n\t\tproxied,\n\t\tchecks\n\t}: {\n\t\treport: ConfigReport;\n\t\tchanges: ConfigChange[];\n\t\trotation: KeyRotation[];\n\t\tproxied: boolean;\n\t\tchecks: ConfigCheck[];\n\t} = $props();\n\n\tconst problems = $derived(checks.filter((c) => c.level !== 'info'));\n\tconst notes = $derived(checks.filter((c) => c.level === 'info'));\n\tconst flagged = $derived(new Set(problems.flatMap((c) => c.keys)));\n\n\tconst rotating = $derived(\n\t\tnew Set(rotation.filter((r) => r.state !== 'none').map((r) => `${r.key}_PREVIOUS`))\n\t);\n\tconst PROXY_KEYS = ['ADDRESS_HEADER', 'XFF_DEPTH'];\n\n\t// Each group answers one question an admin has. A row a group doesn't show (an idle rotation\n\t// slot, proxy headers without a proxy) still appears under \"All settings\".\n\tconst groups = $derived.by(() => {\n\t\tconst byKey = new Map(report.rows.map((r) => [r.key, r]));\n\t\tconst pick = (keys: string[]) => keys.flatMap((k) => byKey.get(k) ?? []);\n\t\treturn [\n\t\t\t{\n\t\t\t\ttitle: 'Reaching your server',\n\t\t\t\trows: pick([\n\t\t\t\t\t'ORIGIN',\n\t\t\t\t\t'HOST',\n\t\t\t\t\t'BODY_SIZE_LIMIT',\n\t\t\t\t\t...PROXY_KEYS.filter((k) => proxied || (byKey.get(k)?.source ?? 'unset') !== 'unset')\n\t\t\t\t])\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: 'Where data lives',\n\t\t\t\trows: pick([\n\t\t\t\t\t'SELVA_DATA_PROVIDER',\n\t\t\t\t\t'SELVA_STORAGE_PROVIDER',\n\t\t\t\t\t'DATA_PATH',\n\t\t\t\t\t'SUPABASE_URL',\n\t\t\t\t\t'SELVA_TENANCY'\n\t\t\t\t])\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: 'Sign-in',\n\t\t\t\trows: pick([\n\t\t\t\t\t'SELVA_AUTH_PROVIDER',\n\t\t\t\t\t'SIGN_IN_MAX_AGE_DAYS',\n\t\t\t\t\t'BOOTSTRAP_INSTANCE_ADMIN_EMAIL'\n\t\t\t\t])\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: 'Security keys',\n\t\t\t\trows: pick(\n\t\t\t\t\t[\n\t\t\t\t\t\t'SELVA_HMAC_KEY',\n\t\t\t\t\t\t'SELVA_HMAC_KEY_PREVIOUS',\n\t\t\t\t\t\t'SELVA_AT_REST_KEY',\n\t\t\t\t\t\t'SELVA_AT_REST_KEY_PREVIOUS'\n\t\t\t\t\t].filter((k) => !k.endsWith('_PREVIOUS') || rotating.has(k))\n\t\t\t\t)\n\t\t\t}\n\t\t].filter((g) => g.rows.length > 0);\n\t});\n\n\tlet showUntouched = $state(false);\n\tlet allOpen = $state(false);\n\tconst isConfigured = (r: ReportRow) =>\n\t\t!!r.problem || (r.source !== 'unset' && r.source !== 'default');\n\tconst untouchedCount = $derived(report.rows.filter((r) => !isConfigured(r)).length);\n\tconst allRows = $derived(showUntouched ? report.rows : report.rows.filter(isConfigured));\n\n\tlet query = $state('');\n\tconst matches = $derived.by(() => {\n\t\tconst q = query.trim().toLowerCase();\n\t\tif (!q) return [];\n\t\treturn report.rows.filter((r) =>\n\t\t\t[r.key, r.label ?? '', r.description, r.display].some((s) => s.toLowerCase().includes(q))\n\t\t);\n\t});\n\n\t// ==========================================================================\n\t// Values as meaning\n\t// ==========================================================================\n\n\ttype Shown = {\n\t\ttext: string;\n\t\ttone: 'value' | 'muted' | 'ok' | 'bad';\n\t\tmono: boolean;\n\t\ttitle?: string;\n\t};\n\n\tfunction shown(r: ReportRow): Shown {\n\t\tif (r.source === 'unset') {\n\t\t\treturn r.required\n\t\t\t\t? { text: 'Missing', tone: 'bad', mono: false }\n\t\t\t\t: { text: 'Not set', tone: 'muted', mono: false };\n\t\t}\n\t\tif (r.display === 'set' || r.display.startsWith('sha256:')) {\n\t\t\t// A fingerprint tells two servers' keys apart; it isn't something to read.\n\t\t\treturn {\n\t\t\t\ttext: 'Set',\n\t\t\t\ttone: 'ok',\n\t\t\t\tmono: false,\n\t\t\t\ttitle: r.display === 'set' ? undefined : r.display\n\t\t\t};\n\t\t}\n\t\tif (r.type === 'bool') {\n\t\t\tconst on = ['true', '1', 'yes', 'on'].includes(r.display.toLowerCase());\n\t\t\treturn { text: on ? 'On' : 'Off', tone: on ? 'ok' : 'muted', mono: false };\n\t\t}\n\t\tif (r.type === 'list' && r.display === '') return { text: 'None', tone: 'muted', mono: false };\n\t\tif (r.type === 'int') {\n\t\t\tconst n = Number(r.display);\n\t\t\tif (n === 0 && r.zero) return { text: r.zero, tone: 'muted', mono: false };\n\t\t\tif (Number.isFinite(n) && r.unit)\n\t\t\t\treturn { text: withUnit(n, r.unit), tone: 'value', mono: false, title: r.display };\n\t\t}\n\t\treturn { text: r.display || '—', tone: 'value', mono: true, title: r.display };\n\t}\n\n\tfunction withUnit(n: number, unit: NonNullable<ReportRow['unit']>): string {\n\t\tif (unit === 'days') return `${n} ${n === 1 ? 'day' : 'days'}`;\n\t\tif (unit === 'mb') return n >= 1024 ? `${+(n / 1024).toFixed(1)} GB` : `${n} MB`;\n\t\tif (unit === 'bytes') {\n\t\t\tif (n >= 1024 ** 3) return `${+(n / 1024 ** 3).toFixed(1)} GB`;\n\t\t\tif (n >= 1024 ** 2) return `${+(n / 1024 ** 2).toFixed(1)} MB`;\n\t\t\treturn n >= 1024 ? `${Math.round(n / 1024)} KB` : `${n} B`;\n\t\t}\n\t\tif (n >= 3_600_000) return `${+(n / 3_600_000).toFixed(1)} h`;\n\t\tif (n >= 60_000) return `${+(n / 60_000).toFixed(1)} min`;\n\t\tif (n >= 1000) return `${+(n / 1000).toFixed(1)} s`;\n\t\treturn `${n} ms`;\n\t}\n\n\tfunction sourceLabel(r: ReportRow): string {\n\t\tif (r.source === 'default') return 'default';\n\t\tif (r.source === 'alias') return `from ${r.alias}`;\n\t\treturn 'set in .env';\n\t}\n\n\tconst TONE: Record<Shown['tone'], string> = {\n\t\tvalue: 'bg-muted text-foreground',\n\t\tmuted: 'text-muted-foreground',\n\t\tok: 'text-success',\n\t\tbad: 'bg-destructive/10 text-destructive'\n\t};\n\n\tconst ROTATE: Record<string, { name: string; arg: string; breaks: string }> = {\n\t\tSELVA_HMAC_KEY: {\n\t\t\tname: 'signing key',\n\t\t\targ: 'hmac',\n\t\t\tbreaks: 'Sessions, links and tokens signed with the old key keep working for 30 days.'\n\t\t},\n\t\tSELVA_AT_REST_KEY: {\n\t\t\tname: 'encryption key',\n\t\t\targ: 'at-rest',\n\t\t\tbreaks: 'Stored compute API keys are re-encrypted with the new key when the app restarts.'\n\t\t}\n\t};\n\n\tlet copied = $state<string | null>(null);\n\tasync function copy(text: string) {\n\t\tawait navigator.clipboard.writeText(text);\n\t\tcopied = text;\n\t\tsetTimeout(() => {\n\t\t\tif (copied === text) copied = null;\n\t\t}, 1500);\n\t}\n</script>\n\n{#snippet commands(lines: string[])}\n\t<div class=\"bg-muted mt-2 flex items-start gap-2 rounded-md px-3 py-2\">\n\t\t<pre\n\t\t\tclass=\"text-foreground min-w-0 flex-1 overflow-x-auto font-mono text-xs leading-relaxed\">{lines.join(\n\t\t\t\t'\\n'\n\t\t\t)}</pre>\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tclass=\"text-faint-foreground hover:text-foreground hover:bg-hover -m-1 shrink-0 rounded-sm p-1\"\n\t\t\taria-label=\"Copy commands\"\n\t\t\tonclick={() => copy(lines.join('\\n'))}\n\t\t>\n\t\t\t{#if copied === lines.join('\\n')}<Check class=\"size-3.5\" />{:else}<Copy\n\t\t\t\t\tclass=\"size-3.5\"\n\t\t\t\t/>{/if}\n\t\t</button>\n\t</div>\n{/snippet}\n\n{#snippet configRow(row: ReportRow)}\n\t{@const v = shown(row)}\n\t<div class=\"px-4 py-3\">\n\t\t<div class=\"flex items-start justify-between gap-4\">\n\t\t\t<div class=\"min-w-0 flex-1\">\n\t\t\t\t<p class=\"text-foreground flex items-center gap-1.5 text-sm leading-snug font-medium\">\n\t\t\t\t\t{#if flagged.has(row.key)}\n\t\t\t\t\t\t<span class=\"bg-warning size-1.5 shrink-0 rounded-full\" aria-label=\"Needs attention\"\n\t\t\t\t\t\t></span>\n\t\t\t\t\t{/if}\n\t\t\t\t\t{row.label ?? row.key}\n\t\t\t\t</p>\n\t\t\t\t<p class=\"text-muted-foreground mt-0.5 text-xs leading-snug\">{row.description}</p>\n\t\t\t\t<code class=\"text-faint-foreground text-2xs mt-1 block font-mono\">{row.key}</code>\n\t\t\t\t{#if row.problem}\n\t\t\t\t\t<p class=\"text-destructive mt-1 text-xs\">Value {row.problem}.</p>\n\t\t\t\t{/if}\n\t\t\t</div>\n\t\t\t<div class=\"flex shrink-0 flex-col items-end gap-1\">\n\t\t\t\t<span\n\t\t\t\t\tclass={`max-w-64 truncate rounded-sm px-2 py-0.5 text-xs ${v.mono ? 'font-mono' : 'font-medium'} ${TONE[v.tone]}`}\n\t\t\t\t\ttitle={v.title}\n\t\t\t\t>\n\t\t\t\t\t{#if v.tone === 'ok' && v.text === 'Set'}<Check\n\t\t\t\t\t\t\tclass=\"mr-0.5 inline size-3 align-[-2px]\"\n\t\t\t\t\t\t/>{/if}{v.text}\n\t\t\t\t</span>\n\t\t\t\t{#if row.source !== 'unset'}\n\t\t\t\t\t<span class=\"text-faint-foreground text-2xs\">{sourceLabel(row)}</span>\n\t\t\t\t{/if}\n\t\t\t</div>\n\t\t</div>\n\t\t{#if ROTATE[row.key]}\n\t\t\t{@const r = ROTATE[row.key]}\n\t\t\t<details class=\"group mt-2\">\n\t\t\t\t<summary\n\t\t\t\t\tclass=\"text-muted-foreground hover:text-foreground flex w-fit cursor-pointer items-center gap-1 text-xs select-none\"\n\t\t\t\t>\n\t\t\t\t\t<ChevronRight class=\"size-3 transition-transform group-open:rotate-90\" />\n\t\t\t\t\tChange the {r.name}\n\t\t\t\t</summary>\n\t\t\t\t<div class=\"text-muted-foreground mt-2 space-y-1 pl-4 text-xs\">\n\t\t\t\t\t<p>\n\t\t\t\t\t\tDo this if the key may have leaked, or as routine hygiene. On the server, in the install\n\t\t\t\t\t\tfolder, run:\n\t\t\t\t\t</p>\n\t\t\t\t\t{@render commands([`npx selva keys rotate ${r.arg}`, 'npx selva restart'])}\n\t\t\t\t\t<p class=\"pt-1\">\n\t\t\t\t\t\t{r.breaks} If the old key leaked and must stop working now, use\n\t\t\t\t\t\t<code class=\"font-mono\">--leaked</code> instead; that signs everyone out.\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t</details>\n\t\t{/if}\n\t</div>\n{/snippet}\n\n<div class=\"space-y-6\">\n\t<section class=\"space-y-2\">\n\t\t{#if problems.length === 0}\n\t\t\t<Callout tone=\"success\" title=\"Nothing needs your attention\">\n\t\t\t\tEvery setting this server reads has a usable value.\n\t\t\t</Callout>\n\t\t{/if}\n\t\t{#each [...problems, ...notes] as c (c.id)}\n\t\t\t<Callout\n\t\t\t\ttone={c.level === 'error' ? 'danger' : c.level === 'warning' ? 'warning' : 'info'}\n\t\t\t\ttitle={c.title}\n\t\t\t>\n\t\t\t\t<p>{c.detail}</p>\n\t\t\t\t{#if c.fix}\n\t\t\t\t\t<p class=\"pt-1\">To fix it, run on the server:</p>\n\t\t\t\t\t{@render commands(c.fix)}\n\t\t\t\t{/if}\n\t\t\t</Callout>\n\t\t{/each}\n\t</section>\n\n\t{#if changes.length > 0}\n\t\t<div class=\"space-y-1 rounded-lg border px-4 py-3 text-xs\">\n\t\t\t<p class=\"font-medium\">Changed since the last start</p>\n\t\t\t{#each changes as c (c.key)}\n\t\t\t\t<p class=\"text-muted-foreground\">\n\t\t\t\t\t<code class=\"text-foreground font-mono\">{c.key}</code>\n\t\t\t\t\t{#if c.change === 'added'}set{c.to !== undefined ? ` to ${c.to}` : ''}\n\t\t\t\t\t{:else if c.change === 'removed'}removed{c.from !== undefined ? ` (was ${c.from})` : ''}\n\t\t\t\t\t{:else if c.from !== undefined}{c.from} → {c.to}\n\t\t\t\t\t{:else}changed{/if}\n\t\t\t\t</p>\n\t\t\t{/each}\n\t\t</div>\n\t{/if}\n\n\t<Search bind:value={query} clearable placeholder=\"Search {report.rows.length} settings\" />\n\n\t{#if query.trim()}\n\t\t<div class=\"divide-y rounded-lg border\">\n\t\t\t{#each matches as row (row.key)}\n\t\t\t\t{@render configRow(row)}\n\t\t\t{:else}\n\t\t\t\t<p class=\"text-muted-foreground px-4 py-6 text-center text-sm\">No setting matches.</p>\n\t\t\t{/each}\n\t\t</div>\n\t{:else}\n\t\t{#each groups as group (group.title)}\n\t\t\t<section class=\"space-y-2.5\">\n\t\t\t\t<h3 class=\"text-foreground flex items-baseline gap-2 text-sm font-semibold\">\n\t\t\t\t\t{group.title}\n\t\t\t\t\t{#if group.title === 'Reaching your server'}\n\t\t\t\t\t\t<span class=\"text-muted-foreground text-xs font-normal\">\n\t\t\t\t\t\t\t{proxied\n\t\t\t\t\t\t\t\t? 'This request came through a reverse proxy.'\n\t\t\t\t\t\t\t\t: 'This request reached the app directly, without a proxy.'}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t{/if}\n\t\t\t\t</h3>\n\t\t\t\t<div class=\"divide-y rounded-lg border\">\n\t\t\t\t\t{#each group.rows as row (row.key)}\n\t\t\t\t\t\t{@render configRow(row)}\n\t\t\t\t\t{/each}\n\t\t\t\t</div>\n\t\t\t</section>\n\t\t{/each}\n\n\t\t<details class=\"group rounded-lg border\" bind:open={allOpen}>\n\t\t\t<summary\n\t\t\t\tclass=\"hover:bg-hover flex cursor-pointer items-center gap-2 rounded-lg px-4 py-3 text-sm font-semibold select-none\"\n\t\t\t>\n\t\t\t\t<ChevronRight class=\"size-4 shrink-0 transition-transform group-open:rotate-90\" />\n\t\t\t\tAll settings\n\t\t\t\t<span class=\"text-muted-foreground text-xs font-normal\"\n\t\t\t\t\t>for fine-tuning; most never need changing</span\n\t\t\t\t>\n\t\t\t\t<span class=\"text-muted-foreground ml-auto font-mono text-xs\">{report.rows.length}</span>\n\t\t\t</summary>\n\t\t\t{#if allOpen}\n\t\t\t\t<div class=\"border-t\">\n\t\t\t\t\t{#if untouchedCount > 0}\n\t\t\t\t\t\t<label\n\t\t\t\t\t\t\tclass=\"text-muted-foreground flex cursor-pointer items-center gap-2 border-b px-4 py-2.5 text-xs\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Switch bind:checked={showUntouched} />\n\t\t\t\t\t\t\tInclude {untouchedCount} settings left at their default or unset\n\t\t\t\t\t\t</label>\n\t\t\t\t\t{/if}\n\t\t\t\t\t<div class=\"divide-y\">\n\t\t\t\t\t\t{#each allRows as row (row.key)}\n\t\t\t\t\t\t\t{@render configRow(row)}\n\t\t\t\t\t\t{/each}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t{/if}\n\t\t</details>\n\t{/if}\n</div>\n","// ============================================================================\n// Restart-wait polling\n// ============================================================================\n//\n// After the update runner is daemonized, the SSE stream dies at `pm2 stop` and\n// the browser's only remaining view of the update is polling. This module owns\n// that poll loop, kept separate from the admin page so its inputs (three probe\n// results and a clock) and output (a verdict) stay testable with the clock and\n// probes injected — a 5-minute deadline runs in microseconds.\n//\n// **Every probe MUST settle.** The loop awaits `Promise.all` of the three, so a\n// probe that hangs forever hangs the loop, deadline or not. A probe against a\n// stopped app usually does NOT fail fast — the reverse proxy in front of it\n// holds the connection open until its own read timeout rather than refusing\n// it. Bounding that is the caller's job (`AbortSignal.timeout` on each fetch);\n// without it the UI freezes on \"PM2 is restarting…\" until a manual reload.\n\nexport interface RestartHealth {\n\tstatus: string;\n\tinstanceId?: string | null;\n\tversion?: string | null;\n}\n\n/**\n * The three probes the loop runs each tick. Each resolves to a \"nothing yet\"\n * value rather than rejecting — a failed probe during the restart blackout is\n * the expected case, not an error.\n */\nexport interface RestartProbes {\n\t/**\n\t * /api/health — null when unreachable or still booting. A 503 `degraded`\n\t * body still counts as reachable: the process is up and answering.\n\t */\n\thealth(): Promise<RestartHealth | null>;\n\t/** The tee'd update log file — null when the fetch failed. */\n\tlog(): Promise<string | null>;\n\t/** The heavier readiness route — true only on a real 200. */\n\tready(): Promise<boolean>;\n}\n\nexport interface PollDeps {\n\tprobes: RestartProbes;\n\tnow(): number;\n\tsleep(ms: number): Promise<void>;\n\t/** Replaces the displayed log content. */\n\tonLog(logs: string): void;\n\t/** Appends one line — the waiting notice, the timeout notice. */\n\tappendLog(line: string): void;\n}\n\nexport interface RestartVerdict {\n\texitCode: number;\n}\n\n/** Must match `TIMED_OUT` in update-outcome.ts. */\nconst NEVER_CAME_BACK = -2;\n\n/** How long to give PM2 to actually kill the old process before polling. */\nexport const SETTLE_MS = 2000;\n/** Gap between poll ticks. */\nexport const POLL_INTERVAL_MS = 2000;\n/**\n * npm update on a slow VPS with a cold packument cache plus a pm2 cold start\n * can legitimately take 60–90s; an earlier 90s deadline was failing live\n * updates that were otherwise succeeding in the background.\n */\nexport const RESTART_DEADLINE_MS = 5 * 60 * 1000;\n\n/**\n * The health poll only proves the app is *reachable* — NOT that the update\n * succeeded. A rollback (runner exit 5) leaves the app perfectly healthy on\n * the OLD version; reporting that as exit 0 would tell the operator the\n * update worked. So this reads the runner's own verdict out of the log.\n *\n * Returns null when the log carries no terminal marker yet.\n */\nexport function exitCodeFromLog(log: string): number | null {\n\tif (/\\bManual recovery required\\b/.test(log)) return 6; // rollback failed — app may be DOWN\n\tif (/\\bRolled back to .* — previous version is online\\b/.test(log)) return 5; // safe rollback\n\tif (/New process failed health check/.test(log) && !/Rolled back/.test(log)) return 3;\n\tif (/\\[FATAL\\]/.test(log) && !/\\[DONE\\]/.test(log)) return 1; // fatal with no clean finish\n\tif (/\\[DONE\\]/.test(log)) return 0; // runner reported clean completion\n\treturn null;\n}\n\n/**\n * Polls until the *new* process is confirmed serving, or the deadline passes.\n *\n * The reliable signal is `instanceId`: a per-boot fingerprint from /api/health\n * that changes on every restart. We wait for it to differ from the process\n * running before we started — the only moment we know the old process is gone\n * and a fresh one is answering. Works in every deployment shape (npm has no\n * git commit) and even when the new build is the same version.\n *\n * A fresh instanceId alone is not treated as done: /api/health answers the\n * instant the process boots, a beat before real routes serve through the\n * proxy, so a premature \"online\" verdict left an immediate reload hitting a\n * 502. The heavier readiness probe closes that gap as an *accelerator*, never\n * a requirement — it re-runs live integrity checks per request, so it reports\n * false whenever an unrelated dependency is down, and can outrun the caller's\n * probe timeout on a slow host. So the loop finishes on either signal:\n * readiness going green, or the runner writing its own terminal marker to the\n * log. Requiring both is what hung a *successful* update on \"PM2 is\n * restarting…\" until the deadline turned it into a false failure.\n */\nexport async function pollForRestart(\n\tpreviousInstanceId: string | null | undefined,\n\tdeps: PollDeps\n): Promise<RestartVerdict> {\n\tconst { probes, now, sleep, onLog, appendLog } = deps;\n\n\tappendLog('\\nWaiting for app to come back online…\\n');\n\tawait sleep(SETTLE_MS);\n\n\t// A deadline, not an attempt count: a slow probe costs real seconds instead\n\t// of returning instantly, so N attempts × interval understates wall-clock.\n\tconst deadline = now() + RESTART_DEADLINE_MS;\n\n\t// Mirrors what the caller displays, so the log-derived verdict sees the\n\t// same content the operator does.\n\tlet logs = '';\n\n\twhile (now() < deadline) {\n\t\tconst [health, log, ready] = await Promise.all([probes.health(), probes.log(), probes.ready()]);\n\n\t\t// Empty bodies are ignored — the file isn't there yet, and clobbering the\n\t\t// SSE-collected prefix with nothing would lose it.\n\t\tif (log && log.trim().length > 0) {\n\t\t\tlogs = log;\n\t\t\tonLog(log);\n\t\t}\n\n\t\tconst logVerdict = exitCodeFromLog(logs);\n\t\tconst freshInstance = !!health?.instanceId && health.instanceId !== previousInstanceId;\n\n\t\t// Trust the runner's logged verdict over a bare assumption of success — a\n\t\t// rollback also brings up a fresh process but must not read as a clean\n\t\t// update.\n\t\tif (freshInstance && ready) {\n\t\t\treturn { exitCode: logVerdict ?? 0 };\n\t\t}\n\n\t\t// A fresh process is answering AND the runner wrote its terminal marker,\n\t\t// but the heavy readiness route hasn't gone green. Readiness is a\n\t\t// *quality* signal, not a liveness one — it stays false whenever an\n\t\t// unrelated dependency is down (an unreachable compute server is the\n\t\t// common one) and can outrun the caller's probe timeout on a slow host.\n\t\t// Requiring it here is what left a finished update spinning on \"PM2 is\n\t\t// restarting…\" until the deadline reported a false failure. The runner's\n\t\t// own marker is the authority on whether the update finished.\n\t\tif (freshInstance && logVerdict !== null) {\n\t\t\treturn { exitCode: logVerdict };\n\t\t}\n\n\t\t// No-restart terminal: the runner reached a verdict WITHOUT bringing up a\n\t\t// new process — the pre-flight \"already up to date\" path exits before\n\t\t// `pm2 stop`, and an early failure aborts while the old process still\n\t\t// serves. In both cases instanceId never changes, so the fresh-instance\n\t\t// branches can never fire and keying on them alone would wait out the\n\t\t// full deadline. When the app is reachable on the SAME instanceId and the\n\t\t// log carries a terminal marker, that marker IS the outcome.\n\t\tif (logVerdict !== null && health && health.instanceId === previousInstanceId) {\n\t\t\treturn { exitCode: logVerdict };\n\t\t}\n\n\t\t// No baseline instanceId (the pre-update health fetch failed, or an old\n\t\t// build with no fingerprint): can't tell the new process from the old one\n\t\t// by id, so hold out for the runner's own terminal marker rather than\n\t\t// latching onto the still-running old process.\n\t\tif (!previousInstanceId && health && logVerdict !== null) {\n\t\t\treturn { exitCode: logVerdict };\n\t\t}\n\n\t\tawait sleep(POLL_INTERVAL_MS);\n\t}\n\n\t// Final fetch so the post-mortem carries the latest content the script\n\t// managed to write before the deadline.\n\tconst finalLog = await probes.log();\n\tif (finalLog && finalLog.trim().length > 0) onLog(finalLog);\n\tappendLog('\\n⚠ App did not come back within 5 minutes — check PM2 logs.\\n');\n\treturn { exitCode: NEVER_CAME_BACK };\n}\n","<script lang=\"ts\">\n\timport { page } from '$app/state';\n\timport { replaceState } from '$app/navigation';\n\timport { Card, SectionHeader, Tabs } from '@selvajs/ui';\n\timport { ChevronRight } from '@lucide/svelte';\n\timport UpdateSection from './UpdateSection.svelte';\n\timport ChannelSection from './ChannelSection.svelte';\n\timport HealthSection from './HealthSection.svelte';\n\timport NetworkSection from './NetworkSection.svelte';\n\timport ConfigSection from './ConfigSection.svelte';\n\timport type { ConfigChange, ConfigReport, KeyRotation } from '@selvajs/platform/config';\n\timport type { ConfigCheck } from '#lib/server/config/checks.js';\n\timport { pollForRestart, type RestartHealth } from '#lib/update-restart-poll.js';\n\n\tinterface PageData {\n\t\tcanManageUpdates: boolean;\n\t\tisInstanceAdmin: boolean;\n\t\tversion: string;\n\t\tchannel: 'stable' | 'beta';\n\t\tupdate: {\n\t\t\tlatest: string | null;\n\t\t\tupdateAvailable: boolean;\n\t\t\tnodeCompatibility: { compatible: boolean | null; required: string | null; running: string };\n\t\t};\n\t\tconfig: {\n\t\t\treport: ConfigReport;\n\t\t\tchanges: ConfigChange[];\n\t\t\trotation: KeyRotation[];\n\t\t\tproxied: boolean;\n\t\t\tchecks: ConfigCheck[];\n\t\t} | null;\n\t\tflags: {\n\t\t\tALLOW_CROSS_ORG_PUBLIC: boolean;\n\t\t\tALLOW_ORG_COMPUTE_OVERRIDE: boolean;\n\t\t\tALLOW_ORG_CREATION: boolean;\n\t\t\tENABLE_PLATFORM_PROJECTS: boolean;\n\t\t\tENABLE_SHARING: boolean;\n\t\t};\n\t\tlimits: {\n\t\t\tRATE_LIMIT_WINDOW_MS: number;\n\t\t\tRATE_LIMIT_MAX_REQUESTS: number;\n\t\t\tMAX_DEFINITION_FILE_SIZE: number;\n\t\t\tMAX_IMAGE_FILE_SIZE: number;\n\t\t\tCOMPUTE_REQUEST_MAX_BYTES: number;\n\t\t\tCOMPUTE_RESPONSE_MAX_BYTES: number;\n\t\t\tREMOTE_DEFINITION_MAX_BYTES: number;\n\t\t\tREMOTE_DEFINITION_FETCH_TIMEOUT_MS: number;\n\t\t\tREMOTE_DEFINITION_CACHE_TTL_MS: number;\n\t\t\tCOMPUTE_DEFINITION_CACHE_BYTES: number;\n\t\t\tCOMPUTE_SOLVE_CACHE_BYTES: number;\n\t\t};\n\t}\n\tlet { data }: { data: PageData } = $props();\n\n\t// One tab per concern instead of one long page. The tab lives in `?tab=` so a link or a\n\t// reload lands on the same one.\n\tconst tabs = $derived(\n\t\t[\n\t\t\t{ id: 'updates', label: 'Updates', show: data.canManageUpdates },\n\t\t\t{ id: 'health', label: 'Health & network', show: data.isInstanceAdmin },\n\t\t\t{ id: 'config', label: 'Configuration', show: true }\n\t\t].filter((t) => t.show)\n\t);\n\tlet requestedTab = $state(page.url.searchParams.get('tab'));\n\tconst activeTab = $derived(\n\t\ttabs.find((t) => t.id === requestedTab)?.id ?? tabs[0]?.id ?? 'config'\n\t);\n\n\tfunction selectTab(id: string) {\n\t\trequestedTab = id;\n\t\tconst url = new URL(page.url.href);\n\t\turl.searchParams.set('tab', id);\n\t\treplaceState(url, page.state);\n\t}\n\n\tfunction formatBytes(bytes: number): string {\n\t\tif (bytes >= 1024 * 1024 * 1024) return `${(bytes / (1024 * 1024 * 1024)).toFixed(1)} GB`;\n\t\tif (bytes >= 1024 * 1024) return `${Math.round(bytes / (1024 * 1024))} MB`;\n\t\tif (bytes >= 1024) return `${Math.round(bytes / 1024)} KB`;\n\t\treturn `${bytes} B`;\n\t}\n\n\tfunction formatMs(ms: number): string {\n\t\tif (ms >= 60_000) {\n\t\t\tconst mins = ms / 60_000;\n\t\t\treturn `${Number.isInteger(mins) ? mins : mins.toFixed(1)} min`;\n\t\t}\n\t\tif (ms >= 1000) {\n\t\t\tconst s = ms / 1000;\n\t\t\treturn `${Number.isInteger(s) ? s : s.toFixed(1)} s`;\n\t\t}\n\t\treturn `${ms} ms`;\n\t}\n\n\t// Display metadata for each resolved limit, in render order. The `value`\n\t// thunk picks the right unit formatter; `env` is the override var name, absent\n\t// for limits fixed in code.\n\t// `note` is optional and only carries what the label and value can't: a\n\t// multiplier, a disable sentinel, what a limit is keyed on. What each var\n\t// means belongs in .env.example, not here.\n\tconst limitRows: Array<{\n\t\tkey: keyof PageData['limits'];\n\t\tlabel: string;\n\t\tenv?: string;\n\t\tvalue: (l: PageData['limits']) => string;\n\t\tnote?: string;\n\t}> = [\n\t\t{\n\t\t\tkey: 'RATE_LIMIT_MAX_REQUESTS',\n\t\t\tlabel: 'Compute rate limit',\n\t\t\tenv: 'COMPUTE_RATE_LIMIT_MAX',\n\t\t\tvalue: (l) => `${l.RATE_LIMIT_MAX_REQUESTS} / ${formatMs(l.RATE_LIMIT_WINDOW_MS)}`,\n\t\t\tnote: 'Counted per key — a user or a share link.'\n\t\t},\n\t\t{\n\t\t\tkey: 'MAX_DEFINITION_FILE_SIZE',\n\t\t\tlabel: 'Max .gh upload size',\n\t\t\tenv: 'MAX_DEFINITION_FILE_SIZE_BYTES',\n\t\t\tvalue: (l) => formatBytes(l.MAX_DEFINITION_FILE_SIZE)\n\t\t},\n\t\t{\n\t\t\tkey: 'MAX_IMAGE_FILE_SIZE',\n\t\t\tlabel: 'Max cover image size',\n\t\t\tvalue: (l) => formatBytes(l.MAX_IMAGE_FILE_SIZE)\n\t\t},\n\t\t{\n\t\t\tkey: 'COMPUTE_REQUEST_MAX_BYTES',\n\t\t\tlabel: 'Compute request body cap',\n\t\t\tvalue: (l) => formatBytes(l.COMPUTE_REQUEST_MAX_BYTES),\n\t\t\tnote: 'Inputs plus base64 file values.'\n\t\t},\n\t\t{\n\t\t\tkey: 'COMPUTE_RESPONSE_MAX_BYTES',\n\t\t\tlabel: 'Compute response body cap',\n\t\t\tvalue: (l) => formatBytes(l.COMPUTE_RESPONSE_MAX_BYTES)\n\t\t},\n\t\t{\n\t\t\tkey: 'REMOTE_DEFINITION_MAX_BYTES',\n\t\t\tlabel: 'Remote definition fetch cap',\n\t\t\tenv: 'MAX_DEFINITION_FILE_SIZE_BYTES',\n\t\t\tvalue: (l) => formatBytes(l.REMOTE_DEFINITION_MAX_BYTES),\n\t\t\tnote: 'Shares the upload cap above — one var sets both.'\n\t\t},\n\t\t{\n\t\t\tkey: 'REMOTE_DEFINITION_FETCH_TIMEOUT_MS',\n\t\t\tlabel: 'Remote definition fetch timeout',\n\t\t\tvalue: (l) => formatMs(l.REMOTE_DEFINITION_FETCH_TIMEOUT_MS)\n\t\t},\n\t\t{\n\t\t\tkey: 'REMOTE_DEFINITION_CACHE_TTL_MS',\n\t\t\tlabel: 'Remote definition cache TTL',\n\t\t\tvalue: (l) => formatMs(l.REMOTE_DEFINITION_CACHE_TTL_MS),\n\t\t\tnote: 'Remote fetches only — uploads are keyed on an immutable version and never go stale.'\n\t\t},\n\t\t{\n\t\t\tkey: 'COMPUTE_DEFINITION_CACHE_BYTES',\n\t\t\tlabel: 'Definition cache',\n\t\t\tenv: 'COMPUTE_DEFINITION_CACHE_MB',\n\t\t\tvalue: (l) => formatBytes(l.COMPUTE_DEFINITION_CACHE_BYTES),\n\t\t\tnote: '0 disables.'\n\t\t},\n\t\t{\n\t\t\tkey: 'COMPUTE_SOLVE_CACHE_BYTES',\n\t\t\tlabel: 'Solve cache',\n\t\t\tenv: 'COMPUTE_SOLVE_CACHE_MB',\n\t\t\tvalue: (l) => formatBytes(l.COMPUTE_SOLVE_CACHE_BYTES),\n\t\t\tnote: 'Per compute server, up to 16 kept warm — worst case is 16× this. 0 disables.'\n\t\t}\n\t];\n\n\t// Only flags whose resolved value misleads on its own. What each flag *does* is\n\t// documented in .env.example — repeating it here just gives it somewhere to drift.\n\tconst flagNotes: Partial<Record<keyof PageData['flags'], string>> = {\n\t\tALLOW_ORG_CREATION:\n\t\t\t'Not wired up yet — no route consults this flag, so flipping it does nothing.'\n\t};\n\n\tconst enabledFlagCount = $derived(Object.values(data.flags).filter(Boolean).length);\n\n\tlet updateRunning = $state(false);\n\tlet updateLogs = $state('');\n\tlet updateExitCode = $state<number | null>(null);\n\tlet updateRestarting = $state(false);\n\n\t// A probe against a stopped app usually does NOT fail fast: the reverse proxy\n\t// in front of it holds the connection open until its own read timeout rather\n\t// than refusing it. Bare `fetch` has no timeout, so without this the restart\n\t// poll below blocks for a minute or more per attempt — the banner freezes on\n\t// \"PM2 is restarting…\" and only a manual reload shows the real state.\n\tconst PROBE_TIMEOUT_MS = 4000;\n\n\t// A 503 here means \"up but degraded\" (see /api/health) — the process is\n\t// answering, which is all this probe is asked to establish. Treating it as\n\t// unreachable stalls the restart wait on an instance that is genuinely back.\n\tasync function fetchHealth(): Promise<RestartHealth | null> {\n\t\ttry {\n\t\t\tconst res = await fetch('/api/health', {\n\t\t\t\tcache: 'no-store',\n\t\t\t\tsignal: AbortSignal.timeout(PROBE_TIMEOUT_MS)\n\t\t\t});\n\t\t\tif (!res.ok && res.status !== 503) return null;\n\t\t\treturn (await res.json()) as RestartHealth;\n\t\t} catch {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\t// Probe readiness, not just liveness. /api/health answers the instant the Node\n\t// process boots — before the app can necessarily serve real routes through the\n\t// proxy — so keying \"online\" on it alone races: the UI said \"back online\"\n\t// while a health-check click moments later 502'd. `/api/health/ready` does one\n\t// provider read, the same one the auth hook makes on every gated request, so a\n\t// 200 means a real request would succeed.\n\t//\n\t// Deliberately NOT `/api/admin/system/health`: that route pings the compute\n\t// server, so it reports non-ok whenever an unrelated dependency is down and\n\t// can outlast any sane probe timeout. Using it here meant a finished update\n\t// could never be confirmed on a deployment whose compute server was down.\n\tasync function isReadinessProbeWarm(): Promise<boolean> {\n\t\ttry {\n\t\t\tconst res = await fetch('/api/health/ready', {\n\t\t\t\tcache: 'no-store',\n\t\t\t\tsignal: AbortSignal.timeout(PROBE_TIMEOUT_MS)\n\t\t\t});\n\t\t\treturn res.ok;\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// Pull the tee'd update log from the server. Returns the *full* log file\n\t// content — the script truncates at the start of every run so this isn't\n\t// cumulative across updates. Returns null if the request fails (typically\n\t// during the window where the old selva-compute is dead and the new one\n\t// hasn't booted yet).\n\tasync function fetchUpdateLog(): Promise<string | null> {\n\t\ttry {\n\t\t\tconst res = await fetch('/api/admin/system/update', {\n\t\t\t\tcache: 'no-store',\n\t\t\t\tsignal: AbortSignal.timeout(PROBE_TIMEOUT_MS * 2)\n\t\t\t});\n\t\t\tif (!res.ok) return null;\n\t\t\treturn await res.text();\n\t\t} catch {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\t// Poll until the new process is serving. The loop itself lives in\n\t// `#lib/update-restart-poll.js` so it can be tested against a clock and probes\n\t// that misbehave on demand; this wrapper owns only the `$state` writes.\n\tasync function waitForAppRestart(previousInstanceId: string | null | undefined) {\n\t\t// The daemonized runner never streams over SSE, so the SSE `restarting`\n\t\t// event can't drive this flag — set it here, where we actually begin the\n\t\t// restart wait, so the \"PM2 is restarting…\" banner reflects reality.\n\t\tupdateRestarting = true;\n\n\t\tconst { exitCode } = await pollForRestart(previousInstanceId, {\n\t\t\tprobes: {\n\t\t\t\thealth: fetchHealth,\n\t\t\t\tlog: fetchUpdateLog,\n\t\t\t\tready: isReadinessProbeWarm\n\t\t\t},\n\t\t\tnow: () => Date.now(),\n\t\t\tsleep: (ms) => new Promise((r) => setTimeout(r, ms)),\n\t\t\tonLog: (log) => {\n\t\t\t\tupdateLogs = log;\n\t\t\t},\n\t\t\tappendLog: (line) => {\n\t\t\t\tupdateLogs += line;\n\t\t\t}\n\t\t});\n\n\t\tupdateExitCode = exitCode;\n\t\tupdateRunning = false;\n\t\tupdateRestarting = false;\n\t}\n\n\tasync function runUpdate() {\n\t\tupdateRunning = true;\n\t\tupdateRestarting = false;\n\t\tupdateLogs = '';\n\t\tupdateExitCode = null;\n\n\t\t// Snapshot the instanceId of the *currently running* process so we can\n\t\t// detect when a new one takes over (the value changes on every boot).\n\t\tconst preHealth = await fetchHealth();\n\t\tconst previousInstanceId = preHealth?.instanceId ?? null;\n\n\t\ttry {\n\t\t\tconst response = await fetch('/api/admin/system/update', { method: 'POST' });\n\t\t\tif (!response.ok) {\n\t\t\t\tupdateLogs = 'Failed to start update process';\n\t\t\t\tupdateExitCode = response.status;\n\t\t\t\tupdateRunning = false;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst reader = response.body?.getReader();\n\t\t\tconst decoder = new TextDecoder();\n\t\t\tif (!reader) {\n\t\t\t\tupdateLogs = 'Failed to read response';\n\t\t\t\tupdateExitCode = -1;\n\t\t\t\tupdateRunning = false;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlet buffer = '';\n\t\t\tlet sawRestarting = false;\n\t\t\tlet sawExit = false;\n\t\t\tlet streamExitCode: number | null = null;\n\t\t\twhile (true) {\n\t\t\t\tconst { done, value } = await reader.read();\n\t\t\t\tif (done) break;\n\t\t\t\tbuffer += decoder.decode(value, { stream: true });\n\t\t\t\tconst parts = buffer.split('\\n\\n');\n\t\t\t\tbuffer = parts.pop()!;\n\t\t\t\tfor (const part of parts) {\n\t\t\t\t\tif (!part.startsWith('data: ')) continue;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst event = JSON.parse(part.slice(6));\n\t\t\t\t\t\tif (event.type === 'log') {\n\t\t\t\t\t\t\tupdateLogs += event.data + '\\n';\n\t\t\t\t\t\t} else if (event.type === 'restarting') {\n\t\t\t\t\t\t\tupdateLogs += event.data + '\\n';\n\t\t\t\t\t\t\tupdateRestarting = true;\n\t\t\t\t\t\t\tsawRestarting = true;\n\t\t\t\t\t\t} else if (event.type === 'exit') {\n\t\t\t\t\t\t\tsawExit = true;\n\t\t\t\t\t\t\tstreamExitCode = event.code;\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch {\n\t\t\t\t\t\t// ignore malformed events\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// The POST spawns a LAUNCHER that daemonizes the real update runner and\n\t\t\t// then exits 0 on its own. So the SSE stream closing with exit 0 means\n\t\t\t// \"runner launched\", NOT \"update finished\" — and because the runner's\n\t\t\t// output (pm2 stop/start, npm, health probe, rollback) is redirected to\n\t\t\t// the log file, the SSE stream never carries the `restarting` signal or\n\t\t\t// the runner's real exit code. The only source of truth from here is\n\t\t\t// /api/health + the log file, which waitForAppRestart polls.\n\t\t\t//\n\t\t\t// The one case we can decide from the stream alone: the launcher itself\n\t\t\t// exiting non-zero means it failed before daemonizing anything, so nothing\n\t\t\t// is updating in the background — surface that directly.\n\t\t\tif (sawExit && !sawRestarting && streamExitCode !== null && streamExitCode !== 0) {\n\t\t\t\tupdateExitCode = streamExitCode;\n\t\t\t\tupdateRunning = false;\n\t\t\t} else {\n\t\t\t\tawait waitForAppRestart(previousInstanceId);\n\t\t\t}\n\t\t} catch (err) {\n\t\t\t// Fetch threw — most likely because PM2 killed the connection mid-stream.\n\t\t\t// If we got far enough to see a restart, treat it as expected.\n\t\t\tif (updateRestarting) {\n\t\t\t\tawait waitForAppRestart(previousInstanceId);\n\t\t\t} else {\n\t\t\t\tupdateLogs += '\\nError: ' + (err instanceof Error ? err.message : 'Unknown error');\n\t\t\t\tupdateExitCode = -1;\n\t\t\t\tupdateRunning = false;\n\t\t\t}\n\t\t}\n\t}\n</script>\n\n<svelte:head>\n\t<title>Admin · System</title>\n</svelte:head>\n\n<div class=\"space-y-6\">\n\t<SectionHeader\n\t\teyebrow=\"Admin\"\n\t\ttitle=\"System settings\"\n\t\tdescription=\"Updates, health checks, and the instance's env-driven configuration.\"\n\t/>\n\n\t<Tabs.Root value={activeTab} onValueChange={selectTab} class=\"gap-6\">\n\t\t<Tabs.List variant=\"line\" class=\"border-border border-b px-0\">\n\t\t\t{#each tabs as tab (tab.id)}\n\t\t\t\t<Tabs.Trigger value={tab.id} variant=\"line\">{tab.label}</Tabs.Trigger>\n\t\t\t{/each}\n\t\t</Tabs.List>\n\n\t\t<Tabs.Content value=\"updates\" class=\"space-y-6\">\n\t\t\t{#if data.canManageUpdates}\n\t\t\t\t<UpdateSection\n\t\t\t\t\tcurrentVersion={data.version}\n\t\t\t\t\tlatestVersion={data.update.latest}\n\t\t\t\t\tupdateAvailable={data.update.updateAvailable}\n\t\t\t\t\tchannel={data.channel}\n\t\t\t\t\tisRunning={updateRunning}\n\t\t\t\t\tisRestarting={updateRestarting}\n\t\t\t\t\tlogs={updateLogs}\n\t\t\t\t\texitCode={updateExitCode}\n\t\t\t\t\tnodeCompatibility={data.update.nodeCompatibility}\n\t\t\t\t\tonRun={runUpdate}\n\t\t\t\t/>\n\t\t\t\t{#key data.channel}\n\t\t\t\t\t<ChannelSection channel={data.channel} disabled={updateRunning} />\n\t\t\t\t{/key}\n\t\t\t{/if}\n\t\t</Tabs.Content>\n\n\t\t<Tabs.Content value=\"health\" class=\"space-y-6\">\n\t\t\t{#if data.isInstanceAdmin}\n\t\t\t\t<HealthSection />\n\t\t\t\t<NetworkSection />\n\t\t\t{/if}\n\t\t</Tabs.Content>\n\n\t\t<Tabs.Content value=\"config\">\n\t\t\t<Card.Root>\n\t\t\t\t<Card.Header>\n\t\t\t\t\t<Card.Title class=\"text-base font-semibold\">Configuration</Card.Title>\n\t\t\t\t\t<Card.Description>\n\t\t\t\t\t\tWhat this server runs on, and anything that needs fixing. To change a value, run\n\t\t\t\t\t\t<code class=\"font-mono text-xs\">npx selva config set KEY=VALUE</code> on the server,\n\t\t\t\t\t\tthen\n\t\t\t\t\t\t<code class=\"font-mono text-xs\">npx selva restart</code>.\n\t\t\t\t\t</Card.Description>\n\t\t\t\t</Card.Header>\n\t\t\t\t<Card.Content class=\"space-y-6\">\n\t\t\t\t\t{#if data.config}\n\t\t\t\t\t\t<ConfigSection\n\t\t\t\t\t\t\treport={data.config.report}\n\t\t\t\t\t\t\tchanges={data.config.changes}\n\t\t\t\t\t\t\trotation={data.config.rotation}\n\t\t\t\t\t\t\tproxied={data.config.proxied}\n\t\t\t\t\t\t\tchecks={data.config.checks}\n\t\t\t\t\t\t/>\n\t\t\t\t\t{/if}\n\n\t\t\t\t\t<details class=\"group rounded-lg border\">\n\t\t\t\t\t\t<summary\n\t\t\t\t\t\t\tclass=\"hover:bg-hover flex cursor-pointer items-center gap-2 rounded-lg px-4 py-3 text-sm font-semibold select-none\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ChevronRight class=\"h-4 w-4 shrink-0 transition-transform group-open:rotate-90\" />\n\t\t\t\t\t\t\tPlatform flags\n\t\t\t\t\t\t\t<span class=\"text-muted-foreground ml-auto font-mono text-xs\"\n\t\t\t\t\t\t\t\t>{enabledFlagCount} on</span\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t</summary>\n\t\t\t\t\t\t<div class=\"divide-y border-t\">\n\t\t\t\t\t\t\t{#each Object.entries(data.flags) as [name, value] (name)}\n\t\t\t\t\t\t\t\t<div class=\"flex items-center justify-between gap-4 px-4 py-3\">\n\t\t\t\t\t\t\t\t\t<div class=\"min-w-0 flex-1\">\n\t\t\t\t\t\t\t\t\t\t{#if flagNotes[name as keyof PageData['flags']]}\n\t\t\t\t\t\t\t\t\t\t\t<p class=\"text-foreground text-sm leading-snug font-medium\">\n\t\t\t\t\t\t\t\t\t\t\t\t{flagNotes[name as keyof PageData['flags']]}\n\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t\t\t\t\t<code class=\"text-muted-foreground text-2xs mt-1 block font-mono\">{name}</code>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\tclass={`rounded-full border px-2 py-0.5 text-xs font-medium ${\n\t\t\t\t\t\t\t\t\t\t\tvalue\n\t\t\t\t\t\t\t\t\t\t\t\t? 'border-success/40 bg-success/10 text-success'\n\t\t\t\t\t\t\t\t\t\t\t\t: 'border-border text-muted-foreground'\n\t\t\t\t\t\t\t\t\t\t}`}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{value ? 'On' : 'Off'}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t{/each}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</details>\n\n\t\t\t\t\t<details class=\"group rounded-lg border\">\n\t\t\t\t\t\t<summary\n\t\t\t\t\t\t\tclass=\"hover:bg-hover flex cursor-pointer items-center gap-2 rounded-lg px-4 py-3 text-sm font-semibold select-none\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ChevronRight class=\"h-4 w-4 shrink-0 transition-transform group-open:rotate-90\" />\n\t\t\t\t\t\t\tPlatform limits\n\t\t\t\t\t\t\t<span class=\"text-muted-foreground ml-auto font-mono text-xs\">{limitRows.length}</span\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t</summary>\n\t\t\t\t\t\t<div class=\"divide-y border-t\">\n\t\t\t\t\t\t\t{#each limitRows as row (row.key)}\n\t\t\t\t\t\t\t\t<div class=\"flex items-start justify-between gap-4 px-4 py-3\">\n\t\t\t\t\t\t\t\t\t<div class=\"min-w-0 flex-1\">\n\t\t\t\t\t\t\t\t\t\t<span class=\"text-foreground text-sm font-medium\">{row.label}</span>\n\t\t\t\t\t\t\t\t\t\t{#if row.env}\n\t\t\t\t\t\t\t\t\t\t\t<code class=\"text-muted-foreground mt-0.5 block font-mono text-[10px]\"\n\t\t\t\t\t\t\t\t\t\t\t\t>{row.env}</code\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t\t\t\t\t{#if row.note}\n\t\t\t\t\t\t\t\t\t\t\t<p class=\"text-muted-foreground mt-1 text-xs\">{row.note}</p>\n\t\t\t\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\tclass=\"bg-muted text-foreground shrink-0 rounded-md px-2 py-0.5 font-mono text-xs whitespace-nowrap\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{row.value(data.limits)}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t{/each}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</details>\n\t\t\t\t</Card.Content>\n\t\t\t</Card.Root>\n\t\t</Tabs.Content>\n\t</Tabs.Root>\n</div>\n"],"ignoreList":[0,1,2,3,4,5],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAQyB,IAAaA,eAAU;CAAK,QAAQ;CAAc,QAAQ;CAAI,QAAM,CAAI,CAAA,QAAM,EAAI,KAAK,WAAU,CAAA,GAAM,CAAA,QAAM,EAAI,KAAK,iBAAgB,CAAA,C;;AAIrIA,aAAW;AAGrC,SAAA,WAAA,YAAA,SAAA;CACA,IAAI,EAAA,SAAA,UAAA,GAAA,UAAA;CAYM,KAAA,YAAAE,aAAA,CAAA,OAAK,EAAA,MAAQF,aAAU,CAAA,CAAA,CAAA;AAXzB;;ACTiB,IAAaG,eAAU;CAAK,QAAQ;CAAY,QAAQ;CAAI,QAAM,CAAI,CAAA,QAAM,EAAI,KAAK,gBAAe,CAAA,GAAM,CAAA,QAAM,EAAI,KAAK,WAAU,CAAA,C;;AAIlIA,aAAW;AAGrC,SAAA,SAAA,YAAA,SAAA;CACA,IAAI,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAkBlB,IAAA,KAAK,QAAM;;;gBAEN,QAAA,KAAK,OAAO;gBACX,SAAA,KAAK,OAAO;gBACX,UAAA,KAAK,OAAO;gBACb,SAAA,KAAK,OAAO;gBACb,QAAA,KAAK,OAAO;;;;;cAWjB,WAAA,KAAA,wFAAAA,YAAA,iBAAgB,CAAA,EAAA,6DAAA;cAIZ,MAAA,eAAAF,kBAAA,OAAO,QAAQ,KAAK,KAAK,CAAA;;eAAM,IAAA,CAAA,MAAM,SAAK,aAAA;;eAGzC,IAAA,UAAU,OAEZ,WAAA,KAAA,wEAAAE,YAAA,UAAU,KAAI,EAAA,KAAA;;eAGkD,WAAA,KAAA,8EAAAA,YAAA,IAAI,EAAA,qBAAAO,WAAA,uDAItE,QACG,iDACA,uCAAoC,EAAA,GAAAP,YAGvC,QAAQ,OAAO,KAAK,EAAA,cAAA;;;;cAauC,WAAA,KAAA,yFAAAA,YAAA,UAAU,MAAM,EAAA,0DAAA;cAIxE,MAAA,eAAAF,kBAAA,SAAS;;eAAI,IAAA,MAAG,aAAA;eAG+B,WAAA,KAAA,+IAAAE,YAAA,IAAI,KAAK,EAAA,SAAA;eACvD,IAAA,IAAI,KAEL,WAAA,KAAA,mFAAAA,YAAA,IAAI,GAAG,EAAA,QAAA;;;eAGN,IAAA,IAAI,MACuC,WAAA,KAAA,0DAAAA,YAAA,IAAI,IAAI,EAAA,KAAA;;eAMvD,WAAA,KAAA,6HAAAA,YAAA,IAAI,MAAM,KAAK,MAAM,CAAA,EAAA,cAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAlIxB,CAAA"}
|
|
1
|
+
{"version":3,"file":"_page.svelte.js","names":["__iconData","__iconNode","$.spread_props","__iconData","__iconNode","$.spread_props","__iconData","__iconNode","$.spread_props","__iconData","__iconNode","$.spread_props","__iconData","__iconNode","$.spread_props","$.spread_props","$.derived","CircleCheck","TriangleAlert","CircleX","RefreshCw","Card.Root","Card.Header","Card.Title","$.attr_class","$.escape","Card.Description","Card.Content","$.stringify","$.attr","AlertDialog.Root","AlertDialog.Content","AlertDialog.Header","AlertDialog.Title","AlertDialog.Description","AlertDialog.Footer","AlertDialog.Cancel","AlertDialog.Action","untrack","$.derived","Card.Root","Card.Header","Card.Title","$.attr_class","$.escape","Card.Description","Card.Content","$.attr","CircleCheck","TriangleAlert","CircleX","Card.Root","Card.Header","Card.Title","Card.Description","Card.Content","$.escape","$.attr_class","$.stringify","$.ensure_array_like","Card.Root","Card.Header","Card.Title","Card.Description","Card.Content","$.escape","$.ensure_array_like","$.derived","$.escape","$.attr_class","$.attr","$.ensure_array_like","$.stringify","$.derived","Tabs.Root","Tabs.List","$.ensure_array_like","Tabs.Trigger","$.escape","Tabs.Content","Card.Root","Card.Header","Card.Title","Card.Description","Card.Content","$.attr_class"],"sources":["../../../../../../../../node_modules/.pnpm/@lucide+svelte@1.66.0_svelte@5.57.3_@typescript-eslint+types@8.72.1_/node_modules/@lucide/svelte/dist/icons/arrow-down.svelte","../../../../../../../../node_modules/.pnpm/@lucide+svelte@1.66.0_svelte@5.57.3_@typescript-eslint+types@8.72.1_/node_modules/@lucide/svelte/dist/icons/arrow-up.svelte","../../../../../../../../node_modules/.pnpm/@lucide+svelte@1.66.0_svelte@5.57.3_@typescript-eslint+types@8.72.1_/node_modules/@lucide/svelte/dist/icons/circle-arrow-up.svelte","../../../../../../../../node_modules/.pnpm/@lucide+svelte@1.66.0_svelte@5.57.3_@typescript-eslint+types@8.72.1_/node_modules/@lucide/svelte/dist/icons/circle-x.svelte","../../../../../../../../node_modules/.pnpm/@lucide+svelte@1.66.0_svelte@5.57.3_@typescript-eslint+types@8.72.1_/node_modules/@lucide/svelte/dist/icons/flask-conical.svelte","../../../../../../../../node_modules/.pnpm/@lucide+svelte@1.66.0_svelte@5.57.3_@typescript-eslint+types@8.72.1_/node_modules/@lucide/svelte/dist/icons/stethoscope.svelte","../../../../../../src/routes/admin/system/UpdateSection.svelte","../../../../../../src/routes/admin/system/ChannelSection.svelte","../../../../../../src/routes/admin/system/HealthSection.svelte","../../../../../../src/routes/admin/system/NetworkSection.svelte","../../../../../../src/routes/admin/system/ConfigSection.svelte","../../../../../../src/lib/update-restart-poll.ts","../../../../../../src/routes/admin/system/+page.svelte"],"sourcesContent":["<!--\n@lucide/svelte v1.66.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script module lang=\"ts\">export const __iconData = { \"name\": \"arrow-down\", \"size\": 24, \"node\": [[\"path\", { \"d\": \"M12 5v14\" }], [\"path\", { \"d\": \"m19 12-7 7-7-7\" }]] };\n/**\n * @deprecated Access `__iconData` instead.\n */\nexport const __iconNode = __iconData.node;\n</script>\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/arrow-down\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={__iconData} />\n","<!--\n@lucide/svelte v1.66.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script module lang=\"ts\">export const __iconData = { \"name\": \"arrow-up\", \"size\": 24, \"node\": [[\"path\", { \"d\": \"m5 12 7-7 7 7\" }], [\"path\", { \"d\": \"M12 19V5\" }]] };\n/**\n * @deprecated Access `__iconData` instead.\n */\nexport const __iconNode = __iconData.node;\n</script>\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/arrow-up\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={__iconData} />\n","<!--\n@lucide/svelte v1.66.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script module lang=\"ts\">export const __iconData = { \"name\": \"circle-arrow-up\", \"size\": 24, \"node\": [[\"circle\", { \"cx\": \"12\", \"cy\": \"12\", \"r\": \"10\" }], [\"path\", { \"d\": \"m16 12-4-4-4 4\" }], [\"path\", { \"d\": \"M12 16V8\" }]], \"aliases\": [\"arrow-up-circle\"] };\n/**\n * @deprecated Access `__iconData` instead.\n */\nexport const __iconNode = __iconData.node;\n</script>\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/circle-arrow-up\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={__iconData} />\n","<!--\n@lucide/svelte v1.66.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script module lang=\"ts\">export const __iconData = { \"name\": \"circle-x\", \"size\": 24, \"node\": [[\"circle\", { \"cx\": \"12\", \"cy\": \"12\", \"r\": \"10\" }], [\"path\", { \"d\": \"m15 9-6 6\" }], [\"path\", { \"d\": \"m9 9 6 6\" }]], \"aliases\": [\"x-circle\"] };\n/**\n * @deprecated Access `__iconData` instead.\n */\nexport const __iconNode = __iconData.node;\n</script>\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/circle-x\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={__iconData} />\n","<!--\n@lucide/svelte v1.66.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script module lang=\"ts\">export const __iconData = { \"name\": \"flask-conical\", \"size\": 24, \"node\": [[\"path\", { \"d\": \"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2\" }], [\"path\", { \"d\": \"M6.453 15h11.094\" }], [\"path\", { \"d\": \"M8.5 2h7\" }]] };\n/**\n * @deprecated Access `__iconData` instead.\n */\nexport const __iconNode = __iconData.node;\n</script>\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/flask-conical\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={__iconData} />\n","<!--\n@lucide/svelte v1.66.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script module lang=\"ts\">export const __iconData = { \"name\": \"stethoscope\", \"size\": 24, \"node\": [[\"path\", { \"d\": \"M11 2v2\" }], [\"path\", { \"d\": \"M5 2v2\" }], [\"path\", { \"d\": \"M5 3H4a2 2 0 0 0-2 2v4a6 6 0 0 0 12 0V5a2 2 0 0 0-2-2h-1\" }], [\"path\", { \"d\": \"M8 15a6 6 0 0 0 12 0v-3\" }], [\"circle\", { \"cx\": \"20\", \"cy\": \"10\", \"r\": \"2\" }]] };\n/**\n * @deprecated Access `__iconData` instead.\n */\nexport const __iconNode = __iconData.node;\n</script>\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/stethoscope\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={__iconData} />\n","<script lang=\"ts\">\n\timport { Button, Card, AlertDialog } from '@selvajs/ui';\n\timport {\n\t\tRefreshCw,\n\t\tCircleCheck,\n\t\tInfo,\n\t\tTriangleAlert,\n\t\tCircleX,\n\t\tArrowUpCircle\n\t} from '@lucide/svelte';\n\timport { deriveOutcome, type OutcomeSeverity } from '#lib/update-outcome.js';\n\n\tinterface NodeCompatibility {\n\t\tcompatible: boolean | null;\n\t\trequired: string | null;\n\t\trunning: string;\n\t}\n\n\tinterface Props {\n\t\tcurrentVersion?: string;\n\t\tlatestVersion?: string | null;\n\t\tupdateAvailable?: boolean;\n\t\tchannel?: 'stable' | 'beta';\n\t\tisRunning?: boolean;\n\t\tisRestarting?: boolean;\n\t\tlogs?: string;\n\t\texitCode?: number | null;\n\t\tnodeCompatibility?: NodeCompatibility;\n\t\tdataCompatibility?: { compatible: boolean | null; installed: number; target: number | null };\n\t\tonRun?: () => void;\n\t}\n\n\tlet {\n\t\tcurrentVersion,\n\t\tlatestVersion = null,\n\t\tupdateAvailable = false,\n\t\tchannel = 'stable',\n\t\tisRunning = false,\n\t\tisRestarting = false,\n\t\tlogs = '',\n\t\texitCode = null,\n\t\tnodeCompatibility = { compatible: null, required: null, running: '' },\n\t\tdataCompatibility = { compatible: null, installed: 1, target: null },\n\t\tonRun\n\t}: Props = $props();\n\n\t// Only a definite `false` blocks. `null` means we couldn't determine the\n\t// requirement (registry down, no engines field, unparseable range) — never\n\t// strand an operator behind a check that couldn't run (issue #176).\n\tconst nodeBlocked = $derived(nodeCompatibility.compatible === false);\n\n\t// Typed override: the operator retypes the target version to proceed anyway.\n\t// A mismatched update will NOT self-roll-back — the health probe passes\n\t// regardless — so this needs more friction than a second click.\n\tlet overrideInput = $state('');\n\tlet overrideArmed = $state(false);\n\tconst overrideSatisfied = $derived(\n\t\toverrideArmed && !!latestVersion && overrideInput.trim() === latestVersion\n\t);\n\t// No override: the runner refuses the same install before it stops the app.\n\tconst dataBlocked = $derived(dataCompatibility.compatible === false);\n\tconst runDisabled = $derived(isRunning || dataBlocked || (nodeBlocked && !overrideSatisfied));\n\n\tconst channelLabel = $derived(channel === 'beta' ? 'beta' : 'stable');\n\n\tlet logEl = $state<HTMLPreElement>();\n\tlet showRunConfirm = $state(false);\n\n\t// Only classify once the run has finished (exitCode set). While running we\n\t// show live progress instead, so a transient mid-run log line can't be\n\t// misread as a final verdict.\n\tlet outcome = $derived(exitCode === null ? null : deriveOutcome(exitCode, logs));\n\n\tconst severityStyles: Record<\n\t\tOutcomeSeverity,\n\t\t{ text: string; border: string; bg: string; icon: typeof CircleCheck }\n\t> = {\n\t\tsuccess: {\n\t\t\ttext: 'text-success',\n\t\t\tborder: 'border-success/40',\n\t\t\tbg: 'bg-success/10',\n\t\t\ticon: CircleCheck\n\t\t},\n\t\tinfo: {\n\t\t\ttext: 'text-foreground',\n\t\t\tborder: 'border-border',\n\t\t\tbg: 'bg-muted',\n\t\t\ticon: Info\n\t\t},\n\t\twarning: {\n\t\t\ttext: 'text-warning',\n\t\t\tborder: 'border-warning/40',\n\t\t\tbg: 'bg-warning/10',\n\t\t\ticon: TriangleAlert\n\t\t},\n\t\tcritical: {\n\t\t\ttext: 'text-destructive',\n\t\t\tborder: 'border-destructive/40',\n\t\t\tbg: 'bg-destructive/10',\n\t\t\ticon: CircleX\n\t\t},\n\t\tpending: {\n\t\t\ttext: 'text-muted-foreground',\n\t\t\tborder: 'border-border',\n\t\t\tbg: 'bg-muted',\n\t\t\ticon: RefreshCw\n\t\t}\n\t};\n\n\t$effect(() => {\n\t\t// Auto-scroll to bottom whenever logs change\n\t\tif (logs && logEl) {\n\t\t\tlogEl.scrollTop = logEl.scrollHeight;\n\t\t}\n\t});\n\n\tfunction buttonLabel() {\n\t\tif (isRestarting) return 'Restarting & verifying…';\n\t\tif (isRunning) return 'Running…';\n\t\treturn 'Run Update';\n\t}\n\n\tfunction handleRunClick() {\n\t\tshowRunConfirm = true;\n\t}\n\n\tfunction confirmRun() {\n\t\tshowRunConfirm = false;\n\t\tonRun?.();\n\t}\n</script>\n\n<Card.Root>\n\t<Card.Header>\n\t\t<div class=\"flex items-start justify-between gap-3\">\n\t\t\t<Card.Title>Application Update</Card.Title>\n\t\t\t{#if currentVersion}\n\t\t\t\t<span\n\t\t\t\t\tclass=\"rounded-full border px-2 py-0.5 font-mono text-xs {updateAvailable\n\t\t\t\t\t\t? 'border-warning/40 bg-warning/10 text-warning'\n\t\t\t\t\t\t: 'border-border bg-muted text-muted-foreground'}\"\n\t\t\t\t\ttitle=\"Currently installed @selvajs/selva version\"\n\t\t\t\t>\n\t\t\t\t\tv{currentVersion}\n\t\t\t\t</span>\n\t\t\t{/if}\n\t\t</div>\n\t\t<Card.Description\n\t\t\t>Update @selvajs/* to the latest <span class=\"font-medium\">{channelLabel}</span> release and restart</Card.Description\n\t\t>\n\t</Card.Header>\n\t<Card.Content class=\"space-y-4\">\n\t\t{#if updateAvailable && latestVersion}\n\t\t\t<div\n\t\t\t\tclass=\"border-warning/40 bg-warning/10 text-warning flex items-center gap-2 rounded-md border px-3 py-2 text-sm\"\n\t\t\t\trole=\"status\"\n\t\t\t>\n\t\t\t\t<ArrowUpCircle class=\"h-4 w-4 shrink-0\" />\n\t\t\t\t<span>\n\t\t\t\t\t{channelLabel} release available — <span class=\"font-mono\">v{currentVersion}</span> →\n\t\t\t\t\t<span class=\"font-mono\">v{latestVersion}</span>\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t{:else if currentVersion && latestVersion}\n\t\t\t<p class=\"text-muted-foreground text-sm\">\n\t\t\t\tYou're on the latest {channelLabel} release (<span class=\"font-mono\">v{currentVersion}</span\n\t\t\t\t>).\n\t\t\t</p>\n\t\t{/if}\n\t\t{#if dataBlocked}\n\t\t\t<div\n\t\t\t\tclass=\"border-destructive/40 bg-destructive/10 text-destructive flex items-start gap-2 rounded-md border px-3 py-3 text-sm\"\n\t\t\t\trole=\"alert\"\n\t\t\t>\n\t\t\t\t<TriangleAlert class=\"mt-0.5 h-4 w-4 shrink-0\" />\n\t\t\t\t<div class=\"space-y-1\">\n\t\t\t\t\t<p class=\"font-medium\">\n\t\t\t\t\t\tUpdate blocked — <span class=\"font-mono\">v{latestVersion}</span> cannot read this deployment's\n\t\t\t\t\t\tdata\n\t\t\t\t\t</p>\n\t\t\t\t\t<p class=\"text-muted-foreground text-xs\">\n\t\t\t\t\t\tIt reads data format {dataCompatibility.target}; this deployment is on format\n\t\t\t\t\t\t{dataCompatibility.installed}. Installing it would leave stored data, such as Compute\n\t\t\t\t\t\tAPI keys, unreadable. Switch the release channel back to stay on this version. To go\n\t\t\t\t\t\tback anyway, follow \"Going back to an older release\" in the admin guide.\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t{/if}\n\t\t{#if nodeBlocked}\n\t\t\t<div\n\t\t\t\tclass=\"border-destructive/40 bg-destructive/10 space-y-3 rounded-md border px-3 py-3 text-sm\"\n\t\t\t\trole=\"alert\"\n\t\t\t>\n\t\t\t\t<div class=\"text-destructive flex items-start gap-2\">\n\t\t\t\t\t<TriangleAlert class=\"mt-0.5 h-4 w-4 shrink-0\" />\n\t\t\t\t\t<div class=\"space-y-1\">\n\t\t\t\t\t\t<p class=\"font-medium\">Update blocked — this release needs a newer Node</p>\n\t\t\t\t\t\t<p class=\"text-muted-foreground text-xs\">\n\t\t\t\t\t\t\t<span class=\"font-mono\">v{latestVersion}</span> requires Node\n\t\t\t\t\t\t\t<span class=\"font-mono\">{nodeCompatibility.required}</span>, but this host runs\n\t\t\t\t\t\t\t<span class=\"font-mono\">v{nodeCompatibility.running}</span>. npm installs it anyway\n\t\t\t\t\t\t\tand the health check still passes, so a failed update would\n\t\t\t\t\t\t\t<span class=\"font-medium\">not</span> roll back automatically. Upgrade Node on the server\n\t\t\t\t\t\t\tfirst.\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t{#if !overrideArmed}\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tclass=\"text-muted-foreground hover:text-foreground text-xs underline underline-offset-2\"\n\t\t\t\t\t\tonclick={() => (overrideArmed = true)}\n\t\t\t\t\t>\n\t\t\t\t\t\tOverride anyway (advanced)\n\t\t\t\t\t</button>\n\t\t\t\t{:else}\n\t\t\t\t\t<div class=\"space-y-2\">\n\t\t\t\t\t\t<label class=\"text-muted-foreground block text-xs\" for=\"node-override\">\n\t\t\t\t\t\t\tType <span class=\"text-foreground font-mono\">{latestVersion}</span> to confirm you accept\n\t\t\t\t\t\t\ta deployment that may fail under real traffic:\n\t\t\t\t\t\t</label>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tid=\"node-override\"\n\t\t\t\t\t\t\tclass=\"border-input bg-background w-full rounded-md border px-2 py-1 font-mono text-xs\"\n\t\t\t\t\t\t\tbind:value={overrideInput}\n\t\t\t\t\t\t\tplaceholder={latestVersion ?? ''}\n\t\t\t\t\t\t\tautocomplete=\"off\"\n\t\t\t\t\t\t\tspellcheck=\"false\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t{/if}\n\t\t\t</div>\n\t\t{/if}\n\t\t<Button onclick={handleRunClick} disabled={runDisabled} variant=\"destructive\">\n\t\t\t{buttonLabel()}\n\t\t</Button>\n\t\t{#if isRestarting && exitCode === null}\n\t\t\t<div\n\t\t\t\tclass=\"border-border bg-muted text-muted-foreground flex items-center gap-2 rounded-md border px-3 py-2 text-sm\"\n\t\t\t>\n\t\t\t\t<RefreshCw class=\"h-4 w-4 animate-spin\" />\n\t\t\t\t<span>PM2 is restarting the app — waiting for the new process to come online…</span>\n\t\t\t</div>\n\t\t{/if}\n\t\t{#if outcome}\n\t\t\t{@const style = severityStyles[outcome.severity]}\n\t\t\t{@const Icon = style.icon}\n\t\t\t<div\n\t\t\t\tclass=\"flex items-start gap-3 rounded-md border px-3 py-3 {style.border} {style.bg}\"\n\t\t\t\trole={outcome.severity === 'critical' ? 'alert' : 'status'}\n\t\t\t\taria-live={outcome.severity === 'critical' ? 'assertive' : 'polite'}\n\t\t\t>\n\t\t\t\t<Icon class=\"mt-0.5 h-5 w-5 shrink-0 {style.text}\" />\n\t\t\t\t<div class=\"min-w-0 space-y-1\">\n\t\t\t\t\t<p class=\"text-sm font-medium {style.text}\">{outcome.title}</p>\n\t\t\t\t\t{#if outcome.from && outcome.to && outcome.from !== outcome.to}\n\t\t\t\t\t\t<p class=\"text-muted-foreground font-mono text-xs\">\n\t\t\t\t\t\t\t{outcome.from} → {outcome.to}\n\t\t\t\t\t\t</p>\n\t\t\t\t\t{/if}\n\t\t\t\t\t{#if outcome.detail}\n\t\t\t\t\t\t<p class=\"text-muted-foreground text-xs whitespace-pre-line\">{outcome.detail}</p>\n\t\t\t\t\t{/if}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t{/if}\n\n\t\t{#if logs}\n\t\t\t<div class=\"space-y-2\">\n\t\t\t\t<h4 class=\"text-sm font-medium\">Update Logs</h4>\n\t\t\t\t<pre\n\t\t\t\t\tbind:this={logEl}\n\t\t\t\t\tclass=\"bg-muted text-foreground max-h-96 overflow-auto rounded-md p-4 font-mono text-xs\">{logs}</pre>\n\t\t\t</div>\n\t\t{/if}\n\t</Card.Content>\n</Card.Root>\n\n<AlertDialog.Root open={showRunConfirm} onOpenChange={(o) => (showRunConfirm = o)}>\n\t<AlertDialog.Content>\n\t\t<AlertDialog.Header>\n\t\t\t<AlertDialog.Title>\n\t\t\t\t{nodeBlocked ? 'Run Update despite the Node mismatch?' : 'Run Update?'}\n\t\t\t</AlertDialog.Title>\n\t\t\t{#if nodeBlocked}\n\t\t\t\t<AlertDialog.Description class=\"text-destructive\">\n\t\t\t\t\tThis release requires Node {nodeCompatibility.required} and the host runs v{nodeCompatibility.running}.\n\t\t\t\t\tThe health check will pass regardless, so this update will not roll itself back if routes\n\t\t\t\t\tstart failing.\n\t\t\t\t</AlertDialog.Description>\n\t\t\t{/if}\n\t\t\t<AlertDialog.Description>\n\t\t\t\tThis will update @selvajs/* to the latest {channelLabel} release and restart the application.\n\t\t\t\tThe service will be temporarily unavailable.\n\t\t\t</AlertDialog.Description>\n\t\t</AlertDialog.Header>\n\t\t<AlertDialog.Footer>\n\t\t\t<AlertDialog.Cancel>Cancel</AlertDialog.Cancel>\n\t\t\t<AlertDialog.Action onclick={confirmRun} disabled={isRunning}>Continue</AlertDialog.Action>\n\t\t</AlertDialog.Footer>\n\t</AlertDialog.Content>\n</AlertDialog.Root>\n","<script lang=\"ts\">\n\timport { untrack } from 'svelte';\n\timport { Button, Callout, Card } from '@selvajs/ui';\n\timport { FlaskConical, ShieldCheck } from '@lucide/svelte';\n\timport { enhance } from '$app/forms';\n\n\tinterface Props {\n\t\t/** The persisted channel. */\n\t\tchannel: 'stable' | 'beta';\n\t\t/** Disable controls while an update is mid-flight. */\n\t\tdisabled?: boolean;\n\t}\n\n\tlet { channel, disabled = false }: Props = $props();\n\n\t// Local selection the radios mutate; the form submits it. Intentionally a\n\t// one-time snapshot of the persisted `channel` (untrack makes that explicit).\n\t// The parent keys this component on `channel` ({#key data.channel}), so a\n\t// confirmed switch remounts it and re-seeds the selection.\n\tlet selected = $state(untrack(() => channel));\n\n\tlet saving = $state(false);\n\n\tlet dirty = $derived(selected !== channel);\n</script>\n\n<Card.Root>\n\t<Card.Header>\n\t\t<div class=\"flex items-start justify-between gap-3\">\n\t\t\t<Card.Title>Release channel</Card.Title>\n\t\t\t<span\n\t\t\t\tclass=\"rounded-full border px-2 py-0.5 font-mono text-xs {channel === 'beta'\n\t\t\t\t\t? 'border-warning/40 bg-warning/10 text-warning'\n\t\t\t\t\t: 'border-border bg-muted text-muted-foreground'}\"\n\t\t\t\ttitle=\"The channel this deployment currently tracks\"\n\t\t\t>\n\t\t\t\t{channel === 'beta' ? 'Beta' : 'Stable'}\n\t\t\t</span>\n\t\t</div>\n\t\t<Card.Description>\n\t\t\tWhich published line of @selvajs/* this instance updates to. Switching here only changes the\n\t\t\tchannel — run an update afterwards to install from it.\n\t\t</Card.Description>\n\t</Card.Header>\n\t<Card.Content class=\"space-y-4\">\n\t\t<form\n\t\t\tmethod=\"POST\"\n\t\t\taction=\"?/setChannel\"\n\t\t\tuse:enhance={() => {\n\t\t\t\tsaving = true;\n\t\t\t\treturn async ({ update }) => {\n\t\t\t\t\tawait update({ reset: false });\n\t\t\t\t\tsaving = false;\n\t\t\t\t};\n\t\t\t}}\n\t\t>\n\t\t\t<div class=\"grid gap-3 sm:grid-cols-2\">\n\t\t\t\t<label\n\t\t\t\t\tclass=\"flex cursor-pointer items-start gap-3 rounded-lg border px-4 py-3 transition-colors {selected ===\n\t\t\t\t\t'stable'\n\t\t\t\t\t\t? 'border-primary bg-primary/5'\n\t\t\t\t\t\t: 'border-border hover:bg-hover'}\"\n\t\t\t\t>\n\t\t\t\t\t<input\n\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\tname=\"channel\"\n\t\t\t\t\t\tvalue=\"stable\"\n\t\t\t\t\t\tbind:group={selected}\n\t\t\t\t\t\t{disabled}\n\t\t\t\t\t\tclass=\"sr-only\"\n\t\t\t\t\t/>\n\t\t\t\t\t<ShieldCheck class=\"text-success mt-0.5 h-5 w-5 shrink-0\" />\n\t\t\t\t\t<div class=\"min-w-0\">\n\t\t\t\t\t\t<p class=\"text-sm font-medium\">Stable</p>\n\t\t\t\t\t\t<p class=\"text-muted-foreground mt-0.5 text-xs\">\n\t\t\t\t\t\t\tProduction releases (npm <code class=\"font-mono\">latest</code>). The default.\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</div>\n\t\t\t\t</label>\n\n\t\t\t\t<label\n\t\t\t\t\tclass=\"flex cursor-pointer items-start gap-3 rounded-lg border px-4 py-3 transition-colors {selected ===\n\t\t\t\t\t'beta'\n\t\t\t\t\t\t? 'border-primary bg-primary/5'\n\t\t\t\t\t\t: 'border-border hover:bg-hover'}\"\n\t\t\t\t>\n\t\t\t\t\t<input\n\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\tname=\"channel\"\n\t\t\t\t\t\tvalue=\"beta\"\n\t\t\t\t\t\tbind:group={selected}\n\t\t\t\t\t\t{disabled}\n\t\t\t\t\t\tclass=\"sr-only\"\n\t\t\t\t\t/>\n\t\t\t\t\t<FlaskConical class=\"text-warning mt-0.5 h-5 w-5 shrink-0\" />\n\t\t\t\t\t<div class=\"min-w-0\">\n\t\t\t\t\t\t<p class=\"text-sm font-medium\">Beta</p>\n\t\t\t\t\t\t<p class=\"text-muted-foreground mt-0.5 text-xs\">\n\t\t\t\t\t\t\tPre-release builds (npm <code class=\"font-mono\">beta</code>). Early features, less\n\t\t\t\t\t\t\ttested.\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</div>\n\t\t\t\t</label>\n\t\t\t</div>\n\n\t\t\t{#if selected === 'beta'}\n\t\t\t\t<Callout tone=\"warning\" class=\"mt-3\">\n\t\t\t\t\tBeta builds may be unstable. You can revert to Stable here at any time and run an update\n\t\t\t\t\tto roll back to the latest stable release.\n\t\t\t\t</Callout>\n\t\t\t{/if}\n\n\t\t\t<div class=\"mt-4 flex items-center gap-3\">\n\t\t\t\t<Button type=\"submit\" disabled={!dirty || saving || disabled}>\n\t\t\t\t\t{saving ? 'Saving…' : 'Save channel'}\n\t\t\t\t</Button>\n\t\t\t\t{#if dirty}\n\t\t\t\t\t<span class=\"text-muted-foreground text-xs\">\n\t\t\t\t\t\tSwitches to <span class=\"font-medium\">{selected === 'beta' ? 'Beta' : 'Stable'}</span> — run\n\t\t\t\t\t\tan update to apply.\n\t\t\t\t\t</span>\n\t\t\t\t{/if}\n\t\t\t</div>\n\t\t</form>\n\t</Card.Content>\n</Card.Root>\n","<script lang=\"ts\">\n\timport { Button, Callout, Card } from '@selvajs/ui';\n\timport { CircleCheck, TriangleAlert, CircleX, Minus, Stethoscope } from '@lucide/svelte';\n\n\ttype CheckStatus = 'ok' | 'degraded' | 'not_applicable' | 'error';\n\n\tinterface HealthCheck {\n\t\tid: string;\n\t\tlabel: string;\n\t\tstatus: CheckStatus;\n\t\tsummary: string;\n\t\tremediation?: string;\n\t}\n\n\tinterface HealthReport {\n\t\toverall: CheckStatus;\n\t\tcheckedAt: string;\n\t\tchecks: HealthCheck[];\n\t}\n\n\tlet running = $state(false);\n\tlet report = $state<HealthReport | null>(null);\n\tlet error = $state<string | null>(null);\n\n\tconst statusStyle: Record<\n\t\tCheckStatus,\n\t\t{ text: string; icon: typeof CircleCheck; label: string }\n\t> = {\n\t\tok: { text: 'text-success', icon: CircleCheck, label: 'OK' },\n\t\tdegraded: { text: 'text-warning', icon: TriangleAlert, label: 'Degraded' },\n\t\terror: { text: 'text-destructive', icon: CircleX, label: 'Error' },\n\t\tnot_applicable: { text: 'text-muted-foreground', icon: Minus, label: 'N/A' }\n\t};\n\n\tasync function runCheck() {\n\t\trunning = true;\n\t\terror = null;\n\t\ttry {\n\t\t\tconst res = await fetch('/api/admin/system/health', { cache: 'no-store' });\n\t\t\tif (!res.ok) {\n\t\t\t\terror = `Health check request failed (HTTP ${res.status}).`;\n\t\t\t\treport = null;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treport = (await res.json()) as HealthReport;\n\t\t} catch (err) {\n\t\t\terror = err instanceof Error ? err.message : 'Health check request failed.';\n\t\t\treport = null;\n\t\t} finally {\n\t\t\trunning = false;\n\t\t}\n\t}\n</script>\n\n<Card.Root>\n\t<Card.Header>\n\t\t<Card.Title class=\"text-sm font-medium\">System health</Card.Title>\n\t\t<Card.Description>\n\t\t\tTests the things that break solving: compute server keys, the database schema, whether the\n\t\t\tdefault compute server answers, whether the data folder is writable, and the reverse-proxy and\n\t\t\tupload-limit settings that fail silently at runtime. Runs the checks fresh each time — after\n\t\t\tfixing something, run it again to confirm. Config changes need a restart first.\n\t\t</Card.Description>\n\t</Card.Header>\n\t<Card.Content class=\"space-y-4\">\n\t\t<Button onclick={runCheck} disabled={running} variant=\"outline\">\n\t\t\t<Stethoscope class=\"mr-2 h-4 w-4 {running ? 'animate-pulse' : ''}\" />\n\t\t\t{running ? 'Checking…' : 'Run health check'}\n\t\t</Button>\n\n\t\t{#if error}\n\t\t\t<Callout tone=\"danger\">{error}</Callout>\n\t\t{/if}\n\n\t\t{#if report}\n\t\t\t{@const overall = statusStyle[report.overall]}\n\t\t\t{@const OverallIcon = overall.icon}\n\t\t\t<div class=\"space-y-3\">\n\t\t\t\t<div class=\"flex items-center gap-2 text-sm font-medium {overall.text}\">\n\t\t\t\t\t<OverallIcon class=\"h-5 w-5\" />\n\t\t\t\t\t<span>\n\t\t\t\t\t\t{report.overall === 'ok'\n\t\t\t\t\t\t\t? 'All checks passed'\n\t\t\t\t\t\t\t: report.overall === 'degraded'\n\t\t\t\t\t\t\t\t? 'Attention needed'\n\t\t\t\t\t\t\t\t: report.overall === 'error'\n\t\t\t\t\t\t\t\t\t? 'Check failed to run'\n\t\t\t\t\t\t\t\t\t: 'No applicable checks'}\n\t\t\t\t\t</span>\n\t\t\t\t\t<span class=\"text-muted-foreground ml-auto text-xs font-normal\">\n\t\t\t\t\t\t{new Date(report.checkedAt).toLocaleTimeString()}\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\n\t\t\t\t<div class=\"divide-y rounded-lg border\">\n\t\t\t\t\t{#each report.checks as check (check.id)}\n\t\t\t\t\t\t{@const style = statusStyle[check.status]}\n\t\t\t\t\t\t{@const Icon = style.icon}\n\t\t\t\t\t\t<div class=\"flex items-start gap-3 px-4 py-3\">\n\t\t\t\t\t\t\t<Icon class=\"mt-0.5 h-4 w-4 shrink-0 {style.text}\" />\n\t\t\t\t\t\t\t<div class=\"min-w-0 flex-1 space-y-1\">\n\t\t\t\t\t\t\t\t<div class=\"flex items-center justify-between gap-2\">\n\t\t\t\t\t\t\t\t\t<span class=\"text-sm font-medium\">{check.label}</span>\n\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\tclass=\"rounded-full border px-2 py-0.5 font-mono text-[10px] tracking-wide uppercase {style.text}\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{style.label}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<p class=\"text-muted-foreground text-xs\">{check.summary}</p>\n\t\t\t\t\t\t\t\t{#if check.remediation}\n\t\t\t\t\t\t\t\t\t<p class=\"text-foreground text-xs\">{check.remediation}</p>\n\t\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t{/each}\n\t\t\t\t</div>\n\n\t\t\t\t<p class=\"text-muted-foreground text-xs\">\n\t\t\t\t\tThis covers what the running app can see. Checks that need the host filesystem — that\n\t\t\t\t\t<span class=\"font-mono\">.env</span> and the pm2 boot unit are in place, that no migration\n\t\t\t\t\twas interrupted, that the signing keys are real keys and not the shipped placeholder —\n\t\t\t\t\tonly run from a shell on the server:\n\t\t\t\t\t<span class=\"text-foreground font-mono\">npx selva doctor</span>\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t{/if}\n\t</Card.Content>\n</Card.Root>\n","<script lang=\"ts\">\n\timport { Button, Card, FilterableDropdown } from '@selvajs/ui';\n\timport { ArrowDown, ArrowUp, Gauge } from '@lucide/svelte';\n\n\tinterface RunResult {\n\t\tdirection: 'download' | 'upload';\n\t\tmb: number;\n\t\tms: number;\n\t\tmbps: number;\n\t\t/** Upload only: the server's own receive-side measurement. */\n\t\tserverMbps?: number | null;\n\t\tat: string;\n\t}\n\n\tconst SIZES = [10, 25, 50, 100, 200] as const;\n\tlet sizeMb = $state<number>(25);\n\tlet running = $state<'download' | 'upload' | null>(null);\n\tlet error = $state<string | null>(null);\n\tlet results = $state<RunResult[]>([]);\n\n\tfunction record(result: RunResult) {\n\t\tresults = [result, ...results].slice(0, 8);\n\t}\n\n\t// Incompressible payload so proxy compression can't fake a fast upload.\n\t// crypto.getRandomValues caps at 64 KiB per call, so fill in slices. Returns\n\t// the raw ArrayBuffer — a directly valid fetch BodyInit.\n\tfunction randomBytes(totalBytes: number): ArrayBuffer {\n\t\tconst buffer = new ArrayBuffer(totalBytes);\n\t\tconst view = new Uint8Array(buffer);\n\t\tconst step = 65536;\n\t\tfor (let offset = 0; offset < totalBytes; offset += step) {\n\t\t\tcrypto.getRandomValues(view.subarray(offset, Math.min(offset + step, totalBytes)));\n\t\t}\n\t\treturn buffer;\n\t}\n\n\tasync function runDownload() {\n\t\trunning = 'download';\n\t\terror = null;\n\t\ttry {\n\t\t\tconst start = performance.now();\n\t\t\tconst res = await fetch(`/api/admin/system/throughput?mb=${sizeMb}`, {\n\t\t\t\tcache: 'no-store'\n\t\t\t});\n\t\t\tif (!res.ok || !res.body) {\n\t\t\t\terror = `Download test failed (HTTP ${res.status}).`;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Stream-read so we measure arrival, not a buffered copy at the end.\n\t\t\tconst reader = res.body.getReader();\n\t\t\tlet bytes = 0;\n\t\t\twhile (true) {\n\t\t\t\tconst { done, value } = await reader.read();\n\t\t\t\tif (done) break;\n\t\t\t\tbytes += value.byteLength;\n\t\t\t}\n\t\t\tconst ms = performance.now() - start;\n\t\t\trecord({\n\t\t\t\tdirection: 'download',\n\t\t\t\tmb: bytes / (1024 * 1024),\n\t\t\t\tms: Math.round(ms),\n\t\t\t\tmbps: bytes / (1024 * 1024) / (ms / 1000),\n\t\t\t\tat: new Date().toLocaleTimeString()\n\t\t\t});\n\t\t} catch (err) {\n\t\t\terror = err instanceof Error ? err.message : 'Download test failed.';\n\t\t} finally {\n\t\t\trunning = null;\n\t\t}\n\t}\n\n\tasync function runUpload() {\n\t\trunning = 'upload';\n\t\terror = null;\n\t\ttry {\n\t\t\tconst body = randomBytes(sizeMb * 1024 * 1024);\n\t\t\tconst start = performance.now();\n\t\t\tconst res = await fetch('/api/admin/system/throughput', {\n\t\t\t\tmethod: 'POST',\n\t\t\t\theaders: { 'Content-Type': 'application/octet-stream' },\n\t\t\t\tbody\n\t\t\t});\n\t\t\tconst ms = performance.now() - start;\n\t\t\tif (!res.ok) {\n\t\t\t\terror =\n\t\t\t\t\tres.status === 413\n\t\t\t\t\t\t? `Upload rejected (HTTP 413) — a body-size limit in the chain is below ${sizeMb} MB ` +\n\t\t\t\t\t\t\t`(adapter-node BODY_SIZE_LIMIT, or a proxy request cap).`\n\t\t\t\t\t\t: `Upload test failed (HTTP ${res.status}).`;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst server = (await res.json()) as { mbps: number | null };\n\t\t\trecord({\n\t\t\t\tdirection: 'upload',\n\t\t\t\tmb: sizeMb,\n\t\t\t\tms: Math.round(ms),\n\t\t\t\tmbps: sizeMb / (ms / 1000),\n\t\t\t\tserverMbps: server.mbps,\n\t\t\t\tat: new Date().toLocaleTimeString()\n\t\t\t});\n\t\t} catch (err) {\n\t\t\terror = err instanceof Error ? err.message : 'Upload test failed.';\n\t\t} finally {\n\t\t\trunning = null;\n\t\t}\n\t}\n</script>\n\n<Card.Root>\n\t<Card.Header>\n\t\t<Card.Title class=\"text-sm font-medium\">Network throughput</Card.Title>\n\t\t<Card.Description>\n\t\t\tTransfers incompressible random data between this browser and the server — through every\n\t\t\tproxy/tunnel on the path — to measure real transport speed in each direction. No compute\n\t\t\tinvolvement; large solve transfers can't go faster than these numbers.\n\t\t</Card.Description>\n\t</Card.Header>\n\t<Card.Content class=\"space-y-4\">\n\t\t<div class=\"flex flex-wrap items-center gap-2\">\n\t\t\t<label class=\"text-muted-foreground text-sm\" for=\"throughput-size\">Test size</label>\n\t\t\t<FilterableDropdown\n\t\t\t\tid=\"throughput-size\"\n\t\t\t\titems={SIZES.map((size) => ({ id: String(size), label: `${size} MB` }))}\n\t\t\t\tvalue={String(sizeMb)}\n\t\t\t\tonChange={(v) => (sizeMb = Number(v))}\n\t\t\t\tdisabled={running !== null}\n\t\t\t\tsize=\"sm\"\n\t\t\t\tclass=\"w-28\"\n\t\t\t/>\n\t\t\t<Button size=\"sm\" variant=\"outline\" onclick={runDownload} disabled={running !== null}>\n\t\t\t\t<ArrowDown class=\"mr-1 size-4\" />\n\t\t\t\t{running === 'download' ? 'Downloading…' : 'Download test'}\n\t\t\t</Button>\n\t\t\t<Button size=\"sm\" variant=\"outline\" onclick={runUpload} disabled={running !== null}>\n\t\t\t\t<ArrowUp class=\"mr-1 size-4\" />\n\t\t\t\t{running === 'upload' ? 'Uploading…' : 'Upload test'}\n\t\t\t</Button>\n\t\t</div>\n\n\t\t{#if error}\n\t\t\t<p class=\"text-destructive text-sm\">{error}</p>\n\t\t{/if}\n\n\t\t{#if results.length > 0}\n\t\t\t<ul class=\"space-y-1\">\n\t\t\t\t{#each results as r (r.at + r.direction + r.ms)}\n\t\t\t\t\t<li class=\"flex items-center gap-2 font-mono text-sm\">\n\t\t\t\t\t\t<Gauge class=\"text-muted-foreground size-4\" />\n\t\t\t\t\t\t<span class=\"text-muted-foreground\">{r.at}</span>\n\t\t\t\t\t\t<span>{r.direction === 'download' ? '↓' : '↑'} {r.mb.toFixed(0)} MB</span>\n\t\t\t\t\t\t<span class=\"font-semibold\">{r.mbps.toFixed(1)} MB/s</span>\n\t\t\t\t\t\t<span class=\"text-muted-foreground\">({(r.ms / 1000).toFixed(1)}s)</span>\n\t\t\t\t\t\t{#if r.serverMbps != null}\n\t\t\t\t\t\t\t<span class=\"text-muted-foreground\">· server-side {r.serverMbps.toFixed(1)} MB/s</span\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t{/if}\n\t\t\t\t\t</li>\n\t\t\t\t{/each}\n\t\t\t</ul>\n\t\t{/if}\n\t</Card.Content>\n</Card.Root>\n","<script lang=\"ts\">\n\timport { Callout, Search, Switch } from '@selvajs/ui';\n\timport { Check, ChevronRight, Copy } from '@lucide/svelte';\n\timport type {\n\t\tConfigChange,\n\t\tConfigReport,\n\t\tKeyRotation,\n\t\tReportRow\n\t} from '@selvajs/platform/config';\n\timport type { ConfigCheck } from '#lib/server/config/checks.js';\n\n\tlet {\n\t\treport,\n\t\tchanges,\n\t\trotation,\n\t\tproxied,\n\t\tchecks\n\t}: {\n\t\treport: ConfigReport;\n\t\tchanges: ConfigChange[];\n\t\trotation: KeyRotation[];\n\t\tproxied: boolean;\n\t\tchecks: ConfigCheck[];\n\t} = $props();\n\n\tconst problems = $derived(checks.filter((c) => c.level !== 'info'));\n\tconst notes = $derived(checks.filter((c) => c.level === 'info'));\n\tconst flagged = $derived(new Set(problems.flatMap((c) => c.keys)));\n\n\tconst rotating = $derived(\n\t\tnew Set(rotation.filter((r) => r.state !== 'none').map((r) => `${r.key}_PREVIOUS`))\n\t);\n\tconst PROXY_KEYS = ['ADDRESS_HEADER', 'XFF_DEPTH'];\n\n\t// Each group answers one question an admin has. A row a group doesn't show (an idle rotation\n\t// slot, proxy headers without a proxy) still appears under \"All settings\".\n\tconst groups = $derived.by(() => {\n\t\tconst byKey = new Map(report.rows.map((r) => [r.key, r]));\n\t\tconst pick = (keys: string[]) => keys.flatMap((k) => byKey.get(k) ?? []);\n\t\treturn [\n\t\t\t{\n\t\t\t\ttitle: 'Reaching your server',\n\t\t\t\trows: pick([\n\t\t\t\t\t'ORIGIN',\n\t\t\t\t\t'HOST',\n\t\t\t\t\t'BODY_SIZE_LIMIT',\n\t\t\t\t\t...PROXY_KEYS.filter((k) => proxied || (byKey.get(k)?.source ?? 'unset') !== 'unset')\n\t\t\t\t])\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: 'Where data lives',\n\t\t\t\trows: pick([\n\t\t\t\t\t'SELVA_DATA_PROVIDER',\n\t\t\t\t\t'SELVA_STORAGE_PROVIDER',\n\t\t\t\t\t'DATA_PATH',\n\t\t\t\t\t'SUPABASE_URL',\n\t\t\t\t\t'SELVA_TENANCY'\n\t\t\t\t])\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: 'Sign-in',\n\t\t\t\trows: pick([\n\t\t\t\t\t'SELVA_AUTH_PROVIDER',\n\t\t\t\t\t'SIGN_IN_MAX_AGE_DAYS',\n\t\t\t\t\t'BOOTSTRAP_INSTANCE_ADMIN_EMAIL'\n\t\t\t\t])\n\t\t\t},\n\t\t\t{\n\t\t\t\ttitle: 'Security keys',\n\t\t\t\trows: pick(\n\t\t\t\t\t[\n\t\t\t\t\t\t'SELVA_HMAC_KEY',\n\t\t\t\t\t\t'SELVA_HMAC_KEY_PREVIOUS',\n\t\t\t\t\t\t'SELVA_AT_REST_KEY',\n\t\t\t\t\t\t'SELVA_AT_REST_KEY_PREVIOUS'\n\t\t\t\t\t].filter((k) => !k.endsWith('_PREVIOUS') || rotating.has(k))\n\t\t\t\t)\n\t\t\t}\n\t\t].filter((g) => g.rows.length > 0);\n\t});\n\n\tlet showUntouched = $state(false);\n\tlet allOpen = $state(false);\n\tconst isConfigured = (r: ReportRow) =>\n\t\t!!r.problem || (r.source !== 'unset' && r.source !== 'default');\n\tconst untouchedCount = $derived(report.rows.filter((r) => !isConfigured(r)).length);\n\tconst allRows = $derived(showUntouched ? report.rows : report.rows.filter(isConfigured));\n\n\tlet query = $state('');\n\tconst matches = $derived.by(() => {\n\t\tconst q = query.trim().toLowerCase();\n\t\tif (!q) return [];\n\t\treturn report.rows.filter((r) =>\n\t\t\t[r.key, r.label ?? '', r.description, r.display].some((s) => s.toLowerCase().includes(q))\n\t\t);\n\t});\n\n\t// ==========================================================================\n\t// Values as meaning\n\t// ==========================================================================\n\n\ttype Shown = {\n\t\ttext: string;\n\t\ttone: 'value' | 'muted' | 'ok' | 'bad';\n\t\tmono: boolean;\n\t\ttitle?: string;\n\t};\n\n\tfunction shown(r: ReportRow): Shown {\n\t\tif (r.source === 'unset') {\n\t\t\treturn r.required\n\t\t\t\t? { text: 'Missing', tone: 'bad', mono: false }\n\t\t\t\t: { text: 'Not set', tone: 'muted', mono: false };\n\t\t}\n\t\tif (r.display === 'set' || r.display.startsWith('sha256:')) {\n\t\t\t// A fingerprint tells two servers' keys apart; it isn't something to read.\n\t\t\treturn {\n\t\t\t\ttext: 'Set',\n\t\t\t\ttone: 'ok',\n\t\t\t\tmono: false,\n\t\t\t\ttitle: r.display === 'set' ? undefined : r.display\n\t\t\t};\n\t\t}\n\t\tif (r.type === 'bool') {\n\t\t\tconst on = ['true', '1', 'yes', 'on'].includes(r.display.toLowerCase());\n\t\t\treturn { text: on ? 'On' : 'Off', tone: on ? 'ok' : 'muted', mono: false };\n\t\t}\n\t\tif (r.type === 'list' && r.display === '') return { text: 'None', tone: 'muted', mono: false };\n\t\tif (r.type === 'int') {\n\t\t\tconst n = Number(r.display);\n\t\t\tif (n === 0 && r.zero) return { text: r.zero, tone: 'muted', mono: false };\n\t\t\tif (Number.isFinite(n) && r.unit)\n\t\t\t\treturn { text: withUnit(n, r.unit), tone: 'value', mono: false, title: r.display };\n\t\t}\n\t\treturn { text: r.display || '—', tone: 'value', mono: true, title: r.display };\n\t}\n\n\tfunction withUnit(n: number, unit: NonNullable<ReportRow['unit']>): string {\n\t\tif (unit === 'days') return `${n} ${n === 1 ? 'day' : 'days'}`;\n\t\tif (unit === 'mb') return n >= 1024 ? `${+(n / 1024).toFixed(1)} GB` : `${n} MB`;\n\t\tif (unit === 'bytes') {\n\t\t\tif (n >= 1024 ** 3) return `${+(n / 1024 ** 3).toFixed(1)} GB`;\n\t\t\tif (n >= 1024 ** 2) return `${+(n / 1024 ** 2).toFixed(1)} MB`;\n\t\t\treturn n >= 1024 ? `${Math.round(n / 1024)} KB` : `${n} B`;\n\t\t}\n\t\tif (n >= 3_600_000) return `${+(n / 3_600_000).toFixed(1)} h`;\n\t\tif (n >= 60_000) return `${+(n / 60_000).toFixed(1)} min`;\n\t\tif (n >= 1000) return `${+(n / 1000).toFixed(1)} s`;\n\t\treturn `${n} ms`;\n\t}\n\n\tfunction sourceLabel(r: ReportRow): string {\n\t\tif (r.source === 'default') return 'default';\n\t\tif (r.source === 'alias') return `from ${r.alias}`;\n\t\treturn 'set in .env';\n\t}\n\n\tconst TONE: Record<Shown['tone'], string> = {\n\t\tvalue: 'bg-muted text-foreground',\n\t\tmuted: 'text-muted-foreground',\n\t\tok: 'text-success',\n\t\tbad: 'bg-destructive/10 text-destructive'\n\t};\n\n\tconst ROTATE: Record<string, { name: string; arg: string; breaks: string }> = {\n\t\tSELVA_HMAC_KEY: {\n\t\t\tname: 'signing key',\n\t\t\targ: 'hmac',\n\t\t\tbreaks: 'Sessions, links and tokens signed with the old key keep working for 30 days.'\n\t\t},\n\t\tSELVA_AT_REST_KEY: {\n\t\t\tname: 'encryption key',\n\t\t\targ: 'at-rest',\n\t\t\tbreaks: 'Stored compute API keys are re-encrypted with the new key when the app restarts.'\n\t\t}\n\t};\n\n\tlet copied = $state<string | null>(null);\n\tasync function copy(text: string) {\n\t\tawait navigator.clipboard.writeText(text);\n\t\tcopied = text;\n\t\tsetTimeout(() => {\n\t\t\tif (copied === text) copied = null;\n\t\t}, 1500);\n\t}\n</script>\n\n{#snippet commands(lines: string[])}\n\t<div class=\"bg-muted mt-2 flex items-start gap-2 rounded-md px-3 py-2\">\n\t\t<pre\n\t\t\tclass=\"text-foreground min-w-0 flex-1 overflow-x-auto font-mono text-xs leading-relaxed\">{lines.join(\n\t\t\t\t'\\n'\n\t\t\t)}</pre>\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tclass=\"text-faint-foreground hover:text-foreground hover:bg-hover -m-1 shrink-0 rounded-sm p-1\"\n\t\t\taria-label=\"Copy commands\"\n\t\t\tonclick={() => copy(lines.join('\\n'))}\n\t\t>\n\t\t\t{#if copied === lines.join('\\n')}<Check class=\"size-3.5\" />{:else}<Copy\n\t\t\t\t\tclass=\"size-3.5\"\n\t\t\t\t/>{/if}\n\t\t</button>\n\t</div>\n{/snippet}\n\n{#snippet configRow(row: ReportRow)}\n\t{@const v = shown(row)}\n\t<div class=\"px-4 py-3\">\n\t\t<div class=\"flex items-start justify-between gap-4\">\n\t\t\t<div class=\"min-w-0 flex-1\">\n\t\t\t\t<p class=\"text-foreground flex items-center gap-1.5 text-sm leading-snug font-medium\">\n\t\t\t\t\t{#if flagged.has(row.key)}\n\t\t\t\t\t\t<span class=\"bg-warning size-1.5 shrink-0 rounded-full\" aria-label=\"Needs attention\"\n\t\t\t\t\t\t></span>\n\t\t\t\t\t{/if}\n\t\t\t\t\t{row.label ?? row.key}\n\t\t\t\t</p>\n\t\t\t\t<p class=\"text-muted-foreground mt-0.5 text-xs leading-snug\">{row.description}</p>\n\t\t\t\t<code class=\"text-faint-foreground text-2xs mt-1 block font-mono\">{row.key}</code>\n\t\t\t\t{#if row.problem}\n\t\t\t\t\t<p class=\"text-destructive mt-1 text-xs\">Value {row.problem}.</p>\n\t\t\t\t{/if}\n\t\t\t</div>\n\t\t\t<div class=\"flex shrink-0 flex-col items-end gap-1\">\n\t\t\t\t<span\n\t\t\t\t\tclass={`max-w-64 truncate rounded-sm px-2 py-0.5 text-xs ${v.mono ? 'font-mono' : 'font-medium'} ${TONE[v.tone]}`}\n\t\t\t\t\ttitle={v.title}\n\t\t\t\t>\n\t\t\t\t\t{#if v.tone === 'ok' && v.text === 'Set'}<Check\n\t\t\t\t\t\t\tclass=\"mr-0.5 inline size-3 align-[-2px]\"\n\t\t\t\t\t\t/>{/if}{v.text}\n\t\t\t\t</span>\n\t\t\t\t{#if row.source !== 'unset'}\n\t\t\t\t\t<span class=\"text-faint-foreground text-2xs\">{sourceLabel(row)}</span>\n\t\t\t\t{/if}\n\t\t\t</div>\n\t\t</div>\n\t\t{#if ROTATE[row.key]}\n\t\t\t{@const r = ROTATE[row.key]}\n\t\t\t<details class=\"group mt-2\">\n\t\t\t\t<summary\n\t\t\t\t\tclass=\"text-muted-foreground hover:text-foreground flex w-fit cursor-pointer items-center gap-1 text-xs select-none\"\n\t\t\t\t>\n\t\t\t\t\t<ChevronRight class=\"size-3 transition-transform group-open:rotate-90\" />\n\t\t\t\t\tChange the {r.name}\n\t\t\t\t</summary>\n\t\t\t\t<div class=\"text-muted-foreground mt-2 space-y-1 pl-4 text-xs\">\n\t\t\t\t\t<p>\n\t\t\t\t\t\tDo this if the key may have leaked, or as routine hygiene. On the server, in the install\n\t\t\t\t\t\tfolder, run:\n\t\t\t\t\t</p>\n\t\t\t\t\t{@render commands([`npx selva keys rotate ${r.arg}`, 'npx selva restart'])}\n\t\t\t\t\t<p class=\"pt-1\">\n\t\t\t\t\t\t{r.breaks} If the old key leaked and must stop working now, use\n\t\t\t\t\t\t<code class=\"font-mono\">--leaked</code> instead; that signs everyone out.\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t</details>\n\t\t{/if}\n\t</div>\n{/snippet}\n\n<div class=\"space-y-6\">\n\t<section class=\"space-y-2\">\n\t\t{#if problems.length === 0}\n\t\t\t<Callout tone=\"success\" title=\"Nothing needs your attention\">\n\t\t\t\tEvery setting this server reads has a usable value.\n\t\t\t</Callout>\n\t\t{/if}\n\t\t{#each [...problems, ...notes] as c (c.id)}\n\t\t\t<Callout\n\t\t\t\ttone={c.level === 'error' ? 'danger' : c.level === 'warning' ? 'warning' : 'info'}\n\t\t\t\ttitle={c.title}\n\t\t\t>\n\t\t\t\t<p>{c.detail}</p>\n\t\t\t\t{#if c.fix}\n\t\t\t\t\t<p class=\"pt-1\">To fix it, run on the server:</p>\n\t\t\t\t\t{@render commands(c.fix)}\n\t\t\t\t{/if}\n\t\t\t</Callout>\n\t\t{/each}\n\t</section>\n\n\t{#if changes.length > 0}\n\t\t<div class=\"space-y-1 rounded-lg border px-4 py-3 text-xs\">\n\t\t\t<p class=\"font-medium\">Changed since the last start</p>\n\t\t\t{#each changes as c (c.key)}\n\t\t\t\t<p class=\"text-muted-foreground\">\n\t\t\t\t\t<code class=\"text-foreground font-mono\">{c.key}</code>\n\t\t\t\t\t{#if c.change === 'added'}set{c.to !== undefined ? ` to ${c.to}` : ''}\n\t\t\t\t\t{:else if c.change === 'removed'}removed{c.from !== undefined ? ` (was ${c.from})` : ''}\n\t\t\t\t\t{:else if c.from !== undefined}{c.from} → {c.to}\n\t\t\t\t\t{:else}changed{/if}\n\t\t\t\t</p>\n\t\t\t{/each}\n\t\t</div>\n\t{/if}\n\n\t<Search bind:value={query} clearable placeholder=\"Search {report.rows.length} settings\" />\n\n\t{#if query.trim()}\n\t\t<div class=\"divide-y rounded-lg border\">\n\t\t\t{#each matches as row (row.key)}\n\t\t\t\t{@render configRow(row)}\n\t\t\t{:else}\n\t\t\t\t<p class=\"text-muted-foreground px-4 py-6 text-center text-sm\">No setting matches.</p>\n\t\t\t{/each}\n\t\t</div>\n\t{:else}\n\t\t{#each groups as group (group.title)}\n\t\t\t<section class=\"space-y-2.5\">\n\t\t\t\t<h3 class=\"text-foreground flex items-baseline gap-2 text-sm font-semibold\">\n\t\t\t\t\t{group.title}\n\t\t\t\t\t{#if group.title === 'Reaching your server'}\n\t\t\t\t\t\t<span class=\"text-muted-foreground text-xs font-normal\">\n\t\t\t\t\t\t\t{proxied\n\t\t\t\t\t\t\t\t? 'This request came through a reverse proxy.'\n\t\t\t\t\t\t\t\t: 'This request reached the app directly, without a proxy.'}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t{/if}\n\t\t\t\t</h3>\n\t\t\t\t<div class=\"divide-y rounded-lg border\">\n\t\t\t\t\t{#each group.rows as row (row.key)}\n\t\t\t\t\t\t{@render configRow(row)}\n\t\t\t\t\t{/each}\n\t\t\t\t</div>\n\t\t\t</section>\n\t\t{/each}\n\n\t\t<details class=\"group rounded-lg border\" bind:open={allOpen}>\n\t\t\t<summary\n\t\t\t\tclass=\"hover:bg-hover flex cursor-pointer items-center gap-2 rounded-lg px-4 py-3 text-sm font-semibold select-none\"\n\t\t\t>\n\t\t\t\t<ChevronRight class=\"size-4 shrink-0 transition-transform group-open:rotate-90\" />\n\t\t\t\tAll settings\n\t\t\t\t<span class=\"text-muted-foreground text-xs font-normal\"\n\t\t\t\t\t>for fine-tuning; most never need changing</span\n\t\t\t\t>\n\t\t\t\t<span class=\"text-muted-foreground ml-auto font-mono text-xs\">{report.rows.length}</span>\n\t\t\t</summary>\n\t\t\t{#if allOpen}\n\t\t\t\t<div class=\"border-t\">\n\t\t\t\t\t{#if untouchedCount > 0}\n\t\t\t\t\t\t<label\n\t\t\t\t\t\t\tclass=\"text-muted-foreground flex cursor-pointer items-center gap-2 border-b px-4 py-2.5 text-xs\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Switch bind:checked={showUntouched} />\n\t\t\t\t\t\t\tInclude {untouchedCount} settings left at their default or unset\n\t\t\t\t\t\t</label>\n\t\t\t\t\t{/if}\n\t\t\t\t\t<div class=\"divide-y\">\n\t\t\t\t\t\t{#each allRows as row (row.key)}\n\t\t\t\t\t\t\t{@render configRow(row)}\n\t\t\t\t\t\t{/each}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t{/if}\n\t\t</details>\n\t{/if}\n</div>\n","// ============================================================================\n// Restart-wait polling\n// ============================================================================\n//\n// After the update runner is daemonized, the SSE stream dies at `pm2 stop` and\n// the browser's only remaining view of the update is polling. This module owns\n// that poll loop, kept separate from the admin page so its inputs (three probe\n// results and a clock) and output (a verdict) stay testable with the clock and\n// probes injected — a 5-minute deadline runs in microseconds.\n//\n// **Every probe MUST settle.** The loop awaits `Promise.all` of the three, so a\n// probe that hangs forever hangs the loop, deadline or not. A probe against a\n// stopped app usually does NOT fail fast — the reverse proxy in front of it\n// holds the connection open until its own read timeout rather than refusing\n// it. Bounding that is the caller's job (`AbortSignal.timeout` on each fetch);\n// without it the UI freezes on \"PM2 is restarting…\" until a manual reload.\n\nexport interface RestartHealth {\n\tstatus: string;\n\tinstanceId?: string | null;\n\tversion?: string | null;\n}\n\n/**\n * The three probes the loop runs each tick. Each resolves to a \"nothing yet\"\n * value rather than rejecting — a failed probe during the restart blackout is\n * the expected case, not an error.\n */\nexport interface RestartProbes {\n\t/**\n\t * /api/health — null when unreachable or still booting. A 503 `degraded`\n\t * body still counts as reachable: the process is up and answering.\n\t */\n\thealth(): Promise<RestartHealth | null>;\n\t/** The tee'd update log file — null when the fetch failed. */\n\tlog(): Promise<string | null>;\n\t/** The heavier readiness route — true only on a real 200. */\n\tready(): Promise<boolean>;\n}\n\nexport interface PollDeps {\n\tprobes: RestartProbes;\n\tnow(): number;\n\tsleep(ms: number): Promise<void>;\n\t/** Replaces the displayed log content. */\n\tonLog(logs: string): void;\n\t/** Appends one line — the waiting notice, the timeout notice. */\n\tappendLog(line: string): void;\n}\n\nexport interface RestartVerdict {\n\texitCode: number;\n}\n\n/** Must match `TIMED_OUT` in update-outcome.ts. */\nconst NEVER_CAME_BACK = -2;\n\n/** How long to give PM2 to actually kill the old process before polling. */\nexport const SETTLE_MS = 2000;\n/** Gap between poll ticks. */\nexport const POLL_INTERVAL_MS = 2000;\n/**\n * npm update on a slow VPS with a cold packument cache plus a pm2 cold start\n * can legitimately take 60–90s; an earlier 90s deadline was failing live\n * updates that were otherwise succeeding in the background.\n */\nexport const RESTART_DEADLINE_MS = 5 * 60 * 1000;\n\n/**\n * The health poll only proves the app is *reachable* — NOT that the update\n * succeeded. A rollback (runner exit 5) leaves the app perfectly healthy on\n * the OLD version; reporting that as exit 0 would tell the operator the\n * update worked. So this reads the runner's own verdict out of the log.\n *\n * Returns null when the log carries no terminal marker yet.\n */\nexport function exitCodeFromLog(log: string): number | null {\n\tif (/\\bManual recovery required\\b/.test(log)) return 6; // rollback failed — app may be DOWN\n\tif (/\\bRolled back to .* — previous version is online\\b/.test(log)) return 5; // safe rollback\n\tif (/New process failed health check/.test(log) && !/Rolled back/.test(log)) return 3;\n\tif (/\\[FATAL\\]/.test(log) && !/\\[DONE\\]/.test(log)) return 1; // fatal with no clean finish\n\tif (/\\[DONE\\]/.test(log)) return 0; // runner reported clean completion\n\treturn null;\n}\n\n/**\n * Polls until the *new* process is confirmed serving, or the deadline passes.\n *\n * The reliable signal is `instanceId`: a per-boot fingerprint from /api/health\n * that changes on every restart. We wait for it to differ from the process\n * running before we started — the only moment we know the old process is gone\n * and a fresh one is answering. Works in every deployment shape (npm has no\n * git commit) and even when the new build is the same version.\n *\n * A fresh instanceId alone is not treated as done: /api/health answers the\n * instant the process boots, a beat before real routes serve through the\n * proxy, so a premature \"online\" verdict left an immediate reload hitting a\n * 502. The heavier readiness probe closes that gap as an *accelerator*, never\n * a requirement — it re-runs live integrity checks per request, so it reports\n * false whenever an unrelated dependency is down, and can outrun the caller's\n * probe timeout on a slow host. So the loop finishes on either signal:\n * readiness going green, or the runner writing its own terminal marker to the\n * log. Requiring both is what hung a *successful* update on \"PM2 is\n * restarting…\" until the deadline turned it into a false failure.\n */\nexport async function pollForRestart(\n\tpreviousInstanceId: string | null | undefined,\n\tdeps: PollDeps\n): Promise<RestartVerdict> {\n\tconst { probes, now, sleep, onLog, appendLog } = deps;\n\n\tappendLog('\\nWaiting for app to come back online…\\n');\n\tawait sleep(SETTLE_MS);\n\n\t// A deadline, not an attempt count: a slow probe costs real seconds instead\n\t// of returning instantly, so N attempts × interval understates wall-clock.\n\tconst deadline = now() + RESTART_DEADLINE_MS;\n\n\t// Mirrors what the caller displays, so the log-derived verdict sees the\n\t// same content the operator does.\n\tlet logs = '';\n\n\twhile (now() < deadline) {\n\t\tconst [health, log, ready] = await Promise.all([probes.health(), probes.log(), probes.ready()]);\n\n\t\t// Empty bodies are ignored — the file isn't there yet, and clobbering the\n\t\t// SSE-collected prefix with nothing would lose it.\n\t\tif (log && log.trim().length > 0) {\n\t\t\tlogs = log;\n\t\t\tonLog(log);\n\t\t}\n\n\t\tconst logVerdict = exitCodeFromLog(logs);\n\t\tconst freshInstance = !!health?.instanceId && health.instanceId !== previousInstanceId;\n\n\t\t// Trust the runner's logged verdict over a bare assumption of success — a\n\t\t// rollback also brings up a fresh process but must not read as a clean\n\t\t// update.\n\t\tif (freshInstance && ready) {\n\t\t\treturn { exitCode: logVerdict ?? 0 };\n\t\t}\n\n\t\t// A fresh process is answering AND the runner wrote its terminal marker,\n\t\t// but the heavy readiness route hasn't gone green. Readiness is a\n\t\t// *quality* signal, not a liveness one — it stays false whenever an\n\t\t// unrelated dependency is down (an unreachable compute server is the\n\t\t// common one) and can outrun the caller's probe timeout on a slow host.\n\t\t// Requiring it here is what left a finished update spinning on \"PM2 is\n\t\t// restarting…\" until the deadline reported a false failure. The runner's\n\t\t// own marker is the authority on whether the update finished.\n\t\tif (freshInstance && logVerdict !== null) {\n\t\t\treturn { exitCode: logVerdict };\n\t\t}\n\n\t\t// No-restart terminal: the runner reached a verdict WITHOUT bringing up a\n\t\t// new process — the pre-flight \"already up to date\" path exits before\n\t\t// `pm2 stop`, and an early failure aborts while the old process still\n\t\t// serves. In both cases instanceId never changes, so the fresh-instance\n\t\t// branches can never fire and keying on them alone would wait out the\n\t\t// full deadline. When the app is reachable on the SAME instanceId and the\n\t\t// log carries a terminal marker, that marker IS the outcome.\n\t\tif (logVerdict !== null && health && health.instanceId === previousInstanceId) {\n\t\t\treturn { exitCode: logVerdict };\n\t\t}\n\n\t\t// No baseline instanceId (the pre-update health fetch failed, or an old\n\t\t// build with no fingerprint): can't tell the new process from the old one\n\t\t// by id, so hold out for the runner's own terminal marker rather than\n\t\t// latching onto the still-running old process.\n\t\tif (!previousInstanceId && health && logVerdict !== null) {\n\t\t\treturn { exitCode: logVerdict };\n\t\t}\n\n\t\tawait sleep(POLL_INTERVAL_MS);\n\t}\n\n\t// Final fetch so the post-mortem carries the latest content the script\n\t// managed to write before the deadline.\n\tconst finalLog = await probes.log();\n\tif (finalLog && finalLog.trim().length > 0) onLog(finalLog);\n\tappendLog('\\n⚠ App did not come back within 5 minutes — check PM2 logs.\\n');\n\treturn { exitCode: NEVER_CAME_BACK };\n}\n","<script lang=\"ts\">\n\timport { page } from '$app/state';\n\timport { replaceState } from '$app/navigation';\n\timport { Card, SectionHeader, Tabs } from '@selvajs/ui';\n\timport { ChevronRight } from '@lucide/svelte';\n\timport UpdateSection from './UpdateSection.svelte';\n\timport ChannelSection from './ChannelSection.svelte';\n\timport HealthSection from './HealthSection.svelte';\n\timport NetworkSection from './NetworkSection.svelte';\n\timport ConfigSection from './ConfigSection.svelte';\n\timport type { ConfigChange, ConfigReport, KeyRotation } from '@selvajs/platform/config';\n\timport type { ConfigCheck } from '#lib/server/config/checks.js';\n\timport { pollForRestart, type RestartHealth } from '#lib/update-restart-poll.js';\n\n\tinterface PageData {\n\t\tcanManageUpdates: boolean;\n\t\tisInstanceAdmin: boolean;\n\t\tversion: string;\n\t\tchannel: 'stable' | 'beta';\n\t\tupdate: {\n\t\t\tlatest: string | null;\n\t\t\tupdateAvailable: boolean;\n\t\t\tnodeCompatibility: { compatible: boolean | null; required: string | null; running: string };\n\t\t\tdataCompatibility: { compatible: boolean | null; installed: number; target: number | null };\n\t\t};\n\t\tconfig: {\n\t\t\treport: ConfigReport;\n\t\t\tchanges: ConfigChange[];\n\t\t\trotation: KeyRotation[];\n\t\t\tproxied: boolean;\n\t\t\tchecks: ConfigCheck[];\n\t\t} | null;\n\t\tflags: {\n\t\t\tALLOW_CROSS_ORG_PUBLIC: boolean;\n\t\t\tALLOW_ORG_COMPUTE_OVERRIDE: boolean;\n\t\t\tALLOW_ORG_CREATION: boolean;\n\t\t\tENABLE_PLATFORM_PROJECTS: boolean;\n\t\t\tENABLE_SHARING: boolean;\n\t\t};\n\t\tlimits: {\n\t\t\tRATE_LIMIT_WINDOW_MS: number;\n\t\t\tRATE_LIMIT_MAX_REQUESTS: number;\n\t\t\tMAX_DEFINITION_FILE_SIZE: number;\n\t\t\tMAX_IMAGE_FILE_SIZE: number;\n\t\t\tCOMPUTE_REQUEST_MAX_BYTES: number;\n\t\t\tCOMPUTE_RESPONSE_MAX_BYTES: number;\n\t\t\tREMOTE_DEFINITION_MAX_BYTES: number;\n\t\t\tREMOTE_DEFINITION_FETCH_TIMEOUT_MS: number;\n\t\t\tREMOTE_DEFINITION_CACHE_TTL_MS: number;\n\t\t\tCOMPUTE_DEFINITION_CACHE_BYTES: number;\n\t\t\tCOMPUTE_SOLVE_CACHE_BYTES: number;\n\t\t};\n\t}\n\tlet { data }: { data: PageData } = $props();\n\n\t// One tab per concern instead of one long page. The tab lives in `?tab=` so a link or a\n\t// reload lands on the same one.\n\tconst tabs = $derived(\n\t\t[\n\t\t\t{ id: 'updates', label: 'Updates', show: data.canManageUpdates },\n\t\t\t{ id: 'health', label: 'Health & network', show: data.isInstanceAdmin },\n\t\t\t{ id: 'config', label: 'Configuration', show: true }\n\t\t].filter((t) => t.show)\n\t);\n\tlet requestedTab = $state(page.url.searchParams.get('tab'));\n\tconst activeTab = $derived(\n\t\ttabs.find((t) => t.id === requestedTab)?.id ?? tabs[0]?.id ?? 'config'\n\t);\n\n\tfunction selectTab(id: string) {\n\t\trequestedTab = id;\n\t\tconst url = new URL(page.url.href);\n\t\turl.searchParams.set('tab', id);\n\t\treplaceState(url, page.state);\n\t}\n\n\tfunction formatBytes(bytes: number): string {\n\t\tif (bytes >= 1024 * 1024 * 1024) return `${(bytes / (1024 * 1024 * 1024)).toFixed(1)} GB`;\n\t\tif (bytes >= 1024 * 1024) return `${Math.round(bytes / (1024 * 1024))} MB`;\n\t\tif (bytes >= 1024) return `${Math.round(bytes / 1024)} KB`;\n\t\treturn `${bytes} B`;\n\t}\n\n\tfunction formatMs(ms: number): string {\n\t\tif (ms >= 60_000) {\n\t\t\tconst mins = ms / 60_000;\n\t\t\treturn `${Number.isInteger(mins) ? mins : mins.toFixed(1)} min`;\n\t\t}\n\t\tif (ms >= 1000) {\n\t\t\tconst s = ms / 1000;\n\t\t\treturn `${Number.isInteger(s) ? s : s.toFixed(1)} s`;\n\t\t}\n\t\treturn `${ms} ms`;\n\t}\n\n\t// Display metadata for each resolved limit, in render order. The `value`\n\t// thunk picks the right unit formatter; `env` is the override var name, absent\n\t// for limits fixed in code.\n\t// `note` is optional and only carries what the label and value can't: a\n\t// multiplier, a disable sentinel, what a limit is keyed on. What each var\n\t// means belongs in .env.example, not here.\n\tconst limitRows: Array<{\n\t\tkey: keyof PageData['limits'];\n\t\tlabel: string;\n\t\tenv?: string;\n\t\tvalue: (l: PageData['limits']) => string;\n\t\tnote?: string;\n\t}> = [\n\t\t{\n\t\t\tkey: 'RATE_LIMIT_MAX_REQUESTS',\n\t\t\tlabel: 'Compute rate limit',\n\t\t\tenv: 'COMPUTE_RATE_LIMIT_MAX',\n\t\t\tvalue: (l) => `${l.RATE_LIMIT_MAX_REQUESTS} / ${formatMs(l.RATE_LIMIT_WINDOW_MS)}`,\n\t\t\tnote: 'Counted per key — a user or a share link.'\n\t\t},\n\t\t{\n\t\t\tkey: 'MAX_DEFINITION_FILE_SIZE',\n\t\t\tlabel: 'Max .gh upload size',\n\t\t\tenv: 'MAX_DEFINITION_FILE_SIZE_BYTES',\n\t\t\tvalue: (l) => formatBytes(l.MAX_DEFINITION_FILE_SIZE)\n\t\t},\n\t\t{\n\t\t\tkey: 'MAX_IMAGE_FILE_SIZE',\n\t\t\tlabel: 'Max cover image size',\n\t\t\tvalue: (l) => formatBytes(l.MAX_IMAGE_FILE_SIZE)\n\t\t},\n\t\t{\n\t\t\tkey: 'COMPUTE_REQUEST_MAX_BYTES',\n\t\t\tlabel: 'Compute request body cap',\n\t\t\tvalue: (l) => formatBytes(l.COMPUTE_REQUEST_MAX_BYTES),\n\t\t\tnote: 'Inputs plus base64 file values. The largest RHINO_COMPUTE_MAX_REQUEST_SIZE a reached compute server reports; 256 MB before one is reached.'\n\t\t},\n\t\t{\n\t\t\tkey: 'COMPUTE_RESPONSE_MAX_BYTES',\n\t\t\tlabel: 'Compute response body cap',\n\t\t\tvalue: (l) => formatBytes(l.COMPUTE_RESPONSE_MAX_BYTES)\n\t\t},\n\t\t{\n\t\t\tkey: 'REMOTE_DEFINITION_MAX_BYTES',\n\t\t\tlabel: 'Remote definition fetch cap',\n\t\t\tenv: 'MAX_DEFINITION_FILE_SIZE_BYTES',\n\t\t\tvalue: (l) => formatBytes(l.REMOTE_DEFINITION_MAX_BYTES),\n\t\t\tnote: 'Shares the upload cap above — one var sets both.'\n\t\t},\n\t\t{\n\t\t\tkey: 'REMOTE_DEFINITION_FETCH_TIMEOUT_MS',\n\t\t\tlabel: 'Remote definition fetch timeout',\n\t\t\tvalue: (l) => formatMs(l.REMOTE_DEFINITION_FETCH_TIMEOUT_MS)\n\t\t},\n\t\t{\n\t\t\tkey: 'REMOTE_DEFINITION_CACHE_TTL_MS',\n\t\t\tlabel: 'Remote definition cache TTL',\n\t\t\tvalue: (l) => formatMs(l.REMOTE_DEFINITION_CACHE_TTL_MS),\n\t\t\tnote: 'Remote fetches only — uploads are keyed on an immutable version and never go stale.'\n\t\t},\n\t\t{\n\t\t\tkey: 'COMPUTE_DEFINITION_CACHE_BYTES',\n\t\t\tlabel: 'Definition cache',\n\t\t\tenv: 'COMPUTE_DEFINITION_CACHE_MB',\n\t\t\tvalue: (l) => formatBytes(l.COMPUTE_DEFINITION_CACHE_BYTES),\n\t\t\tnote: '0 disables.'\n\t\t},\n\t\t{\n\t\t\tkey: 'COMPUTE_SOLVE_CACHE_BYTES',\n\t\t\tlabel: 'Solve cache',\n\t\t\tenv: 'COMPUTE_SOLVE_CACHE_MB',\n\t\t\tvalue: (l) => formatBytes(l.COMPUTE_SOLVE_CACHE_BYTES),\n\t\t\tnote: 'Per compute server, up to 16 kept warm — worst case is 16× this. 0 disables.'\n\t\t}\n\t];\n\n\t// Only flags whose resolved value misleads on its own. What each flag *does* is\n\t// documented in .env.example — repeating it here just gives it somewhere to drift.\n\tconst flagNotes: Partial<Record<keyof PageData['flags'], string>> = {\n\t\tALLOW_ORG_CREATION:\n\t\t\t'Not wired up yet — no route consults this flag, so flipping it does nothing.'\n\t};\n\n\tconst enabledFlagCount = $derived(Object.values(data.flags).filter(Boolean).length);\n\n\tlet updateRunning = $state(false);\n\tlet updateLogs = $state('');\n\tlet updateExitCode = $state<number | null>(null);\n\tlet updateRestarting = $state(false);\n\n\t// A probe against a stopped app usually does NOT fail fast: the reverse proxy\n\t// in front of it holds the connection open until its own read timeout rather\n\t// than refusing it. Bare `fetch` has no timeout, so without this the restart\n\t// poll below blocks for a minute or more per attempt — the banner freezes on\n\t// \"PM2 is restarting…\" and only a manual reload shows the real state.\n\tconst PROBE_TIMEOUT_MS = 4000;\n\n\t// A 503 here means \"up but degraded\" (see /api/health) — the process is\n\t// answering, which is all this probe is asked to establish. Treating it as\n\t// unreachable stalls the restart wait on an instance that is genuinely back.\n\tasync function fetchHealth(): Promise<RestartHealth | null> {\n\t\ttry {\n\t\t\tconst res = await fetch('/api/health', {\n\t\t\t\tcache: 'no-store',\n\t\t\t\tsignal: AbortSignal.timeout(PROBE_TIMEOUT_MS)\n\t\t\t});\n\t\t\tif (!res.ok && res.status !== 503) return null;\n\t\t\treturn (await res.json()) as RestartHealth;\n\t\t} catch {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\t// Probe readiness, not just liveness. /api/health answers the instant the Node\n\t// process boots — before the app can necessarily serve real routes through the\n\t// proxy — so keying \"online\" on it alone races: the UI said \"back online\"\n\t// while a health-check click moments later 502'd. `/api/health/ready` does one\n\t// provider read, the same one the auth hook makes on every gated request, so a\n\t// 200 means a real request would succeed.\n\t//\n\t// Deliberately NOT `/api/admin/system/health`: that route pings the compute\n\t// server, so it reports non-ok whenever an unrelated dependency is down and\n\t// can outlast any sane probe timeout. Using it here meant a finished update\n\t// could never be confirmed on a deployment whose compute server was down.\n\tasync function isReadinessProbeWarm(): Promise<boolean> {\n\t\ttry {\n\t\t\tconst res = await fetch('/api/health/ready', {\n\t\t\t\tcache: 'no-store',\n\t\t\t\tsignal: AbortSignal.timeout(PROBE_TIMEOUT_MS)\n\t\t\t});\n\t\t\treturn res.ok;\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// Pull the tee'd update log from the server. Returns the *full* log file\n\t// content — the script truncates at the start of every run so this isn't\n\t// cumulative across updates. Returns null if the request fails (typically\n\t// during the window where the old selva-compute is dead and the new one\n\t// hasn't booted yet).\n\tasync function fetchUpdateLog(): Promise<string | null> {\n\t\ttry {\n\t\t\tconst res = await fetch('/api/admin/system/update', {\n\t\t\t\tcache: 'no-store',\n\t\t\t\tsignal: AbortSignal.timeout(PROBE_TIMEOUT_MS * 2)\n\t\t\t});\n\t\t\tif (!res.ok) return null;\n\t\t\treturn await res.text();\n\t\t} catch {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\t// Poll until the new process is serving. The loop itself lives in\n\t// `#lib/update-restart-poll.js` so it can be tested against a clock and probes\n\t// that misbehave on demand; this wrapper owns only the `$state` writes.\n\tasync function waitForAppRestart(previousInstanceId: string | null | undefined) {\n\t\t// The daemonized runner never streams over SSE, so the SSE `restarting`\n\t\t// event can't drive this flag — set it here, where we actually begin the\n\t\t// restart wait, so the \"PM2 is restarting…\" banner reflects reality.\n\t\tupdateRestarting = true;\n\n\t\tconst { exitCode } = await pollForRestart(previousInstanceId, {\n\t\t\tprobes: {\n\t\t\t\thealth: fetchHealth,\n\t\t\t\tlog: fetchUpdateLog,\n\t\t\t\tready: isReadinessProbeWarm\n\t\t\t},\n\t\t\tnow: () => Date.now(),\n\t\t\tsleep: (ms) => new Promise((r) => setTimeout(r, ms)),\n\t\t\tonLog: (log) => {\n\t\t\t\tupdateLogs = log;\n\t\t\t},\n\t\t\tappendLog: (line) => {\n\t\t\t\tupdateLogs += line;\n\t\t\t}\n\t\t});\n\n\t\tupdateExitCode = exitCode;\n\t\tupdateRunning = false;\n\t\tupdateRestarting = false;\n\t}\n\n\tasync function runUpdate() {\n\t\tupdateRunning = true;\n\t\tupdateRestarting = false;\n\t\tupdateLogs = '';\n\t\tupdateExitCode = null;\n\n\t\t// Snapshot the instanceId of the *currently running* process so we can\n\t\t// detect when a new one takes over (the value changes on every boot).\n\t\tconst preHealth = await fetchHealth();\n\t\tconst previousInstanceId = preHealth?.instanceId ?? null;\n\n\t\ttry {\n\t\t\tconst response = await fetch('/api/admin/system/update', { method: 'POST' });\n\t\t\tif (!response.ok) {\n\t\t\t\tupdateLogs = 'Failed to start update process';\n\t\t\t\tupdateExitCode = response.status;\n\t\t\t\tupdateRunning = false;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst reader = response.body?.getReader();\n\t\t\tconst decoder = new TextDecoder();\n\t\t\tif (!reader) {\n\t\t\t\tupdateLogs = 'Failed to read response';\n\t\t\t\tupdateExitCode = -1;\n\t\t\t\tupdateRunning = false;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlet buffer = '';\n\t\t\tlet sawRestarting = false;\n\t\t\tlet sawExit = false;\n\t\t\tlet streamExitCode: number | null = null;\n\t\t\twhile (true) {\n\t\t\t\tconst { done, value } = await reader.read();\n\t\t\t\tif (done) break;\n\t\t\t\tbuffer += decoder.decode(value, { stream: true });\n\t\t\t\tconst parts = buffer.split('\\n\\n');\n\t\t\t\tbuffer = parts.pop()!;\n\t\t\t\tfor (const part of parts) {\n\t\t\t\t\tif (!part.startsWith('data: ')) continue;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst event = JSON.parse(part.slice(6));\n\t\t\t\t\t\tif (event.type === 'log') {\n\t\t\t\t\t\t\tupdateLogs += event.data + '\\n';\n\t\t\t\t\t\t} else if (event.type === 'restarting') {\n\t\t\t\t\t\t\tupdateLogs += event.data + '\\n';\n\t\t\t\t\t\t\tupdateRestarting = true;\n\t\t\t\t\t\t\tsawRestarting = true;\n\t\t\t\t\t\t} else if (event.type === 'exit') {\n\t\t\t\t\t\t\tsawExit = true;\n\t\t\t\t\t\t\tstreamExitCode = event.code;\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch {\n\t\t\t\t\t\t// ignore malformed events\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// The POST spawns a LAUNCHER that daemonizes the real update runner and\n\t\t\t// then exits 0 on its own. So the SSE stream closing with exit 0 means\n\t\t\t// \"runner launched\", NOT \"update finished\" — and because the runner's\n\t\t\t// output (pm2 stop/start, npm, health probe, rollback) is redirected to\n\t\t\t// the log file, the SSE stream never carries the `restarting` signal or\n\t\t\t// the runner's real exit code. The only source of truth from here is\n\t\t\t// /api/health + the log file, which waitForAppRestart polls.\n\t\t\t//\n\t\t\t// The one case we can decide from the stream alone: the launcher itself\n\t\t\t// exiting non-zero means it failed before daemonizing anything, so nothing\n\t\t\t// is updating in the background — surface that directly.\n\t\t\tif (sawExit && !sawRestarting && streamExitCode !== null && streamExitCode !== 0) {\n\t\t\t\tupdateExitCode = streamExitCode;\n\t\t\t\tupdateRunning = false;\n\t\t\t} else {\n\t\t\t\tawait waitForAppRestart(previousInstanceId);\n\t\t\t}\n\t\t} catch (err) {\n\t\t\t// Fetch threw — most likely because PM2 killed the connection mid-stream.\n\t\t\t// If we got far enough to see a restart, treat it as expected.\n\t\t\tif (updateRestarting) {\n\t\t\t\tawait waitForAppRestart(previousInstanceId);\n\t\t\t} else {\n\t\t\t\tupdateLogs += '\\nError: ' + (err instanceof Error ? err.message : 'Unknown error');\n\t\t\t\tupdateExitCode = -1;\n\t\t\t\tupdateRunning = false;\n\t\t\t}\n\t\t}\n\t}\n</script>\n\n<svelte:head>\n\t<title>Admin · System</title>\n</svelte:head>\n\n<div class=\"space-y-6\">\n\t<SectionHeader\n\t\teyebrow=\"Admin\"\n\t\ttitle=\"System settings\"\n\t\tdescription=\"Updates, health checks, and the instance's env-driven configuration.\"\n\t/>\n\n\t<Tabs.Root value={activeTab} onValueChange={selectTab} class=\"gap-6\">\n\t\t<Tabs.List variant=\"line\" class=\"border-border border-b px-0\">\n\t\t\t{#each tabs as tab (tab.id)}\n\t\t\t\t<Tabs.Trigger value={tab.id} variant=\"line\">{tab.label}</Tabs.Trigger>\n\t\t\t{/each}\n\t\t</Tabs.List>\n\n\t\t<Tabs.Content value=\"updates\" class=\"space-y-6\">\n\t\t\t{#if data.canManageUpdates}\n\t\t\t\t<UpdateSection\n\t\t\t\t\tcurrentVersion={data.version}\n\t\t\t\t\tlatestVersion={data.update.latest}\n\t\t\t\t\tupdateAvailable={data.update.updateAvailable}\n\t\t\t\t\tchannel={data.channel}\n\t\t\t\t\tisRunning={updateRunning}\n\t\t\t\t\tisRestarting={updateRestarting}\n\t\t\t\t\tlogs={updateLogs}\n\t\t\t\t\texitCode={updateExitCode}\n\t\t\t\t\tnodeCompatibility={data.update.nodeCompatibility}\n\t\t\t\t\tdataCompatibility={data.update.dataCompatibility}\n\t\t\t\t\tonRun={runUpdate}\n\t\t\t\t/>\n\t\t\t\t{#key data.channel}\n\t\t\t\t\t<ChannelSection channel={data.channel} disabled={updateRunning} />\n\t\t\t\t{/key}\n\t\t\t{/if}\n\t\t</Tabs.Content>\n\n\t\t<Tabs.Content value=\"health\" class=\"space-y-6\">\n\t\t\t{#if data.isInstanceAdmin}\n\t\t\t\t<HealthSection />\n\t\t\t\t<NetworkSection />\n\t\t\t{/if}\n\t\t</Tabs.Content>\n\n\t\t<Tabs.Content value=\"config\">\n\t\t\t<Card.Root>\n\t\t\t\t<Card.Header>\n\t\t\t\t\t<Card.Title class=\"text-base font-semibold\">Configuration</Card.Title>\n\t\t\t\t\t<Card.Description>\n\t\t\t\t\t\tWhat this server runs on, and anything that needs fixing. To change a value, run\n\t\t\t\t\t\t<code class=\"font-mono text-xs\">npx selva config set KEY=VALUE</code> on the server,\n\t\t\t\t\t\tthen\n\t\t\t\t\t\t<code class=\"font-mono text-xs\">npx selva restart</code>.\n\t\t\t\t\t</Card.Description>\n\t\t\t\t</Card.Header>\n\t\t\t\t<Card.Content class=\"space-y-6\">\n\t\t\t\t\t{#if data.config}\n\t\t\t\t\t\t<ConfigSection\n\t\t\t\t\t\t\treport={data.config.report}\n\t\t\t\t\t\t\tchanges={data.config.changes}\n\t\t\t\t\t\t\trotation={data.config.rotation}\n\t\t\t\t\t\t\tproxied={data.config.proxied}\n\t\t\t\t\t\t\tchecks={data.config.checks}\n\t\t\t\t\t\t/>\n\t\t\t\t\t{/if}\n\n\t\t\t\t\t<details class=\"group rounded-lg border\">\n\t\t\t\t\t\t<summary\n\t\t\t\t\t\t\tclass=\"hover:bg-hover flex cursor-pointer items-center gap-2 rounded-lg px-4 py-3 text-sm font-semibold select-none\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ChevronRight class=\"h-4 w-4 shrink-0 transition-transform group-open:rotate-90\" />\n\t\t\t\t\t\t\tPlatform flags\n\t\t\t\t\t\t\t<span class=\"text-muted-foreground ml-auto font-mono text-xs\"\n\t\t\t\t\t\t\t\t>{enabledFlagCount} on</span\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t</summary>\n\t\t\t\t\t\t<div class=\"divide-y border-t\">\n\t\t\t\t\t\t\t{#each Object.entries(data.flags) as [name, value] (name)}\n\t\t\t\t\t\t\t\t<div class=\"flex items-center justify-between gap-4 px-4 py-3\">\n\t\t\t\t\t\t\t\t\t<div class=\"min-w-0 flex-1\">\n\t\t\t\t\t\t\t\t\t\t{#if flagNotes[name as keyof PageData['flags']]}\n\t\t\t\t\t\t\t\t\t\t\t<p class=\"text-foreground text-sm leading-snug font-medium\">\n\t\t\t\t\t\t\t\t\t\t\t\t{flagNotes[name as keyof PageData['flags']]}\n\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t\t\t\t\t<code class=\"text-muted-foreground text-2xs mt-1 block font-mono\">{name}</code>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\tclass={`rounded-full border px-2 py-0.5 text-xs font-medium ${\n\t\t\t\t\t\t\t\t\t\t\tvalue\n\t\t\t\t\t\t\t\t\t\t\t\t? 'border-success/40 bg-success/10 text-success'\n\t\t\t\t\t\t\t\t\t\t\t\t: 'border-border text-muted-foreground'\n\t\t\t\t\t\t\t\t\t\t}`}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{value ? 'On' : 'Off'}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t{/each}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</details>\n\n\t\t\t\t\t<details class=\"group rounded-lg border\">\n\t\t\t\t\t\t<summary\n\t\t\t\t\t\t\tclass=\"hover:bg-hover flex cursor-pointer items-center gap-2 rounded-lg px-4 py-3 text-sm font-semibold select-none\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ChevronRight class=\"h-4 w-4 shrink-0 transition-transform group-open:rotate-90\" />\n\t\t\t\t\t\t\tPlatform limits\n\t\t\t\t\t\t\t<span class=\"text-muted-foreground ml-auto font-mono text-xs\">{limitRows.length}</span\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t</summary>\n\t\t\t\t\t\t<div class=\"divide-y border-t\">\n\t\t\t\t\t\t\t{#each limitRows as row (row.key)}\n\t\t\t\t\t\t\t\t<div class=\"flex items-start justify-between gap-4 px-4 py-3\">\n\t\t\t\t\t\t\t\t\t<div class=\"min-w-0 flex-1\">\n\t\t\t\t\t\t\t\t\t\t<span class=\"text-foreground text-sm font-medium\">{row.label}</span>\n\t\t\t\t\t\t\t\t\t\t{#if row.env}\n\t\t\t\t\t\t\t\t\t\t\t<code class=\"text-muted-foreground mt-0.5 block font-mono text-[10px]\"\n\t\t\t\t\t\t\t\t\t\t\t\t>{row.env}</code\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t\t\t\t\t{#if row.note}\n\t\t\t\t\t\t\t\t\t\t\t<p class=\"text-muted-foreground mt-1 text-xs\">{row.note}</p>\n\t\t\t\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\tclass=\"bg-muted text-foreground shrink-0 rounded-md px-2 py-0.5 font-mono text-xs whitespace-nowrap\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{row.value(data.limits)}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t{/each}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</details>\n\t\t\t\t</Card.Content>\n\t\t\t</Card.Root>\n\t\t</Tabs.Content>\n\t</Tabs.Root>\n</div>\n"],"ignoreList":[0,1,2,3,4,5],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAQyB,IAAaA,eAAU;CAAK,QAAQ;CAAc,QAAQ;CAAI,QAAM,CAAI,CAAA,QAAM,EAAI,KAAK,WAAU,CAAA,GAAM,CAAA,QAAM,EAAI,KAAK,iBAAgB,CAAA,C;;AAIrIA,a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