@selvajs/selva 4.21.0-beta.24 → 4.21.0-beta.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/build/adapter-node.js +1 -1
  2. package/build/client/_app/immutable/chunks/A_2RYLH9.js +1 -0
  3. package/build/client/_app/immutable/chunks/A_2RYLH9.js.br +1 -0
  4. package/build/client/_app/immutable/chunks/A_2RYLH9.js.gz +0 -0
  5. package/build/client/_app/immutable/chunks/{DtmN00GS.js → BMp0Pt9F.js} +4 -4
  6. package/build/client/_app/immutable/chunks/BMp0Pt9F.js.br +0 -0
  7. package/build/client/_app/immutable/chunks/BMp0Pt9F.js.gz +0 -0
  8. package/build/client/_app/immutable/entry/{app.Dl3HM1mx.js → app.UvCzfP6E.js} +2 -2
  9. package/build/client/_app/immutable/entry/app.UvCzfP6E.js.br +0 -0
  10. package/build/client/_app/immutable/entry/app.UvCzfP6E.js.gz +0 -0
  11. package/build/client/_app/immutable/nodes/21.BAYqxLPV.js +1 -0
  12. package/build/client/_app/immutable/nodes/21.BAYqxLPV.js.br +1 -0
  13. package/build/client/_app/immutable/nodes/21.BAYqxLPV.js.gz +0 -0
  14. package/build/client/_app/version.json +1 -1
  15. package/build/client/_app/version.json.br +0 -0
  16. package/build/client/_app/version.json.gz +0 -0
  17. package/build/runtime-meta.json +1 -1
  18. package/build/server/.vite/manifest.json +13 -11
  19. package/build/server/chunks/compute.js +1 -1
  20. package/build/server/chunks/engine.server.js +1 -1
  21. package/build/server/chunks/errors.js +7 -30
  22. package/build/server/chunks/errors.js.map +1 -1
  23. package/build/server/chunks/handlers.js +5 -4
  24. package/build/server/chunks/handlers.js.map +1 -1
  25. package/build/server/chunks/instance.js +3 -3
  26. package/build/server/chunks/internal.js +1 -1
  27. package/build/server/chunks/ops.js +1 -1
  28. package/build/server/chunks/package.js +1 -1
  29. package/build/server/chunks/package.js.map +1 -1
  30. package/build/server/chunks/providers.server.js +48 -15
  31. package/build/server/chunks/providers.server.js.map +1 -1
  32. package/build/server/chunks/{limits.js → saved-values.js} +35 -2
  33. package/build/server/chunks/saved-values.js.map +1 -0
  34. package/build/server/chunks/types2.js.map +1 -1
  35. package/build/server/entries/pages/library/_guid_/_page.server.ts.js +14 -3
  36. package/build/server/entries/pages/library/_guid_/_page.server.ts.js.map +1 -1
  37. package/build/server/entries/pages/library/_guid_/_page.svelte.js +42 -8
  38. package/build/server/entries/pages/library/_guid_/_page.svelte.js.map +1 -1
  39. package/build/server/manifest-full.js +1 -1
  40. package/build/server/manifest.js +1 -1
  41. package/build/server/nodes/21.js +1 -1
  42. package/build/server/server.js +1 -1
  43. package/package.json +9 -9
  44. package/build/client/_app/immutable/chunks/B58dPMPq.js +0 -1
  45. package/build/client/_app/immutable/chunks/B58dPMPq.js.br +0 -1
  46. package/build/client/_app/immutable/chunks/B58dPMPq.js.gz +0 -0
  47. package/build/client/_app/immutable/chunks/DtmN00GS.js.br +0 -0
  48. package/build/client/_app/immutable/chunks/DtmN00GS.js.gz +0 -0
  49. package/build/client/_app/immutable/entry/app.Dl3HM1mx.js.br +0 -0
  50. package/build/client/_app/immutable/entry/app.Dl3HM1mx.js.gz +0 -0
  51. package/build/client/_app/immutable/nodes/21.BZJQikE5.js +0 -1
  52. package/build/client/_app/immutable/nodes/21.BZJQikE5.js.br +0 -0
  53. package/build/client/_app/immutable/nodes/21.BZJQikE5.js.gz +0 -0
  54. package/build/server/chunks/limits.js.map +0 -1
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.BQ4J6cqX.js","../chunks/sphvlIzg.js","../chunks/C1xbQMZF.js","../chunks/BJGlbpZ0.js","../chunks/BFJ8iwO4.js","./payload.DSmR2FwN.js","../chunks/Cyt8LZpN.js","../chunks/BHnRUwtv.js","../chunks/BQmUk61d.js","../assets/0.DOeouCe4.css","../nodes/1.DmBjtFLw.js","../chunks/Bs2bQTgl.js","../chunks/Ca-1xMUo.js","../chunks/BbFMtSJ8.js","../chunks/BEzPIk5e.js","../chunks/CivEAG-M.js","../chunks/B8LXiPqe.js","../chunks/Bx2qumU5.js","../chunks/DIYaLgLs.js","../nodes/2.Dstc2B2E.js","../chunks/85w20NVU.js","../chunks/CoLPPvYz.js","../chunks/rIQJtl5L.js","../chunks/DEthS42j.js","../chunks/Nv1S5RTq.js","../chunks/CoRMsLUN.js","../chunks/DNFu5yLd.js","../chunks/OznVWGiS.js","../chunks/C9yuuH4J.js","../chunks/Jlr_WNWs.js","../chunks/CXFC38jr.js","../chunks/D_-42ATH.js","../chunks/BuCeXb-q.js","../chunks/Rbl3OsBf.js","../chunks/aBYenH6-.js","../chunks/DtmJiR65.js","../chunks/DIOXhUNn.js","../chunks/CSy_25b1.js","../chunks/CBf5ToEX.js","../chunks/BUENW6k7.js","../chunks/B3e8ZKjr.js","../chunks/34Sd6e9o.js","../chunks/1VJx1aVI.js","../chunks/BkTC9VdY.js","../chunks/B7agp_uZ.js","../chunks/BmbAoXqr.js","../nodes/3.GtVSkcEP.js","../nodes/4.DPB_nXDo.js","../nodes/5.CA3-Q2Yj.js","../nodes/6.DXhDcOvi.js","../chunks/C0bsOHz0.js","../chunks/DqBxcKN2.js","../chunks/D-1_v2Lf.js","../chunks/ChEklEBB.js","../chunks/DBMBAz5L.js","../nodes/7.B-g8F3Ul.js","../chunks/lMQbJOeE.js","../assets/7.T1zeJ20D.css","../nodes/8.CeF7Yj23.js","../chunks/BCgmDXNw.js","../chunks/CUaHcctM.js","../nodes/9.Bk5Lntvs.js","../chunks/BPWrsj_h.js","../chunks/1AvDtYi1.js","../chunks/ByPYmSUR.js","../chunks/fJvE1weH.js","../chunks/Uzaejkud.js","../chunks/CdTxvcQ4.js","../chunks/CNij7yXO.js","../chunks/ag4k__EW.js","../nodes/10.B3aBLsAq.js","../chunks/B9-uqzXO.js","../chunks/B187F-XR.js","../chunks/Djv8qD_2.js","../chunks/CVl4suwo.js","../chunks/Dqc45la5.js","../chunks/DcS7V4T3.js","../chunks/BLG35vEW.js","../assets/select.CV-KWLNP.css","../chunks/ZGbF6Eux.js","../nodes/11.CnQVPSaL.js","../chunks/B7VqKSCZ.js","../chunks/DmlEI0uK.js","../chunks/CNkLk5_8.js","../chunks/CoB4qHba.js","../chunks/D6cAtf8B.js","../chunks/DqR8kuM6.js","../nodes/12.B7-VLcK9.js","../chunks/-MlIqmcL.js","../assets/DataTable.BjgXtTHK.css","../nodes/13.TEbI6lFx.js","../chunks/TZzCN567.js","../chunks/Cms9vBTq.js","../nodes/14.Dx84-S7G.js","../chunks/D6SQx3MR.js","../chunks/CK2nnbJa.js","../chunks/Cj9-pF71.js","../chunks/BVVRTJCQ.js","../nodes/15.CEROqZ8B.js","../chunks/gNgZDPHs.js","../chunks/nJUe9gXb.js","../chunks/DR4HRB4w.js","../nodes/16.C7nA7TCy.js","../chunks/Cv8bPnPc.js","../chunks/BvRGv1MX.js","../chunks/BFtd89gK.js","../nodes/17.0cv7e5IP.js","../chunks/hvudoNyJ.js","../nodes/18.PJQUQ85Q.js","../nodes/19.DRxrJE9N.js","../nodes/20.B8bN-AYw.js","../chunks/a5NclWb-.js","../chunks/DG4fF26P.js","../nodes/21.BZJQikE5.js","../chunks/DtmN00GS.js","../chunks/CRzLMJPS.js","../chunks/BSN2qO1R.js","../chunks/Bct5vmEM.js","../chunks/DnJObvmm.js","../assets/21.VfhYpgTQ.css","../nodes/22.q4pJo1Ec.js","../nodes/24.DkL5kHzA.js","../nodes/25.DbMk0htM.js","../chunks/v0PYjZZ5.js","../nodes/26.7nAJpm5P.js","../nodes/27.BZljPb4_.js","../nodes/28.BUnWplt-.js","../nodes/29.DWokJWH0.js","../nodes/30.ForK2knd.js","../nodes/31.DEYw8Upz.js","../chunks/BrpXEGl0.js","../nodes/32.Bi8d2lf7.js","../nodes/33.CswdDR11.js","../nodes/34.DUW5te4K.js","../nodes/35.Dpj9Kp45.js"])))=>i.map(i=>d[i]);
2
- import{t as e}from"../chunks/CRzLMJPS.js";var t={},n=[()=>e(()=>import(`../nodes/0.BQ4J6cqX.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url),()=>e(()=>import(`../nodes/1.DmBjtFLw.js`),__vite__mapDeps([10,1,4,5,6,7,11,12,13,14,15,16,17,18]),import.meta.url),()=>e(()=>import(`../nodes/2.Dstc2B2E.js`),__vite__mapDeps([19,1,20,12,21,22,23,2,3,4,5,6,7,24,25,13,14,26,27,15,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45]),import.meta.url),()=>e(()=>import(`../nodes/3.GtVSkcEP.js`),__vite__mapDeps([46,1,4,5,6,7,11,12,13,14,15,16,17,18]),import.meta.url),()=>e(()=>import(`../nodes/4.DPB_nXDo.js`),__vite__mapDeps([47,1]),import.meta.url),()=>e(()=>import(`../nodes/5.CA3-Q2Yj.js`),__vite__mapDeps([48,1,23,2,3,4,5,6,7,12,24,25,13,14,26,27,15,28,29,30,31,32,33,34,35,36,37,38,39,40]),import.meta.url),()=>e(()=>import(`../nodes/6.DXhDcOvi.js`),__vite__mapDeps([49,1,4,5,6,7,12,50,51,22,52,53,23,2,3,24,25,13,14,26,27,15,28,29,30,31,32,33,34,35,36,37,38,39,40,54,42,43,44,45]),import.meta.url),()=>e(()=>import(`../nodes/7.B-g8F3Ul.js`),__vite__mapDeps([55,1,4,5,6,7,13,12,56,23,2,3,24,25,14,26,27,15,28,29,30,31,32,33,34,35,36,37,38,39,40,57]),import.meta.url),()=>e(()=>import(`../nodes/8.CeF7Yj23.js`),__vite__mapDeps([58,1,4,5,6,7,13,12,59,25,60,18,15]),import.meta.url),()=>e(()=>import(`../nodes/9.Bk5Lntvs.js`),__vite__mapDeps([61,1,40,5,6,4,7,12,13,20,42,62,30,63,16,64,17,65,8,66,67,25,27,3,68,32,69,56]),import.meta.url),()=>e(()=>import(`../nodes/10.B3aBLsAq.js`),__vite__mapDeps([70,1,13,12,71,72,41,73,35,74,3,25,26,27,75,33,76,77,78,59,63,79,60,16,17,65]),import.meta.url),()=>e(()=>import(`../nodes/11.CnQVPSaL.js`),__vite__mapDeps([80,1,3,40,5,6,4,12,13,71,75,81,82,83,42,84,62,63,85,60,16,8,66,67,25,27,68,32,86]),import.meta.url),()=>e(()=>import(`../nodes/12.B7-VLcK9.js`),__vite__mapDeps([87,1,20,12,63,85,16,88,89]),import.meta.url),()=>e(()=>import(`../nodes/13.TEbI6lFx.js`),__vite__mapDeps([90,1,40,5,6,4,13,12,21,82,91,25,26,27,3,71,92,60,77,68,59,63,85,16,8,88,89]),import.meta.url),()=>e(()=>import(`../nodes/14.Dx84-S7G.js`),__vite__mapDeps([93,1,40,5,6,4,12,13,94,82,28,29,62,35,91,25,26,27,3,71,92,60,77,68,59,95,31,63,85,96,16,8,88,89,66,67,32,97]),import.meta.url),()=>e(()=>import(`../nodes/15.CEROqZ8B.js`),__vite__mapDeps([98,1,25,40,5,6,4,7,12,13,26,27,3,72,15,99,22,100,83,73,67,68,32,76,77,91,71,92,60,95,31,63,101,35,16,64,17,65,18,39]),import.meta.url),()=>e(()=>import(`../nodes/16.C7nA7TCy.js`),__vite__mapDeps([102,1,40,5,6,4,12,13,71,72,82,92,3,25,26,27,60,73,62,30,35,91,77,68,63,85,16,8,18,15,66,67,32,103,104,97,105,38,37]),import.meta.url),()=>e(()=>import(`../nodes/17.0cv7e5IP.js`),__vite__mapDeps([106,1,4,5,6,7,107,12,18,15]),import.meta.url),()=>e(()=>import(`../nodes/18.PJQUQ85Q.js`),__vite__mapDeps([108,1]),import.meta.url),()=>e(()=>import(`../nodes/19.DRxrJE9N.js`),__vite__mapDeps([109,1,6,5,43]),import.meta.url),()=>e(()=>import(`../nodes/20.B8bN-AYw.js`),__vite__mapDeps([110,1,40,5,6,4,12,56,111,42,84,112,25,31,27,3,23,2,7,24,13,14,26,15,28,29,30,32,33,34,35,36,37,38,39,91,71,92,60,77,68,43,63,85,101,8]),import.meta.url),()=>e(()=>import(`../nodes/21.BZJQikE5.js`),__vite__mapDeps([113,114,115,1,2,3,25,40,5,6,4,7,12,24,13,14,26,27,15,28,29,30,31,32,33,34,35,36,37,38,39,71,104,75,72,45,116,117,100,92,60,42,74,76,77,78,59,95,112,96,8,18,118,86,119]),import.meta.url),()=>e(()=>import(`../nodes/22.q4pJo1Ec.js`),__vite__mapDeps([120,1,4,5,6,7,13,12,59,25,60,18,15,118]),import.meta.url),()=>e(()=>import(`../chunks/BvRk9kiK.js`),[],import.meta.url),()=>e(()=>import(`../nodes/24.DkL5kHzA.js`),__vite__mapDeps([121,1,4,5,6,7,13,12,91,25,26,27,3,71,92,60,77,68,79,18,15]),import.meta.url),()=>e(()=>import(`../nodes/25.DbMk0htM.js`),__vite__mapDeps([122,1,3,40,5,6,4,7,12,13,94,26,25,27,71,15,81,99,116,117,111,56,42,84,112,31,53,100,82,92,60,28,62,123,30,35,67,68,32,91,77,34,14,59,95,43,63,85,79,101,96,8,18,66,37,97,105]),import.meta.url),()=>e(()=>import(`../nodes/26.7nAJpm5P.js`),__vite__mapDeps([124,1,4,5,6,7,13,12,59,25,60,18,15]),import.meta.url),()=>e(()=>import(`../nodes/27.BZljPb4_.js`),__vite__mapDeps([125,1,20,12,51,30,63,16,17,65,69,56]),import.meta.url),()=>e(()=>import(`../nodes/28.BUnWplt-.js`),__vite__mapDeps([126,1,50,12,73,63,16,17,65]),import.meta.url),()=>e(()=>import(`../nodes/29.DWokJWH0.js`),__vite__mapDeps([127,1,40,5,6,4,7,13,12,82,42,84,62,91,25,26,27,3,71,92,60,77,68,63,85,79,16,64,17,65,8,66,67,32,86]),import.meta.url),()=>e(()=>import(`../nodes/30.ForK2knd.js`),__vite__mapDeps([128,1,40,5,6,4,12,13,99,107,92,3,25,26,27,60,62,123,35,91,71,77,68,63,85,16,64,17,65,8,66,67,32,103,104,72,97,105,36,37]),import.meta.url),()=>e(()=>import(`../nodes/31.DEYw8Upz.js`),__vite__mapDeps([129,1,40,5,6,4,13,12,130,51,82,62,67,25,27,3,68,32,91,26,71,92,60,77,63,85,16,8,88,89]),import.meta.url),()=>e(()=>import(`../nodes/32.Bi8d2lf7.js`),__vite__mapDeps([131,1,40,5,6,4,13,12,117,54,67,25,27,3,68,32,63,85,16,8,88,89]),import.meta.url),()=>e(()=>import(`../nodes/33.CswdDR11.js`),__vite__mapDeps([132,1,12,62,63,16,64,17,65]),import.meta.url),()=>e(()=>import(`../nodes/34.DUW5te4K.js`),__vite__mapDeps([133,1,40,5,6,4,13,12,130,53,62,67,25,27,3,68,32,63,85,60,16,8,88,89]),import.meta.url),()=>e(()=>import(`../nodes/35.Dpj9Kp45.js`),__vite__mapDeps([134,1,40,5,6,4,7,13,12,26,25,27,3,99,52,62,74,71,75,33,76,77,78,67,68,32,59,95,31,63,85,79,60,16,64,17,65,8,18,15,88,89,37]),import.meta.url)],r=[0,2,5,6],i={"/":[-8],"/accept-invite":[-9],"/admin":[-10,[2],[3]],"/admin/audit":[-11,[2],[3]],"/admin/compute":[-12,[2],[3]],"/admin/organizations":[-13,[2],[3]],"/admin/projects":[-14,[2],[3]],"/admin/projects/[id]":[-15,[2],[3]],"/admin/system":[-16,[2],[3]],"/admin/users":[-17,[2],[3]],"/auth/email/sent":[17],"/auth/email/start":[-19],"/docs/api":[-20],"/library":[-21,[4]],"/library/[guid]":[-22,[4]],"/login":[-23],"/logout":[23],"/oauth/authorize":[-25],"/projects":[-26,[5]],"/setup":[-27],"/team":[-28,[6]],"/team/activity":[28,[6]],"/team/compute":[-30,[6]],"/team/members":[-31,[6]],"/team/projects":[-32,[6]],"/team/reclaim":[-33,[6]],"/team/settings":[-34,[6]],"/team/shares":[-35,[6]],"/team/tokens":[-36,[6]]},a={handleError:(({kind:e,error:t})=>{e===`unknown`&&console.error(t)}),reroute:(()=>{}),transport:{}},o=Object.fromEntries(Object.entries(a.transport).map(([e,t])=>[e,t.decode])),s=Object.fromEntries(Object.entries(a.transport).map(([e,t])=>[e,t.encode])),c=!1,l=(e,t)=>o[e](t),u=()=>e(()=>import(`../chunks/Bjy-W4x2.js`).then(e=>e.default),[],import.meta.url);export{l as decode,o as decoders,i as dictionary,s as encoders,u as get_error_template,c as hash,a as hooks,t as matchers,n as nodes,r as server_loads};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.BQ4J6cqX.js","../chunks/sphvlIzg.js","../chunks/C1xbQMZF.js","../chunks/BJGlbpZ0.js","../chunks/BFJ8iwO4.js","./payload.DSmR2FwN.js","../chunks/Cyt8LZpN.js","../chunks/BHnRUwtv.js","../chunks/BQmUk61d.js","../assets/0.DOeouCe4.css","../nodes/1.DmBjtFLw.js","../chunks/Bs2bQTgl.js","../chunks/Ca-1xMUo.js","../chunks/BbFMtSJ8.js","../chunks/BEzPIk5e.js","../chunks/CivEAG-M.js","../chunks/B8LXiPqe.js","../chunks/Bx2qumU5.js","../chunks/DIYaLgLs.js","../nodes/2.Dstc2B2E.js","../chunks/85w20NVU.js","../chunks/CoLPPvYz.js","../chunks/rIQJtl5L.js","../chunks/DEthS42j.js","../chunks/Nv1S5RTq.js","../chunks/CoRMsLUN.js","../chunks/DNFu5yLd.js","../chunks/OznVWGiS.js","../chunks/C9yuuH4J.js","../chunks/Jlr_WNWs.js","../chunks/CXFC38jr.js","../chunks/D_-42ATH.js","../chunks/BuCeXb-q.js","../chunks/Rbl3OsBf.js","../chunks/aBYenH6-.js","../chunks/DtmJiR65.js","../chunks/DIOXhUNn.js","../chunks/CSy_25b1.js","../chunks/CBf5ToEX.js","../chunks/BUENW6k7.js","../chunks/B3e8ZKjr.js","../chunks/34Sd6e9o.js","../chunks/1VJx1aVI.js","../chunks/BkTC9VdY.js","../chunks/B7agp_uZ.js","../chunks/BmbAoXqr.js","../nodes/3.GtVSkcEP.js","../nodes/4.DPB_nXDo.js","../nodes/5.CA3-Q2Yj.js","../nodes/6.DXhDcOvi.js","../chunks/C0bsOHz0.js","../chunks/DqBxcKN2.js","../chunks/D-1_v2Lf.js","../chunks/ChEklEBB.js","../chunks/DBMBAz5L.js","../nodes/7.B-g8F3Ul.js","../chunks/lMQbJOeE.js","../assets/7.T1zeJ20D.css","../nodes/8.CeF7Yj23.js","../chunks/BCgmDXNw.js","../chunks/CUaHcctM.js","../nodes/9.Bk5Lntvs.js","../chunks/BPWrsj_h.js","../chunks/1AvDtYi1.js","../chunks/ByPYmSUR.js","../chunks/fJvE1weH.js","../chunks/Uzaejkud.js","../chunks/CdTxvcQ4.js","../chunks/CNij7yXO.js","../chunks/ag4k__EW.js","../nodes/10.B3aBLsAq.js","../chunks/B9-uqzXO.js","../chunks/B187F-XR.js","../chunks/Djv8qD_2.js","../chunks/CVl4suwo.js","../chunks/Dqc45la5.js","../chunks/DcS7V4T3.js","../chunks/BLG35vEW.js","../assets/select.CV-KWLNP.css","../chunks/ZGbF6Eux.js","../nodes/11.CnQVPSaL.js","../chunks/B7VqKSCZ.js","../chunks/DmlEI0uK.js","../chunks/CNkLk5_8.js","../chunks/CoB4qHba.js","../chunks/D6cAtf8B.js","../chunks/DqR8kuM6.js","../nodes/12.B7-VLcK9.js","../chunks/-MlIqmcL.js","../assets/DataTable.BjgXtTHK.css","../nodes/13.TEbI6lFx.js","../chunks/TZzCN567.js","../chunks/Cms9vBTq.js","../nodes/14.Dx84-S7G.js","../chunks/D6SQx3MR.js","../chunks/CK2nnbJa.js","../chunks/Cj9-pF71.js","../chunks/BVVRTJCQ.js","../nodes/15.CEROqZ8B.js","../chunks/gNgZDPHs.js","../chunks/nJUe9gXb.js","../chunks/DR4HRB4w.js","../nodes/16.C7nA7TCy.js","../chunks/Cv8bPnPc.js","../chunks/BvRGv1MX.js","../chunks/BFtd89gK.js","../nodes/17.0cv7e5IP.js","../chunks/hvudoNyJ.js","../nodes/18.PJQUQ85Q.js","../nodes/19.DRxrJE9N.js","../nodes/20.B8bN-AYw.js","../chunks/a5NclWb-.js","../chunks/DG4fF26P.js","../nodes/21.BAYqxLPV.js","../chunks/BMp0Pt9F.js","../chunks/CRzLMJPS.js","../chunks/BSN2qO1R.js","../chunks/Bct5vmEM.js","../chunks/DnJObvmm.js","../assets/21.VfhYpgTQ.css","../nodes/22.q4pJo1Ec.js","../nodes/24.DkL5kHzA.js","../nodes/25.DbMk0htM.js","../chunks/v0PYjZZ5.js","../nodes/26.7nAJpm5P.js","../nodes/27.BZljPb4_.js","../nodes/28.BUnWplt-.js","../nodes/29.DWokJWH0.js","../nodes/30.ForK2knd.js","../nodes/31.DEYw8Upz.js","../chunks/BrpXEGl0.js","../nodes/32.Bi8d2lf7.js","../nodes/33.CswdDR11.js","../nodes/34.DUW5te4K.js","../nodes/35.Dpj9Kp45.js"])))=>i.map(i=>d[i]);
2
+ import{t as e}from"../chunks/CRzLMJPS.js";var t={},n=[()=>e(()=>import(`../nodes/0.BQ4J6cqX.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url),()=>e(()=>import(`../nodes/1.DmBjtFLw.js`),__vite__mapDeps([10,1,4,5,6,7,11,12,13,14,15,16,17,18]),import.meta.url),()=>e(()=>import(`../nodes/2.Dstc2B2E.js`),__vite__mapDeps([19,1,20,12,21,22,23,2,3,4,5,6,7,24,25,13,14,26,27,15,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45]),import.meta.url),()=>e(()=>import(`../nodes/3.GtVSkcEP.js`),__vite__mapDeps([46,1,4,5,6,7,11,12,13,14,15,16,17,18]),import.meta.url),()=>e(()=>import(`../nodes/4.DPB_nXDo.js`),__vite__mapDeps([47,1]),import.meta.url),()=>e(()=>import(`../nodes/5.CA3-Q2Yj.js`),__vite__mapDeps([48,1,23,2,3,4,5,6,7,12,24,25,13,14,26,27,15,28,29,30,31,32,33,34,35,36,37,38,39,40]),import.meta.url),()=>e(()=>import(`../nodes/6.DXhDcOvi.js`),__vite__mapDeps([49,1,4,5,6,7,12,50,51,22,52,53,23,2,3,24,25,13,14,26,27,15,28,29,30,31,32,33,34,35,36,37,38,39,40,54,42,43,44,45]),import.meta.url),()=>e(()=>import(`../nodes/7.B-g8F3Ul.js`),__vite__mapDeps([55,1,4,5,6,7,13,12,56,23,2,3,24,25,14,26,27,15,28,29,30,31,32,33,34,35,36,37,38,39,40,57]),import.meta.url),()=>e(()=>import(`../nodes/8.CeF7Yj23.js`),__vite__mapDeps([58,1,4,5,6,7,13,12,59,25,60,18,15]),import.meta.url),()=>e(()=>import(`../nodes/9.Bk5Lntvs.js`),__vite__mapDeps([61,1,40,5,6,4,7,12,13,20,42,62,30,63,16,64,17,65,8,66,67,25,27,3,68,32,69,56]),import.meta.url),()=>e(()=>import(`../nodes/10.B3aBLsAq.js`),__vite__mapDeps([70,1,13,12,71,72,41,73,35,74,3,25,26,27,75,33,76,77,78,59,63,79,60,16,17,65]),import.meta.url),()=>e(()=>import(`../nodes/11.CnQVPSaL.js`),__vite__mapDeps([80,1,3,40,5,6,4,12,13,71,75,81,82,83,42,84,62,63,85,60,16,8,66,67,25,27,68,32,86]),import.meta.url),()=>e(()=>import(`../nodes/12.B7-VLcK9.js`),__vite__mapDeps([87,1,20,12,63,85,16,88,89]),import.meta.url),()=>e(()=>import(`../nodes/13.TEbI6lFx.js`),__vite__mapDeps([90,1,40,5,6,4,13,12,21,82,91,25,26,27,3,71,92,60,77,68,59,63,85,16,8,88,89]),import.meta.url),()=>e(()=>import(`../nodes/14.Dx84-S7G.js`),__vite__mapDeps([93,1,40,5,6,4,12,13,94,82,28,29,62,35,91,25,26,27,3,71,92,60,77,68,59,95,31,63,85,96,16,8,88,89,66,67,32,97]),import.meta.url),()=>e(()=>import(`../nodes/15.CEROqZ8B.js`),__vite__mapDeps([98,1,25,40,5,6,4,7,12,13,26,27,3,72,15,99,22,100,83,73,67,68,32,76,77,91,71,92,60,95,31,63,101,35,16,64,17,65,18,39]),import.meta.url),()=>e(()=>import(`../nodes/16.C7nA7TCy.js`),__vite__mapDeps([102,1,40,5,6,4,12,13,71,72,82,92,3,25,26,27,60,73,62,30,35,91,77,68,63,85,16,8,18,15,66,67,32,103,104,97,105,38,37]),import.meta.url),()=>e(()=>import(`../nodes/17.0cv7e5IP.js`),__vite__mapDeps([106,1,4,5,6,7,107,12,18,15]),import.meta.url),()=>e(()=>import(`../nodes/18.PJQUQ85Q.js`),__vite__mapDeps([108,1]),import.meta.url),()=>e(()=>import(`../nodes/19.DRxrJE9N.js`),__vite__mapDeps([109,1,6,5,43]),import.meta.url),()=>e(()=>import(`../nodes/20.B8bN-AYw.js`),__vite__mapDeps([110,1,40,5,6,4,12,56,111,42,84,112,25,31,27,3,23,2,7,24,13,14,26,15,28,29,30,32,33,34,35,36,37,38,39,91,71,92,60,77,68,43,63,85,101,8]),import.meta.url),()=>e(()=>import(`../nodes/21.BAYqxLPV.js`),__vite__mapDeps([113,114,115,1,2,3,25,40,5,6,4,7,12,24,13,14,26,27,15,28,29,30,31,32,33,34,35,36,37,38,39,71,104,75,72,45,116,117,100,92,60,42,74,76,77,78,59,95,112,96,8,18,118,86,119]),import.meta.url),()=>e(()=>import(`../nodes/22.q4pJo1Ec.js`),__vite__mapDeps([120,1,4,5,6,7,13,12,59,25,60,18,15,118]),import.meta.url),()=>e(()=>import(`../chunks/BvRk9kiK.js`),[],import.meta.url),()=>e(()=>import(`../nodes/24.DkL5kHzA.js`),__vite__mapDeps([121,1,4,5,6,7,13,12,91,25,26,27,3,71,92,60,77,68,79,18,15]),import.meta.url),()=>e(()=>import(`../nodes/25.DbMk0htM.js`),__vite__mapDeps([122,1,3,40,5,6,4,7,12,13,94,26,25,27,71,15,81,99,116,117,111,56,42,84,112,31,53,100,82,92,60,28,62,123,30,35,67,68,32,91,77,34,14,59,95,43,63,85,79,101,96,8,18,66,37,97,105]),import.meta.url),()=>e(()=>import(`../nodes/26.7nAJpm5P.js`),__vite__mapDeps([124,1,4,5,6,7,13,12,59,25,60,18,15]),import.meta.url),()=>e(()=>import(`../nodes/27.BZljPb4_.js`),__vite__mapDeps([125,1,20,12,51,30,63,16,17,65,69,56]),import.meta.url),()=>e(()=>import(`../nodes/28.BUnWplt-.js`),__vite__mapDeps([126,1,50,12,73,63,16,17,65]),import.meta.url),()=>e(()=>import(`../nodes/29.DWokJWH0.js`),__vite__mapDeps([127,1,40,5,6,4,7,13,12,82,42,84,62,91,25,26,27,3,71,92,60,77,68,63,85,79,16,64,17,65,8,66,67,32,86]),import.meta.url),()=>e(()=>import(`../nodes/30.ForK2knd.js`),__vite__mapDeps([128,1,40,5,6,4,12,13,99,107,92,3,25,26,27,60,62,123,35,91,71,77,68,63,85,16,64,17,65,8,66,67,32,103,104,72,97,105,36,37]),import.meta.url),()=>e(()=>import(`../nodes/31.DEYw8Upz.js`),__vite__mapDeps([129,1,40,5,6,4,13,12,130,51,82,62,67,25,27,3,68,32,91,26,71,92,60,77,63,85,16,8,88,89]),import.meta.url),()=>e(()=>import(`../nodes/32.Bi8d2lf7.js`),__vite__mapDeps([131,1,40,5,6,4,13,12,117,54,67,25,27,3,68,32,63,85,16,8,88,89]),import.meta.url),()=>e(()=>import(`../nodes/33.CswdDR11.js`),__vite__mapDeps([132,1,12,62,63,16,64,17,65]),import.meta.url),()=>e(()=>import(`../nodes/34.DUW5te4K.js`),__vite__mapDeps([133,1,40,5,6,4,13,12,130,53,62,67,25,27,3,68,32,63,85,60,16,8,88,89]),import.meta.url),()=>e(()=>import(`../nodes/35.Dpj9Kp45.js`),__vite__mapDeps([134,1,40,5,6,4,7,13,12,26,25,27,3,99,52,62,74,71,75,33,76,77,78,67,68,32,59,95,31,63,85,79,60,16,64,17,65,8,18,15,88,89,37]),import.meta.url)],r=[0,2,5,6],i={"/":[-8],"/accept-invite":[-9],"/admin":[-10,[2],[3]],"/admin/audit":[-11,[2],[3]],"/admin/compute":[-12,[2],[3]],"/admin/organizations":[-13,[2],[3]],"/admin/projects":[-14,[2],[3]],"/admin/projects/[id]":[-15,[2],[3]],"/admin/system":[-16,[2],[3]],"/admin/users":[-17,[2],[3]],"/auth/email/sent":[17],"/auth/email/start":[-19],"/docs/api":[-20],"/library":[-21,[4]],"/library/[guid]":[-22,[4]],"/login":[-23],"/logout":[23],"/oauth/authorize":[-25],"/projects":[-26,[5]],"/setup":[-27],"/team":[-28,[6]],"/team/activity":[28,[6]],"/team/compute":[-30,[6]],"/team/members":[-31,[6]],"/team/projects":[-32,[6]],"/team/reclaim":[-33,[6]],"/team/settings":[-34,[6]],"/team/shares":[-35,[6]],"/team/tokens":[-36,[6]]},a={handleError:(({kind:e,error:t})=>{e===`unknown`&&console.error(t)}),reroute:(()=>{}),transport:{}},o=Object.fromEntries(Object.entries(a.transport).map(([e,t])=>[e,t.decode])),s=Object.fromEntries(Object.entries(a.transport).map(([e,t])=>[e,t.encode])),c=!1,l=(e,t)=>o[e](t),u=()=>e(()=>import(`../chunks/Bjy-W4x2.js`).then(e=>e.default),[],import.meta.url);export{l as decode,o as decoders,i as dictionary,s as encoders,u as get_error_template,c as hash,a as hooks,t as matchers,n as nodes,r as server_loads};
@@ -0,0 +1 @@
1
+ export{t as component}from"../chunks/BMp0Pt9F.js";
@@ -0,0 +1 @@
1
+ ��export{t as component}from"../chunks/BMp0Pt9F.js";
@@ -1 +1 @@
1
- {"version":"1795177396466"}
1
+ {"version":"1795190200646"}
Binary file
Binary file
@@ -1,3 +1,3 @@
1
1
  {
2
- "supabaseMigrationHead": "20261117200000"
2
+ "supabaseMigrationHead": "20261120150000"
3
3
  }
@@ -559,7 +559,7 @@
559
559
  "file": "chunks/compute.js",
560
560
  "name": "compute",
561
561
  "imports": [
562
- "_limits.js"
562
+ "_saved-values.js"
563
563
  ]
564
564
  },
