@selvajs/selva 4.21.0-beta.15 → 4.21.0-beta.16
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/BWnVNIyV.js +6085 -0
- package/build/client/_app/immutable/chunks/BWnVNIyV.js.br +0 -0
- package/build/client/_app/immutable/chunks/BWnVNIyV.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Cj8nqfNF.js +1 -0
- package/build/client/_app/immutable/chunks/Cj8nqfNF.js.br +1 -0
- package/build/client/_app/immutable/chunks/Cj8nqfNF.js.gz +0 -0
- package/build/client/_app/immutable/entry/{app.B1zrk4oJ.js → app.Dw0M74ME.js} +2 -2
- package/build/client/_app/immutable/entry/app.Dw0M74ME.js.br +0 -0
- package/build/client/_app/immutable/entry/app.Dw0M74ME.js.gz +0 -0
- package/build/client/_app/immutable/nodes/21.-ms9uSQh.js +1 -0
- package/build/client/_app/immutable/nodes/21.-ms9uSQh.js.br +0 -0
- package/build/client/_app/immutable/nodes/21.-ms9uSQh.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{25.DCzT_X3a.js → 25.C7VDbaM3.js} +19 -18
- package/build/client/_app/immutable/nodes/25.C7VDbaM3.js.br +0 -0
- package/build/client/_app/immutable/nodes/{25.DCzT_X3a.js.gz → 25.C7VDbaM3.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/chunks/errors.js +30 -11
- package/build/server/chunks/errors.js.map +1 -1
- package/build/server/chunks/handlers.js +25 -6
- package/build/server/chunks/handlers.js.map +1 -1
- package/build/server/chunks/instance.js +3 -3
- package/build/server/chunks/internal.js +1 -1
- package/build/server/chunks/package.js +1 -1
- package/build/server/chunks/package.js.map +1 -1
- package/build/server/entries/pages/library/_guid_/_page.svelte.js +46 -13
- package/build/server/entries/pages/library/_guid_/_page.svelte.js.map +1 -1
- package/build/server/entries/pages/projects/_page.svelte.js +5 -0
- package/build/server/entries/pages/projects/_page.svelte.js.map +1 -1
- package/build/server/manifest-full.js +1 -1
- package/build/server/manifest.js +1 -1
- package/build/server/nodes/21.js +1 -1
- package/build/server/nodes/25.js +1 -1
- package/build/server/server.js +1 -1
- package/package.json +7 -7
- package/build/client/_app/immutable/chunks/CCHz3Pcq.js +0 -1
- package/build/client/_app/immutable/chunks/CCHz3Pcq.js.br +0 -1
- package/build/client/_app/immutable/chunks/CCHz3Pcq.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CVA0v6Z8.js +0 -6085
- package/build/client/_app/immutable/chunks/CVA0v6Z8.js.br +0 -0
- package/build/client/_app/immutable/chunks/CVA0v6Z8.js.gz +0 -0
- package/build/client/_app/immutable/entry/app.B1zrk4oJ.js.br +0 -0
- package/build/client/_app/immutable/entry/app.B1zrk4oJ.js.gz +0 -0
- package/build/client/_app/immutable/nodes/21.CFGMFbJt.js +0 -1
- package/build/client/_app/immutable/nodes/21.CFGMFbJt.js.br +0 -1
- package/build/client/_app/immutable/nodes/21.CFGMFbJt.js.gz +0 -0
- package/build/client/_app/immutable/nodes/25.DCzT_X3a.js.br +0 -0
|
@@ -213,7 +213,7 @@ function server_data_serializer(event, state) {
|
|
|
213
213
|
let promise_id = 1;
|
|
214
214
|
let max_nodes = -1;
|
|
215
215
|
const iterator = create_async_iterator();
|
|
216
|
-
const global = "
|
|
216
|
+
const global = "__sveltekit_zgjvde";
|
|
217
217
|
/** @param {number} index */
|
|
218
218
|
function get_replacer(index) {
|
|
219
219
|
/** @param {any} thing */
|
|
@@ -1443,7 +1443,7 @@ async function render_response({ branch, fetched, page_config, status, error = n
|
|
|
1443
1443
|
"crossorigin"
|
|
1444
1444
|
]);
|
|
1445
1445
|
}
|
|
1446
|
-
const global = "
|
|
1446
|
+
const global = "__sveltekit_zgjvde";
|
|
1447
1447
|
const { data, chunks } = data_serializer.get_data(csp);
|
|
1448
1448
|
if (page_config.ssr && page_config.csr) body += `\n\t\t\t${fetched.map((item) => serialize_data(item, resolve_opts.filterSerializedResponseHeaders, !!(state.prerendering || state.prerender_default === true))).join("\n ")}`;
|
|
1449
1449
|
if (page_config.csr && client) {
|
|
@@ -1467,7 +1467,7 @@ async function render_response({ branch, fetched, page_config, status, error = n
|
|
|
1467
1467
|
}
|
|
1468
1468
|
}
|
|
1469
1469
|
const blocks = [];
|
|
1470
|
-
const properties = [`base: ${base_expression}`, `version: ${s("
|
|
1470
|
+
const properties = [`base: ${base_expression}`, `version: ${s("1795009911728")}`];
|
|
1471
1471
|
if (assets) properties.push(`assets: ${s(assets)}`);
|
|
1472
1472
|
if (client.uses_env_dynamic_public) properties.push(`env: ${load_env_eagerly ? "null" : uneval$1(rendered_env)}`);
|
|
1473
1473
|
if (chunks) {
|
|
@@ -2363,7 +2363,7 @@ function redirect_response(status, location) {
|
|
|
2363
2363
|
* @param {Response} response
|
|
2364
2364
|
*/
|
|
2365
2365
|
function with_version_header(response) {
|
|
2366
|
-
response.headers.set("x-sveltekit-version", "
|
|
2366
|
+
response.headers.set("x-sveltekit-version", "1795009911728");
|
|
2367
2367
|
return response;
|
|
2368
2368
|
}
|
|
2369
2369
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package.js","names":[],"sources":["../../../package.json"],"sourcesContent":["{\n\t\"name\": \"@selvajs/selva\",\n\t\"version\": \"4.21.0-beta.
|
|
1
|
+
{"version":3,"file":"package.js","names":[],"sources":["../../../package.json"],"sourcesContent":["{\n\t\"name\": \"@selvajs/selva\",\n\t\"version\": \"4.21.0-beta.16\",\n\t\"description\": \"Selva — self-contained Grasshopper-driven web app. Install, configure via .env, deploy.\",\n\t\"license\": \"MIT\",\n\t\"author\": \"VektorNode\",\n\t\"homepage\": \"https://selva.dev\",\n\t\"bugs\": \"https://github.com/VektorNode/selva/issues\",\n\t\"keywords\": [\n\t\t\"grasshopper\",\n\t\t\"rhino\",\n\t\t\"rhino-compute\",\n\t\t\"parametric-design\",\n\t\t\"web-app\",\n\t\t\"sveltekit\"\n\t],\n\t\"publishConfig\": {\n\t\t\"access\": \"public\"\n\t},\n\t\"repository\": {\n\t\t\"type\": \"git\",\n\t\t\"url\": \"git+https://github.com/VektorNode/selva.git\",\n\t\t\"directory\": \"packages/selva\"\n\t},\n\t\"type\": \"module\",\n\t\"main\": \"./build/index.js\",\n\t\"files\": [\n\t\t\"build\",\n\t\t\"templates\"\n\t],\n\t\"engines\": {\n\t\t\"node\": \">=24.0.0\"\n\t},\n\t\"selva\": {\n\t\t\"dataFormat\": 3\n\t},\n\t\"scripts\": {\n\t\t\"dev\": \"vite dev\",\n\t\t\"dev:lan\": \"vite dev --host\",\n\t\t\"build\": \"rimraf build && vite build && node ./scripts/generate-templates.js && node ./scripts/write-runtime-meta.js\",\n\t\t\"preview\": \"vite preview\",\n\t\t\"start\": \"node build/index.js\",\n\t\t\"clean\": \"rimraf build templates\",\n\t\t\"prepare\": \"svelte-kit sync || echo ''\",\n\t\t\"check\": \"svelte-kit sync && svelte-check --tsconfig ./tsconfig.json\",\n\t\t\"test\": \"vitest run\",\n\t\t\"test:watch\": \"vitest\",\n\t\t\"openapi:generate\": \"node scripts/generate-openapi.js\",\n\t\t\"test:e2e\": \"playwright test\",\n\t\t\"lint\": \"eslint .\",\n\t\t\"lint:types\": \"eslint . --config eslint.typed.config.js\",\n\t\t\"generate:cli-config\": \"node scripts/generate-cli-config.js\"\n\t},\n\t\"dependencies\": {\n\t\t\"@lucide/svelte\": \"catalog:\",\n\t\t\"@supabase/supabase-js\": \"catalog:\",\n\t\t\"@sveltejs/kit\": \"catalog:\",\n\t\t\"bits-ui\": \"catalog:\",\n\t\t\"clsx\": \"catalog:\",\n\t\t\"mode-watcher\": \"catalog:\",\n\t\t\"nodemailer\": \"catalog:\",\n\t\t\"pino\": \"^10.4.0\",\n\t\t\"rhino3dm\": \"catalog:\",\n\t\t\"sharp\": \"catalog:\",\n\t\t\"tailwind-merge\": \"catalog:\",\n\t\t\"tailwind-variants\": \"catalog:\",\n\t\t\"three\": \"catalog:\",\n\t\t\"zod\": \"catalog:\"\n\t},\n\t\"optionalDependencies\": {\n\t\t\"@sentry/node\": \"^11.10.0\"\n\t},\n\t\"devDependencies\": {\n\t\t\"@playwright/test\": \"catalog:\",\n\t\t\"@selvajs/compute\": \"workspace:*\",\n\t\t\"@selvajs/config\": \"workspace:*\",\n\t\t\"@selvajs/header-auth-provider\": \"workspace:*\",\n\t\t\"@selvajs/local-provider\": \"workspace:*\",\n\t\t\"@selvajs/mcp\": \"workspace:*\",\n\t\t\"@selvajs/notifications\": \"workspace:*\",\n\t\t\"@selvajs/platform\": \"workspace:*\",\n\t\t\"@selvajs/schemas\": \"workspace:*\",\n\t\t\"@selvajs/server\": \"workspace:*\",\n\t\t\"@selvajs/solve\": \"workspace:*\",\n\t\t\"@selvajs/supabase-provider\": \"workspace:*\",\n\t\t\"@selvajs/ui\": \"workspace:*\",\n\t\t\"@selvajs/visualization\": \"workspace:*\",\n\t\t\"@sveltejs/adapter-node\": \"catalog:\",\n\t\t\"@types/nodemailer\": \"catalog:\",\n\t\t\"@types/three\": \"catalog:\",\n\t\t\"rimraf\": \"catalog:\",\n\t\t\"tw-animate-css\": \"catalog:\",\n\t\t\"vitest\": \"catalog:\"\n\t},\n\t\"imports\": {\n\t\t\"#lib/*\": \"./src/lib/*\"\n\t}\n}\n"],"mappings":""}
|
|
@@ -14944,6 +14944,48 @@ function prepend(first, reader) {
|
|
|
14944
14944
|
}
|
|
14945
14945
|
});
|
|
14946
14946
|
}
|
|
14947
|
+
/** A `Server-Timing` header's `dur` entries, in ms by metric name. */
|
|
14948
|
+
function parseServerTiming(header) {
|
|
14949
|
+
const out = {};
|
|
14950
|
+
if (!header) return out;
|
|
14951
|
+
for (const part of header.split(",")) {
|
|
14952
|
+
const [name, ...params] = part.split(";").map((s) => s.trim());
|
|
14953
|
+
const dur = params.find((p) => p.startsWith("dur="));
|
|
14954
|
+
if (!name || !dur) continue;
|
|
14955
|
+
const ms = Number(dur.slice(4));
|
|
14956
|
+
if (Number.isFinite(ms)) out[name] = ms;
|
|
14957
|
+
}
|
|
14958
|
+
return out;
|
|
14959
|
+
}
|
|
14960
|
+
/**
|
|
14961
|
+
* Where the server's time went, as one line for the debug log. Null without a `solve` entry.
|
|
14962
|
+
*
|
|
14963
|
+
* `compute` is the whole call to Rhino.Compute. A server that reports its own timing splits it
|
|
14964
|
+
* into `solve` (of which `grasshopper` is the definition running), `decode`, `encode`, and
|
|
14965
|
+
* `queue+link`: the rest, network plus the wait for a free worker. `prep` is what the app did
|
|
14966
|
+
* before the solve, slowest step first, steps under 1 ms left out.
|
|
14967
|
+
*/
|
|
14968
|
+
function describeServerTiming(header) {
|
|
14969
|
+
const t = parseServerTiming(header);
|
|
14970
|
+
if (!header || t.solve === void 0) return null;
|
|
14971
|
+
const ms = (value) => (value ?? 0).toFixed(0);
|
|
14972
|
+
let compute = `compute ${ms(t.solve)}`;
|
|
14973
|
+
if (t.rhino_solve !== void 0) {
|
|
14974
|
+
const grasshopper = t.rhino_gh === void 0 ? "" : ` (grasshopper ${ms(t.rhino_gh)})`;
|
|
14975
|
+
compute += `: solve ${ms(t.rhino_solve)}${grasshopper}, decode ${ms(t.rhino_decode)}, encode ${ms(t.rhino_encode)}, queue+link ${ms(t.compute_link)}`;
|
|
14976
|
+
}
|
|
14977
|
+
const parts = [compute];
|
|
14978
|
+
const prep = Object.entries(t).filter(([name]) => name.startsWith("p_"));
|
|
14979
|
+
const prepTotal = prep.reduce((sum, [, dur]) => sum + dur, 0);
|
|
14980
|
+
if (prepTotal >= 1) {
|
|
14981
|
+
const steps = prep.filter(([, dur]) => dur >= 1).sort((a, b) => b[1] - a[1]).map(([name, dur]) => `${name.slice(2)} ${ms(dur)}`);
|
|
14982
|
+
parts.push(`prep ${ms(prepTotal)}: ${steps.join(", ")}`);
|
|
14983
|
+
}
|
|
14984
|
+
parts.push(`tree ${ms(t.tree)}`, `serialize ${ms(t.serialize)}`, `gzip ${ms(t.gzip)}`);
|
|
14985
|
+
if (t.def_reupload) parts.push("definition re-sent to Compute");
|
|
14986
|
+
for (const [, name, value] of header.matchAll(/(\w+);desc="?([^",;]+)"?/g)) parts.push(`${name.replace(/^rhino_/, "")} ${value}`);
|
|
14987
|
+
return parts.join(" | ");
|
|
14988
|
+
}
|
|
14947
14989
|
/**
|
|
14948
14990
|
* A ready-made `SolveFn` that POSTs to a `/api/compute`-shaped endpoint (the wire contract
|
|
14949
14991
|
* `SolveEngine` produces) and unpacks the result, with 429 cooldown, session-expiry detection,
|
|
@@ -14957,18 +14999,6 @@ function prepend(first, reader) {
|
|
|
14957
14999
|
var DEFAULT_RETRY_AFTER_S = 5;
|
|
14958
15000
|
/** A server's hint, not a lock: past this the client tries again anyway. */
|
|
14959
15001
|
var MAX_RETRY_AFTER_S = 3600;
|
|
14960
|
-
function parseServerTiming(header) {
|
|
14961
|
-
const out = {};
|
|
14962
|
-
if (!header) return out;
|
|
14963
|
-
for (const part of header.split(",")) {
|
|
14964
|
-
const [name, ...params] = part.split(";").map((s) => s.trim());
|
|
14965
|
-
const dur = params.find((p) => p.startsWith("dur="));
|
|
14966
|
-
if (!name || !dur) continue;
|
|
14967
|
-
const ms = Number(dur.slice(4));
|
|
14968
|
-
if (Number.isFinite(ms)) out[name] = ms;
|
|
14969
|
-
}
|
|
14970
|
-
return out;
|
|
14971
|
-
}
|
|
14972
15002
|
/**
|
|
14973
15003
|
* The server refused the solve. `message` is the text to show; branch on `status` and `code`
|
|
14974
15004
|
* instead of matching it. A solve refused locally during a 429 cooldown has `status` 429 and no
|
|
@@ -15161,7 +15191,8 @@ function createComputeFetchSolveFn(opts) {
|
|
|
15161
15191
|
}
|
|
15162
15192
|
if (debug) {
|
|
15163
15193
|
const valuesBytes = JSON.stringify(values).length;
|
|
15164
|
-
const
|
|
15194
|
+
const timingHeader = res.headers.get("Server-Timing");
|
|
15195
|
+
const serverTiming = parseServerTiming(timingHeader);
|
|
15165
15196
|
const serverTotal = serverTiming.total ?? 0;
|
|
15166
15197
|
const networkMs = Math.max(0, ttfbMs - serverTotal);
|
|
15167
15198
|
const sizeMB = bodyChars / 1048576;
|
|
@@ -15170,6 +15201,8 @@ function createComputeFetchSolveFn(opts) {
|
|
|
15170
15201
|
const heapBytes = performance.memory?.usedJSHeapSize;
|
|
15171
15202
|
const heap = heapBytes !== void 0 ? ` | heap=${(heapBytes / 1048576).toFixed(0)} MB` : "";
|
|
15172
15203
|
log(`[Compute] req=${(payload.length / 1024).toFixed(0)}KB (values ${(valuesBytes / 1024).toFixed(0)}KB) | ttfb=${ttfbMs.toFixed(0)}ms (network≈${networkMs.toFixed(0)} + server ${serverTotal.toFixed(0)}) | download=${downloadMs.toFixed(0)}ms (${size} @ ${mbps} MB/s)${heap}`);
|
|
15204
|
+
const breakdown = describeServerTiming(timingHeader);
|
|
15205
|
+
if (breakdown) log(`[Compute] └─ server: ${breakdown}`);
|
|
15173
15206
|
if (serverTiming.selva_cache !== void 0) {
|
|
15174
15207
|
const cacheMsg = serverTiming.selva_cache ? "HIT — served without calling compute" : serverTiming.rhino_cache ? "HIT — Rhino.Compute's result cache, solved nothing" : "miss — solved on Rhino.Compute";
|
|
15175
15208
|
log(`[Compute] └─ cache: ${cacheMsg}`);
|