@selvajs/compute 3.1.0-beta.5 → 3.1.0-beta.6

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.
Files changed (51) hide show
  1. package/dist/chunk-727SRM4E.cjs +62 -0
  2. package/dist/chunk-727SRM4E.cjs.map +1 -0
  3. package/dist/{chunk-GF6ZIJWX.cjs → chunk-CUQQ3ZBV.cjs} +1 -1
  4. package/dist/chunk-CUQQ3ZBV.cjs.map +1 -0
  5. package/dist/chunk-CWODTGNH.js +62 -0
  6. package/dist/chunk-CWODTGNH.js.map +1 -0
  7. package/dist/{chunk-PJATLYMU.js → chunk-JNFNLKFO.js} +2 -2
  8. package/dist/chunk-JNFNLKFO.js.map +1 -0
  9. package/dist/{chunk-54O6BO24.js → chunk-WPB2LKCD.js} +1 -1
  10. package/dist/chunk-WPB2LKCD.js.map +1 -0
  11. package/dist/{chunk-7KFBCOZM.cjs → chunk-Y5E6RIEH.cjs} +2 -2
  12. package/dist/{chunk-7KFBCOZM.cjs.map → chunk-Y5E6RIEH.cjs.map} +1 -1
  13. package/dist/core.cjs +1 -1
  14. package/dist/core.d.cts +3 -3
  15. package/dist/core.d.ts +3 -3
  16. package/dist/core.js +1 -1
  17. package/dist/grasshopper.cjs +1 -1
  18. package/dist/grasshopper.d.cts +8 -18
  19. package/dist/grasshopper.d.ts +8 -18
  20. package/dist/grasshopper.js +1 -1
  21. package/dist/{handle-files-DMnx92gr.d.ts → handle-files-BISo_wob.d.cts} +17 -69
  22. package/dist/{handle-files-DMnx92gr.d.cts → handle-files-BISo_wob.d.ts} +17 -69
  23. package/dist/index.cjs +1 -1
  24. package/dist/index.d.cts +3 -3
  25. package/dist/index.d.ts +3 -3
  26. package/dist/index.js +1 -1
  27. package/dist/types-BGhtYxZ-.d.cts +45 -0
  28. package/dist/types-BGhtYxZ-.d.ts +45 -0
  29. package/dist/{types-DuOh5XqS.d.ts → types-C8XWc4Ab.d.cts} +9 -56
  30. package/dist/{types-Ci8Z0-hF.d.cts → types-Dtok-mVq.d.ts} +9 -56
  31. package/dist/visualization-36IV2CVU.cjs +2 -0
  32. package/dist/visualization-36IV2CVU.cjs.map +1 -0
  33. package/dist/visualization-QCI36RHC.js +2 -0
  34. package/dist/visualization.cjs +1 -1
  35. package/dist/visualization.d.cts +91 -49
  36. package/dist/visualization.d.ts +91 -49
  37. package/dist/visualization.js +1 -1
  38. package/package.json +1 -1
  39. package/dist/chunk-54O6BO24.js.map +0 -1
  40. package/dist/chunk-EZRBMUXT.cjs +0 -62
  41. package/dist/chunk-EZRBMUXT.cjs.map +0 -1
  42. package/dist/chunk-GF6ZIJWX.cjs.map +0 -1
  43. package/dist/chunk-ORGJSKR4.js +0 -62
  44. package/dist/chunk-ORGJSKR4.js.map +0 -1
  45. package/dist/chunk-PJATLYMU.js.map +0 -1
  46. package/dist/types-C9YpTbr3.d.cts +0 -121
  47. package/dist/types-C9YpTbr3.d.ts +0 -121
  48. package/dist/visualization-C3YOGQTW.js +0 -2
  49. package/dist/visualization-CERJ6XDX.cjs +0 -2
  50. package/dist/visualization-CERJ6XDX.cjs.map +0 -1
  51. /package/dist/{visualization-C3YOGQTW.js.map → visualization-QCI36RHC.js.map} +0 -0
