@selvajs/selva 4.21.0-beta.21 → 4.21.0-beta.23
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/chunks/B58dPMPq.js +1 -0
- package/build/client/_app/immutable/chunks/B58dPMPq.js.br +1 -0
- package/build/client/_app/immutable/chunks/B58dPMPq.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{C6zhj8Tc.js → DtmN00GS.js} +3 -3
- package/build/client/_app/immutable/chunks/DtmN00GS.js.br +0 -0
- package/build/client/_app/immutable/chunks/{C6zhj8Tc.js.gz → DtmN00GS.js.gz} +0 -0
- package/build/client/_app/immutable/entry/{app.C2KpbBu3.js → app.Dl3HM1mx.js} +2 -2
- package/build/client/_app/immutable/entry/app.Dl3HM1mx.js.br +0 -0
- package/build/client/_app/immutable/entry/app.Dl3HM1mx.js.gz +0 -0
- package/build/client/_app/immutable/nodes/21.BZJQikE5.js +1 -0
- package/build/client/_app/immutable/nodes/21.BZJQikE5.js.br +0 -0
- package/build/client/_app/immutable/nodes/21.BZJQikE5.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/server/.vite/manifest.json +228 -187
- package/build/server/chunks/AppHeader.js +1 -1
- package/build/server/chunks/Callout.js +1 -1
- package/build/server/chunks/ConfirmDialog.js +1 -1
- package/build/server/chunks/DataTable.js +1 -1
- package/build/server/chunks/DefinitionCard.js +2 -2
- package/build/server/chunks/EmptyState.js +1 -1
- package/build/server/chunks/ErrorScreen.js +1 -1
- package/build/server/chunks/FilterableDropdown.js +1 -1
- package/build/server/chunks/PageContent.js +1 -1
- package/build/server/chunks/SectionHeader.js +1 -1
- package/build/server/chunks/SettingsMenu.js +1 -1
- package/build/server/chunks/SideNav.js +1 -1
- package/build/server/chunks/StatCard.js +1 -1
- package/build/server/chunks/UserAvatar.js +1 -1
- package/build/server/chunks/UserRowIdentity.js +1 -1
- package/build/server/chunks/activity.js +1 -1
- package/build/server/chunks/alert-dialog.js +1 -1
- package/build/server/chunks/arrow-left.js +1 -1
- package/build/server/chunks/arrow-right.js +1 -1
- package/build/server/chunks/{keepalive-DbmLH4v1.js → async-solve-Doflh4BJ.js} +5 -3
- package/build/server/chunks/async-solve-Doflh4BJ.js.map +1 -0
- package/build/server/chunks/asyncSolves.server.js +22 -0
- package/build/server/chunks/asyncSolves.server.js.map +1 -0
- package/build/server/chunks/auth-bootstrap.server.js +1 -1
- package/build/server/chunks/badge.js +1 -1
- package/build/server/chunks/boot.server.js +1 -1
- package/build/server/chunks/building-complex.js +1 -1
- package/build/server/chunks/button.js +1 -1
- package/build/server/chunks/capture.js +1 -1
- package/build/server/chunks/card-content.js +1 -1
- package/build/server/chunks/card-description.js +1 -1
- package/build/server/chunks/card-header.js +1 -1
- package/build/server/chunks/card-title.js +1 -1
- package/build/server/chunks/chevron-down.js +1 -1
- package/build/server/chunks/chevron-left.js +1 -1
- package/build/server/chunks/chevron-right.js +1 -1
- package/build/server/chunks/chevron-up.js +1 -1
- package/build/server/chunks/circle.js +1 -1
- package/build/server/chunks/computeRateLimit.server.js +1 -1
- package/build/server/chunks/copy.js +1 -1
- package/build/server/chunks/create-id.js +1 -1
- package/build/server/chunks/delete-with-blobs.js +1 -1
- package/build/server/chunks/dialog-description.js +1 -1
- package/build/server/chunks/dialog.js +1 -1
- package/build/server/chunks/dom-typeahead.svelte.js +1 -1
- package/build/server/chunks/dynamic-value-list.js +301 -0
- package/build/server/chunks/dynamic-value-list.js.map +1 -0
- package/build/server/chunks/engine.server.js +2 -1
- package/build/server/chunks/engine.server.js.map +1 -1
- package/build/server/chunks/events.js +1 -1
- package/build/server/chunks/external-link.js +1 -1
- package/build/server/chunks/folder-kanban.js +1 -1
- package/build/server/chunks/folder-open.js +1 -1
- package/build/server/chunks/folders.js +1 -1
- package/build/server/chunks/footerContext.svelte.js +1 -1
- package/build/server/chunks/gauge.js +1 -1
- package/build/server/chunks/handlers.js +1 -1
- package/build/server/chunks/index-server2.js +1 -1
- package/build/server/chunks/input-group.js +1 -1
- package/build/server/chunks/input.js +1 -1
- package/build/server/chunks/instance.js +4 -4
- package/build/server/chunks/instanceAdmins.server.js +1 -1
- package/build/server/chunks/internal.js +1 -1
- package/build/server/chunks/key-round.js +1 -1
- package/build/server/chunks/label.js +1 -1
- package/build/server/chunks/link-2.js +1 -1
- package/build/server/chunks/localeContext.svelte.js +1 -1
- package/build/server/chunks/mail.js +1 -1
- package/build/server/chunks/minus.js +1 -1
- package/build/server/chunks/package.js +2 -2
- package/build/server/chunks/package.js.map +1 -1
- package/build/server/chunks/permissions.server.js +1 -1
- package/build/server/chunks/plus.js +1 -1
- package/build/server/chunks/popper-layer-force-mount.js +1 -1
- package/build/server/chunks/providers.server.js +3 -28134
- package/build/server/chunks/providers.server.js.map +1 -1
- package/build/server/chunks/refresh-cw.js +1 -1
- package/build/server/chunks/registry.js +22 -0
- package/build/server/chunks/registry.js.map +1 -1
- package/build/server/chunks/rotate-ccw.js +1 -1
- package/build/server/chunks/roving-focus-group.js +1 -1
- package/build/server/chunks/scroll-lock.js +1 -1
- package/build/server/chunks/scroll-text.js +1 -1
- package/build/server/chunks/search.js +1 -1
- package/build/server/chunks/search2.js +1 -1
- package/build/server/chunks/select.js +1 -1
- package/build/server/chunks/separator.js +1 -1
- package/build/server/chunks/server-config-write.js +1 -1
- package/build/server/chunks/server.js +28298 -5
- package/build/server/chunks/server.js.map +1 -1
- package/build/server/chunks/server2.js +5 -107
- package/build/server/chunks/server2.js.map +1 -1
- package/build/server/chunks/server3.js +101 -3911
- package/build/server/chunks/server3.js.map +1 -1
- package/build/server/chunks/server4.js +3916 -41
- package/build/server/chunks/server4.js.map +1 -1
- package/build/server/chunks/server5.js +45 -0
- package/build/server/chunks/server5.js.map +1 -0
- package/build/server/chunks/settings.js +1 -1
- package/build/server/chunks/severity.js +1 -1
- package/build/server/chunks/shield-check.js +1 -1
- package/build/server/chunks/shield.js +1 -1
- package/build/server/chunks/signInMaxAge.server.js +1 -1
- package/build/server/chunks/solve.server.js +4 -3
- package/build/server/chunks/solve.server.js.map +1 -1
- package/build/server/chunks/star.js +1 -1
- package/build/server/chunks/state.js +1 -1
- package/build/server/chunks/sveltekit.js +1 -1
- package/build/server/chunks/tabs-trigger.js +1 -1
- package/build/server/chunks/textarea.js +1 -1
- package/build/server/chunks/toast-state.svelte.js +1 -1
- package/build/server/chunks/toggle-group-item.js +1 -1
- package/build/server/chunks/trash.js +1 -1
- package/build/server/chunks/user-plus.js +1 -1
- package/build/server/chunks/users.js +1 -1
- package/build/server/chunks/utils.js +1 -1
- package/build/server/chunks/x.js +1 -1
- package/build/server/entries/endpoints/.well-known/oauth-authorization-server/_server.ts.js +1 -1
- package/build/server/entries/endpoints/.well-known/oauth-protected-resource/_server.ts.js +1 -1
- package/build/server/entries/endpoints/.well-known/oauth-protected-resource/mcp/_server.ts.js +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 +1 -1
- package/build/server/entries/endpoints/api/admin/system/update/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/admin/users/_id_/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/admin/users/_id_/disable/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/admin/users/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/files/_...path_/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/compute/_server.ts.js +8 -4
- package/build/server/entries/endpoints/api/v1/compute/_server.ts.js.map +1 -1
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/solve/_server.ts.js +12 -3
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/solve/_server.ts.js.map +1 -1
- package/build/server/entries/endpoints/api/v1/solves/_solveId_/_server.ts.js +32 -0
- package/build/server/entries/endpoints/api/v1/solves/_solveId_/_server.ts.js.map +1 -0
- package/build/server/entries/endpoints/auth/email/callback/_server.ts.js +1 -1
- package/build/server/entries/endpoints/auth/supabase/callback/_server.ts.js +1 -1
- package/build/server/entries/endpoints/auth/supabase/start/_server.ts.js +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 +244 -41
- 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 +2 -1
- package/build/server/entries/hooks.server.js.map +1 -1
- package/build/server/entries/pages/_error.svelte.js +1 -1
- package/build/server/entries/pages/_layout.svelte.js +1 -1
- package/build/server/entries/pages/_page.svelte.js +1 -1
- package/build/server/entries/pages/accept-invite/_page.svelte.js +1 -1
- package/build/server/entries/pages/admin/_error.svelte.js +1 -1
- package/build/server/entries/pages/admin/_layout.svelte.js +2 -2
- package/build/server/entries/pages/admin/_page.svelte.js +2 -2
- package/build/server/entries/pages/admin/audit/_page.svelte.js +1 -1
- package/build/server/entries/pages/admin/compute/_page.svelte.js +2 -2
- package/build/server/entries/pages/admin/organizations/_page.svelte.js +1 -1
- package/build/server/entries/pages/admin/projects/_id_/_page.svelte.js +1 -1
- package/build/server/entries/pages/admin/projects/_page.svelte.js +1 -1
- package/build/server/entries/pages/admin/system/_page.server.ts.js +1 -1
- package/build/server/entries/pages/admin/system/_page.svelte.js +1 -1
- package/build/server/entries/pages/admin/users/_page.svelte.js +1 -1
- package/build/server/entries/pages/auth/email/sent/_page.svelte.js +1 -1
- package/build/server/entries/pages/auth/email/start/_page.svelte.js +1 -1
- package/build/server/entries/pages/docs/api/_page.svelte.js +1 -1
- package/build/server/entries/pages/library/_guid_/_page.server.ts.js +1 -1
- package/build/server/entries/pages/library/_guid_/_page.svelte.js +71 -305
- package/build/server/entries/pages/library/_guid_/_page.svelte.js.map +1 -1
- package/build/server/entries/pages/library/_layout.svelte.js +1 -1
- package/build/server/entries/pages/library/_page.svelte.js +1 -1
- package/build/server/entries/pages/login/_page.svelte.js +1 -1
- package/build/server/entries/pages/oauth/authorize/_page.server.ts.js +1 -1
- package/build/server/entries/pages/oauth/authorize/_page.svelte.js +1 -1
- package/build/server/entries/pages/projects/_layout.svelte.js +1 -1
- package/build/server/entries/pages/projects/_page.server.ts.js +1 -1
- package/build/server/entries/pages/projects/_page.svelte.js +1 -1
- package/build/server/entries/pages/setup/_page.server.ts.js +1 -1
- package/build/server/entries/pages/setup/_page.svelte.js +1 -1
- package/build/server/entries/pages/team/_layout.svelte.js +2 -2
- package/build/server/entries/pages/team/_page.svelte.js +1 -1
- package/build/server/entries/pages/team/activity/_page.svelte.js +1 -1
- package/build/server/entries/pages/team/compute/_page.svelte.js +2 -2
- package/build/server/entries/pages/team/members/_page.svelte.js +1 -1
- package/build/server/entries/pages/team/projects/_page.server.ts.js +1 -1
- package/build/server/entries/pages/team/projects/_page.svelte.js +1 -1
- package/build/server/entries/pages/team/reclaim/_page.svelte.js +1 -1
- package/build/server/entries/pages/team/settings/_page.svelte.js +1 -1
- package/build/server/entries/pages/team/shares/_page.svelte.js +1 -1
- package/build/server/entries/pages/team/tokens/_page.svelte.js +1 -1
- package/build/server/index.js +1 -1
- package/build/server/manifest-full.js +8 -1
- package/build/server/manifest.js +8 -1
- package/build/server/nodes/21.js +1 -1
- package/build/server/remote-entry.js +1 -1
- package/build/server/server.js +8 -1
- package/package.json +8 -8
- package/templates/.env.example +5 -3
- package/build/client/_app/immutable/chunks/C36Kxzt3.js +0 -1
- package/build/client/_app/immutable/chunks/C36Kxzt3.js.br +0 -1
- package/build/client/_app/immutable/chunks/C36Kxzt3.js.gz +0 -0
- package/build/client/_app/immutable/chunks/C6zhj8Tc.js.br +0 -0
- package/build/client/_app/immutable/entry/app.C2KpbBu3.js.br +0 -0
- package/build/client/_app/immutable/entry/app.C2KpbBu3.js.gz +0 -0
- package/build/client/_app/immutable/nodes/21.C3YDbmsU.js +0 -1
- package/build/client/_app/immutable/nodes/21.C3YDbmsU.js.br +0 -0
- package/build/client/_app/immutable/nodes/21.C3YDbmsU.js.gz +0 -0
- package/build/server/chunks/keepalive-DbmLH4v1.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as bind_props, kt as clsx, r as attributes } from "./
|
|
1
|
+
import { i as bind_props, kt as clsx, r as attributes } from "./server4.js";
|
|
2
2
|
import { t as cn } from "./utils.js";
|
|
3
3
|
import { tv } from "tailwind-variants";
|
|
4
4
|
// ../ui/src/lib/components/primitives/card/card.svelte
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as bind_props, kt as clsx, r as attributes } from "./
|
|
1
|
+
import { i as bind_props, kt as clsx, r as attributes } from "./server4.js";
|
|
2
2
|
import { t as cn } from "./utils.js";
|
|
3
3
|
// ../ui/src/lib/components/primitives/card/card-description.svelte
|
|
4
4
|
function Card_description($$renderer, $$props) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as bind_props, kt as clsx, r as attributes } from "./
|
|
1
|
+
import { i as bind_props, kt as clsx, r as attributes } from "./server4.js";
|
|
2
2
|
import { t as cn } from "./utils.js";
|
|
3
3
|
// ../ui/src/lib/components/primitives/card/card-header.svelte
|
|
4
4
|
function Card_header($$renderer, $$props) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as bind_props, kt as clsx, r as attributes } from "./
|
|
1
|
+
import { i as bind_props, kt as clsx, r as attributes } from "./server4.js";
|
|
2
2
|
import { t as cn } from "./utils.js";
|
|
3
3
|
// ../ui/src/lib/components/primitives/card/card-title.svelte
|
|
4
4
|
function Card_title($$renderer, $$props) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as spread_props } from "./
|
|
1
|
+
import { d as spread_props } from "./server4.js";
|
|
2
2
|
import { n as Icon } from "./utils.js";
|
|
3
3
|
// ../../node_modules/.pnpm/@lucide+svelte@1.66.0_svelte@5.57.3_@typescript-eslint+types@8.72.1_/node_modules/@lucide/svelte/dist/icons/chevron-down.svelte
|
|
4
4
|
var __iconData = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as spread_props } from "./
|
|
1
|
+
import { d as spread_props } from "./server4.js";
|
|
2
2
|
import { n as Icon } from "./utils.js";
|
|
3
3
|
// ../../node_modules/.pnpm/@lucide+svelte@1.66.0_svelte@5.57.3_@typescript-eslint+types@8.72.1_/node_modules/@lucide/svelte/dist/icons/chevron-left.svelte
|
|
4
4
|
var __iconData = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as spread_props } from "./
|
|
1
|
+
import { d as spread_props } from "./server4.js";
|
|
2
2
|
import { n as Icon } from "./utils.js";
|
|
3
3
|
// ../../node_modules/.pnpm/@lucide+svelte@1.66.0_svelte@5.57.3_@typescript-eslint+types@8.72.1_/node_modules/@lucide/svelte/dist/icons/chevron-right.svelte
|
|
4
4
|
var __iconData = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as spread_props } from "./
|
|
1
|
+
import { d as spread_props } from "./server4.js";
|
|
2
2
|
import { n as Icon } from "./utils.js";
|
|
3
3
|
// ../../node_modules/.pnpm/@lucide+svelte@1.66.0_svelte@5.57.3_@typescript-eslint+types@8.72.1_/node_modules/@lucide/svelte/dist/icons/chevron-up.svelte
|
|
4
4
|
var __iconData = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as spread_props } from "./
|
|
1
|
+
import { d as spread_props } from "./server4.js";
|
|
2
2
|
import { n as Icon } from "./utils.js";
|
|
3
3
|
// ../../node_modules/.pnpm/@lucide+svelte@1.66.0_svelte@5.57.3_@typescript-eslint+types@8.72.1_/node_modules/@lucide/svelte/dist/icons/circle.svelte
|
|
4
4
|
var __iconData = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { w as lazyLogger } from "./providers.server.js";
|
|
2
1
|
import { n as env } from "./previous-key.js";
|
|
2
|
+
import { w as lazyLogger } from "./providers.server.js";
|
|
3
3
|
import { O as createApiRateLimiter, j as resolveApiRateLimitConfig } from "./api.js";
|
|
4
4
|
import { t as createComputeRateLimiter } from "./rate-limit.js";
|
|
5
5
|
import "./compute.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as spread_props } from "./
|
|
1
|
+
import { d as spread_props } from "./server4.js";
|
|
2
2
|
import { n as Icon } from "./utils.js";
|
|
3
3
|
// ../../node_modules/.pnpm/@lucide+svelte@1.66.0_svelte@5.57.3_@typescript-eslint+types@8.72.1_/node_modules/@lucide/svelte/dist/icons/copy.svelte
|
|
4
4
|
var __iconData = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ft as run, Rt as ATTACHMENT_KEY, Tt as EFFECT_TRANSPARENT, a as derived, wt as EFFECT_PRESERVED } from "./
|
|
1
|
+
import { Ft as run, Rt as ATTACHMENT_KEY, Tt as EFFECT_TRANSPARENT, a as derived, wt as EFFECT_PRESERVED } from "./server4.js";
|
|
2
2
|
import "./events.js";
|
|
3
3
|
import "./index-server2.js";
|
|
4
4
|
import { clsx } from "clsx";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { B as definitionPaths, I as orgPaths } from "./providers.server.js";
|
|
2
2
|
import { t as SYSTEM_CONTEXT } from "./context.js";
|
|
3
3
|
import { _ as listAll, v as walkPages } from "./logging.js";
|
|
4
4
|
// ../server/src/projects/delete-with-blobs.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as derived, i as bind_props, l as props_id, r as attributes } from "./
|
|
1
|
+
import { a as derived, i as bind_props, l as props_id, r as attributes } from "./server4.js";
|
|
2
2
|
import { c as getDataOpenClosed, f as mergeProps, l as getDataTransitionAttrs, n as boolToEmptyStrOrUndef, o as createBitsAttrs, r as boolToStr, t as createId, u as attachRef, y as boxWith } from "./create-id.js";
|
|
3
3
|
import { G as watch, m as PresenceManager, q as Context } from "./scroll-lock.js";
|
|
4
4
|
// ../../node_modules/.pnpm/bits-ui@2.20.2_@internationalized+date@3.12.4_@sveltejs+kit@3.1.1_@opentelemetry+api@1._ee0cc2dca752cac163e62e76ab57f1b7/node_modules/bits-ui/dist/bits/dialog/dialog.svelte.js
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Lt as escape_html, a as derived, d as spread_props, i as bind_props, kt as clsx, l as props_id, r as attributes } from "./
|
|
1
|
+
import { Lt as escape_html, a as derived, d as spread_props, i as bind_props, kt as clsx, l as props_id, r as attributes } from "./server4.js";
|
|
2
2
|
import { f as mergeProps, t as createId, y as boxWith } from "./create-id.js";
|
|
3
3
|
import { t as cn } from "./utils.js";
|
|
4
4
|
import { t as getLocaleContext } from "./localeContext.svelte.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as derived } from "./
|
|
1
|
+
import { a as derived } from "./server4.js";
|
|
2
2
|
import { y as boxWith } from "./create-id.js";
|
|
3
3
|
import { p as noop } from "./scroll-lock.js";
|
|
4
4
|
// ../../node_modules/.pnpm/bits-ui@2.20.2_@internationalized+date@3.12.4_@sveltejs+kit@3.1.1_@opentelemetry+api@1._ee0cc2dca752cac163e62e76ab57f1b7/node_modules/bits-ui/dist/internal/arrays.js
|
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
import { r as getLayoutItems } from "./traversal.js";
|
|
2
|
+
// ../schemas/src/dynamic-value-list.ts
|
|
3
|
+
function isDynamicValueListPayload(value) {
|
|
4
|
+
return typeof value === "object" && value !== null && ("targetInputId" in value || "options" in value);
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Normalize a raw output value into a payload object.
|
|
8
|
+
*
|
|
9
|
+
* The local/WebSocket path delivers a real object; the Rhino.Compute path delivers the
|
|
10
|
+
* component's JSON output as a string (possibly double-encoded by the compute layer), so try
|
|
11
|
+
* to parse strings before giving up.
|
|
12
|
+
*/
|
|
13
|
+
function coercePayload(value) {
|
|
14
|
+
if (isDynamicValueListPayload(value)) return value;
|
|
15
|
+
let candidate = value;
|
|
16
|
+
for (let i = 0; i < 2 && typeof candidate === "string"; i++) {
|
|
17
|
+
try {
|
|
18
|
+
candidate = JSON.parse(candidate);
|
|
19
|
+
} catch {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
if (isDynamicValueListPayload(candidate)) return candidate;
|
|
23
|
+
}
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
var coerceCache = /* @__PURE__ */ new Map();
|
|
27
|
+
var COERCE_CACHE_MAX = 8;
|
|
28
|
+
function coercePayloadMemo(value) {
|
|
29
|
+
if (typeof value !== "string" || value.length < 1024) return coercePayload(value);
|
|
30
|
+
const hit = coerceCache.get(value);
|
|
31
|
+
if (hit !== void 0 || coerceCache.has(value)) {
|
|
32
|
+
coerceCache.delete(value);
|
|
33
|
+
coerceCache.set(value, hit ?? null);
|
|
34
|
+
return hit ?? null;
|
|
35
|
+
}
|
|
36
|
+
const parseStart = performance.now();
|
|
37
|
+
const parsed = coercePayload(value);
|
|
38
|
+
if (value.length > 262144) {
|
|
39
|
+
const optionCount = parsed?.options ? Object.keys(parsed.options).length : 0;
|
|
40
|
+
console.info(`[DVL] parsed ${(value.length / 1048576).toFixed(1)} MB options payload (${optionCount} options) in ${(performance.now() - parseStart).toFixed(0)}ms — cache miss`);
|
|
41
|
+
}
|
|
42
|
+
if (coerceCache.size >= COERCE_CACHE_MAX) {
|
|
43
|
+
const oldest = coerceCache.keys().next().value;
|
|
44
|
+
if (oldest !== void 0) coerceCache.delete(oldest);
|
|
45
|
+
}
|
|
46
|
+
coerceCache.set(value, parsed);
|
|
47
|
+
return parsed;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Every dynamicValueList output reference in the schema.
|
|
51
|
+
*
|
|
52
|
+
* Canonical location is `schema.outputs[]` — the plugin's SchemaSynchronizer mirrors every
|
|
53
|
+
* dynamicValueList layout item there (`CanonicalizeDynamicValueListOutputs`). The layout scan is
|
|
54
|
+
* back-compat defense for schemas persisted by an older plugin that lacked that invariant; on
|
|
55
|
+
* current schemas it finds nothing new. Deduped by id, `outputs[]` winning so the canonical
|
|
56
|
+
* record's targetInputId takes precedence.
|
|
57
|
+
*/
|
|
58
|
+
function collectDynamicValueListSources(schema) {
|
|
59
|
+
const byId = /* @__PURE__ */ new Map();
|
|
60
|
+
for (const item of getLayoutItems(schema)) {
|
|
61
|
+
if (item.type !== "output" || item.widgetType !== "dynamicValueList") continue;
|
|
62
|
+
const dvl = item;
|
|
63
|
+
if (typeof dvl.paramId !== "string") continue;
|
|
64
|
+
byId.set(dvl.paramId, {
|
|
65
|
+
id: dvl.paramId,
|
|
66
|
+
targetInputId: dvl.config?.targetInputId
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
for (const output of schema.outputs ?? []) {
|
|
70
|
+
if (output.type !== "dynamicValueList") continue;
|
|
71
|
+
byId.set(output.id, {
|
|
72
|
+
id: output.id,
|
|
73
|
+
targetInputId: output.targetInputId
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
return [...byId.values()];
|
|
77
|
+
}
|
|
78
|
+
function findOptionIndex(entries, pick) {
|
|
79
|
+
if (typeof pick !== "string") return -1;
|
|
80
|
+
const wanted = pick.toLowerCase();
|
|
81
|
+
return entries.findIndex(([name, value]) => value.toLowerCase() === wanted || name.toLowerCase() === wanted);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* The option value a pick resolves to, as Grasshopper resolves it in the solve: the pick if still
|
|
85
|
+
* offered (by value or name, ignoring case), else the first option. With no options known the
|
|
86
|
+
* pick passes through. `packages/schemas/fixtures/dynamic-value-list-resolution.json` pins both.
|
|
87
|
+
*/
|
|
88
|
+
function resolvePick(options, pick) {
|
|
89
|
+
const entries = Object.entries(options ?? {});
|
|
90
|
+
if (entries.length === 0) return typeof pick === "string" ? pick : "";
|
|
91
|
+
return entries[Math.max(0, findOptionIndex(entries, pick))][1];
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Checklist: the picks still offered, in pick order; none left gives the first option. Duplicates
|
|
95
|
+
* collapse by option, not by value, so two options sharing a value both stay.
|
|
96
|
+
*/
|
|
97
|
+
function resolvePicks(options, picks) {
|
|
98
|
+
const entries = Object.entries(options ?? {});
|
|
99
|
+
if (entries.length === 0) return picks.filter((p) => typeof p === "string");
|
|
100
|
+
const kept = /* @__PURE__ */ new Set();
|
|
101
|
+
for (const pick of picks) {
|
|
102
|
+
const index = findOptionIndex(entries, pick);
|
|
103
|
+
if (index >= 0) kept.add(index);
|
|
104
|
+
}
|
|
105
|
+
return kept.size > 0 ? [...kept].map((i) => entries[i][1]) : [entries[0][1]];
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* A checklist edit made on the resolved picks, merged back into the stored ones: picks not offered
|
|
109
|
+
* now were never shown, so the edit can't have removed them, and they come back when offered again.
|
|
110
|
+
*/
|
|
111
|
+
function keepHiddenPicks(options, stored, edited) {
|
|
112
|
+
const entries = Object.entries(options ?? {});
|
|
113
|
+
if (entries.length === 0 || !Array.isArray(stored)) return edited;
|
|
114
|
+
const hidden = stored.filter((pick) => typeof pick === "string" && findOptionIndex(entries, pick) < 0 && !edited.includes(pick));
|
|
115
|
+
return [...edited, ...hidden];
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* A repeated input's picks. Its value is one JSON object of row key to pick, so a pick stays with
|
|
119
|
+
* its row when rows come and go, and the value is a plain string on the wire. Anything else reads
|
|
120
|
+
* as no picks.
|
|
121
|
+
*/
|
|
122
|
+
function readRowPicks(value) {
|
|
123
|
+
if (typeof value !== "string" || !value.trimStart().startsWith("{")) return {};
|
|
124
|
+
try {
|
|
125
|
+
const parsed = JSON.parse(value);
|
|
126
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return {};
|
|
127
|
+
return Object.fromEntries(Object.entries(parsed).filter((entry) => typeof entry[1] === "string"));
|
|
128
|
+
} catch {
|
|
129
|
+
return {};
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
/** The repeated input's value with one row's pick set. Picks for rows not shown now are kept. */
|
|
133
|
+
function withRowPick(value, rowKey, pick) {
|
|
134
|
+
return JSON.stringify({
|
|
135
|
+
...readRowPicks(value),
|
|
136
|
+
[rowKey]: pick
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
/** The options each targeted payload gives its input: one set, or the same set for every row. */
|
|
140
|
+
function lookUpOptions(payloads, repeatById, repeatOf) {
|
|
141
|
+
const options = {};
|
|
142
|
+
const rowOptions = {};
|
|
143
|
+
for (const { source, payload } of payloads) {
|
|
144
|
+
const target = payload.targetInputId ?? source.targetInputId;
|
|
145
|
+
if (!target || !payload.options || typeof payload.options !== "object") continue;
|
|
146
|
+
const repeat = repeatById.get(repeatOf[target]);
|
|
147
|
+
const offered = payload.options;
|
|
148
|
+
if (repeat) rowOptions[target] = repeat.rows.map(() => offered);
|
|
149
|
+
else options[target] = offered;
|
|
150
|
+
}
|
|
151
|
+
for (const { source, payload } of payloads) {
|
|
152
|
+
const repeat = repeatById.get(source.id);
|
|
153
|
+
const offered = payload.options;
|
|
154
|
+
if (!repeat || !offered || Object.keys(offered).length === 0) continue;
|
|
155
|
+
for (const member of repeat.members) rowOptions[member] ??= repeat.rows.map(() => offered);
|
|
156
|
+
}
|
|
157
|
+
return {
|
|
158
|
+
options,
|
|
159
|
+
rowOptions
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
var tableOptionsCache = /* @__PURE__ */ new WeakMap();
|
|
163
|
+
/**
|
|
164
|
+
* Narrows each pick table as Grasshopper does in the solve: an input offers the values its column
|
|
165
|
+
* has in the rows left by the picks before it, and resolves its own pick against those.
|
|
166
|
+
* `packages/schemas/fixtures/pick-table.json` pins both.
|
|
167
|
+
*/
|
|
168
|
+
function narrowPickTables(payloads, values, repeatById, repeatOf) {
|
|
169
|
+
const options = {};
|
|
170
|
+
const rowOptions = {};
|
|
171
|
+
const shown = {};
|
|
172
|
+
for (const { payload } of payloads) {
|
|
173
|
+
const table = payload.pickTable;
|
|
174
|
+
if (!table || !Array.isArray(table.inputs) || !Array.isArray(table.rows)) continue;
|
|
175
|
+
const cache = tableOptionsCache.get(table.rows) ?? /* @__PURE__ */ new Map();
|
|
176
|
+
tableOptionsCache.set(table.rows, cache);
|
|
177
|
+
const by = Array.isArray(table.by) ? table.by : [];
|
|
178
|
+
const held = by.map((id) => {
|
|
179
|
+
const value = values[id];
|
|
180
|
+
return (Array.isArray(value) ? value : [value]).filter((item) => item !== void 0 && item !== null).map(String);
|
|
181
|
+
});
|
|
182
|
+
const start = Array.from({ length: Math.max(1, ...held.map((h) => h.length)) }, (_, i) => {
|
|
183
|
+
const picked = held.map((items) => items[Math.min(i, items.length - 1)]);
|
|
184
|
+
return {
|
|
185
|
+
rows: table.rows.filter((row) => picked.every((item, d) => item === void 0 || row[d]?.toLowerCase() === item.toLowerCase())),
|
|
186
|
+
picked: picked.map((item) => item ?? "")
|
|
187
|
+
};
|
|
188
|
+
});
|
|
189
|
+
const left = [];
|
|
190
|
+
table.inputs.forEach((id, index) => {
|
|
191
|
+
const column = by.length + index;
|
|
192
|
+
const parent = table.parents?.[index] ?? index - 1;
|
|
193
|
+
const before = parent >= 0 && left[parent] ? left[parent] : start;
|
|
194
|
+
const repeat = repeatById.get(repeatOf[id]);
|
|
195
|
+
const rowPicks = repeat ? readRowPicks(values[id]) : void 0;
|
|
196
|
+
const picks = repeat ? repeat.rows.map((row) => rowPicks?.[row.key]) : [values[id]];
|
|
197
|
+
const offeredPerRow = [];
|
|
198
|
+
const resolved = [];
|
|
199
|
+
const after = picks.map((wanted, i) => {
|
|
200
|
+
const { rows, picked } = before[Math.min(i, before.length - 1)];
|
|
201
|
+
const key = JSON.stringify([column, ...picked]);
|
|
202
|
+
let offered = cache.get(key);
|
|
203
|
+
if (!offered) {
|
|
204
|
+
offered = {};
|
|
205
|
+
for (const row of rows) {
|
|
206
|
+
const cell = row[column];
|
|
207
|
+
if (typeof cell === "string" && cell !== "") offered[cell] = cell;
|
|
208
|
+
}
|
|
209
|
+
cache.set(key, offered);
|
|
210
|
+
}
|
|
211
|
+
offeredPerRow.push(offered);
|
|
212
|
+
const pick = resolvePick(offered, wanted);
|
|
213
|
+
resolved.push(pick);
|
|
214
|
+
return {
|
|
215
|
+
rows: rows.filter((row) => row[column] === pick),
|
|
216
|
+
picked: [...picked, `${column}:${pick}`]
|
|
217
|
+
};
|
|
218
|
+
});
|
|
219
|
+
if (repeat) {
|
|
220
|
+
rowOptions[id] = offeredPerRow;
|
|
221
|
+
shown[id] = resolved;
|
|
222
|
+
} else {
|
|
223
|
+
options[id] = offeredPerRow[0];
|
|
224
|
+
shown[id] = resolved[0];
|
|
225
|
+
}
|
|
226
|
+
left[index] = after.length > 0 ? after : before;
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
return {
|
|
230
|
+
options,
|
|
231
|
+
rowOptions,
|
|
232
|
+
shown
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* What the form shows, from the payloads the last solve returned and the values on screen now.
|
|
237
|
+
* A pick table is narrowed by the picks on screen, so changing one updates the lists that depend
|
|
238
|
+
* on it without a solve.
|
|
239
|
+
*
|
|
240
|
+
* Pass the previous model to keep the identity of every array that didn't change: this runs on
|
|
241
|
+
* each value change, and a fresh array re-renders its whole checklist or repeat.
|
|
242
|
+
*/
|
|
243
|
+
function buildFormModel(schema, values, previous) {
|
|
244
|
+
const payloads = [];
|
|
245
|
+
for (const source of collectDynamicValueListSources(schema)) {
|
|
246
|
+
const payload = coercePayloadMemo(values[source.id]);
|
|
247
|
+
if (payload) payloads.push({
|
|
248
|
+
source,
|
|
249
|
+
payload
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
const repeats = [];
|
|
253
|
+
const repeatOf = {};
|
|
254
|
+
for (const { source, payload } of payloads) {
|
|
255
|
+
if (!Array.isArray(payload.rows) || !Array.isArray(payload.members)) continue;
|
|
256
|
+
const rows = payload.rows.filter((r) => typeof r?.key === "string");
|
|
257
|
+
repeats.push({
|
|
258
|
+
id: source.id,
|
|
259
|
+
rows,
|
|
260
|
+
members: payload.members
|
|
261
|
+
});
|
|
262
|
+
for (const member of payload.members) repeatOf[member] = source.id;
|
|
263
|
+
}
|
|
264
|
+
const repeatById = new Map(repeats.map((r) => [r.id, r]));
|
|
265
|
+
const tables = narrowPickTables(payloads, values, repeatById, repeatOf);
|
|
266
|
+
const lookup = lookUpOptions(payloads, repeatById, repeatOf);
|
|
267
|
+
Object.assign(lookup.options, tables.options);
|
|
268
|
+
Object.assign(lookup.rowOptions, tables.rowOptions);
|
|
269
|
+
const shown = { ...tables.shown };
|
|
270
|
+
for (const { source, payload } of payloads) {
|
|
271
|
+
const target = payload.targetInputId ?? source.targetInputId;
|
|
272
|
+
if (!target || !payload.resolvedInSolve || repeatOf[target]) continue;
|
|
273
|
+
const value = values[target];
|
|
274
|
+
shown[target] = Array.isArray(value) ? resolvePicks(lookup.options[target], value) : resolvePick(lookup.options[target], value);
|
|
275
|
+
}
|
|
276
|
+
for (const repeat of repeats) for (const member of repeat.members) {
|
|
277
|
+
const picks = readRowPicks(values[member]);
|
|
278
|
+
shown[member] = repeat.rows.map((row, i) => resolvePick(lookup.rowOptions[member]?.[i], picks[row.key]));
|
|
279
|
+
}
|
|
280
|
+
if (previous) {
|
|
281
|
+
reuseUnchanged(shown, previous.shown);
|
|
282
|
+
reuseUnchanged(lookup.rowOptions, previous.rowOptions);
|
|
283
|
+
}
|
|
284
|
+
return {
|
|
285
|
+
...lookup,
|
|
286
|
+
repeats,
|
|
287
|
+
repeatOf,
|
|
288
|
+
shown
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
function sameValue(a, b) {
|
|
292
|
+
if (a === b) return true;
|
|
293
|
+
if (!Array.isArray(a) || !Array.isArray(b) || a.length !== b.length) return false;
|
|
294
|
+
return a.every((item, i) => item === b[i]);
|
|
295
|
+
}
|
|
296
|
+
function reuseUnchanged(next, previous) {
|
|
297
|
+
for (const key of Object.keys(next)) if (key in previous && sameValue(next[key], previous[key])) next[key] = previous[key];
|
|
298
|
+
}
|
|
299
|
+
export { keepHiddenPicks as n, withRowPick as r, buildFormModel as t };
|
|
300
|
+
|
|
301
|
+
//# sourceMappingURL=dynamic-value-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dynamic-value-list.js","names":[],"sources":["../../../../schemas/src/dynamic-value-list.ts"],"sourcesContent":["import type { UISchema, OutputDynamicValueListLayoutItem } from './generated/index.js';\nimport { getLayoutItems } from './traversal.js';\n\n/**\n * The runtime payload a dynamic value list output produces, keyed by the output's id in `values`.\n * Routed back into the dynamic value list input identified by `targetInputId`.\n */\nexport interface DynamicValueListPayload {\n\ttargetInputId?: string | null;\n\t/** On a Repeat: what every row of a member offers, unless another payload fills that member. */\n\toptions?: Record<string, string>;\n\t/** Repeat: one entry per row, in order. */\n\trows?: RepeatRow[] | null;\n\t/** Repeat: the inputs shown once per row. Each value is a JSON object of row key to pick. */\n\tmembers?: string[] | null;\n\t/**\n\t * The output is wired into its target, so Grasshopper resolves the target's pick in the same\n\t * solve. The form shows the resolved pick and never sends a correction.\n\t */\n\tresolvedInSolve?: boolean | null;\n\t/** Options Table: the valid combinations for a set of inputs. */\n\tpickTable?: PickTable | null;\n}\n\n/**\n * The valid combinations for a set of inputs. Each input offers the values its cell still has in\n * the rows matching the picks it depends on: the `by` inputs, then its parent, its parent's parent\n * and so on.\n */\nexport interface PickTable {\n\t/** Ids of the inputs that narrow the rows without being filled from them. */\n\tby?: string[] | null;\n\t/** Ids of the inputs the table fills, a parent before its children. */\n\tinputs: string[];\n\t/**\n\t * For each of `inputs`, the index of the input whose pick it narrows on, or -1 for one that only\n\t * `by` narrows. Absent: one chain, each input narrowing on the one before it.\n\t */\n\tparents?: number[] | null;\n\t/** One entry per valid combination: a cell for each of `by`, then one for each of `inputs`. */\n\trows: string[][];\n}\n\nexport interface RepeatRow {\n\tkey: string;\n\tlabel?: string | null;\n\tsection?: string | null;\n}\n\nfunction isDynamicValueListPayload(value: unknown): value is DynamicValueListPayload {\n\treturn (\n\t\ttypeof value === 'object' && value !== null && ('targetInputId' in value || 'options' in value)\n\t);\n}\n\n/**\n * Normalize a raw output value into a payload object.\n *\n * The local/WebSocket path delivers a real object; the Rhino.Compute path delivers the\n * component's JSON output as a string (possibly double-encoded by the compute layer), so try\n * to parse strings before giving up.\n */\nfunction coercePayload(value: unknown): DynamicValueListPayload | null {\n\tif (isDynamicValueListPayload(value)) return value;\n\n\tlet candidate = value;\n\t// Unwrap up to two layers of JSON string encoding (compute may quote the string output).\n\tfor (let i = 0; i < 2 && typeof candidate === 'string'; i++) {\n\t\ttry {\n\t\t\tcandidate = JSON.parse(candidate);\n\t\t} catch {\n\t\t\treturn null;\n\t\t}\n\t\tif (isDynamicValueListPayload(candidate)) return candidate;\n\t}\n\n\treturn null;\n}\n\n// Memoizes string-payload coercion. In compute mode the payload arrives as a JSON\n// string — several MB for a large options list — and the options map is derived from\n// `values` (TabLayout), so it recomputes on EVERY value change. Unmemoized, each\n// keystroke re-parses megabytes and allocates a fresh options object whose new\n// identity re-renders the whole dropdown subtree; a 6.4 MB payload drove a tab OOM.\n// Map keys use SameValueZero, so an identical string from a later solve also hits.\nconst coerceCache = new Map<string, DynamicValueListPayload | null>();\nconst COERCE_CACHE_MAX = 8;\n\nfunction coercePayloadMemo(value: unknown): DynamicValueListPayload | null {\n\t// Only string payloads are expensive (JSON.parse); objects pass straight through.\n\tif (typeof value !== 'string' || value.length < 1024) return coercePayload(value);\n\tconst hit = coerceCache.get(value);\n\tif (hit !== undefined || coerceCache.has(value)) {\n\t\t// Refresh LRU position.\n\t\tcoerceCache.delete(value);\n\t\tcoerceCache.set(value, hit ?? null);\n\t\treturn hit ?? null;\n\t}\n\tconst parseStart = performance.now();\n\tconst parsed = coercePayload(value);\n\t// An expensive parse should happen ONCE per distinct solve result. If this line\n\t// storms the console, memoization is being defeated (payload strings differing\n\t// per recompute) — the churn pattern that could OOM a tab.\n\tif (value.length > 256 * 1024) {\n\t\tconst optionCount = parsed?.options ? Object.keys(parsed.options).length : 0;\n\t\tconsole.info(\n\t\t\t`[DVL] parsed ${(value.length / (1024 * 1024)).toFixed(1)} MB options payload ` +\n\t\t\t\t`(${optionCount} options) in ${(performance.now() - parseStart).toFixed(0)}ms — cache miss`\n\t\t);\n\t}\n\tif (coerceCache.size >= COERCE_CACHE_MAX) {\n\t\tconst oldest = coerceCache.keys().next().value;\n\t\tif (oldest !== undefined) coerceCache.delete(oldest);\n\t}\n\tcoerceCache.set(value, parsed);\n\treturn parsed;\n}\n\n/** One DynVL routing source: the id keying `values`, plus the schema-side target fallback. */\ninterface DynamicValueListSource {\n\tid: string;\n\ttargetInputId?: string | null;\n}\n\n/**\n * Every dynamicValueList output reference in the schema.\n *\n * Canonical location is `schema.outputs[]` — the plugin's SchemaSynchronizer mirrors every\n * dynamicValueList layout item there (`CanonicalizeDynamicValueListOutputs`). The layout scan is\n * back-compat defense for schemas persisted by an older plugin that lacked that invariant; on\n * current schemas it finds nothing new. Deduped by id, `outputs[]` winning so the canonical\n * record's targetInputId takes precedence.\n */\nfunction collectDynamicValueListSources(schema: UISchema): DynamicValueListSource[] {\n\tconst byId = new Map<string, DynamicValueListSource>();\n\n\tfor (const item of getLayoutItems(schema)) {\n\t\tif (item.type !== 'output' || item.widgetType !== 'dynamicValueList') continue;\n\t\tconst dvl = item as OutputDynamicValueListLayoutItem;\n\t\tif (typeof dvl.paramId !== 'string') continue;\n\t\tbyId.set(dvl.paramId, { id: dvl.paramId, targetInputId: dvl.config?.targetInputId });\n\t}\n\n\tfor (const output of schema.outputs ?? []) {\n\t\tif (output.type !== 'dynamicValueList') continue;\n\t\tbyId.set(output.id, { id: output.id, targetInputId: output.targetInputId });\n\t}\n\n\treturn [...byId.values()];\n}\n\n/**\n * Build a map of `inputId -> computed options` from the solved output values.\n *\n * Reads each dynamicValueList source's `{ targetInputId, options }` payload from `values` and routes\n * the options to the targeted input. The payload's own `targetInputId` wins; the schema-side\n * `targetInputId` is the fallback when the payload omits it.\n */\nexport function buildDynamicValueListOptions(\n\tschema: UISchema,\n\tvalues: Record<string, unknown>\n): Record<string, Record<string, string>> {\n\treturn buildFormModel(schema, values).options;\n}\n\n// ============================================================================\n// Pick tables, repeats, and picks resolved in the solve\n// ============================================================================\n\nexport interface RepeatSpec {\n\t/** The Repeat output's id. */\n\tid: string;\n\trows: RepeatRow[];\n\tmembers: string[];\n}\n\nexport interface FormModel {\n\t/** Options for each input shown once, keyed by input id. */\n\toptions: Record<string, Record<string, string>>;\n\t/** Options for each row of a repeated input, keyed by input id. */\n\trowOptions: Record<string, Record<string, string>[]>;\n\trepeats: RepeatSpec[];\n\t/** The repeat each member input belongs to. */\n\trepeatOf: Record<string, string>;\n\t/**\n\t * What each input Grasshopper resolves in the solve shows, which is also what the solve uses:\n\t * the pick if still offered, else the first option; one per row for a repeated input.\n\t */\n\tshown: Record<string, unknown>;\n}\n\nfunction findOptionIndex(entries: [string, string][], pick: unknown): number {\n\tif (typeof pick !== 'string') return -1;\n\tconst wanted = pick.toLowerCase();\n\treturn entries.findIndex(\n\t\t([name, value]) => value.toLowerCase() === wanted || name.toLowerCase() === wanted\n\t);\n}\n\n/**\n * The option value a pick resolves to, as Grasshopper resolves it in the solve: the pick if still\n * offered (by value or name, ignoring case), else the first option. With no options known the\n * pick passes through. `packages/schemas/fixtures/dynamic-value-list-resolution.json` pins both.\n */\nexport function resolvePick(options: Record<string, string> | undefined, pick: unknown): string {\n\tconst entries = Object.entries(options ?? {});\n\tif (entries.length === 0) return typeof pick === 'string' ? pick : '';\n\treturn entries[Math.max(0, findOptionIndex(entries, pick))][1];\n}\n\n/**\n * Checklist: the picks still offered, in pick order; none left gives the first option. Duplicates\n * collapse by option, not by value, so two options sharing a value both stay.\n */\nexport function resolvePicks(\n\toptions: Record<string, string> | undefined,\n\tpicks: unknown[]\n): string[] {\n\tconst entries = Object.entries(options ?? {});\n\tif (entries.length === 0) return picks.filter((p): p is string => typeof p === 'string');\n\tconst kept = new Set<number>();\n\tfor (const pick of picks) {\n\t\tconst index = findOptionIndex(entries, pick);\n\t\tif (index >= 0) kept.add(index);\n\t}\n\treturn kept.size > 0 ? [...kept].map((i) => entries[i][1]) : [entries[0][1]];\n}\n\n/**\n * A checklist edit made on the resolved picks, merged back into the stored ones: picks not offered\n * now were never shown, so the edit can't have removed them, and they come back when offered again.\n */\nexport function keepHiddenPicks(\n\toptions: Record<string, string> | undefined,\n\tstored: unknown,\n\tedited: string[]\n): string[] {\n\tconst entries = Object.entries(options ?? {});\n\tif (entries.length === 0 || !Array.isArray(stored)) return edited;\n\tconst hidden = stored.filter(\n\t\t(pick): pick is string =>\n\t\t\ttypeof pick === 'string' && findOptionIndex(entries, pick) < 0 && !edited.includes(pick)\n\t);\n\treturn [...edited, ...hidden];\n}\n\n/**\n * A repeated input's picks. Its value is one JSON object of row key to pick, so a pick stays with\n * its row when rows come and go, and the value is a plain string on the wire. Anything else reads\n * as no picks.\n */\nexport function readRowPicks(value: unknown): Record<string, string> {\n\tif (typeof value !== 'string' || !value.trimStart().startsWith('{')) return {};\n\ttry {\n\t\tconst parsed: unknown = JSON.parse(value);\n\t\tif (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) return {};\n\t\treturn Object.fromEntries(\n\t\t\tObject.entries(parsed).filter(\n\t\t\t\t(entry): entry is [string, string] => typeof entry[1] === 'string'\n\t\t\t)\n\t\t);\n\t} catch {\n\t\treturn {};\n\t}\n}\n\n/** The repeated input's value with one row's pick set. Picks for rows not shown now are kept. */\nexport function withRowPick(value: unknown, rowKey: string, pick: string): string {\n\treturn JSON.stringify({ ...readRowPicks(value), [rowKey]: pick });\n}\n\ninterface Lookup {\n\toptions: FormModel['options'];\n\trowOptions: FormModel['rowOptions'];\n}\n\ninterface SourcedPayload {\n\tsource: DynamicValueListSource;\n\tpayload: DynamicValueListPayload;\n}\n\n/** The options each targeted payload gives its input: one set, or the same set for every row. */\nfunction lookUpOptions(\n\tpayloads: SourcedPayload[],\n\trepeatById: Map<string, RepeatSpec>,\n\trepeatOf: Record<string, string>\n): Lookup {\n\tconst options: Lookup['options'] = {};\n\tconst rowOptions: Lookup['rowOptions'] = {};\n\n\tfor (const { source, payload } of payloads) {\n\t\tconst target = payload.targetInputId ?? source.targetInputId;\n\t\tif (!target || !payload.options || typeof payload.options !== 'object') continue;\n\t\tconst repeat = repeatById.get(repeatOf[target]);\n\t\tconst offered = payload.options;\n\t\tif (repeat) rowOptions[target] = repeat.rows.map(() => offered);\n\t\telse options[target] = offered;\n\t}\n\n\t// A Repeat's own options are for the members nothing else fills.\n\tfor (const { source, payload } of payloads) {\n\t\tconst repeat = repeatById.get(source.id);\n\t\tconst offered = payload.options;\n\t\tif (!repeat || !offered || Object.keys(offered).length === 0) continue;\n\t\tfor (const member of repeat.members) {\n\t\t\trowOptions[member] ??= repeat.rows.map(() => offered);\n\t\t}\n\t}\n\n\treturn { options, rowOptions };\n}\n\n// One options object per column and set of earlier picks, per table. This runs on every value\n// change, and a fresh object re-renders the dropdown it feeds.\nconst tableOptionsCache = new WeakMap<string[][], Map<string, Record<string, string>>>();\n\n/**\n * Narrows each pick table as Grasshopper does in the solve: an input offers the values its column\n * has in the rows left by the picks before it, and resolves its own pick against those.\n * `packages/schemas/fixtures/pick-table.json` pins both.\n */\nfunction narrowPickTables(\n\tpayloads: SourcedPayload[],\n\tvalues: Record<string, unknown>,\n\trepeatById: Map<string, RepeatSpec>,\n\trepeatOf: Record<string, string>\n): Lookup & { shown: Record<string, unknown> } {\n\tconst options: Lookup['options'] = {};\n\tconst rowOptions: Lookup['rowOptions'] = {};\n\tconst shown: Record<string, unknown> = {};\n\n\tfor (const { payload } of payloads) {\n\t\tconst table = payload.pickTable;\n\t\tif (!table || !Array.isArray(table.inputs) || !Array.isArray(table.rows)) continue;\n\n\t\tconst cache = tableOptionsCache.get(table.rows) ?? new Map<string, Record<string, string>>();\n\t\ttableOptionsCache.set(table.rows, cache);\n\n\t\t// The rows left by a run of picks, and those picks: one entry, or one per row of a repeat.\n\t\t// Row i reads entry i, the last entry covering the rest, so a repeated input after a single\n\t\t// one starts every row from the same rows.\n\t\ttype Left = { rows: string[][]; picked: string[] }[];\n\n\t\t// Where an input with no parent starts: the rows matching what the `by` inputs hold. A `by`\n\t\t// input holding several items (a repeated one) gives one entry per item. Cells match\n\t\t// ignoring case, so a table may say True where a toggle sends true; no value yet narrows\n\t\t// nothing.\n\t\tconst by = Array.isArray(table.by) ? table.by : [];\n\t\tconst held = by.map((id) => {\n\t\t\tconst value = values[id];\n\t\t\tconst items = Array.isArray(value) ? value : [value];\n\t\t\treturn items.filter((item) => item !== undefined && item !== null).map(String);\n\t\t});\n\t\tconst start: Left = Array.from(\n\t\t\t{ length: Math.max(1, ...held.map((h) => h.length)) },\n\t\t\t(_, i) => {\n\t\t\t\tconst picked = held.map((items) => items[Math.min(i, items.length - 1)]);\n\t\t\t\tconst rows = table.rows.filter((row) =>\n\t\t\t\t\tpicked.every(\n\t\t\t\t\t\t(item, d) => item === undefined || row[d]?.toLowerCase() === item.toLowerCase()\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\treturn { rows, picked: picked.map((item) => item ?? '') };\n\t\t\t}\n\t\t);\n\n\t\tconst left: Left[] = [];\n\t\ttable.inputs.forEach((id, index) => {\n\t\t\tconst column = by.length + index;\n\t\t\t// Without `parents` the inputs are one chain, each narrowing on the one before it.\n\t\t\tconst parent = table.parents?.[index] ?? index - 1;\n\t\t\tconst before = parent >= 0 && left[parent] ? left[parent] : start;\n\n\t\t\tconst repeat = repeatById.get(repeatOf[id]);\n\t\t\tconst rowPicks = repeat ? readRowPicks(values[id]) : undefined;\n\t\t\tconst picks = repeat ? repeat.rows.map((row) => rowPicks?.[row.key]) : [values[id]];\n\n\t\t\tconst offeredPerRow: Record<string, string>[] = [];\n\t\t\tconst resolved: string[] = [];\n\t\t\tconst after = picks.map((wanted, i) => {\n\t\t\t\tconst { rows, picked } = before[Math.min(i, before.length - 1)];\n\t\t\t\tconst key = JSON.stringify([column, ...picked]);\n\t\t\t\tlet offered = cache.get(key);\n\t\t\t\tif (!offered) {\n\t\t\t\t\toffered = {};\n\t\t\t\t\tfor (const row of rows) {\n\t\t\t\t\t\tconst cell = row[column];\n\t\t\t\t\t\tif (typeof cell === 'string' && cell !== '') offered[cell] = cell;\n\t\t\t\t\t}\n\t\t\t\t\tcache.set(key, offered);\n\t\t\t\t}\n\n\t\t\t\tofferedPerRow.push(offered);\n\t\t\t\tconst pick = resolvePick(offered, wanted);\n\t\t\t\tresolved.push(pick);\n\t\t\t\t// The column joins the picks: two inputs narrowing on the same ones offer different cells.\n\t\t\t\treturn {\n\t\t\t\t\trows: rows.filter((row) => row[column] === pick),\n\t\t\t\t\tpicked: [...picked, `${column}:${pick}`]\n\t\t\t\t};\n\t\t\t});\n\n\t\t\tif (repeat) {\n\t\t\t\trowOptions[id] = offeredPerRow;\n\t\t\t\tshown[id] = resolved;\n\t\t\t} else {\n\t\t\t\toptions[id] = offeredPerRow[0];\n\t\t\t\tshown[id] = resolved[0];\n\t\t\t}\n\t\t\t// A repeat with no rows shows nothing; the inputs after it still start from what was left.\n\t\t\tleft[index] = after.length > 0 ? after : before;\n\t\t});\n\t}\n\n\treturn { options, rowOptions, shown };\n}\n\n/**\n * What the form shows, from the payloads the last solve returned and the values on screen now.\n * A pick table is narrowed by the picks on screen, so changing one updates the lists that depend\n * on it without a solve.\n *\n * Pass the previous model to keep the identity of every array that didn't change: this runs on\n * each value change, and a fresh array re-renders its whole checklist or repeat.\n */\nexport function buildFormModel(\n\tschema: UISchema,\n\tvalues: Record<string, unknown>,\n\tprevious?: FormModel\n): FormModel {\n\tconst payloads: SourcedPayload[] = [];\n\tfor (const source of collectDynamicValueListSources(schema)) {\n\t\tconst payload = coercePayloadMemo(values[source.id]);\n\t\tif (payload) payloads.push({ source, payload });\n\t}\n\n\tconst repeats: RepeatSpec[] = [];\n\tconst repeatOf: Record<string, string> = {};\n\tfor (const { source, payload } of payloads) {\n\t\tif (!Array.isArray(payload.rows) || !Array.isArray(payload.members)) continue;\n\t\tconst rows = payload.rows.filter((r): r is RepeatRow => typeof r?.key === 'string');\n\t\trepeats.push({ id: source.id, rows, members: payload.members });\n\t\tfor (const member of payload.members) repeatOf[member] = source.id;\n\t}\n\tconst repeatById = new Map(repeats.map((r) => [r.id, r]));\n\n\tconst tables = narrowPickTables(payloads, values, repeatById, repeatOf);\n\tconst lookup = lookUpOptions(payloads, repeatById, repeatOf);\n\tObject.assign(lookup.options, tables.options);\n\tObject.assign(lookup.rowOptions, tables.rowOptions);\n\n\tconst shown: Record<string, unknown> = { ...tables.shown };\n\tfor (const { source, payload } of payloads) {\n\t\tconst target = payload.targetInputId ?? source.targetInputId;\n\t\tif (!target || !payload.resolvedInSolve || repeatOf[target]) continue;\n\t\tconst value = values[target];\n\t\tshown[target] = Array.isArray(value)\n\t\t\t? resolvePicks(lookup.options[target], value)\n\t\t\t: resolvePick(lookup.options[target], value);\n\t}\n\tfor (const repeat of repeats) {\n\t\tfor (const member of repeat.members) {\n\t\t\tconst picks = readRowPicks(values[member]);\n\t\t\tshown[member] = repeat.rows.map((row, i) =>\n\t\t\t\tresolvePick(lookup.rowOptions[member]?.[i], picks[row.key])\n\t\t\t);\n\t\t}\n\t}\n\n\tif (previous) {\n\t\treuseUnchanged(shown, previous.shown);\n\t\treuseUnchanged(lookup.rowOptions, previous.rowOptions);\n\t}\n\treturn { ...lookup, repeats, repeatOf, shown };\n}\n\nfunction sameValue(a: unknown, b: unknown): boolean {\n\tif (a === b) return true;\n\tif (!Array.isArray(a) || !Array.isArray(b) || a.length !== b.length) return false;\n\treturn a.every((item, i) => item === b[i]);\n}\n\nfunction reuseUnchanged(next: Record<string, unknown>, previous: Record<string, unknown>) {\n\tfor (const key of Object.keys(next)) {\n\t\tif (key in previous && sameValue(next[key], previous[key])) next[key] = previous[key];\n\t}\n}\n"],"mappings":";;AAiDA,SAAS,0BAA0B,OAAkD;CACpF,OACC,OAAO,UAAU,YAAY,UAAU,SAAS,mBAAmB,SAAS,aAAa;AAE3F;;;;;;;;AASA,SAAS,cAAc,OAAgD;CACtE,IAAI,0BAA0B,KAAK,GAAG,OAAO;CAE7C,IAAI,YAAY;CAEhB,KAAK,IAAI,IAAI,GAAG,IAAI,KAAK,OAAO,cAAc,UAAU,KAAK;EAC5D,IAAI;GACH,YAAY,KAAK,MAAM,SAAS;EACjC,QAAQ;GACP,OAAO;EACR;EACA,IAAI,0BAA0B,SAAS,GAAG,OAAO;CAClD;CAEA,OAAO;AACR;AAQA,IAAM,8BAAc,IAAI,IAA4C;AACpE,IAAM,mBAAmB;AAEzB,SAAS,kBAAkB,OAAgD;CAE1E,IAAI,OAAO,UAAU,YAAY,MAAM,SAAS,MAAM,OAAO,cAAc,KAAK;CAChF,MAAM,MAAM,YAAY,IAAI,KAAK;CACjC,IAAI,QAAQ,KAAA,KAAa,YAAY,IAAI,KAAK,GAAG;EAEhD,YAAY,OAAO,KAAK;EACxB,YAAY,IAAI,OAAO,OAAO,IAAI;EAClC,OAAO,OAAO;CACf;CACA,MAAM,aAAa,YAAY,IAAI;CACnC,MAAM,SAAS,cAAc,KAAK;CAIlC,IAAI,MAAM,SAAS,QAAY;EAC9B,MAAM,cAAc,QAAQ,UAAU,OAAO,KA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MAAM,QAAQ,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,KAAK,EAAE,WAAW,EAAE,QAAQ,OAAO;CAC5E,OAAO,EAAE,OAAO,MAAM,MAAM,SAAS,EAAE,EAAE;AAC1C;AAEA,SAAS,eAAe,MAA+B,UAAmC;CACzF,KAAK,MAAM,OAAO,OAAO,KAAK,IAAI,GACjC,IAAI,OAAO,YAAY,UAAU,KAAK,MAAM,SAAS,IAAI,GAAG,KAAK,OAAO,SAAS;AAEnF"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
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
|
+
import { D as computeDebugMode, f as getLogger, w as lazyLogger } from "./providers.server.js";
|
|
3
4
|
import { r as resolveComputeLimits } from "./limits.js";
|
|
4
5
|
import "./compute.js";
|
|
5
6
|
// src/lib/server/computeLimits.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.server.js","names":[],"sources":["../../../src/lib/server/computeLimits.ts","../../../src/lib/server/compute/engine.server.ts"],"sourcesContent":["/**\n * Thin adapter over `@selvajs/server`'s `resolveComputeLimits`: reads the server\n * env once and re-exports the resolved values as named constants.\n *\n * Client-side counterparts (in-flight compute throttle, slider debounce) are\n * bundled into the client and can't read env — see `async-throttle.ts` in\n * `@selvajs/solve/client` and the input components.\n */\n\nimport { env } from '#lib/server/env.js';\nimport { resolveComputeLimits } from '@selvajs/server/compute';\n// Limits resolve at module scope, before the pino swap — a captured logger\n// would pin the boot placeholder, so this needs the forwarding one.\nimport { lazyLogger } from '#lib/server/providers.server.js';\n\n// The logger surfaces malformed env values (a non-numeric COMPUTE_RATE_LIMIT_MAX\n// falls back to its default).\nconst limits = resolveComputeLimits(env, lazyLogger);\n\n/** The whole resolved object — passed wholesale to `SolveEngine` (`compute/engine.server.ts`). */\nexport const computeLimits = limits;\n\n// Per-key compute rate limit (see computeRateLimit.server.ts).\nexport const RATE_LIMIT_WINDOW_MS = limits.rateLimitWindowMs;\nexport const RATE_LIMIT_MAX_REQUESTS = limits.rateLimitMaxRequests;\n\n// Upload caps. Only the .gh cap is an env var. The Rhino.Compute server caps at\n// RHINO_COMPUTE_MAX_REQUEST_SIZE (default 50 MB), so raising\n// MAX_DEFINITION_FILE_SIZE_BYTES past that only defers the 413 to compute:\n// raise it there too.\nexport const MAX_DEFINITION_FILE_SIZE = limits.maxDefinitionFileSize;\nexport const MAX_IMAGE_FILE_SIZE = limits.maxImageFileSize;\n\n// /api/compute JSON request/response body caps. In a production (adapter-node)\n// build these must stay <= the global BODY_SIZE_LIMIT or the global backstop\n// rejects first; under vite dev it isn't enforced.\nexport const COMPUTE_REQUEST_MAX_BYTES = limits.computeRequestMaxBytes;\nexport const COMPUTE_RESPONSE_MAX_BYTES = limits.computeResponseMaxBytes;\n\n// Remote-definition fetch caps (SSRF + slow-loris protection sits in safe-url).\nexport const REMOTE_DEFINITION_MAX_BYTES = limits.remoteDefinitionMaxBytes;\nexport const REMOTE_DEFINITION_FETCH_TIMEOUT_MS = limits.remoteDefinitionFetchTimeoutMs;\n\n// TTL for the in-process cache of REMOTE-fetched .gh bytes. Only the remote path\n// is TTL'd — the definition cache below is keyed on an immutable version id.\nexport const REMOTE_DEFINITION_CACHE_TTL_MS = limits.remoteDefinitionCacheTtlMs;\n\n// Server-side solve-result cache (`cachesolve`).\nexport const COMPUTE_SERVER_CACHESOLVE = limits.computeServerCachesolve;\n\n// Backpressure: queue-depth cap and queue-wait deadline. Both 0 = unbounded/off.\nexport const COMPUTE_MAX_QUEUE_DEPTH = limits.computeMaxQueueDepth;\nexport const COMPUTE_QUEUE_WAIT_MS = limits.computeQueueWaitMs;\n\n// Definition cache — .gh bytes keyed on immutable version id. 0 disables.\nexport const COMPUTE_DEFINITION_CACHE_BYTES = limits.computeDefinitionCacheBytes;\n\n// Solve cache — results, PER warm client (so the worst case is ×16). 0 disables.\nexport const COMPUTE_SOLVE_CACHE_BYTES = limits.computeSolveCacheBytes;\n","/**\n * App-wide `SolveEngine` instance (`@selvajs/solve/server`) — backs the warm\n * client cache, the definition-byte cache, and solve coalescing for the whole app.\n */\n\nimport { DEFAULT_SOLVE_DEADLINE_MS, SolveEngine, type CachedClient } from '@selvajs/solve/server';\nimport { env } from '#lib/server/env.js';\nimport { getLogger } from '#lib/server/providers.server.js';\nimport { computeLimits, COMPUTE_REQUEST_MAX_BYTES } from '#lib/server/computeLimits.js';\nimport { computeDebugMode } from '#lib/server/config/settings.js';\nimport type { ComputeServerConfig } from '@selvajs/platform';\n\n// `verbose` adds lib-level request logs and Compute's raw error bodies, and implies `on`.\nconst COMPUTE_DEBUG_MODE = computeDebugMode(env);\n\nexport const COMPUTE_DEBUG = COMPUTE_DEBUG_MODE !== 'off';\nexport const COMPUTE_DEBUG_VERBOSE = COMPUTE_DEBUG_MODE === 'verbose';\n\nexport const engine = new SolveEngine({\n\tlimits: computeLimits,\n\tdebug: COMPUTE_DEBUG ? (COMPUTE_DEBUG_VERBOSE ? 'verbose' : true) : false,\n\tonDebugLog: (message) => getLogger().debug(message, { component: 'Compute/client-cache' }),\n\tonSolveCoalesced: (key) => {\n\t\tif (COMPUTE_DEBUG) {\n\t\t\t// key = version:server:tree-json — truncate the tree tail for the log.\n\t\t\tgetLogger().debug('Coalesced onto in-flight solve', {\n\t\t\t\tcomponent: 'Compute/single-flight',\n\t\t\t\tkey: `${key.slice(0, 96)}…`\n\t\t\t});\n\t\t}\n\t}\n});\n\n/** Get (or create) the warm client + scheduler for a resolved compute server. */\nexport function getClient(serverConfig: ComputeServerConfig): Promise<CachedClient> {\n\treturn engine.getClient({\n\t\tid: serverConfig.id,\n\t\tserverUrl: serverConfig.serverUrl,\n\t\tapiKey: serverConfig.apiKey\n\t});\n}\n\n/**\n * The solve deadline `server` reports, for the browser's AbortController. A cold client connects\n * first, and a page must not wait on a slow Compute for it: past `waitMs` it gets the default.\n * The connect carries on and warms the client for the first solve.\n */\nexport async function solveDeadlineFor(\n\tserverConfig: ComputeServerConfig,\n\twaitMs = 2_000\n): Promise<number> {\n\tconst fallback = new Promise<number>((resolve) => {\n\t\tsetTimeout(() => resolve(DEFAULT_SOLVE_DEADLINE_MS), waitMs).unref?.();\n\t});\n\tconst reported = getClient(serverConfig).then(\n\t\t({ limits }) => limits.solveDeadlineMs,\n\t\t() => DEFAULT_SOLVE_DEADLINE_MS\n\t);\n\treturn Promise.race([reported, fallback]);\n}\n\n/**\n * The largest solve request Selva takes: the largest a warm compute server reports\n * (`RHINO_COMPUTE_MAX_REQUEST_SIZE`), so that one setting drives both. Until a server has been\n * reached, `COMPUTE_REQUEST_MAX_BYTES`. Each server still refuses what exceeds its own cap.\n */\nexport function computeRequestCap(): number {\n\treturn engine.largestReportedRequestBytes() ?? COMPUTE_REQUEST_MAX_BYTES;\n}\n\n/** Drop the warm client for a server whose config just changed (URL/key rotation or deletion). */\nexport function evictComputeClient(id: string): void {\n\tengine.evictServer(id);\n}\n\n/**\n * Drop cached solve results held by this Selva process (every warm client's\n * scheduler). Separate from the compute server's own `cache/purge`: that one\n * clears Rhino's `cachesolve`, this one clears the layer in front of it.\n */\nexport function clearSolveResultCache(): void {\n\tengine.clearSolveCaches();\n}\n\n/** Drop the `.gh` bytes this Selva process is holding. Costs a storage re-read, nothing more. */\nexport function clearDefinitionCache(): void {\n\tengine.clearDefinitionCache();\n}\n\n/** Solve-cache counters for the admin panel's hit rate. */\nexport function solveCacheStats() {\n\treturn engine.stats().client;\n}\n\n/** Definition-byte-cache counters (hits/misses/evictions/entries/bytes) for admin/debug surfaces. */\nexport function definitionByteCacheStats() {\n\treturn engine.stats().definitionBytes;\n}\n\n/** Materialize a version's bytes through the shared byte cache (render/IO path). */\nexport function loadDefinitionBytes(\n\tversionId: string,\n\tload: () => Promise<Uint8Array>\n): Promise<Uint8Array> {\n\treturn engine.definitionRef(versionId, load).load();\n}\n\nexport type { CachedClient };\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"engine.server.js","names":[],"sources":["../../../src/lib/server/computeLimits.ts","../../../src/lib/server/compute/engine.server.ts"],"sourcesContent":["/**\n * Thin adapter over `@selvajs/server`'s `resolveComputeLimits`: reads the server\n * env once and re-exports the resolved values as named constants.\n *\n * Client-side counterparts (in-flight compute throttle, slider debounce) are\n * bundled into the client and can't read env — see `async-throttle.ts` in\n * `@selvajs/solve/client` and the input components.\n */\n\nimport { env } from '#lib/server/env.js';\nimport { resolveComputeLimits } from '@selvajs/server/compute';\n// Limits resolve at module scope, before the pino swap — a captured logger\n// would pin the boot placeholder, so this needs the forwarding one.\nimport { lazyLogger } from '#lib/server/providers.server.js';\n\n// The logger surfaces malformed env values (a non-numeric COMPUTE_RATE_LIMIT_MAX\n// falls back to its default).\nconst limits = resolveComputeLimits(env, lazyLogger);\n\n/** The whole resolved object — passed wholesale to `SolveEngine` (`compute/engine.server.ts`). */\nexport const computeLimits = limits;\n\n// Per-key compute rate limit (see computeRateLimit.server.ts).\nexport const RATE_LIMIT_WINDOW_MS = limits.rateLimitWindowMs;\nexport const RATE_LIMIT_MAX_REQUESTS = limits.rateLimitMaxRequests;\n\n// Upload caps. Only the .gh cap is an env var. The Rhino.Compute server caps at\n// RHINO_COMPUTE_MAX_REQUEST_SIZE (default 50 MB), so raising\n// MAX_DEFINITION_FILE_SIZE_BYTES past that only defers the 413 to compute:\n// raise it there too.\nexport const MAX_DEFINITION_FILE_SIZE = limits.maxDefinitionFileSize;\nexport const MAX_IMAGE_FILE_SIZE = limits.maxImageFileSize;\n\n// /api/compute JSON request/response body caps. In a production (adapter-node)\n// build these must stay <= the global BODY_SIZE_LIMIT or the global backstop\n// rejects first; under vite dev it isn't enforced.\nexport const COMPUTE_REQUEST_MAX_BYTES = limits.computeRequestMaxBytes;\nexport const COMPUTE_RESPONSE_MAX_BYTES = limits.computeResponseMaxBytes;\n\n// Remote-definition fetch caps (SSRF + slow-loris protection sits in safe-url).\nexport const REMOTE_DEFINITION_MAX_BYTES = limits.remoteDefinitionMaxBytes;\nexport const REMOTE_DEFINITION_FETCH_TIMEOUT_MS = limits.remoteDefinitionFetchTimeoutMs;\n\n// TTL for the in-process cache of REMOTE-fetched .gh bytes. Only the remote path\n// is TTL'd — the definition cache below is keyed on an immutable version id.\nexport const REMOTE_DEFINITION_CACHE_TTL_MS = limits.remoteDefinitionCacheTtlMs;\n\n// Server-side solve-result cache (`cachesolve`).\nexport const COMPUTE_SERVER_CACHESOLVE = limits.computeServerCachesolve;\n\n// Backpressure: queue-depth cap and queue-wait deadline. Both 0 = unbounded/off.\nexport const COMPUTE_MAX_QUEUE_DEPTH = limits.computeMaxQueueDepth;\nexport const COMPUTE_QUEUE_WAIT_MS = limits.computeQueueWaitMs;\n\n// Definition cache — .gh bytes keyed on immutable version id. 0 disables.\nexport const COMPUTE_DEFINITION_CACHE_BYTES = limits.computeDefinitionCacheBytes;\n\n// Solve cache — results, PER warm client (so the worst case is ×16). 0 disables.\nexport const COMPUTE_SOLVE_CACHE_BYTES = limits.computeSolveCacheBytes;\n","/**\n * App-wide `SolveEngine` instance (`@selvajs/solve/server`) — backs the warm\n * client cache, the definition-byte cache, and solve coalescing for the whole app.\n */\n\nimport { DEFAULT_SOLVE_DEADLINE_MS, SolveEngine, type CachedClient } from '@selvajs/solve/server';\nimport { env } from '#lib/server/env.js';\nimport { getLogger } from '#lib/server/providers.server.js';\nimport { computeLimits, COMPUTE_REQUEST_MAX_BYTES } from '#lib/server/computeLimits.js';\nimport { computeDebugMode } from '#lib/server/config/settings.js';\nimport type { ComputeServerConfig } from '@selvajs/platform';\n\n// `verbose` adds lib-level request logs and Compute's raw error bodies, and implies `on`.\nconst COMPUTE_DEBUG_MODE = computeDebugMode(env);\n\nexport const COMPUTE_DEBUG = COMPUTE_DEBUG_MODE !== 'off';\nexport const COMPUTE_DEBUG_VERBOSE = COMPUTE_DEBUG_MODE === 'verbose';\n\nexport const engine = new SolveEngine({\n\tlimits: computeLimits,\n\tdebug: COMPUTE_DEBUG ? (COMPUTE_DEBUG_VERBOSE ? 'verbose' : true) : false,\n\tonDebugLog: (message) => getLogger().debug(message, { component: 'Compute/client-cache' }),\n\tonSolveCoalesced: (key) => {\n\t\tif (COMPUTE_DEBUG) {\n\t\t\t// key = version:server:tree-json — truncate the tree tail for the log.\n\t\t\tgetLogger().debug('Coalesced onto in-flight solve', {\n\t\t\t\tcomponent: 'Compute/single-flight',\n\t\t\t\tkey: `${key.slice(0, 96)}…`\n\t\t\t});\n\t\t}\n\t}\n});\n\n/** Get (or create) the warm client + scheduler for a resolved compute server. */\nexport function getClient(serverConfig: ComputeServerConfig): Promise<CachedClient> {\n\treturn engine.getClient({\n\t\tid: serverConfig.id,\n\t\tserverUrl: serverConfig.serverUrl,\n\t\tapiKey: serverConfig.apiKey\n\t});\n}\n\n/**\n * The solve deadline `server` reports, for the browser's AbortController. A cold client connects\n * first, and a page must not wait on a slow Compute for it: past `waitMs` it gets the default.\n * The connect carries on and warms the client for the first solve.\n */\nexport async function solveDeadlineFor(\n\tserverConfig: ComputeServerConfig,\n\twaitMs = 2_000\n): Promise<number> {\n\tconst fallback = new Promise<number>((resolve) => {\n\t\tsetTimeout(() => resolve(DEFAULT_SOLVE_DEADLINE_MS), waitMs).unref?.();\n\t});\n\tconst reported = getClient(serverConfig).then(\n\t\t({ limits }) => limits.solveDeadlineMs,\n\t\t() => DEFAULT_SOLVE_DEADLINE_MS\n\t);\n\treturn Promise.race([reported, fallback]);\n}\n\n/**\n * The largest solve request Selva takes: the largest a warm compute server reports\n * (`RHINO_COMPUTE_MAX_REQUEST_SIZE`), so that one setting drives both. Until a server has been\n * reached, `COMPUTE_REQUEST_MAX_BYTES`. Each server still refuses what exceeds its own cap.\n */\nexport function computeRequestCap(): number {\n\treturn engine.largestReportedRequestBytes() ?? COMPUTE_REQUEST_MAX_BYTES;\n}\n\n/** Drop the warm client for a server whose config just changed (URL/key rotation or deletion). */\nexport function evictComputeClient(id: string): void {\n\tengine.evictServer(id);\n}\n\n/**\n * Drop cached solve results held by this Selva process (every warm client's\n * scheduler). Separate from the compute server's own `cache/purge`: that one\n * clears Rhino's `cachesolve`, this one clears the layer in front of it.\n */\nexport function clearSolveResultCache(): void {\n\tengine.clearSolveCaches();\n}\n\n/** Drop the `.gh` bytes this Selva process is holding. Costs a storage re-read, nothing more. */\nexport function clearDefinitionCache(): void {\n\tengine.clearDefinitionCache();\n}\n\n/** Solve-cache counters for the admin panel's hit rate. */\nexport function solveCacheStats() {\n\treturn engine.stats().client;\n}\n\n/** Definition-byte-cache counters (hits/misses/evictions/entries/bytes) for admin/debug surfaces. */\nexport function definitionByteCacheStats() {\n\treturn engine.stats().definitionBytes;\n}\n\n/** Materialize a version's bytes through the shared byte cache (render/IO path). */\nexport function loadDefinitionBytes(\n\tversionId: string,\n\tload: () => Promise<Uint8Array>\n): Promise<Uint8Array> {\n\treturn engine.definitionRef(versionId, load).load();\n}\n\nexport type { CachedClient };\n"],"mappings":";;;;;;;;;;;;;;AAiBA,IAAM,SAAS,qBAAqB,KAAK,UAAU;;AAGnD,IAAa,gBAAgB;AAG7B,IAAa,uBAAuB,OAAO;AAC3C,IAAa,0BAA0B,OAAO;AAM9C,IAAa,2BAA2B,OAAO;AAC/C,IAAa,sBAAsB,OAAO;AAK1C,IAAa,4BAA4B,OAAO;AAChD,IAAa,6BAA6B,OAAO;AAGjD,IAAa,8BAA8B,OAAO;AAClD,IAAa,qCAAqC,OAAO;AAIzD,IAAa,iCAAiC,OAAO;AAGZ,OAAO;AAGT,OAAO;AACT,OAAO;AAG5C,IAAa,iCAAiC,OAAO;AAGrD,IAAa,4BAA4B,OAAO;;;;;;AC7ChD,IAAM,qBAAqB,iBAAiB,GAAG;AAE/C,IAAa,gBAAgB,uBAAuB;AACpD,IAAa,wBAAwB,uBAAuB;AAE5D,IAAa,SAAS,IAAI,YAAY;CACrC,QAAQ;CACR,OAAO,gBAAiB,wBAAwB,YAAY,OAAQ;CACpE,aAAa,YAAY,UAAU,CAAC,CAAC,MAAM,SAAS,EAAE,WAAW,uBAAuB,CAAC;CACzF,mBAAmB,QAAQ;EAC1B,IAAI,eAEH,UAAU,CAAC,CAAC,MAAM,kCAAkC;GACnD,WAAW;GACX,KAAK,GAAG,IAAI,MAAM,GAAG,EAAE,EAAE;EAC1B,CAAC;CAEH;AACD,CAAC;;AAGD,SAAgB,UAAU,cAA0D;CACnF,OAAO,OAAO,UAAU;EACvB,IAAI,aAAa;EACjB,WAAW,aAAa;EACxB,QAAQ,aAAa;CACtB,CAAC;AACF;;;;;;AAOA,eAAsB,iBACrB,cACA,SAAS,KACS;CAClB,MAAM,WAAW,IAAI,SAAiB,YAAY;EACjD,iBAAiB,QAAQ,yBAAyB,GAAG,MAAM,CAAC,CAAC,QAAQ;CACtE,CAAC;CACD,MAAM,WAAW,UAAU,YAAY,CAAC,CAAC,MACvC,EAAE,aAAa,OAAO,uBACjB,yBACP;CACA,OAAO,QAAQ,KAAK,CAAC,UAAU,QAAQ,CAAC;AACzC;;;;;;AAOA,SAAgB,oBAA4B;CAC3C,OAAO,OAAO,4BAA4B,KAAK;AAChD;;AAGA,SAAgB,mBAAmB,IAAkB;CACpD,OAAO,YAAY,EAAE;AACtB;;;;;;AAOA,SAAgB,wBAA8B;CAC7C,OAAO,iBAAiB;AACzB;;AAGA,SAAgB,uBAA6B;CAC5C,OAAO,qBAAqB;AAC7B;;AAGA,SAAgB,kBAAkB;CACjC,OAAO,OAAO,MAAM,CAAC,CAAC;AACvB;;AAGA,SAAgB,2BAA2B;CAC1C,OAAO,OAAO,MAAM,CAAC,CAAC;AACvB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as queue_micro_task, S as active_reaction, T as set_active_reaction, Z as without_reactive_context, jt as define_property, w as set_active_effect, x as active_effect } from "./
|
|
1
|
+
import { $ as queue_micro_task, S as active_reaction, T as set_active_reaction, Z as without_reactive_context, jt as define_property, w as set_active_effect, x as active_effect } from "./server4.js";
|
|
2
2
|
// ../../node_modules/.pnpm/svelte@5.57.3_@typescript-eslint+types@8.72.1/node_modules/svelte/src/internal/client/dom/elements/events.js
|
|
3
3
|
/**
|
|
4
4
|
* Used on elements, as a map of event type -> event handler,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as spread_props } from "./
|
|
1
|
+
import { d as spread_props } from "./server4.js";
|
|
2
2
|
import { n as Icon } from "./utils.js";
|
|
3
3
|
// ../../node_modules/.pnpm/@lucide+svelte@1.66.0_svelte@5.57.3_@typescript-eslint+types@8.72.1_/node_modules/@lucide/svelte/dist/icons/external-link.svelte
|
|
4
4
|
var __iconData = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as spread_props } from "./
|
|
1
|
+
import { d as spread_props } from "./server4.js";
|
|
2
2
|
import { n as Icon } from "./utils.js";
|
|
3
3
|
// ../../node_modules/.pnpm/@lucide+svelte@1.66.0_svelte@5.57.3_@typescript-eslint+types@8.72.1_/node_modules/@lucide/svelte/dist/icons/folder-kanban.svelte
|
|
4
4
|
var __iconData = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as spread_props } from "./
|
|
1
|
+
import { d as spread_props } from "./server4.js";
|
|
2
2
|
import { n as Icon } from "./utils.js";
|
|
3
3
|
// ../../node_modules/.pnpm/@lucide+svelte@1.66.0_svelte@5.57.3_@typescript-eslint+types@8.72.1_/node_modules/@lucide/svelte/dist/icons/folder-open.svelte
|
|
4
4
|
var __iconData = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as spread_props } from "./
|
|
1
|
+
import { d as spread_props } from "./server4.js";
|
|
2
2
|
import { n as Icon } from "./utils.js";
|
|
3
3
|
// ../../node_modules/.pnpm/@lucide+svelte@1.66.0_svelte@5.57.3_@typescript-eslint+types@8.72.1_/node_modules/@lucide/svelte/dist/icons/folders.svelte
|
|
4
4
|
var __iconData = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ft as run, Ot as attr, _ as setContext, a as derived, c as head, g as hasContext, h as getContext, p as html } from "./
|
|
1
|
+
import { Ft as run, Ot as attr, _ as setContext, a as derived, c as head, g as hasContext, h as getContext, p as html } from "./server4.js";
|
|
2
2
|
import { r as on } from "./events.js";
|
|
3
3
|
import { a as createSubscriber, n as SvelteMap, t as MediaQuery } from "./index-server.js";
|
|
4
4
|
import "./index-server2.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as spread_props } from "./
|
|
1
|
+
import { d as spread_props } from "./server4.js";
|
|
2
2
|
import { n as Icon } from "./utils.js";
|
|
3
3
|
// ../../node_modules/.pnpm/@lucide+svelte@1.66.0_svelte@5.57.3_@typescript-eslint+types@8.72.1_/node_modules/@lucide/svelte/dist/icons/gauge.svelte
|
|
4
4
|
var __iconData = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { J as definitionPaths, q as actorOf } from "./providers.server.js";
|
|
2
1
|
import { $ as canView, G as scopeAllows, K as canChangeOrgRole, O as ApiErrorCode, Q as canSolve, S as requireManageOrgMembers, T as requireTargetIsOrgMember, W as outsideTokenOrg, Y as canEdit, _ as requireEditableDefinition, a as canCreateProjectIn, et as checkOwnerRemoval, f as requireCanEditProjectSettings, g as requireCanViewProject, i as canActorChangeOrgRole, j as isApiError, k as apiError, l as requireCanCreateDefinition, m as requireCanReclaim, o as projectAccessInputFromRowsWith, p as requireCanManage, q as canCreateDefinition, r as assertCanGrantPlatformPermissions, s as requireActingOrg, t as splitFlatPermissions, u as requireCanCreateProject, w as requireProjectVisibilityAllowed, x as requireManageOrgCompute } from "./access.js";
|
|
2
|
+
import { B as definitionPaths, z as actorOf } from "./providers.server.js";
|
|
3
3
|
import { a as formatApiScope, i as describeApiScope, o as parseApiScope } from "./types.js";
|
|
4
4
|
import { r as hasPermission, t as SYSTEM_CONTEXT } from "./context.js";
|
|
5
5
|
import { a as inventoryWarnings, h as isPlatformServer, m as isOrgServer, n as diffLines, o as summarizeInventory, p as serversVisibleTo, t as diffInventories } from "./inventory.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { v as ssr_context, y as lifecycle_function_unavailable } from "./
|
|
1
|
+
import { v as ssr_context, y as lifecycle_function_unavailable } from "./server4.js";
|
|
2
2
|
// ../../node_modules/.pnpm/svelte@5.57.3_@typescript-eslint+types@8.72.1/node_modules/svelte/src/index-server.js
|
|
3
3
|
/** @import { SSRContext } from '#server' */
|
|
4
4
|
/** @import { Renderer } from './internal/server/renderer.js' */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as derived, d as spread_props, i as bind_props, kt as clsx, l as props_id, r as attributes } from "./
|
|
1
|
+
import { a as derived, d as spread_props, i as bind_props, kt as clsx, l as props_id, r as attributes } from "./server4.js";
|
|
2
2
|
import { r as on } from "./events.js";
|
|
3
3
|
import "./index-server.js";
|
|
4
4
|
import { c as getDataOpenClosed, f as mergeProps, l as getDataTransitionAttrs, o as createBitsAttrs, r as boolToStr, t as createId, u as attachRef, y as boxWith } from "./create-id.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as bind_props, kt as clsx, r as attributes } from "./
|
|
1
|
+
import { i as bind_props, kt as clsx, r as attributes } from "./server4.js";
|
|
2
2
|
import { t as cn } from "./utils.js";
|
|
3
3
|
// ../ui/src/lib/components/primitives/input/input.svelte
|
|
4
4
|
function Input($$renderer, $$props) {
|