feat(companion): add runtime bootstrapNode helper

This commit is contained in:
William Valentin
2026-02-16 18:46:02 -08:00
parent 156f3e2498
commit 985b7bf459
5 changed files with 72 additions and 1 deletions
+30
View File
@@ -267,6 +267,36 @@ describe('CompanionRuntimeClient', () => {
}
});
it('bootstraps node registration and capabilities in one call', async () => {
if (!LISTEN_ALLOWED) {
return;
}
const client = new CompanionRuntimeClient({
url: `ws://127.0.0.1:${TEST_PORT}`,
token: TEST_TOKEN,
});
await client.connect();
try {
const boot = await client.bootstrapNode(
{
nodeId: 'bootstrap-runtime-node',
role: 'companion',
capabilities: ['ui.canvas'],
},
{ includeSystemCapabilities: true },
);
expect(boot.register.registered).toBe(true);
expect(boot.capabilities.node.id).toBe('bootstrap-runtime-node');
expect(boot.systemCapabilities?.nodes.enabled).toBe(true);
expect(boot.systemCapabilities?.nodes.registered).toBe(true);
} finally {
client.disconnect();
}
});
it('updates status/location/push and exposes them through system.nodes', async () => {
if (!LISTEN_ALLOWED) {
return;