565
565
  "_computeRateLimit.server.js": {
@@ -673,7 +673,7 @@
673
673
  "_server.js",
674
674
  "_previous-key.js",
675
675
  "_providers.server.js",
676
- "_limits.js",
676
+ "_saved-values.js",
677
677
  "_compute.js"
678
678
  ]
679
679
  },
@@ -681,6 +681,7 @@
681
681
  "file": "chunks/errors.js",
682
682
  "name": "errors",
683
683
  "imports": [
684
+ "_saved-values.js",
684
685
  "_schema.js",
685
686
  "_grasshopper.js"
686
687
  ]
@@ -901,13 +902,6 @@
901
902
  "_utils.js"
902
903
  ]
903
904
  },
904
- "_limits.js": {
905
- "file": "chunks/limits.js",
906
- "name": "limits",
907
- "imports": [
908
- "_access.js"
909
- ]
910
- },
911
905
  "_link-2.js": {
912
906
  "file": "chunks/link-2.js",
913
907
  "name": "link-2",
@@ -998,7 +992,7 @@
998
992
  "imports": [
999
993
  "_access.js",
1000
994
  "_context.js",
1001
- "_limits.js"
995
+ "_saved-values.js"
1002
996
  ]
1003
997
  },
1004
998
  "_origin.js": {
@@ -1073,7 +1067,7 @@
1073
1067
  "_schemas2.js",
1074
1068
  "_types3.js",
1075
1069
  "_logging.js",
1076
- "_limits.js"
1070
+ "_saved-values.js"
1077
1071
  ]
