@rulecad/cad 0.9.0 → 0.11.0
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/AGENTS.md +29 -10
- package/CHANGELOG.md +604 -0
- package/EXAMPLES.md +122 -105
- package/README.md +292 -63
- package/bin/cad.mjs +500 -87
- package/lib/assembly.mjs +486 -134
- package/lib/bays.mjs +124 -0
- package/lib/cache-file.mjs +148 -0
- package/lib/clone.mjs +93 -11
- package/lib/code-text.mjs +28 -0
- package/lib/design-imports.mjs +127 -0
- package/lib/design.mjs +291 -59
- package/lib/designshapes.mjs +142 -0
- package/lib/edit.mjs +29 -5
- package/lib/estimates.mjs +51 -0
- package/lib/fasten.mjs +11 -5
- package/lib/fe-key.mjs +29 -0
- package/lib/fittings.mjs +20 -15
- package/lib/fixings.mjs +17 -4
- package/lib/framebuild.mjs +73 -92
- package/lib/framecheck.mjs +154 -77
- package/lib/framegen.mjs +9 -1
- package/lib/frames.mjs +6 -2
- package/lib/framesize.mjs +45 -82
- package/lib/gait.mjs +17 -7
- package/lib/guides.mjs +84 -50
- package/lib/host.mjs +7 -3
- package/lib/kit.mjs +5 -5
- package/lib/list.mjs +29 -21
- package/lib/live-guard.mjs +18 -8
- package/lib/loads.mjs +35 -23
- package/lib/measured.mjs +740 -99
- package/lib/mesh.mjs +156 -56
- package/lib/motors.mjs +26 -33
- package/lib/names.mjs +15 -0
- package/lib/node-version.mjs +52 -0
- package/lib/optimise.mjs +34 -25
- package/lib/order.mjs +5 -12
- package/lib/parts.mjs +3 -0
- package/lib/picture-servers.mjs +66 -0
- package/lib/power.mjs +14 -7
- package/lib/preview.mjs +12 -25
- package/lib/programs.mjs +113 -0
- package/lib/rules.mjs +2 -1
- package/lib/sandbox-guard.mjs +43 -0
- package/lib/sandbox-hooks.mjs +109 -15
- package/lib/sandbox-lock.mjs +225 -0
- package/lib/sandbox-preload.mjs +2 -2
- package/lib/sandbox-run.mjs +22 -24
- package/lib/sandbox.mjs +345 -42
- package/lib/sheet.mjs +114 -3
- package/lib/targets/gist.mjs +9 -6
- package/lib/versions.mjs +294 -35
- package/lib/workspace.mjs +6 -3
- package/package.json +14 -14
- package/schemas/assembly.schema.json +6 -5
- package/schemas/object.schema.json +1 -1
- package/schemas/project.schema.json +6 -0
- package/templates/coupons/MEASURE.md +109 -0
- package/templates/coupons/assemblies/fixings-test.json +20 -0
- package/templates/coupons/assemblies/slot-test.json +11 -0
- package/templates/coupons/objects/fixings-coupon.js +88 -0
- package/templates/coupons/objects/fixings-coupon.json +26 -0
- package/templates/coupons/objects/holds-coupon.js +130 -0
- package/templates/coupons/objects/holds-coupon.json +42 -0
- package/templates/coupons/objects/slot-coupon.js +89 -0
- package/templates/coupons/objects/slot-coupon.json +29 -0
- package/templates/coupons/project.json +10 -0
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
// What the sandbox's runner (sandbox-run.mjs) shuts before the design loads, on top of the import hook
|
|
2
|
+
// (sandbox-hooks.mjs): the ways to Node's own modules, to the network and to files that don't go through an import.
|
|
3
|
+
// The hook keeps every import and require() to the design's own files and the allowed packages, and refuses a
|
|
4
|
+
// CommonJS file of the project outright; what is here holds whatever way the design finds round it.
|
|
5
|
+
// - The CommonJS loader (Module._load, which require(), module.require, createRequire and the loader's own functions
|
|
6
|
+
// all go through) gives no module of Node's that reaches the network, another program or a worker to anyone (the
|
|
7
|
+
// hook's QUIET list holds the rest), and refuses the rest to the design's code: to any call that comes from a file
|
|
8
|
+
// of its project, or from no file at all, by the call's own stack (no parent module it names is believed). No hook
|
|
9
|
+
// can be added past the sandbox's (module.register, module.registerHooks).
|
|
10
|
+
// - process loses its own ways to Node's modules and internals (getBuiltinModule, binding, dlopen), to other
|
|
11
|
+
// processes (kill, execve), and to files (loadEnvFile); and process.exit, the runner's, ends the process.
|
|
12
|
+
// - A pipe's stream (process.stdout, stderr, stdin) is a socket, and a socket's class connects anywhere (before Node
|
|
13
|
+
// 25, whose permission model shuts the network: no --allow-net). So the runner reads and writes its file
|
|
14
|
+
// descriptors itself, and process.stdout, stderr and stdin and the console are plain streams that pass on what is
|
|
15
|
+
// written. (Node 22.13 to 22.14 makes process.stdout itself for its hooks' worker, before the runner starts: the
|
|
16
|
+
// design is given the plain one all the same.)
|
|
17
|
+
// test/sandbox-loader.test.mjs tries each of these, and the other ways round, on the Node it runs on.
|
|
18
|
+
import Module, { isBuiltin } from 'node:module';
|
|
19
|
+
import fs from 'node:fs';
|
|
20
|
+
import path from 'node:path';
|
|
21
|
+
import { fileURLToPath } from 'node:url';
|
|
22
|
+
import { quiet } from './sandbox-hooks.mjs';
|
|
23
|
+
import { Writable } from 'node:stream';
|
|
24
|
+
import { Console } from 'node:console';
|
|
25
|
+
|
|
26
|
+
const deny = (what, why) => Object.assign(new Error(`designs can't ${what}: ${why}`), { code: 'design.sandbox' });
|
|
27
|
+
|
|
28
|
+
const shut = (o, k, value) => Object.defineProperty(o, k, { value, writable: false, configurable: false });
|
|
29
|
+
|
|
30
|
+
// The code that asks the CommonJS loader for a module: the first frame of the call's stack that is none of Node's own
|
|
31
|
+
// (node:…), by its file (a path, or a file: URL for an ES module), or null where it has none (code made by eval or
|
|
32
|
+
// new Function, or a call from no code at all: a callback queued straight onto the loader). Read with this module's
|
|
33
|
+
// own way of reading a stack, which Error.prepareStackTrace and Error itself are fixed to (lockStacks), and with the
|
|
34
|
+
// functions it calls taken before the design runs (a design may change String.prototype.startsWith for everyone;
|
|
35
|
+
// a stack frame's own functions can't be changed), so the code asking can't dress it up.
|
|
36
|
+
const call = Reflect.apply,
|
|
37
|
+
startsWith = String.prototype.startsWith,
|
|
38
|
+
isArray = Array.isArray,
|
|
39
|
+
isAbsolute = path.isAbsolute;
|
|
40
|
+
let reading = false;
|
|
41
|
+
const asker = () => {
|
|
42
|
+
const limit = Error.stackTraceLimit;
|
|
43
|
+
reading = true;
|
|
44
|
+
try {
|
|
45
|
+
Error.stackTraceLimit = 64;
|
|
46
|
+
const frames = /** @type {any} */ (new Error().stack);
|
|
47
|
+
if (!isArray(frames)) return null;
|
|
48
|
+
for (let i = 2; i < frames.length; i++) {
|
|
49
|
+
// (past asker itself and the loader's lock that called it)
|
|
50
|
+
const f = frames[i],
|
|
51
|
+
file = f.getFileName();
|
|
52
|
+
if (typeof file === 'string' && call(startsWith, file, ['node:'])) continue;
|
|
53
|
+
if (f.isEval() || typeof file !== 'string') return null;
|
|
54
|
+
return call(startsWith, file, ['file:']) || isAbsolute(file) ? file : null;
|
|
55
|
+
}
|
|
56
|
+
return null;
|
|
57
|
+
} catch {
|
|
58
|
+
return null;
|
|
59
|
+
} finally {
|
|
60
|
+
reading = false;
|
|
61
|
+
try {
|
|
62
|
+
Error.stackTraceLimit = limit;
|
|
63
|
+
} catch {
|
|
64
|
+
/* as it was */
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
// Error.prepareStackTrace as anyone may set it, but while asker reads a stack, when it is asker's; and Error itself,
|
|
69
|
+
// which Node reads prepareStackTrace from, kept as it is
|
|
70
|
+
function lockStacks() {
|
|
71
|
+
let theirs = Error.prepareStackTrace;
|
|
72
|
+
const ours = (e, frames) => frames;
|
|
73
|
+
Object.defineProperty(Error, 'prepareStackTrace', {
|
|
74
|
+
get: () => (reading ? ours : theirs),
|
|
75
|
+
set: (f) => {
|
|
76
|
+
theirs = f;
|
|
77
|
+
},
|
|
78
|
+
configurable: false,
|
|
79
|
+
});
|
|
80
|
+
shut(globalThis, 'Error', Error);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Shut the CommonJS loader to Node's own modules for the design's code, and take away the ways to add an import hook.
|
|
85
|
+
* Of Node's modules only the quiet ones (QUIET in sandbox-hooks.mjs: no network, programs or workers) are given at
|
|
86
|
+
* all, to anyone: the tool's packages still load those as they run (Manifold's loader asks for fs and path each time
|
|
87
|
+
* a lamina makes one), where the code asking is a file outside the design's project, and never to code with no file
|
|
88
|
+
* (eval, new Function, a callback queued onto the loader itself). That a call comes from the tool's code is read from
|
|
89
|
+
* its stack, which a design that has the loader to hand can still arrange (a tool's function it gives the loader to as
|
|
90
|
+
* a callback, a module it compiles under a tool's file name): so the quiet modules' reads rest on Node's permission
|
|
91
|
+
* model, which keeps them to the folders the sandbox may read, and the network on the list alone.
|
|
92
|
+
* @param {string} project the design's project, a file: URL ending in a slash
|
|
93
|
+
*/
|
|
94
|
+
export function shutLoader(project) {
|
|
95
|
+
lockStacks();
|
|
96
|
+
const load = Module._load,
|
|
97
|
+
// (the project as a file: URL and as a path, as a stack names an ES module's file and a CommonJS one's)
|
|
98
|
+
projectPath = project ? fileURLToPath(project) : '';
|
|
99
|
+
shut(Module, '_load', function _load(request, ...rest) {
|
|
100
|
+
if (typeof request !== 'string') throw deny('load that', 'a module is named by its name');
|
|
101
|
+
if (isBuiltin(request)) {
|
|
102
|
+
if (!quiet(request))
|
|
103
|
+
throw deny(
|
|
104
|
+
`load "${request}"`,
|
|
105
|
+
"in the sandbox none of Node's own modules that reach the network, other programs or workers is loaded",
|
|
106
|
+
);
|
|
107
|
+
const from = asker();
|
|
108
|
+
if (!from || !project || call(startsWith, from, [project]) || call(startsWith, from, [projectPath]))
|
|
109
|
+
throw deny(
|
|
110
|
+
`load "${request}"`,
|
|
111
|
+
"a design only makes shapes, and Node's own modules (files, network, programs) are not for it",
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
return call(load, this, [request, ...rest]);
|
|
115
|
+
});
|
|
116
|
+
for (const k of ['register', 'registerHooks', 'runMain', '_preloadModules', 'enableCompileCache'])
|
|
117
|
+
if (k in Module) shut(Module, k, undefined);
|
|
118
|
+
// and what import gives of node:module and node:process follows (it was taken when the runner first imported them)
|
|
119
|
+
Module.syncBuiltinESMExports();
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Take the place of Node's own web client's connection keeper before anything can make one. Node's fetch is undici,
|
|
124
|
+
* which Node loads the first time Headers, FormData, Request, Response, WebSocket, MessageEvent or CloseEvent is
|
|
125
|
+
* touched: it then keeps an agent on globalThis, under this name, that connects anywhere, through no module a design
|
|
126
|
+
* asks for. So the name is held first, for good, by one that refuses: undici keeps one it finds there.
|
|
127
|
+
*/
|
|
128
|
+
export function shutWebClient() {
|
|
129
|
+
const refuse = () => {
|
|
130
|
+
throw deny('reach the network', 'a design only makes shapes');
|
|
131
|
+
};
|
|
132
|
+
const none = Object.freeze({
|
|
133
|
+
dispatch: refuse,
|
|
134
|
+
close: refuse,
|
|
135
|
+
destroy: refuse,
|
|
136
|
+
on: refuse,
|
|
137
|
+
once: refuse,
|
|
138
|
+
emit: refuse,
|
|
139
|
+
removeListener: refuse,
|
|
140
|
+
});
|
|
141
|
+
Object.defineProperty(globalThis, Symbol.for('undici.globalDispatcher.1'), {
|
|
142
|
+
value: none,
|
|
143
|
+
writable: false,
|
|
144
|
+
configurable: false,
|
|
145
|
+
enumerable: false,
|
|
146
|
+
});
|
|
147
|
+
for (const k of ['FormData', 'Headers', 'MessageEvent', 'CloseEvent']) delete globalThis[k];
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/** Take away what process itself offers past the import hook: Node's modules and internals, programs, files. */
|
|
151
|
+
export function shutProcess() {
|
|
152
|
+
for (const k of [
|
|
153
|
+
'getBuiltinModule',
|
|
154
|
+
'binding',
|
|
155
|
+
'_linkedBinding',
|
|
156
|
+
'dlopen',
|
|
157
|
+
'kill',
|
|
158
|
+
'_kill',
|
|
159
|
+
'execve',
|
|
160
|
+
'loadEnvFile',
|
|
161
|
+
'openStdin',
|
|
162
|
+
'_getActiveHandles',
|
|
163
|
+
'_getActiveRequests',
|
|
164
|
+
'_debugProcess',
|
|
165
|
+
'_startProfilerIdleNotifier',
|
|
166
|
+
]) {
|
|
167
|
+
if (k in process) shut(process, k, undefined);
|
|
168
|
+
}
|
|
169
|
+
// and process.exit ends the process however the design changes process: it calls reallyExit, kept as it is
|
|
170
|
+
shut(process, 'reallyExit', process.reallyExit);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// A wait of a millisecond, where a write would block for long (a pipe Node has made non-blocking: older Node makes
|
|
174
|
+
// process.stdout and stderr sockets for its hooks' worker before the runner starts)
|
|
175
|
+
const pause = new Int32Array(new SharedArrayBuffer(4));
|
|
176
|
+
/**
|
|
177
|
+
* Write all of data to a file descriptor (1, stdout; 2, stderr) directly, through no stream: what the runner sends.
|
|
178
|
+
* @param {number} fd @param {string | Uint8Array} data
|
|
179
|
+
*/
|
|
180
|
+
export function writeAll(fd, data) {
|
|
181
|
+
const b = typeof data === 'string' ? Buffer.from(data) : data;
|
|
182
|
+
for (let n = 0, tries = 0; n < b.length;) {
|
|
183
|
+
try {
|
|
184
|
+
n += fs.writeSync(fd, b, n);
|
|
185
|
+
tries = 0;
|
|
186
|
+
} catch (e) {
|
|
187
|
+
if (e.code !== 'EAGAIN') throw e;
|
|
188
|
+
if (++tries > 1000) Atomics.wait(pause, 0, 0, 1); // (the pipe is full: try again at once, then wait a little)
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Put plain streams in the place of process.stdout, stderr and stdin and the console, before anything has asked for
|
|
195
|
+
* the real ones: a pipe's stream is a socket, whose class connects anywhere, so the runner never makes them, and
|
|
196
|
+
* writes to its file descriptors itself (writeAll). What a design writes to stdout or stderr goes on to the same.
|
|
197
|
+
*/
|
|
198
|
+
export function shutStreams() {
|
|
199
|
+
const passOn = (fd) =>
|
|
200
|
+
new Writable({
|
|
201
|
+
write(chunk, encoding, done) {
|
|
202
|
+
try {
|
|
203
|
+
writeAll(fd, typeof chunk === 'string' ? Buffer.from(chunk, encoding) : chunk);
|
|
204
|
+
done();
|
|
205
|
+
} catch (e) {
|
|
206
|
+
done(e);
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
});
|
|
210
|
+
const out = passOn(1),
|
|
211
|
+
err = passOn(2),
|
|
212
|
+
none = new Writable({ write: (c, e, done) => done() }); // (stdin: read already, nothing more comes)
|
|
213
|
+
for (const [k, s] of [
|
|
214
|
+
['stdout', out],
|
|
215
|
+
['stderr', err],
|
|
216
|
+
['stdin', none],
|
|
217
|
+
])
|
|
218
|
+
Object.defineProperty(process, k, { get: () => s, enumerable: true, configurable: false });
|
|
219
|
+
// what a design prints goes to stderr: stdout carries the reply
|
|
220
|
+
Object.defineProperty(globalThis, 'console', {
|
|
221
|
+
value: new Console({ stdout: err, stderr: err }),
|
|
222
|
+
writable: true,
|
|
223
|
+
configurable: true,
|
|
224
|
+
});
|
|
225
|
+
}
|
package/lib/sandbox-preload.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// Loaded first in the sandbox (node --import): the import hook that keeps designs to their own imports. In-thread
|
|
2
2
|
// (module.registerHooks) where Node has it; older Node runs hooks in a worker, which the sandbox then allows.
|
|
3
3
|
import * as mod from 'node:module';
|
|
4
|
-
import { resolveHook, initialize, homesOf } from './sandbox-hooks.mjs';
|
|
4
|
+
import { resolveHook, loadHook, initialize, homesOf } from './sandbox-hooks.mjs';
|
|
5
5
|
|
|
6
6
|
const project = process.env.CAD_SANDBOX_PROJECT;
|
|
7
7
|
if (mod.registerHooks) {
|
|
8
8
|
initialize({ project });
|
|
9
|
-
mod.registerHooks({ resolve: resolveHook });
|
|
9
|
+
mod.registerHooks({ resolve: resolveHook, load: loadHook });
|
|
10
10
|
} else mod.register('./sandbox-hooks.mjs', import.meta.url, { data: { project, homes: homesOf() } });
|
package/lib/sandbox-run.mjs
CHANGED
|
@@ -11,31 +11,21 @@ import * as gears from '@rulecad/gears';
|
|
|
11
11
|
import * as motors from '@rulecad/motors';
|
|
12
12
|
import { designFrames } from './frames.mjs';
|
|
13
13
|
import { designFixings } from './fixings.mjs';
|
|
14
|
+
import { designShapes } from './designshapes.mjs';
|
|
14
15
|
import { named, faces, unpack, watch } from './parts.mjs';
|
|
15
16
|
import { lineOf } from './errors.mjs';
|
|
16
17
|
import { keeper, STAGES_MOST, ROUTES_MOST } from './kept.mjs';
|
|
18
|
+
import { IMPORTED } from './sandbox-hooks.mjs';
|
|
19
|
+
import { shutLoader, shutProcess, shutStreams, shutWebClient, writeAll } from './sandbox-lock.mjs';
|
|
17
20
|
|
|
21
|
+
shutWebClient(); // (first: touching Headers and the like makes an agent that connects anywhere: sandbox-lock.mjs)
|
|
18
22
|
for (const k of ['fetch', 'WebSocket', 'EventSource', 'XMLHttpRequest', 'Request', 'Response']) delete globalThis[k];
|
|
19
23
|
// and the ways round the import hook that process itself offers: Node's own modules by name, its internals, other
|
|
20
|
-
// processes
|
|
24
|
+
// processes, files (sandbox-lock.mjs; sandbox.mjs's header says what this does and doesn't promise)
|
|
21
25
|
const exit = process.exit.bind(process);
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
'_linkedBinding',
|
|
26
|
-
'dlopen',
|
|
27
|
-
'kill',
|
|
28
|
-
'_kill',
|
|
29
|
-
'_getActiveHandles',
|
|
30
|
-
'_getActiveRequests',
|
|
31
|
-
'_debugProcess',
|
|
32
|
-
'_startProfilerIdleNotifier',
|
|
33
|
-
]) {
|
|
34
|
-
if (k in process) Object.defineProperty(process, k, { value: undefined, configurable: false, writable: false });
|
|
35
|
-
}
|
|
36
|
-
const chunks = [];
|
|
37
|
-
for await (const c of process.stdin) chunks.push(c);
|
|
38
|
-
const { js, values, meta, engine, optional, stages, bound, board } = JSON.parse(Buffer.concat(chunks).toString('utf8')),
|
|
26
|
+
shutProcess();
|
|
27
|
+
shutStreams(); // (the request is read, and the reply written, by file descriptor: sandbox-lock.mjs says why)
|
|
28
|
+
const { js, values, meta, engine, optional, stages, bound, board } = JSON.parse(fs.readFileSync(0, 'utf8')),
|
|
39
29
|
context = bound?.fixings;
|
|
40
30
|
// A lamina's slow stages: read from the tool's cache (the workspace is readable), and what this run makes handed back
|
|
41
31
|
// with the parts for the tool to write (this process can't), up to the cap the tool takes (kept.mjs: past it, a stage
|
|
@@ -95,20 +85,24 @@ const engineFor = () => ({
|
|
|
95
85
|
return pcb.mount(thread, x, y, { sets: context?.sets, ...o });
|
|
96
86
|
},
|
|
97
87
|
});
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
88
|
+
// stdout carries the result, so what a design prints (console.log, to see a value) goes to stderr (shutStreams), which
|
|
89
|
+
// the tool passes on
|
|
90
|
+
const done = (o) => {
|
|
91
|
+
writeAll(1, JSON.stringify(o));
|
|
92
|
+
exit(0);
|
|
93
|
+
};
|
|
102
94
|
try {
|
|
95
|
+
shutLoader(process.env.CAD_SANDBOX_PROJECT); // (the CommonJS loader: no design reaches Node's own modules by it)
|
|
103
96
|
const mod = await import(js);
|
|
104
97
|
if (typeof mod.main !== 'function')
|
|
105
98
|
throw Object.assign(new Error('the design has no exported main(v)'), { code: 'design.main' });
|
|
106
99
|
const ops = await shapes.ops(engine || 'jscad'),
|
|
107
|
-
df = designFixings({ ...(context || {}), ops })
|
|
100
|
+
df = designFixings({ ...(context || {}), ops }), // (v.fixings: bound to the project, as the build's own is)
|
|
101
|
+
ds = designShapes(shapes, { printer: context?.printer }); // (v.shapes: its seats said, as the build's own are)
|
|
108
102
|
const { v, read } = watch(
|
|
109
103
|
values,
|
|
110
104
|
{
|
|
111
|
-
shapes,
|
|
105
|
+
shapes: ds.shapes,
|
|
112
106
|
flexures,
|
|
113
107
|
gears,
|
|
114
108
|
motors,
|
|
@@ -120,10 +114,14 @@ try {
|
|
|
120
114
|
optional,
|
|
121
115
|
);
|
|
122
116
|
const { shapes: made, mechanism } = unpack(await mod.main(v));
|
|
117
|
+
// the files of its project the design imported, as the import hook saw them (after main: it may import as it runs)
|
|
118
|
+
const imports = (await import(IMPORTED)).default;
|
|
123
119
|
const found = {
|
|
124
120
|
read: [...read],
|
|
121
|
+
imports,
|
|
125
122
|
...(mechanism ? { mechanism } : {}),
|
|
126
123
|
...(df.used() ? { fixings: df.found() } : {}),
|
|
124
|
+
...(ds.used() ? { seats: ds.found() } : {}),
|
|
127
125
|
...(Object.keys(kept).length ? { stages: kept } : {}),
|
|
128
126
|
};
|
|
129
127
|
if (pcb) {
|