mirror of
https://github.com/makecindy/cindy.git
synced 2026-12-02 05:39:29 +08:00
The host constructs the desktop's own GhostManager with owner-scoped roots instead of maintaining a second plugin registry, serves it at /api/ghosts, feeds the web client's synchronous list channel from a boot prefetch, and replays it for Electron client mode. Host suite: 43/43. Signed-off-by: CHEYAN <me@iamcheyan.com>
18 lines
580 B
JavaScript
18 lines
580 B
JavaScript
import { test } from 'node:test';
|
|
import assert from 'node:assert/strict';
|
|
import fs from 'node:fs';
|
|
import os from 'node:os';
|
|
import path from 'node:path';
|
|
|
|
import { listInstalledGhosts } from './plugins-installed.ts';
|
|
|
|
test('an owner without plugins lists nothing instead of failing', async () => {
|
|
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'host-ghosts-'));
|
|
try {
|
|
const ghosts = await listInstalledGhosts({ userDataDir: root, ownerId: 'owner-a' });
|
|
assert.deepEqual(ghosts, []);
|
|
} finally {
|
|
fs.rmSync(root, { recursive: true, force: true });
|
|
}
|
|
});
|