@selvajs/selva 4.20.1-beta.5 → 4.21.0-beta.11
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.DJ150bSr.css +2 -0
- package/build/client/_app/immutable/assets/0.DJ150bSr.css.br +0 -0
- package/build/client/_app/immutable/assets/0.DJ150bSr.css.gz +0 -0
- package/build/client/_app/immutable/chunks/{D-uUm_OB.js → B3BHv1lE.js} +73 -68
- package/build/client/_app/immutable/chunks/B3BHv1lE.js.br +0 -0
- package/build/client/_app/immutable/chunks/B3BHv1lE.js.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/{BDYCH-_Q.js → BEPlNI5E.js} +1 -1
- package/build/client/_app/immutable/chunks/BEPlNI5E.js.br +0 -0
- package/build/client/_app/immutable/chunks/BEPlNI5E.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BSN2qO1R.js +1 -0
- package/build/client/_app/immutable/chunks/BSN2qO1R.js.br +0 -0
- package/build/client/_app/immutable/chunks/BSN2qO1R.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{CcWwBvi8.js → CBf5ToEX.js} +1 -1
- package/build/client/_app/immutable/chunks/CBf5ToEX.js.br +0 -0
- package/build/client/_app/immutable/chunks/CBf5ToEX.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CSy_25b1.js +55 -0
- package/build/client/_app/immutable/chunks/CSy_25b1.js.br +0 -0
- package/build/client/_app/immutable/chunks/CSy_25b1.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/{zJ-SFdYZ.js → DIOXhUNn.js} +1 -1
- package/build/client/_app/immutable/chunks/DIOXhUNn.js.br +0 -0
- package/build/client/_app/immutable/chunks/DIOXhUNn.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DQbsDiDJ.js +1 -0
- package/build/client/_app/immutable/chunks/DQbsDiDJ.js.br +1 -0
- package/build/client/_app/immutable/chunks/DQbsDiDJ.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/{DzxE3j6C.js → Dqy8nTaG.js} +1 -1
- package/build/client/_app/immutable/chunks/Dqy8nTaG.js.br +0 -0
- package/build/client/_app/immutable/chunks/Dqy8nTaG.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{qi43d-TM.js → cUJB_11K.js} +1 -1
- package/build/client/_app/immutable/chunks/cUJB_11K.js.br +0 -0
- package/build/client/_app/immutable/chunks/cUJB_11K.js.gz +0 -0
- package/build/client/_app/immutable/entry/app.B3im90t6.js +2 -0
- package/build/client/_app/immutable/entry/app.B3im90t6.js.br +0 -0
- package/build/client/_app/immutable/entry/app.B3im90t6.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/11.NPUXRN3p.js +5 -0
- package/build/client/_app/immutable/nodes/11.NPUXRN3p.js.br +0 -0
- package/build/client/_app/immutable/nodes/11.NPUXRN3p.js.gz +0 -0
- package/build/client/_app/immutable/nodes/15.C0vWxAsK.js +36 -0
- package/build/client/_app/immutable/nodes/15.C0vWxAsK.js.br +0 -0
- package/build/client/_app/immutable/nodes/15.C0vWxAsK.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{16.D7-QOesS.js → 16.BE4OfH4C.js} +1 -1
- package/build/client/_app/immutable/nodes/16.BE4OfH4C.js.br +0 -0
- package/build/client/_app/immutable/nodes/16.BE4OfH4C.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{2.CUNbzjI_.js → 2.bCPP2ncY.js} +1 -1
- package/build/client/_app/immutable/nodes/2.bCPP2ncY.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.bCPP2ncY.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{20.9OIre0ah.js → 20.DI5Eri_M.js} +1 -1
- package/build/client/_app/immutable/nodes/20.DI5Eri_M.js.br +0 -0
- package/build/client/_app/immutable/nodes/20.DI5Eri_M.js.gz +0 -0
- package/build/client/_app/immutable/nodes/21.BI8SjY_r.js +1 -0
- package/build/client/_app/immutable/nodes/21.BI8SjY_r.js.br +1 -0
- package/build/client/_app/immutable/nodes/21.BI8SjY_r.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.BRm8FzmQ.js +42 -0
- package/build/client/_app/immutable/nodes/25.BRm8FzmQ.js.br +0 -0
- package/build/client/_app/immutable/nodes/25.BRm8FzmQ.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/{30.BBuL_XNB.js → 30.B6pd-F-z.js} +1 -1
- package/build/client/_app/immutable/nodes/30.B6pd-F-z.js.br +0 -0
- package/build/client/_app/immutable/nodes/30.B6pd-F-z.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{35.De6sleaH.js → 35.BPmyLjFW.js} +1 -1
- package/build/client/_app/immutable/nodes/35.BPmyLjFW.js.br +0 -0
- package/build/client/_app/immutable/nodes/35.BPmyLjFW.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{5.DmA9lTA-.js → 5.BUX4zZQj.js} +1 -1
- package/build/client/_app/immutable/nodes/5.BUX4zZQj.js.br +0 -0
- package/build/client/_app/immutable/nodes/5.BUX4zZQj.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{6.D6WLqCgl.js → 6.BpjtFwPi.js} +1 -1
- package/build/client/_app/immutable/nodes/6.BpjtFwPi.js.br +0 -0
- package/build/client/_app/immutable/nodes/6.BpjtFwPi.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{7.CNuRjkv2.js → 7.hBM6C-wN.js} +1 -1
- package/build/client/_app/immutable/nodes/7.hBM6C-wN.js.br +0 -0
- package/build/client/_app/immutable/nodes/7.hBM6C-wN.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 +201 -144
- package/build/server/_app/immutable/assets/_layout.DJ150bSr.css +2 -0
- package/build/server/chunks/AppHeader.js +1 -1
- package/build/server/chunks/Callout.js +1 -1
- package/build/server/chunks/DefinitionCard.js +4 -1
- package/build/server/chunks/DefinitionCard.js.map +1 -1
- package/build/server/chunks/ErrorScreen.js +1 -1
- package/build/server/chunks/FilterableDropdown.js +1 -1
- package/build/server/chunks/SettingsMenu.js +1 -1
- package/build/server/chunks/SideNav.js +1 -1
- package/build/server/chunks/access.js +15 -3
- package/build/server/chunks/access.js.map +1 -1
- package/build/server/chunks/access2.server.js +1 -1
- package/build/server/chunks/activity.js +1 -1
- package/build/server/chunks/alert-dialog.js +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 +11 -33
- package/build/server/chunks/api.js.map +1 -1
- package/build/server/chunks/arrow-left.js +1 -1
- package/build/server/chunks/arrow-right.js +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/badge.js +1 -1
- package/build/server/chunks/bodies.js +37 -0
- package/build/server/chunks/bodies.js.map +1 -0
- 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/building-complex.js +1 -1
- package/build/server/chunks/button.js +1 -1
- package/build/server/chunks/card-content.js +1 -1
- package/build/server/chunks/card-description.js +1 -1
- package/build/server/chunks/card-header.js +1 -1
- package/build/server/chunks/card-title.js +1 -1
- package/build/server/chunks/chevron-down.js +1 -1
- package/build/server/chunks/chevron-left.js +1 -1
- package/build/server/chunks/chevron-right.js +1 -1
- package/build/server/chunks/chevron-up.js +1 -1
- package/build/server/chunks/circle.js +1 -1
- package/build/server/chunks/computeRateLimit.server.js +2 -2
- package/build/server/chunks/copy.js +1 -1
- package/build/server/chunks/delete-with-blobs.js +1 -1
- package/build/server/chunks/dialog.js +1 -1
- package/build/server/chunks/diff.js +275 -0
- package/build/server/chunks/diff.js.map +1 -0
- package/build/server/chunks/engine.server.js +50 -3
- package/build/server/chunks/engine.server.js.map +1 -1
- package/build/server/chunks/external-link.js +1 -1
- package/build/server/chunks/folder-kanban.js +1 -1
- package/build/server/chunks/folder-open.js +1 -1
- package/build/server/chunks/folders.js +1 -1
- package/build/server/chunks/gauge.js +1 -1
- package/build/server/chunks/grasshopper.js +15 -3
- package/build/server/chunks/grasshopper.js.map +1 -1
- package/build/server/chunks/handlers.js +308 -133
- 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/input-group.js +1 -1
- package/build/server/chunks/input.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/inventory.js +395 -0
- package/build/server/chunks/inventory.js.map +1 -0
- package/build/server/chunks/keepalive-vtcjhAV3.js +24 -0
- package/build/server/chunks/keepalive-vtcjhAV3.js.map +1 -0
- package/build/server/chunks/key-round.js +1 -1
- package/build/server/chunks/label.js +1 -1
- package/build/server/chunks/link-2.js +1 -1
- 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/mail.js +1 -1
- package/build/server/chunks/minus.js +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/plus.js +1 -1
- package/build/server/chunks/popper-layer-force-mount.js +1 -1
- package/build/server/chunks/presets.server.js +1 -1
- package/build/server/chunks/providers.server.js +310 -98
- package/build/server/chunks/providers.server.js.map +1 -1
- package/build/server/chunks/refresh-cw.js +1 -1
- package/build/server/chunks/registry.js +69 -5
- package/build/server/chunks/registry.js.map +1 -1
- package/build/server/chunks/resolve-server.js +2 -2
- package/build/server/chunks/rotate-ccw.js +1 -1
- package/build/server/chunks/schema-extraction.js +117 -9
- 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/scroll-text.js +1 -1
- package/build/server/chunks/search.js +1 -1
- package/build/server/chunks/search2.js +1 -1
- package/build/server/chunks/select.js +1 -1
- package/build/server/chunks/separator.js +19 -7
- package/build/server/chunks/separator.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/server4.js +1 -1
- package/build/server/chunks/serverStats.server.js +1 -1
- package/build/server/chunks/settings.js +1 -1
- package/build/server/chunks/severity.js +1 -1
- package/build/server/chunks/shield-check.js +1 -1
- package/build/server/chunks/shield.js +1 -1
- package/build/server/chunks/signInMaxAge.server.js +1 -1
- package/build/server/chunks/solve.server.js +8 -8
- package/build/server/chunks/solve.server.js.map +1 -1
- package/build/server/chunks/star.js +1 -1
- package/build/server/chunks/sveltekit.js +4 -5
- package/build/server/chunks/sveltekit.js.map +1 -1
- package/build/server/chunks/tabs-trigger.js +1 -1
- package/build/server/chunks/textarea.js +1 -1
- package/build/server/chunks/toggle-group-item.js +1 -1
- package/build/server/chunks/trash.js +1 -1
- package/build/server/chunks/traversal.js +23 -0
- package/build/server/chunks/traversal.js.map +1 -0
- package/build/server/chunks/types2.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/chunks/user-plus.js +1 -1
- package/build/server/chunks/users.js +1 -1
- package/build/server/chunks/utils.js +156 -70
- package/build/server/chunks/utils.js.map +1 -1
- package/build/server/chunks/x.js +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 +2 -2
- package/build/server/entries/endpoints/api/admin/compute/actions/_server.ts.js +2 -2
- package/build/server/entries/endpoints/api/admin/compute/status/_server.ts.js +2 -2
- 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 +10 -3
- 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 +2 -2
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/image/_server.ts.js +2 -2
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/publish/_server.ts.js +2 -2
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/schema/_server.ts.js +2 -2
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/share-links/_linkId_/_server.ts.js +2 -2
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/share-links/_server.ts.js +2 -2
- 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 +2 -2
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/versions/_versionId_/_server.ts.js +2 -2
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/versions/_versionId_/changes/_server.ts.js +9 -0
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/versions/_versionId_/changes/_server.ts.js.map +1 -0
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/versions/_versionId_/inventory/_server.ts.js +12 -0
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/versions/_versionId_/inventory/_server.ts.js.map +1 -0
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/versions/_versionId_/schema/_server.ts.js +2 -2
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/versions/_versionId_/scripts/_scriptId_/_server.ts.js +12 -0
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/versions/_versionId_/scripts/_scriptId_/_server.ts.js.map +1 -0
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/versions/check/_server.ts.js +12 -0
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/versions/check/_server.ts.js.map +1 -0
- package/build/server/entries/endpoints/api/v1/definitions/_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_/assets/_kind_/_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_/members/_userId_/_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 +2 -2
- 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/_page.svelte.js +1 -1
- package/build/server/entries/pages/admin/compute/_page.server.ts.js +2 -3
- package/build/server/entries/pages/admin/compute/_page.server.ts.js.map +1 -1
- package/build/server/entries/pages/admin/compute/_page.svelte.js +7 -3
- package/build/server/entries/pages/admin/compute/_page.svelte.js.map +1 -1
- package/build/server/entries/pages/admin/projects/_id_/_page.svelte.js +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 +23 -4
- package/build/server/entries/pages/admin/system/_page.svelte.js.map +1 -1
- package/build/server/entries/pages/admin/users/_page.svelte.js +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 +722 -80
- package/build/server/entries/pages/library/_guid_/_page.svelte.js.map +1 -1
- package/build/server/entries/pages/library/_page.svelte.js +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.server.ts.js +1 -1
- package/build/server/entries/pages/projects/_page.svelte.js +792 -35
- 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/_layout.svelte.js +1 -1
- package/build/server/entries/pages/team/compute/_page.server.ts.js +1 -1
- package/build/server/entries/pages/team/members/_page.svelte.js +1 -1
- package/build/server/entries/pages/team/settings/_page.svelte.js +1 -1
- package/build/server/entries/pages/team/tokens/_page.server.ts.js +1 -1
- package/build/server/manifest-full.js +29 -1
- package/build/server/manifest.js +29 -1
- package/build/server/nodes/0.js +2 -2
- package/build/server/nodes/1.js +1 -1
- package/build/server/nodes/11.js +1 -1
- package/build/server/nodes/15.js +1 -1
- package/build/server/nodes/16.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/30.js +1 -1
- package/build/server/nodes/35.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 +29 -1
- package/package.json +15 -12
- 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/Bga9Qxze.js +0 -55
- package/build/client/_app/immutable/chunks/Bga9Qxze.js.br +0 -0
- package/build/client/_app/immutable/chunks/Bga9Qxze.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/CBWE8gpj.js +0 -1
- package/build/client/_app/immutable/chunks/CBWE8gpj.js.br +0 -0
- package/build/client/_app/immutable/chunks/CBWE8gpj.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CcWwBvi8.js.br +0 -0
- package/build/client/_app/immutable/chunks/CcWwBvi8.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/D-uUm_OB.js.gz +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/chunks/zJ-SFdYZ.js.br +0 -0
- package/build/client/_app/immutable/chunks/zJ-SFdYZ.js.gz +0 -0
- package/build/client/_app/immutable/entry/app.BpT6WkO1.js +0 -2
- 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/11.DS0azG6Y.js +0 -5
- package/build/client/_app/immutable/nodes/11.DS0azG6Y.js.br +0 -0
- package/build/client/_app/immutable/nodes/11.DS0azG6Y.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/16.D7-QOesS.js.br +0 -0
- package/build/client/_app/immutable/nodes/16.D7-QOesS.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 +0 -17
- 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/30.BBuL_XNB.js.br +0 -0
- package/build/client/_app/immutable/nodes/30.BBuL_XNB.js.gz +0 -0
- package/build/client/_app/immutable/nodes/35.De6sleaH.js.br +0 -0
- package/build/client/_app/immutable/nodes/35.De6sleaH.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 +0 -40
- 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/server/chunks/types4.js +0 -10
- package/build/server/chunks/types4.js.map +0 -1
- package/build/server/chunks/utils2.js +0 -174
- package/build/server/chunks/utils2.js.map +0 -1
- /package/build/client/_app/immutable/nodes/{0.CYdyv5To.js → 0.Bu9WQ0W_.js} +0 -0
- /package/build/client/_app/immutable/nodes/{0.CYdyv5To.js.br → 0.Bu9WQ0W_.js.br} +0 -0
- /package/build/client/_app/immutable/nodes/{0.CYdyv5To.js.gz → 0.Bu9WQ0W_.js.gz} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_page.svelte.js","names":["__iconData","__iconNode","$.spread_props","$.spread_props","$.derived","$.escape","$.attr_class","$.ensure_array_like","$.attr","$.stringify","Card.Root","Card.Content"],"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/eraser.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/power.svelte","../../../../../../src/lib/composables/useServerHealth.svelte.ts","../../../../../../src/routes/admin/compute/+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\": \"eraser\", \"size\": 24, \"node\": [[\"path\", { \"d\": \"M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21\" }], [\"path\", { \"d\": \"m5.082 11.09 8.828 8.828\" }]] };\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/eraser\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\": \"power\", \"size\": 24, \"node\": [[\"path\", { \"d\": \"M12 2v10\" }], [\"path\", { \"d\": \"M18.4 6.6a9 9 0 1 1-12.77.04\" }]] };\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/power\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={__iconData} />\n","import { browser } from '$app/env';\n\nexport interface ServerHealthState {\n\tstate: 'idle' | 'checking' | 'loading' | 'ok' | 'warning' | 'error';\n\treachable: boolean;\n\t// True once the plugin inventory loaded, so `selvaInstalled` is\n\t// authoritative. A cold server is `reachable` (proxy answers) before it's\n\t// `ready` (a child finished enumerating Grasshopper add-ons).\n\tready: boolean;\n\trhinoVersion: string | null;\n\tcomputeVersion: string | null;\n\tselvaInstalled: boolean;\n\tselvaVersion: string | null;\n\tplugins: Record<string, string>;\n\tactiveChildren: number | null;\n\tidleSpanSeconds: number | null;\n\t/** What the server reports from `/limits`; `null` when it can't. */\n\tlimits: { timeoutSeconds: number; maxRequestBytes: number } | null;\n\t/**\n\t * Why the last probe failed, when the server classified it. Null while\n\t * reachable. Shown to the operator instead of a bare \"error\" pill.\n\t */\n\tfailureSummary: string | null;\n}\n\n// A manual check retries a cold/booting server for up to this long, so an\n// operator who clicks \"Check\" on a sleeping server sees it come Online\n// without re-clicking. Retries until *ready* (plugin inventory loaded), not\n// merely reachable — settling for reachable is what made Selva read as \"Not\n// installed\" during boot. Never polls on a background timer: every probe is\n// operator-initiated so we don't wake (and bill) idle servers.\nconst RETRY_WINDOW_MS = 60000;\nconst RETRY_INTERVAL_MS = 5000;\n\nexport function useServerHealth(serverId: () => string) {\n\tlet state = $state<ServerHealthState>({\n\t\tstate: 'idle',\n\t\treachable: false,\n\t\tready: false,\n\t\trhinoVersion: null,\n\t\tcomputeVersion: null,\n\t\tselvaInstalled: false,\n\t\tselvaVersion: null,\n\t\tplugins: {},\n\t\tactiveChildren: null,\n\t\tidleSpanSeconds: null,\n\t\tlimits: null,\n\t\tfailureSummary: null\n\t});\n\n\tlet timerId: ReturnType<typeof setTimeout> | null = null;\n\tlet deadline = 0;\n\tlet destroyed = false;\n\n\t// Set when the server says the failure cannot resolve itself (connection\n\t// refused, rejected API key). Ends the retry window early — see `attempt`.\n\tlet terminal = false;\n\n\t// Return value is the retry loop's stop condition: ready, not merely reachable.\n\tasync function probe(): Promise<boolean> {\n\t\tif (!browser || destroyed) return false;\n\t\ttry {\n\t\t\tconst res = await fetch(`/api/admin/compute/status?serverId=${serverId()}`);\n\t\t\tif (destroyed) return false;\n\t\t\tif (!res.ok) {\n\t\t\t\tstate = { ...state, reachable: false, ready: false };\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst data = await res.json();\n\t\t\tconst reachable: boolean = data.reachable;\n\t\t\tconst ready: boolean = data.ready ?? reachable;\n\t\t\t// Absent field (older server) means \"keep the old behaviour and retry\".\n\t\t\tterminal = !reachable && data.retryable === false;\n\t\t\tstate = {\n\t\t\t\treachable,\n\t\t\t\tready,\n\t\t\t\tfailureSummary: data.failureSummary ?? null,\n\t\t\t\trhinoVersion: data.rhinoVersion,\n\t\t\t\tcomputeVersion: data.computeVersion,\n\t\t\t\tselvaInstalled: data.selvaInstalled,\n\t\t\t\tselvaVersion: data.selvaVersion,\n\t\t\t\tplugins: data.plugins ?? {},\n\t\t\t\tactiveChildren: data.activeChildren ?? null,\n\t\t\t\tidleSpanSeconds: data.idleSpanSeconds ?? null,\n\t\t\t\tlimits: data.limits ?? null,\n\t\t\t\t// Reachable but not ready = a booting server still loading plugins.\n\t\t\t\t// Show 'loading' (progress), not 'warning' (misconfiguration), so the\n\t\t\t\t// operator isn't alarmed while add-ons enumerate. Only once the\n\t\t\t\t// inventory is loaded do we trust `selvaInstalled` to raise a warning.\n\t\t\t\tstate: !reachable ? 'error' : !ready ? 'loading' : !data.selvaInstalled ? 'warning' : 'ok'\n\t\t\t};\n\t\t\treturn ready;\n\t\t} catch {\n\t\t\t// A fetch that never reached our own API says nothing about the compute\n\t\t\t// server — keep retrying.\n\t\t\tterminal = false;\n\t\t\tif (!destroyed) state = { ...state, reachable: false, ready: false };\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tasync function attempt() {\n\t\tconst ready = await probe();\n\t\tif (destroyed || ready) return;\n\t\tif (terminal) {\n\t\t\t// The server told us waiting cannot help. Settle on the real reason now\n\t\t\t// rather than spinning out the window.\n\t\t\tstate = { ...state, state: 'error', reachable: false, ready: false };\n\t\t\treturn;\n\t\t}\n\t\tif (Date.now() < deadline) {\n\t\t\t// Keep the pill in an in-progress state between retries: 'loading' when\n\t\t\t// the server is up and enumerating plugins, 'checking' otherwise. Never\n\t\t\t// flash a terminal 'error'/'warning' while we still intend to retry.\n\t\t\tif (state.state !== 'loading') state = { ...state, state: 'checking' };\n\t\t\ttimerId = setTimeout(attempt, RETRY_INTERVAL_MS);\n\t\t} else if (!state.reachable) {\n\t\t\tstate = { ...state, state: 'error', reachable: false, ready: false };\n\t\t} else {\n\t\t\t// Reachable but never became ready within the window: don't leave it\n\t\t\t// stuck on 'loading' — the server is up but Selva couldn't be confirmed.\n\t\t\tstate = { ...state, state: 'warning' };\n\t\t}\n\t}\n\n\tfunction check() {\n\t\tif (!browser || destroyed) return;\n\t\tif (timerId !== null) {\n\t\t\tclearTimeout(timerId);\n\t\t\ttimerId = null;\n\t\t}\n\t\tdeadline = Date.now() + RETRY_WINDOW_MS;\n\t\tterminal = false;\n\t\tstate = { ...state, state: 'checking', failureSummary: null };\n\t\tattempt();\n\t}\n\n\tfunction stop() {\n\t\tdestroyed = true;\n\t\tif (timerId !== null) {\n\t\t\tclearTimeout(timerId);\n\t\t\ttimerId = null;\n\t\t}\n\t}\n\n\treturn {\n\t\tget state() {\n\t\t\treturn state;\n\t\t},\n\t\tcheck,\n\t\tstop\n\t};\n}\n","<script lang=\"ts\">\n\timport {\n\t\tButton,\n\t\tCard,\n\t\tEmptyState,\n\t\tInput,\n\t\ttoast,\n\t\tSectionHeader,\n\t\trandomId,\n\t\tConfirmDialog\n\t} from '@selvajs/ui';\n\timport {\n\t\tCircle,\n\t\tServer,\n\t\tPlus,\n\t\tTrash2,\n\t\tStar,\n\t\tChevronDown,\n\t\tChevronUp,\n\t\tRefreshCw,\n\t\tEraser,\n\t\tPower\n\t} from '@lucide/svelte';\n\timport type { PlatformComputeServer } from '@selvajs/platform/computeServer';\n\timport type { TenancyMode } from '@selvajs/platform';\n\timport { useServerHealth } from '#lib/composables/useServerHealth.svelte.js';\n\timport { refreshAll } from '$app/navigation';\n\timport { SvelteSet } from 'svelte/reactivity';\n\timport { untrack, onDestroy } from 'svelte';\n\n\tconst API_KEY_CLEAR = '__clear__';\n\n\tinterface ServerEntry extends Omit<PlatformComputeServer, 'apiKey' | 'scope'> {\n\t\tapiKey: string;\n\t\thasApiKey: boolean;\n\t}\n\n\tinterface OrgRow {\n\t\tid: string;\n\t\tname: string;\n\t\tslug: string;\n\t}\n\n\tinterface CacheCounters {\n\t\thits: number;\n\t\tmisses: number;\n\t\tevictions: number;\n\t\tentries: number;\n\t\tbytes: number;\n\t\tbudgetBytes: number;\n\t}\n\n\tinterface PageData {\n\t\tservers: (Omit<PlatformComputeServer, 'apiKey'> & { hasApiKey: boolean })[];\n\t\tdefaultServerId: string;\n\t\torgs: OrgRow[];\n\t\ttenancy: TenancyMode;\n\t\tcaches: {\n\t\t\tsolve: CacheCounters & { warmClients: number; budgetTotalBytes: number };\n\t\t\tdefinition: CacheCounters;\n\t\t};\n\t}\n\tinterface Props {\n\t\tdata: PageData;\n\t}\n\tlet { data }: Props = $props();\n\n\tfunction formatCacheBytes(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\t/**\n\t * Hit rate as a percentage, or null before any solve has consulted the cache.\n\t * Reported as null rather than 0% because \"no data yet\" and \"nothing is\n\t * hitting\" are different answers to the question an operator is asking.\n\t */\n\tfunction hitRate(c: { hits: number; misses: number }): number | null {\n\t\tconst total = c.hits + c.misses;\n\t\treturn total === 0 ? null : Math.round((c.hits / total) * 100);\n\t}\n\n\t// Humanize an idle span (seconds since the last child request) into a compact\n\t// \"just now / 5m / 1h 3m\" label. null → '-' (unreachable or not reported).\n\tfunction formatIdle(seconds: number | null): string {\n\t\tif (seconds === null) return '-';\n\t\tif (seconds < 5) return 'just now';\n\t\tif (seconds < 60) return `${Math.round(seconds)}s`;\n\t\tconst m = Math.floor(seconds / 60);\n\t\tif (m < 60) return `${m}m`;\n\t\tconst h = Math.floor(m / 60);\n\t\treturn `${h}h ${m % 60}m`;\n\t}\n\n\tconst statusConfig = {\n\t\tidle: { label: 'Not checked', color: 'text-muted-foreground' },\n\t\tok: { label: 'Online', color: 'text-green-600 dark:text-green-400' },\n\t\twarning: { label: 'Warning', color: 'text-yellow-600 dark:text-yellow-400' },\n\t\terror: { label: 'Offline', color: 'text-red-600 dark:text-red-400' },\n\t\tchecking: { label: 'Checking…', color: 'text-blue-600 dark:text-blue-400' },\n\t\t// Reachable but plugins still loading — a booting server, not a fault.\n\t\tloading: { label: 'Loading plugins…', color: 'text-blue-600 dark:text-blue-400' }\n\t};\n\n\tlet servers = $state<ServerEntry[]>([]);\n\tlet defaultServerId = $state('');\n\tlet saving = $state(false);\n\tconst dirtyIds = new SvelteSet<string>();\n\t// Servers the operator deleted. They stay in `servers` (struck through, with\n\t// Undo) until a save flushes them, so deletion follows the same stage-then-save\n\t// model as every other edit on this page.\n\tconst removedIds = new SvelteSet<string>();\n\tlet expandedPlugins = $state<Record<string, boolean>>({});\n\tlet expandedSharing = $state<Record<string, boolean>>({});\n\n\tfunction toEntry(s: PageData['servers'][number]): ServerEntry {\n\t\treturn {\n\t\t\tid: s.id,\n\t\t\tlabel: s.label,\n\t\t\tserverUrl: s.serverUrl,\n\t\t\tsharedWith: s.sharedWith === 'all' ? 'all' : [...s.sharedWith],\n\t\t\tapiKey: '',\n\t\t\thasApiKey: s.hasApiKey\n\t\t};\n\t}\n\n\tfunction markDirty(id: string) {\n\t\tdirtyIds.add(id);\n\t}\n\n\t// The whole page is one unit of work: the API replaces the entire platform\n\t// server list in a single PUT, so a per-card save would flush every other\n\t// card's edits along with it.\n\tconst pendingCount = $derived(dirtyIds.size + removedIds.size);\n\tconst defaultChanged = $derived(\n\t\tdefaultServerId !== data.defaultServerId && servers.some((s) => !removedIds.has(s.id))\n\t);\n\tconst hasChanges = $derived(pendingCount > 0 || defaultChanged);\n\n\tfunction forgetHealth(id: string) {\n\t\thealthMap[id]?.stop();\n\t\tconst { [id]: _, ...rest } = healthMap;\n\t\thealthMap = rest;\n\t}\n\n\tfunction discardChanges(id: string) {\n\t\tdirtyIds.delete(id);\n\t\tremovedIds.delete(id);\n\t\tconst original = data.servers.find((s) => s.id === id);\n\t\tif (!original) {\n\t\t\t// Newly-added server that was never saved — drop it.\n\t\t\tforgetHealth(id);\n\t\t\tservers = servers.filter((s) => s.id !== id);\n\t\t\treturn;\n\t\t}\n\t\tconst idx = servers.findIndex((s) => s.id === id);\n\t\tif (idx >= 0) servers[idx] = toEntry(original);\n\t}\n\n\tfunction discardAll() {\n\t\tfor (const id of [...dirtyIds, ...removedIds]) {\n\t\t\tif (!data.servers.some((s) => s.id === id)) forgetHealth(id);\n\t\t}\n\t\tdirtyIds.clear();\n\t\tremovedIds.clear();\n\t\tservers = data.servers.map(toEntry);\n\t\tdefaultServerId = data.defaultServerId;\n\t}\n\n\t// Per-server health — keyed by server id. Entries are created lazily and never\n\t// probe on their own; a server is only contacted when the operator clicks Check.\n\tlet healthMap = $state<Record<string, ReturnType<typeof useServerHealth>>>({});\n\n\tfunction ensureHealth(id: string) {\n\t\tif (!healthMap[id]) {\n\t\t\thealthMap[id] = useServerHealth(() => id);\n\t\t}\n\t\treturn healthMap[id];\n\t}\n\n\t$effect(() => {\n\t\tif (dirtyIds.size === 0 && removedIds.size === 0) {\n\t\t\tservers = data.servers.map(toEntry);\n\t\t\tdefaultServerId = data.defaultServerId;\n\t\t}\n\t});\n\n\t$effect(() => {\n\t\t// Pre-create an (idle) health entry per known server so each card has a\n\t\t// Check button to drive. No probe runs here — servers stay untouched until\n\t\t// the operator explicitly checks them. `ensureHealth` writes healthMap, so\n\t\t// it must be untracked — otherwise this effect re-runs and (via its old\n\t\t// cleanup) tore down the entries it just made, leaving Check a no-op.\n\t\tconst ids = data.servers.map((s) => s.id);\n\t\tuntrack(() => {\n\t\t\tfor (const id of ids) ensureHealth(id);\n\t\t});\n\t});\n\n\t// Teardown only on real unmount — never coupled to data/healthMap changes.\n\tonDestroy(() => {\n\t\tfor (const h of Object.values(healthMap)) h.stop();\n\t});\n\n\tfunction addServer() {\n\t\tconst id = randomId();\n\t\tif (servers.length === 0) defaultServerId = id;\n\t\tservers = [\n\t\t\t...servers,\n\t\t\t{\n\t\t\t\tid,\n\t\t\t\tlabel: 'new-server',\n\t\t\t\tserverUrl: 'http://localhost:5000',\n\t\t\t\tsharedWith: 'all',\n\t\t\t\tapiKey: '',\n\t\t\t\thasApiKey: false\n\t\t\t}\n\t\t];\n\t\tensureHealth(id);\n\t\tmarkDirty(id);\n\t}\n\n\tfunction removeServer(server: ServerEntry) {\n\t\tif (!data.servers.some((s) => s.id === server.id)) {\n\t\t\t// Never saved — nothing to stage, just drop it.\n\t\t\tdirtyIds.delete(server.id);\n\t\t\tforgetHealth(server.id);\n\t\t\tservers = servers.filter((s) => s.id !== server.id);\n\t\t} else {\n\t\t\tremovedIds.add(server.id);\n\t\t\tdirtyIds.delete(server.id);\n\t\t}\n\t\tshowRemoveConfirm = false;\n\t}\n\n\tfunction undoRemove(id: string) {\n\t\tremovedIds.delete(id);\n\t}\n\n\tfunction setSharedWithAll(server: ServerEntry, all: boolean) {\n\t\tserver.sharedWith = all ? 'all' : [];\n\t\tmarkDirty(server.id);\n\t}\n\n\tfunction toggleOrg(server: ServerEntry, orgId: string) {\n\t\tif (server.sharedWith === 'all') return; // ignored when in 'all' mode\n\t\tserver.sharedWith = server.sharedWith.includes(orgId)\n\t\t\t? server.sharedWith.filter((id) => id !== orgId)\n\t\t\t: [...server.sharedWith, orgId];\n\t\tmarkDirty(server.id);\n\t}\n\n\tasync function save() {\n\t\tsaving = true;\n\t\ttry {\n\t\t\tconst kept = servers.filter((s) => !removedIds.has(s.id));\n\t\t\tconst payload = {\n\t\t\t\tdefaultServerId: kept.some((s) => s.id === defaultServerId)\n\t\t\t\t\t? defaultServerId\n\t\t\t\t\t: (kept[0]?.id ?? ''),\n\t\t\t\tservers: kept.map(({ apiKey, hasApiKey: _, ...s }) => ({\n\t\t\t\t\t...s,\n\t\t\t\t\t...(apiKey === API_KEY_CLEAR ? { apiKey: null } : apiKey ? { apiKey } : {})\n\t\t\t\t}))\n\t\t\t};\n\t\t\tconst res = await fetch('/api/admin/compute', {\n\t\t\t\tmethod: 'PUT',\n\t\t\t\theaders: { 'Content-Type': 'application/json' },\n\t\t\t\tbody: JSON.stringify(payload)\n\t\t\t});\n\t\t\tif (res.ok) {\n\t\t\t\ttoast.success(\n\t\t\t\t\tremovedIds.size > 0\n\t\t\t\t\t\t? `Saved — ${removedIds.size} server${removedIds.size === 1 ? '' : 's'} removed`\n\t\t\t\t\t\t: 'Compute config saved'\n\t\t\t\t);\n\t\t\t\tfor (const id of removedIds) forgetHealth(id);\n\t\t\t\tawait refreshAll();\n\t\t\t\tdirtyIds.clear();\n\t\t\t\tremovedIds.clear();\n\t\t\t\t// Reset health to idle after save (URL/key may have changed) without\n\t\t\t\t// probing — the operator re-checks manually to avoid waking servers.\n\t\t\t\tfor (const h of Object.values(healthMap)) h.stop();\n\t\t\t\thealthMap = {};\n\t\t\t\tfor (const s of servers) ensureHealth(s.id);\n\t\t\t} else {\n\t\t\t\tconst err = await res.json().catch(() => ({ error: 'Unknown error' }));\n\t\t\t\ttoast.error(err.message || err.error || `Failed to save (${res.status})`);\n\t\t\t}\n\t\t} catch {\n\t\t\ttoast.error('Failed to save compute config');\n\t\t} finally {\n\t\t\tsaving = false;\n\t\t}\n\t}\n\n\t// Per-server in-flight action ('purge' | 'shutdown') so each card disables only\n\t// its own buttons while a fleet action runs.\n\tlet busyAction = $state<Record<string, 'purge' | 'shutdown' | null>>({});\n\tlet confirmingShutdown = $state<ServerEntry | null>(null);\n\tlet confirmingPurge = $state<ServerEntry | null>(null);\n\tlet showShutdownConfirm = $state(false);\n\tlet showPurgeConfirm = $state(false);\n\tlet confirmingRemove = $state<ServerEntry | null>(null);\n\tlet showRemoveConfirm = $state(false);\n\n\tasync function runAction(server: ServerEntry, action: 'purge' | 'shutdown') {\n\t\tbusyAction[server.id] = action;\n\t\ttry {\n\t\t\tconst res = await fetch('/api/admin/compute/actions', {\n\t\t\t\tmethod: 'POST',\n\t\t\t\theaders: { 'Content-Type': 'application/json' },\n\t\t\t\tbody: JSON.stringify({ serverId: server.id, action })\n\t\t\t});\n\t\t\tconst data = await res.json().catch(() => ({}));\n\t\t\tif (!res.ok) {\n\t\t\t\ttoast.error(data.message || data.error || `Action failed (${res.status})`);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (action === 'purge') {\n\t\t\t\t// purgeAllChildren is best-effort across a round-robin pool — say so\n\t\t\t\t// honestly unless the server reported a single child (exact).\n\t\t\t\tconst { totalPurged = 0, children = 0, confident } = data;\n\t\t\t\ttoast.success(\n\t\t\t\t\tconfident\n\t\t\t\t\t\t? `Purged ${totalPurged} cached solve${totalPurged === 1 ? '' : 's'}`\n\t\t\t\t\t\t: `Purged ~${totalPurged} across ${children} children (best-effort)`\n\t\t\t\t);\n\t\t\t\tshowPurgeConfirm = false;\n\t\t\t} else {\n\t\t\t\tconst { shutdown = 0, active = 0 } = data;\n\t\t\t\ttoast.success(\n\t\t\t\t\t`Shut down ${shutdown} child${shutdown === 1 ? '' : 'ren'} (${active} still active)`\n\t\t\t\t);\n\t\t\t\tshowShutdownConfirm = false;\n\t\t\t\t// The pool changed — re-probe so the card's status/version refresh.\n\t\t\t\thealthMap[server.id]?.check();\n\t\t\t}\n\t\t} catch {\n\t\t\ttoast.error(`Failed to ${action} server`);\n\t\t} finally {\n\t\t\tbusyAction[server.id] = null;\n\t\t}\n\t}\n\n\ttype LocalCacheAction = 'clear-solve-cache' | 'clear-definition-cache';\n\n\tlet busyLocalCache = $state<LocalCacheAction | null>(null);\n\tlet confirmingLocalCache = $state<{ action: LocalCacheAction; label: string } | null>(null);\n\tlet showLocalCacheConfirm = $state(false);\n\n\tasync function clearLocalCache(action: LocalCacheAction, label: string) {\n\t\tbusyLocalCache = action;\n\t\ttry {\n\t\t\tconst res = await fetch('/api/admin/compute/actions', {\n\t\t\t\tmethod: 'POST',\n\t\t\t\theaders: { 'Content-Type': 'application/json' },\n\t\t\t\tbody: JSON.stringify({ action })\n\t\t\t});\n\t\t\tconst data = await res.json().catch(() => ({}));\n\t\t\tif (!res.ok) {\n\t\t\t\ttoast.error(data.message || data.error || `Clear failed (${res.status})`);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst { entries = 0, bytes = 0 } = data;\n\t\t\ttoast.success(\n\t\t\t\t`Cleared ${label} — ${entries.toLocaleString()} ${entries === 1 ? 'entry' : 'entries'}, ${formatCacheBytes(bytes)}`\n\t\t\t);\n\t\t\tshowLocalCacheConfirm = false;\n\t\t\t// Counters just changed — reload so the panel doesn't show stale entries.\n\t\t\tawait refreshAll();\n\t\t} catch {\n\t\t\ttoast.error(`Failed to clear ${label}`);\n\t\t} finally {\n\t\t\tbusyLocalCache = null;\n\t\t}\n\t}\n</script>\n\n<svelte:head>\n\t<title>Admin · Compute</title>\n</svelte:head>\n\n{#snippet cachePanel(\n\tlabel: string,\n\tholds: string,\n\tenvVar: string,\n\tc: CacheCounters,\n\tnote: string | null,\n\tclearAction: LocalCacheAction\n)}\n\t{@const rate = hitRate(c)}\n\t<div class=\"space-y-2 rounded-lg border p-4\">\n\t\t<div class=\"flex items-baseline justify-between gap-3\">\n\t\t\t<div>\n\t\t\t\t<p class=\"text-sm font-medium\">{label}</p>\n\t\t\t\t<p class=\"text-muted-foreground text-xs\">{holds}</p>\n\t\t\t</div>\n\t\t\t<div class=\"text-right\">\n\t\t\t\t<p class=\"text-2xl font-semibold tabular-nums\">\n\t\t\t\t\t{rate === null ? '—' : `${rate}%`}\n\t\t\t\t</p>\n\t\t\t\t<p class=\"text-muted-foreground text-xs\">hit rate</p>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<dl class=\"text-muted-foreground grid grid-cols-3 gap-2 text-xs\">\n\t\t\t<div>\n\t\t\t\t<dt>Hits</dt>\n\t\t\t\t<dd class=\"text-foreground font-mono tabular-nums\">{c.hits.toLocaleString()}</dd>\n\t\t\t</div>\n\t\t\t<div>\n\t\t\t\t<dt>Misses</dt>\n\t\t\t\t<dd class=\"text-foreground font-mono tabular-nums\">{c.misses.toLocaleString()}</dd>\n\t\t\t</div>\n\t\t\t<div>\n\t\t\t\t<dt>Evictions</dt>\n\t\t\t\t<dd class=\"text-foreground font-mono tabular-nums\">{c.evictions.toLocaleString()}</dd>\n\t\t\t</div>\n\t\t</dl>\n\n\t\t<div\n\t\t\tclass=\"text-muted-foreground flex items-center justify-between gap-3 border-t pt-2 text-xs\"\n\t\t>\n\t\t\t<span>\n\t\t\t\t{c.entries.toLocaleString()}\n\t\t\t\t{c.entries === 1 ? 'entry' : 'entries'} · {formatCacheBytes(c.bytes)} of {formatCacheBytes(\n\t\t\t\t\tc.budgetBytes\n\t\t\t\t)}\n\t\t\t</span>\n\t\t\t<code class=\"font-mono text-[10px]\">{envVar}</code>\n\t\t</div>\n\n\t\t{#if note}\n\t\t\t<p class=\"text-muted-foreground text-xs\">{note}</p>\n\t\t{/if}\n\n\t\t<div class=\"flex justify-end\">\n\t\t\t<Button\n\t\t\t\tvariant=\"outline\"\n\t\t\t\tsize=\"sm\"\n\t\t\t\tdisabled={busyLocalCache !== null || c.entries === 0}\n\t\t\t\tonclick={() => {\n\t\t\t\t\tconfirmingLocalCache = { action: clearAction, label: label.toLowerCase() };\n\t\t\t\t\tshowLocalCacheConfirm = true;\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<Eraser class=\"mr-1 h-3.5 w-3.5\" />\n\t\t\t\t{busyLocalCache === clearAction ? 'Clearing…' : 'Clear'}\n\t\t\t</Button>\n\t\t</div>\n\t</div>\n{/snippet}\n\n{#snippet sharingControl(server: ServerEntry)}\n\t{@const isAll = server.sharedWith === 'all'}\n\t{@const orgIds = isAll ? new Set<string>() : new Set(server.sharedWith)}\n\t{@const isDefault = server.id === defaultServerId}\n\t<div class=\"space-y-2\">\n\t\t<div class=\"flex items-center gap-3\">\n\t\t\t<p class=\"text-muted-foreground text-xs\">Available to</p>\n\t\t\t<div class=\"bg-muted inline-flex rounded-md p-0.5\">\n\t\t\t\t<button\n\t\t\t\t\tclass=\"rounded-sm px-2 py-0.5 text-xs {isAll\n\t\t\t\t\t\t? 'bg-background shadow-sm'\n\t\t\t\t\t\t: 'text-muted-foreground hover:text-foreground'}\"\n\t\t\t\t\tonclick={() => setSharedWithAll(server, true)}\n\t\t\t\t>\n\t\t\t\t\tAll orgs\n\t\t\t\t</button>\n\t\t\t\t<button\n\t\t\t\t\tclass=\"rounded-sm px-2 py-0.5 text-xs {!isAll\n\t\t\t\t\t\t? 'bg-background shadow-sm'\n\t\t\t\t\t\t: 'text-muted-foreground hover:text-foreground'}\"\n\t\t\t\t\tonclick={() => setSharedWithAll(server, false)}\n\t\t\t\t>\n\t\t\t\t\tSpecific orgs\n\t\t\t\t</button>\n\t\t\t</div>\n\t\t\t{#if !isAll && data.orgs.length > 0}\n\t\t\t\t<button\n\t\t\t\t\tclass=\"text-muted-foreground hover:text-foreground ml-auto flex items-center gap-1 text-xs\"\n\t\t\t\t\tonclick={() => (expandedSharing[server.id] = !expandedSharing[server.id])}\n\t\t\t\t>\n\t\t\t\t\t{orgIds.size}/{data.orgs.length} selected\n\t\t\t\t\t{#if expandedSharing[server.id]}\n\t\t\t\t\t\t<ChevronUp class=\"h-3 w-3\" />\n\t\t\t\t\t{:else}\n\t\t\t\t\t\t<ChevronDown class=\"h-3 w-3\" />\n\t\t\t\t\t{/if}\n\t\t\t\t</button>\n\t\t\t{/if}\n\t\t</div>\n\t\t{#if !isAll && expandedSharing[server.id]}\n\t\t\t{#if data.orgs.length === 0}\n\t\t\t\t<p class=\"text-muted-foreground text-xs\">No organizations exist yet.</p>\n\t\t\t{:else}\n\t\t\t\t<div class=\"grid gap-1 sm:grid-cols-2\">\n\t\t\t\t\t{#each data.orgs as org (org.id)}\n\t\t\t\t\t\t<label class=\"hover:bg-hover flex items-center gap-2 rounded-sm px-2 py-1 text-xs\">\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t\t\t\tchecked={orgIds.has(org.id)}\n\t\t\t\t\t\t\t\tonchange={() => toggleOrg(server, org.id)}\n\t\t\t\t\t\t\t\tclass=\"h-3.5 w-3.5\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<span class=\"truncate\">{org.name}</span>\n\t\t\t\t\t\t\t<span class=\"text-muted-foreground ml-auto font-mono text-[10px]\">{org.slug}</span>\n\t\t\t\t\t\t</label>\n\t\t\t\t\t{/each}\n\t\t\t\t</div>\n\t\t\t{/if}\n\t\t{/if}\n\t\t{#if !isAll && isDefault}\n\t\t\t<p class=\"text-muted-foreground text-xs\">\n\t\t\t\tThis server is the global default — it stays visible to every org regardless of the\n\t\t\t\tallowlist.\n\t\t\t</p>\n\t\t{:else if !isAll && orgIds.size === 0}\n\t\t\t<p class=\"text-muted-foreground text-xs\">\n\t\t\t\tNo orgs selected — this server is dormant (admin-only).\n\t\t\t</p>\n\t\t{/if}\n\t</div>\n{/snippet}\n\n{#snippet serverCard(server: ServerEntry)}\n\t{@const health = healthMap[server.id]?.state}\n\t{@const sc = statusConfig[health?.state ?? 'idle']}\n\t{@const isChecking = health?.state === 'checking' || health?.state === 'loading'}\n\t{@const pluginEntries = Object.entries(health?.plugins ?? {})}\n\t{@const isRemoved = removedIds.has(server.id)}\n\t{@const isDirty = dirtyIds.has(server.id) && !isRemoved}\n\t<div\n\t\tclass=\"space-y-3 rounded-lg border p-4 transition-colors {isRemoved\n\t\t\t? 'border-destructive/40 bg-destructive/5'\n\t\t\t: isDirty\n\t\t\t\t? 'border-amber-400/60 bg-amber-50/30 dark:border-amber-500/40 dark:bg-amber-950/10'\n\t\t\t\t: 'bg-muted'}\"\n\t>\n\t\t{#if isRemoved}\n\t\t\t<div class=\"flex items-center justify-between gap-3\">\n\t\t\t\t<p class=\"text-destructive text-xs font-medium\">\n\t\t\t\t\t<span class=\"line-through\">{server.label}</span> will be removed when you save\n\t\t\t\t</p>\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\tonclick={() => undoRemove(server.id)}\n\t\t\t\t\tdisabled={saving}\n\t\t\t\t\tclass=\"h-7\"\n\t\t\t\t>\n\t\t\t\t\tUndo\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t{/if}\n\t\t<div\n\t\t\tclass=\"flex items-center justify-between {isRemoved ? 'pointer-events-none opacity-50' : ''}\"\n\t\t>\n\t\t\t<div class=\"flex items-center gap-2\">\n\t\t\t\t<Input\n\t\t\t\t\tplaceholder=\"label\"\n\t\t\t\t\tvalue={server.label}\n\t\t\t\t\toninput={(e) => {\n\t\t\t\t\t\tconst input = e.target as HTMLInputElement;\n\t\t\t\t\t\tserver.label = input.value.toLowerCase().replace(/[^a-z0-9_-]/g, '');\n\t\t\t\t\t\tinput.value = server.label;\n\t\t\t\t\t\tmarkDirty(server.id);\n\t\t\t\t\t}}\n\t\t\t\t\tclass=\"h-7 w-32 font-mono text-xs\"\n\t\t\t\t/>\n\t\t\t\t{#if server.id === defaultServerId}\n\t\t\t\t\t<span\n\t\t\t\t\t\tclass=\"flex items-center gap-1 rounded-full bg-green-100 px-2 py-0.5 text-xs font-medium text-green-800 dark:bg-green-900/30 dark:text-green-400\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Star class=\"h-3 w-3\" /> default\n\t\t\t\t\t</span>\n\t\t\t\t{:else}\n\t\t\t\t\t<button\n\t\t\t\t\t\tclass=\"text-muted-foreground hover:text-foreground text-xs underline-offset-2 hover:underline\"\n\t\t\t\t\t\tonclick={() => {\n\t\t\t\t\t\t\tdefaultServerId = server.id;\n\t\t\t\t\t\t\tmarkDirty(server.id);\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\tset as default\n\t\t\t\t\t</button>\n\t\t\t\t{/if}\n\t\t\t</div>\n\t\t\t<div class=\"flex items-center gap-3\">\n\t\t\t\t<div class=\"flex items-center gap-1.5\" title={health?.failureSummary ?? undefined}>\n\t\t\t\t\t<Circle class=\"h-2.5 w-2.5 shrink-0 fill-current {sc.color}\" />\n\t\t\t\t\t<span class=\"text-xs font-medium {sc.color}\">{sc.label}</span>\n\t\t\t\t</div>\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\tonclick={() => healthMap[server.id]?.check()}\n\t\t\t\t\tdisabled={isChecking}\n\t\t\t\t\tclass=\"h-7\"\n\t\t\t\t\ttitle=\"Probe this server's availability (retries for up to 1 min)\"\n\t\t\t\t>\n\t\t\t\t\t<RefreshCw class=\"mr-1.5 h-3.5 w-3.5 {isChecking ? 'animate-spin' : ''}\" />\n\t\t\t\t\t{isChecking ? 'Checking…' : 'Check'}\n\t\t\t\t</Button>\n\t\t\t\t{#if health?.reachable}\n\t\t\t\t\t{@const busy = busyAction[server.id]}\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\tonclick={() => {\n\t\t\t\t\t\t\tconfirmingPurge = server;\n\t\t\t\t\t\t\tshowPurgeConfirm = true;\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tdisabled={busy !== null && busy !== undefined}\n\t\t\t\t\t\tclass=\"h-7\"\n\t\t\t\t\t\ttitle=\"Clear cached solve results across this server's children (best-effort fleet-wide)\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Eraser class=\"mr-1.5 h-3.5 w-3.5\" />\n\t\t\t\t\t\t{busy === 'purge' ? 'Purging…' : 'Purge cache'}\n\t\t\t\t\t</Button>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\tonclick={() => {\n\t\t\t\t\t\t\tconfirmingShutdown = server;\n\t\t\t\t\t\t\tshowShutdownConfirm = true;\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tdisabled={busy !== null && busy !== undefined}\n\t\t\t\t\t\tclass=\"text-destructive hover:text-destructive h-7\"\n\t\t\t\t\t\ttitle=\"Gracefully shut down all child processes (they auto-respawn on the next request)\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Power class=\"mr-1.5 h-3.5 w-3.5\" />\n\t\t\t\t\t\t{busy === 'shutdown' ? 'Shutting down…' : 'Shutdown children'}\n\t\t\t\t\t</Button>\n\t\t\t\t{/if}\n\t\t\t\t{#if isDirty}\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\tonclick={() => discardChanges(server.id)}\n\t\t\t\t\t\tdisabled={saving}\n\t\t\t\t\t\tclass=\"text-muted-foreground hover:text-foreground h-7\"\n\t\t\t\t\t\ttitle=\"Revert this server to its saved values\"\n\t\t\t\t\t>\n\t\t\t\t\t\tDiscard\n\t\t\t\t\t</Button>\n\t\t\t\t{/if}\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\tonclick={() => {\n\t\t\t\t\t\tconfirmingRemove = server;\n\t\t\t\t\t\tshowRemoveConfirm = true;\n\t\t\t\t\t}}\n\t\t\t\t\tdisabled={server.id === defaultServerId}\n\t\t\t\t\ttitle={server.id === defaultServerId\n\t\t\t\t\t\t? 'Set another server as default before deleting'\n\t\t\t\t\t\t: undefined}\n\t\t\t\t\tclass=\"text-destructive hover:text-destructive h-7 w-7 p-0\"\n\t\t\t\t>\n\t\t\t\t\t<Trash2 class=\"h-3.5 w-3.5\" />\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t</div>\n\n\t\t{#if health?.failureSummary && !health.reachable && !isRemoved}\n\t\t\t<p class=\"text-muted-foreground text-xs\">{health.failureSummary}</p>\n\t\t{/if}\n\n\t\t{#if health?.reachable && !isRemoved}\n\t\t\t<div class=\"grid grid-cols-3 gap-2\">\n\t\t\t\t<div class=\"bg-muted rounded-md px-3 py-2\">\n\t\t\t\t\t<p class=\"text-muted-foreground text-xs\">Rhino</p>\n\t\t\t\t\t<p class=\"mt-0.5 text-xs font-medium\">{health.rhinoVersion ?? '-'}</p>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"bg-muted rounded-md px-3 py-2\">\n\t\t\t\t\t<p class=\"text-muted-foreground text-xs\">Compute</p>\n\t\t\t\t\t<p class=\"mt-0.5 text-xs font-medium\">{health.computeVersion ?? '-'}</p>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"bg-muted rounded-md px-3 py-2\">\n\t\t\t\t\t<p class=\"text-muted-foreground text-xs\">Selva Plugin</p>\n\t\t\t\t\t<p class=\"mt-0.5 text-xs font-medium\">\n\t\t\t\t\t\t{#if health.selvaInstalled}\n\t\t\t\t\t\t\t{health.selvaVersion}\n\t\t\t\t\t\t{:else if !health.ready}\n\t\t\t\t\t\t\t<span class=\"text-muted-foreground\">Loading…</span>\n\t\t\t\t\t\t{:else}\n\t\t\t\t\t\t\t<span class=\"text-red-600 dark:text-red-400\">Not installed</span>\n\t\t\t\t\t\t{/if}\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class=\"grid grid-cols-2 gap-2 sm:grid-cols-4\">\n\t\t\t\t<div class=\"bg-muted rounded-md px-3 py-2\">\n\t\t\t\t\t<p class=\"text-muted-foreground text-xs\">Active children</p>\n\t\t\t\t\t<p class=\"mt-0.5 text-xs font-medium\">{health.activeChildren ?? '-'}</p>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"bg-muted rounded-md px-3 py-2\">\n\t\t\t\t\t<p class=\"text-muted-foreground text-xs\">Idle for</p>\n\t\t\t\t\t<p class=\"mt-0.5 text-xs font-medium\">{formatIdle(health.idleSpanSeconds)}</p>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"bg-muted rounded-md px-3 py-2\">\n\t\t\t\t\t<p class=\"text-muted-foreground text-xs\">Solve timeout</p>\n\t\t\t\t\t<p class=\"mt-0.5 text-xs font-medium\">\n\t\t\t\t\t\t{health.limits ? `${health.limits.timeoutSeconds} s` : '100 s (assumed)'}\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"bg-muted rounded-md px-3 py-2\">\n\t\t\t\t\t<p class=\"text-muted-foreground text-xs\">Max request</p>\n\t\t\t\t\t<p class=\"mt-0.5 text-xs font-medium\">\n\t\t\t\t\t\t{health.limits\n\t\t\t\t\t\t\t? `${Math.round(health.limits.maxRequestBytes / (1024 * 1024))} MB`\n\t\t\t\t\t\t\t: 'Not reported'}\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t{#if !health.limits}\n\t\t\t\t<p class=\"text-muted-foreground text-xs\">\n\t\t\t\t\tThis server doesn't report its limits, so Selva assumes Rhino.Compute's defaults and\n\t\t\t\t\tre-uploads the definition on every solve. The VektorNode build of Rhino.Compute reports\n\t\t\t\t\tthem.\n\t\t\t\t</p>\n\t\t\t{/if}\n\t\t{/if}\n\n\t\t<div class=\"grid gap-2 sm:grid-cols-2 {isRemoved ? 'pointer-events-none opacity-50' : ''}\">\n\t\t\t<div class=\"space-y-1\">\n\t\t\t\t<p class=\"text-muted-foreground text-xs\">Server URL</p>\n\t\t\t\t<Input\n\t\t\t\t\tplaceholder=\"http://localhost:5000\"\n\t\t\t\t\tbind:value={server.serverUrl}\n\t\t\t\t\toninput={() => markDirty(server.id)}\n\t\t\t\t\tclass=\"font-mono text-xs\"\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<div class=\"space-y-1\">\n\t\t\t\t<p class=\"text-muted-foreground text-xs\">API Key (optional)</p>\n\t\t\t\t<div class=\"flex gap-1.5\">\n\t\t\t\t\t<Input\n\t\t\t\t\t\ttype=\"password\"\n\t\t\t\t\t\tplaceholder={server.hasApiKey && server.apiKey !== API_KEY_CLEAR && !server.apiKey\n\t\t\t\t\t\t\t? 'Key set - enter new value to replace'\n\t\t\t\t\t\t\t: server.apiKey === API_KEY_CLEAR\n\t\t\t\t\t\t\t\t? 'Key will be cleared on save'\n\t\t\t\t\t\t\t\t: ''}\n\t\t\t\t\t\tvalue={server.apiKey === API_KEY_CLEAR ? '' : server.apiKey}\n\t\t\t\t\t\tdisabled={server.apiKey === API_KEY_CLEAR}\n\t\t\t\t\t\toninput={(e) => {\n\t\t\t\t\t\t\tserver.apiKey = (e.target as HTMLInputElement).value;\n\t\t\t\t\t\t\tmarkDirty(server.id);\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tclass=\"font-mono text-xs\"\n\t\t\t\t\t/>\n\t\t\t\t\t{#if server.hasApiKey && server.apiKey !== API_KEY_CLEAR && !server.apiKey}\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\tclass=\"text-muted-foreground hover:text-destructive shrink-0 text-xs underline-offset-2 hover:underline\"\n\t\t\t\t\t\t\tonclick={() => {\n\t\t\t\t\t\t\t\tserver.apiKey = API_KEY_CLEAR;\n\t\t\t\t\t\t\t\tmarkDirty(server.id);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\tClear\n\t\t\t\t\t\t</button>\n\t\t\t\t\t{:else if server.apiKey === API_KEY_CLEAR}\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\tclass=\"text-muted-foreground hover:text-foreground shrink-0 text-xs underline-offset-2 hover:underline\"\n\t\t\t\t\t\t\tonclick={() => (server.apiKey = '')}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\tUndo\n\t\t\t\t\t\t</button>\n\t\t\t\t\t{/if}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\n\t\t{#if data.tenancy !== 'single' && !isRemoved}\n\t\t\t{@render sharingControl(server)}\n\t\t{/if}\n\n\t\t{#if health?.reachable && pluginEntries.length > 0 && !isRemoved}\n\t\t\t<div>\n\t\t\t\t<button\n\t\t\t\t\tclass=\"text-muted-foreground hover:text-foreground flex items-center gap-1 text-xs\"\n\t\t\t\t\tonclick={() => (expandedPlugins[server.id] = !expandedPlugins[server.id])}\n\t\t\t\t>\n\t\t\t\t\t{#if expandedPlugins[server.id]}\n\t\t\t\t\t\t<ChevronUp class=\"h-3 w-3\" />\n\t\t\t\t\t{:else}\n\t\t\t\t\t\t<ChevronDown class=\"h-3 w-3\" />\n\t\t\t\t\t{/if}\n\t\t\t\t\t{pluginEntries.length} Grasshopper plugin{pluginEntries.length === 1 ? '' : 's'}\n\t\t\t\t</button>\n\t\t\t\t{#if expandedPlugins[server.id]}\n\t\t\t\t\t<div class=\"mt-2 grid gap-1.5 sm:grid-cols-2 lg:grid-cols-3\">\n\t\t\t\t\t\t{#each pluginEntries as [name, version] (name)}\n\t\t\t\t\t\t\t<div class=\"bg-muted flex items-center justify-between rounded-md px-3 py-1.5\">\n\t\t\t\t\t\t\t\t<span class=\"text-xs font-medium\">{name}</span>\n\t\t\t\t\t\t\t\t<span class=\"text-muted-foreground text-xs\">{version}</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{/each}\n\t\t\t\t\t</div>\n\t\t\t\t{/if}\n\t\t\t</div>\n\t\t{/if}\n\t</div>\n{/snippet}\n\n<div class=\"space-y-6\">\n\t<SectionHeader\n\t\teyebrow=\"Admin\"\n\t\ttitle=\"Compute\"\n\t\tdescription=\"Manage compute servers. Share servers with specific orgs to expose them in pickers. When ALLOW_ORG_COMPUTE_OVERRIDE is on, org owners can configure their own servers.\"\n\t/>\n\n\t<Card.Root>\n\t\t<Card.Content class=\"space-y-3 pt-6\">\n\t\t\t{#if servers.length === 0}\n\t\t\t\t<EmptyState icon={Server} title=\"No servers configured\">\n\t\t\t\t\t{#snippet actions()}\n\t\t\t\t\t\t<Button variant=\"outline\" size=\"sm\" onclick={addServer}>\n\t\t\t\t\t\t\t<Plus class=\"mr-1.5 h-3.5 w-3.5\" />\n\t\t\t\t\t\t\tAdd server\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t{/snippet}\n\t\t\t\t</EmptyState>\n\t\t\t{:else}\n\t\t\t\t{#each servers as server (server.id)}\n\t\t\t\t\t{@render serverCard(server)}\n\t\t\t\t{/each}\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tonclick={addServer}\n\t\t\t\t\tclass=\"border-border-strong text-muted-foreground hover:border-input hover:text-foreground hover:bg-hover flex w-full items-center justify-center gap-2 rounded-lg border border-dashed py-4 text-sm font-medium transition-colors\"\n\t\t\t\t>\n\t\t\t\t\t<Plus class=\"h-4 w-4\" />\n\t\t\t\t\tAdd another server\n\t\t\t\t</button>\n\t\t\t{/if}\n\t\t</Card.Content>\n\t</Card.Root>\n\n\t{#if hasChanges}\n\t\t<div\n\t\t\tclass=\"bg-background/95 sticky bottom-4 z-10 flex items-center justify-between gap-4 rounded-lg border border-amber-400/60 p-3 shadow-lg backdrop-blur dark:border-amber-500/40\"\n\t\t>\n\t\t\t<p class=\"text-sm font-medium\">\n\t\t\t\t{pendingCount === 0\n\t\t\t\t\t? 'Default server changed'\n\t\t\t\t\t: `${pendingCount} unsaved change${pendingCount === 1 ? '' : 's'}`}\n\t\t\t\t{#if removedIds.size > 0}\n\t\t\t\t\t<span class=\"text-muted-foreground font-normal\">\n\t\t\t\t\t\t· {removedIds.size} pending removal\n\t\t\t\t\t</span>\n\t\t\t\t{/if}\n\t\t\t</p>\n\t\t\t<div class=\"flex items-center gap-2\">\n\t\t\t\t<Button variant=\"ghost\" size=\"sm\" onclick={discardAll} disabled={saving}>Discard all</Button\n\t\t\t\t>\n\t\t\t\t<Button size=\"sm\" onclick={save} disabled={saving}>\n\t\t\t\t\t{saving ? 'Saving…' : 'Save changes'}\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t</div>\n\t{/if}\n\n\t<SectionHeader\n\t\ttitle=\"Caching\"\n\t\tdescription=\"Whether solves are actually being served from memory. Counters are for this Selva instance and reset when it restarts; behind a load balancer each instance keeps its own, so Clear empties only this one.\"\n\t/>\n\n\t<Card.Root>\n\t\t<Card.Content class=\"grid gap-3 pt-6 sm:grid-cols-2\">\n\t\t\t{@render cachePanel(\n\t\t\t\t'Solve cache',\n\t\t\t\t'Results, so identical inputs skip Rhino entirely',\n\t\t\t\t'COMPUTE_SOLVE_CACHE_MB',\n\t\t\t\tdata.caches.solve,\n\t\t\t\t`Budget is per compute server — ${data.caches.solve.warmClients} warm, so up to ${formatCacheBytes(data.caches.solve.budgetTotalBytes)} total right now.`,\n\t\t\t\t'clear-solve-cache'\n\t\t\t)}\n\t\t\t{@render cachePanel(\n\t\t\t\t'Definition cache',\n\t\t\t\t'.gh bytes, so a solve skips the storage read',\n\t\t\t\t'COMPUTE_DEFINITION_CACHE_MB',\n\t\t\t\tdata.caches.definition,\n\t\t\t\tnull,\n\t\t\t\t'clear-definition-cache'\n\t\t\t)}\n\t\t</Card.Content>\n\t</Card.Root>\n</div>\n\n<ConfirmDialog\n\tbind:open={showShutdownConfirm}\n\ttitle=\"Shutdown children?\"\n\tdescription={confirmingShutdown\n\t\t? `Shut down ALL child processes on \"${confirmingShutdown.label}\"? In-flight solves on those children will be interrupted. The pool auto-respawns on the next request.`\n\t\t: undefined}\n\tconfirmLabel=\"Shutdown\"\n\tpendingLabel=\"Shutting down…\"\n\tvariant=\"destructive\"\n\tonConfirm={async () => {\n\t\tif (confirmingShutdown) await runAction(confirmingShutdown, 'shutdown');\n\t}}\n/>\n\n<ConfirmDialog\n\tbind:open={showPurgeConfirm}\n\ttitle=\"Purge cache?\"\n\tdescription={confirmingPurge\n\t\t? `Clear cached solve results across \"${confirmingPurge.label}\"'s children? This is best-effort across the pool.`\n\t\t: undefined}\n\tconfirmLabel=\"Purge\"\n\tpendingLabel=\"Purging…\"\n\tonConfirm={async () => {\n\t\tif (confirmingPurge) await runAction(confirmingPurge, 'purge');\n\t}}\n/>\n\n<ConfirmDialog\n\tbind:open={showLocalCacheConfirm}\n\ttitle=\"Clear this cache?\"\n\tdescription={confirmingLocalCache?.action === 'clear-solve-cache'\n\t\t? 'Drop every cached solve result held by this Selva instance. The next solve of each definition runs on Rhino.Compute again. Other instances behind a load balancer keep theirs.'\n\t\t: 'Drop the .gh bytes this Selva instance is holding. Costs a storage re-read on the next solve, nothing more.'}\n\tconfirmLabel=\"Clear\"\n\tpendingLabel=\"Clearing…\"\n\tonConfirm={async () => {\n\t\tif (confirmingLocalCache)\n\t\t\tawait clearLocalCache(confirmingLocalCache.action, confirmingLocalCache.label);\n\t}}\n/>\n\n<ConfirmDialog\n\tbind:open={showRemoveConfirm}\n\ttitle=\"Remove this server?\"\n\tdescription={confirmingRemove\n\t\t? `Remove \"${confirmingRemove.label}\" from the compute config? It stays listed, struck through, until you save.`\n\t\t: undefined}\n\tconfirmLabel=\"Remove\"\n\tvariant=\"destructive\"\n\tonConfirm={() => {\n\t\tif (confirmingRemove) removeServer(confirmingRemove);\n\t}}\n/>\n"],"ignoreList":[0,1],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAQyB,IAAaA,eAAU;CAAK,QAAQ;CAAU,QAAQ;CAAI,QAAM,C,CAAI,Q,EAAU,KAAK,0H,IAA+H,CAAA,QAAM,EAAI,KAAK,2BAA0B,CAAA,C;;AAI1PA,aAAW;AAGrC,SAAA,OAAA,YAAA,SAAA;CACA,IAAI,EAAA,SAAA,UAAA,GAAA,UAAA;CAYM,KAAA,YAAAE,aAAA,CAAA,OAAK,EAAA,MAAQF,aAAU,CAAA,CAAA,CAAA;AAXzB;;ACTiB,IAAa,aAAU;CAAK,QAAQ;CAAS,QAAQ;CAAI,QAAM,CAAI,CAAA,QAAM,EAAI,KAAK,WAAU,CAAA,GAAM,CAAA,QAAM,EAAI,KAAK,+BAA8B,CAAA,C;;AAI9I,WAAW;AAGrC,SAAA,MAAA,YAAA,SAAA;CACA,IAAI,EAAA,SAAA,UAAA,GAAA,UAAA;CAYM,KAAA,YAAAG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BAAmB,iBAAiB,KAAK,OAAO,MAAM,gBAAgB,EAAA,oBACrI,mBAAkB;;SAEV,WAAU,YAClB,oBACA,gDACA,+BACA,KAAK,OAAO,YACZ,MACA,wBAAuB;;;;;;;;;;;;;;;;;;;;;IASb,aAAA,qBAC2B,qCAAA,mBAAmB,MAAK,0GAC7D,KAAA;;;;IAIQ,WAAA,YAAY;KACtB,IAAI,oBAAoB,MAAM,UAAU,oBAAoB,UAAU;IACvE;;KAVW,OAAA;;;KAAA,sBAAmB;;;;;;;IAgBjB,aAAA,kBAC4B,sCAAA,gBAAgB,MAAK,sDAC3D,KAAA;;;IAGQ,WAAA,YAAY;KACtB,IAAI,iBAAiB,MAAM,UAAU,iBAAiB,OAAO;IAC9D;;KATW,OAAA;;;KAAA,mBAAgB;;;;;;;IAed,aAAA,sBAAsB,WAAW,sBAC3C,mLACA;;;IAGQ,WAAA,YAAY;KACtB,IAAI,sBACH,MAAM,gBAAgB,qBAAqB,QAAQ,qBAAqB,KAAK;IAC/E;;KAVW,OAAA;;;KAAA,wBAAqB;;;;;;;IAgBnB,aAAA,mBACC,WAAA,iBAAiB,MAAK,+EACjC,KAAA;;;IAGc,iBAAA;KAChB,IAAI,kBAAkB,aAAa,gBAAgB;IACpD;;KATW,OAAA;;;KAAA,oBAAiB;;;;;;;;;;;;CA9iBrB,CAAA"}
|
|
1
|
+
{"version":3,"file":"_page.svelte.js","names":["__iconData","__iconNode","$.spread_props","$.spread_props","$.derived","$.escape","$.attr","$.stringify","$.attr_class","$.attr_style","$.ensure_array_like","Card.Root","Card.Content"],"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/eraser.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/power.svelte","../../../../../../src/lib/composables/useServerHealth.svelte.ts","../../../../../../src/routes/admin/compute/+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\": \"eraser\", \"size\": 24, \"node\": [[\"path\", { \"d\": \"M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21\" }], [\"path\", { \"d\": \"m5.082 11.09 8.828 8.828\" }]] };\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/eraser\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\": \"power\", \"size\": 24, \"node\": [[\"path\", { \"d\": \"M12 2v10\" }], [\"path\", { \"d\": \"M18.4 6.6a9 9 0 1 1-12.77.04\" }]] };\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/power\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={__iconData} />\n","import { browser } from '$app/env';\n\nexport interface ServerHealthState {\n\tstate: 'idle' | 'checking' | 'loading' | 'ok' | 'warning' | 'error';\n\treachable: boolean;\n\t// True once the plugin inventory loaded, so `selvaInstalled` is\n\t// authoritative. A cold server is `reachable` (proxy answers) before it's\n\t// `ready` (a child finished enumerating Grasshopper add-ons).\n\tready: boolean;\n\trhinoVersion: string | null;\n\tcomputeVersion: string | null;\n\tselvaInstalled: boolean;\n\tselvaVersion: string | null;\n\tplugins: Record<string, string>;\n\tactiveChildren: number | null;\n\tidleSpanSeconds: number | null;\n\t/** What the server reports from `/limits`; `null` when it can't. */\n\tlimits: { timeoutSeconds: number; maxRequestBytes: number } | null;\n\t/**\n\t * Why the last probe failed, when the server classified it. Null while\n\t * reachable. Shown to the operator instead of a bare \"error\" pill.\n\t */\n\tfailureSummary: string | null;\n}\n\n// A manual check retries a cold/booting server for up to this long, so an\n// operator who clicks \"Check\" on a sleeping server sees it come Online\n// without re-clicking. Retries until *ready* (plugin inventory loaded), not\n// merely reachable — settling for reachable is what made Selva read as \"Not\n// installed\" during boot. Never polls on a background timer: every probe is\n// operator-initiated so we don't wake (and bill) idle servers.\nconst RETRY_WINDOW_MS = 60000;\nconst RETRY_INTERVAL_MS = 5000;\n\nexport function useServerHealth(serverId: () => string) {\n\tlet state = $state<ServerHealthState>({\n\t\tstate: 'idle',\n\t\treachable: false,\n\t\tready: false,\n\t\trhinoVersion: null,\n\t\tcomputeVersion: null,\n\t\tselvaInstalled: false,\n\t\tselvaVersion: null,\n\t\tplugins: {},\n\t\tactiveChildren: null,\n\t\tidleSpanSeconds: null,\n\t\tlimits: null,\n\t\tfailureSummary: null\n\t});\n\n\tlet timerId: ReturnType<typeof setTimeout> | null = null;\n\tlet deadline = 0;\n\tlet destroyed = false;\n\n\t// Set when the server says the failure cannot resolve itself (connection\n\t// refused, rejected API key). Ends the retry window early — see `attempt`.\n\tlet terminal = false;\n\n\t// Return value is the retry loop's stop condition: ready, not merely reachable.\n\tasync function probe(): Promise<boolean> {\n\t\tif (!browser || destroyed) return false;\n\t\ttry {\n\t\t\tconst res = await fetch(`/api/admin/compute/status?serverId=${serverId()}`);\n\t\t\tif (destroyed) return false;\n\t\t\tif (!res.ok) {\n\t\t\t\tstate = { ...state, reachable: false, ready: false };\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst data = await res.json();\n\t\t\tconst reachable: boolean = data.reachable;\n\t\t\tconst ready: boolean = data.ready ?? reachable;\n\t\t\t// Absent field (older server) means \"keep the old behaviour and retry\".\n\t\t\tterminal = !reachable && data.retryable === false;\n\t\t\tstate = {\n\t\t\t\treachable,\n\t\t\t\tready,\n\t\t\t\tfailureSummary: data.failureSummary ?? null,\n\t\t\t\trhinoVersion: data.rhinoVersion,\n\t\t\t\tcomputeVersion: data.computeVersion,\n\t\t\t\tselvaInstalled: data.selvaInstalled,\n\t\t\t\tselvaVersion: data.selvaVersion,\n\t\t\t\tplugins: data.plugins ?? {},\n\t\t\t\tactiveChildren: data.activeChildren ?? null,\n\t\t\t\tidleSpanSeconds: data.idleSpanSeconds ?? null,\n\t\t\t\tlimits: data.limits ?? null,\n\t\t\t\t// Reachable but not ready = a booting server still loading plugins.\n\t\t\t\t// Show 'loading' (progress), not 'warning' (misconfiguration), so the\n\t\t\t\t// operator isn't alarmed while add-ons enumerate. Only once the\n\t\t\t\t// inventory is loaded do we trust `selvaInstalled` to raise a warning.\n\t\t\t\tstate: !reachable ? 'error' : !ready ? 'loading' : !data.selvaInstalled ? 'warning' : 'ok'\n\t\t\t};\n\t\t\treturn ready;\n\t\t} catch {\n\t\t\t// A fetch that never reached our own API says nothing about the compute\n\t\t\t// server — keep retrying.\n\t\t\tterminal = false;\n\t\t\tif (!destroyed) state = { ...state, reachable: false, ready: false };\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tasync function attempt() {\n\t\tconst ready = await probe();\n\t\tif (destroyed || ready) return;\n\t\tif (terminal) {\n\t\t\t// The server told us waiting cannot help. Settle on the real reason now\n\t\t\t// rather than spinning out the window.\n\t\t\tstate = { ...state, state: 'error', reachable: false, ready: false };\n\t\t\treturn;\n\t\t}\n\t\tif (Date.now() < deadline) {\n\t\t\t// Keep the pill in an in-progress state between retries: 'loading' when\n\t\t\t// the server is up and enumerating plugins, 'checking' otherwise. Never\n\t\t\t// flash a terminal 'error'/'warning' while we still intend to retry.\n\t\t\tif (state.state !== 'loading') state = { ...state, state: 'checking' };\n\t\t\ttimerId = setTimeout(attempt, RETRY_INTERVAL_MS);\n\t\t} else if (!state.reachable) {\n\t\t\tstate = { ...state, state: 'error', reachable: false, ready: false };\n\t\t} else {\n\t\t\t// Reachable but never became ready within the window: don't leave it\n\t\t\t// stuck on 'loading' — the server is up but Selva couldn't be confirmed.\n\t\t\tstate = { ...state, state: 'warning' };\n\t\t}\n\t}\n\n\tfunction check() {\n\t\tif (!browser || destroyed) return;\n\t\tif (timerId !== null) {\n\t\t\tclearTimeout(timerId);\n\t\t\ttimerId = null;\n\t\t}\n\t\tdeadline = Date.now() + RETRY_WINDOW_MS;\n\t\tterminal = false;\n\t\tstate = { ...state, state: 'checking', failureSummary: null };\n\t\tattempt();\n\t}\n\n\tfunction stop() {\n\t\tdestroyed = true;\n\t\tif (timerId !== null) {\n\t\t\tclearTimeout(timerId);\n\t\t\ttimerId = null;\n\t\t}\n\t}\n\n\treturn {\n\t\tget state() {\n\t\t\treturn state;\n\t\t},\n\t\tcheck,\n\t\tstop\n\t};\n}\n","<script lang=\"ts\">\n\timport {\n\t\tButton,\n\t\tCard,\n\t\tEmptyState,\n\t\tInput,\n\t\ttoast,\n\t\tSectionHeader,\n\t\trandomId,\n\t\tConfirmDialog\n\t} from '@selvajs/ui';\n\timport {\n\t\tCircle,\n\t\tServer,\n\t\tPlus,\n\t\tTrash2,\n\t\tStar,\n\t\tChevronDown,\n\t\tChevronUp,\n\t\tRefreshCw,\n\t\tEraser,\n\t\tPower\n\t} from '@lucide/svelte';\n\timport type { PlatformComputeServer } from '@selvajs/platform/computeServer';\n\timport type { TenancyMode } from '@selvajs/platform';\n\timport { useServerHealth } from '#lib/composables/useServerHealth.svelte.js';\n\timport { refreshAll } from '$app/navigation';\n\timport { SvelteSet } from 'svelte/reactivity';\n\timport { untrack, onDestroy } from 'svelte';\n\n\tconst API_KEY_CLEAR = '__clear__';\n\n\tinterface ServerEntry extends Omit<PlatformComputeServer, 'apiKey' | 'scope'> {\n\t\tapiKey: string;\n\t\thasApiKey: boolean;\n\t}\n\n\tinterface OrgRow {\n\t\tid: string;\n\t\tname: string;\n\t\tslug: string;\n\t}\n\n\tinterface CacheCounters {\n\t\thits: number;\n\t\tmisses: number;\n\t\tevictions: number;\n\t\tentries: number;\n\t\tbytes: number;\n\t\tbudgetBytes: number;\n\t}\n\n\tinterface PageData {\n\t\tservers: (Omit<PlatformComputeServer, 'apiKey'> & { hasApiKey: boolean })[];\n\t\tdefaultServerId: string;\n\t\torgs: OrgRow[];\n\t\ttenancy: TenancyMode;\n\t\tcaches: {\n\t\t\tsolve: CacheCounters & { warmClients: number; budgetTotalBytes: number };\n\t\t\tdefinition: CacheCounters;\n\t\t};\n\t}\n\tinterface Props {\n\t\tdata: PageData;\n\t}\n\tlet { data }: Props = $props();\n\n\tfunction formatCacheBytes(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\t/**\n\t * Hit rate as a percentage, or null before any solve has consulted the cache.\n\t * Reported as null rather than 0% because \"no data yet\" and \"nothing is\n\t * hitting\" are different answers to the question an operator is asking.\n\t */\n\tfunction hitRate(c: { hits: number; misses: number }): number | null {\n\t\tconst total = c.hits + c.misses;\n\t\treturn total === 0 ? null : Math.round((c.hits / total) * 100);\n\t}\n\n\t// Humanize an idle span (seconds since the last child request) into a compact\n\t// \"just now / 5m / 1h 3m\" label. null → '-' (unreachable or not reported).\n\tfunction formatIdle(seconds: number | null): string {\n\t\tif (seconds === null) return '-';\n\t\tif (seconds < 5) return 'just now';\n\t\tif (seconds < 60) return `${Math.round(seconds)}s`;\n\t\tconst m = Math.floor(seconds / 60);\n\t\tif (m < 60) return `${m}m`;\n\t\tconst h = Math.floor(m / 60);\n\t\treturn `${h}h ${m % 60}m`;\n\t}\n\n\tconst statusConfig = {\n\t\tidle: { label: 'Not checked', color: 'text-muted-foreground' },\n\t\tok: { label: 'Online', color: 'text-green-600 dark:text-green-400' },\n\t\twarning: { label: 'Warning', color: 'text-yellow-600 dark:text-yellow-400' },\n\t\terror: { label: 'Offline', color: 'text-red-600 dark:text-red-400' },\n\t\tchecking: { label: 'Checking…', color: 'text-blue-600 dark:text-blue-400' },\n\t\t// Reachable but plugins still loading — a booting server, not a fault.\n\t\tloading: { label: 'Loading plugins…', color: 'text-blue-600 dark:text-blue-400' }\n\t};\n\n\tlet servers = $state<ServerEntry[]>([]);\n\tlet defaultServerId = $state('');\n\tlet saving = $state(false);\n\tconst dirtyIds = new SvelteSet<string>();\n\t// Servers the operator deleted. They stay in `servers` (struck through, with\n\t// Undo) until a save flushes them, so deletion follows the same stage-then-save\n\t// model as every other edit on this page.\n\tconst removedIds = new SvelteSet<string>();\n\tlet expandedPlugins = $state<Record<string, boolean>>({});\n\tlet expandedSharing = $state<Record<string, boolean>>({});\n\n\tfunction toEntry(s: PageData['servers'][number]): ServerEntry {\n\t\treturn {\n\t\t\tid: s.id,\n\t\t\tlabel: s.label,\n\t\t\tserverUrl: s.serverUrl,\n\t\t\tsharedWith: s.sharedWith === 'all' ? 'all' : [...s.sharedWith],\n\t\t\tapiKey: '',\n\t\t\thasApiKey: s.hasApiKey\n\t\t};\n\t}\n\n\tfunction markDirty(id: string) {\n\t\tdirtyIds.add(id);\n\t}\n\n\t// The whole page is one unit of work: the API replaces the entire platform\n\t// server list in a single PUT, so a per-card save would flush every other\n\t// card's edits along with it.\n\tconst pendingCount = $derived(dirtyIds.size + removedIds.size);\n\tconst defaultChanged = $derived(\n\t\tdefaultServerId !== data.defaultServerId && servers.some((s) => !removedIds.has(s.id))\n\t);\n\tconst hasChanges = $derived(pendingCount > 0 || defaultChanged);\n\n\tfunction forgetHealth(id: string) {\n\t\thealthMap[id]?.stop();\n\t\tconst { [id]: _, ...rest } = healthMap;\n\t\thealthMap = rest;\n\t}\n\n\tfunction discardChanges(id: string) {\n\t\tdirtyIds.delete(id);\n\t\tremovedIds.delete(id);\n\t\tconst original = data.servers.find((s) => s.id === id);\n\t\tif (!original) {\n\t\t\t// Newly-added server that was never saved — drop it.\n\t\t\tforgetHealth(id);\n\t\t\tservers = servers.filter((s) => s.id !== id);\n\t\t\treturn;\n\t\t}\n\t\tconst idx = servers.findIndex((s) => s.id === id);\n\t\tif (idx >= 0) servers[idx] = toEntry(original);\n\t}\n\n\tfunction discardAll() {\n\t\tfor (const id of [...dirtyIds, ...removedIds]) {\n\t\t\tif (!data.servers.some((s) => s.id === id)) forgetHealth(id);\n\t\t}\n\t\tdirtyIds.clear();\n\t\tremovedIds.clear();\n\t\tservers = data.servers.map(toEntry);\n\t\tdefaultServerId = data.defaultServerId;\n\t}\n\n\t// Per-server health — keyed by server id. Entries are created lazily and never\n\t// probe on their own; a server is only contacted when the operator clicks Check.\n\tlet healthMap = $state<Record<string, ReturnType<typeof useServerHealth>>>({});\n\n\tfunction ensureHealth(id: string) {\n\t\tif (!healthMap[id]) {\n\t\t\thealthMap[id] = useServerHealth(() => id);\n\t\t}\n\t\treturn healthMap[id];\n\t}\n\n\t$effect(() => {\n\t\tif (dirtyIds.size === 0 && removedIds.size === 0) {\n\t\t\tservers = data.servers.map(toEntry);\n\t\t\tdefaultServerId = data.defaultServerId;\n\t\t}\n\t});\n\n\t$effect(() => {\n\t\t// Pre-create an (idle) health entry per known server so each card has a\n\t\t// Check button to drive. No probe runs here — servers stay untouched until\n\t\t// the operator explicitly checks them. `ensureHealth` writes healthMap, so\n\t\t// it must be untracked — otherwise this effect re-runs and (via its old\n\t\t// cleanup) tore down the entries it just made, leaving Check a no-op.\n\t\tconst ids = data.servers.map((s) => s.id);\n\t\tuntrack(() => {\n\t\t\tfor (const id of ids) ensureHealth(id);\n\t\t});\n\t});\n\n\t// Teardown only on real unmount — never coupled to data/healthMap changes.\n\tonDestroy(() => {\n\t\tfor (const h of Object.values(healthMap)) h.stop();\n\t});\n\n\tfunction addServer() {\n\t\tconst id = randomId();\n\t\tif (servers.length === 0) defaultServerId = id;\n\t\tservers = [\n\t\t\t...servers,\n\t\t\t{\n\t\t\t\tid,\n\t\t\t\tlabel: 'new-server',\n\t\t\t\tserverUrl: 'http://localhost:5000',\n\t\t\t\tsharedWith: 'all',\n\t\t\t\tapiKey: '',\n\t\t\t\thasApiKey: false\n\t\t\t}\n\t\t];\n\t\tensureHealth(id);\n\t\tmarkDirty(id);\n\t}\n\n\tfunction removeServer(server: ServerEntry) {\n\t\tif (!data.servers.some((s) => s.id === server.id)) {\n\t\t\t// Never saved — nothing to stage, just drop it.\n\t\t\tdirtyIds.delete(server.id);\n\t\t\tforgetHealth(server.id);\n\t\t\tservers = servers.filter((s) => s.id !== server.id);\n\t\t} else {\n\t\t\tremovedIds.add(server.id);\n\t\t\tdirtyIds.delete(server.id);\n\t\t}\n\t\tshowRemoveConfirm = false;\n\t}\n\n\tfunction undoRemove(id: string) {\n\t\tremovedIds.delete(id);\n\t}\n\n\tfunction setSharedWithAll(server: ServerEntry, all: boolean) {\n\t\tserver.sharedWith = all ? 'all' : [];\n\t\tmarkDirty(server.id);\n\t}\n\n\tfunction toggleOrg(server: ServerEntry, orgId: string) {\n\t\tif (server.sharedWith === 'all') return; // ignored when in 'all' mode\n\t\tserver.sharedWith = server.sharedWith.includes(orgId)\n\t\t\t? server.sharedWith.filter((id) => id !== orgId)\n\t\t\t: [...server.sharedWith, orgId];\n\t\tmarkDirty(server.id);\n\t}\n\n\tasync function save() {\n\t\tsaving = true;\n\t\ttry {\n\t\t\tconst kept = servers.filter((s) => !removedIds.has(s.id));\n\t\t\tconst payload = {\n\t\t\t\tdefaultServerId: kept.some((s) => s.id === defaultServerId)\n\t\t\t\t\t? defaultServerId\n\t\t\t\t\t: (kept[0]?.id ?? ''),\n\t\t\t\tservers: kept.map(({ apiKey, hasApiKey: _, ...s }) => ({\n\t\t\t\t\t...s,\n\t\t\t\t\t...(apiKey === API_KEY_CLEAR ? { apiKey: null } : apiKey ? { apiKey } : {})\n\t\t\t\t}))\n\t\t\t};\n\t\t\tconst res = await fetch('/api/admin/compute', {\n\t\t\t\tmethod: 'PUT',\n\t\t\t\theaders: { 'Content-Type': 'application/json' },\n\t\t\t\tbody: JSON.stringify(payload)\n\t\t\t});\n\t\t\tif (res.ok) {\n\t\t\t\ttoast.success(\n\t\t\t\t\tremovedIds.size > 0\n\t\t\t\t\t\t? `Saved — ${removedIds.size} server${removedIds.size === 1 ? '' : 's'} removed`\n\t\t\t\t\t\t: 'Compute config saved'\n\t\t\t\t);\n\t\t\t\tfor (const id of removedIds) forgetHealth(id);\n\t\t\t\tawait refreshAll();\n\t\t\t\tdirtyIds.clear();\n\t\t\t\tremovedIds.clear();\n\t\t\t\t// Reset health to idle after save (URL/key may have changed) without\n\t\t\t\t// probing — the operator re-checks manually to avoid waking servers.\n\t\t\t\tfor (const h of Object.values(healthMap)) h.stop();\n\t\t\t\thealthMap = {};\n\t\t\t\tfor (const s of servers) ensureHealth(s.id);\n\t\t\t} else {\n\t\t\t\tconst err = await res.json().catch(() => ({ error: 'Unknown error' }));\n\t\t\t\ttoast.error(err.message || err.error || `Failed to save (${res.status})`);\n\t\t\t}\n\t\t} catch {\n\t\t\ttoast.error('Failed to save compute config');\n\t\t} finally {\n\t\t\tsaving = false;\n\t\t}\n\t}\n\n\t// Per-server in-flight action ('purge' | 'shutdown') so each card disables only\n\t// its own buttons while a fleet action runs.\n\tlet busyAction = $state<Record<string, 'purge' | 'shutdown' | null>>({});\n\tlet confirmingShutdown = $state<ServerEntry | null>(null);\n\tlet confirmingPurge = $state<ServerEntry | null>(null);\n\tlet showShutdownConfirm = $state(false);\n\tlet showPurgeConfirm = $state(false);\n\tlet confirmingRemove = $state<ServerEntry | null>(null);\n\tlet showRemoveConfirm = $state(false);\n\n\tasync function runAction(server: ServerEntry, action: 'purge' | 'shutdown') {\n\t\tbusyAction[server.id] = action;\n\t\ttry {\n\t\t\tconst res = await fetch('/api/admin/compute/actions', {\n\t\t\t\tmethod: 'POST',\n\t\t\t\theaders: { 'Content-Type': 'application/json' },\n\t\t\t\tbody: JSON.stringify({ serverId: server.id, action })\n\t\t\t});\n\t\t\tconst data = await res.json().catch(() => ({}));\n\t\t\tif (!res.ok) {\n\t\t\t\ttoast.error(data.message || data.error || `Action failed (${res.status})`);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (action === 'purge') {\n\t\t\t\t// purgeAllChildren is best-effort across a round-robin pool — say so\n\t\t\t\t// honestly unless the server reported a single child (exact).\n\t\t\t\tconst { totalPurged = 0, children = 0, confident } = data;\n\t\t\t\ttoast.success(\n\t\t\t\t\tconfident\n\t\t\t\t\t\t? `Purged ${totalPurged} cached solve${totalPurged === 1 ? '' : 's'}`\n\t\t\t\t\t\t: `Purged ~${totalPurged} across ${children} children (best-effort)`\n\t\t\t\t);\n\t\t\t\tshowPurgeConfirm = false;\n\t\t\t} else {\n\t\t\t\tconst { shutdown = 0, active = 0 } = data;\n\t\t\t\ttoast.success(\n\t\t\t\t\t`Shut down ${shutdown} child${shutdown === 1 ? '' : 'ren'} (${active} still active)`\n\t\t\t\t);\n\t\t\t\tshowShutdownConfirm = false;\n\t\t\t\t// The pool changed — re-probe so the card's status/version refresh.\n\t\t\t\thealthMap[server.id]?.check();\n\t\t\t}\n\t\t} catch {\n\t\t\ttoast.error(`Failed to ${action} server`);\n\t\t} finally {\n\t\t\tbusyAction[server.id] = null;\n\t\t}\n\t}\n\n\ttype LocalCacheAction = 'clear-solve-cache' | 'clear-definition-cache';\n\n\tlet busyLocalCache = $state<LocalCacheAction | null>(null);\n\tlet confirmingLocalCache = $state<{ action: LocalCacheAction; label: string } | null>(null);\n\tlet showLocalCacheConfirm = $state(false);\n\n\tasync function clearLocalCache(action: LocalCacheAction, label: string) {\n\t\tbusyLocalCache = action;\n\t\ttry {\n\t\t\tconst res = await fetch('/api/admin/compute/actions', {\n\t\t\t\tmethod: 'POST',\n\t\t\t\theaders: { 'Content-Type': 'application/json' },\n\t\t\t\tbody: JSON.stringify({ action })\n\t\t\t});\n\t\t\tconst data = await res.json().catch(() => ({}));\n\t\t\tif (!res.ok) {\n\t\t\t\ttoast.error(data.message || data.error || `Clear failed (${res.status})`);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst { entries = 0, bytes = 0 } = data;\n\t\t\ttoast.success(\n\t\t\t\t`Cleared ${label} — ${entries.toLocaleString()} ${entries === 1 ? 'entry' : 'entries'}, ${formatCacheBytes(bytes)}`\n\t\t\t);\n\t\t\tshowLocalCacheConfirm = false;\n\t\t\t// Counters just changed — reload so the panel doesn't show stale entries.\n\t\t\tawait refreshAll();\n\t\t} catch {\n\t\t\ttoast.error(`Failed to clear ${label}`);\n\t\t} finally {\n\t\t\tbusyLocalCache = null;\n\t\t}\n\t}\n</script>\n\n<svelte:head>\n\t<title>Admin · Compute</title>\n</svelte:head>\n\n{#snippet cachePanel(\n\tlabel: string,\n\tholds: string,\n\tenvVar: string,\n\tc: CacheCounters,\n\tnote: string | null,\n\tclearAction: LocalCacheAction\n)}\n\t{@const rate = hitRate(c)}\n\t{@const full = c.budgetBytes > 0 ? Math.min(100, Math.round((c.bytes / c.budgetBytes) * 100)) : 0}\n\t<div class=\"space-y-2 rounded-lg border p-4\">\n\t\t<div class=\"flex items-baseline justify-between gap-3\">\n\t\t\t<div>\n\t\t\t\t<p class=\"text-sm font-medium\">{label}</p>\n\t\t\t\t<p class=\"text-muted-foreground text-xs\">{holds}</p>\n\t\t\t</div>\n\t\t\t<div class=\"text-right\">\n\t\t\t\t<p class=\"text-2xl font-semibold tabular-nums\">\n\t\t\t\t\t{rate === null ? '—' : `${rate}%`}\n\t\t\t\t</p>\n\t\t\t\t<p class=\"text-muted-foreground text-xs\">hit rate</p>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<dl class=\"text-muted-foreground grid grid-cols-3 gap-2 text-xs\">\n\t\t\t<div>\n\t\t\t\t<dt>Hits</dt>\n\t\t\t\t<dd class=\"text-foreground font-mono tabular-nums\">{c.hits.toLocaleString()}</dd>\n\t\t\t</div>\n\t\t\t<div>\n\t\t\t\t<dt>Misses</dt>\n\t\t\t\t<dd class=\"text-foreground font-mono tabular-nums\">{c.misses.toLocaleString()}</dd>\n\t\t\t</div>\n\t\t\t<div>\n\t\t\t\t<dt>Evictions</dt>\n\t\t\t\t<dd class=\"text-foreground font-mono tabular-nums\">{c.evictions.toLocaleString()}</dd>\n\t\t\t</div>\n\t\t</dl>\n\n\t\t<div\n\t\t\tclass=\"text-muted-foreground flex items-center justify-between gap-3 border-t pt-2 text-xs\"\n\t\t>\n\t\t\t<span>\n\t\t\t\t{c.entries.toLocaleString()}\n\t\t\t\t{c.entries === 1 ? 'entry' : 'entries'} · {formatCacheBytes(c.bytes)} of {formatCacheBytes(\n\t\t\t\t\tc.budgetBytes\n\t\t\t\t)}\n\t\t\t</span>\n\t\t\t<code class=\"font-mono text-[10px]\">{envVar}</code>\n\t\t</div>\n\n\t\t<div class=\"space-y-1\">\n\t\t\t<div class=\"text-muted-foreground flex justify-between text-xs\">\n\t\t\t\t<span>{full}% full</span>\n\t\t\t\t{#if full >= 90}\n\t\t\t\t\t<span class=\"text-destructive\"\n\t\t\t\t\t\t>Nearly full: oldest entries get evicted, raise {envVar}</span\n\t\t\t\t\t>\n\t\t\t\t{/if}\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\tclass=\"bg-muted h-2 overflow-hidden rounded-full\"\n\t\t\t\trole=\"progressbar\"\n\t\t\t\taria-label=\"{label} fill\"\n\t\t\t\taria-valuemin={0}\n\t\t\t\taria-valuemax={100}\n\t\t\t\taria-valuenow={full}\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tclass=\"h-full rounded-full {full >= 90\n\t\t\t\t\t\t? 'bg-destructive'\n\t\t\t\t\t\t: full >= 70\n\t\t\t\t\t\t\t? 'bg-warning'\n\t\t\t\t\t\t\t: 'bg-primary'}\"\n\t\t\t\t\tstyle=\"width: {full}%\"\n\t\t\t\t></div>\n\t\t\t</div>\n\t\t</div>\n\n\t\t{#if note}\n\t\t\t<p class=\"text-muted-foreground text-xs\">{note}</p>\n\t\t{/if}\n\n\t\t<div class=\"flex justify-end\">\n\t\t\t<Button\n\t\t\t\tvariant=\"outline\"\n\t\t\t\tsize=\"sm\"\n\t\t\t\tdisabled={busyLocalCache !== null || c.entries === 0}\n\t\t\t\tonclick={() => {\n\t\t\t\t\tconfirmingLocalCache = { action: clearAction, label: label.toLowerCase() };\n\t\t\t\t\tshowLocalCacheConfirm = true;\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<Eraser class=\"mr-1 h-3.5 w-3.5\" />\n\t\t\t\t{busyLocalCache === clearAction ? 'Clearing…' : 'Clear'}\n\t\t\t</Button>\n\t\t</div>\n\t</div>\n{/snippet}\n\n{#snippet sharingControl(server: ServerEntry)}\n\t{@const isAll = server.sharedWith === 'all'}\n\t{@const orgIds = isAll ? new Set<string>() : new Set(server.sharedWith)}\n\t{@const isDefault = server.id === defaultServerId}\n\t<div class=\"space-y-2\">\n\t\t<div class=\"flex items-center gap-3\">\n\t\t\t<p class=\"text-muted-foreground text-xs\">Available to</p>\n\t\t\t<div class=\"bg-muted inline-flex rounded-md p-0.5\">\n\t\t\t\t<button\n\t\t\t\t\tclass=\"rounded-sm px-2 py-0.5 text-xs {isAll\n\t\t\t\t\t\t? 'bg-background shadow-sm'\n\t\t\t\t\t\t: 'text-muted-foreground hover:text-foreground'}\"\n\t\t\t\t\tonclick={() => setSharedWithAll(server, true)}\n\t\t\t\t>\n\t\t\t\t\tAll orgs\n\t\t\t\t</button>\n\t\t\t\t<button\n\t\t\t\t\tclass=\"rounded-sm px-2 py-0.5 text-xs {!isAll\n\t\t\t\t\t\t? 'bg-background shadow-sm'\n\t\t\t\t\t\t: 'text-muted-foreground hover:text-foreground'}\"\n\t\t\t\t\tonclick={() => setSharedWithAll(server, false)}\n\t\t\t\t>\n\t\t\t\t\tSpecific orgs\n\t\t\t\t</button>\n\t\t\t</div>\n\t\t\t{#if !isAll && data.orgs.length > 0}\n\t\t\t\t<button\n\t\t\t\t\tclass=\"text-muted-foreground hover:text-foreground ml-auto flex items-center gap-1 text-xs\"\n\t\t\t\t\tonclick={() => (expandedSharing[server.id] = !expandedSharing[server.id])}\n\t\t\t\t>\n\t\t\t\t\t{orgIds.size}/{data.orgs.length} selected\n\t\t\t\t\t{#if expandedSharing[server.id]}\n\t\t\t\t\t\t<ChevronUp class=\"h-3 w-3\" />\n\t\t\t\t\t{:else}\n\t\t\t\t\t\t<ChevronDown class=\"h-3 w-3\" />\n\t\t\t\t\t{/if}\n\t\t\t\t</button>\n\t\t\t{/if}\n\t\t</div>\n\t\t{#if !isAll && expandedSharing[server.id]}\n\t\t\t{#if data.orgs.length === 0}\n\t\t\t\t<p class=\"text-muted-foreground text-xs\">No organizations exist yet.</p>\n\t\t\t{:else}\n\t\t\t\t<div class=\"grid gap-1 sm:grid-cols-2\">\n\t\t\t\t\t{#each data.orgs as org (org.id)}\n\t\t\t\t\t\t<label class=\"hover:bg-hover flex items-center gap-2 rounded-sm px-2 py-1 text-xs\">\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t\t\t\tchecked={orgIds.has(org.id)}\n\t\t\t\t\t\t\t\tonchange={() => toggleOrg(server, org.id)}\n\t\t\t\t\t\t\t\tclass=\"h-3.5 w-3.5\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<span class=\"truncate\">{org.name}</span>\n\t\t\t\t\t\t\t<span class=\"text-muted-foreground ml-auto font-mono text-[10px]\">{org.slug}</span>\n\t\t\t\t\t\t</label>\n\t\t\t\t\t{/each}\n\t\t\t\t</div>\n\t\t\t{/if}\n\t\t{/if}\n\t\t{#if !isAll && isDefault}\n\t\t\t<p class=\"text-muted-foreground text-xs\">\n\t\t\t\tThis server is the global default — it stays visible to every org regardless of the\n\t\t\t\tallowlist.\n\t\t\t</p>\n\t\t{:else if !isAll && orgIds.size === 0}\n\t\t\t<p class=\"text-muted-foreground text-xs\">\n\t\t\t\tNo orgs selected — this server is dormant (admin-only).\n\t\t\t</p>\n\t\t{/if}\n\t</div>\n{/snippet}\n\n{#snippet serverCard(server: ServerEntry)}\n\t{@const health = healthMap[server.id]?.state}\n\t{@const sc = statusConfig[health?.state ?? 'idle']}\n\t{@const isChecking = health?.state === 'checking' || health?.state === 'loading'}\n\t{@const pluginEntries = Object.entries(health?.plugins ?? {})}\n\t{@const isRemoved = removedIds.has(server.id)}\n\t{@const isDirty = dirtyIds.has(server.id) && !isRemoved}\n\t<div\n\t\tclass=\"space-y-3 rounded-lg border p-4 transition-colors {isRemoved\n\t\t\t? 'border-destructive/40 bg-destructive/5'\n\t\t\t: isDirty\n\t\t\t\t? 'border-amber-400/60 bg-amber-50/30 dark:border-amber-500/40 dark:bg-amber-950/10'\n\t\t\t\t: 'bg-muted'}\"\n\t>\n\t\t{#if isRemoved}\n\t\t\t<div class=\"flex items-center justify-between gap-3\">\n\t\t\t\t<p class=\"text-destructive text-xs font-medium\">\n\t\t\t\t\t<span class=\"line-through\">{server.label}</span> will be removed when you save\n\t\t\t\t</p>\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\tonclick={() => undoRemove(server.id)}\n\t\t\t\t\tdisabled={saving}\n\t\t\t\t\tclass=\"h-7\"\n\t\t\t\t>\n\t\t\t\t\tUndo\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t{/if}\n\t\t<div\n\t\t\tclass=\"flex items-center justify-between {isRemoved ? 'pointer-events-none opacity-50' : ''}\"\n\t\t>\n\t\t\t<div class=\"flex items-center gap-2\">\n\t\t\t\t<Input\n\t\t\t\t\tplaceholder=\"label\"\n\t\t\t\t\tvalue={server.label}\n\t\t\t\t\toninput={(e) => {\n\t\t\t\t\t\tconst input = e.target as HTMLInputElement;\n\t\t\t\t\t\tserver.label = input.value.toLowerCase().replace(/[^a-z0-9_-]/g, '');\n\t\t\t\t\t\tinput.value = server.label;\n\t\t\t\t\t\tmarkDirty(server.id);\n\t\t\t\t\t}}\n\t\t\t\t\tclass=\"h-7 w-32 font-mono text-xs\"\n\t\t\t\t/>\n\t\t\t\t{#if server.id === defaultServerId}\n\t\t\t\t\t<span\n\t\t\t\t\t\tclass=\"flex items-center gap-1 rounded-full bg-green-100 px-2 py-0.5 text-xs font-medium text-green-800 dark:bg-green-900/30 dark:text-green-400\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Star class=\"h-3 w-3\" /> default\n\t\t\t\t\t</span>\n\t\t\t\t{:else}\n\t\t\t\t\t<button\n\t\t\t\t\t\tclass=\"text-muted-foreground hover:text-foreground text-xs underline-offset-2 hover:underline\"\n\t\t\t\t\t\tonclick={() => {\n\t\t\t\t\t\t\tdefaultServerId = server.id;\n\t\t\t\t\t\t\tmarkDirty(server.id);\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\tset as default\n\t\t\t\t\t</button>\n\t\t\t\t{/if}\n\t\t\t</div>\n\t\t\t<div class=\"flex items-center gap-3\">\n\t\t\t\t<div class=\"flex items-center gap-1.5\" title={health?.failureSummary ?? undefined}>\n\t\t\t\t\t<Circle class=\"h-2.5 w-2.5 shrink-0 fill-current {sc.color}\" />\n\t\t\t\t\t<span class=\"text-xs font-medium {sc.color}\">{sc.label}</span>\n\t\t\t\t</div>\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\tonclick={() => healthMap[server.id]?.check()}\n\t\t\t\t\tdisabled={isChecking}\n\t\t\t\t\tclass=\"h-7\"\n\t\t\t\t\ttitle=\"Probe this server's availability (retries for up to 1 min)\"\n\t\t\t\t>\n\t\t\t\t\t<RefreshCw class=\"mr-1.5 h-3.5 w-3.5 {isChecking ? 'animate-spin' : ''}\" />\n\t\t\t\t\t{isChecking ? 'Checking…' : 'Check'}\n\t\t\t\t</Button>\n\t\t\t\t{#if health?.reachable}\n\t\t\t\t\t{@const busy = busyAction[server.id]}\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\tonclick={() => {\n\t\t\t\t\t\t\tconfirmingPurge = server;\n\t\t\t\t\t\t\tshowPurgeConfirm = true;\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tdisabled={busy !== null && busy !== undefined}\n\t\t\t\t\t\tclass=\"h-7\"\n\t\t\t\t\t\ttitle=\"Clear cached solve results across this server's children (best-effort fleet-wide)\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Eraser class=\"mr-1.5 h-3.5 w-3.5\" />\n\t\t\t\t\t\t{busy === 'purge' ? 'Purging…' : 'Purge cache'}\n\t\t\t\t\t</Button>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\tonclick={() => {\n\t\t\t\t\t\t\tconfirmingShutdown = server;\n\t\t\t\t\t\t\tshowShutdownConfirm = true;\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tdisabled={busy !== null && busy !== undefined}\n\t\t\t\t\t\tclass=\"text-destructive hover:text-destructive h-7\"\n\t\t\t\t\t\ttitle=\"Gracefully shut down all child processes (they auto-respawn on the next request)\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Power class=\"mr-1.5 h-3.5 w-3.5\" />\n\t\t\t\t\t\t{busy === 'shutdown' ? 'Shutting down…' : 'Shutdown children'}\n\t\t\t\t\t</Button>\n\t\t\t\t{/if}\n\t\t\t\t{#if isDirty}\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\tonclick={() => discardChanges(server.id)}\n\t\t\t\t\t\tdisabled={saving}\n\t\t\t\t\t\tclass=\"text-muted-foreground hover:text-foreground h-7\"\n\t\t\t\t\t\ttitle=\"Revert this server to its saved values\"\n\t\t\t\t\t>\n\t\t\t\t\t\tDiscard\n\t\t\t\t\t</Button>\n\t\t\t\t{/if}\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\tonclick={() => {\n\t\t\t\t\t\tconfirmingRemove = server;\n\t\t\t\t\t\tshowRemoveConfirm = true;\n\t\t\t\t\t}}\n\t\t\t\t\tdisabled={server.id === defaultServerId}\n\t\t\t\t\ttitle={server.id === defaultServerId\n\t\t\t\t\t\t? 'Set another server as default before deleting'\n\t\t\t\t\t\t: undefined}\n\t\t\t\t\tclass=\"text-destructive hover:text-destructive h-7 w-7 p-0\"\n\t\t\t\t>\n\t\t\t\t\t<Trash2 class=\"h-3.5 w-3.5\" />\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t</div>\n\n\t\t{#if health?.failureSummary && !health.reachable && !isRemoved}\n\t\t\t<p class=\"text-muted-foreground text-xs\">{health.failureSummary}</p>\n\t\t{/if}\n\n\t\t{#if health?.reachable && !isRemoved}\n\t\t\t<div class=\"grid grid-cols-3 gap-2\">\n\t\t\t\t<div class=\"bg-muted rounded-md px-3 py-2\">\n\t\t\t\t\t<p class=\"text-muted-foreground text-xs\">Rhino</p>\n\t\t\t\t\t<p class=\"mt-0.5 text-xs font-medium\">{health.rhinoVersion ?? '-'}</p>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"bg-muted rounded-md px-3 py-2\">\n\t\t\t\t\t<p class=\"text-muted-foreground text-xs\">Compute</p>\n\t\t\t\t\t<p class=\"mt-0.5 text-xs font-medium\">{health.computeVersion ?? '-'}</p>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"bg-muted rounded-md px-3 py-2\">\n\t\t\t\t\t<p class=\"text-muted-foreground text-xs\">Selva Plugin</p>\n\t\t\t\t\t<p class=\"mt-0.5 text-xs font-medium\">\n\t\t\t\t\t\t{#if health.selvaInstalled}\n\t\t\t\t\t\t\t{health.selvaVersion}\n\t\t\t\t\t\t{:else if !health.ready}\n\t\t\t\t\t\t\t<span class=\"text-muted-foreground\">Loading…</span>\n\t\t\t\t\t\t{:else}\n\t\t\t\t\t\t\t<span class=\"text-red-600 dark:text-red-400\">Not installed</span>\n\t\t\t\t\t\t{/if}\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class=\"grid grid-cols-2 gap-2 sm:grid-cols-4\">\n\t\t\t\t<div class=\"bg-muted rounded-md px-3 py-2\">\n\t\t\t\t\t<p class=\"text-muted-foreground text-xs\">Active children</p>\n\t\t\t\t\t<p class=\"mt-0.5 text-xs font-medium\">{health.activeChildren ?? '-'}</p>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"bg-muted rounded-md px-3 py-2\">\n\t\t\t\t\t<p class=\"text-muted-foreground text-xs\">Idle for</p>\n\t\t\t\t\t<p class=\"mt-0.5 text-xs font-medium\">{formatIdle(health.idleSpanSeconds)}</p>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"bg-muted rounded-md px-3 py-2\">\n\t\t\t\t\t<p class=\"text-muted-foreground text-xs\">Solve timeout</p>\n\t\t\t\t\t<p class=\"mt-0.5 text-xs font-medium\">\n\t\t\t\t\t\t{health.limits ? `${health.limits.timeoutSeconds} s` : '100 s (assumed)'}\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"bg-muted rounded-md px-3 py-2\">\n\t\t\t\t\t<p class=\"text-muted-foreground text-xs\">Max request</p>\n\t\t\t\t\t<p class=\"mt-0.5 text-xs font-medium\">\n\t\t\t\t\t\t{health.limits\n\t\t\t\t\t\t\t? `${Math.round(health.limits.maxRequestBytes / (1024 * 1024))} MB`\n\t\t\t\t\t\t\t: 'Not reported'}\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t{#if !health.limits}\n\t\t\t\t<p class=\"text-muted-foreground text-xs\">\n\t\t\t\t\tThis server doesn't report its limits, so Selva assumes Rhino.Compute's defaults and\n\t\t\t\t\tre-uploads the definition on every solve. The VektorNode build of Rhino.Compute reports\n\t\t\t\t\tthem.\n\t\t\t\t</p>\n\t\t\t{/if}\n\t\t{/if}\n\n\t\t<div class=\"grid gap-2 sm:grid-cols-2 {isRemoved ? 'pointer-events-none opacity-50' : ''}\">\n\t\t\t<div class=\"space-y-1\">\n\t\t\t\t<p class=\"text-muted-foreground text-xs\">Server URL</p>\n\t\t\t\t<Input\n\t\t\t\t\tplaceholder=\"http://localhost:5000\"\n\t\t\t\t\tbind:value={server.serverUrl}\n\t\t\t\t\toninput={() => markDirty(server.id)}\n\t\t\t\t\tclass=\"font-mono text-xs\"\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<div class=\"space-y-1\">\n\t\t\t\t<p class=\"text-muted-foreground text-xs\">API Key (optional)</p>\n\t\t\t\t<div class=\"flex gap-1.5\">\n\t\t\t\t\t<Input\n\t\t\t\t\t\ttype=\"password\"\n\t\t\t\t\t\tplaceholder={server.hasApiKey && server.apiKey !== API_KEY_CLEAR && !server.apiKey\n\t\t\t\t\t\t\t? 'Key set - enter new value to replace'\n\t\t\t\t\t\t\t: server.apiKey === API_KEY_CLEAR\n\t\t\t\t\t\t\t\t? 'Key will be cleared on save'\n\t\t\t\t\t\t\t\t: ''}\n\t\t\t\t\t\tvalue={server.apiKey === API_KEY_CLEAR ? '' : server.apiKey}\n\t\t\t\t\t\tdisabled={server.apiKey === API_KEY_CLEAR}\n\t\t\t\t\t\toninput={(e) => {\n\t\t\t\t\t\t\tserver.apiKey = (e.target as HTMLInputElement).value;\n\t\t\t\t\t\t\tmarkDirty(server.id);\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tclass=\"font-mono text-xs\"\n\t\t\t\t\t/>\n\t\t\t\t\t{#if server.hasApiKey && server.apiKey !== API_KEY_CLEAR && !server.apiKey}\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\tclass=\"text-muted-foreground hover:text-destructive shrink-0 text-xs underline-offset-2 hover:underline\"\n\t\t\t\t\t\t\tonclick={() => {\n\t\t\t\t\t\t\t\tserver.apiKey = API_KEY_CLEAR;\n\t\t\t\t\t\t\t\tmarkDirty(server.id);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\tClear\n\t\t\t\t\t\t</button>\n\t\t\t\t\t{:else if server.apiKey === API_KEY_CLEAR}\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\tclass=\"text-muted-foreground hover:text-foreground shrink-0 text-xs underline-offset-2 hover:underline\"\n\t\t\t\t\t\t\tonclick={() => (server.apiKey = '')}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\tUndo\n\t\t\t\t\t\t</button>\n\t\t\t\t\t{/if}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\n\t\t{#if data.tenancy !== 'single' && !isRemoved}\n\t\t\t{@render sharingControl(server)}\n\t\t{/if}\n\n\t\t{#if health?.reachable && pluginEntries.length > 0 && !isRemoved}\n\t\t\t<div>\n\t\t\t\t<button\n\t\t\t\t\tclass=\"text-muted-foreground hover:text-foreground flex items-center gap-1 text-xs\"\n\t\t\t\t\tonclick={() => (expandedPlugins[server.id] = !expandedPlugins[server.id])}\n\t\t\t\t>\n\t\t\t\t\t{#if expandedPlugins[server.id]}\n\t\t\t\t\t\t<ChevronUp class=\"h-3 w-3\" />\n\t\t\t\t\t{:else}\n\t\t\t\t\t\t<ChevronDown class=\"h-3 w-3\" />\n\t\t\t\t\t{/if}\n\t\t\t\t\t{pluginEntries.length} Grasshopper plugin{pluginEntries.length === 1 ? '' : 's'}\n\t\t\t\t</button>\n\t\t\t\t{#if expandedPlugins[server.id]}\n\t\t\t\t\t<div class=\"mt-2 grid gap-1.5 sm:grid-cols-2 lg:grid-cols-3\">\n\t\t\t\t\t\t{#each pluginEntries as [name, version] (name)}\n\t\t\t\t\t\t\t<div class=\"bg-muted flex items-center justify-between rounded-md px-3 py-1.5\">\n\t\t\t\t\t\t\t\t<span class=\"text-xs font-medium\">{name}</span>\n\t\t\t\t\t\t\t\t<span class=\"text-muted-foreground text-xs\">{version}</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{/each}\n\t\t\t\t\t</div>\n\t\t\t\t{/if}\n\t\t\t</div>\n\t\t{/if}\n\t</div>\n{/snippet}\n\n<div class=\"space-y-6\">\n\t<SectionHeader\n\t\teyebrow=\"Admin\"\n\t\ttitle=\"Compute\"\n\t\tdescription=\"Manage compute servers. Share servers with specific orgs to expose them in pickers. When ALLOW_ORG_COMPUTE_OVERRIDE is on, org owners can configure their own servers.\"\n\t/>\n\n\t<Card.Root>\n\t\t<Card.Content class=\"space-y-3 pt-6\">\n\t\t\t{#if servers.length === 0}\n\t\t\t\t<EmptyState icon={Server} title=\"No servers configured\">\n\t\t\t\t\t{#snippet actions()}\n\t\t\t\t\t\t<Button variant=\"outline\" size=\"sm\" onclick={addServer}>\n\t\t\t\t\t\t\t<Plus class=\"mr-1.5 h-3.5 w-3.5\" />\n\t\t\t\t\t\t\tAdd server\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t{/snippet}\n\t\t\t\t</EmptyState>\n\t\t\t{:else}\n\t\t\t\t{#each servers as server (server.id)}\n\t\t\t\t\t{@render serverCard(server)}\n\t\t\t\t{/each}\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tonclick={addServer}\n\t\t\t\t\tclass=\"border-border-strong text-muted-foreground hover:border-input hover:text-foreground hover:bg-hover flex w-full items-center justify-center gap-2 rounded-lg border border-dashed py-4 text-sm font-medium transition-colors\"\n\t\t\t\t>\n\t\t\t\t\t<Plus class=\"h-4 w-4\" />\n\t\t\t\t\tAdd another server\n\t\t\t\t</button>\n\t\t\t{/if}\n\t\t</Card.Content>\n\t</Card.Root>\n\n\t{#if hasChanges}\n\t\t<div\n\t\t\tclass=\"bg-background/95 sticky bottom-4 z-10 flex items-center justify-between gap-4 rounded-lg border border-amber-400/60 p-3 shadow-lg backdrop-blur dark:border-amber-500/40\"\n\t\t>\n\t\t\t<p class=\"text-sm font-medium\">\n\t\t\t\t{pendingCount === 0\n\t\t\t\t\t? 'Default server changed'\n\t\t\t\t\t: `${pendingCount} unsaved change${pendingCount === 1 ? '' : 's'}`}\n\t\t\t\t{#if removedIds.size > 0}\n\t\t\t\t\t<span class=\"text-muted-foreground font-normal\">\n\t\t\t\t\t\t· {removedIds.size} pending removal\n\t\t\t\t\t</span>\n\t\t\t\t{/if}\n\t\t\t</p>\n\t\t\t<div class=\"flex items-center gap-2\">\n\t\t\t\t<Button variant=\"ghost\" size=\"sm\" onclick={discardAll} disabled={saving}>Discard all</Button\n\t\t\t\t>\n\t\t\t\t<Button size=\"sm\" onclick={save} disabled={saving}>\n\t\t\t\t\t{saving ? 'Saving…' : 'Save changes'}\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t</div>\n\t{/if}\n\n\t<SectionHeader\n\t\ttitle=\"Caching\"\n\t\tdescription=\"Whether solves are actually being served from memory. Counters are for this Selva instance and reset when it restarts; behind a load balancer each instance keeps its own, so Clear empties only this one.\"\n\t/>\n\n\t<Card.Root>\n\t\t<Card.Content class=\"grid gap-3 pt-6 sm:grid-cols-2\">\n\t\t\t{@render cachePanel(\n\t\t\t\t'Solve cache',\n\t\t\t\t'Results, so identical inputs skip Rhino entirely',\n\t\t\t\t'COMPUTE_SOLVE_CACHE_MB',\n\t\t\t\tdata.caches.solve,\n\t\t\t\t`Budget is per compute server — ${data.caches.solve.warmClients} warm, so up to ${formatCacheBytes(data.caches.solve.budgetTotalBytes)} total right now.`,\n\t\t\t\t'clear-solve-cache'\n\t\t\t)}\n\t\t\t{@render cachePanel(\n\t\t\t\t'Definition cache',\n\t\t\t\t'.gh bytes, so a solve skips the storage read',\n\t\t\t\t'COMPUTE_DEFINITION_CACHE_MB',\n\t\t\t\tdata.caches.definition,\n\t\t\t\tnull,\n\t\t\t\t'clear-definition-cache'\n\t\t\t)}\n\t\t</Card.Content>\n\t</Card.Root>\n</div>\n\n<ConfirmDialog\n\tbind:open={showShutdownConfirm}\n\ttitle=\"Shutdown children?\"\n\tdescription={confirmingShutdown\n\t\t? `Shut down ALL child processes on \"${confirmingShutdown.label}\"? In-flight solves on those children will be interrupted. The pool auto-respawns on the next request.`\n\t\t: undefined}\n\tconfirmLabel=\"Shutdown\"\n\tpendingLabel=\"Shutting down…\"\n\tvariant=\"destructive\"\n\tonConfirm={async () => {\n\t\tif (confirmingShutdown) await runAction(confirmingShutdown, 'shutdown');\n\t}}\n/>\n\n<ConfirmDialog\n\tbind:open={showPurgeConfirm}\n\ttitle=\"Purge cache?\"\n\tdescription={confirmingPurge\n\t\t? `Clear cached solve results across \"${confirmingPurge.label}\"'s children? This is best-effort across the pool.`\n\t\t: undefined}\n\tconfirmLabel=\"Purge\"\n\tpendingLabel=\"Purging…\"\n\tonConfirm={async () => {\n\t\tif (confirmingPurge) await runAction(confirmingPurge, 'purge');\n\t}}\n/>\n\n<ConfirmDialog\n\tbind:open={showLocalCacheConfirm}\n\ttitle=\"Clear this cache?\"\n\tdescription={confirmingLocalCache?.action === 'clear-solve-cache'\n\t\t? 'Drop every cached solve result held by this Selva instance. The next solve of each definition runs on Rhino.Compute again. Other instances behind a load balancer keep theirs.'\n\t\t: 'Drop the .gh bytes this Selva instance is holding. Costs a storage re-read on the next solve, nothing more.'}\n\tconfirmLabel=\"Clear\"\n\tpendingLabel=\"Clearing…\"\n\tonConfirm={async () => {\n\t\tif (confirmingLocalCache)\n\t\t\tawait clearLocalCache(confirmingLocalCache.action, confirmingLocalCache.label);\n\t}}\n/>\n\n<ConfirmDialog\n\tbind:open={showRemoveConfirm}\n\ttitle=\"Remove this server?\"\n\tdescription={confirmingRemove\n\t\t? `Remove \"${confirmingRemove.label}\" from the compute config? It stays listed, struck through, until you save.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AO,MAAM,gBAAgB,EAAA,oBACrI,mBAAkB;;SAEV,WAAU,YAClB,oBACA,gDACA,+BACA,KAAK,OAAO,YACZ,MACA,wBAAuB;;;;;;;;;;;;;;;;;;;;;IASb,aAAA,qBAC2B,qCAAA,mBAAmB,MAAK,0GAC7D,KAAA;;;;IAIQ,WAAA,YAAY;KACtB,IAAI,oBAAoB,MAAM,UAAU,oBAAoB,UAAU;IACvE;;KAVW,OAAA;;;KAAA,sBAAmB;;;;;;;IAgBjB,aAAA,kBAC4B,sCAAA,gBAAgB,MAAK,sDAC3D,KAAA;;;IAGQ,WAAA,YAAY;KACtB,IAAI,iBAAiB,MAAM,UAAU,iBAAiB,OAAO;IAC9D;;KATW,OAAA;;;KAAA,mBAAgB;;;;;;;IAed,aAAA,sBAAsB,WAAW,sBAC3C,mLACA;;;IAGQ,WAAA,YAAY;KACtB,IAAI,sBACH,MAAM,gBAAgB,qBAAqB,QAAQ,qBAAqB,KAAK;IAC/E;;KAVW,OAAA;;;KAAA,wBAAqB;;;;;;;IAgBnB,aAAA,mBACC,WAAA,iBAAiB,MAAK,+EACjC,KAAA;;;IAGc,iBAAA;KAChB,IAAI,kBAAkB,aAAa,gBAAgB;IACpD;;KATW,OAAA;;;KAAA,oBAAiB;;;;;;;;;;;;CA3kBrB,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Lt as escape_html, Ot as attr, a as derived, c as head, d as spread_props } from "../../../../../chunks/server3.js";
|
|
2
|
-
import { n as Icon } from "../../../../../chunks/
|
|
2
|
+
import { n as Icon } from "../../../../../chunks/utils.js";
|
|
3
3
|
import { t as Button } from "../../../../../chunks/button.js";
|
|
4
4
|
import { t as Arrow_left } from "../../../../../chunks/arrow-left.js";
|
|
5
5
|
import { t as Plus } from "../../../../../chunks/plus.js";
|
|
@@ -2,7 +2,7 @@ import { t as flag } from "../../../../chunks/providers.server.js";
|
|
|
2
2
|
import { C as requirePermission } from "../../../../chunks/access.js";
|
|
3
3
|
import { r as hasPermission } from "../../../../chunks/context.js";
|
|
4
4
|
import { t as asHttpError } from "../../../../chunks/access2.server.js";
|
|
5
|
-
import {
|
|
5
|
+
import { S as REMOTE_DEFINITION_MAX_BYTES, _ as MAX_IMAGE_FILE_SIZE, a as computeRequestCap, b as REMOTE_DEFINITION_CACHE_TTL_MS, f as COMPUTE_DEFINITION_CACHE_BYTES, g as MAX_DEFINITION_FILE_SIZE, h as COMPUTE_SOLVE_CACHE_BYTES, m as COMPUTE_RESPONSE_MAX_BYTES, v as RATE_LIMIT_MAX_REQUESTS, x as REMOTE_DEFINITION_FETCH_TIMEOUT_MS, y as RATE_LIMIT_WINDOW_MS } from "../../../../chunks/engine.server.js";
|
|
6
6
|
import { i as writeChannel, r as readChannel, t as checkForUpdate } from "../../../../chunks/updateCheck.server.js";
|
|
7
7
|
import { t as getBootHealth } from "../../../../chunks/bootHealth.server.js";
|
|
8
8
|
import { t as package_default } from "../../../../chunks/package.js";
|
|
@@ -35,7 +35,7 @@ var load = async ({ locals, fetch, request, url }) => {
|
|
|
35
35
|
RATE_LIMIT_MAX_REQUESTS,
|
|
36
36
|
MAX_DEFINITION_FILE_SIZE,
|
|
37
37
|
MAX_IMAGE_FILE_SIZE,
|
|
38
|
-
COMPUTE_REQUEST_MAX_BYTES,
|
|
38
|
+
COMPUTE_REQUEST_MAX_BYTES: computeRequestCap(),
|
|
39
39
|
COMPUTE_RESPONSE_MAX_BYTES,
|
|
40
40
|
REMOTE_DEFINITION_MAX_BYTES,
|
|
41
41
|
REMOTE_DEFINITION_FETCH_TIMEOUT_MS,
|
|
@@ -53,6 +53,11 @@ var load = async ({ locals, fetch, request, url }) => {
|
|
|
53
53
|
compatible: null,
|
|
54
54
|
required: null,
|
|
55
55
|
running: process.versions.node
|
|
56
|
+
},
|
|
57
|
+
dataCompatibility: {
|
|
58
|
+
compatible: null,
|
|
59
|
+
installed: 3,
|
|
60
|
+
target: null
|
|
56
61
|
}
|
|
57
62
|
};
|
|
58
63
|
return {
|
|
@@ -77,7 +82,7 @@ async function configView(request, url) {
|
|
|
77
82
|
checks: getConfigChecks({
|
|
78
83
|
atRestOnPreviousKey,
|
|
79
84
|
request: facts,
|
|
80
|
-
computeRequestMaxBytes:
|
|
85
|
+
computeRequestMaxBytes: computeRequestCap(),
|
|
81
86
|
dev: false
|
|
82
87
|
})
|
|
83
88
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_page.server.ts.js","names":["pkg"],"sources":["../../../../../../src/routes/admin/system/+page.server.ts"],"sourcesContent":["import { fail } from '@sveltejs/kit';\nimport { hasPermission } from '@selvajs/platform';\nimport { flag } from '#lib/server/providers.server.js';\nimport { checkForUpdate } from '#lib/server/updateCheck.server.js';\nimport { readChannel, writeChannel } from '#lib/server/releaseChannel.server.js';\nimport { asHttpError, requirePermission } from '#lib/server/access.server.js';\nimport {\n\tRATE_LIMIT_WINDOW_MS,\n\tRATE_LIMIT_MAX_REQUESTS,\n\tMAX_DEFINITION_FILE_SIZE,\n\tMAX_IMAGE_FILE_SIZE,\n\
|
|
1
|
+
{"version":3,"file":"_page.server.ts.js","names":["pkg"],"sources":["../../../../../../src/routes/admin/system/+page.server.ts"],"sourcesContent":["import { fail } from '@sveltejs/kit';\nimport { hasPermission } from '@selvajs/platform';\nimport { flag } from '#lib/server/providers.server.js';\nimport { checkForUpdate } from '#lib/server/updateCheck.server.js';\nimport { DATA_FORMAT } from '#lib/server/dataFormat.server.js';\nimport { readChannel, writeChannel } from '#lib/server/releaseChannel.server.js';\nimport { asHttpError, requirePermission } from '#lib/server/access.server.js';\nimport {\n\tRATE_LIMIT_WINDOW_MS,\n\tRATE_LIMIT_MAX_REQUESTS,\n\tMAX_DEFINITION_FILE_SIZE,\n\tMAX_IMAGE_FILE_SIZE,\n\tCOMPUTE_RESPONSE_MAX_BYTES,\n\tREMOTE_DEFINITION_MAX_BYTES,\n\tREMOTE_DEFINITION_FETCH_TIMEOUT_MS,\n\tREMOTE_DEFINITION_CACHE_TTL_MS,\n\tCOMPUTE_DEFINITION_CACHE_BYTES,\n\tCOMPUTE_SOLVE_CACHE_BYTES\n} from '#lib/server/computeLimits.js';\nimport { computeRequestCap } from '#lib/server/compute/engine.server.js';\nimport { dev } from '$app/env';\nimport {\n\tgetChangesSinceLastBoot,\n\tgetConfigChecks,\n\tgetConfigReport,\n\tgetKeyRotation\n} from '#lib/server/config/boot.server.js';\nimport { requestFacts } from '#lib/server/config/checks.js';\nimport { getBootHealth } from '#lib/server/bootHealth.server.js';\nimport pkg from '../../../../package.json';\nimport type { Actions, PageServerLoad } from './$types';\n\n/**\n * System settings host the Update runner (`manage_updates`). Other panels\n * (platform-flag display, build/deploy metadata) are visible to anyone who\n * passed the layout-level `assertAnyPlatformPermission` gate.\n *\n * `version` comes from a build-time JSON import of this package's own\n * package.json — the runtime version IS the version we built with, and\n * after an admin update the new build embeds the new constant. No need to\n * shell out to `npm` or read node_modules at request time.\n */\nexport const load: PageServerLoad = async ({ locals, fetch, request, url }) => {\n\tconst ctx = locals.ctx;\n\tconst canManageUpdates = ctx ? hasPermission(ctx, 'manage_updates') : false;\n\t// The on-demand health check endpoint is instance_admin-only; gate the UI\n\t// to match so we don't show a button that 403s.\n\tconst isInstanceAdmin = ctx ? hasPermission(ctx, 'instance_admin') : false;\n\n\tconst flags = {\n\t\tALLOW_CROSS_ORG_PUBLIC: flag('ALLOW_CROSS_ORG_PUBLIC'),\n\t\tALLOW_ORG_COMPUTE_OVERRIDE: flag('ALLOW_ORG_COMPUTE_OVERRIDE'),\n\t\tALLOW_ORG_CREATION: flag('ALLOW_ORG_CREATION'),\n\t\tENABLE_PLATFORM_PROJECTS: flag('ENABLE_PLATFORM_PROJECTS'),\n\t\tENABLE_SHARING: flag('ENABLE_SHARING')\n\t};\n\n\t// Resolved compute/upload limits (computeLimits.ts is the single source of\n\t// truth — each value here reflects the env override or its default). Surfaced\n\t// read-only so operators can see what's enforced without reading the .env.\n\tconst limits = {\n\t\tRATE_LIMIT_WINDOW_MS,\n\t\tRATE_LIMIT_MAX_REQUESTS,\n\t\tMAX_DEFINITION_FILE_SIZE,\n\t\tMAX_IMAGE_FILE_SIZE,\n\t\tCOMPUTE_REQUEST_MAX_BYTES: computeRequestCap(),\n\t\tCOMPUTE_RESPONSE_MAX_BYTES,\n\t\tREMOTE_DEFINITION_MAX_BYTES,\n\t\tREMOTE_DEFINITION_FETCH_TIMEOUT_MS,\n\t\tREMOTE_DEFINITION_CACHE_TTL_MS,\n\t\tCOMPUTE_DEFINITION_CACHE_BYTES,\n\t\tCOMPUTE_SOLVE_CACHE_BYTES\n\t};\n\n\t// The persisted release channel drives which dist-tag the update check (and\n\t// the runner) targets. Read it regardless of permission so the panel can show\n\t// it; only managers can change it via the action below.\n\tconst channel = readChannel();\n\n\t// Only operators who can run updates need the registry check — skip the\n\t// npm round-trip for everyone else.\n\tconst update = canManageUpdates\n\t\t? await checkForUpdate(fetch, channel)\n\t\t: {\n\t\t\t\tchannel,\n\t\t\t\tcurrent: null,\n\t\t\t\tlatest: null,\n\t\t\t\tupdateAvailable: false,\n\t\t\t\tnodeCompatibility: {\n\t\t\t\t\tcompatible: null,\n\t\t\t\t\trequired: null,\n\t\t\t\t\trunning: process.versions.node\n\t\t\t\t},\n\t\t\t\tdataCompatibility: { compatible: null, installed: DATA_FORMAT, target: null }\n\t\t\t};\n\n\treturn {\n\t\tcanManageUpdates,\n\t\tisInstanceAdmin,\n\t\tflags,\n\t\tlimits,\n\t\t// Hosts, ports and addresses: instance admins only, like the health check.\n\t\tconfig: isInstanceAdmin ? await configView(request, url) : null,\n\t\tversion: pkg.version,\n\t\tchannel,\n\t\tupdate\n\t};\n};\n\nasync function configView(request: Request, url: URL) {\n\t// Set only while SELVA_AT_REST_KEY_PREVIOUS is: what `--finish` would strand.\n\tconst atRestOnPreviousKey = (await getBootHealth()).atRestSecrets?.onPreviousKey ?? null;\n\tconst facts = requestFacts(request.headers, url);\n\treturn {\n\t\treport: getConfigReport(),\n\t\tchanges: getChangesSinceLastBoot(),\n\t\trotation: getKeyRotation(),\n\t\tproxied: facts.proxied,\n\t\tchecks: getConfigChecks({\n\t\t\tatRestOnPreviousKey,\n\t\t\trequest: facts,\n\t\t\tcomputeRequestMaxBytes: computeRequestCap(),\n\t\t\tdev\n\t\t})\n\t};\n}\n\nexport const actions: Actions = {\n\t// Persist the release channel. Switch-only: this does NOT trigger an update —\n\t// the operator then uses the Update runner to install from the chosen channel.\n\tsetChannel: async ({ request, locals }) => {\n\t\tawait asHttpError(() => requirePermission(locals, 'manage_updates'));\n\t\tconst data = await request.formData();\n\t\tconst channel = data.get('channel');\n\t\tif (channel !== 'stable' && channel !== 'beta') {\n\t\t\treturn fail(400, { error: 'Invalid channel.' });\n\t\t}\n\t\ttry {\n\t\t\twriteChannel(channel);\n\t\t} catch (e) {\n\t\t\treturn fail(500, {\n\t\t\t\terror: `Could not persist the channel: ${e instanceof Error ? e.message : 'unknown error'}`\n\t\t\t});\n\t\t}\n\t\treturn { channel };\n\t}\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA0CA,IAAa,OAAuB,OAAO,EAAE,QAAQ,OAAO,SAAS,UAAU;CAC9E,MAAM,MAAM,OAAO;CACnB,MAAM,mBAAmB,MAAM,cAAc,KAAK,gBAAgB,IAAI;CAGtE,MAAM,kBAAkB,MAAM,cAAc,KAAK,gBAAgB,IAAI;CAErE,MAAM,QAAQ;EACb,wBAAwB,KAAK,wBAAwB;EACrD,4BAA4B,KAAK,4BAA4B;EAC7D,oBAAoB,KAAK,oBAAoB;EAC7C,0BAA0B,KAAK,0BAA0B;EACzD,gBAAgB,KAAK,gBAAgB;CACtC;CAKA,MAAM,SAAS;EACd;EACA;EACA;EACA;EACA,2BAA2B,kBAAkB;EAC7C;EACA;EACA;EACA;EACA;EACA;CACD;CAKA,MAAM,UAAU,YAAY;CAI5B,MAAM,SAAS,mBACZ,MAAM,eAAe,OAAO,OAAO,IACnC;EACA;EACA,SAAS;EACT,QAAQ;EACR,iBAAiB;EACjB,mBAAmB;GAClB,YAAY;GACZ,UAAU;GACV,SAAS,QAAQ,SAAS;EAC3B;EACA,mBAAmB;GAAE,YAAY;GAAM,WAAA;GAAwB,QAAQ;EAAK;CAC7E;CAEF,OAAO;EACN;EACA;EACA;EACA;EAEA,QAAQ,kBAAkB,MAAM,WAAW,SAAS,GAAG,IAAI;EAC3D,SAASA,gBAAI;EACb;EACA;CACD;AACD;AAEA,eAAe,WAAW,SAAkB,KAAU;CAErD,MAAM,uBAAuB,MAAM,cAAc,EAAA,CAAG,eAAe,iBAAiB;CACpF,MAAM,QAAQ,aAAa,QAAQ,SAAS,GAAG;CAC/C,OAAO;EACN,QAAQ,gBAAgB;EACxB,SAAS,wBAAwB;EACjC,UAAU,eAAe;EACzB,SAAS,MAAM;EACf,QAAQ,gBAAgB;GACvB;GACA,SAAS;GACT,wBAAwB,kBAAkB;GAC1C,KAAA;EACD,CAAC;CACF;AACD;AAEA,IAAa,UAAmB,EAG/B,YAAY,OAAO,EAAE,SAAS,aAAa;CAC1C,MAAM,kBAAkB,kBAAkB,QAAQ,gBAAgB,CAAC;CAEnE,MAAM,WAAU,MADG,QAAQ,SAAS,EAAA,CACf,IAAI,SAAS;CAClC,IAAI,YAAY,YAAY,YAAY,QACvC,OAAO,KAAK,KAAK,EAAE,OAAO,mBAAmB,CAAC;CAE/C,IAAI;EACH,aAAa,OAAO;CACrB,SAAS,GAAG;EACX,OAAO,KAAK,KAAK,EAChB,OAAO,kCAAkC,aAAa,QAAQ,EAAE,UAAU,kBAC3E,CAAC;CACF;CACA,OAAO,EAAE,QAAQ;AAClB,EACD"}
|
|
@@ -2,7 +2,7 @@ import { t as deriveOutcome } from "../../../../chunks/update-outcome.js";
|
|
|
2
2
|
import { Ft as run, Lt as escape_html, Ot as attr, a as derived, c as head, d as spread_props, f as stringify, s as ensure_array_like, t as attr_class } from "../../../../chunks/server3.js";
|
|
3
3
|
import "../../../../chunks/index-server2.js";
|
|
4
4
|
import { t as page } from "../../../../chunks/state.js";
|
|
5
|
-
import { n as Icon } from "../../../../chunks/
|
|
5
|
+
import { n as Icon } from "../../../../chunks/utils.js";
|
|
6
6
|
import { t as Button } from "../../../../chunks/button.js";
|
|
7
7
|
import { o as Check } from "../../../../chunks/popper-layer-force-mount.js";
|
|
8
8
|
import { t as Chevron_right } from "../../../../chunks/chevron-right.js";
|
|
@@ -129,11 +129,17 @@ function UpdateSection($$renderer, $$props) {
|
|
|
129
129
|
compatible: null,
|
|
130
130
|
required: null,
|
|
131
131
|
running: ""
|
|
132
|
+
}, dataCompatibility = {
|
|
133
|
+
compatible: null,
|
|
134
|
+
installed: 1,
|
|
135
|
+
target: null
|
|
132
136
|
}, onRun } = $$props;
|
|
133
137
|
const nodeBlocked = derived(() => nodeCompatibility.compatible === false);
|
|
134
138
|
let overrideArmed = false;
|
|
135
139
|
const overrideSatisfied = derived(() => overrideArmed);
|
|
136
|
-
const
|
|
140
|
+
const dataBlocked = derived(() => dataCompatibility.compatible === false);
|
|
141
|
+
const upToDate = derived(() => !updateAvailable && !!currentVersion && !!latestVersion);
|
|
142
|
+
const runDisabled = derived(() => isRunning || upToDate() || dataBlocked() || nodeBlocked() && !overrideSatisfied());
|
|
137
143
|
const channelLabel = derived(() => channel === "beta" ? "beta" : "stable");
|
|
138
144
|
let showRunConfirm = false;
|
|
139
145
|
let outcome = derived(() => exitCode === null ? null : deriveOutcome(exitCode, logs));
|
|
@@ -172,6 +178,7 @@ function UpdateSection($$renderer, $$props) {
|
|
|
172
178
|
function buttonLabel() {
|
|
173
179
|
if (isRestarting) return "Restarting & verifying…";
|
|
174
180
|
if (isRunning) return "Running…";
|
|
181
|
+
if (upToDate()) return "Up to date";
|
|
175
182
|
return "Run Update";
|
|
176
183
|
}
|
|
177
184
|
function handleRunClick() {
|
|
@@ -241,6 +248,16 @@ function UpdateSection($$renderer, $$props) {
|
|
|
241
248
|
} else if (currentVersion && latestVersion) $$renderer.push(`<!--[1--><p class="text-muted-foreground text-sm">You're on the latest ${escape_html(channelLabel())} release (<span class="font-mono">v${escape_html(currentVersion)}</span>).</p>`);
|
|
242
249
|
else $$renderer.push("<!--[-1-->");
|
|
243
250
|
$$renderer.push(`<!--]--> `);
|
|
251
|
+
if (dataBlocked()) {
|
|
252
|
+
$$renderer.push(`<!--[0--><div class="border-destructive/40 bg-destructive/10 text-destructive flex items-start gap-2 rounded-md border px-3 py-3 text-sm" role="alert">`);
|
|
253
|
+
Triangle_alert($$renderer, { class: "mt-0.5 h-4 w-4 shrink-0" });
|
|
254
|
+
$$renderer.push(`<!----> <div class="space-y-1"><p class="font-medium">Update blocked — <span class="font-mono">v${escape_html(latestVersion)}</span> cannot read this deployment's
|
|
255
|
+
data</p> <p class="text-muted-foreground text-xs">It reads data format ${escape_html(dataCompatibility.target)}; this deployment is on format
|
|
256
|
+
${escape_html(dataCompatibility.installed)}. Installing it would leave stored data, such as Compute
|
|
257
|
+
API keys, unreadable. Switch the release channel back to stay on this version. To go
|
|
258
|
+
back anyway, follow "Going back to an older release" in the admin guide.</p></div></div>`);
|
|
259
|
+
} else $$renderer.push("<!--[-1-->");
|
|
260
|
+
$$renderer.push(`<!--]--> `);
|
|
244
261
|
if (nodeBlocked()) {
|
|
245
262
|
$$renderer.push(`<!--[0--><div class="border-destructive/40 bg-destructive/10 space-y-3 rounded-md border px-3 py-3 text-sm" role="alert"><div class="text-destructive flex items-start gap-2">`);
|
|
246
263
|
Triangle_alert($$renderer, { class: "mt-0.5 h-4 w-4 shrink-0" });
|
|
@@ -1388,7 +1405,7 @@ function _page($$renderer, $$props) {
|
|
|
1388
1405
|
key: "COMPUTE_REQUEST_MAX_BYTES",
|
|
1389
1406
|
label: "Compute request body cap",
|
|
1390
1407
|
value: (l) => formatBytes(l.COMPUTE_REQUEST_MAX_BYTES),
|
|
1391
|
-
note: "Inputs plus base64 file values."
|
|
1408
|
+
note: "Inputs plus base64 file values. The largest RHINO_COMPUTE_MAX_REQUEST_SIZE a reached compute server reports; 256 MB before one is reached."
|
|
1392
1409
|
},
|
|
1393
1410
|
{
|
|
1394
1411
|
key: "COMPUTE_RESPONSE_MAX_BYTES",
|
|
@@ -1499,7 +1516,8 @@ function _page($$renderer, $$props) {
|
|
|
1499
1516
|
try {
|
|
1500
1517
|
const response = await fetch("/api/admin/system/update", { method: "POST" });
|
|
1501
1518
|
if (!response.ok) {
|
|
1502
|
-
|
|
1519
|
+
const body = await response.json().catch(() => null);
|
|
1520
|
+
updateLogs = body?.error ?? body?.message ?? "Failed to start update process";
|
|
1503
1521
|
updateExitCode = response.status;
|
|
1504
1522
|
updateRunning = false;
|
|
1505
1523
|
return;
|
|
@@ -1624,6 +1642,7 @@ function _page($$renderer, $$props) {
|
|
|
1624
1642
|
logs: updateLogs,
|
|
1625
1643
|
exitCode: updateExitCode,
|
|
1626
1644
|
nodeCompatibility: data.update.nodeCompatibility,
|
|
1645
|
+
dataCompatibility: data.update.dataCompatibility,
|
|
1627
1646
|
onRun: runUpdate
|
|
1628
1647
|
});
|
|
1629
1648
|
$$renderer.push(`<!----> <!---->`);
|