@selvajs/compute 5.0.0-beta.9 → 5.0.1
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/dist/core.js +1 -1
- package/dist/grasshopper.d.ts +22 -1
- package/dist/grasshopper.js +32 -1
- package/dist/grasshopper.js.map +1 -1
- package/dist/{handle-files-fKtSlWT2.js → handle-files-D-4X4Uh_.js} +33 -5
- package/dist/handle-files-D-4X4Uh_.js.map +1 -0
- package/package.json +2 -2
- package/dist/handle-files-fKtSlWT2.js.map +0 -1
package/dist/core.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { P as ComputeError, T as DEFAULT_BLOCKED_HOST, F as ErrorCodes, d as classifyProbeFailure, y as decodeBase64ToBinary, t as downloadFileData, n as downloadFileDataByRoot, j as enableDebugLogging, r as extractFilesFromComputeResponse, l as fetchCompute, M as getLogger, a as groupFilesByRoot, k as hasField, s as isDefinitionRef, A as readField, N as setLogger, o as subFolderSegments, E as validateServerUrl } from "./handle-files-
|
|
1
|
+
export { P as ComputeError, T as DEFAULT_BLOCKED_HOST, F as ErrorCodes, d as classifyProbeFailure, y as decodeBase64ToBinary, t as downloadFileData, n as downloadFileDataByRoot, j as enableDebugLogging, r as extractFilesFromComputeResponse, l as fetchCompute, M as getLogger, a as groupFilesByRoot, k as hasField, s as isDefinitionRef, A as readField, N as setLogger, o as subFolderSegments, E as validateServerUrl } from "./handle-files-D-4X4Uh_.js";
|
package/dist/grasshopper.d.ts
CHANGED
|
@@ -4,6 +4,21 @@ interface ServerVersion {
|
|
|
4
4
|
compute: string;
|
|
5
5
|
git_sha: string | null;
|
|
6
6
|
}
|
|
7
|
+
/** What `GET /limits` reports. Only the VektorNode fork answers it. */
|
|
8
|
+
interface ServerLimits {
|
|
9
|
+
/** Longest the server lets one request run (`RHINO_COMPUTE_TIMEOUT`, `--timeout`). */
|
|
10
|
+
timeoutSeconds: number;
|
|
11
|
+
/** Largest request body it accepts (`RHINO_COMPUTE_MAX_REQUEST_SIZE`, `--max-request-size`). */
|
|
12
|
+
maxRequestBytes: number;
|
|
13
|
+
/** A stale definition pointer answers `definition_not_cached`, so pointer reuse is safe. */
|
|
14
|
+
signalsStaleDefinition: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Changes whenever the server's plugins may have: it restarted (how a plugin is redeployed) or
|
|
17
|
+
* recycled its children. A solve result from another deployment may be wrong. `null` when the
|
|
18
|
+
* server doesn't report one.
|
|
19
|
+
*/
|
|
20
|
+
deploymentId: string | null;
|
|
21
|
+
}
|
|
7
22
|
interface ServerStats {
|
|
8
23
|
isOnline: boolean;
|
|
9
24
|
version?: ServerVersion;
|
|
@@ -106,6 +121,12 @@ declare class ComputeServerStats {
|
|
|
106
121
|
getActiveChildren(options?: {
|
|
107
122
|
initialize?: boolean;
|
|
108
123
|
}): Promise<number | null>;
|
|
124
|
+
/**
|
|
125
|
+
* The server's request limits, or `null` when it can't report them: a standard rhino.compute
|
|
126
|
+
* has no `/limits`, and neither does an older fork. A missing route is expected, so it isn't
|
|
127
|
+
* logged as a failure.
|
|
128
|
+
*/
|
|
129
|
+
getLimits(): Promise<ServerLimits | null>;
|
|
109
130
|
/**
|
|
110
131
|
* Get the server version information.
|
|
111
132
|
*
|
|
@@ -1316,5 +1337,5 @@ export declare class TreeBuilder {
|
|
|
1316
1337
|
private static hasValidValue;
|
|
1317
1338
|
private static clampValue;
|
|
1318
1339
|
}
|
|
1319
|
-
export { type BooleanInputType, type CacheOptions, type CacheStats, type ColorInputType, ComputeServerStats, type CreateClientOptions, type DataItem, type DataTree, type DataTreeDefault, type DataTreePath, type DataTreeValue, type DefaultValue, type FileInputType, type GeometryInputType, type GetValuesOptions, type GetValuesResult, GrasshopperClient, type GrasshopperComputeConfig, type GrasshopperComputeResponse, type GrasshopperParsedIO, type GrasshopperParsedIORaw, GrasshopperResponseProcessor, type InnerTreeData, type InputParam, type InputParamSchema, type InputParseError, type NumericInputType, type OutputParamSchema, type ParsedContext, type RhinoDecodeError, type RhinoModelUnit, type RhinoRuntime, type SchedulerMode, type SchedulerSolveOptions, type SchemaEndpointResult, type SelvaEventTarget, type SelvaResponseBlock, type ServerStats, type ServerVersion, type SolveContext, type SolveDetail, type SolveExecutor, type SolveOptions, type SolveResult, type SolveSchedulerOptions, type TextInputType, type TreeValueEntry, type ValueListInputType };
|
|
1340
|
+
export { type BooleanInputType, type CacheOptions, type CacheStats, type ColorInputType, ComputeServerStats, type CreateClientOptions, type DataItem, type DataTree, type DataTreeDefault, type DataTreePath, type DataTreeValue, type DefaultValue, type FileInputType, type GeometryInputType, type GetValuesOptions, type GetValuesResult, GrasshopperClient, type GrasshopperComputeConfig, type GrasshopperComputeResponse, type GrasshopperParsedIO, type GrasshopperParsedIORaw, GrasshopperResponseProcessor, type InnerTreeData, type InputParam, type InputParamSchema, type InputParseError, type NumericInputType, type OutputParamSchema, type ParsedContext, type RhinoDecodeError, type RhinoModelUnit, type RhinoRuntime, type SchedulerMode, type SchedulerSolveOptions, type SchemaEndpointResult, type SelvaEventTarget, type SelvaResponseBlock, type ServerLimits, type ServerStats, type ServerVersion, type SolveContext, type SolveDetail, type SolveExecutor, type SolveOptions, type SolveResult, type SolveSchedulerOptions, type TextInputType, type TreeValueEntry, type ValueListInputType };
|
|
1320
1341
|
//# sourceMappingURL=grasshopper.d.ts.map
|
package/dist/grasshopper.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as readField, C as withJsonContentType, D as tryParseJson, E as validateServerUrl, F as ErrorCodes, I as abortedByCaller, L as sleep, M as getLogger, O as redactUrl, P as ComputeError, S as buildAuthHeaders, _ as readBodyText, b as detectBase64Payload, c as isDefinitionUrl, d as classifyProbeFailure, f as isRedirect, g as raceSignal, h as composeSignal, i as isBase64Flag, k as hasField, l as fetchCompute, m as setResponseWireSize, p as getResponseWireSize, s as isDefinitionRef, t as downloadFileData, u as validateNumbers, v as base64ByteArray, w as warnIfClientSide, x as encodeStringToBase64 } from "./handle-files-
|
|
1
|
+
import { A as readField, C as withJsonContentType, D as tryParseJson, E as validateServerUrl, F as ErrorCodes, I as abortedByCaller, L as sleep, M as getLogger, O as redactUrl, P as ComputeError, S as buildAuthHeaders, _ as readBodyText, b as detectBase64Payload, c as isDefinitionUrl, d as classifyProbeFailure, f as isRedirect, g as raceSignal, h as composeSignal, i as isBase64Flag, k as hasField, l as fetchCompute, m as setResponseWireSize, p as getResponseWireSize, s as isDefinitionRef, t as downloadFileData, u as validateNumbers, v as base64ByteArray, w as warnIfClientSide, x as encodeStringToBase64 } from "./handle-files-D-4X4Uh_.js";
|
|
2
2
|
// src/grasshopper/server/compute-server-stats.ts
|
|
3
3
|
/**
|
|
4
4
|
* Server health and control: liveness, version, child processes, cache purges.
|
|
@@ -160,6 +160,37 @@ var ComputeServerStats = class ComputeServerStats {
|
|
|
160
160
|
return parseInt(text, 10);
|
|
161
161
|
}
|
|
162
162
|
/**
|
|
163
|
+
* The server's request limits, or `null` when it can't report them: a standard rhino.compute
|
|
164
|
+
* has no `/limits`, and neither does an older fork. A missing route is expected, so it isn't
|
|
165
|
+
* logged as a failure.
|
|
166
|
+
*/
|
|
167
|
+
async getLimits() {
|
|
168
|
+
this.ensureNotDisposed();
|
|
169
|
+
let text;
|
|
170
|
+
try {
|
|
171
|
+
const response = await this.fetchWithTimeout(`${this.serverUrl}/limits`);
|
|
172
|
+
if (!response.ok) {
|
|
173
|
+
await response.body?.cancel().catch(() => {});
|
|
174
|
+
return null;
|
|
175
|
+
}
|
|
176
|
+
const read = await readBodyText(response, ComputeServerStats.MAX_BODY_BYTES);
|
|
177
|
+
if (read.truncated) return null;
|
|
178
|
+
text = read.text;
|
|
179
|
+
} catch (err) {
|
|
180
|
+
getLogger().debug(`[ComputeServerStats] GET /limits errored: ${describeProbeError(err)}`);
|
|
181
|
+
return null;
|
|
182
|
+
}
|
|
183
|
+
const json = tryParseJson(text);
|
|
184
|
+
const positive = (n) => typeof n === "number" && Number.isFinite(n) && n > 0;
|
|
185
|
+
if (!json || !positive(json.timeoutSeconds) || !positive(json.maxRequestBytes)) return null;
|
|
186
|
+
return {
|
|
187
|
+
timeoutSeconds: json.timeoutSeconds,
|
|
188
|
+
maxRequestBytes: json.maxRequestBytes,
|
|
189
|
+
signalsStaleDefinition: json.signalsStaleDefinition === true,
|
|
190
|
+
deploymentId: typeof json.deploymentId === "string" && json.deploymentId !== "" ? json.deploymentId : null
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
163
194
|
* Get the server version information.
|
|
164
195
|
*
|
|
165
196
|
* @returns Version object with rhino, compute, and git_sha, or null if unavailable
|