@vzn/vx 0.0.67 → 0.0.68
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vzn/vx",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.68",
|
|
4
4
|
"description": "An open, extensible monorepo task runner.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
"node": ">=18"
|
|
18
18
|
},
|
|
19
19
|
"optionalDependencies": {
|
|
20
|
-
"@vzn/vx-linux-x64": "0.0.
|
|
21
|
-
"@vzn/vx-linux-arm64": "0.0.
|
|
22
|
-
"@vzn/vx-darwin-x64": "0.0.
|
|
23
|
-
"@vzn/vx-darwin-arm64": "0.0.
|
|
20
|
+
"@vzn/vx-linux-x64": "0.0.68",
|
|
21
|
+
"@vzn/vx-linux-arm64": "0.0.68",
|
|
22
|
+
"@vzn/vx-darwin-x64": "0.0.68",
|
|
23
|
+
"@vzn/vx-darwin-arm64": "0.0.68"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@anthropic-ai/sandbox-runtime": "^0.0.76"
|
package/src/exec/executor.ts
CHANGED
|
@@ -190,7 +190,8 @@ export interface TaskExecutor {
|
|
|
190
190
|
/**
|
|
191
191
|
* How many tasks this executor runs at once. Its tasks then occupy a pool
|
|
192
192
|
* of this size instead of the local worker slots, so a remote pool is not
|
|
193
|
-
* throttled by the local CPU count.
|
|
193
|
+
* throttled by the local CPU count. A positive integer; anything else
|
|
194
|
+
* is refused when the executor is resolved. Absent = the local pool.
|
|
194
195
|
*/
|
|
195
196
|
readonly capacity?: number
|
|
196
197
|
/** Per-task opt-out at placement time. Absent = accepts every task it is offered. */
|
|
@@ -419,6 +419,13 @@ export async function resolveExecutors(
|
|
|
419
419
|
if (typeof executor.name !== 'string' || executor.name.length === 0) {
|
|
420
420
|
throw new UserError(`plugin '${plugin.name}' returned an executor with no name`)
|
|
421
421
|
}
|
|
422
|
+
// The pool's room is `active < capacity`: 0 or NaN parks its tasks for good.
|
|
423
|
+
const capacity: unknown = executor.capacity
|
|
424
|
+
if (capacity !== undefined && !(Number.isInteger(capacity) && (capacity as number) > 0)) {
|
|
425
|
+
throw new UserError(
|
|
426
|
+
`plugin '${plugin.name}' returned executor '${executor.name}' with capacity ${typeof capacity === 'number' ? String(capacity) : JSON.stringify(capacity)}: it must be a positive integer`,
|
|
427
|
+
)
|
|
428
|
+
}
|
|
422
429
|
executorPlugin.set(executor, plugin.name)
|
|
423
430
|
executors.push(executor)
|
|
424
431
|
}
|