@vzn/vx 0.0.65 → 0.0.66
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 +5 -5
- package/src/orchestrator/events.ts +4 -1
- package/src/orchestrator/plugin.ts +20 -14
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vzn/vx",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.66",
|
|
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.66",
|
|
21
|
+
"@vzn/vx-linux-arm64": "0.0.66",
|
|
22
|
+
"@vzn/vx-darwin-x64": "0.0.66",
|
|
23
|
+
"@vzn/vx-darwin-arm64": "0.0.66"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@anthropic-ai/sandbox-runtime": "^0.0.76"
|
|
@@ -68,7 +68,10 @@ export function createEventBus(): EventBus {
|
|
|
68
68
|
// as wrong output, not a silent hang.
|
|
69
69
|
for (const subscriber of subscribers) {
|
|
70
70
|
try {
|
|
71
|
-
subscriber
|
|
71
|
+
// A subscriber typed `void` may still be async: its rejection is
|
|
72
|
+
// isolated as its throw is.
|
|
73
|
+
const ret: unknown = subscriber(event)
|
|
74
|
+
if (ret instanceof Promise) ret.catch(() => {})
|
|
72
75
|
} catch {
|
|
73
76
|
// isolate: a surface fault can't propagate into the orchestrator
|
|
74
77
|
}
|
|
@@ -507,47 +507,53 @@ export async function installPlugins(args: InstallPluginsArgs): Promise<() => vo
|
|
|
507
507
|
},
|
|
508
508
|
},
|
|
509
509
|
on(hook, handler) {
|
|
510
|
+
const fail = (err: unknown): void => {
|
|
511
|
+
if (disabled.has(plugin.name)) return
|
|
512
|
+
disabled.add(plugin.name)
|
|
513
|
+
warn(
|
|
514
|
+
`[vx] plugin '${plugin.name}' threw in ${hook}; disabled for this run: ${err instanceof Error ? err.message : String(err)}`,
|
|
515
|
+
)
|
|
516
|
+
}
|
|
510
517
|
const dispose = bus.subscribe((event) => {
|
|
511
518
|
if (disabled.has(plugin.name)) return
|
|
512
|
-
//
|
|
513
|
-
//
|
|
514
|
-
|
|
519
|
+
// Not awaited: the bus is synchronous and plugin work runs off the
|
|
520
|
+
// critical path. A handler's rejection is caught like its throw.
|
|
521
|
+
let ret: unknown
|
|
515
522
|
try {
|
|
516
523
|
switch (hook) {
|
|
517
524
|
case 'onRunStart':
|
|
518
525
|
if (event.kind === 'run:start')
|
|
519
|
-
|
|
526
|
+
ret = (handler as PluginHookHandlers['onRunStart'])(event.info)
|
|
520
527
|
break
|
|
521
528
|
case 'onTaskStart':
|
|
522
529
|
if (event.kind === 'task:start')
|
|
523
|
-
|
|
530
|
+
ret = (handler as PluginHookHandlers['onTaskStart'])(event.node)
|
|
524
531
|
break
|
|
525
532
|
case 'onTaskStdout':
|
|
526
533
|
if (event.kind === 'task:stdout')
|
|
527
|
-
|
|
534
|
+
ret = (handler as PluginHookHandlers['onTaskStdout'])(event.node, event.chunk)
|
|
528
535
|
break
|
|
529
536
|
case 'onTaskStderr':
|
|
530
537
|
if (event.kind === 'task:stderr')
|
|
531
|
-
|
|
538
|
+
ret = (handler as PluginHookHandlers['onTaskStderr'])(event.node, event.chunk)
|
|
532
539
|
break
|
|
533
540
|
case 'onTaskComplete':
|
|
534
541
|
if (event.kind === 'task:complete')
|
|
535
|
-
|
|
542
|
+
ret = (handler as PluginHookHandlers['onTaskComplete'])(event.node, event.outcome)
|
|
536
543
|
break
|
|
537
544
|
case 'onRunStatus':
|
|
538
545
|
if (event.kind === 'run:status')
|
|
539
|
-
|
|
546
|
+
ret = (handler as PluginHookHandlers['onRunStatus'])(event.line)
|
|
540
547
|
break
|
|
541
548
|
case 'onRunEnd':
|
|
542
|
-
if (event.kind === 'run:end')
|
|
549
|
+
if (event.kind === 'run:end') ret = (handler as PluginHookHandlers['onRunEnd'])()
|
|
543
550
|
break
|
|
544
551
|
}
|
|
545
552
|
} catch (err) {
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
`[vx] plugin '${plugin.name}' threw in ${hook}; disabled for this run: ${err instanceof Error ? err.message : String(err)}`,
|
|
549
|
-
)
|
|
553
|
+
fail(err)
|
|
554
|
+
return
|
|
550
555
|
}
|
|
556
|
+
if (ret instanceof Promise) ret.catch(fail)
|
|
551
557
|
})
|
|
552
558
|
disposers.push(dispose)
|
|
553
559
|
},
|