1078
1072
  },
1079
1073
  "_randomId.js": {
@@ -1159,6 +1153,13 @@
1159
1153
  "_access.js"
1160
1154
  ]
1161
1155
  },
1156
+ "_saved-values.js": {
1157
+ "file": "chunks/saved-values.js",
1158
+ "name": "saved-values",
1159
+ "imports": [
1160
+ "_access.js"
1161
+ ]
1162
+ },
1162
1163
  "_schema.js": {
1163
1164
  "file": "chunks/schema.js",
1164
1165
  "name": "schema"
@@ -3006,6 +3007,7 @@
3006
3007
  "_providers.server.js",
3007
3008
  "_api.js",
3008
3009
  "_logging.js",
3010
+ "_saved-values.js",
3009
3011
  "_schema.js",
3010
3012
  "_errors.js",
3011
3013
  "_access2.server.js",
@@ -1,2 +1,2 @@
1
- import "./limits.js";
1
+ import "./saved-values.js";
2
2
  export {};
@@ -1,7 +1,7 @@
1
1
  import { i as SolveEngine, n as DEFAULT_SOLVE_DEADLINE_MS } from "./server.js";
2
2
  import { n as env } from "./previous-key.js";
3
3
  import { D as computeDebugMode, f as getLogger, w as lazyLogger } from "./providers.server.js";
4
- import { r as resolveComputeLimits } from "./limits.js";
4
+ import { s as resolveComputeLimits } from "./saved-values.js";
5
5
  import "./compute.js";
6
6
  // src/lib/server/computeLimits.ts
7
7
  /**
@@ -1,32 +1,7 @@
1
+ import { n as savedValuesFrom, t as applySavedValues } from "./saved-values.js";
1
2
  import { t as UI_SCHEMA_VERSION } from "./schema.js";
2
3
  import { a as fetchParsedDefinitionIO, o as normalizeUISchemaCasing, s as readSchemaResults$1 } from "./grasshopper.js";
3
4
  import { createHash } from "node:crypto";
4
- // ../server/src/definitions/saved-values.ts
5
- function savedValuesFrom(inputs) {
6
- const values = /* @__PURE__ */ new Map();
7
- for (const input of inputs) {
8
- if (input.id === void 0 || input.default === void 0) continue;
9
- values.set(input.id, input.paramType === "Color" ? colorToHex(input.default) : input.default);
10
- }
11
- return values;
12
- }
13
- /** `schema` with each input's `default` replaced by its saved value, where it has one. */
14
- function applySavedValues(schema, values) {
15
- return {
16
- ...schema,
17
- inputs: schema.inputs.map((input) => values.has(input.id) ? {
18
- ...input,
19
- default: values.get(input.id)
20
- } : input)
21
- };
22
- }
23
- function colorToHex(value) {
24
- const parts = String(value).split(",").map((s) => parseInt(s.trim(), 10));
25
- const hex = (n) => n.toString(16).padStart(2, "0");
26
- if (parts.length === 3) return `#${hex(parts[0])}${hex(parts[1])}${hex(parts[2])}`;
27
- if (parts.length === 4) return `#${hex(parts[1])}${hex(parts[2])}${hex(parts[3])}`;
28
- return value;
29
- }
30
5
  // ../server/src/definitions/with-timeout.ts
