@deepblend/dsh-blender-provider-local 0.2.7 → 0.2.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/lib/index.js
CHANGED
|
@@ -225,6 +225,28 @@ async function connect(socketPath, timeoutMs) {
|
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
227
|
|
|
228
|
+
/**
|
|
229
|
+
* The actions this provider can serve from a kept session, and the ONLY ones it can.
|
|
230
|
+
*
|
|
231
|
+
* DERIVED, NOT CHOSEN: these are exactly the actions whose calls go through `runBootstrap`, which is
|
|
232
|
+
* the one place the session path is decided. Everything else spawns its own process on purpose —
|
|
233
|
+
* `render_frames` most of all, because cancelling a render has to kill exactly that render, and a
|
|
234
|
+
* request inside a kept session cannot be killed without ending the session (and, attached, the
|
|
235
|
+
* user's own Blender).
|
|
236
|
+
*
|
|
237
|
+
* WHY THE LIST IS CHECKED RATHER THAN TRUSTED. MEASURED: naming `render_frames` in `sessionActions`
|
|
238
|
+
* used to do NOTHING AT ALL — the configuration was inert, the render ran in its own process as
|
|
239
|
+
* before, and nothing anywhere said so. A key that silently does nothing is worse than a key that
|
|
240
|
+
* fails: the operator believes they changed something. `contract/session-routing.test.mjs` derives
|
|
241
|
+
* this set from the source, so adding a `runBootstrap` call site without adding it here goes red.
|
|
242
|
+
*/
|
|
243
|
+
export const SESSION_ROUTABLE_ACTIONS = Object.freeze([
|
|
244
|
+
'get_capabilities',
|
|
245
|
+
'compile_scene',
|
|
246
|
+
'render_preview',
|
|
247
|
+
'render_views',
|
|
248
|
+
])
|
|
249
|
+
|
|
228
250
|
/**
|
|
229
251
|
* A live Blender, presented as one shape whatever carries the bytes.
|
|
230
252
|
*
|
|
@@ -574,6 +596,20 @@ export default class LocalBlenderRuntime extends Service {
|
|
|
574
596
|
// See the host's constructor: a key this row does not read is a startup error, because the schema
|
|
575
597
|
// accepts it silently (SPEC §17's nested groups versus this package's flat keys).
|
|
576
598
|
assertKnownConfigKeys(ProviderConfig, config, 'deepblend-blender-runtime')
|
|
599
|
+
// A CONFIGURED ACTION THAT CANNOT BE ROUTED IS REFUSED AT STARTUP, not ignored. Naming a render
|
|
600
|
+
// here would leave the operator believing their renders now run in their own Blender, while the
|
|
601
|
+
// render quietly kept its own process — the same shape as a key this row does not read, which the
|
|
602
|
+
// line above already refuses.
|
|
603
|
+
const unroutable = (config.sessionActions ?? []).filter(action => !SESSION_ROUTABLE_ACTIONS.includes(action))
|
|
604
|
+
if (unroutable.length > 0) {
|
|
605
|
+
throw new Error(
|
|
606
|
+
`sessionActions names ${unroutable.map(action => `"${action}"`).join(', ')}, and this provider can only ` +
|
|
607
|
+
`serve ${SESSION_ROUTABLE_ACTIONS.join(', ')} from a kept session. The renders that must be cancellable ` +
|
|
608
|
+
'(`render_frames`) spawn their own process on purpose: cancelling one kills exactly that render, and a ' +
|
|
609
|
+
'request inside a kept session cannot be killed without ending the session — which, attached, is the ' +
|
|
610
|
+
'user\'s own Blender.',
|
|
611
|
+
)
|
|
612
|
+
}
|
|
577
613
|
this.config = config
|
|
578
614
|
this.bootstrapPath = this._resolveBootstrapPath(config.bootstrapPath)
|
|
579
615
|
/** Resolved once: the host must be configured with the same value. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepblend/dsh-blender-provider-local",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Local Blender Provider: the BlenderRuntime Service over ctx.subprocess (batch execution).",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"./package.json": "./package.json"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@deepblend/dsh-blender-contracts": "0.2.
|
|
14
|
+
"@deepblend/dsh-blender-contracts": "0.2.8"
|
|
15
15
|
},
|
|
16
16
|
"license": "MIT",
|
|
17
17
|
"repository": {
|
|
Binary file
|