@selvajs/selva 4.20.1-beta.4 → 4.21.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/adapter-node.js +1 -1
- package/build/client/_app/immutable/assets/0.CqqJCiiV.css +2 -0
- package/build/client/_app/immutable/assets/0.CqqJCiiV.css.br +0 -0
- package/build/client/_app/immutable/assets/0.CqqJCiiV.css.gz +0 -0
- package/build/client/_app/immutable/chunks/{CzfnuBzq.js → BAhtiTKe.js} +1 -1
- package/build/client/_app/immutable/chunks/BAhtiTKe.js.br +0 -0
- package/build/client/_app/immutable/chunks/BAhtiTKe.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{qi43d-TM.js → CKbHmAlc.js} +1 -1
- package/build/client/_app/immutable/chunks/CKbHmAlc.js.br +0 -0
- package/build/client/_app/immutable/chunks/CKbHmAlc.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{C6Y_BUwr.js → CmlXAF26.js} +1 -1
- package/build/client/_app/immutable/chunks/CmlXAF26.js.br +0 -0
- package/build/client/_app/immutable/chunks/CmlXAF26.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Cv7GBWJh.js +2 -0
- package/build/client/_app/immutable/chunks/Cv7GBWJh.js.br +0 -0
- package/build/client/_app/immutable/chunks/Cv7GBWJh.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{BDYCH-_Q.js → D5j4-ZO1.js} +1 -1
- package/build/client/_app/immutable/chunks/D5j4-ZO1.js.br +0 -0
- package/build/client/_app/immutable/chunks/D5j4-ZO1.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DW5EJMC7.js +1 -0
- package/build/client/_app/immutable/chunks/DW5EJMC7.js.br +0 -0
- package/build/client/_app/immutable/chunks/DW5EJMC7.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{D-uUm_OB.js → DptnDNFA.js} +61 -56
- package/build/client/_app/immutable/chunks/DptnDNFA.js.br +0 -0
- package/build/client/_app/immutable/chunks/{D-uUm_OB.js.gz → DptnDNFA.js.gz} +0 -0
- package/build/client/_app/immutable/chunks/DvJo0Zn0.js +1 -0
- package/build/client/_app/immutable/chunks/DvJo0Zn0.js.br +1 -0
- package/build/client/_app/immutable/chunks/DvJo0Zn0.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{DzxE3j6C.js → qXnHMKD9.js} +1 -1
- package/build/client/_app/immutable/chunks/qXnHMKD9.js.br +0 -0
- package/build/client/_app/immutable/chunks/qXnHMKD9.js.gz +0 -0
- package/build/client/_app/immutable/entry/{app.BpT6WkO1.js → app.DPbjEDd3.js} +2 -2
- package/build/client/_app/immutable/entry/app.DPbjEDd3.js.br +0 -0
- package/build/client/_app/immutable/entry/app.DPbjEDd3.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{1.D3kiiIk_.js → 1.DWd6YbcT.js} +1 -1
- package/build/client/_app/immutable/nodes/1.DWd6YbcT.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.DWd6YbcT.js.gz +0 -0
- package/build/client/_app/immutable/nodes/15._hpTnSzc.js +36 -0
- package/build/client/_app/immutable/nodes/15._hpTnSzc.js.br +0 -0
- package/build/client/_app/immutable/nodes/15._hpTnSzc.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{2.CUNbzjI_.js → 2.CS32Eh9m.js} +1 -1
- package/build/client/_app/immutable/nodes/2.CS32Eh9m.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.CS32Eh9m.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{20.9OIre0ah.js → 20.CVaxGEhZ.js} +1 -1
- package/build/client/_app/immutable/nodes/20.CVaxGEhZ.js.br +0 -0
- package/build/client/_app/immutable/nodes/20.CVaxGEhZ.js.gz +0 -0
- package/build/client/_app/immutable/nodes/21.DpKe0-GH.js +1 -0
- package/build/client/_app/immutable/nodes/21.DpKe0-GH.js.br +0 -0
- package/build/client/_app/immutable/nodes/21.DpKe0-GH.js.gz +0 -0
- package/build/client/_app/immutable/nodes/24.DkL5kHzA.js +3 -0
- package/build/client/_app/immutable/nodes/24.DkL5kHzA.js.br +0 -0
- package/build/client/_app/immutable/nodes/24.DkL5kHzA.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{25.DW1_vMxq.js → 25.DiYmTwXC.js} +2 -2
- package/build/client/_app/immutable/nodes/25.DiYmTwXC.js.br +0 -0
- package/build/client/_app/immutable/nodes/25.DiYmTwXC.js.gz +0 -0
- package/build/client/_app/immutable/nodes/26.7nAJpm5P.js +5 -0
- package/build/client/_app/immutable/nodes/26.7nAJpm5P.js.br +0 -0
- package/build/client/_app/immutable/nodes/26.7nAJpm5P.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{3.3Z4QUsQQ.js → 3.Ctd9OGCk.js} +1 -1
- package/build/client/_app/immutable/nodes/3.Ctd9OGCk.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.Ctd9OGCk.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{5.DmA9lTA-.js → 5.Wh_w3RkZ.js} +1 -1
- package/build/client/_app/immutable/nodes/5.Wh_w3RkZ.js.br +2 -0
- package/build/client/_app/immutable/nodes/5.Wh_w3RkZ.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{6.D6WLqCgl.js → 6.C-DiUI5R.js} +1 -1
- package/build/client/_app/immutable/nodes/6.C-DiUI5R.js.br +0 -0
- package/build/client/_app/immutable/nodes/6.C-DiUI5R.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{7.CNuRjkv2.js → 7.B8yubYrv.js} +1 -1
- package/build/client/_app/immutable/nodes/7.B8yubYrv.js.br +0 -0
- package/build/client/_app/immutable/nodes/7.B8yubYrv.js.gz +0 -0
- package/build/client/_app/version.json +1 -1
- package/build/client/_app/version.json.br +0 -0
- package/build/client/_app/version.json.gz +0 -0
- package/build/runtime-meta.json +1 -1
- package/build/server/.vite/manifest.json +35 -45
- package/build/server/_app/immutable/assets/_layout.CqqJCiiV.css +2 -0
- package/build/server/chunks/DefinitionCard.js +3 -0
- package/build/server/chunks/DefinitionCard.js.map +1 -1
- package/build/server/chunks/access.js +15 -3
- package/build/server/chunks/access.js.map +1 -1
- package/build/server/chunks/api-errors.js +18 -3
- package/build/server/chunks/api-errors.js.map +1 -1
- package/build/server/chunks/api.js +9 -2
- package/build/server/chunks/api.js.map +1 -1
- package/build/server/chunks/auth-bootstrap.server.js +63 -39
- package/build/server/chunks/auth-bootstrap.server.js.map +1 -1
- package/build/server/chunks/boot.server.js +1 -1
- package/build/server/chunks/bootHealth.server.js +23 -23
- package/build/server/chunks/bootHealth.server.js.map +1 -1
- package/build/server/chunks/computeRateLimit.server.js +2 -2
- package/build/server/chunks/delete-with-blobs.js +1 -1
- package/build/server/chunks/engine.server.js +52 -5
- package/build/server/chunks/engine.server.js.map +1 -1
- package/build/server/chunks/grasshopper.js +217 -162
- package/build/server/chunks/grasshopper.js.map +1 -1
- package/build/server/chunks/handlers.js +70 -60
- package/build/server/chunks/handlers.js.map +1 -1
- package/build/server/chunks/http.js +24 -24
- package/build/server/chunks/http.js.map +1 -1
- package/build/server/chunks/http2.js +1 -1
- package/build/server/chunks/instance.js +3 -3
- package/build/server/chunks/instanceAdmins.server.js +31 -16
- package/build/server/chunks/instanceAdmins.server.js.map +1 -1
- package/build/server/chunks/internal.js +1 -1
- package/build/server/chunks/{abort-Bfrdupaj.js → keepalive-vtcjhAV3.js} +6 -3
- package/build/server/chunks/keepalive-vtcjhAV3.js.map +1 -0
- package/build/server/chunks/liveSolve.server.js +1 -1
- package/build/server/chunks/localeContext.svelte.js +14 -0
- package/build/server/chunks/localeContext.svelte.js.map +1 -1
- package/build/server/chunks/oauth.js +70 -24
- package/build/server/chunks/oauth.js.map +1 -1
- package/build/server/chunks/{outcome-DNrffAXp.js → outcome-D28FgvFK.js} +9 -6
- package/build/server/chunks/outcome-D28FgvFK.js.map +1 -0
- package/build/server/chunks/package.js +2 -1
- package/build/server/chunks/package.js.map +1 -1
- package/build/server/chunks/permissions.server.js +1 -1
- package/build/server/chunks/presets.server.js +1 -1
- package/build/server/chunks/providers.server.js +324 -121
- package/build/server/chunks/providers.server.js.map +1 -1
- package/build/server/chunks/registry.js +1 -1
- package/build/server/chunks/resolve-server.js +1 -1
- package/build/server/chunks/schema-extraction.js +75 -8
- package/build/server/chunks/schema-extraction.js.map +1 -1
- package/build/server/chunks/schema.js +1 -1
- package/build/server/chunks/schema.js.map +1 -1
- package/build/server/chunks/server-config-write.js +6 -6
- package/build/server/chunks/server-config-write.js.map +1 -1
- package/build/server/chunks/server2.js +2 -2
- package/build/server/chunks/server2.js.map +1 -1
- package/build/server/chunks/serverStats.server.js +1 -1
- package/build/server/chunks/signInMaxAge.server.js +1 -1
- package/build/server/chunks/solve.server.js +34 -8
- package/build/server/chunks/solve.server.js.map +1 -1
- package/build/server/chunks/sveltekit.js +4 -5
- package/build/server/chunks/sveltekit.js.map +1 -1
- package/build/server/chunks/update-outcome.js +11 -0
- package/build/server/chunks/update-outcome.js.map +1 -1
- package/build/server/chunks/updateCheck.server.js +24 -12
- package/build/server/chunks/updateCheck.server.js.map +1 -1
- package/build/server/entries/endpoints/.well-known/oauth-authorization-server/_server.ts.js +6 -3
- package/build/server/entries/endpoints/.well-known/oauth-authorization-server/_server.ts.js.map +1 -1
- package/build/server/entries/endpoints/.well-known/oauth-protected-resource/_server.ts.js +6 -3
- package/build/server/entries/endpoints/.well-known/oauth-protected-resource/_server.ts.js.map +1 -1
- package/build/server/entries/endpoints/.well-known/oauth-protected-resource/mcp/_server.ts.js +6 -3
- package/build/server/entries/endpoints/.well-known/oauth-protected-resource/mcp/_server.ts.js.map +1 -1
- package/build/server/entries/endpoints/api/admin/compute/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/admin/compute/actions/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/admin/compute/status/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/admin/orgs/_id_/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/admin/orgs/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/admin/projects/_id_/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/admin/projects/_id_/grants/_grantId_/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/admin/projects/_id_/grants/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/admin/projects/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/admin/system/health/_server.ts.js +9 -2
- package/build/server/entries/endpoints/api/admin/system/health/_server.ts.js.map +1 -1
- package/build/server/entries/endpoints/api/admin/system/update/_server.ts.js +59 -15
- package/build/server/entries/endpoints/api/admin/system/update/_server.ts.js.map +1 -1
- package/build/server/entries/endpoints/api/admin/users/_id_/_server.ts.js +42 -16
- package/build/server/entries/endpoints/api/admin/users/_id_/_server.ts.js.map +1 -1
- package/build/server/entries/endpoints/api/admin/users/_id_/disable/_server.ts.js +24 -13
- package/build/server/entries/endpoints/api/admin/users/_id_/disable/_server.ts.js.map +1 -1
- package/build/server/entries/endpoints/api/admin/users/_server.ts.js +2 -2
- package/build/server/entries/endpoints/api/files/_...path_/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/compute/_server.ts.js +15 -6
- package/build/server/entries/endpoints/api/v1/compute/_server.ts.js.map +1 -1
- package/build/server/entries/endpoints/api/v1/compute/schema/_server.ts.js +3 -3
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/image/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/publish/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/schema/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/share-links/_linkId_/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/share-links/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/solve/_server.ts.js +5 -4
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/solve/_server.ts.js.map +1 -1
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/versions/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/versions/_versionId_/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/versions/_versionId_/schema/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/me/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/me/starred/_guid_/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/me/token/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/orgs/_orgId_/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/orgs/_orgId_/members/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/orgs/_orgId_/tokens/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/orgs/_orgId_/tokens/_tokenId_/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/projects/_id_/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/projects/_id_/members/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/projects/_id_/members/_userId_/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/projects/_id_/reclaim/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/solve/_solveId_/cancel/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/solve-events/_server.ts.js +1 -1
- package/build/server/entries/endpoints/auth/email/callback/_server.ts.js +2 -2
- package/build/server/entries/endpoints/auth/email/callback/_server.ts.js.map +1 -1
- package/build/server/entries/endpoints/auth/supabase/callback/_server.ts.js +2 -2
- package/build/server/entries/endpoints/auth/supabase/callback/_server.ts.js.map +1 -1
- package/build/server/entries/endpoints/docs/api/openapi.yaml/_server.ts.js +1 -1
- package/build/server/entries/endpoints/mcp/_server.ts.js +43 -13
- package/build/server/entries/endpoints/mcp/_server.ts.js.map +1 -1
- package/build/server/entries/endpoints/oauth/register/_server.ts.js +1 -1
- package/build/server/entries/endpoints/oauth/token/_server.ts.js +1 -1
- package/build/server/entries/hooks.server.js +25 -6
- package/build/server/entries/hooks.server.js.map +1 -1
- package/build/server/entries/pages/admin/compute/_page.server.ts.js +1 -2
- package/build/server/entries/pages/admin/compute/_page.server.ts.js.map +1 -1
- package/build/server/entries/pages/admin/system/_page.server.ts.js +8 -3
- package/build/server/entries/pages/admin/system/_page.server.ts.js.map +1 -1
- package/build/server/entries/pages/admin/system/_page.svelte.js +18 -2
- package/build/server/entries/pages/admin/system/_page.svelte.js.map +1 -1
- package/build/server/entries/pages/library/_guid_/_page.server.ts.js +198 -99
- package/build/server/entries/pages/library/_guid_/_page.server.ts.js.map +1 -1
- package/build/server/entries/pages/library/_guid_/_page.svelte.js +693 -40
- package/build/server/entries/pages/library/_guid_/_page.svelte.js.map +1 -1
- package/build/server/entries/pages/oauth/authorize/_page.server.ts.js +3 -2
- package/build/server/entries/pages/oauth/authorize/_page.server.ts.js.map +1 -1
- package/build/server/entries/pages/oauth/authorize/_page.svelte.js +8 -1
- package/build/server/entries/pages/oauth/authorize/_page.svelte.js.map +1 -1
- package/build/server/entries/pages/projects/_page.svelte.js +2 -0
- package/build/server/entries/pages/projects/_page.svelte.js.map +1 -1
- package/build/server/entries/pages/setup/_page.server.ts.js +62 -8
- package/build/server/entries/pages/setup/_page.server.ts.js.map +1 -1
- package/build/server/entries/pages/setup/_page.svelte.js +52 -33
- package/build/server/entries/pages/setup/_page.svelte.js.map +1 -1
- package/build/server/entries/pages/team/tokens/_page.server.ts.js +1 -1
- package/build/server/manifest-full.js +1 -1
- package/build/server/manifest.js +1 -1
- package/build/server/nodes/0.js +2 -2
- package/build/server/nodes/1.js +1 -1
- package/build/server/nodes/15.js +1 -1
- package/build/server/nodes/2.js +1 -1
- package/build/server/nodes/20.js +1 -1
- package/build/server/nodes/21.js +1 -1
- package/build/server/nodes/24.js +1 -1
- package/build/server/nodes/25.js +1 -1
- package/build/server/nodes/26.js +1 -1
- package/build/server/nodes/3.js +1 -1
- package/build/server/nodes/5.js +1 -1
- package/build/server/nodes/6.js +1 -1
- package/build/server/nodes/7.js +1 -1
- package/build/server/server.js +1 -1
- package/package.json +16 -13
- package/templates/.env.example +15 -7
- package/build/client/_app/immutable/assets/0.2jDm0bqh.css +0 -2
- package/build/client/_app/immutable/assets/0.2jDm0bqh.css.br +0 -0
- package/build/client/_app/immutable/assets/0.2jDm0bqh.css.gz +0 -0
- package/build/client/_app/immutable/chunks/BDYCH-_Q.js.br +0 -0
- package/build/client/_app/immutable/chunks/BDYCH-_Q.js.gz +0 -0
- package/build/client/_app/immutable/chunks/C6Y_BUwr.js.br +0 -0
- package/build/client/_app/immutable/chunks/C6Y_BUwr.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CzfnuBzq.js.br +0 -0
- package/build/client/_app/immutable/chunks/CzfnuBzq.js.gz +0 -0
- package/build/client/_app/immutable/chunks/D-uUm_OB.js.br +0 -0
- package/build/client/_app/immutable/chunks/D84F7w9g.js +0 -1
- package/build/client/_app/immutable/chunks/D84F7w9g.js.br +0 -1
- package/build/client/_app/immutable/chunks/D84F7w9g.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DQsP4nZb.js +0 -1
- package/build/client/_app/immutable/chunks/DQsP4nZb.js.br +0 -0
- package/build/client/_app/immutable/chunks/DQsP4nZb.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DzeQucGI.js +0 -2
- package/build/client/_app/immutable/chunks/DzeQucGI.js.br +0 -0
- package/build/client/_app/immutable/chunks/DzeQucGI.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DzxE3j6C.js.br +0 -0
- package/build/client/_app/immutable/chunks/DzxE3j6C.js.gz +0 -0
- package/build/client/_app/immutable/chunks/qi43d-TM.js.br +0 -0
- package/build/client/_app/immutable/chunks/qi43d-TM.js.gz +0 -0
- package/build/client/_app/immutable/entry/app.BpT6WkO1.js.br +0 -0
- package/build/client/_app/immutable/entry/app.BpT6WkO1.js.gz +0 -0
- package/build/client/_app/immutable/nodes/1.D3kiiIk_.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.D3kiiIk_.js.gz +0 -0
- package/build/client/_app/immutable/nodes/15.BXIV1QfS.js +0 -32
- package/build/client/_app/immutable/nodes/15.BXIV1QfS.js.br +0 -0
- package/build/client/_app/immutable/nodes/15.BXIV1QfS.js.gz +0 -0
- package/build/client/_app/immutable/nodes/2.CUNbzjI_.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.CUNbzjI_.js.gz +0 -0
- package/build/client/_app/immutable/nodes/20.9OIre0ah.js.br +0 -0
- package/build/client/_app/immutable/nodes/20.9OIre0ah.js.gz +0 -0
- package/build/client/_app/immutable/nodes/21.BkNlRItr.js +0 -1
- package/build/client/_app/immutable/nodes/21.BkNlRItr.js.br +0 -0
- package/build/client/_app/immutable/nodes/21.BkNlRItr.js.gz +0 -0
- package/build/client/_app/immutable/nodes/24.CPSunfJJ.js +0 -3
- package/build/client/_app/immutable/nodes/24.CPSunfJJ.js.br +0 -0
- package/build/client/_app/immutable/nodes/24.CPSunfJJ.js.gz +0 -0
- package/build/client/_app/immutable/nodes/25.DW1_vMxq.js.br +0 -0
- package/build/client/_app/immutable/nodes/25.DW1_vMxq.js.gz +0 -0
- package/build/client/_app/immutable/nodes/26.CqaMEm_t.js +0 -6
- package/build/client/_app/immutable/nodes/26.CqaMEm_t.js.br +0 -0
- package/build/client/_app/immutable/nodes/26.CqaMEm_t.js.gz +0 -0
- package/build/client/_app/immutable/nodes/3.3Z4QUsQQ.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.3Z4QUsQQ.js.gz +0 -0
- package/build/client/_app/immutable/nodes/5.DmA9lTA-.js.br +0 -1
- package/build/client/_app/immutable/nodes/5.DmA9lTA-.js.gz +0 -0
- package/build/client/_app/immutable/nodes/6.D6WLqCgl.js.br +0 -0
- package/build/client/_app/immutable/nodes/6.D6WLqCgl.js.gz +0 -0
- package/build/client/_app/immutable/nodes/7.CNuRjkv2.js.br +0 -0
- package/build/client/_app/immutable/nodes/7.CNuRjkv2.js.gz +0 -0
- package/build/server/_app/immutable/assets/_layout.2jDm0bqh.css +0 -2
- package/build/server/chunks/abort-Bfrdupaj.js.map +0 -1
- package/build/server/chunks/computeLimits.js +0 -33
- package/build/server/chunks/computeLimits.js.map +0 -1
- package/build/server/chunks/outcome-DNrffAXp.js.map +0 -1
- /package/build/client/_app/immutable/nodes/{0.CYdyv5To.js → 0.Ds0zeDAg.js} +0 -0
- /package/build/client/_app/immutable/nodes/{0.CYdyv5To.js.br → 0.Ds0zeDAg.js.br} +0 -0
- /package/build/client/_app/immutable/nodes/{0.CYdyv5To.js.gz → 0.Ds0zeDAg.js.gz} +0 -0
|
@@ -216,6 +216,9 @@ function DefinitionCard($$renderer, $$props) {
|
|
|
216
216
|
let tag = each_array[$$index];
|
|
217
217
|
$$renderer.push(`<span class="bg-muted text-muted-foreground rounded-full px-2 py-0.5 text-xs">${escape_html(tag)}</span>`);
|
|
218
218
|
}
|
|
219
|
+
$$renderer.push(`<!--]--> `);
|
|
220
|
+
if (record.tags.length > 3) $$renderer.push(`<!--[0--><span class="bg-muted text-muted-foreground rounded-full px-2 py-0.5 text-xs"${attr("title", record.tags.slice(3).join(", "))}>+${escape_html(record.tags.length - 3)}</span>`);
|
|
221
|
+
else $$renderer.push("<!--[-1-->");
|
|
219
222
|
$$renderer.push(`<!--]--></div>`);
|
|
220
223
|
} else $$renderer.push("<!--[-1-->");
|
|
221
224
|
$$renderer.push(`<!--]--> <div class="mt-auto">`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefinitionCard.js","names":["__iconData","__iconNode","$.spread_props","$.spread_props","ToggleGroup.Root","ToggleGroup.Item","$.derived","$.attr","$.attr_style","$.escape","$.attr_class","$.stringify","$.ensure_array_like"],"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/grid-2x2.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/list.svelte","../../../../ui/src/lib/components/primitives/ViewToggle.svelte","../../../src/lib/components/definitions/cardStyles.ts","../../../src/lib/format/relativeTime.ts","../../../src/routes/projects/_components/statusStyles.ts","../../../src/lib/components/definitions/DefinitionCard.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\": \"grid-2x2\", \"size\": 24, \"node\": [[\"path\", { \"d\": \"M12 3v18\" }], [\"path\", { \"d\": \"M3 12h18\" }], [\"rect\", { \"x\": \"3\", \"y\": \"3\", \"width\": \"18\", \"height\": \"18\", \"rx\": \"2\" }]], \"aliases\": [\"grid-2-x-2\"] };\n/**\n * @deprecated Access `__iconData` instead.\n */\nexport const __iconNode = __iconData.node;\n</script>\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/grid-2x2\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\": \"list\", \"size\": 24, \"node\": [[\"path\", { \"d\": \"M3 5h.01\" }], [\"path\", { \"d\": \"M3 12h.01\" }], [\"path\", { \"d\": \"M3 19h.01\" }], [\"path\", { \"d\": \"M8 5h13\" }], [\"path\", { \"d\": \"M8 12h13\" }], [\"path\", { \"d\": \"M8 19h13\" }]] };\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/list\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={__iconData} />\n","<script lang=\"ts\">\n\timport { Grid2x2, List } from '@lucide/svelte';\n\timport * as ToggleGroup from './toggle-group';\n\n\ttype ViewMode = 'grid' | 'list';\n\n\tinterface Props {\n\t\tmode: ViewMode;\n\t\tonChange: (mode: ViewMode) => void;\n\t\tsize?: 'sm' | 'md';\n\t}\n\n\tlet { mode, onChange, size = 'md' }: Props = $props();\n</script>\n\n<ToggleGroup.Root\n\ttype=\"single\"\n\tvariant=\"outline\"\n\tsize={size === 'sm' ? 'sm' : 'default'}\n\tvalue={mode}\n\tonValueChange={(next) => {\n\t\t// A single-select group emits '' when the active item is clicked again; keep the mode.\n\t\tif (next === 'grid' || next === 'list') onChange(next);\n\t}}\n>\n\t<ToggleGroup.Item value=\"grid\" aria-label=\"Grid view\" title=\"Grid view\">\n\t\t<Grid2x2 />\n\t</ToggleGroup.Item>\n\t<ToggleGroup.Item value=\"list\" aria-label=\"List view\" title=\"List view\">\n\t\t<List />\n\t</ToggleGroup.Item>\n</ToggleGroup.Root>\n","/**\n * Visual helpers shared by the consumer (library) and author (projects)\n * definition card. Pure — no DOM, no randomness.\n */\n\nfunction hash(str: string): number {\n\tlet h = 0;\n\tfor (let i = 0; i < str.length; i++) h = (h * 31 + str.charCodeAt(i)) | 0;\n\treturn Math.abs(h);\n}\n\n/**\n * Two stable hues derived from the key. The actual gradient is composed in\n * CSS (`.tool-cover-fallback`) so light/dark modes can pick different\n * saturation + lightness without touching this module.\n */\nexport function huesFor(key: string): { h1: number; h2: number } {\n\tconst h = hash(key);\n\treturn { h1: h % 360, h2: (h >> 3) % 360 };\n}\n\n/** First letter of the name, uppercased. Falls back to '?' for empty names. */\nexport function monogram(name: string | undefined): string {\n\tconst trimmed = name?.trim() ?? '';\n\treturn trimmed ? trimmed[0].toUpperCase() : '?';\n}\n\n/** Compact \"2h\", \"3d\", \"1w\" relative timestamp for card footers. */\nexport function formatUpdated(iso: string): string {\n\tconst diff = Date.now() - new Date(iso).getTime();\n\tconst mins = Math.floor(diff / 60000);\n\tif (mins < 60) return `${mins}m`;\n\tconst h = Math.floor(mins / 60);\n\tif (h < 24) return `${h}h`;\n\tconst d = Math.floor(h / 24);\n\tif (d < 7) return `${d}d`;\n\treturn `${Math.floor(d / 7)}w`;\n}\n","/** Relative timestamp — \"2m ago\", \"3h ago\", \"5d ago\" — for recent-activity rows. */\nexport function formatRelative(iso: string): string {\n\tconst diff = Date.now() - new Date(iso).getTime();\n\tconst m = Math.floor(diff / 60_000);\n\tif (m < 1) return 'just now';\n\tif (m < 60) return `${m}m ago`;\n\tconst h = Math.floor(m / 60);\n\tif (h < 24) return `${h}h ago`;\n\tconst d = Math.floor(h / 24);\n\treturn `${d}d ago`;\n}\n","export const STATUS_RING: Record<string, string> = {\n\tdraft: 'bg-muted text-muted-foreground border-border',\n\treview:\n\t\t'bg-yellow-50 text-yellow-700 border-yellow-200 dark:bg-yellow-950/30 dark:text-yellow-400 dark:border-yellow-800',\n\tpublished:\n\t\t'bg-green-50 text-green-700 border-green-200 dark:bg-green-950/30 dark:text-green-400 dark:border-green-800',\n\tarchived: 'bg-muted text-muted-foreground border-border opacity-60',\n\tpending: 'bg-muted text-muted-foreground border-border'\n};\n\nexport const STATUS_DOT: Record<string, string> = {\n\tdraft: 'bg-muted-foreground',\n\treview: 'bg-yellow-500',\n\tpublished: 'bg-green-500',\n\tarchived: 'bg-muted-foreground',\n\tpending: 'bg-muted-foreground'\n};\n\nexport const statusRing = (s: string) => STATUS_RING[s] ?? STATUS_RING.draft;\nexport const statusDot = (s: string) => STATUS_DOT[s] ?? STATUS_DOT.draft;\n\nconst PROJECT_COLORS = ['#4f7c4f', '#4f6a7c', '#7c4f4f', '#7c6a4f', '#6a4f7c', '#4f7c6a'];\n\nexport function projectColor(id: string) {\n\tlet h = 0;\n\tfor (let i = 0; i < id.length; i++) h = (h * 31 + id.charCodeAt(i)) & 0xffffffff;\n\treturn PROJECT_COLORS[Math.abs(h) % PROJECT_COLORS.length];\n}\n\nexport function formatUpdated(iso: string) {\n\tconst diff = Date.now() - new Date(iso).getTime();\n\tconst mins = Math.floor(diff / 60000);\n\tif (mins < 60) return `${mins}m`;\n\tconst h = Math.floor(mins / 60);\n\tif (h < 24) return `${h}h`;\n\tconst d = Math.floor(h / 24);\n\tif (d < 7) return `${d}d`;\n\treturn `${Math.floor(d / 7)}w`;\n}\n","<script lang=\"ts\">\n\timport { ArrowRight, Server, Star } from '@lucide/svelte';\n\timport type { DefinitionRecord, ProjectVisibility } from '@selvajs/platform';\n\timport { huesFor, monogram } from './cardStyles';\n\timport { formatRelative } from '#lib/format/relativeTime.js';\n\timport { statusRing, statusDot } from '../../../routes/projects/_components/statusStyles';\n\n\tinterface Props {\n\t\trecord: DefinitionRecord;\n\t\t/** Click handler — caller decides what \"open\" means (run / drawer / etc.). */\n\t\tonOpen: (record: DefinitionRecord) => void;\n\t\t/** Optional project chip; pass when the surrounding view shows multiple projects. */\n\t\tprojectName?: string;\n\t\t/** Visibility of the parent project. Shown as muted text alongside projectName. */\n\t\tprojectVisibility?: ProjectVisibility;\n\n\t\t// ---- Author surface (projects) ----\n\t\t/** When true, renders the status badge top-left and \"updated X ago\" in the footer. */\n\t\tshowStatus?: boolean;\n\t\t/** Compute server this definition solves on. Shown in the footer when provided. */\n\t\tserverName?: string;\n\n\t\t// ---- Consumer surface (library) ----\n\t\t/** Spinner overlay while the runner navigates. */\n\t\tloading?: boolean;\n\t\t/** When provided, renders the star button top-right and reflects star state. */\n\t\tstarred?: boolean;\n\t\tstarBusy?: boolean;\n\t\tonToggleStar?: (guid: string) => void;\n\t}\n\n\tlet {\n\t\trecord,\n\t\tonOpen,\n\t\tprojectName,\n\t\tprojectVisibility,\n\t\tshowStatus = false,\n\t\tserverName,\n\t\tloading = false,\n\t\tstarred = false,\n\t\tstarBusy = false,\n\t\tonToggleStar\n\t}: Props = $props();\n\n\tconst hues = $derived(huesFor(record.guid));\n\t// Same project, same colour, so look-alike tools from different projects tell apart at a glance.\n\tconst projectHue = $derived(projectName ? huesFor(projectName).h1 : 0);\n\n\tfunction activate() {\n\t\tif (loading) return;\n\t\tonOpen(record);\n\t}\n\tfunction handleKey(e: KeyboardEvent) {\n\t\tif (e.key === 'Enter' || e.key === ' ') {\n\t\t\te.preventDefault();\n\t\t\tactivate();\n\t\t}\n\t}\n</script>\n\n<div\n\trole=\"button\"\n\ttabindex={loading ? -1 : 0}\n\taria-disabled={loading}\n\tonclick={activate}\n\tonkeydown={handleKey}\n\tclass=\"group border-border bg-card focus-visible:ring-ring flex cursor-pointer flex-col overflow-hidden rounded-xl border text-left shadow-[0_1px_0_rgba(0,0,0,0.03)] transition duration-200 hover:-translate-y-0.5 hover:shadow-[0_10px_30px_-16px_rgba(0,0,0,0.18)] focus:outline-none focus-visible:ring-2 aria-disabled:cursor-not-allowed aria-disabled:opacity-60\"\n>\n\t<div class=\"border-border relative aspect-16/10 overflow-hidden border-b\">\n\t\t{#if record.coverImage}\n\t\t\t<img\n\t\t\t\tsrc={record.coverImage}\n\t\t\t\talt={record.displayName}\n\t\t\t\tclass=\"absolute inset-0 h-full w-full object-cover\"\n\t\t\t/>\n\t\t{:else}\n\t\t\t<div\n\t\t\t\tclass=\"tool-cover-fallback absolute inset-0 flex items-center justify-center\"\n\t\t\t\tstyle:--tool-h1={hues.h1}\n\t\t\t\tstyle:--tool-h2={hues.h2}\n\t\t\t>\n\t\t\t\t<span\n\t\t\t\t\tclass=\"bg-card/70 text-foreground flex size-16 items-center justify-center rounded-xl text-3xl font-semibold shadow-sm backdrop-blur-sm\"\n\t\t\t\t>\n\t\t\t\t\t{monogram(record.displayName)}\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t{/if}\n\n\t\t{#if showStatus}\n\t\t\t<div class=\"absolute top-2.5 left-2.5\">\n\t\t\t\t<span\n\t\t\t\t\tclass=\"inline-flex items-center gap-1.5 rounded-full border px-2 py-0.5 font-mono text-[11px] tracking-wide {statusRing(\n\t\t\t\t\t\trecord.status\n\t\t\t\t\t)}\"\n\t\t\t\t>\n\t\t\t\t\t<span class=\"h-1.5 w-1.5 rounded-full {statusDot(record.status)}\"></span>\n\t\t\t\t\t{record.status}\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t{/if}\n\n\t\t{#if onToggleStar}\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\ttitle={starred ? 'Unstar' : 'Star'}\n\t\t\t\taria-label={starred ? 'Unstar definition' : 'Star definition'}\n\t\t\t\taria-pressed={starred}\n\t\t\t\tdisabled={starBusy}\n\t\t\t\tonclick={(e) => {\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tonToggleStar?.(record.guid);\n\t\t\t\t}}\n\t\t\t\tclass={`absolute top-2 right-2 flex h-7 w-7 items-center justify-center rounded-full backdrop-blur-sm transition-all disabled:opacity-60 ${\n\t\t\t\t\tstarred\n\t\t\t\t\t\t? 'bg-amber-400/90 text-white'\n\t\t\t\t\t\t: 'bg-black/40 text-white opacity-0 group-hover:opacity-100 hover:bg-black/55 pointer-coarse:opacity-100'\n\t\t\t\t}`}\n\t\t\t>\n\t\t\t\t<Star class=\"h-3.5 w-3.5 {starred ? 'fill-current' : ''}\" />\n\t\t\t</button>\n\t\t{/if}\n\n\t\t{#if loading}\n\t\t\t<div class=\"absolute inset-0 flex items-center justify-center bg-black/25\">\n\t\t\t\t<div\n\t\t\t\t\tclass=\"h-5 w-5 animate-spin rounded-full border-2 border-white border-t-transparent\"\n\t\t\t\t></div>\n\t\t\t</div>\n\t\t{/if}\n\t</div>\n\n\t<div class=\"flex flex-1 flex-col p-3.5\">\n\t\t{#if projectName}\n\t\t\t<p class=\"mb-1.5 flex items-center gap-1.5 text-xs\">\n\t\t\t\t<span\n\t\t\t\t\tclass=\"project-chip max-w-full truncate rounded-full px-2 py-0.5 font-medium\"\n\t\t\t\t\tstyle:--project-h={projectHue}\n\t\t\t\t>\n\t\t\t\t\t{projectName}\n\t\t\t\t</span>\n\t\t\t\t{#if projectVisibility}\n\t\t\t\t\t<span class=\"text-muted-foreground shrink-0\">{projectVisibility}</span>\n\t\t\t\t{/if}\n\t\t\t</p>\n\t\t{/if}\n\t\t<p class=\"truncate text-[14px] font-semibold\">{record.displayName}</p>\n\t\t{#if record.description}\n\t\t\t<p class=\"text-muted-foreground mt-1 line-clamp-2 text-[13px] leading-relaxed\">\n\t\t\t\t{record.description}\n\t\t\t</p>\n\t\t{/if}\n\n\t\t{#if record.tags?.length}\n\t\t\t<div class=\"mt-2.5 flex flex-wrap gap-1\">\n\t\t\t\t{#each record.tags.slice(0, 3) as tag (tag)}\n\t\t\t\t\t<span class=\"bg-muted text-muted-foreground rounded-full px-2 py-0.5 text-xs\">{tag}</span>\n\t\t\t\t{/each}\n\t\t\t</div>\n\t\t{/if}\n\n\t\t<div class=\"mt-auto\">\n\t\t\t{#if showStatus && serverName}\n\t\t\t\t<div\n\t\t\t\t\tclass=\"text-muted-foreground mt-2.5 flex items-center gap-1.5 font-mono text-[11px]\"\n\t\t\t\t\ttitle=\"Solves on {serverName}\"\n\t\t\t\t>\n\t\t\t\t\t<Server class=\"h-3 w-3 shrink-0 opacity-70\" />\n\t\t\t\t\t<span class=\"truncate\">{serverName}</span>\n\t\t\t\t</div>\n\t\t\t{/if}\n\t\t\t<hr class=\"border-border my-3\" />\n\t\t\t<div class=\"text-muted-foreground flex items-center justify-between text-xs\">\n\t\t\t\t<span>\n\t\t\t\t\tUpdated {formatRelative(record.updatedAt)}\n\t\t\t\t\t· {record.solveCount > 0 ? `${record.solveCount.toLocaleString()} runs` : 'No runs yet'}\n\t\t\t\t</span>\n\t\t\t\t{#if onToggleStar}\n\t\t\t\t\t<span\n\t\t\t\t\t\tclass=\"text-foreground flex items-center gap-1 font-medium opacity-60 transition-opacity group-hover:opacity-100\"\n\t\t\t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BAAsB,iBAAiB,IAAAA,KAAA,gBAC/C,OAAO,IAAAA,KAAA,YACX,UAAQ,IAAA,IAAAG,WAAA,oIAOjB,UACG,+BACA,yGAAsG,EAAA,EAAA;GAGhF,KAAA,YAAA,EAAA,OAAA,eAAA,UAAU,iBAAiB,KAAE,CAAA;;;;EAIpD,IAAA,S;;;EAUA,IAAA,aAAW;GAIM,WAAA,KAAA,mJAAAF,WAAA,IAAA,EAAA,eAAA,WAAU,EAAA,CAAA,EAAA,GAAAC,YAE5B,WAAW,EAAA,SAAA;GAER,IAAA,mBAC0C,WAAA,KAAA,yDAAAA,YAAA,iBAAiB,EAAA,QAAA;;;;EAInB,WAAA,KAAA,0DAAAA,YAAA,OAAO,WAAW,EAAA,MAAA;EAC5D,IAAA,OAAO,aAET,WAAA,KAAA,2FAAAA,YAAA,OAAO,WAAW,EAAA,KAAA;;;EAIhB,IAAA,OAAO,MAAM,QAAM;;GAEf,MAAA,aAAAG,kBAAA,OAAO,KAAK,MAAM,GAAG,CAAC,CAAA;;IAAK,IAAA,MAAG,WAAA;IAC2C,WAAA,KAAA,iFAAAH,YAAA,GAAG,EAAA,QAAA;;;;;EAM/E,IAAA,cAAc,YAAU;GAGT,WAAA,KAAA,qGAAAF,KAAA,SAAA,aAAAI,UAAA,UAAU,GAAA,EAAA,EAAA;;GAGJ,WAAA,KAAA,kCAAAF,YAAA,UAAU,EAAA,cAAA;;EAMzB,WAAA,KAAA,wIAAAA,YAAA,eAAe,OAAO,SAAS,CAAA,EAAA;SACrCA,YAAA,OAAO,aAAa,IAAO,GAAA,OAAO,WAAW,eAAc,EAAA,SAAY,aAAa,EAAA,SAAA;EAEnF,IAAA,cAAY;;;;;;CAxHb,CAAA"}
|
|
1
|
+
{"version":3,"file":"DefinitionCard.js","names":["__iconData","__iconNode","$.spread_props","$.spread_props","ToggleGroup.Root","ToggleGroup.Item","$.derived","$.attr","$.attr_style","$.escape","$.attr_class","$.stringify","$.ensure_array_like"],"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/grid-2x2.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/list.svelte","../../../../ui/src/lib/components/primitives/ViewToggle.svelte","../../../src/lib/components/definitions/cardStyles.ts","../../../src/lib/format/relativeTime.ts","../../../src/routes/projects/_components/statusStyles.ts","../../../src/lib/components/definitions/DefinitionCard.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\": \"grid-2x2\", \"size\": 24, \"node\": [[\"path\", { \"d\": \"M12 3v18\" }], [\"path\", { \"d\": \"M3 12h18\" }], [\"rect\", { \"x\": \"3\", \"y\": \"3\", \"width\": \"18\", \"height\": \"18\", \"rx\": \"2\" }]], \"aliases\": [\"grid-2-x-2\"] };\n/**\n * @deprecated Access `__iconData` instead.\n */\nexport const __iconNode = __iconData.node;\n</script>\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/grid-2x2\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\": \"list\", \"size\": 24, \"node\": [[\"path\", { \"d\": \"M3 5h.01\" }], [\"path\", { \"d\": \"M3 12h.01\" }], [\"path\", { \"d\": \"M3 19h.01\" }], [\"path\", { \"d\": \"M8 5h13\" }], [\"path\", { \"d\": \"M8 12h13\" }], [\"path\", { \"d\": \"M8 19h13\" }]] };\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/list\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={__iconData} />\n","<script lang=\"ts\">\n\timport { Grid2x2, List } from '@lucide/svelte';\n\timport * as ToggleGroup from './toggle-group';\n\n\ttype ViewMode = 'grid' | 'list';\n\n\tinterface Props {\n\t\tmode: ViewMode;\n\t\tonChange: (mode: ViewMode) => void;\n\t\tsize?: 'sm' | 'md';\n\t}\n\n\tlet { mode, onChange, size = 'md' }: Props = $props();\n</script>\n\n<ToggleGroup.Root\n\ttype=\"single\"\n\tvariant=\"outline\"\n\tsize={size === 'sm' ? 'sm' : 'default'}\n\tvalue={mode}\n\tonValueChange={(next) => {\n\t\t// A single-select group emits '' when the active item is clicked again; keep the mode.\n\t\tif (next === 'grid' || next === 'list') onChange(next);\n\t}}\n>\n\t<ToggleGroup.Item value=\"grid\" aria-label=\"Grid view\" title=\"Grid view\">\n\t\t<Grid2x2 />\n\t</ToggleGroup.Item>\n\t<ToggleGroup.Item value=\"list\" aria-label=\"List view\" title=\"List view\">\n\t\t<List />\n\t</ToggleGroup.Item>\n</ToggleGroup.Root>\n","/**\n * Visual helpers shared by the consumer (library) and author (projects)\n * definition card. Pure — no DOM, no randomness.\n */\n\nfunction hash(str: string): number {\n\tlet h = 0;\n\tfor (let i = 0; i < str.length; i++) h = (h * 31 + str.charCodeAt(i)) | 0;\n\treturn Math.abs(h);\n}\n\n/**\n * Two stable hues derived from the key. The actual gradient is composed in\n * CSS (`.tool-cover-fallback`) so light/dark modes can pick different\n * saturation + lightness without touching this module.\n */\nexport function huesFor(key: string): { h1: number; h2: number } {\n\tconst h = hash(key);\n\treturn { h1: h % 360, h2: (h >> 3) % 360 };\n}\n\n/** First letter of the name, uppercased. Falls back to '?' for empty names. */\nexport function monogram(name: string | undefined): string {\n\tconst trimmed = name?.trim() ?? '';\n\treturn trimmed ? trimmed[0].toUpperCase() : '?';\n}\n\n/** Compact \"2h\", \"3d\", \"1w\" relative timestamp for card footers. */\nexport function formatUpdated(iso: string): string {\n\tconst diff = Date.now() - new Date(iso).getTime();\n\tconst mins = Math.floor(diff / 60000);\n\tif (mins < 60) return `${mins}m`;\n\tconst h = Math.floor(mins / 60);\n\tif (h < 24) return `${h}h`;\n\tconst d = Math.floor(h / 24);\n\tif (d < 7) return `${d}d`;\n\treturn `${Math.floor(d / 7)}w`;\n}\n","/** Relative timestamp — \"2m ago\", \"3h ago\", \"5d ago\" — for recent-activity rows. */\nexport function formatRelative(iso: string): string {\n\tconst diff = Date.now() - new Date(iso).getTime();\n\tconst m = Math.floor(diff / 60_000);\n\tif (m < 1) return 'just now';\n\tif (m < 60) return `${m}m ago`;\n\tconst h = Math.floor(m / 60);\n\tif (h < 24) return `${h}h ago`;\n\tconst d = Math.floor(h / 24);\n\treturn `${d}d ago`;\n}\n","export const STATUS_RING: Record<string, string> = {\n\tdraft: 'bg-muted text-muted-foreground border-border',\n\treview:\n\t\t'bg-yellow-50 text-yellow-700 border-yellow-200 dark:bg-yellow-950/30 dark:text-yellow-400 dark:border-yellow-800',\n\tpublished:\n\t\t'bg-green-50 text-green-700 border-green-200 dark:bg-green-950/30 dark:text-green-400 dark:border-green-800',\n\tarchived: 'bg-muted text-muted-foreground border-border opacity-60',\n\tpending: 'bg-muted text-muted-foreground border-border'\n};\n\nexport const STATUS_DOT: Record<string, string> = {\n\tdraft: 'bg-muted-foreground',\n\treview: 'bg-yellow-500',\n\tpublished: 'bg-green-500',\n\tarchived: 'bg-muted-foreground',\n\tpending: 'bg-muted-foreground'\n};\n\nexport const statusRing = (s: string) => STATUS_RING[s] ?? STATUS_RING.draft;\nexport const statusDot = (s: string) => STATUS_DOT[s] ?? STATUS_DOT.draft;\n\nconst PROJECT_COLORS = ['#4f7c4f', '#4f6a7c', '#7c4f4f', '#7c6a4f', '#6a4f7c', '#4f7c6a'];\n\nexport function projectColor(id: string) {\n\tlet h = 0;\n\tfor (let i = 0; i < id.length; i++) h = (h * 31 + id.charCodeAt(i)) & 0xffffffff;\n\treturn PROJECT_COLORS[Math.abs(h) % PROJECT_COLORS.length];\n}\n\nexport function formatUpdated(iso: string) {\n\tconst diff = Date.now() - new Date(iso).getTime();\n\tconst mins = Math.floor(diff / 60000);\n\tif (mins < 60) return `${mins}m`;\n\tconst h = Math.floor(mins / 60);\n\tif (h < 24) return `${h}h`;\n\tconst d = Math.floor(h / 24);\n\tif (d < 7) return `${d}d`;\n\treturn `${Math.floor(d / 7)}w`;\n}\n","<script lang=\"ts\">\n\timport { ArrowRight, Server, Star } from '@lucide/svelte';\n\timport type { DefinitionRecord, ProjectVisibility } from '@selvajs/platform';\n\timport { huesFor, monogram } from './cardStyles';\n\timport { formatRelative } from '#lib/format/relativeTime.js';\n\timport { statusRing, statusDot } from '../../../routes/projects/_components/statusStyles';\n\n\tinterface Props {\n\t\trecord: DefinitionRecord;\n\t\t/** Click handler — caller decides what \"open\" means (run / drawer / etc.). */\n\t\tonOpen: (record: DefinitionRecord) => void;\n\t\t/** Optional project chip; pass when the surrounding view shows multiple projects. */\n\t\tprojectName?: string;\n\t\t/** Visibility of the parent project. Shown as muted text alongside projectName. */\n\t\tprojectVisibility?: ProjectVisibility;\n\n\t\t// ---- Author surface (projects) ----\n\t\t/** When true, renders the status badge top-left and \"updated X ago\" in the footer. */\n\t\tshowStatus?: boolean;\n\t\t/** Compute server this definition solves on. Shown in the footer when provided. */\n\t\tserverName?: string;\n\n\t\t// ---- Consumer surface (library) ----\n\t\t/** Spinner overlay while the runner navigates. */\n\t\tloading?: boolean;\n\t\t/** When provided, renders the star button top-right and reflects star state. */\n\t\tstarred?: boolean;\n\t\tstarBusy?: boolean;\n\t\tonToggleStar?: (guid: string) => void;\n\t}\n\n\tlet {\n\t\trecord,\n\t\tonOpen,\n\t\tprojectName,\n\t\tprojectVisibility,\n\t\tshowStatus = false,\n\t\tserverName,\n\t\tloading = false,\n\t\tstarred = false,\n\t\tstarBusy = false,\n\t\tonToggleStar\n\t}: Props = $props();\n\n\tconst hues = $derived(huesFor(record.guid));\n\t// Same project, same colour, so look-alike tools from different projects tell apart at a glance.\n\tconst projectHue = $derived(projectName ? huesFor(projectName).h1 : 0);\n\n\tfunction activate() {\n\t\tif (loading) return;\n\t\tonOpen(record);\n\t}\n\tfunction handleKey(e: KeyboardEvent) {\n\t\tif (e.key === 'Enter' || e.key === ' ') {\n\t\t\te.preventDefault();\n\t\t\tactivate();\n\t\t}\n\t}\n</script>\n\n<div\n\trole=\"button\"\n\ttabindex={loading ? -1 : 0}\n\taria-disabled={loading}\n\tonclick={activate}\n\tonkeydown={handleKey}\n\tclass=\"group border-border bg-card focus-visible:ring-ring flex cursor-pointer flex-col overflow-hidden rounded-xl border text-left shadow-[0_1px_0_rgba(0,0,0,0.03)] transition duration-200 hover:-translate-y-0.5 hover:shadow-[0_10px_30px_-16px_rgba(0,0,0,0.18)] focus:outline-none focus-visible:ring-2 aria-disabled:cursor-not-allowed aria-disabled:opacity-60\"\n>\n\t<div class=\"border-border relative aspect-16/10 overflow-hidden border-b\">\n\t\t{#if record.coverImage}\n\t\t\t<img\n\t\t\t\tsrc={record.coverImage}\n\t\t\t\talt={record.displayName}\n\t\t\t\tclass=\"absolute inset-0 h-full w-full object-cover\"\n\t\t\t/>\n\t\t{:else}\n\t\t\t<div\n\t\t\t\tclass=\"tool-cover-fallback absolute inset-0 flex items-center justify-center\"\n\t\t\t\tstyle:--tool-h1={hues.h1}\n\t\t\t\tstyle:--tool-h2={hues.h2}\n\t\t\t>\n\t\t\t\t<span\n\t\t\t\t\tclass=\"bg-card/70 text-foreground flex size-16 items-center justify-center rounded-xl text-3xl font-semibold shadow-sm backdrop-blur-sm\"\n\t\t\t\t>\n\t\t\t\t\t{monogram(record.displayName)}\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t{/if}\n\n\t\t{#if showStatus}\n\t\t\t<div class=\"absolute top-2.5 left-2.5\">\n\t\t\t\t<span\n\t\t\t\t\tclass=\"inline-flex items-center gap-1.5 rounded-full border px-2 py-0.5 font-mono text-[11px] tracking-wide {statusRing(\n\t\t\t\t\t\trecord.status\n\t\t\t\t\t)}\"\n\t\t\t\t>\n\t\t\t\t\t<span class=\"h-1.5 w-1.5 rounded-full {statusDot(record.status)}\"></span>\n\t\t\t\t\t{record.status}\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t{/if}\n\n\t\t{#if onToggleStar}\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\ttitle={starred ? 'Unstar' : 'Star'}\n\t\t\t\taria-label={starred ? 'Unstar definition' : 'Star definition'}\n\t\t\t\taria-pressed={starred}\n\t\t\t\tdisabled={starBusy}\n\t\t\t\tonclick={(e) => {\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tonToggleStar?.(record.guid);\n\t\t\t\t}}\n\t\t\t\tclass={`absolute top-2 right-2 flex h-7 w-7 items-center justify-center rounded-full backdrop-blur-sm transition-all disabled:opacity-60 ${\n\t\t\t\t\tstarred\n\t\t\t\t\t\t? 'bg-amber-400/90 text-white'\n\t\t\t\t\t\t: 'bg-black/40 text-white opacity-0 group-hover:opacity-100 hover:bg-black/55 pointer-coarse:opacity-100'\n\t\t\t\t}`}\n\t\t\t>\n\t\t\t\t<Star class=\"h-3.5 w-3.5 {starred ? 'fill-current' : ''}\" />\n\t\t\t</button>\n\t\t{/if}\n\n\t\t{#if loading}\n\t\t\t<div class=\"absolute inset-0 flex items-center justify-center bg-black/25\">\n\t\t\t\t<div\n\t\t\t\t\tclass=\"h-5 w-5 animate-spin rounded-full border-2 border-white border-t-transparent\"\n\t\t\t\t></div>\n\t\t\t</div>\n\t\t{/if}\n\t</div>\n\n\t<div class=\"flex flex-1 flex-col p-3.5\">\n\t\t{#if projectName}\n\t\t\t<p class=\"mb-1.5 flex items-center gap-1.5 text-xs\">\n\t\t\t\t<span\n\t\t\t\t\tclass=\"project-chip max-w-full truncate rounded-full px-2 py-0.5 font-medium\"\n\t\t\t\t\tstyle:--project-h={projectHue}\n\t\t\t\t>\n\t\t\t\t\t{projectName}\n\t\t\t\t</span>\n\t\t\t\t{#if projectVisibility}\n\t\t\t\t\t<span class=\"text-muted-foreground shrink-0\">{projectVisibility}</span>\n\t\t\t\t{/if}\n\t\t\t</p>\n\t\t{/if}\n\t\t<p class=\"truncate text-[14px] font-semibold\">{record.displayName}</p>\n\t\t{#if record.description}\n\t\t\t<p class=\"text-muted-foreground mt-1 line-clamp-2 text-[13px] leading-relaxed\">\n\t\t\t\t{record.description}\n\t\t\t</p>\n\t\t{/if}\n\n\t\t{#if record.tags?.length}\n\t\t\t<div class=\"mt-2.5 flex flex-wrap gap-1\">\n\t\t\t\t{#each record.tags.slice(0, 3) as tag (tag)}\n\t\t\t\t\t<span class=\"bg-muted text-muted-foreground rounded-full px-2 py-0.5 text-xs\">{tag}</span>\n\t\t\t\t{/each}\n\t\t\t\t{#if record.tags.length > 3}\n\t\t\t\t\t<span\n\t\t\t\t\t\tclass=\"bg-muted text-muted-foreground rounded-full px-2 py-0.5 text-xs\"\n\t\t\t\t\t\ttitle={record.tags.slice(3).join(', ')}\n\t\t\t\t\t>\n\t\t\t\t\t\t+{record.tags.length - 3}\n\t\t\t\t\t</span>\n\t\t\t\t{/if}\n\t\t\t</div>\n\t\t{/if}\n\n\t\t<div class=\"mt-auto\">\n\t\t\t{#if showStatus && serverName}\n\t\t\t\t<div\n\t\t\t\t\tclass=\"text-muted-foreground mt-2.5 flex items-center gap-1.5 font-mono text-[11px]\"\n\t\t\t\t\ttitle=\"Solves on {serverName}\"\n\t\t\t\t>\n\t\t\t\t\t<Server class=\"h-3 w-3 shrink-0 opacity-70\" />\n\t\t\t\t\t<span class=\"truncate\">{serverName}</span>\n\t\t\t\t</div>\n\t\t\t{/if}\n\t\t\t<hr class=\"border-border my-3\" />\n\t\t\t<div class=\"text-muted-foreground flex items-center justify-between text-xs\">\n\t\t\t\t<span>\n\t\t\t\t\tUpdated {formatRelative(record.updatedAt)}\n\t\t\t\t\t· {record.solveCount > 0 ? `${record.solveCount.toLocaleString()} runs` : 'No runs yet'}\n\t\t\t\t</span>\n\t\t\t\t{#if onToggleStar}\n\t\t\t\t\t<span\n\t\t\t\t\t\tclass=\"text-foreground flex items-center gap-1 font-medium opacity-60 transition-opacity group-hover:opacity-100\"\n\t\t\t\t\t>\n\t\t\t\t\t\tOpen <ArrowRight class=\"h-3 w-3\" />\n\t\t\t\t\t</span>\n\t\t\t\t{/if}\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n"],"ignoreList":[0,1],"mappings":";;;;;;;AAQyB,IAAaA,eAAU;CAAK,QAAQ;CAAY,QAAQ;CAAI,QAAM;EAAI,CAAA,QAAM,EAAI,KAAK,WAAU,CAAA;EAAM,CAAA,QAAM,EAAI,KAAK,WAAU,CAAA;E,CAAM,QAAU;GAAA,KAAK;GAAK,KAAK;GAAK,SAAS;GAAM,UAAU;GAAM,MAAM;EAAG,C;;CAAM,WAAS,CAAG,YAAY;;AAIvOA,aAAW;AAGrC,SAAA,SAAA,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;CAAQ,QAAQ;CAAI,QAAM;EAAI,CAAA,QAAM,EAAI,KAAK,WAAU,CAAA;EAAM,CAAA,QAAM,EAAI,KAAK,YAAW,CAAA;EAAM,CAAA,QAAM,EAAI,KAAK,YAAW,CAAA;EAAM,CAAA,QAAM,EAAI,KAAK,UAAS,CAAA;EAAM,CAAA,QAAM,EAAI,KAAK,WAAU,CAAA;EAAM,CAAA,QAAM,EAAI,KA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S,CAAC,EAAA,QAAA;;;;;EAOtB,IAAA,cAAc,YAAU;GAGT,WAAA,KAAA,qGAAAF,KAAA,SAAA,aAAAI,UAAA,UAAU,GAAA,EAAA,EAAA;;GAGJ,WAAA,KAAA,kCAAAF,YAAA,UAAU,EAAA,cAAA;;EAMzB,WAAA,KAAA,wIAAAA,YAAA,eAAe,OAAO,SAAS,CAAA,EAAA;SACrCA,YAAA,OAAO,aAAa,IAAO,GAAA,OAAO,WAAW,eAAc,EAAA,SAAY,aAAa,EAAA,SAAA;EAEnF,IAAA,cAAY;;;;;;CAhIb,CAAA"}
|
|
@@ -1049,6 +1049,18 @@ async function loadProjectOr404(ctx, projectId, src) {
|
|
|
1049
1049
|
if (!project || outsideTokenOrg(ctx, project.orgId)) apiError(404, ApiErrorCode.NOT_FOUND, "Project not found");
|
|
1050
1050
|
return project;
|
|
1051
1051
|
}
|
|
1052
|
+
/**
|
|
1053
|
+
* The project for a management gate. `instance_admin` passes those gates for
|
|
1054
|
+
* any project, so its row has to load whatever the caller's own session can
|
|
1055
|
+
* see: the data layer shows staff no more tenant content than anyone else.
|
|
1056
|
+
* Content gates keep `loadProjectOr404`, where an unseen project is a 404.
|
|
1057
|
+
*/
|
|
1058
|
+
async function loadProjectForManagement(ctx, projectId, src) {
|
|
1059
|
+
const readAs = hasPermission(ctx, "instance_admin") ? SYSTEM_CONTEXT : ctx;
|
|
1060
|
+
const project = await projectsOf(src).getProject(readAs, projectId);
|
|
1061
|
+
if (!project || outsideTokenOrg(ctx, project.orgId)) apiError(404, ApiErrorCode.NOT_FOUND, "Project not found");
|
|
1062
|
+
return project;
|
|
1063
|
+
}
|
|
1052
1064
|
function accessInputsFor(src) {
|
|
1053
1065
|
const readFlag = flagOf(src);
|
|
1054
1066
|
return createProjectAccessInputBuilder({
|
|
@@ -1123,7 +1135,7 @@ async function requireCanReclaim(locals, projectId) {
|
|
|
1123
1135
|
const { user, ctx } = requireAuthed(locals);
|
|
1124
1136
|
const visible = await projectsOf(locals).getProject(ctx, projectId);
|
|
1125
1137
|
const project = visible ?? await projectsOf(locals).getProject(SYSTEM_CONTEXT, projectId);
|
|
1126
|
-
if (!project || outsideTokenOrg(ctx, project.orgId) || !visible && project.orgId !== ctx.actingOrgId) apiError(404, ApiErrorCode.NOT_FOUND, "Project not found");
|
|
1138
|
+
if (!project || outsideTokenOrg(ctx, project.orgId) || !visible && project.orgId !== ctx.actingOrgId && !hasPermission(ctx, "instance_admin")) apiError(404, ApiErrorCode.NOT_FOUND, "Project not found");
|
|
1127
1139
|
if (project.visibility === "platform") apiError(403, ApiErrorCode.FORBIDDEN, "Platform projects cannot be reclaimed.");
|
|
1128
1140
|
if (!await managementBypassOrRun(ctx, async () => {
|
|
1129
1141
|
const orgMember = await orgsOf(locals).getOrgMember(ctx, project.orgId, ctx.userId);
|
|
@@ -1196,13 +1208,13 @@ async function requireProjectVisibilityAllowed(locals, ctx, orgId, next, current
|
|
|
1196
1208
|
*/
|
|
1197
1209
|
async function requireCanManage(locals, projectId, action = "project") {
|
|
1198
1210
|
const { user, ctx } = requireAuthed(locals);
|
|
1199
|
-
const project = await
|
|
1211
|
+
const project = await loadProjectForManagement(ctx, projectId, locals);
|
|
1200
1212
|
if (!await managementBypassForProject(ctx, project, locals, async () => canManage(await buildProjectAccessInput(ctx, project, locals)))) apiError(403, ApiErrorCode.FORBIDDEN, action === "members" ? "Only project owners can manage members." : "Only project owners can manage this project.");
|
|
1201
1213
|
return user;
|
|
1202
1214
|
}
|
|
1203
1215
|
async function requireCanEditProjectSettings(locals, projectId) {
|
|
1204
1216
|
const { user, ctx } = requireAuthed(locals);
|
|
1205
|
-
const project = await
|
|
1217
|
+
const project = await loadProjectForManagement(ctx, projectId, locals);
|
|
1206
1218
|
if (!await managementBypassForProject(ctx, project, locals, async () => canEditProjectSettings(await buildProjectAccessInput(ctx, project, locals)))) apiError(403, ApiErrorCode.FORBIDDEN, "Only project owners can edit project settings.");
|
|
1207
1219
|
return {
|
|
1208
1220
|
user,
|