@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,9 +1,10 @@
|
|
|
1
1
|
import { a as isDynamicValueListWidget, c as isTextWidget, i as isDropdownWidget, n as isCheckboxWidget, o as isFileWidget, r as isColorWidget, s as isNumberWidget } from "../../../../chunks/schema.js";
|
|
2
2
|
import { n as getInputItems, r as getLayoutItems, t as getGroups } from "../../../../chunks/traversal.js";
|
|
3
|
+
import { n as keepHiddenPicks, r as withRowPick, t as buildFormModel } from "../../../../chunks/dynamic-value-list.js";
|
|
3
4
|
import { _ as subFolderSegments, m as downloadFileDataByRoot, p as decodeBase64ToBinary$1, r as GrasshopperResponseProcessor } from "../../../../chunks/grasshopper.js";
|
|
4
|
-
import {
|
|
5
|
+
import { a as serverSourcedInputIds, i as raceAbort, r as KEEPALIVE_PREFERENCE, t as ASYNC_PREFERENCE } from "../../../../chunks/async-solve-Doflh4BJ.js";
|
|
5
6
|
import { i as outcomeFromComputeMessages, n as decodeOutcome, r as finalizeResult, t as decodeDiagnostic } from "../../../../chunks/outcome-D28FgvFK.js";
|
|
6
|
-
import { Ft as run, Lt as escape_html, Ot as attr, _ as setContext, a as derived, d as spread_props, f as stringify, h as getContext, i as bind_props, kt as clsx$1, l as props_id, n as attr_style, o as element$1, ot as snapshot, p as html, r as attributes, s as ensure_array_like, t as attr_class } from "../../../../chunks/
|
|
7
|
+
import { Ft as run, Lt as escape_html, Ot as attr, _ as setContext, a as derived, d as spread_props, f as stringify, h as getContext, i as bind_props, kt as clsx$1, l as props_id, n as attr_style, o as element$1, ot as snapshot, p as html, r as attributes, s as ensure_array_like, t as attr_class } from "../../../../chunks/server4.js";
|
|
7
8
|
import { c as watch$1, s as Context, t as FOOTER_CONTEXT_KEY } from "../../../../chunks/footerContext.svelte.js";
|
|
8
9
|
import { r as on } from "../../../../chunks/events.js";
|
|
9
10
|
import { a as createSubscriber, n as SvelteMap, r as SvelteSet, t as MediaQuery } from "../../../../chunks/index-server.js";
|
|
@@ -21,7 +22,7 @@ import { t as Chevron_right } from "../../../../chunks/chevron-right.js";
|
|
|
21
22
|
import { a as Loader_circle, i as Play, n as Dialog_footer, o as File_up, r as Upload, s as Ellipsis, t as Separator } from "../../../../chunks/separator.js";
|
|
22
23
|
import { t as Folder_open } from "../../../../chunks/folder-open.js";
|
|
23
24
|
import { t as Minus } from "../../../../chunks/minus.js";
|
|
24
|
-
import { t as Server } from "../../../../chunks/
|
|
25
|
+
import { t as Server } from "../../../../chunks/server5.js";
|
|
25
26
|
import { t as X } from "../../../../chunks/x.js";
|
|
26
27
|
import { D as ARROW_UP, E as ARROW_RIGHT, G as watch$2, K as useDebounce, L as DOMContext$1, M as HOME, T as ARROW_LEFT, U as IsMounted, h as AnimationsComplete, n as useId, p as noop$2, q as Context$1, v as isElementOrSVGElement, w as ARROW_DOWN, y as isHTMLElement$1 } from "../../../../chunks/scroll-lock.js";
|
|
27
28
|
import { a as Hidden_input, i as Select_item, n as Select_trigger, r as Select_content, t as Root } from "../../../../chunks/select.js";
|
|
@@ -14281,13 +14282,13 @@ function createInitialState(schema, scopeKey, read) {
|
|
|
14281
14282
|
* `force` overrides that, and what it solves is every pending edit.
|
|
14282
14283
|
*/
|
|
14283
14284
|
function applyValueChange(state, id, value, instanceSolve, force = false) {
|
|
14284
|
-
if (instanceSolve === false && !force && sameValue
|
|
14285
|
+
if (instanceSolve === false && !force && sameValue(state.values[id], value)) return false;
|
|
14285
14286
|
state.values[id] = value;
|
|
14286
14287
|
if (instanceSolve !== false) return true;
|
|
14287
14288
|
state.hasPendingChanges = !force;
|
|
14288
14289
|
return force;
|
|
14289
14290
|
}
|
|
14290
|
-
function sameValue
|
|
14291
|
+
function sameValue(a, b) {
|
|
14291
14292
|
if (Object.is(a, b)) return true;
|
|
14292
14293
|
if (a === null || b === null || typeof a !== "object" || typeof b !== "object") return false;
|
|
14293
14294
|
return stableInputKey(a) === stableInputKey(b);
|
|
@@ -14945,6 +14946,57 @@ function prepend(first, reader) {
|
|
|
14945
14946
|
}
|
|
14946
14947
|
});
|
|
14947
14948
|
}
|
|
14949
|
+
var ASYNC_REQUEST_HEADERS = { Prefer: ASYNC_PREFERENCE };
|
|
14950
|
+
/** A dropped poll is retried this many times in a row before the solve counts as lost. */
|
|
14951
|
+
var POLL_RETRIES = 3;
|
|
14952
|
+
var RETRY_DELAY_MS = 1e3;
|
|
14953
|
+
/**
|
|
14954
|
+
* The solve's real response when `res` is a detached solve's 202 (wire format in
|
|
14955
|
+
* `shared/async-solve.ts`), or `res` itself when the server answered synchronously. Polls until
|
|
14956
|
+
* the solve ends. Null when `signal` aborted first; the server is then told to stop it.
|
|
14957
|
+
*
|
|
14958
|
+
* @throws when the server stops answering for the solve.
|
|
14959
|
+
*/
|
|
14960
|
+
async function followAsyncSolve(res, init) {
|
|
14961
|
+
if (res.status !== 202 || res.headers.get("Preference-Applied") !== "respond-async") return res;
|
|
14962
|
+
const location = res.headers.get("Location");
|
|
14963
|
+
if (!location) throw new Error("The server accepted the solve but did not say where to wait.");
|
|
14964
|
+
const doFetch = init.fetch ?? fetch;
|
|
14965
|
+
const poll = new URL(location, res.url || globalThis.location?.href);
|
|
14966
|
+
poll.searchParams.set("wait", String(25));
|
|
14967
|
+
const cancel = () => void doFetch(location, {
|
|
14968
|
+
method: "DELETE",
|
|
14969
|
+
headers: init.headers,
|
|
14970
|
+
keepalive: true
|
|
14971
|
+
}).catch(() => {});
|
|
14972
|
+
let failures = 0;
|
|
14973
|
+
for (;;) {
|
|
14974
|
+
if (init.signal.aborted) {
|
|
14975
|
+
cancel();
|
|
14976
|
+
return null;
|
|
14977
|
+
}
|
|
14978
|
+
let next;
|
|
14979
|
+
try {
|
|
14980
|
+
next = await doFetch(poll, {
|
|
14981
|
+
headers: init.headers,
|
|
14982
|
+
signal: init.signal,
|
|
14983
|
+
cache: "no-store"
|
|
14984
|
+
});
|
|
14985
|
+
} catch (err) {
|
|
14986
|
+
if (init.signal.aborted) {
|
|
14987
|
+
cancel();
|
|
14988
|
+
return null;
|
|
14989
|
+
}
|
|
14990
|
+
failures += 1;
|
|
14991
|
+
if (failures > POLL_RETRIES) throw new Error("Lost contact with the server while the solve ran. Please try again.", { cause: err });
|
|
14992
|
+
await new Promise((resolve) => setTimeout(resolve, RETRY_DELAY_MS * failures));
|
|
14993
|
+
continue;
|
|
14994
|
+
}
|
|
14995
|
+
failures = 0;
|
|
14996
|
+
if (next.status !== 202) return next;
|
|
14997
|
+
await next.body?.cancel().catch(() => {});
|
|
14998
|
+
}
|
|
14999
|
+
}
|
|
14948
15000
|
/** A `Server-Timing` header's `dur` entries, in ms by metric name. */
|
|
14949
15001
|
function parseServerTiming(header) {
|
|
14950
15002
|
const out = {};
|
|
@@ -15096,14 +15148,16 @@ function createComputeFetchSolveFn(opts) {
|
|
|
15096
15148
|
...streamId ? { streamId } : {},
|
|
15097
15149
|
...call.solveMode === "preview" ? { mode: "preview" } : {}
|
|
15098
15150
|
});
|
|
15151
|
+
const auth = bearerToken ? { Authorization: `Bearer ${bearerToken}` } : {};
|
|
15152
|
+
const prefer = [...opts.respondAsync ? [ASYNC_REQUEST_HEADERS.Prefer] : [], ...opts.keepalive ? [KEEPALIVE_REQUEST_HEADERS.Prefer] : []].join(", ");
|
|
15099
15153
|
let res;
|
|
15100
15154
|
try {
|
|
15101
15155
|
res = await fetch(opts.endpoint, {
|
|
15102
15156
|
method: "POST",
|
|
15103
15157
|
headers: {
|
|
15104
15158
|
"Content-Type": "application/json",
|
|
15105
|
-
...
|
|
15106
|
-
...
|
|
15159
|
+
...auth,
|
|
15160
|
+
...prefer ? { Prefer: prefer } : {}
|
|
15107
15161
|
},
|
|
15108
15162
|
body: payload,
|
|
15109
15163
|
signal
|
|
@@ -15129,6 +15183,15 @@ function createComputeFetchSolveFn(opts) {
|
|
|
15129
15183
|
}
|
|
15130
15184
|
throw new Error("The connection dropped while waiting for the result. Please try again.", { cause: err });
|
|
15131
15185
|
}
|
|
15186
|
+
const followed = await followAsyncSolve(res, {
|
|
15187
|
+
headers: auth,
|
|
15188
|
+
signal
|
|
15189
|
+
});
|
|
15190
|
+
if (!followed) {
|
|
15191
|
+
log("[Compute] solve aborted while it ran detached — empty result discarded");
|
|
15192
|
+
return { outputs: {} };
|
|
15193
|
+
}
|
|
15194
|
+
res = followed;
|
|
15132
15195
|
if (res.status === 401 || redirectedToLogin) {
|
|
15133
15196
|
opts.onSessionExpired?.();
|
|
15134
15197
|
throw sessionExpiredError(redirectedToLogin ? void 0 : parseErrorBody(await res.text().catch(() => "")).body);
|
|
@@ -21093,303 +21156,6 @@ function TabContent($$renderer, $$props) {
|
|
|
21093
21156
|
}
|
|
21094
21157
|
});
|
|
21095
21158
|
}
|
|
21096
|
-
// ../ui/src/lib/schema/dynamic-value-list.ts
|
|
21097
|
-
function isDynamicValueListPayload(value) {
|
|
21098
|
-
return typeof value === "object" && value !== null && ("targetInputId" in value || "options" in value);
|
|
21099
|
-
}
|
|
21100
|
-
/**
|
|
21101
|
-
* Normalize a raw output value into a payload object.
|
|
21102
|
-
*
|
|
21103
|
-
* The local/WebSocket path delivers a real object; the Rhino.Compute path delivers the
|
|
21104
|
-
* component's JSON output as a string (possibly double-encoded by the compute layer), so try
|
|
21105
|
-
* to parse strings before giving up.
|
|
21106
|
-
*/
|
|
21107
|
-
function coercePayload(value) {
|
|
21108
|
-
if (isDynamicValueListPayload(value)) return value;
|
|
21109
|
-
let candidate = value;
|
|
21110
|
-
for (let i = 0; i < 2 && typeof candidate === "string"; i++) {
|
|
21111
|
-
try {
|
|
21112
|
-
candidate = JSON.parse(candidate);
|
|
21113
|
-
} catch {
|
|
21114
|
-
return null;
|
|
21115
|
-
}
|
|
21116
|
-
if (isDynamicValueListPayload(candidate)) return candidate;
|
|
21117
|
-
}
|
|
21118
|
-
return null;
|
|
21119
|
-
}
|
|
21120
|
-
var coerceCache = /* @__PURE__ */ new Map();
|
|
21121
|
-
var COERCE_CACHE_MAX = 8;
|
|
21122
|
-
function coercePayloadMemo(value) {
|
|
21123
|
-
if (typeof value !== "string" || value.length < 1024) return coercePayload(value);
|
|
21124
|
-
const hit = coerceCache.get(value);
|
|
21125
|
-
if (hit !== void 0 || coerceCache.has(value)) {
|
|
21126
|
-
coerceCache.delete(value);
|
|
21127
|
-
coerceCache.set(value, hit ?? null);
|
|
21128
|
-
return hit ?? null;
|
|
21129
|
-
}
|
|
21130
|
-
const parseStart = performance.now();
|
|
21131
|
-
const parsed = coercePayload(value);
|
|
21132
|
-
if (value.length > 262144) {
|
|
21133
|
-
const optionCount = parsed?.options ? Object.keys(parsed.options).length : 0;
|
|
21134
|
-
console.info(`[DVL] parsed ${(value.length / 1048576).toFixed(1)} MB options payload (${optionCount} options) in ${(performance.now() - parseStart).toFixed(0)}ms — cache miss`);
|
|
21135
|
-
}
|
|
21136
|
-
if (coerceCache.size >= COERCE_CACHE_MAX) {
|
|
21137
|
-
const oldest = coerceCache.keys().next().value;
|
|
21138
|
-
if (oldest !== void 0) coerceCache.delete(oldest);
|
|
21139
|
-
}
|
|
21140
|
-
coerceCache.set(value, parsed);
|
|
21141
|
-
return parsed;
|
|
21142
|
-
}
|
|
21143
|
-
/**
|
|
21144
|
-
* Every dynamicValueList output reference in the schema.
|
|
21145
|
-
*
|
|
21146
|
-
* Canonical location is `schema.outputs[]` — the plugin's SchemaSynchronizer mirrors every
|
|
21147
|
-
* dynamicValueList layout item there (`CanonicalizeDynamicValueListOutputs`). The layout scan is
|
|
21148
|
-
* back-compat defense for schemas persisted by an older plugin that lacked that invariant; on
|
|
21149
|
-
* current schemas it finds nothing new. Deduped by id, `outputs[]` winning so the canonical
|
|
21150
|
-
* record's targetInputId takes precedence.
|
|
21151
|
-
*/
|
|
21152
|
-
function collectDynamicValueListSources(schema) {
|
|
21153
|
-
const byId = /* @__PURE__ */ new Map();
|
|
21154
|
-
for (const item of getLayoutItems(schema)) {
|
|
21155
|
-
if (item.type !== "output" || item.widgetType !== "dynamicValueList") continue;
|
|
21156
|
-
const dvl = item;
|
|
21157
|
-
if (typeof dvl.paramId !== "string") continue;
|
|
21158
|
-
byId.set(dvl.paramId, {
|
|
21159
|
-
id: dvl.paramId,
|
|
21160
|
-
targetInputId: dvl.config?.targetInputId
|
|
21161
|
-
});
|
|
21162
|
-
}
|
|
21163
|
-
for (const output of schema.outputs ?? []) {
|
|
21164
|
-
if (output.type !== "dynamicValueList") continue;
|
|
21165
|
-
byId.set(output.id, {
|
|
21166
|
-
id: output.id,
|
|
21167
|
-
targetInputId: output.targetInputId
|
|
21168
|
-
});
|
|
21169
|
-
}
|
|
21170
|
-
return [...byId.values()];
|
|
21171
|
-
}
|
|
21172
|
-
function findOptionIndex(entries, pick) {
|
|
21173
|
-
if (typeof pick !== "string") return -1;
|
|
21174
|
-
const wanted = pick.toLowerCase();
|
|
21175
|
-
return entries.findIndex(([name, value]) => value.toLowerCase() === wanted || name.toLowerCase() === wanted);
|
|
21176
|
-
}
|
|
21177
|
-
/**
|
|
21178
|
-
* The option value a pick resolves to, as Grasshopper resolves it in the solve: the pick if still
|
|
21179
|
-
* offered (by value or name, ignoring case), else the first option. With no options known the
|
|
21180
|
-
* pick passes through. `packages/schemas/fixtures/dynamic-value-list-resolution.json` pins both.
|
|
21181
|
-
*/
|
|
21182
|
-
function resolvePick(options, pick) {
|
|
21183
|
-
const entries = Object.entries(options ?? {});
|
|
21184
|
-
if (entries.length === 0) return typeof pick === "string" ? pick : "";
|
|
21185
|
-
return entries[Math.max(0, findOptionIndex(entries, pick))][1];
|
|
21186
|
-
}
|
|
21187
|
-
/**
|
|
21188
|
-
* Checklist: the picks still offered, in pick order; none left gives the first option. Duplicates
|
|
21189
|
-
* collapse by option, not by value, so two options sharing a value both stay.
|
|
21190
|
-
*/
|
|
21191
|
-
function resolvePicks(options, picks) {
|
|
21192
|
-
const entries = Object.entries(options ?? {});
|
|
21193
|
-
if (entries.length === 0) return picks.filter((p) => typeof p === "string");
|
|
21194
|
-
const kept = /* @__PURE__ */ new Set();
|
|
21195
|
-
for (const pick of picks) {
|
|
21196
|
-
const index = findOptionIndex(entries, pick);
|
|
21197
|
-
if (index >= 0) kept.add(index);
|
|
21198
|
-
}
|
|
21199
|
-
return kept.size > 0 ? [...kept].map((i) => entries[i][1]) : [entries[0][1]];
|
|
21200
|
-
}
|
|
21201
|
-
/**
|
|
21202
|
-
* A checklist edit made on the resolved picks, merged back into the stored ones: picks not offered
|
|
21203
|
-
* now were never shown, so the edit can't have removed them, and they come back when offered again.
|
|
21204
|
-
*/
|
|
21205
|
-
function keepHiddenPicks(options, stored, edited) {
|
|
21206
|
-
const entries = Object.entries(options ?? {});
|
|
21207
|
-
if (entries.length === 0 || !Array.isArray(stored)) return edited;
|
|
21208
|
-
const hidden = stored.filter((pick) => typeof pick === "string" && findOptionIndex(entries, pick) < 0 && !edited.includes(pick));
|
|
21209
|
-
return [...edited, ...hidden];
|
|
21210
|
-
}
|
|
21211
|
-
/**
|
|
21212
|
-
* A repeated input's picks. Its value is one JSON object of row key to pick, so a pick stays with
|
|
21213
|
-
* its row when rows come and go, and the value is a plain string on the wire. Anything else reads
|
|
21214
|
-
* as no picks.
|
|
21215
|
-
*/
|
|
21216
|
-
function readRowPicks(value) {
|
|
21217
|
-
if (typeof value !== "string" || !value.trimStart().startsWith("{")) return {};
|
|
21218
|
-
try {
|
|
21219
|
-
const parsed = JSON.parse(value);
|
|
21220
|
-
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return {};
|
|
21221
|
-
return Object.fromEntries(Object.entries(parsed).filter((entry) => typeof entry[1] === "string"));
|
|
21222
|
-
} catch {
|
|
21223
|
-
return {};
|
|
21224
|
-
}
|
|
21225
|
-
}
|
|
21226
|
-
/** The repeated input's value with one row's pick set. Picks for rows not shown now are kept. */
|
|
21227
|
-
function withRowPick(value, rowKey, pick) {
|
|
21228
|
-
return JSON.stringify({
|
|
21229
|
-
...readRowPicks(value),
|
|
21230
|
-
[rowKey]: pick
|
|
21231
|
-
});
|
|
21232
|
-
}
|
|
21233
|
-
/** The options each targeted payload gives its input: one set, or the same set for every row. */
|
|
21234
|
-
function lookUpOptions(payloads, repeatById, repeatOf) {
|
|
21235
|
-
const options = {};
|
|
21236
|
-
const rowOptions = {};
|
|
21237
|
-
for (const { source, payload } of payloads) {
|
|
21238
|
-
const target = payload.targetInputId ?? source.targetInputId;
|
|
21239
|
-
if (!target || !payload.options || typeof payload.options !== "object") continue;
|
|
21240
|
-
const repeat = repeatById.get(repeatOf[target]);
|
|
21241
|
-
const offered = payload.options;
|
|
21242
|
-
if (repeat) rowOptions[target] = repeat.rows.map(() => offered);
|
|
21243
|
-
else options[target] = offered;
|
|
21244
|
-
}
|
|
21245
|
-
for (const { source, payload } of payloads) {
|
|
21246
|
-
const repeat = repeatById.get(source.id);
|
|
21247
|
-
const offered = payload.options;
|
|
21248
|
-
if (!repeat || !offered || Object.keys(offered).length === 0) continue;
|
|
21249
|
-
for (const member of repeat.members) rowOptions[member] ??= repeat.rows.map(() => offered);
|
|
21250
|
-
}
|
|
21251
|
-
return {
|
|
21252
|
-
options,
|
|
21253
|
-
rowOptions
|
|
21254
|
-
};
|
|
21255
|
-
}
|
|
21256
|
-
var tableOptionsCache = /* @__PURE__ */ new WeakMap();
|
|
21257
|
-
/**
|
|
21258
|
-
* Narrows each pick table as Grasshopper does in the solve: an input offers the values its column
|
|
21259
|
-
* has in the rows left by the picks before it, and resolves its own pick against those.
|
|
21260
|
-
* `packages/schemas/fixtures/pick-table.json` pins both.
|
|
21261
|
-
*/
|
|
21262
|
-
function narrowPickTables(payloads, values, repeatById, repeatOf) {
|
|
21263
|
-
const options = {};
|
|
21264
|
-
const rowOptions = {};
|
|
21265
|
-
const shown = {};
|
|
21266
|
-
for (const { payload } of payloads) {
|
|
21267
|
-
const table = payload.pickTable;
|
|
21268
|
-
if (!table || !Array.isArray(table.inputs) || !Array.isArray(table.rows)) continue;
|
|
21269
|
-
const cache = tableOptionsCache.get(table.rows) ?? /* @__PURE__ */ new Map();
|
|
21270
|
-
tableOptionsCache.set(table.rows, cache);
|
|
21271
|
-
const by = Array.isArray(table.by) ? table.by : [];
|
|
21272
|
-
const held = by.map((id) => {
|
|
21273
|
-
const value = values[id];
|
|
21274
|
-
return (Array.isArray(value) ? value : [value]).filter((item) => item !== void 0 && item !== null).map(String);
|
|
21275
|
-
});
|
|
21276
|
-
const start = Array.from({ length: Math.max(1, ...held.map((h) => h.length)) }, (_, i) => {
|
|
21277
|
-
const picked = held.map((items) => items[Math.min(i, items.length - 1)]);
|
|
21278
|
-
return {
|
|
21279
|
-
rows: table.rows.filter((row) => picked.every((item, d) => item === void 0 || row[d]?.toLowerCase() === item.toLowerCase())),
|
|
21280
|
-
picked: picked.map((item) => item ?? "")
|
|
21281
|
-
};
|
|
21282
|
-
});
|
|
21283
|
-
const left = [];
|
|
21284
|
-
table.inputs.forEach((id, index) => {
|
|
21285
|
-
const column = by.length + index;
|
|
21286
|
-
const parent = table.parents?.[index] ?? index - 1;
|
|
21287
|
-
const before = parent >= 0 && left[parent] ? left[parent] : start;
|
|
21288
|
-
const repeat = repeatById.get(repeatOf[id]);
|
|
21289
|
-
const rowPicks = repeat ? readRowPicks(values[id]) : void 0;
|
|
21290
|
-
const picks = repeat ? repeat.rows.map((row) => rowPicks?.[row.key]) : [values[id]];
|
|
21291
|
-
const offeredPerRow = [];
|
|
21292
|
-
const resolved = [];
|
|
21293
|
-
const after = picks.map((wanted, i) => {
|
|
21294
|
-
const { rows, picked } = before[Math.min(i, before.length - 1)];
|
|
21295
|
-
const key = JSON.stringify([column, ...picked]);
|
|
21296
|
-
let offered = cache.get(key);
|
|
21297
|
-
if (!offered) {
|
|
21298
|
-
offered = {};
|
|
21299
|
-
for (const row of rows) {
|
|
21300
|
-
const cell = row[column];
|
|
21301
|
-
if (typeof cell === "string" && cell !== "") offered[cell] = cell;
|
|
21302
|
-
}
|
|
21303
|
-
cache.set(key, offered);
|
|
21304
|
-
}
|
|
21305
|
-
offeredPerRow.push(offered);
|
|
21306
|
-
const pick = resolvePick(offered, wanted);
|
|
21307
|
-
resolved.push(pick);
|
|
21308
|
-
return {
|
|
21309
|
-
rows: rows.filter((row) => row[column] === pick),
|
|
21310
|
-
picked: [...picked, `${column}:${pick}`]
|
|
21311
|
-
};
|
|
21312
|
-
});
|
|
21313
|
-
if (repeat) {
|
|
21314
|
-
rowOptions[id] = offeredPerRow;
|
|
21315
|
-
shown[id] = resolved;
|
|
21316
|
-
} else {
|
|
21317
|
-
options[id] = offeredPerRow[0];
|
|
21318
|
-
shown[id] = resolved[0];
|
|
21319
|
-
}
|
|
21320
|
-
left[index] = after.length > 0 ? after : before;
|
|
21321
|
-
});
|
|
21322
|
-
}
|
|
21323
|
-
return {
|
|
21324
|
-
options,
|
|
21325
|
-
rowOptions,
|
|
21326
|
-
shown
|
|
21327
|
-
};
|
|
21328
|
-
}
|
|
21329
|
-
/**
|
|
21330
|
-
* What the form shows, from the payloads the last solve returned and the values on screen now.
|
|
21331
|
-
* A pick table is narrowed by the picks on screen, so changing one updates the lists that depend
|
|
21332
|
-
* on it without a solve.
|
|
21333
|
-
*
|
|
21334
|
-
* Pass the previous model to keep the identity of every array that didn't change: this runs on
|
|
21335
|
-
* each value change, and a fresh array re-renders its whole checklist or repeat.
|
|
21336
|
-
*/
|
|
21337
|
-
function buildFormModel(schema, values, previous) {
|
|
21338
|
-
const payloads = [];
|
|
21339
|
-
for (const source of collectDynamicValueListSources(schema)) {
|
|
21340
|
-
const payload = coercePayloadMemo(values[source.id]);
|
|
21341
|
-
if (payload) payloads.push({
|
|
21342
|
-
source,
|
|
21343
|
-
payload
|
|
21344
|
-
});
|
|
21345
|
-
}
|
|
21346
|
-
const repeats = [];
|
|
21347
|
-
const repeatOf = {};
|
|
21348
|
-
for (const { source, payload } of payloads) {
|
|
21349
|
-
if (!Array.isArray(payload.rows) || !Array.isArray(payload.members)) continue;
|
|
21350
|
-
const rows = payload.rows.filter((r) => typeof r?.key === "string");
|
|
21351
|
-
repeats.push({
|
|
21352
|
-
id: source.id,
|
|
21353
|
-
rows,
|
|
21354
|
-
members: payload.members
|
|
21355
|
-
});
|
|
21356
|
-
for (const member of payload.members) repeatOf[member] = source.id;
|
|
21357
|
-
}
|
|
21358
|
-
const repeatById = new Map(repeats.map((r) => [r.id, r]));
|
|
21359
|
-
const tables = narrowPickTables(payloads, values, repeatById, repeatOf);
|
|
21360
|
-
const lookup = lookUpOptions(payloads, repeatById, repeatOf);
|
|
21361
|
-
Object.assign(lookup.options, tables.options);
|
|
21362
|
-
Object.assign(lookup.rowOptions, tables.rowOptions);
|
|
21363
|
-
const shown = { ...tables.shown };
|
|
21364
|
-
for (const { source, payload } of payloads) {
|
|
21365
|
-
const target = payload.targetInputId ?? source.targetInputId;
|
|
21366
|
-
if (!target || !payload.resolvedInSolve || repeatOf[target]) continue;
|
|
21367
|
-
const value = values[target];
|
|
21368
|
-
shown[target] = Array.isArray(value) ? resolvePicks(lookup.options[target], value) : resolvePick(lookup.options[target], value);
|
|
21369
|
-
}
|
|
21370
|
-
for (const repeat of repeats) for (const member of repeat.members) {
|
|
21371
|
-
const picks = readRowPicks(values[member]);
|
|
21372
|
-
shown[member] = repeat.rows.map((row, i) => resolvePick(lookup.rowOptions[member]?.[i], picks[row.key]));
|
|
21373
|
-
}
|
|
21374
|
-
if (previous) {
|
|
21375
|
-
reuseUnchanged(shown, previous.shown);
|
|
21376
|
-
reuseUnchanged(lookup.rowOptions, previous.rowOptions);
|
|
21377
|
-
}
|
|
21378
|
-
return {
|
|
21379
|
-
...lookup,
|
|
21380
|
-
repeats,
|
|
21381
|
-
repeatOf,
|
|
21382
|
-
shown
|
|
21383
|
-
};
|
|
21384
|
-
}
|
|
21385
|
-
function sameValue(a, b) {
|
|
21386
|
-
if (a === b) return true;
|
|
21387
|
-
if (!Array.isArray(a) || !Array.isArray(b) || a.length !== b.length) return false;
|
|
21388
|
-
return a.every((item, i) => item === b[i]);
|
|
21389
|
-
}
|
|
21390
|
-
function reuseUnchanged(next, previous) {
|
|
21391
|
-
for (const key of Object.keys(next)) if (key in previous && sameValue(next[key], previous[key])) next[key] = previous[key];
|
|
21392
|
-
}
|
|
21393
21159
|
// ../ui/src/lib/components/preview/TabLayout.svelte
|
|
21394
21160
|
function TabLayout($$renderer, $$props) {
|
|
21395
21161
|
$$renderer.component(($$renderer) => {
|
|
@@ -24122,7 +23888,7 @@ function _page($$renderer, $$props) {
|
|
|
24122
23888
|
versionId: () => data.versionId,
|
|
24123
23889
|
streamId: () => liveEvents?.streamId ?? null,
|
|
24124
23890
|
bearerToken: () => data.shareToken,
|
|
24125
|
-
|
|
23891
|
+
respondAsync: true,
|
|
24126
23892
|
meshes: shouldShowViewer() ? { extract: (response, opts) => getThreeObjectsFromComputeResponse(response, opts) } : void 0,
|
|
24127
23893
|
debug: true
|
|
24128
23894
|
});
|