@selvajs/selva 4.21.0-beta.7 → 4.21.0-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/adapter-node.js +1 -1
- package/build/client/_app/immutable/assets/0.CqqJCiiV.css +2 -0
- package/build/client/_app/immutable/assets/0.CqqJCiiV.css.br +0 -0
- package/build/client/_app/immutable/assets/0.CqqJCiiV.css.gz +0 -0
- package/build/client/_app/immutable/chunks/{BepzH9eI.js → DptnDNFA.js} +60 -55
- package/build/client/_app/immutable/chunks/DptnDNFA.js.br +0 -0
- package/build/client/_app/immutable/chunks/{BepzH9eI.js.gz → DptnDNFA.js.gz} +0 -0
- package/build/client/_app/immutable/chunks/DvJo0Zn0.js +1 -0
- package/build/client/_app/immutable/chunks/DvJo0Zn0.js.br +1 -0
- package/build/client/_app/immutable/chunks/DvJo0Zn0.js.gz +0 -0
- package/build/client/_app/immutable/entry/{app.Cmuegtgc.js → app.DPVyoSCt.js} +2 -2
- package/build/client/_app/immutable/entry/app.DPVyoSCt.js.br +0 -0
- package/build/client/_app/immutable/entry/app.DPVyoSCt.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{15.BXIV1QfS.js → 15.0NRg5Hm0.js} +1 -1
- package/build/client/_app/immutable/nodes/15.0NRg5Hm0.js.br +0 -0
- package/build/client/_app/immutable/nodes/15.0NRg5Hm0.js.gz +0 -0
- package/build/client/_app/immutable/nodes/21.DpKe0-GH.js +1 -0
- package/build/client/_app/immutable/nodes/21.DpKe0-GH.js.br +0 -0
- package/build/client/_app/immutable/nodes/21.DpKe0-GH.js.gz +0 -0
- package/build/client/_app/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 +16 -27
- package/build/server/_app/immutable/assets/_layout.CqqJCiiV.css +2 -0
- package/build/server/chunks/api-errors.js +18 -3
- package/build/server/chunks/api-errors.js.map +1 -1
- package/build/server/chunks/boot.server.js +1 -1
- package/build/server/chunks/computeRateLimit.server.js +1 -1
- package/build/server/chunks/delete-with-blobs.js +1 -1
- package/build/server/chunks/engine.server.js +50 -3
- package/build/server/chunks/engine.server.js.map +1 -1
- package/build/server/chunks/grasshopper.js +1 -1
- package/build/server/chunks/handlers.js +4 -4
- package/build/server/chunks/handlers.js.map +1 -1
- package/build/server/chunks/http2.js +1 -1
- package/build/server/chunks/instance.js +3 -3
- package/build/server/chunks/internal.js +1 -1
- package/build/server/chunks/{abort-Bfrdupaj.js → keepalive-vtcjhAV3.js} +6 -3
- package/build/server/chunks/keepalive-vtcjhAV3.js.map +1 -0
- package/build/server/chunks/package.js +1 -1
- package/build/server/chunks/package.js.map +1 -1
- package/build/server/chunks/permissions.server.js +1 -1
- package/build/server/chunks/providers.server.js +72 -3
- package/build/server/chunks/providers.server.js.map +1 -1
- package/build/server/chunks/resolve-server.js +1 -1
- package/build/server/chunks/schema-extraction.js +75 -8
- package/build/server/chunks/schema-extraction.js.map +1 -1
- package/build/server/chunks/server-config-write.js +1 -1
- package/build/server/chunks/serverStats.server.js +1 -1
- package/build/server/chunks/solve.server.js +4 -5
- package/build/server/chunks/solve.server.js.map +1 -1
- package/build/server/chunks/sveltekit.js +3 -4
- package/build/server/chunks/sveltekit.js.map +1 -1
- package/build/server/entries/endpoints/api/admin/compute/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/admin/compute/actions/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/admin/compute/status/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/admin/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 +10 -5
- package/build/server/entries/endpoints/api/v1/compute/_server.ts.js.map +1 -1
- package/build/server/entries/endpoints/api/v1/compute/schema/_server.ts.js +2 -2
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/solve/_server.ts.js +3 -3
- package/build/server/entries/endpoints/mcp/_server.ts.js +38 -9
- package/build/server/entries/endpoints/mcp/_server.ts.js.map +1 -1
- package/build/server/entries/hooks.server.js +1 -1
- package/build/server/entries/pages/admin/compute/_page.server.ts.js +1 -2
- package/build/server/entries/pages/admin/compute/_page.server.ts.js.map +1 -1
- package/build/server/entries/pages/admin/system/_page.server.ts.js +3 -3
- package/build/server/entries/pages/admin/system/_page.server.ts.js.map +1 -1
- package/build/server/entries/pages/admin/system/_page.svelte.js +1 -1
- package/build/server/entries/pages/admin/system/_page.svelte.js.map +1 -1
- package/build/server/entries/pages/library/_guid_/_page.server.ts.js +198 -99
- package/build/server/entries/pages/library/_guid_/_page.server.ts.js.map +1 -1
- package/build/server/entries/pages/library/_guid_/_page.svelte.js +462 -30
- package/build/server/entries/pages/library/_guid_/_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/0.js +2 -2
- package/build/server/nodes/15.js +1 -1
- package/build/server/nodes/21.js +1 -1
- package/build/server/server.js +1 -1
- package/package.json +8 -8
- package/templates/.env.example +5 -3
- package/build/client/_app/immutable/assets/0.2jDm0bqh.css +0 -2
- package/build/client/_app/immutable/assets/0.2jDm0bqh.css.br +0 -0
- package/build/client/_app/immutable/assets/0.2jDm0bqh.css.gz +0 -0
- package/build/client/_app/immutable/chunks/BepzH9eI.js.br +0 -0
- package/build/client/_app/immutable/chunks/BmoT9ksD.js +0 -1
- package/build/client/_app/immutable/chunks/BmoT9ksD.js.br +0 -1
- package/build/client/_app/immutable/chunks/BmoT9ksD.js.gz +0 -0
- package/build/client/_app/immutable/entry/app.Cmuegtgc.js.br +0 -0
- package/build/client/_app/immutable/entry/app.Cmuegtgc.js.gz +0 -0
- package/build/client/_app/immutable/nodes/15.BXIV1QfS.js.br +0 -0
- package/build/client/_app/immutable/nodes/15.BXIV1QfS.js.gz +0 -0
- package/build/client/_app/immutable/nodes/21.DvC40Ypm.js +0 -1
- package/build/client/_app/immutable/nodes/21.DvC40Ypm.js.br +0 -0
- package/build/client/_app/immutable/nodes/21.DvC40Ypm.js.gz +0 -0
- package/build/server/_app/immutable/assets/_layout.2jDm0bqh.css +0 -2
- package/build/server/chunks/abort-Bfrdupaj.js.map +0 -1
- package/build/server/chunks/computeLimits.js +0 -33
- package/build/server/chunks/computeLimits.js.map +0 -1
- /package/build/client/_app/immutable/nodes/{0.CYdyv5To.js → 0.Ds0zeDAg.js} +0 -0
- /package/build/client/_app/immutable/nodes/{0.CYdyv5To.js.br → 0.Ds0zeDAg.js.br} +0 -0
- /package/build/client/_app/immutable/nodes/{0.CYdyv5To.js.gz → 0.Ds0zeDAg.js.gz} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { k as ApiErrorCode } from "./access.js";
|
|
2
2
|
import "./api.js";
|
|
3
|
-
import {
|
|
3
|
+
import { r as handleApiError, t as apiError } from "./api-errors.js";
|
|
4
4
|
import { json } from "@sveltejs/kit";
|
|
5
5
|
// src/lib/server/api/http.ts
|
|
6
6
|
/**
|
|
@@ -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_cjj2z9";
|
|
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_cjj2z9";
|
|
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("1794483560744")}`];
|
|
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", "1794483560744");
|
|
2367
2367
|
return response;
|
|
2368
2368
|
}
|
|
2369
2369
|
/**
|
|
@@ -18,7 +18,7 @@ function getLayoutItems(schema) {
|
|
|
18
18
|
function getInputItems(schema) {
|
|
19
19
|
return getLayoutItems(schema).filter((i) => i.type === "input");
|
|
20
20
|
}
|
|
21
|
-
// ../solve/dist/
|
|
21
|
+
// ../solve/dist/keepalive-vtcjhAV3.js
|
|
22
22
|
/**
|
|
23
23
|
* Inputs the schema marks `source.kind === 'server'`. No resolver fills them, so they solve with
|
|
24
24
|
* their schema default: the client sends no value for them, and the server refuses one.
|
|
@@ -35,6 +35,9 @@ function raceAbort(promise, signal) {
|
|
|
35
35
|
promise.then(resolve, reject).finally(() => signal.removeEventListener("abort", onAbort));
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
|
-
|
|
38
|
+
var KEEPALIVE_PREFERENCE = "selva-keepalive";
|
|
39
|
+
/** Under the 30 s many load balancers allow an idle upstream. */
|
|
40
|
+
var KEEPALIVE_INTERVAL_MS = 15e3;
|
|
41
|
+
export { getGroups as a, serverSourcedInputIds as i, KEEPALIVE_PREFERENCE as n, getInputItems as o, raceAbort as r, getLayoutItems as s, KEEPALIVE_INTERVAL_MS as t };
|
|
39
42
|
|
|
40
|
-
//# sourceMappingURL=
|
|
43
|
+
//# sourceMappingURL=keepalive-vtcjhAV3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keepalive-vtcjhAV3.js","names":[],"sources":["../../../../schemas/src/traversal.ts","../../../../solve/dist/keepalive-vtcjhAV3.js"],"sourcesContent":["// Schema layout traversal — the single place that knows how to walk a UISchema's\n// layout. The layout is a discriminated union ('tabbed' | 'flat'); without this module\n// every caller re-derives the `layout.type === 'tabbed' ? tabs.flatMap(...) : groups`\n// branch by hand. Add a new layout kind and you change this file, not a dozen others.\n//\n// Lives in @selvajs/schemas (next to the types it walks) so any package that depends on\n// the schema can traverse it without pulling in @selvajs/ui. Readers are defensive: a\n// missing layout or missing groups/items yields an empty result rather than throwing.\n\nimport type { UISchema, GroupConfig, LayoutItem, InputLayoutItem } from './generated/index.js';\n\n/**\n * Every group across the schema, in tab order, with tab boundaries flattened away.\n * Callers that need the tab structure (e.g. position-based panels) must walk `layout`\n * directly — this is intentionally a group-level view.\n */\nexport function getGroups(schema: UISchema): GroupConfig[] {\n\tif (!schema?.layout) return [];\n\tif (schema.layout.type === 'tabbed') {\n\t\treturn schema.layout.tabs?.flatMap((t) => t.groups ?? []) ?? [];\n\t}\n\tif (schema.layout.type === 'flat') {\n\t\treturn schema.layout.groups ?? [];\n\t}\n\treturn [];\n}\n\n/** Every layout item across every group — inputs, outputs, and linebreaks. */\nexport function getLayoutItems(schema: UISchema): LayoutItem[] {\n\treturn getGroups(schema).flatMap((g) => g.items ?? []);\n}\n\n/** Only the input items. `getExternalInputs` and preset save build on this. */\nexport function getInputItems(schema: UISchema): InputLayoutItem[] {\n\treturn getLayoutItems(schema).filter((i): i is InputLayoutItem => i.type === 'input');\n}\n","import { getInputItems } from \"@selvajs/schemas\";\n// src/shared/server-sourced.ts\n/**\n* Inputs the schema marks `source.kind === 'server'`. No resolver fills them, so they solve with\n* their schema default: the client sends no value for them, and the server refuses one.\n*/\nfunction serverSourcedInputIds(schema) {\n\treturn new Set(getInputItems(schema).filter((item) => item.source?.kind === \"server\").map((item) => item.paramId));\n}\n// src/shared/abort.ts\n/** `promise`'s outcome, or a rejection with `signal`'s reason if that fires first. */\nfunction raceAbort(promise, signal) {\n\treturn new Promise((resolve, reject) => {\n\t\tconst onAbort = () => reject(signal.reason);\n\t\tif (signal.aborted) onAbort();\n\t\tsignal.addEventListener(\"abort\", onAbort, { once: true });\n\t\tpromise.then(resolve, reject).finally(() => signal.removeEventListener(\"abort\", onAbort));\n\t});\n}\n// src/shared/keepalive.ts\nconst KEEPALIVE_PREFERENCE = \"selva-keepalive\";\n/** Under the 30 s many load balancers allow an idle upstream. */\nconst KEEPALIVE_INTERVAL_MS = 15e3;\nexport { serverSourcedInputIds as i, KEEPALIVE_PREFERENCE as n, raceAbort as r, KEEPALIVE_INTERVAL_MS as t };\n\n//# sourceMappingURL=keepalive-vtcjhAV3.js.map"],"mappings":";;;;;;AAgBA,SAAgB,UAAU,QAAiC;CAC1D,IAAI,CAAC,QAAQ,QAAQ,OAAO,CAAC;CAC7B,IAAI,OAAO,OAAO,SAAS,UAC1B,OAAO,OAAO,OAAO,MAAM,SAAS,MAAM,EAAE,UAAU,CAAC,CAAC,KAAK,CAAC;CAE/D,IAAI,OAAO,OAAO,SAAS,QAC1B,OAAO,OAAO,OAAO,UAAU,CAAC;CAEjC,OAAO,CAAC;AACT;;AAGA,SAAgB,eAAe,QAAgC;CAC9D,OAAO,UAAU,MAAM,CAAC,CAAC,SAAS,MAAM,EAAE,SAAS,CAAC,CAAC;AACtD;;AAGA,SAAgB,cAAc,QAAqC;CAClE,OAAO,eAAe,MAAM,CAAC,CAAC,QAAQ,MAA4B,EAAE,SAAS,OAAO;AACrF;;;;;;AC7BA,SAAS,sBAAsB,QAAQ;CACtC,OAAO,IAAI,IAAI,cAAc,MAAM,CAAC,CAAC,QAAQ,SAAS,KAAK,QAAQ,SAAS,QAAQ,CAAC,CAAC,KAAK,SAAS,KAAK,OAAO,CAAC;AAClH;;AAGA,SAAS,UAAU,SAAS,QAAQ;CACnC,OAAO,IAAI,SAAS,SAAS,WAAW;EACvC,MAAM,gBAAgB,OAAO,OAAO,MAAM;EAC1C,IAAI,OAAO,SAAS,QAAQ;EAC5B,OAAO,iBAAiB,SAAS,SAAS,EAAE,MAAM,KAAK,CAAC;EACxD,QAAQ,KAAK,SAAS,MAAM,CAAC,CAAC,cAAc,OAAO,oBAAoB,SAAS,OAAO,CAAC;CACzF,CAAC;AACF;AAEA,IAAM,uBAAuB;;AAE7B,IAAM,wBAAwB"}
|
|
@@ -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.8\",\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\"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":""}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { K as actorFrom, g as getPermissionStore, u as getEventSink } from "./providers.server.js";
|
|
2
2
|
// src/lib/server/permissions.server.ts
|
|
3
3
|
/**
|
|
4
4
|
* Permission read/write seam over `IPlatformPermissionStore`. Reads happen
|
|
@@ -8,8 +8,8 @@ import { t as ALL_PLATFORM_PERMISSIONS } from "./types3.js";
|
|
|
8
8
|
import { d as encodeOffsetCursor, l as clampPageLimit, u as decodeOffsetCursor } from "./visibility.js";
|
|
9
9
|
import { n as readBool } from "./limits.js";
|
|
10
10
|
import { a as createLogger, i as ConsoleLogger, n as renderThrown } from "./definitions.js";
|
|
11
|
-
import { c as
|
|
12
|
-
import { i as
|
|
11
|
+
import { c as stableStringify, d as ErrorCodes, g as isDefinitionRef, h as enableDebugLogging, i as TreeBuilder, l as withSolveMode, n as GrasshopperClient, u as ComputeError } from "./grasshopper.js";
|
|
12
|
+
import { i as serverSourcedInputIds, n as KEEPALIVE_PREFERENCE, o as getInputItems, r as raceAbort, t as KEEPALIVE_INTERVAL_MS } from "./keepalive-vtcjhAV3.js";
|
|
13
13
|
import { createRequire } from "node:module";
|
|
14
14
|
import * as crypto from "node:crypto";
|
|
15
15
|
import { createCipheriv, createDecipheriv, createHash, createHmac, createPrivateKey, randomBytes, randomUUID, sign, timingSafeEqual } from "node:crypto";
|
|
@@ -34193,6 +34193,14 @@ function createClientCache(config) {
|
|
|
34193
34193
|
evictEntry(id);
|
|
34194
34194
|
}
|
|
34195
34195
|
},
|
|
34196
|
+
largestReportedRequestBytes() {
|
|
34197
|
+
let largest = null;
|
|
34198
|
+
for (const { limits } of cache.values()) {
|
|
34199
|
+
const reported = limits.maxRequestBytes;
|
|
34200
|
+
if (reported !== null && (largest === null || reported > largest)) largest = reported;
|
|
34201
|
+
}
|
|
34202
|
+
return largest;
|
|
34203
|
+
},
|
|
34196
34204
|
solveCacheStats() {
|
|
34197
34205
|
const total = {
|
|
34198
34206
|
warmClients: cache.size,
|
|
@@ -34707,6 +34715,13 @@ var SolveEngine = class {
|
|
|
34707
34715
|
this.clientCache.clearSolveCaches();
|
|
34708
34716
|
}
|
|
34709
34717
|
/**
|
|
34718
|
+
* The largest request body a warm client's server reports accepting
|
|
34719
|
+
* (`RHINO_COMPUTE_MAX_REQUEST_SIZE`). Null until a server that reports one has been reached.
|
|
34720
|
+
*/
|
|
34721
|
+
largestReportedRequestBytes() {
|
|
34722
|
+
return this.clientCache.largestReportedRequestBytes();
|
|
34723
|
+
}
|
|
34724
|
+
/**
|
|
34710
34725
|
* Drop every retained `.gh` byte entry. Safe at any time: entries key on an
|
|
34711
34726
|
* immutable version id, so clearing costs a storage re-read and nothing else.
|
|
34712
34727
|
*/
|
|
@@ -34870,6 +34885,60 @@ var SolveEngine = class {
|
|
|
34870
34885
|
};
|
|
34871
34886
|
}
|
|
34872
34887
|
};
|
|
34888
|
+
var SPACE = new Uint8Array([32]);
|
|
34889
|
+
/** True when the request asked for a keep-alive response (`Prefer: selva-keepalive`). */
|
|
34890
|
+
function wantsKeepalive(request) {
|
|
34891
|
+
const prefer = request.headers.get("Prefer");
|
|
34892
|
+
if (!prefer) return false;
|
|
34893
|
+
return prefer.split(",").some((token) => token.split(";")[0].trim().toLowerCase() === KEEPALIVE_PREFERENCE);
|
|
34894
|
+
}
|
|
34895
|
+
/**
|
|
34896
|
+
* Answers 200 at once and holds the connection with a space every `intervalMs` until `work`
|
|
34897
|
+
* settles, then sends its status, headers and body (wire format in `shared/keepalive.ts`).
|
|
34898
|
+
*
|
|
34899
|
+
* `work` must resolve to every outcome, errors included: once the 200 is out, a rejection can
|
|
34900
|
+
* only drop the connection.
|
|
34901
|
+
*/
|
|
34902
|
+
function respondWithKeepalive(work, intervalMs = KEEPALIVE_INTERVAL_MS) {
|
|
34903
|
+
let timer;
|
|
34904
|
+
const body = new ReadableStream({
|
|
34905
|
+
start(controller) {
|
|
34906
|
+
controller.enqueue(SPACE);
|
|
34907
|
+
timer = setInterval(() => controller.enqueue(SPACE), intervalMs);
|
|
34908
|
+
work.then(async (response) => {
|
|
34909
|
+
clearInterval(timer);
|
|
34910
|
+
const meta = {
|
|
34911
|
+
status: response.status,
|
|
34912
|
+
headers: [...response.headers]
|
|
34913
|
+
};
|
|
34914
|
+
controller.enqueue(new TextEncoder().encode(`${JSON.stringify(meta)}\n`));
|
|
34915
|
+
if (response.body) {
|
|
34916
|
+
const reader = response.body.getReader();
|
|
34917
|
+
for (;;) {
|
|
34918
|
+
const { done, value } = await reader.read();
|
|
34919
|
+
if (done) break;
|
|
34920
|
+
controller.enqueue(value);
|
|
34921
|
+
}
|
|
34922
|
+
}
|
|
34923
|
+
controller.close();
|
|
34924
|
+
}).catch((err) => {
|
|
34925
|
+
clearInterval(timer);
|
|
34926
|
+
controller.error(err);
|
|
34927
|
+
});
|
|
34928
|
+
},
|
|
34929
|
+
cancel() {
|
|
34930
|
+
clearInterval(timer);
|
|
34931
|
+
}
|
|
34932
|
+
});
|
|
34933
|
+
return new Response(body, {
|
|
34934
|
+
status: 200,
|
|
34935
|
+
headers: {
|
|
34936
|
+
"Content-Type": "application/octet-stream",
|
|
34937
|
+
"Cache-Control": "no-store",
|
|
34938
|
+
"Preference-Applied": KEEPALIVE_PREFERENCE
|
|
34939
|
+
}
|
|
34940
|
+
});
|
|
34941
|
+
}
|
|
34873
34942
|
// ../server/src/organizations/org-asset-service.ts
|
|
34874
34943
|
/**
|
|
34875
34944
|
* Orchestrates org-asset writes that span IStorageProvider + IOrgStore — one
|
|
@@ -35641,6 +35710,6 @@ if (!globalThis[ERROR_HOOKS_FLAG]) {
|
|
|
35641
35710
|
getErrorReporter().capture(error, { tags: { origin: "uncaughtException" } });
|
|
35642
35711
|
});
|
|
35643
35712
|
}
|
|
35644
|
-
export { deploymentSnapshot as A,
|
|
35713
|
+
export { deploymentSnapshot as A, LocalComputeServerStore as B, getUserProfileStore as C, computeDebugMode as D, RETIRED_KEYS as E, acceptsGzip as F, NoopEventSink as G, emptyProfile as H, postedServerSourcedIds as I, definitionPaths as J, actorFrom as K, respondWithKeepalive as L, DEFAULT_SOLVE_DEADLINE_MS as M, MAX_SOLVE_DEADLINE_MS as N, deploymentManifest as O, SolveEngine as P, solveInputsFromSchema as R, getTenancy as S, providers as T, classifyAssetPath as U, isEncryptedSecret as V, orgPaths as W, diffSnapshots as Y, getPlatformProjectGrantStore as _, getComputeServerConfigStore as a, getSolveMetricSink as b, getDefinitionService as c, getInviteStore as d, getLogger as f, getPermissionStore as g, getOrganizationProvider as h, getBranding as i, keyRotationStatus as j, deploymentReport as k, getErrorReporter as l, getOrgAssetService as m, getAuditQuery as n, getDataProvider as o, getNotificationProvider as p, actorOf as q, getAuthProvider as r, getDefinitionMeta as s, flag as t, getEventSink as u, getProjectProvider as v, lazyLogger as w, getStorageProvider as x, getShareLinkStore as y, wantsKeepalive as z };
|
|
35645
35714
|
|
|
35646
35715
|
//# sourceMappingURL=providers.server.js.map
|