@@ -1,121 +0,0 @@
1
- /**
2
- * Rhino model unit types supported by Rhino.Compute
3
- */
4
- type RhinoModelUnit = 'None' | 'Microns' | 'Millimeters' | 'Centimeters' | 'Meters' | 'Kilometers' | 'Microinches' | 'Mils' | 'Inches' | 'Feet' | 'Miles' | 'CustomUnits' | 'Angstroms' | 'Nanometers' | 'Decimeters' | 'Dekameters' | 'Hectometers' | 'Megameters' | 'Gigameters' | 'Yards' | 'PrinterPoints' | 'PrinterPicas' | 'NauticalMiles' | 'AstronomicalUnits' | 'LightYears' | 'Parsecs' | 'Unset';
5
- /**
6
- * Retry policy for transient errors (network, 502, 503, 504, optionally 429).
7
- *
8
- * Retries use exponential backoff with jitter, capped at `maxDelayMs`.
9
- * If the server returns `Retry-After`, that value is honored instead — even
10
- * above `maxDelayMs` (the server's stated window wins), up to an absolute
11
- * 60s safety cap.
12
- *
13
- * Duplicate-POST caveat: every compute request is a POST. A network error can
14
- * strike after the body was sent but before the response arrived — in that
15
- * window the server may already have executed the request, and a retry runs it
16
- * again. Compute solves are deterministic/idempotent so this is normally just
17
- * wasted work, but callers wrapping non-idempotent endpoints should keep
18
- * `attempts` at 0 (the default).
19
- */
20
- interface RetryPolicy {
21
- /** Maximum number of retry attempts after the initial request (default: 0). */
22
- attempts?: number;
23
- /** Base delay in milliseconds for exponential backoff (default: 500). */
24
- baseDelayMs?: number;
25
- /** Upper bound for backoff delay (default: 30_000). */
26
- maxDelayMs?: number;
27
- /** Whether to retry on 429 responses (default: true — honors Retry-After). */
28
- retryOn429?: boolean;
29
- }
30
- interface ComputeConfig {
31
- /**
32
- * The base URL of the Rhino Compute server (e.g., http://localhost:6500).
33
- *
34
- * This should point at the `rhino.compute` front (the reverse proxy), not a
35
- * bare `compute.geometry` child process. `ComputeServerStats` relies on the
36
- * proxy liveness root `/` and proxy-only endpoints like `/activechildren`,
37
- * `/idlespan`, and the child-lifecycle controls; targeting a bare
38
- * `compute.geometry` would make those 404 even though `/grasshopper` would
39
- * still solve.
40
- */
41
- serverUrl: string;
42
- /** Optional API key for authenticating with the server (RhinoComputeKey) */
43
- apiKey?: string;
44
- /** Optional Bearer token for authentication (e.g., when behind a proxy or API gateway) */
45
- authToken?: string;
46
- /**
47
- * Extra headers sent on every solve / IO request to the compute server.
48
- *
49
- * Merged UNDER the transport's own headers (`X-Request-ID`, `Content-Type`,
50
- * `Authorization`, `RhinoComputeKey`) so a caller can never accidentally
51
- * override auth or the request id. Intended for routing/telemetry hints a
52
- * reverse proxy or load balancer reads — e.g. a definition-affinity key so a
53
- * pool routes repeat solves of one definition to the same VM (its per-VM
54
- * definition/solve caches then hit). A single-node server ignores unknown
55
- * headers, so this is inert until a router exists.
56
- */
57
- headers?: Record<string, string>;
58
- /** Enable debug logging to the console */
59
- debug?: boolean;
60
- /** Suppress browser security warnings in the console */
61
- suppressBrowserWarning?: boolean;
62
- /** @deprecated Renamed to `suppressBrowserWarning`. */
63
- suppressClientSideWarning?: boolean;
64
- /**
65
- * Per-**attempt** timeout in milliseconds. Set to `0` to disable (useful for
66
- * long solves where any timeout is the wrong answer). Default: no timeout.
67
- *
68
- * This is NOT a total deadline: the timeout is re-armed for every retry
69
- * attempt, so with `retry: { attempts: N }` the worst-case wall clock is
70
- * `(N + 1) × timeoutMs` plus backoff sleeps between attempts. Callers that
71
- * need a hard overall deadline should pass their own `signal` (e.g. from
72
- * `AbortSignal.timeout(totalMs)`), which wins over any pending retry.
73
- *
74
- * Uses `AbortSignal.timeout` so the timer is not throttled when the tab is hidden.
75
- */
76
- timeoutMs?: number;
77
- /**
78
- * Retry policy for transient errors. Default: no retries.
79
- */
80
- retry?: RetryPolicy;
81
- /**
82
- * Optional caller-supplied AbortSignal. Composes with the internal timeout —
83
- * whichever fires first wins. Lets callers cancel in-flight requests
84
- * (e.g. on component unmount or when superseding a stale solve).
85
- */
86
- signal?: AbortSignal;
87
- /**
88
- * Optional callback invoked with the server's per-request `Server-Timing`
89
- * breakdown when the response carries one (the `/grasshopper` solve endpoint
90
- * emits `decode;dur=N, solve;dur=N, encode;dur=N` on every response).
91
- *
92
- * Fires once per request, before the parsed body is returned — on success
93
- * and on the HTTP-500 partial-success path (a solve that completed with
94
- * Grasshopper errors still carries real timings, often the slowest ones).
95
- * The transport stays response-type-agnostic — this is a side
96
- * channel for telemetry, it does not change what a call returns. Use it to
97
- * feed a perf monitor or surface "solve took Nms" without server log access.
98
- *
99
- * `requestId` is the same id sent as the `X-Request-ID` header and used in
100
- * this library's own debug logs — use it to correlate a timing entry with
101
- * a specific request when multiple solves are in flight concurrently.
102
- */
103
- onServerTiming?: (timing: ServerTiming, requestId: string) => void;
104
- }
105
- /**
106
- * Parsed `Server-Timing` metrics from a Compute response. Durations are in
107
- * milliseconds. Any metric the server omits is `undefined`. `raw` is the
108
- * original header value, preserved so callers can read non-standard metrics.
109
- */
110
- interface ServerTiming {
111
- /** Time the server spent decoding the request (deserialize + load definition). */
112
- decode?: number;
113
- /** Time spent actually solving the Grasshopper definition. */
114
- solve?: number;
115
- /** Time spent encoding the response (serialize geometry). */
116
- encode?: number;
117
- /** The raw `Server-Timing` header value, e.g. `decode;dur=3, solve;dur=120, encode;dur=8`. */
118
- raw: string;
119
- }
120
-
121
- export type { ComputeConfig as C, RetryPolicy as R, ServerTiming as S, RhinoModelUnit as a };
@@ -1,121 +0,0 @@
1
- /**
2
- * Rhino model unit types supported by Rhino.Compute
3
- */
4
- type RhinoModelUnit = 'None' | 'Microns' | 'Millimeters' | 'Centimeters' | 'Meters' | 'Kilometers' | 'Microinches' | 'Mils' | 'Inches' | 'Feet' | 'Miles' | 'CustomUnits' | 'Angstroms' | 'Nanometers' | 'Decimeters' | 'Dekameters' | 'Hectometers' | 'Megameters' | 'Gigameters' | 'Yards' | 'PrinterPoints' | 'PrinterPicas' | 'NauticalMiles' | 'AstronomicalUnits' | 'LightYears' | 'Parsecs' | 'Unset';
5
- /**
6
- * Retry policy for transient errors (network, 502, 503, 504, optionally 429).
7
- *
8
- * Retries use exponential backoff with jitter, capped at `maxDelayMs`.
9
- * If the server returns `Retry-After`, that value is honored instead — even
10
- * above `maxDelayMs` (the server's stated window wins), up to an absolute
11
- * 60s safety cap.
12
- *
13
- * Duplicate-POST caveat: every compute request is a POST. A network error can
14
- * strike after the body was sent but before the response arrived — in that
15
- * window the server may already have executed the request, and a retry runs it
16
- * again. Compute solves are deterministic/idempotent so this is normally just
17
- * wasted work, but callers wrapping non-idempotent endpoints should keep
18
- * `attempts` at 0 (the default).
19
- */
20
- interface RetryPolicy {
21
- /** Maximum number of retry attempts after the initial request (default: 0). */
22
- attempts?: number;
23
- /** Base delay in milliseconds for exponential backoff (default: 500). */
24
- baseDelayMs?: number;
25
- /** Upper bound for backoff delay (default: 30_000). */
26
- maxDelayMs?: number;
27
- /** Whether to retry on 429 responses (default: true — honors Retry-After). */
28
- retryOn429?: boolean;
29
- }
30
- interface ComputeConfig {
31
- /**
32
- * The base URL of the Rhino Compute server (e.g., http://localhost:6500).
33
- *
34
- * This should point at the `rhino.compute` front (the reverse proxy), not a
35
- * bare `compute.geometry` child process. `ComputeServerStats` relies on the
36
- * proxy liveness root `/` and proxy-only endpoints like `/activechildren`,
37
- * `/idlespan`, and the child-lifecycle controls; targeting a bare
38
- * `compute.geometry` would make those 404 even though `/grasshopper` would
39
- * still solve.
40
- */
41
- serverUrl: string;
42
- /** Optional API key for authenticating with the server (RhinoComputeKey) */
43
- apiKey?: string;
44
- /** Optional Bearer token for authentication (e.g., when behind a proxy or API gateway) */
45
- authToken?: string;
46
- /**
47
- * Extra headers sent on every solve / IO request to the compute server.
48
- *
49
- * Merged UNDER the transport's own headers (`X-Request-ID`, `Content-Type`,
50
- * `Authorization`, `RhinoComputeKey`) so a caller can never accidentally
51
- * override auth or the request id. Intended for routing/telemetry hints a
52
- * reverse proxy or load balancer reads — e.g. a definition-affinity key so a
53
- * pool routes repeat solves of one definition to the same VM (its per-VM
54
- * definition/solve caches then hit). A single-node server ignores unknown
55
- * headers, so this is inert until a router exists.
56
- */
57
- headers?: Record<string, string>;
58
- /** Enable debug logging to the console */
59
- debug?: boolean;
60
- /** Suppress browser security warnings in the console */
61
- suppressBrowserWarning?: boolean;
62
- /** @deprecated Renamed to `suppressBrowserWarning`. */
63
- suppressClientSideWarning?: boolean;
64
- /**
65
- * Per-**attempt** timeout in milliseconds. Set to `0` to disable (useful for
66
- * long solves where any timeout is the wrong answer). Default: no timeout.
67
- *
68
- * This is NOT a total deadline: the timeout is re-armed for every retry
69
- * attempt, so with `retry: { attempts: N }` the worst-case wall clock is
70
- * `(N + 1) × timeoutMs` plus backoff sleeps between attempts. Callers that
71
- * need a hard overall deadline should pass their own `signal` (e.g. from
72
- * `AbortSignal.timeout(totalMs)`), which wins over any pending retry.
73
- *
74
- * Uses `AbortSignal.timeout` so the timer is not throttled when the tab is hidden.
75
- */
76
- timeoutMs?: number;
77
- /**
78
- * Retry policy for transient errors. Default: no retries.
79
- */
80
- retry?: RetryPolicy;
81
- /**
82
- * Optional caller-supplied AbortSignal. Composes with the internal timeout —
83
- * whichever fires first wins. Lets callers cancel in-flight requests
84
- * (e.g. on component unmount or when superseding a stale solve).
85
- */
86
- signal?: AbortSignal;
87
- /**
88
- * Optional callback invoked with the server's per-request `Server-Timing`
89
- * breakdown when the response carries one (the `/grasshopper` solve endpoint
90
- * emits `decode;dur=N, solve;dur=N, encode;dur=N` on every response).
91
- *
92
- * Fires once per request, before the parsed body is returned — on success
93
- * and on the HTTP-500 partial-success path (a solve that completed with
94
- * Grasshopper errors still carries real timings, often the slowest ones).
95
- * The transport stays response-type-agnostic — this is a side
96
- * channel for telemetry, it does not change what a call returns. Use it to
97
- * feed a perf monitor or surface "solve took Nms" without server log access.
98
- *
99
- * `requestId` is the same id sent as the `X-Request-ID` header and used in
100
- * this library's own debug logs — use it to correlate a timing entry with
101
- * a specific request when multiple solves are in flight concurrently.
102
- */
103
- onServerTiming?: (timing: ServerTiming, requestId: string) => void;
104
- }
105
- /**
106
- * Parsed `Server-Timing` metrics from a Compute response. Durations are in
107
- * milliseconds. Any metric the server omits is `undefined`. `raw` is the
108
- * original header value, preserved so callers can read non-standard metrics.
109
- */
110
- interface ServerTiming {
111
- /** Time the server spent decoding the request (deserialize + load definition). */
112
- decode?: number;
113
- /** Time spent actually solving the Grasshopper definition. */
114
- solve?: number;
115
- /** Time spent encoding the response (serialize geometry). */
116
- encode?: number;
117
- /** The raw `Server-Timing` header value, e.g. `decode;dur=3, solve;dur=120, encode;dur=8`. */
118
- raw: string;
119
- }
120
-
121
- export type { ComputeConfig as C, RetryPolicy as R, ServerTiming as S, RhinoModelUnit as a };
@@ -1,2 +0,0 @@
1
- import{A as j,B as R,C as I,D,E as B,F as G,G as L,H as P,I as u,J as F,K as b,L as N,M as V,a as e,b as r,c as t,d as o,e as a,f as s,g as p,h as i,i as n,j as l,k as m,l as y,m as f,n as d,o as C,p as x,q as h,r as E,s as M,t as _,u as c,v as A,w as g,x as O,y as S,z as T}from"./chunk-ORGJSKR4.js";import"./chunk-54O6BO24.js";export{g as BINARY_MESH_MAGIC,S as BINARY_MESH_VERSION,O as COMPRESSED_MESH_MAGIC,n as EDGE_USERDATA_KIND,I as FLAG_DELTA_ENCODED,j as FLAG_FLOAT32,D as FLAG_HAS_UVS,B as FLAG_HAS_VERTEX_COLORS,R as FLAG_UINT16_INDICES,T as MIN_SUPPORTED_VERSION,e as Materials,N as SCALE_FACTORS,h as TEXTURE_CACHE_MAX_ENTRIES,L as UV_FORMAT_FLOAT32,G as UV_FORMAT_UINT16,l as addEdges,o as applyOffset,M as clearTextureCache,a as computeCombinedBoundingBox,s as createCameraController,p as createGrid,d as createLabelLayer,x as createMeasureTool,f as createRenderPipeline,i as createViewGizmo,V as getThreeMeshesFromComputeResponse,c as initThree,m as isEdgeOverlay,_ as materialAppearanceForStyle,P as parseBinaryMeshBatch,t as parseColor,A as parseDisplayItems,u as parseMeshBatch,b as parseMeshBatchBlob,F as parseMeshBatchObject,y as removeEdges,E as setTextureAnisotropy,C as snapToVertex,r as updateScene};
2
- //# sourceMappingURL=visualization-C3YOGQTW.js.map
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkEZRBMUXTcjs = require('./chunk-EZRBMUXT.cjs');require('./chunk-GF6ZIJWX.cjs');exports.BINARY_MESH_MAGIC = _chunkEZRBMUXTcjs.w; exports.BINARY_MESH_VERSION = _chunkEZRBMUXTcjs.y; exports.COMPRESSED_MESH_MAGIC = _chunkEZRBMUXTcjs.x; exports.EDGE_USERDATA_KIND = _chunkEZRBMUXTcjs.i; exports.FLAG_DELTA_ENCODED = _chunkEZRBMUXTcjs.C; exports.FLAG_FLOAT32 = _chunkEZRBMUXTcjs.A; exports.FLAG_HAS_UVS = _chunkEZRBMUXTcjs.D; exports.FLAG_HAS_VERTEX_COLORS = _chunkEZRBMUXTcjs.E; exports.FLAG_UINT16_INDICES = _chunkEZRBMUXTcjs.B; exports.MIN_SUPPORTED_VERSION = _chunkEZRBMUXTcjs.z; exports.Materials = _chunkEZRBMUXTcjs.a; exports.SCALE_FACTORS = _chunkEZRBMUXTcjs.L; exports.TEXTURE_CACHE_MAX_ENTRIES = _chunkEZRBMUXTcjs.q; exports.UV_FORMAT_FLOAT32 = _chunkEZRBMUXTcjs.G; exports.UV_FORMAT_UINT16 = _chunkEZRBMUXTcjs.F; exports.addEdges = _chunkEZRBMUXTcjs.j; exports.applyOffset = _chunkEZRBMUXTcjs.d; exports.clearTextureCache = _chunkEZRBMUXTcjs.s; exports.computeCombinedBoundingBox = _chunkEZRBMUXTcjs.e; exports.createCameraController = _chunkEZRBMUXTcjs.f; exports.createGrid = _chunkEZRBMUXTcjs.g; exports.createLabelLayer = _chunkEZRBMUXTcjs.n; exports.createMeasureTool = _chunkEZRBMUXTcjs.p; exports.createRenderPipeline = _chunkEZRBMUXTcjs.m; exports.createViewGizmo = _chunkEZRBMUXTcjs.h; exports.getThreeMeshesFromComputeResponse = _chunkEZRBMUXTcjs.M; exports.initThree = _chunkEZRBMUXTcjs.u; exports.isEdgeOverlay = _chunkEZRBMUXTcjs.k; exports.materialAppearanceForStyle = _chunkEZRBMUXTcjs.t; exports.parseBinaryMeshBatch = _chunkEZRBMUXTcjs.H; exports.parseColor = _chunkEZRBMUXTcjs.c; exports.parseDisplayItems = _chunkEZRBMUXTcjs.v; exports.parseMeshBatch = _chunkEZRBMUXTcjs.I; exports.parseMeshBatchBlob = _chunkEZRBMUXTcjs.K; exports.parseMeshBatchObject = _chunkEZRBMUXTcjs.J; exports.removeEdges = _chunkEZRBMUXTcjs.l; exports.setTextureAnisotropy = _chunkEZRBMUXTcjs.r; exports.snapToVertex = _chunkEZRBMUXTcjs.o; exports.updateScene = _chunkEZRBMUXTcjs.b;
2
- //# sourceMappingURL=visualization-CERJ6XDX.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/home/runner/work/selva-compute/selva-compute/dist/visualization-CERJ6XDX.cjs"],"names":[],"mappings":"AAAA,iIAA6S,gCAA6B,82DAAi4B","file":"/home/runner/work/selva-compute/selva-compute/dist/visualization-CERJ6XDX.cjs"}