31
6
  /**
32
7
  * Settles with `work`, or rejects with `onTimeout()` after `ms`. `work` is not cancelled: it runs
@@ -183,8 +158,8 @@ function isInventory(value) {
183
158
  /**
184
159
  * How long an upload waits for the saved values, counted from its start. Compute takes tens of
185
160
  * seconds to open a large file, and the whole request has to stay under the 60 s many proxies
186
- * allow. Missing them costs only the first render its defaults: the render path reads them
187
- * behind that render.
161
+ * allow. A read still running when the upload answers keeps going, and `savedValuesLater` stores
162
+ * its values on the version when it lands.
188
163
  */
189
164
  var SAVED_VALUES_WAIT_MS = 45e3;
190
165
  var SAVED_VALUES_TIMEOUT_MS = 12e4;
@@ -220,7 +195,9 @@ async function extractSchemaForUpload(definitionBytes, server) {
220
195
  return {
221
196
  schema: saved ? applySavedValues(schema, saved) : schema,
222
197
  inventory,
223
- defaultsPending: !saved
198
+ defaultsPending: !saved,
199
+ savedValues: saved,
200
+ savedValuesLater: values
224
201
  };
225
202
  }
226
203
  /**
@@ -270,6 +247,6 @@ var ComputeServerUnconfiguredError = class extends Error {
270
247
  this.name = "ComputeServerUnconfiguredError";
271
248
  }
272
249
  };
273
- export { extractSchemaForUpload as a, fetchScriptSources as c, withTimeout as d, applySavedValues as f, compareSchemaVersion as i, isOlderMinorSchemaVersion as l, SchemaExtractionError as n, fetchExtraction as o, savedValuesFrom as p, assertCamelCaseSchema as r, fetchSchemaFromCompute as s, ComputeServerUnconfiguredError as t, postSchemaFormData as u };
250
+ export { extractSchemaForUpload as a, fetchScriptSources as c, withTimeout as d, compareSchemaVersion as i, isOlderMinorSchemaVersion as l, SchemaExtractionError as n, fetchExtraction as o, assertCamelCaseSchema as r, fetchSchemaFromCompute as s, ComputeServerUnconfiguredError as t, postSchemaFormData as u };
274
251
 
275
252
  //# sourceMappingURL=errors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","names":["readWrapper"],"sources":["../../../../server/src/definitions/saved-values.ts","../../../../server/src/definitions/with-timeout.ts","../../../../server/src/definitions/schema-extraction.ts","../../../../server/src/compute/errors.ts"],"sourcesContent":["// The embedded schema carries input values from the author's last schema sync. Compute's `/io`\n// reads the values saved in the file, which can be newer, and those are what a form must start\n// from. A version's bytes never change, so neither do its saved values.\n\nimport type { UISchema } from '@selvajs/schemas';\n\n/** Each input's saved value, keyed by param id. */\nexport type SavedValues = ReadonlyMap<string, unknown>;\n\nexport function savedValuesFrom(\n\tinputs: ReadonlyArray<{ id?: string; paramType?: string; default?: unknown }>\n): SavedValues {\n\tconst values = new Map<string, unknown>();\n\tfor (const input of inputs) {\n\t\tif (input.id === undefined || input.default === undefined) continue;\n\t\tvalues.set(input.id, input.paramType === 'Color' ? colorToHex(input.default) : input.default);\n\t}\n\treturn values;\n}\n\n/** `schema` with each input's `default` replaced by its saved value, where it has one. */\nexport function applySavedValues(schema: UISchema, values: SavedValues): UISchema {\n\treturn {\n\t\t...schema,\n\t\tinputs: schema.inputs.map((input) =>\n\t\t\tvalues.has(input.id) ? { ...input, default: values.get(input.id) } : input\n\t\t)\n\t};\n}\n\n// Compute sends colors as \"r,g,b\" or \"a,r,g,b\"; the color picker takes hex.\nfunction colorToHex(value: unknown): unknown {\n\tconst parts = String(value)\n\t\t.split(',')\n\t\t.map((s) => parseInt(s.trim(), 10));\n\tconst hex = (n: number) => n.toString(16).padStart(2, '0');\n\tif (parts.length === 3) return `#${hex(parts[0])}${hex(parts[1])}${hex(parts[2])}`;\n\tif (parts.length === 4) return `#${hex(parts[1])}${hex(parts[2])}${hex(parts[3])}`;\n\treturn value;\n}\n","/**\n * Settles with `work`, or rejects with `onTimeout()` after `ms`. `work` is not cancelled: it runs\n * on, and its later rejection stays handled.\n */\nexport function withTimeout<T>(work: Promise<T>, ms: number, onTimeout: () => Error): Promise<T> {\n\tlet timer: ReturnType<typeof setTimeout> | undefined;\n\tconst timeout = new Promise<never>((_, reject) => {\n\t\ttimer = setTimeout(() => reject(onTimeout()), ms);\n\t});\n\treturn Promise.race([work, timeout]).finally(() => clearTimeout(timer));\n}\n","// Extraction IS validation: a `.gh` with no valid \"Schema\" output, or an\n// unreachable compute server, throws here — which is what makes this the upload\n// gate as well as the render path's fallback for un-cached or stale versions.\n\nimport { createHash } from 'node:crypto';\nimport {\n\tfetchParsedDefinitionIO,\n\tnormalizeUISchemaCasing,\n\treadSchemaResults as readWrapper,\n\ttype SchemaEndpointResult\n} from '@selvajs/compute/grasshopper';\nimport {\n\tUI_SCHEMA_VERSION,\n\ttype DocumentInventory,\n\ttype ScriptSource,\n\ttype UISchema\n} from '@selvajs/schemas';\nimport type { ComputeServerConfig } from '@selvajs/platform';\nimport { applySavedValues, savedValuesFrom, type SavedValues } from './saved-values.js';\nimport { withTimeout } from './with-timeout.js';\n\n/** One entry of the compute schema endpoint's response, typed to our `UISchema`. */\nexport type SchemaExtractionResult = SchemaEndpointResult<UISchema>;\n\n/** Thin re-export of @selvajs/compute's unwrap, typed to `UISchema`. */\nexport function readSchemaResults(raw: unknown): SchemaExtractionResult[] {\n\treturn readWrapper<UISchema>(raw);\n}\n\n/** Thrown when compute is reachable but the definition yields no usable schema. */\nexport class SchemaExtractionError extends Error {\n\tconstructor(\n\t\tpublic readonly kind: 'unreachable' | 'invalid' | 'unsupported' | 'malformed',\n\t\tmessage: string\n\t) {\n\t\tsuper(message);\n\t\tthis.name = 'SchemaExtractionError';\n\t}\n}\n\n/**\n * Rejects a schema whose keys are not camelCase by the time it reaches a consumer.\n *\n * Compute serializes the plugin's `UISchema` POCO, whose camelCase names live in\n * `[JsonProperty]` attributes. `Selva.gha` ILRepack-merges Newtonsoft, so those\n * attributes have type `Selva!Newtonsoft.Json.JsonPropertyAttribute`; a compute\n * server serializing with its OWN Newtonsoft does not recognize them, reads no\n * attributes, and falls back to raw CLR member names — `Inputs`, `Layout`.\n * Nothing throws on the wire: every consumer just reads `schema.inputs` as\n * undefined and renders a definition with no inputs.\n *\n * `postSchemaFormData` repairs that casing via `normalizeUISchemaCasing`, so a\n * schema fresh off the wire never trips this. It stays because schemas are also\n * PERSISTED: a row cached before the normalizer existed still holds PascalCase,\n * and it reaches consumers without passing through `postSchemaFormData` again.\n * A schema with no `inputs` in any casing lands here too. It is a backstop, not\n * the primary defense — which is why it names the missing key rather than telling\n * the operator to go update their compute server.\n *\n * Checked structurally rather than by plugin version, because the casing depends\n * on which assembly serialized the schema, not on any version number.\n */\nexport function assertCamelCaseSchema(schema: UISchema): void {\n\tconst raw = schema as unknown as Record<string, unknown>;\n\tif (Array.isArray(raw.inputs)) return;\n\n\tconst pascalKeys = ['Inputs', 'Outputs', 'Layout', 'SchemaVersion'].filter((k) => k in raw);\n\tif (pascalKeys.length > 0) {\n\t\tthrow new SchemaExtractionError(\n\t\t\t'malformed',\n\t\t\t`Schema keys are PascalCase (found ${pascalKeys.join(', ')}), so every property name ` +\n\t\t\t\t`is wrong and the definition would render with no inputs. Compute serialized it with ` +\n\t\t\t\t`its own Newtonsoft instead of the one merged into Selva.gha. Fresh responses are ` +\n\t\t\t\t`normalized, so this is most likely a schema cached before that fix — re-save the ` +\n\t\t\t\t`definition version to re-extract it.`\n\t\t);\n\t}\n\n\tthrow new SchemaExtractionError(\n\t\t'malformed',\n\t\t`Compute returned a schema with no 'inputs' array (got keys: ${Object.keys(raw)\n\t\t\t.slice(0, 12)\n\t\t\t.join(', ')}).`\n\t);\n}\n\nfunction parseSemver(version: string): [number, number, number] | null {\n\tconst m = /^(\\d+)\\.(\\d+)\\.(\\d+)$/.exec(version);\n\treturn m ? [Number(m[1]), Number(m[2]), Number(m[3])] : null;\n}\n\n/**\n * Orders a schema format version against the app's `UI_SCHEMA_VERSION`: -1 older, 0 current,\n * 1 newer, null unparseable. A missing version is older: plugins before 2.12.0 emitted none.\n */\nexport function compareSchemaVersion(version: string | undefined): -1 | 0 | 1 | null {\n\tif (!version) return -1;\n\tconst extracted = parseSemver(version);\n\tconst supported = parseSemver(UI_SCHEMA_VERSION);\n\tif (!extracted || !supported) return null;\n\tfor (let i = 0; i < 3; i++) {\n\t\tif (extracted[i] !== supported[i]) return extracted[i] < supported[i] ? -1 : 1;\n\t}\n\treturn 0;\n}\n\n/** An older minor or patch of the app's own major: a minor bump only adds optional constructs. */\nexport function isOlderMinorSchemaVersion(version: string | undefined): boolean {\n\tconst extracted = version ? parseSemver(version) : null;\n\tconst supported = parseSemver(UI_SCHEMA_VERSION);\n\tif (!extracted || !supported || extracted[0] !== supported[0]) return false;\n\treturn compareSchemaVersion(version) === -1;\n}\n\n/**\n * Rejects a schema from a NEWER plugin than this app was built against — its\n * shape may contain constructs the renderer doesn't know. Older (or missing)\n * versions pass: the compute-side C# migrator always emits its own current\n * version, and an older shape only lacks optional additions.\n */\nexport function assertSupportedSchemaVersion(schema: UISchema): void {\n\tif (compareSchemaVersion(schema.schemaVersion) === 1) {\n\t\tthrow new SchemaExtractionError(\n\t\t\t'unsupported',\n\t\t\t`This definition was authored with a newer Selva plugin (schema format ${schema.schemaVersion}); ` +\n\t\t\t\t`this server supports schema format ≤ ${UI_SCHEMA_VERSION}. Update the server, or ` +\n\t\t\t\t`re-save the definition with a matching plugin version.`\n\t\t);\n\t}\n}\n\n/**\n * POSTs a multipart form to Rhino Compute's `/grasshopper/schema` endpoint (no\n * solve required). Throws 'unreachable' on a network failure or non-2xx. The\n * per-file `error` Compute reports on its 200-with-no-schemas case is left to\n * the caller — single-file and multi-file callers want different messages.\n */\nexport async function postSchemaFormData(\n\tformData: FormData,\n\tserver: ComputeServerConfig\n): Promise<SchemaExtractionResult[]> {\n\tconst schemaUrl = new URL('/grasshopper/schema', server.serverUrl).toString();\n\n\tconst headers: Record<string, string> = {};\n\tif (server.apiKey) {\n\t\theaders['RhinoComputeKey'] = server.apiKey;\n\t}\n\n\tlet response: Response;\n\ttry {\n\t\tresponse = await fetch(schemaUrl, { method: 'POST', headers, body: formData });\n\t} catch (err) {\n\t\tthrow new SchemaExtractionError(\n\t\t\t'unreachable',\n\t\t\t`Compute server is unreachable: ${err instanceof Error ? err.message : String(err)}`\n\t\t);\n\t}\n\n\tif (!response.ok) {\n\t\tthrow new SchemaExtractionError(\n\t\t\t'unreachable',\n\t\t\t`Schema endpoint returned ${response.status}: ${response.statusText}`\n\t\t);\n\t}\n\n\t// Normalize here rather than in each caller: the upload/validation route reads\n\t// `postSchemaFormData` directly, so a fix applied only inside\n\t// `fetchSchemaFromCompute` would leave that path serving PascalCase schemas.\n\tconst results = readSchemaResults(await response.json());\n\treturn results.map((result) => ({\n\t\t...result,\n\t\tschemas: result.schemas?.map((schema) => normalizeUISchemaCasing(schema))\n\t}));\n}\n\n/**\n * Throws `SchemaExtractionError` so callers can map to the right HTTP status:\n * 503 unreachable / 422 invalid or unsupported.\n */\nexport async function fetchSchemaFromCompute(\n\tdefinitionBytes: Uint8Array,\n\tserver: ComputeServerConfig\n): Promise<UISchema> {\n\treturn (await fetchExtraction(definitionBytes, server)).schema;\n}\n\n/** A file's schema and, from a plugin that builds one, its inventory. */\nexport interface Extraction {\n\tschema: UISchema;\n\tinventory: DocumentInventory | null;\n}\n\n/** `fetchSchemaFromCompute` with the inventory Compute returns beside the schema. */\nexport async function fetchExtraction(\n\tdefinitionBytes: Uint8Array,\n\tserver: ComputeServerConfig\n): Promise<Extraction> {\n\tconst formData = new FormData();\n\tconst blob = new Blob([new Uint8Array(definitionBytes)], { type: 'application/octet-stream' });\n\tformData.append('file', blob, 'definition.gh');\n\n\tconst results = await postSchemaFormData(formData, server);\n\tconst schemas = results.flatMap((r) => r.schemas ?? []);\n\n\tif (schemas.length === 0) {\n\t\t// Compute answers 200 while reporting a per-file `error`, so the\n\t\t// !response.ok guard never fires for it. Surface that message verbatim: it\n\t\t// names the actual cause (bad Schema source, no embedded schema, ...),\n\t\t// which the generic fallback below cannot.\n\t\tconst diagnosis = results.map((r) => r.error).filter(Boolean);\n\t\tif (diagnosis.length > 0) {\n\t\t\tthrow new SchemaExtractionError('invalid', diagnosis.join('\\n'));\n\t\t}\n\n\t\tthrow new SchemaExtractionError(\n\t\t\t'invalid',\n\t\t\t'No schemas found in definition.\\n\\n' +\n\t\t\t\t'In Grasshopper, verify a Context Bake component with the output name \"Schema\" is present and wired to the solver.'\n\t\t);\n\t}\n\n\tassertSupportedSchemaVersion(schemas[0]);\n\tassertCamelCaseSchema(schemas[0]);\n\tconst inventory = results.find((r) => r.schemas?.length)?.inventory;\n\treturn { schema: schemas[0], inventory: isInventory(inventory) ? inventory : null };\n}\n\n// Shape check only: the plugin built it from the same wire schema. A malformed one is dropped, not\n// fatal, because the schema alone still gates the upload.\nfunction isInventory(value: unknown): value is DocumentInventory {\n\tconst v = value as Partial<DocumentInventory> | null;\n\treturn (\n\t\t!!v &&\n\t\ttypeof v === 'object' &&\n\t\tArray.isArray(v.libraries) &&\n\t\tArray.isArray(v.components) &&\n\t\tArray.isArray(v.values) &&\n\t\tArray.isArray(v.scripts) &&\n\t\ttypeof v.wires?.count === 'number'\n\t);\n}\n\n/**\n * How long an upload waits for the saved values, counted from its start. Compute takes tens of\n * seconds to open a large file, and the whole request has to stay under the 60 s many proxies\n * allow. Missing them costs only the first render its defaults: the render path reads them\n * behind that render.\n */\nconst SAVED_VALUES_WAIT_MS = 45_000;\n\n// Bounds the `/io` request itself, which outlives an upload that stopped waiting for it.\nconst SAVED_VALUES_TIMEOUT_MS = 120_000;\n\n// A check and the upload that follows send the same bytes, so they share one `/io` read: a file\n// too slow for the check's wait is read by the time the upload asks. Keyed by server and content.\nconst savedValueReads = new Map<string, Promise<SavedValues>>();\nconst SAVED_VALUE_READS_MAX = 32;\n\nfunction readSavedValues(\n\tdefinitionBytes: Uint8Array,\n\tserver: ComputeServerConfig\n): Promise<SavedValues> {\n\tconst digest = createHash('sha256').update(definitionBytes).digest('hex');\n\tconst key = `${server.serverUrl}\\n${digest}`;\n\tconst running = savedValueReads.get(key);\n\tif (running) return running;\n\n\tconst read = fetchParsedDefinitionIO(definitionBytes, {\n\t\tserverUrl: server.serverUrl,\n\t\t...(server.apiKey && { apiKey: server.apiKey }),\n\t\ttimeoutMs: SAVED_VALUES_TIMEOUT_MS\n\t}).then((io) => savedValuesFrom(io.inputs));\n\t// A failed read is forgotten, so the next upload of the file asks again.\n\tread.catch(() => {\n\t\tif (savedValueReads.get(key) === read) savedValueReads.delete(key);\n\t});\n\tif (savedValueReads.size >= SAVED_VALUE_READS_MAX)\n\t\tsavedValueReads.delete(savedValueReads.keys().next().value!);\n\tsavedValueReads.set(key, read);\n\treturn read;\n}\n\nexport interface UploadExtraction extends Extraction {\n\t/** The saved values were not read, so `schema` carries the embedded defaults instead. */\n\tdefaultsPending: boolean;\n}\n\n/**\n * `fetchSchemaFromCompute` with the values saved in the file as input defaults, so the stored\n * schema renders without asking Compute again. The values are read beside the schema,\n * best-effort: only the schema gates the upload.\n */\nexport async function extractSchemaForUpload(\n\tdefinitionBytes: Uint8Array,\n\tserver: ComputeServerConfig\n): Promise<UploadExtraction> {\n\tconst startedAt = Date.now();\n\tconst values = readSavedValues(definitionBytes, server);\n\n\tconst { schema, inventory } = await fetchExtraction(definitionBytes, server);\n\tconst saved = await withTimeout(\n\t\tvalues,\n\t\tMath.max(0, SAVED_VALUES_WAIT_MS - (Date.now() - startedAt)),\n\t\t() => new Error('saved values not read in time')\n\t).catch(() => null);\n\treturn {\n\t\tschema: saved ? applySavedValues(schema, saved) : schema,\n\t\tinventory,\n\t\tdefaultsPending: !saved\n\t};\n}\n\n/**\n * The source of the named script components, read by Compute from a stored file. The inventory\n * keeps fingerprints only, so this is how a code diff gets the code. Throws 'unsupported' when the\n * server's plugin cannot read scripts.\n */\nexport async function fetchScriptSources(\n\tdefinitionBytes: Uint8Array,\n\tids: readonly string[],\n\tserver: ComputeServerConfig\n): Promise<ScriptSource[]> {\n\tconst form = new FormData();\n\tform.append('file', new Blob([new Uint8Array(definitionBytes)]), 'definition.gh');\n\tform.append('ids', ids.join(','));\n\tconst headers: Record<string, string> = {};\n\tif (server.apiKey) headers['RhinoComputeKey'] = server.apiKey;\n\n\tlet response: Response;\n\ttry {\n\t\tresponse = await fetch(new URL('/grasshopper/scripts', server.serverUrl), {\n\t\t\tmethod: 'POST',\n\t\t\theaders,\n\t\t\tbody: form\n\t\t});\n\t} catch (err) {\n\t\tthrow new SchemaExtractionError(\n\t\t\t'unreachable',\n\t\t\t`Compute server is unreachable: ${err instanceof Error ? err.message : String(err)}`\n\t\t);\n\t}\n\t// A server without the endpoint answers 404; one whose plugin predates it, 422.\n\tif (response.status === 404 || response.status === 422) {\n\t\tthrow new SchemaExtractionError(\n\t\t\t'unsupported',\n\t\t\t'This Compute server cannot read script source. Update the server and its Selva plugin.'\n\t\t);\n\t}\n\tif (!response.ok) {\n\t\tthrow new SchemaExtractionError(\n\t\t\t'unreachable',\n\t\t\t`Scripts endpoint returned ${response.status}: ${response.statusText}`\n\t\t);\n\t}\n\tconst body = (await response.json()) as ScriptSource[];\n\treturn Array.isArray(body) ? body : [];\n}\n","/**\n * Compute error types, kept in a leaf module with no imports.\n *\n * Separate from the function that throws them on purpose: an error mapper needs\n * nothing but the class to `instanceof` against, and importing it from beside\n * the throw site drags that module's dependencies into every mapper. Anything\n * an error mapper imports belongs here.\n */\n\n/**\n * Thrown when no compute server is configured or visible for the org — a\n * misconfiguration an operator must fix in `/admin/compute`, not a bug. Routes\n * map this to 503 instead of letting the pure helper's plain `Error` surface as\n * a generic 500.\n */\nexport class ComputeServerUnconfiguredError extends Error {\n\tconstructor(\n\t\tmessage = 'No compute server configured. Ask an admin to add one in /admin/compute.'\n\t) {\n\t\tsuper(message);\n\t\tthis.name = 'ComputeServerUnconfiguredError';\n\t}\n}\n"],"mappings":";;;;AASA,SAAgB,gBACf,QACc;CACd,MAAM,yBAAS,IAAI,IAAqB;CACxC,KAAK,MAAM,SAAS,QAAQ;EAC3B,IAAI,MAAM,OAAO,KAAA,KAAa,MAAM,YAAY,KAAA,GAAW;EAC3D,OAAO,IAAI,MAAM,IAAI,MAAM,cAAc,UAAU,WAAW,MAAM,OAAO,IAAI,MAAM,OAAO;CAC7F;CACA,OAAO;AACR;;AAGA,SAAgB,iBAAiB,QAAkB,QAA+B;CACjF,OAAO;EACN,GAAG;EACH,QAAQ,OAAO,OAAO,KAAK,UAC1B,OAAO,IAAI,MAAM,EAAE,IAAI;GAAE,GAAG;GAAO,SAAS,OAAO,IAAI,MAAM,EAAE;EAAE,IAAI,KACtE;CACD;AACD;AAGA,SAAS,WAAW,OAAyB;CAC5C,MAAM,QAAQ,OAAO,KAAK,CAAC,CACzB,MAAM,GAAG,CAAC,CACV,KAAK,MAAM,SAAS,EAAE,KAAK,GAAG,EAAE,CAAC;CACnC,MAAM,OAAO,MAAc,EAAE,SAAS,EAAE,CAAC,CAAC,SAAS,GAAG,GAAG;CACzD,IAAI,MAAM,WAAW,GAAG,OAAO,IAAI,IAAI,MAAM,EAAE,IAAI,IAAI,MAAM,EAAE,IAAI,IAAI,MAAM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C;CAChC,MAAM,UAAkC,CAAC;CACzC,IAAI,OAAO,QAAQ,QAAQ,qBAAqB,OAAO;CAEvD,IAAI;CACJ,IAAI;EACH,WAAW,MAAM,MAAM,IAAI,IAAI,wBAAwB,OAAO,SAAS,GAAG;GACzE,QAAQ;GACR;GACA,MAAM;EACP,CAAC;CACF,SAAS,KAAK;EACb,MAAM,IAAI,sBACT,eACA,kCAAkC,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG,GAClF;CACD;CAEA,IAAI,SAAS,WAAW,OAAO,SAAS,WAAW,KAClD,MAAM,IAAI,sBACT,eACA,wFACD;CAED,IAAI,CAAC,SAAS,IACb,MAAM,IAAI,sBACT,eACA,6BAA6B,SAAS,OAAO,IAAI,SAAS,YAC3D;CAED,MAAM,OAAQ,MAAM,SAAS,KAAK;CAClC,OAAO,MAAM,QAAQ,IAAI,IAAI,OAAO,CAAC;AACtC;;;;;;;;;;;;;;;;ACrVA,IAAa,iCAAb,cAAoD,MAAM;CACzD,YACC,UAAU,4EACT;EACD,MAAM,OAAO;EACb,KAAK,OAAO;CACb;AACD"}
1
+ {"version":3,"file":"errors.js","names":["readWrapper"],"sources":["../../../../server/src/definitions/with-timeout.ts","../../../../server/src/definitions/schema-extraction.ts","../../../../server/src/compute/errors.ts"],"sourcesContent":["/**\n * Settles with `work`, or rejects with `onTimeout()` after `ms`. `work` is not cancelled: it runs\n * on, and its later rejection stays handled.\n */\nexport function withTimeout<T>(work: Promise<T>, ms: number, onTimeout: () => Error): Promise<T> {\n\tlet timer: ReturnType<typeof setTimeout> | undefined;\n\tconst timeout = new Promise<never>((_, reject) => {\n\t\ttimer = setTimeout(() => reject(onTimeout()), ms);\n\t});\n\treturn Promise.race([work, timeout]).finally(() => clearTimeout(timer));\n}\n","// Extraction IS validation: a `.gh` with no valid \"Schema\" output, or an\n// unreachable compute server, throws here — which is what makes this the upload\n// gate as well as the render path's fallback for un-cached or stale versions.\n\nimport { createHash } from 'node:crypto';\nimport {\n\tfetchParsedDefinitionIO,\n\tnormalizeUISchemaCasing,\n\treadSchemaResults as readWrapper,\n\ttype SchemaEndpointResult\n} from '@selvajs/compute/grasshopper';\nimport {\n\tUI_SCHEMA_VERSION,\n\ttype DocumentInventory,\n\ttype ScriptSource,\n\ttype UISchema\n} from '@selvajs/schemas';\nimport type { ComputeServerConfig } from '@selvajs/platform';\nimport { applySavedValues, savedValuesFrom, type SavedValues } from './saved-values.js';\nimport { withTimeout } from './with-timeout.js';\n\n/** One entry of the compute schema endpoint's response, typed to our `UISchema`. */\nexport type SchemaExtractionResult = SchemaEndpointResult<UISchema>;\n\n/** Thin re-export of @selvajs/compute's unwrap, typed to `UISchema`. */\nexport function readSchemaResults(raw: unknown): SchemaExtractionResult[] {\n\treturn readWrapper<UISchema>(raw);\n}\n\n/** Thrown when compute is reachable but the definition yields no usable schema. */\nexport class SchemaExtractionError extends Error {\n\tconstructor(\n\t\tpublic readonly kind: 'unreachable' | 'invalid' | 'unsupported' | 'malformed',\n\t\tmessage: string\n\t) {\n\t\tsuper(message);\n\t\tthis.name = 'SchemaExtractionError';\n\t}\n}\n\n/**\n * Rejects a schema whose keys are not camelCase by the time it reaches a consumer.\n *\n * Compute serializes the plugin's `UISchema` POCO, whose camelCase names live in\n * `[JsonProperty]` attributes. `Selva.gha` ILRepack-merges Newtonsoft, so those\n * attributes have type `Selva!Newtonsoft.Json.JsonPropertyAttribute`; a compute\n * server serializing with its OWN Newtonsoft does not recognize them, reads no\n * attributes, and falls back to raw CLR member names — `Inputs`, `Layout`.\n * Nothing throws on the wire: every consumer just reads `schema.inputs` as\n * undefined and renders a definition with no inputs.\n *\n * `postSchemaFormData` repairs that casing via `normalizeUISchemaCasing`, so a\n * schema fresh off the wire never trips this. It stays because schemas are also\n * PERSISTED: a row cached before the normalizer existed still holds PascalCase,\n * and it reaches consumers without passing through `postSchemaFormData` again.\n * A schema with no `inputs` in any casing lands here too. It is a backstop, not\n * the primary defense — which is why it names the missing key rather than telling\n * the operator to go update their compute server.\n *\n * Checked structurally rather than by plugin version, because the casing depends\n * on which assembly serialized the schema, not on any version number.\n */\nexport function assertCamelCaseSchema(schema: UISchema): void {\n\tconst raw = schema as unknown as Record<string, unknown>;\n\tif (Array.isArray(raw.inputs)) return;\n\n\tconst pascalKeys = ['Inputs', 'Outputs', 'Layout', 'SchemaVersion'].filter((k) => k in raw);\n\tif (pascalKeys.length > 0) {\n\t\tthrow new SchemaExtractionError(\n\t\t\t'malformed',\n\t\t\t`Schema keys are PascalCase (found ${pascalKeys.join(', ')}), so every property name ` +\n\t\t\t\t`is wrong and the definition would render with no inputs. Compute serialized it with ` +\n\t\t\t\t`its own Newtonsoft instead of the one merged into Selva.gha. Fresh responses are ` +\n\t\t\t\t`normalized, so this is most likely a schema cached before that fix — re-save the ` +\n\t\t\t\t`definition version to re-extract it.`\n\t\t);\n\t}\n\n\tthrow new SchemaExtractionError(\n\t\t'malformed',\n\t\t`Compute returned a schema with no 'inputs' array (got keys: ${Object.keys(raw)\n\t\t\t.slice(0, 12)\n\t\t\t.join(', ')}).`\n\t);\n}\n\nfunction parseSemver(version: string): [number, number, number] | null {\n\tconst m = /^(\\d+)\\.(\\d+)\\.(\\d+)$/.exec(version);\n\treturn m ? [Number(m[1]), Number(m[2]), Number(m[3])] : null;\n}\n\n/**\n * Orders a schema format version against the app's `UI_SCHEMA_VERSION`: -1 older, 0 current,\n * 1 newer, null unparseable. A missing version is older: plugins before 2.12.0 emitted none.\n */\nexport function compareSchemaVersion(version: string | undefined): -1 | 0 | 1 | null {\n\tif (!version) return -1;\n\tconst extracted = parseSemver(version);\n\tconst supported = parseSemver(UI_SCHEMA_VERSION);\n\tif (!extracted || !supported) return null;\n\tfor (let i = 0; i < 3; i++) {\n\t\tif (extracted[i] !== supported[i]) return extracted[i] < supported[i] ? -1 : 1;\n\t}\n\treturn 0;\n}\n\n/** An older minor or patch of the app's own major: a minor bump only adds optional constructs. */\nexport function isOlderMinorSchemaVersion(version: string | undefined): boolean {\n\tconst extracted = version ? parseSemver(version) : null;\n\tconst supported = parseSemver(UI_SCHEMA_VERSION);\n\tif (!extracted || !supported || extracted[0] !== supported[0]) return false;\n\treturn compareSchemaVersion(version) === -1;\n}\n\n/**\n * Rejects a schema from a NEWER plugin than this app was built against — its\n * shape may contain constructs the renderer doesn't know. Older (or missing)\n * versions pass: the compute-side C# migrator always emits its own current\n * version, and an older shape only lacks optional additions.\n */\nexport function assertSupportedSchemaVersion(schema: UISchema): void {\n\tif (compareSchemaVersion(schema.schemaVersion) === 1) {\n\t\tthrow new SchemaExtractionError(\n\t\t\t'unsupported',\n\t\t\t`This definition was authored with a newer Selva plugin (schema format ${schema.schemaVersion}); ` +\n\t\t\t\t`this server supports schema format ≤ ${UI_SCHEMA_VERSION}. Update the server, or ` +\n\t\t\t\t`re-save the definition with a matching plugin version.`\n\t\t);\n\t}\n}\n\n/**\n * POSTs a multipart form to Rhino Compute's `/grasshopper/schema` endpoint (no\n * solve required). Throws 'unreachable' on a network failure or non-2xx. The\n * per-file `error` Compute reports on its 200-with-no-schemas case is left to\n * the caller — single-file and multi-file callers want different messages.\n */\nexport async function postSchemaFormData(\n\tformData: FormData,\n\tserver: ComputeServerConfig\n): Promise<SchemaExtractionResult[]> {\n\tconst schemaUrl = new URL('/grasshopper/schema', server.serverUrl).toString();\n\n\tconst headers: Record<string, string> = {};\n\tif (server.apiKey) {\n\t\theaders['RhinoComputeKey'] = server.apiKey;\n\t}\n\n\tlet response: Response;\n\ttry {\n\t\tresponse = await fetch(schemaUrl, { method: 'POST', headers, body: formData });\n\t} catch (err) {\n\t\tthrow new SchemaExtractionError(\n\t\t\t'unreachable',\n\t\t\t`Compute server is unreachable: ${err instanceof Error ? err.message : String(err)}`\n\t\t);\n\t}\n\n\tif (!response.ok) {\n\t\tthrow new SchemaExtractionError(\n\t\t\t'unreachable',\n\t\t\t`Schema endpoint returned ${response.status}: ${response.statusText}`\n\t\t);\n\t}\n\n\t// Normalize here rather than in each caller: the upload/validation route reads\n\t// `postSchemaFormData` directly, so a fix applied only inside\n\t// `fetchSchemaFromCompute` would leave that path serving PascalCase schemas.\n\tconst results = readSchemaResults(await response.json());\n\treturn results.map((result) => ({\n\t\t...result,\n\t\tschemas: result.schemas?.map((schema) => normalizeUISchemaCasing(schema))\n\t}));\n}\n\n/**\n * Throws `SchemaExtractionError` so callers can map to the right HTTP status:\n * 503 unreachable / 422 invalid or unsupported.\n */\nexport async function fetchSchemaFromCompute(\n\tdefinitionBytes: Uint8Array,\n\tserver: ComputeServerConfig\n): Promise<UISchema> {\n\treturn (await fetchExtraction(definitionBytes, server)).schema;\n}\n\n/** A file's schema and, from a plugin that builds one, its inventory. */\nexport interface Extraction {\n\tschema: UISchema;\n\tinventory: DocumentInventory | null;\n}\n\n/** `fetchSchemaFromCompute` with the inventory Compute returns beside the schema. */\nexport async function fetchExtraction(\n\tdefinitionBytes: Uint8Array,\n\tserver: ComputeServerConfig\n): Promise<Extraction> {\n\tconst formData = new FormData();\n\tconst blob = new Blob([new Uint8Array(definitionBytes)], { type: 'application/octet-stream' });\n\tformData.append('file', blob, 'definition.gh');\n\n\tconst results = await postSchemaFormData(formData, server);\n\tconst schemas = results.flatMap((r) => r.schemas ?? []);\n\n\tif (schemas.length === 0) {\n\t\t// Compute answers 200 while reporting a per-file `error`, so the\n\t\t// !response.ok guard never fires for it. Surface that message verbatim: it\n\t\t// names the actual cause (bad Schema source, no embedded schema, ...),\n\t\t// which the generic fallback below cannot.\n\t\tconst diagnosis = results.map((r) => r.error).filter(Boolean);\n\t\tif (diagnosis.length > 0) {\n\t\t\tthrow new SchemaExtractionError('invalid', diagnosis.join('\\n'));\n\t\t}\n\n\t\tthrow new SchemaExtractionError(\n\t\t\t'invalid',\n\t\t\t'No schemas found in definition.\\n\\n' +\n\t\t\t\t'In Grasshopper, verify a Context Bake component with the output name \"Schema\" is present and wired to the solver.'\n\t\t);\n\t}\n\n\tassertSupportedSchemaVersion(schemas[0]);\n\tassertCamelCaseSchema(schemas[0]);\n\tconst inventory = results.find((r) => r.schemas?.length)?.inventory;\n\treturn { schema: schemas[0], inventory: isInventory(inventory) ? inventory : null };\n}\n\n// Shape check only: the plugin built it from the same wire schema. A malformed one is dropped, not\n// fatal, because the schema alone still gates the upload.\nfunction isInventory(value: unknown): value is DocumentInventory {\n\tconst v = value as Partial<DocumentInventory> | null;\n\treturn (\n\t\t!!v &&\n\t\ttypeof v === 'object' &&\n\t\tArray.isArray(v.libraries) &&\n\t\tArray.isArray(v.components) &&\n\t\tArray.isArray(v.values) &&\n\t\tArray.isArray(v.scripts) &&\n\t\ttypeof v.wires?.count === 'number'\n\t);\n}\n\n/**\n * How long an upload waits for the saved values, counted from its start. Compute takes tens of\n * seconds to open a large file, and the whole request has to stay under the 60 s many proxies\n * allow. A read still running when the upload answers keeps going, and `savedValuesLater` stores\n * its values on the version when it lands.\n */\nconst SAVED_VALUES_WAIT_MS = 45_000;\n\n// Bounds the `/io` request itself, which outlives an upload that stopped waiting for it.\nconst SAVED_VALUES_TIMEOUT_MS = 120_000;\n\n// A check and the upload that follows send the same bytes, so they share one `/io` read: a file\n// too slow for the check's wait is read by the time the upload asks. Keyed by server and content.\nconst savedValueReads = new Map<string, Promise<SavedValues>>();\nconst SAVED_VALUE_READS_MAX = 32;\n\nfunction readSavedValues(\n\tdefinitionBytes: Uint8Array,\n\tserver: ComputeServerConfig\n): Promise<SavedValues> {\n\tconst digest = createHash('sha256').update(definitionBytes).digest('hex');\n\tconst key = `${server.serverUrl}\\n${digest}`;\n\tconst running = savedValueReads.get(key);\n\tif (running) return running;\n\n\tconst read = fetchParsedDefinitionIO(definitionBytes, {\n\t\tserverUrl: server.serverUrl,\n\t\t...(server.apiKey && { apiKey: server.apiKey }),\n\t\ttimeoutMs: SAVED_VALUES_TIMEOUT_MS\n\t}).then((io) => savedValuesFrom(io.inputs));\n\t// A failed read is forgotten, so the next upload of the file asks again.\n\tread.catch(() => {\n\t\tif (savedValueReads.get(key) === read) savedValueReads.delete(key);\n\t});\n\tif (savedValueReads.size >= SAVED_VALUE_READS_MAX)\n\t\tsavedValueReads.delete(savedValueReads.keys().next().value!);\n\tsavedValueReads.set(key, read);\n\treturn read;\n}\n\nexport interface UploadExtraction extends Extraction {\n\t/** The saved values were not read, so `schema` carries the embedded defaults instead. */\n\tdefaultsPending: boolean;\n\t/** The values saved in the file, to store on the version. Null while `defaultsPending`. */\n\tsavedValues: SavedValues | null;\n\t/** The read still running when `defaultsPending`, to store its values once it lands. */\n\tsavedValuesLater: Promise<SavedValues>;\n}\n\n/**\n * `fetchSchemaFromCompute` with the values saved in the file as input defaults, so the stored\n * schema renders without asking Compute again. The values are read beside the schema,\n * best-effort: only the schema gates the upload.\n */\nexport async function extractSchemaForUpload(\n\tdefinitionBytes: Uint8Array,\n\tserver: ComputeServerConfig\n): Promise<UploadExtraction> {\n\tconst startedAt = Date.now();\n\tconst values = readSavedValues(definitionBytes, server);\n\n\tconst { schema, inventory } = await fetchExtraction(definitionBytes, server);\n\tconst saved = await withTimeout(\n\t\tvalues,\n\t\tMath.max(0, SAVED_VALUES_WAIT_MS - (Date.now() - startedAt)),\n\t\t() => new Error('saved values not read in time')\n\t).catch(() => null);\n\treturn {\n\t\tschema: saved ? applySavedValues(schema, saved) : schema,\n\t\tinventory,\n\t\tdefaultsPending: !saved,\n\t\tsavedValues: saved,\n\t\tsavedValuesLater: values\n\t};\n}\n\n/**\n * The source of the named script components, read by Compute from a stored file. The inventory\n * keeps fingerprints only, so this is how a code diff gets the code. Throws 'unsupported' when the\n * server's plugin cannot read scripts.\n */\nexport async function fetchScriptSources(\n\tdefinitionBytes: Uint8Array,\n\tids: readonly string[],\n\tserver: ComputeServerConfig\n): Promise<ScriptSource[]> {\n\tconst form = new FormData();\n\tform.append('file', new Blob([new Uint8Array(definitionBytes)]), 'definition.gh');\n\tform.append('ids', ids.join(','));\n\tconst headers: Record<string, string> = {};\n\tif (server.apiKey) headers['RhinoComputeKey'] = server.apiKey;\n\n\tlet response: Response;\n\ttry {\n\t\tresponse = await fetch(new URL('/grasshopper/scripts', server.serverUrl), {\n\t\t\tmethod: 'POST',\n\t\t\theaders,\n\t\t\tbody: form\n\t\t});\n\t} catch (err) {\n\t\tthrow new SchemaExtractionError(\n\t\t\t'unreachable',\n\t\t\t`Compute server is unreachable: ${err instanceof Error ? err.message : String(err)}`\n\t\t);\n\t}\n\t// A server without the endpoint answers 404; one whose plugin predates it, 422.\n\tif (response.status === 404 || response.status === 422) {\n\t\tthrow new SchemaExtractionError(\n\t\t\t'unsupported',\n\t\t\t'This Compute server cannot read script source. Update the server and its Selva plugin.'\n\t\t);\n\t}\n\tif (!response.ok) {\n\t\tthrow new SchemaExtractionError(\n\t\t\t'unreachable',\n\t\t\t`Scripts endpoint returned ${response.status}: ${response.statusText}`\n\t\t);\n\t}\n\tconst body = (await response.json()) as ScriptSource[];\n\treturn Array.isArray(body) ? body : [];\n}\n","/**\n * Compute error types, kept in a leaf module with no imports.\n *\n * Separate from the function that throws them on purpose: an error mapper needs\n * nothing but the class to `instanceof` against, and importing it from beside\n * the throw site drags that module's dependencies into every mapper. Anything\n * an error mapper imports belongs here.\n */\n\n/**\n * Thrown when no compute server is configured or visible for the org — a\n * misconfiguration an operator must fix in `/admin/compute`, not a bug. Routes\n * map this to 503 instead of letting the pure helper's plain `Error` surface as\n * a generic 500.\n */\nexport class ComputeServerUnconfiguredError extends Error {\n\tconstructor(\n\t\tmessage = 'No compute server configured. Ask an admin to add one in /admin/compute.'\n\t) {\n\t\tsuper(message);\n\t\tthis.name = 'ComputeServerUnconfiguredError';\n\t}\n}\n"],"mappings":";;;;;;;;;AAIA,SAAgB,YAAe,MAAkB,IAAY,WAAoC;CAChG,IAAI;CACJ,MAAM,UAAU,IAAI,SAAgB,GAAG,WAAW;EACjD,QAAQ,iBAAiB,OAAO,UAAU,CAAC,GAAG,EAAE;CACjD,CAAC;CACD,OAAO,QAAQ,KAAK,CAAC,MAAM,OAAO,CAAC,CAAC,CAAC,cAAc,aAAa,KAAK,CAAC;AACvE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BACT,eACA,wFACD;CAED,IAAI,CAAC,SAAS,IACb,MAAM,IAAI,sBACT,eACA,6BAA6B,SAAS,OAAO,IAAI,SAAS,YAC3D;CAED,MAAM,OAAQ,MAAM,SAAS,KAAK;CAClC,OAAO,MAAM,QAAQ,IAAI,IAAI,OAAO,CAAC;AACtC;;;;;;;;;;;;;;;;AC3VA,IAAa,iCAAb,cAAoD,MAAM;CACzD,YACC,UAAU,4EACT;EACD,MAAM,OAAO;EACb,KAAK,OAAO;CACb;AACD"}
@@ -1038,7 +1038,7 @@ async function readVersionUpload(req, guid) {
1038
1038
  const { ctx, record, project } = await requireEditableDefinition(req, guid);
1039
1039
  const data = new Uint8Array(await file.arrayBuffer());
1040
1040
  const server = await resolveServerForOrg(ctx, project?.orgId ?? null, req.deps.computeServer, { definitionPin: record.computeServerId ?? null });
1041
- const { schema, inventory, defaultsPending } = await extractSchemaForUpload(data, server);
1041
+ const { schema, inventory, defaultsPending, savedValues, savedValuesLater } = await extractSchemaForUpload(data, server);
1042
1042
  return {
1043
1043
  ctx,
1044
1044
  record,
@@ -1048,6 +1048,7 @@ async function readVersionUpload(req, guid) {
1048
1048
  schema,
1049
1049
  inventory,
1050
1050
  defaultsPending,
1051
+ savedValues: savedValues ?? savedValuesLater,
1051
1052
  changeNote,
1052
1053
  acceptMissingPlugins
1053
1054
  };
@@ -1078,7 +1079,7 @@ var uploadVersion = async (req) => {
1078
1079
  const { ctx, record, file, extension, data, schema, inventory, changeNote } = upload;
1079
1080
  guardPlugins(inventory, upload.acceptMissingPlugins);
1080
1081
  const base = await loadBase(req, ctx, record);
1081
- const { inventory: _stored, ...version } = await definitionService(req.deps).uploadVersion(ctx, guid, data, extension.slice(1), file.name, schema, changeNote, inventory);
1082
+ const { inventory: _stored, ...version } = await definitionService(req.deps).uploadVersion(ctx, guid, data, extension.slice(1), file.name, schema, changeNote, inventory, upload.savedValues);
1082
1083
  return created({
1083
1084
  version,
1084
1085
  base: refOf(base),
@@ -1299,7 +1300,7 @@ var createDefinition = async (req) => {
1299
1300
  const guid = randomUUID();
1300
1301
  const fileData = new Uint8Array(await file.arrayBuffer());
1301
1302
  const server = await resolveServerForOrg(ctx, project.orgId, req.deps.computeServer, { definitionPin: parsed.data.computeServerId ?? null });
1302
- const { schema, inventory } = await extractSchemaForUpload(fileData, server);
1303
+ const { schema, inventory, savedValues, savedValuesLater } = await extractSchemaForUpload(fileData, server);
1303
1304
  guardPlugins(inventory, formText(form, "acceptMissingPlugins") === "true");
1304
1305
  const service = definitionService(req.deps);
1305
1306
  const { record, version } = await service.create(ctx, {
@@ -1314,7 +1315,7 @@ var createDefinition = async (req) => {
1314
1315
  category: parsed.data.category,
1315
1316
  tags: parsed.data.tags,
1316
1317
  coverImage: parsed.data.coverImage
1317
- }, fileData, schema, inventory);
1318
+ }, fileData, schema, inventory, savedValues ?? savedValuesLater);
1318
1319
  let coverImage = record.coverImage;
1319
1320
  if (imageFile) try {
1320
1321
  coverImage = await service.saveCoverImage(ctx, guid, new Uint8Array(await imageFile.arrayBuffer()));